| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835 |
- (function polyfill() {
- const relList = document.createElement("link").relList;
- if (relList && relList.supports && relList.supports("modulepreload")) {
- return;
- }
- for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
- processPreload(link);
- }
- new MutationObserver((mutations) => {
- for (const mutation of mutations) {
- if (mutation.type !== "childList") {
- continue;
- }
- for (const node of mutation.addedNodes) {
- if (node.tagName === "LINK" && node.rel === "modulepreload")
- processPreload(node);
- }
- }
- }).observe(document, { childList: true, subtree: true });
- function getFetchOpts(link) {
- const fetchOpts = {};
- if (link.integrity)
- fetchOpts.integrity = link.integrity;
- if (link.referrerPolicy)
- fetchOpts.referrerPolicy = link.referrerPolicy;
- if (link.crossOrigin === "use-credentials")
- fetchOpts.credentials = "include";
- else if (link.crossOrigin === "anonymous")
- fetchOpts.credentials = "omit";
- else
- fetchOpts.credentials = "same-origin";
- return fetchOpts;
- }
- function processPreload(link) {
- if (link.ep)
- return;
- link.ep = true;
- const fetchOpts = getFetchOpts(link);
- fetch(link.href, fetchOpts);
- }
- })();
- /**
- * @vue/shared v3.5.4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function makeMap(str) {
- const map = /* @__PURE__ */ Object.create(null);
- for (const key of str.split(","))
- map[key] = 1;
- return (val) => val in map;
- }
- const EMPTY_OBJ = {};
- const EMPTY_ARR = [];
- const NOOP = () => {
- };
- const NO = () => false;
- const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
- (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
- const isModelListener = (key) => key.startsWith("onUpdate:");
- const extend = Object.assign;
- const remove = (arr, el) => {
- const i = arr.indexOf(el);
- if (i > -1) {
- arr.splice(i, 1);
- }
- };
- const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
- const isArray$1 = Array.isArray;
- const isMap = (val) => toTypeString(val) === "[object Map]";
- const isSet = (val) => toTypeString(val) === "[object Set]";
- const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
- const isFunction = (val) => typeof val === "function";
- const isString = (val) => typeof val === "string";
- const isSymbol = (val) => typeof val === "symbol";
- const isObject = (val) => val !== null && typeof val === "object";
- const isPromise = (val) => {
- return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
- };
- const objectToString = Object.prototype.toString;
- const toTypeString = (value) => objectToString.call(value);
- const toRawType = (value) => {
- return toTypeString(value).slice(8, -1);
- };
- const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
- const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
- const isReservedProp = /* @__PURE__ */ makeMap(
- // the leading comma is intentional so empty string "" is also included
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
- );
- const cacheStringFunction = (fn) => {
- const cache = /* @__PURE__ */ Object.create(null);
- return (str) => {
- const hit = cache[str];
- return hit || (cache[str] = fn(str));
- };
- };
- const camelizeRE = /-(\w)/g;
- const camelize = cacheStringFunction(
- (str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
- }
- );
- const hyphenateRE = /\B([A-Z])/g;
- const hyphenate = cacheStringFunction(
- (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
- );
- const capitalize = cacheStringFunction((str) => {
- return str.charAt(0).toUpperCase() + str.slice(1);
- });
- const toHandlerKey = cacheStringFunction(
- (str) => {
- const s = str ? `on${capitalize(str)}` : ``;
- return s;
- }
- );
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
- const invokeArrayFns = (fns, ...arg) => {
- for (let i = 0; i < fns.length; i++) {
- fns[i](...arg);
- }
- };
- const def = (obj, key, value, writable = false) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- writable,
- value
- });
- };
- const looseToNumber = (val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
- };
- const toNumber = (val) => {
- const n = isString(val) ? Number(val) : NaN;
- return isNaN(n) ? val : n;
- };
- let _globalThis;
- const getGlobalThis = () => {
- return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
- };
- function normalizeStyle(value) {
- if (isArray$1(value)) {
- const res = {};
- for (let i = 0; i < value.length; i++) {
- const item = value[i];
- const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
- }
- }
- }
- return res;
- } else if (isString(value) || isObject(value)) {
- return value;
- }
- }
- const listDelimiterRE = /;(?![^(]*\))/g;
- const propertyDelimiterRE = /:([^]+)/;
- const styleCommentRE = /\/\*[^]*?\*\//g;
- function parseStringStyle(cssText) {
- const ret = {};
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
- if (item) {
- const tmp = item.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
- });
- return ret;
- }
- function normalizeClass(value) {
- let res = "";
- if (isString(value)) {
- res = value;
- } else if (isArray$1(value)) {
- for (let i = 0; i < value.length; i++) {
- const normalized = normalizeClass(value[i]);
- if (normalized) {
- res += normalized + " ";
- }
- }
- } else if (isObject(value)) {
- for (const name in value) {
- if (value[name]) {
- res += name + " ";
- }
- }
- }
- return res.trim();
- }
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
- const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
- function includeBooleanAttr(value) {
- return !!value || value === "";
- }
- const isRef$1 = (val) => {
- return !!(val && val["__v_isRef"] === true);
- };
- const toDisplayString = (val) => {
- return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
- };
- const replacer = (_key, val) => {
- if (isRef$1(val)) {
- return replacer(_key, val.value);
- } else if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce(
- (entries, [key, val2], i) => {
- entries[stringifySymbol(key, i) + " =>"] = val2;
- return entries;
- },
- {}
- )
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
- };
- } else if (isSymbol(val)) {
- return stringifySymbol(val);
- } else if (isObject(val) && !isArray$1(val) && !isPlainObject$1(val)) {
- return String(val);
- }
- return val;
- };
- const stringifySymbol = (v, i = "") => {
- var _a;
- return (
- // Symbol.description in es2019+ so we need to cast here to pass
- // the lib: es2016 check
- isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
- );
- };
- /**
- * @vue/reactivity v3.5.4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/
- let activeEffectScope;
- class EffectScope {
- constructor(detached = false) {
- this.detached = detached;
- this._active = true;
- this.effects = [];
- this.cleanups = [];
- this._isPaused = false;
- this.parent = activeEffectScope;
- if (!detached && activeEffectScope) {
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
- this
- ) - 1;
- }
- }
- get active() {
- return this._active;
- }
- pause() {
- if (this._active) {
- this._isPaused = true;
- let i, l;
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].pause();
- }
- }
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].pause();
- }
- }
- }
- /**
- * Resumes the effect scope, including all child scopes and effects.
- */
- resume() {
- if (this._active) {
- if (this._isPaused) {
- this._isPaused = false;
- let i, l;
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].resume();
- }
- }
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].resume();
- }
- }
- }
- }
- run(fn) {
- if (this._active) {
- const currentEffectScope = activeEffectScope;
- try {
- activeEffectScope = this;
- return fn();
- } finally {
- activeEffectScope = currentEffectScope;
- }
- }
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- on() {
- activeEffectScope = this;
- }
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- off() {
- activeEffectScope = this.parent;
- }
- stop(fromParent) {
- if (this._active) {
- let i, l;
- for (i = 0, l = this.effects.length; i < l; i++) {
- this.effects[i].stop();
- }
- for (i = 0, l = this.cleanups.length; i < l; i++) {
- this.cleanups[i]();
- }
- if (this.scopes) {
- for (i = 0, l = this.scopes.length; i < l; i++) {
- this.scopes[i].stop(true);
- }
- }
- if (!this.detached && this.parent && !fromParent) {
- const last = this.parent.scopes.pop();
- if (last && last !== this) {
- this.parent.scopes[this.index] = last;
- last.index = this.index;
- }
- }
- this.parent = void 0;
- this._active = false;
- }
- }
- }
- function effectScope(detached) {
- return new EffectScope(detached);
- }
- function getCurrentScope() {
- return activeEffectScope;
- }
- function onScopeDispose(fn, failSilently = false) {
- if (activeEffectScope) {
- activeEffectScope.cleanups.push(fn);
- }
- }
- let activeSub;
- const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
- class ReactiveEffect {
- constructor(fn) {
- this.fn = fn;
- this.deps = void 0;
- this.depsTail = void 0;
- this.flags = 1 | 4;
- this.nextEffect = void 0;
- this.cleanup = void 0;
- this.scheduler = void 0;
- if (activeEffectScope && activeEffectScope.active) {
- activeEffectScope.effects.push(this);
- }
- }
- pause() {
- this.flags |= 64;
- }
- resume() {
- if (this.flags & 64) {
- this.flags &= ~64;
- if (pausedQueueEffects.has(this)) {
- pausedQueueEffects.delete(this);
- this.trigger();
- }
- }
- }
- /**
- * @internal
- */
- notify() {
- if (this.flags & 2 && !(this.flags & 32)) {
- return;
- }
- if (!(this.flags & 8)) {
- this.flags |= 8;
- this.nextEffect = batchedEffect;
- batchedEffect = this;
- }
- }
- run() {
- if (!(this.flags & 1)) {
- return this.fn();
- }
- this.flags |= 2;
- cleanupEffect(this);
- prepareDeps(this);
- const prevEffect = activeSub;
- const prevShouldTrack = shouldTrack;
- activeSub = this;
- shouldTrack = true;
- try {
- return this.fn();
- } finally {
- cleanupDeps(this);
- activeSub = prevEffect;
- shouldTrack = prevShouldTrack;
- this.flags &= ~2;
- }
- }
- stop() {
- if (this.flags & 1) {
- for (let link = this.deps; link; link = link.nextDep) {
- removeSub(link);
- }
- this.deps = this.depsTail = void 0;
- cleanupEffect(this);
- this.onStop && this.onStop();
- this.flags &= ~1;
- }
- }
- trigger() {
- if (this.flags & 64) {
- pausedQueueEffects.add(this);
- } else if (this.scheduler) {
- this.scheduler();
- } else {
- this.runIfDirty();
- }
- }
- /**
- * @internal
- */
- runIfDirty() {
- if (isDirty(this)) {
- this.run();
- }
- }
- get dirty() {
- return isDirty(this);
- }
- }
- let batchDepth = 0;
- let batchedEffect;
- function startBatch() {
- batchDepth++;
- }
- function endBatch() {
- if (--batchDepth > 0) {
- return;
- }
- let error;
- while (batchedEffect) {
- let e = batchedEffect;
- batchedEffect = void 0;
- while (e) {
- const next = e.nextEffect;
- e.nextEffect = void 0;
- e.flags &= ~8;
- if (e.flags & 1) {
- try {
- e.trigger();
- } catch (err) {
- if (!error)
- error = err;
- }
- }
- e = next;
- }
- }
- if (error)
- throw error;
- }
- function prepareDeps(sub) {
- for (let link = sub.deps; link; link = link.nextDep) {
- link.version = -1;
- link.prevActiveLink = link.dep.activeLink;
- link.dep.activeLink = link;
- }
- }
- function cleanupDeps(sub) {
- let head;
- let tail = sub.depsTail;
- for (let link = tail; link; link = link.prevDep) {
- if (link.version === -1) {
- if (link === tail)
- tail = link.prevDep;
- removeSub(link);
- removeDep(link);
- } else {
- head = link;
- }
- link.dep.activeLink = link.prevActiveLink;
- link.prevActiveLink = void 0;
- }
- sub.deps = head;
- sub.depsTail = tail;
- }
- function isDirty(sub) {
- for (let link = sub.deps; link; link = link.nextDep) {
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
- return true;
- }
- }
- if (sub._dirty) {
- return true;
- }
- return false;
- }
- function refreshComputed(computed2) {
- if (computed2.flags & 4 && !(computed2.flags & 16)) {
- return;
- }
- computed2.flags &= ~16;
- if (computed2.globalVersion === globalVersion) {
- return;
- }
- computed2.globalVersion = globalVersion;
- const dep = computed2.dep;
- computed2.flags |= 2;
- if (dep.version > 0 && !computed2.isSSR && !isDirty(computed2)) {
- computed2.flags &= ~2;
- return;
- }
- const prevSub = activeSub;
- const prevShouldTrack = shouldTrack;
- activeSub = computed2;
- shouldTrack = true;
- try {
- prepareDeps(computed2);
- const value = computed2.fn(computed2._value);
- if (dep.version === 0 || hasChanged(value, computed2._value)) {
- computed2._value = value;
- dep.version++;
- }
- } catch (err) {
- dep.version++;
- throw err;
- } finally {
- activeSub = prevSub;
- shouldTrack = prevShouldTrack;
- cleanupDeps(computed2);
- computed2.flags &= ~2;
- }
- }
- function removeSub(link) {
- const { dep, prevSub, nextSub } = link;
- if (prevSub) {
- prevSub.nextSub = nextSub;
- link.prevSub = void 0;
- }
- if (nextSub) {
- nextSub.prevSub = prevSub;
- link.nextSub = void 0;
- }
- if (dep.subs === link) {
- dep.subs = prevSub;
- }
- if (!dep.subs && dep.computed) {
- dep.computed.flags &= ~4;
- for (let l = dep.computed.deps; l; l = l.nextDep) {
- removeSub(l);
- }
- }
- }
- function removeDep(link) {
- const { prevDep, nextDep } = link;
- if (prevDep) {
- prevDep.nextDep = nextDep;
- link.prevDep = void 0;
- }
- if (nextDep) {
- nextDep.prevDep = prevDep;
- link.nextDep = void 0;
- }
- }
- let shouldTrack = true;
- const trackStack = [];
- function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
- }
- function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
- }
- function cleanupEffect(e) {
- const { cleanup } = e;
- e.cleanup = void 0;
- if (cleanup) {
- const prevSub = activeSub;
- activeSub = void 0;
- try {
- cleanup();
- } finally {
- activeSub = prevSub;
- }
- }
- }
- let globalVersion = 0;
- class Dep {
- constructor(computed2) {
- this.computed = computed2;
- this.version = 0;
- this.activeLink = void 0;
- this.subs = void 0;
- }
- track(debugInfo) {
- if (!activeSub || !shouldTrack || activeSub === this.computed) {
- return;
- }
- let link = this.activeLink;
- if (link === void 0 || link.sub !== activeSub) {
- link = this.activeLink = {
- dep: this,
- sub: activeSub,
- version: this.version,
- nextDep: void 0,
- prevDep: void 0,
- nextSub: void 0,
- prevSub: void 0,
- prevActiveLink: void 0
- };
- if (!activeSub.deps) {
- activeSub.deps = activeSub.depsTail = link;
- } else {
- link.prevDep = activeSub.depsTail;
- activeSub.depsTail.nextDep = link;
- activeSub.depsTail = link;
- }
- if (activeSub.flags & 4) {
- addSub(link);
- }
- } else if (link.version === -1) {
- link.version = this.version;
- if (link.nextDep) {
- const next = link.nextDep;
- next.prevDep = link.prevDep;
- if (link.prevDep) {
- link.prevDep.nextDep = next;
- }
- link.prevDep = activeSub.depsTail;
- link.nextDep = void 0;
- activeSub.depsTail.nextDep = link;
- activeSub.depsTail = link;
- if (activeSub.deps === link) {
- activeSub.deps = next;
- }
- }
- }
- return link;
- }
- trigger(debugInfo) {
- this.version++;
- globalVersion++;
- this.notify(debugInfo);
- }
- notify(debugInfo) {
- startBatch();
- try {
- if (false)
- ;
- for (let link = this.subs; link; link = link.prevSub) {
- link.sub.notify();
- }
- } finally {
- endBatch();
- }
- }
- }
- function addSub(link) {
- const computed2 = link.dep.computed;
- if (computed2 && !link.dep.subs) {
- computed2.flags |= 4 | 16;
- for (let l = computed2.deps; l; l = l.nextDep) {
- addSub(l);
- }
- }
- const currentTail = link.dep.subs;
- if (currentTail !== link) {
- link.prevSub = currentTail;
- if (currentTail)
- currentTail.nextSub = link;
- }
- link.dep.subs = link;
- }
- const targetMap = /* @__PURE__ */ new WeakMap();
- const ITERATE_KEY = Symbol(
- ""
- );
- const MAP_KEY_ITERATE_KEY = Symbol(
- ""
- );
- const ARRAY_ITERATE_KEY = Symbol(
- ""
- );
- function track(target, type, key) {
- if (shouldTrack && activeSub) {
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = new Dep());
- }
- {
- dep.track();
- }
- }
- }
- function trigger(target, type, key, newValue, oldValue, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
- globalVersion++;
- return;
- }
- const run = (dep) => {
- if (dep) {
- {
- dep.trigger();
- }
- }
- };
- startBatch();
- if (type === "clear") {
- depsMap.forEach(run);
- } else {
- const targetIsArray = isArray$1(target);
- const isArrayIndex = targetIsArray && isIntegerKey(key);
- if (targetIsArray && key === "length") {
- const newLength = Number(newValue);
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
- run(dep);
- }
- });
- } else {
- if (key !== void 0) {
- run(depsMap.get(key));
- }
- if (isArrayIndex) {
- run(depsMap.get(ARRAY_ITERATE_KEY));
- }
- switch (type) {
- case "add":
- if (!targetIsArray) {
- run(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- run(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- } else if (isArrayIndex) {
- run(depsMap.get("length"));
- }
- break;
- case "delete":
- if (!targetIsArray) {
- run(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- run(depsMap.get(MAP_KEY_ITERATE_KEY));
- }
- }
- break;
- case "set":
- if (isMap(target)) {
- run(depsMap.get(ITERATE_KEY));
- }
- break;
- }
- }
- }
- endBatch();
- }
- function getDepFromReactive(object, key) {
- var _a;
- return (_a = targetMap.get(object)) == null ? void 0 : _a.get(key);
- }
- function reactiveReadArray(array) {
- const raw = toRaw(array);
- if (raw === array)
- return raw;
- track(raw, "iterate", ARRAY_ITERATE_KEY);
- return isShallow(array) ? raw : raw.map(toReactive);
- }
- function shallowReadArray(arr) {
- track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
- return arr;
- }
- const arrayInstrumentations = {
- __proto__: null,
- [Symbol.iterator]() {
- return iterator(this, Symbol.iterator, toReactive);
- },
- concat(...args) {
- return reactiveReadArray(this).concat(
- ...args.map((x) => isArray$1(x) ? reactiveReadArray(x) : x)
- );
- },
- entries() {
- return iterator(this, "entries", (value) => {
- value[1] = toReactive(value[1]);
- return value;
- });
- },
- every(fn, thisArg) {
- return apply(this, "every", fn, thisArg, void 0, arguments);
- },
- filter(fn, thisArg) {
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
- },
- find(fn, thisArg) {
- return apply(this, "find", fn, thisArg, toReactive, arguments);
- },
- findIndex(fn, thisArg) {
- return apply(this, "findIndex", fn, thisArg, void 0, arguments);
- },
- findLast(fn, thisArg) {
- return apply(this, "findLast", fn, thisArg, toReactive, arguments);
- },
- findLastIndex(fn, thisArg) {
- return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
- },
- // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
- forEach(fn, thisArg) {
- return apply(this, "forEach", fn, thisArg, void 0, arguments);
- },
- includes(...args) {
- return searchProxy(this, "includes", args);
- },
- indexOf(...args) {
- return searchProxy(this, "indexOf", args);
- },
- join(separator) {
- return reactiveReadArray(this).join(separator);
- },
- // keys() iterator only reads `length`, no optimisation required
- lastIndexOf(...args) {
- return searchProxy(this, "lastIndexOf", args);
- },
- map(fn, thisArg) {
- return apply(this, "map", fn, thisArg, void 0, arguments);
- },
- pop() {
- return noTracking(this, "pop");
- },
- push(...args) {
- return noTracking(this, "push", args);
- },
- reduce(fn, ...args) {
- return reduce(this, "reduce", fn, args);
- },
- reduceRight(fn, ...args) {
- return reduce(this, "reduceRight", fn, args);
- },
- shift() {
- return noTracking(this, "shift");
- },
- // slice could use ARRAY_ITERATE but also seems to beg for range tracking
- some(fn, thisArg) {
- return apply(this, "some", fn, thisArg, void 0, arguments);
- },
- splice(...args) {
- return noTracking(this, "splice", args);
- },
- toReversed() {
- return reactiveReadArray(this).toReversed();
- },
- toSorted(comparer) {
- return reactiveReadArray(this).toSorted(comparer);
- },
- toSpliced(...args) {
- return reactiveReadArray(this).toSpliced(...args);
- },
- unshift(...args) {
- return noTracking(this, "unshift", args);
- },
- values() {
- return iterator(this, "values", toReactive);
- }
- };
- function iterator(self2, method, wrapValue) {
- const arr = shallowReadArray(self2);
- const iter = arr[method]();
- if (arr !== self2 && !isShallow(self2)) {
- iter._next = iter.next;
- iter.next = () => {
- const result = iter._next();
- if (result.value) {
- result.value = wrapValue(result.value);
- }
- return result;
- };
- }
- return iter;
- }
- const arrayProto = Array.prototype;
- function apply(self2, method, fn, thisArg, wrappedRetFn, args) {
- const arr = shallowReadArray(self2);
- const needsWrap = arr !== self2 && !isShallow(self2);
- const methodFn = arr[method];
- if (methodFn !== arrayProto[method]) {
- const result2 = methodFn.apply(self2, args);
- return needsWrap ? toReactive(result2) : result2;
- }
- let wrappedFn = fn;
- if (arr !== self2) {
- if (needsWrap) {
- wrappedFn = function(item, index2) {
- return fn.call(this, toReactive(item), index2, self2);
- };
- } else if (fn.length > 2) {
- wrappedFn = function(item, index2) {
- return fn.call(this, item, index2, self2);
- };
- }
- }
- const result = methodFn.call(arr, wrappedFn, thisArg);
- return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
- }
- function reduce(self2, method, fn, args) {
- const arr = shallowReadArray(self2);
- let wrappedFn = fn;
- if (arr !== self2) {
- if (!isShallow(self2)) {
- wrappedFn = function(acc, item, index2) {
- return fn.call(this, acc, toReactive(item), index2, self2);
- };
- } else if (fn.length > 3) {
- wrappedFn = function(acc, item, index2) {
- return fn.call(this, acc, item, index2, self2);
- };
- }
- }
- return arr[method](wrappedFn, ...args);
- }
- function searchProxy(self2, method, args) {
- const arr = toRaw(self2);
- track(arr, "iterate", ARRAY_ITERATE_KEY);
- const res = arr[method](...args);
- if ((res === -1 || res === false) && isProxy(args[0])) {
- args[0] = toRaw(args[0]);
- return arr[method](...args);
- }
- return res;
- }
- function noTracking(self2, method, args = []) {
- pauseTracking();
- startBatch();
- const res = toRaw(self2)[method].apply(self2, args);
- endBatch();
- resetTracking();
- return res;
- }
- const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
- const builtInSymbols = new Set(
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
- );
- function hasOwnProperty(key) {
- if (!isSymbol(key))
- key = String(key);
- const obj = toRaw(this);
- track(obj, "has", key);
- return obj.hasOwnProperty(key);
- }
- class BaseReactiveHandler {
- constructor(_isReadonly = false, _isShallow = false) {
- this._isReadonly = _isReadonly;
- this._isShallow = _isShallow;
- }
- get(target, key, receiver) {
- const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_isShallow") {
- return isShallow2;
- } else if (key === "__v_raw") {
- if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
- // this means the receiver is a user proxy of the reactive proxy
- Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
- return target;
- }
- return;
- }
- const targetIsArray = isArray$1(target);
- if (!isReadonly2) {
- let fn;
- if (targetIsArray && (fn = arrayInstrumentations[key])) {
- return fn;
- }
- if (key === "hasOwnProperty") {
- return hasOwnProperty;
- }
- }
- const res = Reflect.get(
- target,
- key,
- // if this is a proxy wrapping a ref, return methods using the raw ref
- // as receiver so that we don't have to call `toRaw` on the ref in all
- // its class methods
- isRef(target) ? target : receiver
- );
- if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (isShallow2) {
- return res;
- }
- if (isRef(res)) {
- return targetIsArray && isIntegerKey(key) ? res : res.value;
- }
- if (isObject(res)) {
- return isReadonly2 ? readonly(res) : reactive(res);
- }
- return res;
- }
- }
- class MutableReactiveHandler extends BaseReactiveHandler {
- constructor(isShallow2 = false) {
- super(false, isShallow2);
- }
- set(target, key, value, receiver) {
- let oldValue = target[key];
- if (!this._isShallow) {
- const isOldValueReadonly = isReadonly(oldValue);
- if (!isShallow(value) && !isReadonly(value)) {
- oldValue = toRaw(oldValue);
- value = toRaw(value);
- }
- if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) {
- if (isOldValueReadonly) {
- return false;
- } else {
- oldValue.value = value;
- return true;
- }
- }
- }
- const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
- const result = Reflect.set(
- target,
- key,
- value,
- isRef(target) ? target : receiver
- );
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value);
- }
- }
- return result;
- }
- deleteProperty(target, key) {
- const hadKey = hasOwn(target, key);
- target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0);
- }
- return result;
- }
- has(target, key) {
- const result = Reflect.has(target, key);
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
- }
- return result;
- }
- ownKeys(target) {
- track(
- target,
- "iterate",
- isArray$1(target) ? "length" : ITERATE_KEY
- );
- return Reflect.ownKeys(target);
- }
- }
- class ReadonlyReactiveHandler extends BaseReactiveHandler {
- constructor(isShallow2 = false) {
- super(true, isShallow2);
- }
- set(target, key) {
- return true;
- }
- deleteProperty(target, key) {
- return true;
- }
- }
- const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
- const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
- const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
- const toShallow = (value) => value;
- const getProto = (v) => Reflect.getPrototypeOf(v);
- function get(target, key, isReadonly2 = false, isShallow2 = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "get", key);
- }
- track(rawTarget, "get", rawKey);
- }
- const { has: has2 } = getProto(rawTarget);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- if (has2.call(rawTarget, key)) {
- return wrap(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
- }
- }
- function has(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "has", key);
- }
- track(rawTarget, "has", rawKey);
- }
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
- }
- function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
- }
- function add(value, _isShallow = false) {
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
- value = toRaw(value);
- }
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value);
- if (!hadKey) {
- target.add(value);
- trigger(target, "add", value, value);
- }
- return this;
- }
- function set(key, value, _isShallow = false) {
- if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
- value = toRaw(value);
- }
- const target = toRaw(this);
- const { has: has2, get: get2 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- }
- const oldValue = get2.call(target, key);
- target.set(key, value);
- if (!hadKey) {
- trigger(target, "add", key, value);
- } else if (hasChanged(value, oldValue)) {
- trigger(target, "set", key, value);
- }
- return this;
- }
- function deleteEntry(key) {
- const target = toRaw(this);
- const { has: has2, get: get2 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- }
- get2 ? get2.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0);
- }
- return result;
- }
- function clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0);
- }
- return result;
- }
- function createForEach(isReadonly2, isShallow2) {
- return function forEach(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw(target);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value, key) => {
- return callback.call(thisArg, wrap(value), wrap(key), observed);
- });
- };
- }
- function createIterableMethod(method, isReadonly2, isShallow2) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
- !isReadonly2 && track(
- rawTarget,
- "iterate",
- isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
- );
- return {
- // iterator protocol
- next() {
- const { value, done } = innerIterator.next();
- return done ? { value, done } : {
- value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
- done
- };
- },
- // iterable protocol
- [Symbol.iterator]() {
- return this;
- }
- };
- };
- }
- function createReadonlyMethod(type) {
- return function(...args) {
- return type === "delete" ? false : type === "clear" ? void 0 : this;
- };
- }
- function createInstrumentations() {
- const mutableInstrumentations2 = {
- get(key) {
- return get(this, key);
- },
- get size() {
- return size(this);
- },
- has,
- add,
- set,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- const shallowInstrumentations2 = {
- get(key) {
- return get(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has,
- add(value) {
- return add.call(this, value, true);
- },
- set(key, value) {
- return set.call(this, key, value, true);
- },
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- const readonlyInstrumentations2 = {
- get(key) {
- return get(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- const shallowReadonlyInstrumentations2 = {
- get(key) {
- return get(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- const iteratorMethods = [
- "keys",
- "values",
- "entries",
- Symbol.iterator
- ];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
- method,
- true,
- true
- );
- });
- return [
- mutableInstrumentations2,
- readonlyInstrumentations2,
- shallowInstrumentations2,
- shallowReadonlyInstrumentations2
- ];
- }
- const [
- mutableInstrumentations,
- readonlyInstrumentations,
- shallowInstrumentations,
- shallowReadonlyInstrumentations
- ] = /* @__PURE__ */ createInstrumentations();
- function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(
- hasOwn(instrumentations, key) && key in target ? instrumentations : target,
- key,
- receiver
- );
- };
- }
- const mutableCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, false)
- };
- const shallowCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, true)
- };
- const readonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, false)
- };
- const shallowReadonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, true)
- };
- const reactiveMap = /* @__PURE__ */ new WeakMap();
- const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
- const readonlyMap = /* @__PURE__ */ new WeakMap();
- const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
- function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
- }
- }
- function getTargetType(value) {
- return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
- }
- function reactive(target) {
- if (isReadonly(target)) {
- return target;
- }
- return createReactiveObject(
- target,
- false,
- mutableHandlers,
- mutableCollectionHandlers,
- reactiveMap
- );
- }
- function shallowReactive(target) {
- return createReactiveObject(
- target,
- false,
- shallowReactiveHandlers,
- shallowCollectionHandlers,
- shallowReactiveMap
- );
- }
- function readonly(target) {
- return createReactiveObject(
- target,
- true,
- readonlyHandlers,
- readonlyCollectionHandlers,
- readonlyMap
- );
- }
- function shallowReadonly(target) {
- return createReactiveObject(
- target,
- true,
- shallowReadonlyHandlers,
- shallowReadonlyCollectionHandlers,
- shallowReadonlyMap
- );
- }
- function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject(target)) {
- return target;
- }
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
- }
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
- }
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
- }
- const proxy = new Proxy(
- target,
- targetType === 2 ? collectionHandlers : baseHandlers
- );
- proxyMap.set(target, proxy);
- return proxy;
- }
- function isReactive(value) {
- if (isReadonly(value)) {
- return isReactive(value["__v_raw"]);
- }
- return !!(value && value["__v_isReactive"]);
- }
- function isReadonly(value) {
- return !!(value && value["__v_isReadonly"]);
- }
- function isShallow(value) {
- return !!(value && value["__v_isShallow"]);
- }
- function isProxy(value) {
- return value ? !!value["__v_raw"] : false;
- }
- function toRaw(observed) {
- const raw = observed && observed["__v_raw"];
- return raw ? toRaw(raw) : observed;
- }
- function markRaw(value) {
- if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
- def(value, "__v_skip", true);
- }
- return value;
- }
- const toReactive = (value) => isObject(value) ? reactive(value) : value;
- const toReadonly = (value) => isObject(value) ? readonly(value) : value;
- function isRef(r) {
- return r ? r["__v_isRef"] === true : false;
- }
- function ref(value) {
- return createRef(value, false);
- }
- function shallowRef(value) {
- return createRef(value, true);
- }
- function createRef(rawValue, shallow) {
- if (isRef(rawValue)) {
- return rawValue;
- }
- return new RefImpl(rawValue, shallow);
- }
- class RefImpl {
- constructor(value, isShallow2) {
- this.dep = new Dep();
- this["__v_isRef"] = true;
- this["__v_isShallow"] = false;
- this._rawValue = isShallow2 ? value : toRaw(value);
- this._value = isShallow2 ? value : toReactive(value);
- this["__v_isShallow"] = isShallow2;
- }
- get value() {
- {
- this.dep.track();
- }
- return this._value;
- }
- set value(newValue) {
- const oldValue = this._rawValue;
- const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
- newValue = useDirectValue ? newValue : toRaw(newValue);
- if (hasChanged(newValue, oldValue)) {
- this._rawValue = newValue;
- this._value = useDirectValue ? newValue : toReactive(newValue);
- {
- this.dep.trigger();
- }
- }
- }
- }
- function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
- }
- const shallowUnwrapHandlers = {
- get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
- set: (target, key, value, receiver) => {
- const oldValue = target[key];
- if (isRef(oldValue) && !isRef(value)) {
- oldValue.value = value;
- return true;
- } else {
- return Reflect.set(target, key, value, receiver);
- }
- }
- };
- function proxyRefs(objectWithRefs) {
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
- }
- function toRefs(object) {
- const ret = isArray$1(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = propertyToRef(object, key);
- }
- return ret;
- }
- class ObjectRefImpl {
- constructor(_object, _key, _defaultValue) {
- this._object = _object;
- this._key = _key;
- this._defaultValue = _defaultValue;
- this["__v_isRef"] = true;
- this._value = void 0;
- }
- get value() {
- const val = this._object[this._key];
- return this._value = val === void 0 ? this._defaultValue : val;
- }
- set value(newVal) {
- this._object[this._key] = newVal;
- }
- get dep() {
- return getDepFromReactive(toRaw(this._object), this._key);
- }
- }
- function propertyToRef(source, key, defaultValue) {
- const val = source[key];
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
- }
- class ComputedRefImpl {
- constructor(fn, setter, isSSR) {
- this.fn = fn;
- this.setter = setter;
- this._value = void 0;
- this.dep = new Dep(this);
- this.__v_isRef = true;
- this.deps = void 0;
- this.depsTail = void 0;
- this.flags = 16;
- this.globalVersion = globalVersion - 1;
- this.effect = this;
- this["__v_isReadonly"] = !setter;
- this.isSSR = isSSR;
- }
- /**
- * @internal
- */
- notify() {
- this.flags |= 16;
- if (activeSub !== this) {
- this.dep.notify();
- }
- }
- get value() {
- const link = this.dep.track();
- refreshComputed(this);
- if (link) {
- link.version = this.dep.version;
- }
- return this._value;
- }
- set value(newValue) {
- if (this.setter) {
- this.setter(newValue);
- }
- }
- }
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
- let getter;
- let setter;
- if (isFunction(getterOrOptions)) {
- getter = getterOrOptions;
- } else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- const cRef = new ComputedRefImpl(getter, setter, isSSR);
- return cRef;
- }
- const INITIAL_WATCHER_VALUE = {};
- const cleanupMap = /* @__PURE__ */ new WeakMap();
- let activeWatcher = void 0;
- function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
- if (owner) {
- let cleanups = cleanupMap.get(owner);
- if (!cleanups)
- cleanupMap.set(owner, cleanups = []);
- cleanups.push(cleanupFn);
- }
- }
- function watch$1(source, cb, options = EMPTY_OBJ) {
- const { immediate, deep, once, scheduler, augmentJob, call } = options;
- const reactiveGetter = (source2) => {
- if (deep)
- return source2;
- if (isShallow(source2) || deep === false || deep === 0)
- return traverse(source2, 1);
- return traverse(source2);
- };
- let effect;
- let getter;
- let cleanup;
- let boundCleanup;
- let forceTrigger = false;
- let isMultiSource = false;
- if (isRef(source)) {
- getter = () => source.value;
- forceTrigger = isShallow(source);
- } else if (isReactive(source)) {
- getter = () => reactiveGetter(source);
- forceTrigger = true;
- } else if (isArray$1(source)) {
- isMultiSource = true;
- forceTrigger = source.some((s) => isReactive(s) || isShallow(s));
- getter = () => source.map((s) => {
- if (isRef(s)) {
- return s.value;
- } else if (isReactive(s)) {
- return reactiveGetter(s);
- } else if (isFunction(s)) {
- return call ? call(s, 2) : s();
- } else
- ;
- });
- } else if (isFunction(source)) {
- if (cb) {
- getter = call ? () => call(source, 2) : source;
- } else {
- getter = () => {
- if (cleanup) {
- pauseTracking();
- try {
- cleanup();
- } finally {
- resetTracking();
- }
- }
- const currentEffect = activeWatcher;
- activeWatcher = effect;
- try {
- return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
- } finally {
- activeWatcher = currentEffect;
- }
- };
- }
- } else {
- getter = NOOP;
- }
- if (cb && deep) {
- const baseGetter = getter;
- const depth = deep === true ? Infinity : deep;
- getter = () => traverse(baseGetter(), depth);
- }
- const scope = getCurrentScope();
- const watchHandle = () => {
- effect.stop();
- if (scope) {
- remove(scope.effects, effect);
- }
- };
- if (once) {
- if (cb) {
- const _cb = cb;
- cb = (...args) => {
- _cb(...args);
- watchHandle();
- };
- } else {
- const _getter = getter;
- getter = () => {
- _getter();
- watchHandle();
- };
- }
- }
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
- const job = (immediateFirstRun) => {
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
- return;
- }
- if (cb) {
- const newValue = effect.run();
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
- if (cleanup) {
- cleanup();
- }
- const currentWatcher = activeWatcher;
- activeWatcher = effect;
- try {
- const args = [
- newValue,
- // pass undefined as the old value when it's changed for the first time
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
- boundCleanup
- ];
- call ? call(cb, 3, args) : (
- // @ts-expect-error
- cb(...args)
- );
- oldValue = newValue;
- } finally {
- activeWatcher = currentWatcher;
- }
- }
- } else {
- effect.run();
- }
- };
- if (augmentJob) {
- augmentJob(job);
- }
- effect = new ReactiveEffect(getter);
- effect.scheduler = scheduler ? () => scheduler(job, false) : job;
- boundCleanup = (fn) => onWatcherCleanup(fn, false, effect);
- cleanup = effect.onStop = () => {
- const cleanups = cleanupMap.get(effect);
- if (cleanups) {
- if (call) {
- call(cleanups, 4);
- } else {
- for (const cleanup2 of cleanups)
- cleanup2();
- }
- cleanupMap.delete(effect);
- }
- };
- if (cb) {
- if (immediate) {
- job(true);
- } else {
- oldValue = effect.run();
- }
- } else if (scheduler) {
- scheduler(job.bind(null, true), true);
- } else {
- effect.run();
- }
- watchHandle.pause = effect.pause.bind(effect);
- watchHandle.resume = effect.resume.bind(effect);
- watchHandle.stop = watchHandle;
- return watchHandle;
- }
- function traverse(value, depth = Infinity, seen2) {
- if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
- return value;
- }
- seen2 = seen2 || /* @__PURE__ */ new Set();
- if (seen2.has(value)) {
- return value;
- }
- seen2.add(value);
- depth--;
- if (isRef(value)) {
- traverse(value.value, depth, seen2);
- } else if (isArray$1(value)) {
- for (let i = 0; i < value.length; i++) {
- traverse(value[i], depth, seen2);
- }
- } else if (isSet(value) || isMap(value)) {
- value.forEach((v) => {
- traverse(v, depth, seen2);
- });
- } else if (isPlainObject$1(value)) {
- for (const key in value) {
- traverse(value[key], depth, seen2);
- }
- for (const key of Object.getOwnPropertySymbols(value)) {
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
- traverse(value[key], depth, seen2);
- }
- }
- }
- return value;
- }
- /**
- * @vue/runtime-core v3.5.4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/
- const stack = [];
- let isWarning = false;
- function warn$1(msg, ...args) {
- if (isWarning)
- return;
- isWarning = true;
- pauseTracking();
- const instance = stack.length ? stack[stack.length - 1].component : null;
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
- const trace = getComponentTrace();
- if (appWarnHandler) {
- callWithErrorHandling(
- appWarnHandler,
- instance,
- 11,
- [
- // eslint-disable-next-line no-restricted-syntax
- msg + args.map((a) => {
- var _a, _b;
- return (_b = (_a = a.toString) == null ? void 0 : _a.call(a)) != null ? _b : JSON.stringify(a);
- }).join(""),
- instance && instance.proxy,
- trace.map(
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
- ).join("\n"),
- trace
- ]
- );
- } else {
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
- if (trace.length && // avoid spamming console during tests
- true) {
- warnArgs.push(`
- `, ...formatTrace(trace));
- }
- console.warn(...warnArgs);
- }
- resetTracking();
- isWarning = false;
- }
- function getComponentTrace() {
- let currentVNode = stack[stack.length - 1];
- if (!currentVNode) {
- return [];
- }
- const normalizedStack = [];
- while (currentVNode) {
- const last = normalizedStack[0];
- if (last && last.vnode === currentVNode) {
- last.recurseCount++;
- } else {
- normalizedStack.push({
- vnode: currentVNode,
- recurseCount: 0
- });
- }
- const parentInstance = currentVNode.component && currentVNode.component.parent;
- currentVNode = parentInstance && parentInstance.vnode;
- }
- return normalizedStack;
- }
- function formatTrace(trace) {
- const logs = [];
- trace.forEach((entry, i) => {
- logs.push(...i === 0 ? [] : [`
- `], ...formatTraceEntry(entry));
- });
- return logs;
- }
- function formatTraceEntry({ vnode, recurseCount }) {
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
- const isRoot = vnode.component ? vnode.component.parent == null : false;
- const open = ` at <${formatComponentName(
- vnode.component,
- vnode.type,
- isRoot
- )}`;
- const close = `>` + postfix;
- return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
- }
- function formatProps(props) {
- const res = [];
- const keys = Object.keys(props);
- keys.slice(0, 3).forEach((key) => {
- res.push(...formatProp(key, props[key]));
- });
- if (keys.length > 3) {
- res.push(` ...`);
- }
- return res;
- }
- function formatProp(key, value, raw) {
- if (isString(value)) {
- value = JSON.stringify(value);
- return raw ? value : [`${key}=${value}`];
- } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
- return raw ? value : [`${key}=${value}`];
- } else if (isRef(value)) {
- value = formatProp(key, toRaw(value.value), true);
- return raw ? value : [`${key}=Ref<`, value, `>`];
- } else if (isFunction(value)) {
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
- } else {
- value = toRaw(value);
- return raw ? value : [`${key}=`, value];
- }
- }
- function callWithErrorHandling(fn, instance, type, args) {
- try {
- return args ? fn(...args) : fn();
- } catch (err) {
- handleError(err, instance, type);
- }
- }
- function callWithAsyncErrorHandling(fn, instance, type, args) {
- if (isFunction(fn)) {
- const res = callWithErrorHandling(fn, instance, type, args);
- if (res && isPromise(res)) {
- res.catch((err) => {
- handleError(err, instance, type);
- });
- }
- return res;
- }
- if (isArray$1(fn)) {
- const values = [];
- for (let i = 0; i < fn.length; i++) {
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
- }
- return values;
- }
- }
- function handleError(err, instance, type, throwInDev = true) {
- const contextVNode = instance ? instance.vnode : null;
- const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
- if (instance) {
- let cur = instance.parent;
- const exposedInstance = instance.proxy;
- const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
- while (cur) {
- const errorCapturedHooks = cur.ec;
- if (errorCapturedHooks) {
- for (let i = 0; i < errorCapturedHooks.length; i++) {
- if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
- return;
- }
- }
- }
- cur = cur.parent;
- }
- if (errorHandler) {
- pauseTracking();
- callWithErrorHandling(errorHandler, null, 10, [
- err,
- exposedInstance,
- errorInfo
- ]);
- resetTracking();
- return;
- }
- }
- logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
- }
- function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) {
- if (throwInProd) {
- throw err;
- } else {
- console.error(err);
- }
- }
- let isFlushing = false;
- let isFlushPending = false;
- const queue = [];
- let flushIndex = 0;
- const pendingPostFlushCbs = [];
- let activePostFlushCbs = null;
- let postFlushIndex = 0;
- const resolvedPromise = /* @__PURE__ */ Promise.resolve();
- let currentFlushPromise = null;
- function nextTick(fn) {
- const p2 = currentFlushPromise || resolvedPromise;
- return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
- }
- function findInsertionIndex$1(id) {
- let start = isFlushing ? flushIndex + 1 : 0;
- let end = queue.length;
- while (start < end) {
- const middle = start + end >>> 1;
- const middleJob = queue[middle];
- const middleJobId = getId(middleJob);
- if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
- start = middle + 1;
- } else {
- end = middle;
- }
- }
- return start;
- }
- function queueJob(job) {
- if (!(job.flags & 1)) {
- const jobId = getId(job);
- const lastJob = queue[queue.length - 1];
- if (!lastJob || // fast path when the job id is larger than the tail
- !(job.flags & 2) && jobId >= getId(lastJob)) {
- queue.push(job);
- } else {
- queue.splice(findInsertionIndex$1(jobId), 0, job);
- }
- job.flags |= 1;
- queueFlush();
- }
- }
- function queueFlush() {
- if (!isFlushing && !isFlushPending) {
- isFlushPending = true;
- currentFlushPromise = resolvedPromise.then(flushJobs);
- }
- }
- function queuePostFlushCb(cb) {
- if (!isArray$1(cb)) {
- if (activePostFlushCbs && cb.id === -1) {
- activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
- } else if (!(cb.flags & 1)) {
- pendingPostFlushCbs.push(cb);
- cb.flags |= 1;
- }
- } else {
- pendingPostFlushCbs.push(...cb);
- }
- queueFlush();
- }
- function flushPreFlushCbs(instance, seen2, i = isFlushing ? flushIndex + 1 : 0) {
- for (; i < queue.length; i++) {
- const cb = queue[i];
- if (cb && cb.flags & 2) {
- if (instance && cb.id !== instance.uid) {
- continue;
- }
- queue.splice(i, 1);
- i--;
- if (cb.flags & 4) {
- cb.flags &= ~1;
- }
- cb();
- cb.flags &= ~1;
- }
- }
- }
- function flushPostFlushCbs(seen2) {
- if (pendingPostFlushCbs.length) {
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
- (a, b) => getId(a) - getId(b)
- );
- pendingPostFlushCbs.length = 0;
- if (activePostFlushCbs) {
- activePostFlushCbs.push(...deduped);
- return;
- }
- activePostFlushCbs = deduped;
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
- const cb = activePostFlushCbs[postFlushIndex];
- if (cb.flags & 4) {
- cb.flags &= ~1;
- }
- if (!(cb.flags & 8))
- cb();
- cb.flags &= ~1;
- }
- activePostFlushCbs = null;
- postFlushIndex = 0;
- }
- }
- const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
- function flushJobs(seen2) {
- isFlushPending = false;
- isFlushing = true;
- const check = NOOP;
- try {
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job && !(job.flags & 8)) {
- if (false)
- ;
- if (job.flags & 4) {
- job.flags &= ~1;
- }
- callWithErrorHandling(
- job,
- job.i,
- job.i ? 15 : 14
- );
- job.flags &= ~1;
- }
- }
- } finally {
- for (; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job) {
- job.flags &= ~1;
- }
- }
- flushIndex = 0;
- queue.length = 0;
- flushPostFlushCbs();
- isFlushing = false;
- currentFlushPromise = null;
- if (queue.length || pendingPostFlushCbs.length) {
- flushJobs();
- }
- }
- }
- let currentRenderingInstance = null;
- let currentScopeId = null;
- function setCurrentRenderingInstance(instance) {
- const prev = currentRenderingInstance;
- currentRenderingInstance = instance;
- currentScopeId = instance && instance.type.__scopeId || null;
- return prev;
- }
- function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
- if (!ctx)
- return fn;
- if (fn._n) {
- return fn;
- }
- const renderFnWithContext = (...args) => {
- if (renderFnWithContext._d) {
- setBlockTracking(-1);
- }
- const prevInstance = setCurrentRenderingInstance(ctx);
- let res;
- try {
- res = fn(...args);
- } finally {
- setCurrentRenderingInstance(prevInstance);
- if (renderFnWithContext._d) {
- setBlockTracking(1);
- }
- }
- return res;
- };
- renderFnWithContext._n = true;
- renderFnWithContext._c = true;
- renderFnWithContext._d = true;
- return renderFnWithContext;
- }
- function withDirectives(vnode, directives) {
- if (currentRenderingInstance === null) {
- return vnode;
- }
- const instance = getComponentPublicInstance(currentRenderingInstance);
- const bindings = vnode.dirs || (vnode.dirs = []);
- for (let i = 0; i < directives.length; i++) {
- let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
- if (dir) {
- if (isFunction(dir)) {
- dir = {
- mounted: dir,
- updated: dir
- };
- }
- if (dir.deep) {
- traverse(value);
- }
- bindings.push({
- dir,
- instance,
- value,
- oldValue: void 0,
- arg,
- modifiers
- });
- }
- }
- return vnode;
- }
- function invokeDirectiveHook(vnode, prevVNode, instance, name) {
- const bindings = vnode.dirs;
- const oldBindings = prevVNode && prevVNode.dirs;
- for (let i = 0; i < bindings.length; i++) {
- const binding = bindings[i];
- if (oldBindings) {
- binding.oldValue = oldBindings[i].value;
- }
- let hook = binding.dir[name];
- if (hook) {
- pauseTracking();
- callWithAsyncErrorHandling(hook, instance, 8, [
- vnode.el,
- binding,
- vnode,
- prevVNode
- ]);
- resetTracking();
- }
- }
- }
- const TeleportEndKey = Symbol("_vte");
- const isTeleport = (type) => type.__isTeleport;
- const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
- const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
- const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
- const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
- const resolveTarget = (props, select) => {
- const targetSelector = props && props.to;
- if (isString(targetSelector)) {
- if (!select) {
- return null;
- } else {
- const target = select(targetSelector);
- return target;
- }
- } else {
- return targetSelector;
- }
- };
- const TeleportImpl = {
- name: "Teleport",
- __isTeleport: true,
- process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
- const {
- mc: mountChildren,
- pc: patchChildren,
- pbc: patchBlockChildren,
- o: { insert, querySelector, createText, createComment }
- } = internals;
- const disabled = isTeleportDisabled(n2.props);
- let { shapeFlag, children, dynamicChildren } = n2;
- if (n1 == null) {
- const placeholder = n2.el = createText("");
- const mainAnchor = n2.anchor = createText("");
- insert(placeholder, container, anchor);
- insert(mainAnchor, container, anchor);
- const mount = (container2, anchor2) => {
- if (shapeFlag & 16) {
- mountChildren(
- children,
- container2,
- anchor2,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const mountToTarget = () => {
- const target = n2.target = resolveTarget(n2.props, querySelector);
- const targetAnchor = prepareAnchor(target, n2, createText, insert);
- if (target) {
- if (namespace !== "svg" && isTargetSVG(target)) {
- namespace = "svg";
- } else if (namespace !== "mathml" && isTargetMathML(target)) {
- namespace = "mathml";
- }
- if (!disabled) {
- mount(target, targetAnchor);
- updateCssVars(n2);
- }
- }
- };
- if (disabled) {
- mount(container, mainAnchor);
- updateCssVars(n2);
- }
- if (isTeleportDeferred(n2.props)) {
- queuePostRenderEffect(mountToTarget, parentSuspense);
- } else {
- mountToTarget();
- }
- } else {
- n2.el = n1.el;
- n2.targetStart = n1.targetStart;
- const mainAnchor = n2.anchor = n1.anchor;
- const target = n2.target = n1.target;
- const targetAnchor = n2.targetAnchor = n1.targetAnchor;
- const wasDisabled = isTeleportDisabled(n1.props);
- const currentContainer = wasDisabled ? container : target;
- const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
- if (namespace === "svg" || isTargetSVG(target)) {
- namespace = "svg";
- } else if (namespace === "mathml" || isTargetMathML(target)) {
- namespace = "mathml";
- }
- if (dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- currentContainer,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds
- );
- traverseStaticChildren(n1, n2, true);
- } else if (!optimized) {
- patchChildren(
- n1,
- n2,
- currentContainer,
- currentAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- false
- );
- }
- if (disabled) {
- if (!wasDisabled) {
- moveTeleport(
- n2,
- container,
- mainAnchor,
- internals,
- 1
- );
- } else {
- if (n2.props && n1.props && n2.props.to !== n1.props.to) {
- n2.props.to = n1.props.to;
- }
- }
- } else {
- if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
- const nextTarget = n2.target = resolveTarget(
- n2.props,
- querySelector
- );
- if (nextTarget) {
- moveTeleport(
- n2,
- nextTarget,
- null,
- internals,
- 0
- );
- }
- } else if (wasDisabled) {
- moveTeleport(
- n2,
- target,
- targetAnchor,
- internals,
- 1
- );
- }
- }
- updateCssVars(n2);
- }
- },
- remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
- const {
- shapeFlag,
- children,
- anchor,
- targetStart,
- targetAnchor,
- target,
- props
- } = vnode;
- if (target) {
- hostRemove(targetStart);
- hostRemove(targetAnchor);
- }
- doRemove && hostRemove(anchor);
- if (shapeFlag & 16) {
- const shouldRemove = doRemove || !isTeleportDisabled(props);
- for (let i = 0; i < children.length; i++) {
- const child = children[i];
- unmount(
- child,
- parentComponent,
- parentSuspense,
- shouldRemove,
- !!child.dynamicChildren
- );
- }
- }
- },
- move: moveTeleport,
- hydrate: hydrateTeleport
- };
- function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
- if (moveType === 0) {
- insert(vnode.targetAnchor, container, parentAnchor);
- }
- const { el, anchor, shapeFlag, children, props } = vnode;
- const isReorder = moveType === 2;
- if (isReorder) {
- insert(el, container, parentAnchor);
- }
- if (!isReorder || isTeleportDisabled(props)) {
- if (shapeFlag & 16) {
- for (let i = 0; i < children.length; i++) {
- move(
- children[i],
- container,
- parentAnchor,
- 2
- );
- }
- }
- }
- if (isReorder) {
- insert(anchor, container, parentAnchor);
- }
- }
- function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
- o: { nextSibling, parentNode, querySelector, insert, createText }
- }, hydrateChildren) {
- const target = vnode.target = resolveTarget(
- vnode.props,
- querySelector
- );
- if (target) {
- const targetNode = target._lpa || target.firstChild;
- if (vnode.shapeFlag & 16) {
- if (isTeleportDisabled(vnode.props)) {
- vnode.anchor = hydrateChildren(
- nextSibling(node),
- vnode,
- parentNode(node),
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- vnode.targetStart = targetNode;
- vnode.targetAnchor = targetNode && nextSibling(targetNode);
- } else {
- vnode.anchor = nextSibling(node);
- let targetAnchor = targetNode;
- while (targetAnchor) {
- if (targetAnchor && targetAnchor.nodeType === 8) {
- if (targetAnchor.data === "teleport start anchor") {
- vnode.targetStart = targetAnchor;
- } else if (targetAnchor.data === "teleport anchor") {
- vnode.targetAnchor = targetAnchor;
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
- break;
- }
- }
- targetAnchor = nextSibling(targetAnchor);
- }
- if (!vnode.targetAnchor) {
- prepareAnchor(target, vnode, createText, insert);
- }
- hydrateChildren(
- targetNode && nextSibling(targetNode),
- vnode,
- target,
- parentComponent,
- parentSuspense,
- slotScopeIds,
- optimized
- );
- }
- }
- updateCssVars(vnode);
- }
- return vnode.anchor && nextSibling(vnode.anchor);
- }
- const Teleport = TeleportImpl;
- function updateCssVars(vnode) {
- const ctx = vnode.ctx;
- if (ctx && ctx.ut) {
- let node = vnode.targetStart;
- while (node && node !== vnode.targetAnchor) {
- if (node.nodeType === 1)
- node.setAttribute("data-v-owner", ctx.uid);
- node = node.nextSibling;
- }
- ctx.ut();
- }
- }
- function prepareAnchor(target, vnode, createText, insert) {
- const targetStart = vnode.targetStart = createText("");
- const targetAnchor = vnode.targetAnchor = createText("");
- targetStart[TeleportEndKey] = targetAnchor;
- if (target) {
- insert(targetStart, target);
- insert(targetAnchor, target);
- }
- return targetAnchor;
- }
- const leaveCbKey = Symbol("_leaveCb");
- const enterCbKey = Symbol("_enterCb");
- function useTransitionState() {
- const state = {
- isMounted: false,
- isLeaving: false,
- isUnmounting: false,
- leavingVNodes: /* @__PURE__ */ new Map()
- };
- onMounted(() => {
- state.isMounted = true;
- });
- onBeforeUnmount(() => {
- state.isUnmounting = true;
- });
- return state;
- }
- const TransitionHookValidator = [Function, Array];
- const BaseTransitionPropsValidators = {
- mode: String,
- appear: Boolean,
- persisted: Boolean,
- // enter
- onBeforeEnter: TransitionHookValidator,
- onEnter: TransitionHookValidator,
- onAfterEnter: TransitionHookValidator,
- onEnterCancelled: TransitionHookValidator,
- // leave
- onBeforeLeave: TransitionHookValidator,
- onLeave: TransitionHookValidator,
- onAfterLeave: TransitionHookValidator,
- onLeaveCancelled: TransitionHookValidator,
- // appear
- onBeforeAppear: TransitionHookValidator,
- onAppear: TransitionHookValidator,
- onAfterAppear: TransitionHookValidator,
- onAppearCancelled: TransitionHookValidator
- };
- const recursiveGetSubtree = (instance) => {
- const subTree = instance.subTree;
- return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
- };
- const BaseTransitionImpl = {
- name: `BaseTransition`,
- props: BaseTransitionPropsValidators,
- setup(props, { slots }) {
- const instance = getCurrentInstance();
- const state = useTransitionState();
- return () => {
- const children = slots.default && getTransitionRawChildren(slots.default(), true);
- if (!children || !children.length) {
- return;
- }
- const child = findNonCommentChild(children);
- const rawProps = toRaw(props);
- const { mode } = rawProps;
- if (state.isLeaving) {
- return emptyPlaceholder(child);
- }
- const innerChild = getInnerChild$1(child);
- if (!innerChild) {
- return emptyPlaceholder(child);
- }
- let enterHooks = resolveTransitionHooks(
- innerChild,
- rawProps,
- state,
- instance,
- // #11061, ensure enterHooks is fresh after clone
- (hooks) => enterHooks = hooks
- );
- if (innerChild.type !== Comment) {
- setTransitionHooks(innerChild, enterHooks);
- }
- const oldChild = instance.subTree;
- const oldInnerChild = oldChild && getInnerChild$1(oldChild);
- if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
- const leavingHooks = resolveTransitionHooks(
- oldInnerChild,
- rawProps,
- state,
- instance
- );
- setTransitionHooks(oldInnerChild, leavingHooks);
- if (mode === "out-in" && innerChild.type !== Comment) {
- state.isLeaving = true;
- leavingHooks.afterLeave = () => {
- state.isLeaving = false;
- if (!(instance.job.flags & 8)) {
- instance.update();
- }
- delete leavingHooks.afterLeave;
- };
- return emptyPlaceholder(child);
- } else if (mode === "in-out" && innerChild.type !== Comment) {
- leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
- const leavingVNodesCache = getLeavingNodesForType(
- state,
- oldInnerChild
- );
- leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
- el[leaveCbKey] = () => {
- earlyRemove();
- el[leaveCbKey] = void 0;
- delete enterHooks.delayedLeave;
- };
- enterHooks.delayedLeave = delayedLeave;
- };
- }
- }
- return child;
- };
- }
- };
- function findNonCommentChild(children) {
- let child = children[0];
- if (children.length > 1) {
- for (const c of children) {
- if (c.type !== Comment) {
- child = c;
- break;
- }
- }
- }
- return child;
- }
- const BaseTransition = BaseTransitionImpl;
- function getLeavingNodesForType(state, vnode) {
- const { leavingVNodes } = state;
- let leavingVNodesCache = leavingVNodes.get(vnode.type);
- if (!leavingVNodesCache) {
- leavingVNodesCache = /* @__PURE__ */ Object.create(null);
- leavingVNodes.set(vnode.type, leavingVNodesCache);
- }
- return leavingVNodesCache;
- }
- function resolveTransitionHooks(vnode, props, state, instance, postClone) {
- const {
- appear,
- mode,
- persisted = false,
- onBeforeEnter,
- onEnter,
- onAfterEnter,
- onEnterCancelled,
- onBeforeLeave,
- onLeave,
- onAfterLeave,
- onLeaveCancelled,
- onBeforeAppear,
- onAppear,
- onAfterAppear,
- onAppearCancelled
- } = props;
- const key = String(vnode.key);
- const leavingVNodesCache = getLeavingNodesForType(state, vnode);
- const callHook2 = (hook, args) => {
- hook && callWithAsyncErrorHandling(
- hook,
- instance,
- 9,
- args
- );
- };
- const callAsyncHook = (hook, args) => {
- const done = args[1];
- callHook2(hook, args);
- if (isArray$1(hook)) {
- if (hook.every((hook2) => hook2.length <= 1))
- done();
- } else if (hook.length <= 1) {
- done();
- }
- };
- const hooks = {
- mode,
- persisted,
- beforeEnter(el) {
- let hook = onBeforeEnter;
- if (!state.isMounted) {
- if (appear) {
- hook = onBeforeAppear || onBeforeEnter;
- } else {
- return;
- }
- }
- if (el[leaveCbKey]) {
- el[leaveCbKey](
- true
- /* cancelled */
- );
- }
- const leavingVNode = leavingVNodesCache[key];
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
- leavingVNode.el[leaveCbKey]();
- }
- callHook2(hook, [el]);
- },
- enter(el) {
- let hook = onEnter;
- let afterHook = onAfterEnter;
- let cancelHook = onEnterCancelled;
- if (!state.isMounted) {
- if (appear) {
- hook = onAppear || onEnter;
- afterHook = onAfterAppear || onAfterEnter;
- cancelHook = onAppearCancelled || onEnterCancelled;
- } else {
- return;
- }
- }
- let called = false;
- const done = el[enterCbKey] = (cancelled) => {
- if (called)
- return;
- called = true;
- if (cancelled) {
- callHook2(cancelHook, [el]);
- } else {
- callHook2(afterHook, [el]);
- }
- if (hooks.delayedLeave) {
- hooks.delayedLeave();
- }
- el[enterCbKey] = void 0;
- };
- if (hook) {
- callAsyncHook(hook, [el, done]);
- } else {
- done();
- }
- },
- leave(el, remove2) {
- const key2 = String(vnode.key);
- if (el[enterCbKey]) {
- el[enterCbKey](
- true
- /* cancelled */
- );
- }
- if (state.isUnmounting) {
- return remove2();
- }
- callHook2(onBeforeLeave, [el]);
- let called = false;
- const done = el[leaveCbKey] = (cancelled) => {
- if (called)
- return;
- called = true;
- remove2();
- if (cancelled) {
- callHook2(onLeaveCancelled, [el]);
- } else {
- callHook2(onAfterLeave, [el]);
- }
- el[leaveCbKey] = void 0;
- if (leavingVNodesCache[key2] === vnode) {
- delete leavingVNodesCache[key2];
- }
- };
- leavingVNodesCache[key2] = vnode;
- if (onLeave) {
- callAsyncHook(onLeave, [el, done]);
- } else {
- done();
- }
- },
- clone(vnode2) {
- const hooks2 = resolveTransitionHooks(
- vnode2,
- props,
- state,
- instance,
- postClone
- );
- if (postClone)
- postClone(hooks2);
- return hooks2;
- }
- };
- return hooks;
- }
- function emptyPlaceholder(vnode) {
- if (isKeepAlive(vnode)) {
- vnode = cloneVNode(vnode);
- vnode.children = null;
- return vnode;
- }
- }
- function getInnerChild$1(vnode) {
- if (!isKeepAlive(vnode)) {
- if (isTeleport(vnode.type) && vnode.children) {
- return findNonCommentChild(vnode.children);
- }
- return vnode;
- }
- const { shapeFlag, children } = vnode;
- if (children) {
- if (shapeFlag & 16) {
- return children[0];
- }
- if (shapeFlag & 32 && isFunction(children.default)) {
- return children.default();
- }
- }
- }
- function setTransitionHooks(vnode, hooks) {
- if (vnode.shapeFlag & 6 && vnode.component) {
- vnode.transition = hooks;
- setTransitionHooks(vnode.component.subTree, hooks);
- } else if (vnode.shapeFlag & 128) {
- vnode.ssContent.transition = hooks.clone(vnode.ssContent);
- vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
- } else {
- vnode.transition = hooks;
- }
- }
- function getTransitionRawChildren(children, keepComment = false, parentKey) {
- let ret = [];
- let keyedFragmentCount = 0;
- for (let i = 0; i < children.length; i++) {
- let child = children[i];
- const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i);
- if (child.type === Fragment) {
- if (child.patchFlag & 128)
- keyedFragmentCount++;
- ret = ret.concat(
- getTransitionRawChildren(child.children, keepComment, key)
- );
- } else if (keepComment || child.type !== Comment) {
- ret.push(key != null ? cloneVNode(child, { key }) : child);
- }
- }
- if (keyedFragmentCount > 1) {
- for (let i = 0; i < ret.length; i++) {
- ret[i].patchFlag = -2;
- }
- }
- return ret;
- }
- /*! #__NO_SIDE_EFFECTS__ */
- // @__NO_SIDE_EFFECTS__
- function defineComponent(options, extraOptions) {
- return isFunction(options) ? (
- // #8236: extend call and options.name access are considered side-effects
- // by Rollup, so we have to wrap it in a pure-annotated IIFE.
- /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
- ) : options;
- }
- function markAsyncBoundary(instance) {
- instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
- }
- function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
- if (isArray$1(rawRef)) {
- rawRef.forEach(
- (r, i) => setRef(
- r,
- oldRawRef && (isArray$1(oldRawRef) ? oldRawRef[i] : oldRawRef),
- parentSuspense,
- vnode,
- isUnmount
- )
- );
- return;
- }
- if (isAsyncWrapper(vnode) && !isUnmount) {
- return;
- }
- const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
- const value = isUnmount ? null : refValue;
- const { i: owner, r: ref2 } = rawRef;
- const oldRef = oldRawRef && oldRawRef.r;
- const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
- const setupState = owner.setupState;
- const rawSetupState = toRaw(setupState);
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
- return hasOwn(rawSetupState, key);
- };
- if (oldRef != null && oldRef !== ref2) {
- if (isString(oldRef)) {
- refs[oldRef] = null;
- if (canSetSetupRef(oldRef)) {
- setupState[oldRef] = null;
- }
- } else if (isRef(oldRef)) {
- oldRef.value = null;
- }
- }
- if (isFunction(ref2)) {
- callWithErrorHandling(ref2, owner, 12, [value, refs]);
- } else {
- const _isString = isString(ref2);
- const _isRef = isRef(ref2);
- if (_isString || _isRef) {
- const doSet = () => {
- if (rawRef.f) {
- const existing = _isString ? canSetSetupRef(ref2) ? setupState[ref2] : refs[ref2] : ref2.value;
- if (isUnmount) {
- isArray$1(existing) && remove(existing, refValue);
- } else {
- if (!isArray$1(existing)) {
- if (_isString) {
- refs[ref2] = [refValue];
- if (canSetSetupRef(ref2)) {
- setupState[ref2] = refs[ref2];
- }
- } else {
- ref2.value = [refValue];
- if (rawRef.k)
- refs[rawRef.k] = ref2.value;
- }
- } else if (!existing.includes(refValue)) {
- existing.push(refValue);
- }
- }
- } else if (_isString) {
- refs[ref2] = value;
- if (canSetSetupRef(ref2)) {
- setupState[ref2] = value;
- }
- } else if (_isRef) {
- ref2.value = value;
- if (rawRef.k)
- refs[rawRef.k] = value;
- } else
- ;
- };
- if (value) {
- doSet.id = -1;
- queuePostRenderEffect(doSet, parentSuspense);
- } else {
- doSet();
- }
- }
- }
- }
- const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
- const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
- const KeepAliveImpl = {
- name: `KeepAlive`,
- // Marker for special handling inside the renderer. We are not using a ===
- // check directly on KeepAlive in the renderer, because importing it directly
- // would prevent it from being tree-shaken.
- __isKeepAlive: true,
- props: {
- include: [String, RegExp, Array],
- exclude: [String, RegExp, Array],
- max: [String, Number]
- },
- setup(props, { slots }) {
- const instance = getCurrentInstance();
- const sharedContext = instance.ctx;
- if (!sharedContext.renderer) {
- return () => {
- const children = slots.default && slots.default();
- return children && children.length === 1 ? children[0] : children;
- };
- }
- const cache = /* @__PURE__ */ new Map();
- const keys = /* @__PURE__ */ new Set();
- let current = null;
- const parentSuspense = instance.suspense;
- const {
- renderer: {
- p: patch,
- m: move,
- um: _unmount,
- o: { createElement }
- }
- } = sharedContext;
- const storageContainer = createElement("div");
- sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
- const instance2 = vnode.component;
- move(vnode, container, anchor, 0, parentSuspense);
- patch(
- instance2.vnode,
- vnode,
- container,
- anchor,
- instance2,
- parentSuspense,
- namespace,
- vnode.slotScopeIds,
- optimized
- );
- queuePostRenderEffect(() => {
- instance2.isDeactivated = false;
- if (instance2.a) {
- invokeArrayFns(instance2.a);
- }
- const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
- if (vnodeHook) {
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
- }
- }, parentSuspense);
- };
- sharedContext.deactivate = (vnode) => {
- const instance2 = vnode.component;
- invalidateMount(instance2.m);
- invalidateMount(instance2.a);
- move(vnode, storageContainer, null, 1, parentSuspense);
- queuePostRenderEffect(() => {
- if (instance2.da) {
- invokeArrayFns(instance2.da);
- }
- const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
- if (vnodeHook) {
- invokeVNodeHook(vnodeHook, instance2.parent, vnode);
- }
- instance2.isDeactivated = true;
- }, parentSuspense);
- };
- function unmount(vnode) {
- resetShapeFlag(vnode);
- _unmount(vnode, instance, parentSuspense, true);
- }
- function pruneCache(filter) {
- cache.forEach((vnode, key) => {
- const name = getComponentName(vnode.type);
- if (name && !filter(name)) {
- pruneCacheEntry(key);
- }
- });
- }
- function pruneCacheEntry(key) {
- const cached = cache.get(key);
- if (cached && (!current || !isSameVNodeType(cached, current))) {
- unmount(cached);
- } else if (current) {
- resetShapeFlag(current);
- }
- cache.delete(key);
- keys.delete(key);
- }
- watch(
- () => [props.include, props.exclude],
- ([include, exclude]) => {
- include && pruneCache((name) => matches(include, name));
- exclude && pruneCache((name) => !matches(exclude, name));
- },
- // prune post-render after `current` has been updated
- { flush: "post", deep: true }
- );
- let pendingCacheKey = null;
- const cacheSubtree = () => {
- if (pendingCacheKey != null) {
- if (isSuspense(instance.subTree.type)) {
- queuePostRenderEffect(() => {
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
- }, instance.subTree.suspense);
- } else {
- cache.set(pendingCacheKey, getInnerChild(instance.subTree));
- }
- }
- };
- onMounted(cacheSubtree);
- onUpdated(cacheSubtree);
- onBeforeUnmount(() => {
- cache.forEach((cached) => {
- const { subTree, suspense } = instance;
- const vnode = getInnerChild(subTree);
- if (cached.type === vnode.type && cached.key === vnode.key) {
- resetShapeFlag(vnode);
- const da = vnode.component.da;
- da && queuePostRenderEffect(da, suspense);
- return;
- }
- unmount(cached);
- });
- });
- return () => {
- pendingCacheKey = null;
- if (!slots.default) {
- return current = null;
- }
- const children = slots.default();
- const rawVNode = children[0];
- if (children.length > 1) {
- current = null;
- return children;
- } else if (!isVNode(rawVNode) || !(rawVNode.shapeFlag & 4) && !(rawVNode.shapeFlag & 128)) {
- current = null;
- return rawVNode;
- }
- let vnode = getInnerChild(rawVNode);
- if (vnode.type === Comment) {
- current = null;
- return vnode;
- }
- const comp = vnode.type;
- const name = getComponentName(
- isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
- );
- const { include, exclude, max } = props;
- if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
- vnode.shapeFlag &= ~256;
- current = vnode;
- return rawVNode;
- }
- const key = vnode.key == null ? comp : vnode.key;
- const cachedVNode = cache.get(key);
- if (vnode.el) {
- vnode = cloneVNode(vnode);
- if (rawVNode.shapeFlag & 128) {
- rawVNode.ssContent = vnode;
- }
- }
- pendingCacheKey = key;
- if (cachedVNode) {
- vnode.el = cachedVNode.el;
- vnode.component = cachedVNode.component;
- if (vnode.transition) {
- setTransitionHooks(vnode, vnode.transition);
- }
- vnode.shapeFlag |= 512;
- keys.delete(key);
- keys.add(key);
- } else {
- keys.add(key);
- if (max && keys.size > parseInt(max, 10)) {
- pruneCacheEntry(keys.values().next().value);
- }
- }
- vnode.shapeFlag |= 256;
- current = vnode;
- return isSuspense(rawVNode.type) ? rawVNode : vnode;
- };
- }
- };
- const KeepAlive = KeepAliveImpl;
- function matches(pattern, name) {
- if (isArray$1(pattern)) {
- return pattern.some((p2) => matches(p2, name));
- } else if (isString(pattern)) {
- return pattern.split(",").includes(name);
- } else if (isRegExp(pattern)) {
- pattern.lastIndex = 0;
- return pattern.test(name);
- }
- return false;
- }
- function onActivated(hook, target) {
- registerKeepAliveHook(hook, "a", target);
- }
- function onDeactivated(hook, target) {
- registerKeepAliveHook(hook, "da", target);
- }
- function registerKeepAliveHook(hook, type, target = currentInstance) {
- const wrappedHook = hook.__wdc || (hook.__wdc = () => {
- let current = target;
- while (current) {
- if (current.isDeactivated) {
- return;
- }
- current = current.parent;
- }
- return hook();
- });
- injectHook(type, wrappedHook, target);
- if (target) {
- let current = target.parent;
- while (current && current.parent) {
- if (isKeepAlive(current.parent.vnode)) {
- injectToKeepAliveRoot(wrappedHook, type, target, current);
- }
- current = current.parent;
- }
- }
- }
- function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
- const injected = injectHook(
- type,
- hook,
- keepAliveRoot,
- true
- /* prepend */
- );
- onUnmounted(() => {
- remove(keepAliveRoot[type], injected);
- }, target);
- }
- function resetShapeFlag(vnode) {
- vnode.shapeFlag &= ~256;
- vnode.shapeFlag &= ~512;
- }
- function getInnerChild(vnode) {
- return vnode.shapeFlag & 128 ? vnode.ssContent : vnode;
- }
- function injectHook(type, hook, target = currentInstance, prepend = false) {
- if (target) {
- const hooks = target[type] || (target[type] = []);
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
- pauseTracking();
- const reset = setCurrentInstance(target);
- const res = callWithAsyncErrorHandling(hook, target, type, args);
- reset();
- resetTracking();
- return res;
- });
- if (prepend) {
- hooks.unshift(wrappedHook);
- } else {
- hooks.push(wrappedHook);
- }
- return wrappedHook;
- }
- }
- const createHook = (lifecycle) => (hook, target = currentInstance) => {
- if (!isInSSRComponentSetup || lifecycle === "sp") {
- injectHook(lifecycle, (...args) => hook(...args), target);
- }
- };
- const onBeforeMount = createHook("bm");
- const onMounted = createHook("m");
- const onBeforeUpdate = createHook(
- "bu"
- );
- const onUpdated = createHook("u");
- const onBeforeUnmount = createHook(
- "bum"
- );
- const onUnmounted = createHook("um");
- const onServerPrefetch = createHook(
- "sp"
- );
- const onRenderTriggered = createHook("rtg");
- const onRenderTracked = createHook("rtc");
- function onErrorCaptured(hook, target = currentInstance) {
- injectHook("ec", hook, target);
- }
- const COMPONENTS = "components";
- const DIRECTIVES = "directives";
- function resolveComponent(name, maybeSelfReference) {
- return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
- }
- const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
- function resolveDynamicComponent(component) {
- if (isString(component)) {
- return resolveAsset(COMPONENTS, component, false) || component;
- } else {
- return component || NULL_DYNAMIC_COMPONENT;
- }
- }
- function resolveDirective(name) {
- return resolveAsset(DIRECTIVES, name);
- }
- function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
- const instance = currentRenderingInstance || currentInstance;
- if (instance) {
- const Component = instance.type;
- if (type === COMPONENTS) {
- const selfName = getComponentName(
- Component,
- false
- );
- if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
- return Component;
- }
- }
- const res = (
- // local registration
- // check instance[type] first which is resolved for options API
- resolve(instance[type] || Component[type], name) || // global registration
- resolve(instance.appContext[type], name)
- );
- if (!res && maybeSelfReference) {
- return Component;
- }
- return res;
- }
- }
- function resolve(registry, name) {
- return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
- }
- function renderList(source, renderItem, cache, index2) {
- let ret;
- const cached = cache && cache[index2];
- const sourceIsArray = isArray$1(source);
- if (sourceIsArray || isString(source)) {
- const sourceIsReactiveArray = sourceIsArray && isReactive(source);
- let needsWrap = false;
- if (sourceIsReactiveArray) {
- needsWrap = !isShallow(source);
- source = shallowReadArray(source);
- }
- ret = new Array(source.length);
- for (let i = 0, l = source.length; i < l; i++) {
- ret[i] = renderItem(
- needsWrap ? toReactive(source[i]) : source[i],
- i,
- void 0,
- cached && cached[i]
- );
- }
- } else if (typeof source === "number") {
- ret = new Array(source);
- for (let i = 0; i < source; i++) {
- ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
- }
- } else if (isObject(source)) {
- if (source[Symbol.iterator]) {
- ret = Array.from(
- source,
- (item, i) => renderItem(item, i, void 0, cached && cached[i])
- );
- } else {
- const keys = Object.keys(source);
- ret = new Array(keys.length);
- for (let i = 0, l = keys.length; i < l; i++) {
- const key = keys[i];
- ret[i] = renderItem(source[key], key, i, cached && cached[i]);
- }
- }
- } else {
- ret = [];
- }
- if (cache) {
- cache[index2] = ret;
- }
- return ret;
- }
- function createSlots(slots, dynamicSlots) {
- for (let i = 0; i < dynamicSlots.length; i++) {
- const slot = dynamicSlots[i];
- if (isArray$1(slot)) {
- for (let j = 0; j < slot.length; j++) {
- slots[slot[j].name] = slot[j].fn;
- }
- } else if (slot) {
- slots[slot.name] = slot.key ? (...args) => {
- const res = slot.fn(...args);
- if (res)
- res.key = slot.key;
- return res;
- } : slot.fn;
- }
- }
- return slots;
- }
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
- if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
- if (name !== "default")
- props.name = name;
- return openBlock(), createBlock(
- Fragment,
- null,
- [createVNode("slot", props, fallback && fallback())],
- 64
- );
- }
- let slot = slots[name];
- if (slot && slot._c) {
- slot._d = false;
- }
- openBlock();
- const validSlotContent = slot && ensureValidVNode(slot(props));
- const rendered = createBlock(
- Fragment,
- {
- key: (props.key || // slot content array of a dynamic conditional slot may have a branch
- // key attached in the `createSlots` helper, respect that
- validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
- (!validSlotContent && fallback ? "_fb" : "")
- },
- validSlotContent || (fallback ? fallback() : []),
- validSlotContent && slots._ === 1 ? 64 : -2
- );
- if (!noSlotted && rendered.scopeId) {
- rendered.slotScopeIds = [rendered.scopeId + "-s"];
- }
- if (slot && slot._c) {
- slot._d = true;
- }
- return rendered;
- }
- function ensureValidVNode(vnodes) {
- return vnodes.some((child) => {
- if (!isVNode(child))
- return true;
- if (child.type === Comment)
- return false;
- if (child.type === Fragment && !ensureValidVNode(child.children))
- return false;
- return true;
- }) ? vnodes : null;
- }
- const getPublicInstance = (i) => {
- if (!i)
- return null;
- if (isStatefulComponent(i))
- return getComponentPublicInstance(i);
- return getPublicInstance(i.parent);
- };
- const publicPropertiesMap = (
- // Move PURE marker to new line to workaround compiler discarding it
- // due to type annotation
- /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), {
- $: (i) => i,
- $el: (i) => i.vnode.el,
- $data: (i) => i.data,
- $props: (i) => i.props,
- $attrs: (i) => i.attrs,
- $slots: (i) => i.slots,
- $refs: (i) => i.refs,
- $parent: (i) => getPublicInstance(i.parent),
- $root: (i) => getPublicInstance(i.root),
- $host: (i) => i.ce,
- $emit: (i) => i.emit,
- $options: (i) => resolveMergedOptions(i),
- $forceUpdate: (i) => i.f || (i.f = () => {
- queueJob(i.update);
- }),
- $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
- $watch: (i) => instanceWatch.bind(i)
- })
- );
- const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
- const PublicInstanceProxyHandlers = {
- get({ _: instance }, key) {
- if (key === "__v_skip") {
- return true;
- }
- const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
- let normalizedProps;
- if (key[0] !== "$") {
- const n = accessCache[key];
- if (n !== void 0) {
- switch (n) {
- case 1:
- return setupState[key];
- case 2:
- return data[key];
- case 4:
- return ctx[key];
- case 3:
- return props[key];
- }
- } else if (hasSetupBinding(setupState, key)) {
- accessCache[key] = 1;
- return setupState[key];
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
- accessCache[key] = 2;
- return data[key];
- } else if (
- // only cache other properties when instance has declared (thus stable)
- // props
- (normalizedProps = instance.propsOptions[0]) && hasOwn(normalizedProps, key)
- ) {
- accessCache[key] = 3;
- return props[key];
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (shouldCacheAccess) {
- accessCache[key] = 0;
- }
- }
- const publicGetter = publicPropertiesMap[key];
- let cssModule, globalProperties;
- if (publicGetter) {
- if (key === "$attrs") {
- track(instance.attrs, "get", "");
- }
- return publicGetter(instance);
- } else if (
- // css module (injected by vue-loader)
- (cssModule = type.__cssModules) && (cssModule = cssModule[key])
- ) {
- return cssModule;
- } else if (ctx !== EMPTY_OBJ && hasOwn(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (
- // global properties
- globalProperties = appContext.config.globalProperties, hasOwn(globalProperties, key)
- ) {
- {
- return globalProperties[key];
- }
- } else
- ;
- },
- set({ _: instance }, key, value) {
- const { data, setupState, ctx } = instance;
- if (hasSetupBinding(setupState, key)) {
- setupState[key] = value;
- return true;
- } else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
- data[key] = value;
- return true;
- } else if (hasOwn(instance.props, key)) {
- return false;
- }
- if (key[0] === "$" && key.slice(1) in instance) {
- return false;
- } else {
- {
- ctx[key] = value;
- }
- }
- return true;
- },
- has({
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
- }, key) {
- let normalizedProps;
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
- },
- defineProperty(target, key, descriptor) {
- if (descriptor.get != null) {
- target._.accessCache[key] = 0;
- } else if (hasOwn(descriptor, "value")) {
- this.set(target, key, descriptor.value, null);
- }
- return Reflect.defineProperty(target, key, descriptor);
- }
- };
- function normalizePropsOrEmits(props) {
- return isArray$1(props) ? props.reduce(
- (normalized, p2) => (normalized[p2] = null, normalized),
- {}
- ) : props;
- }
- let shouldCacheAccess = true;
- function applyOptions(instance) {
- const options = resolveMergedOptions(instance);
- const publicThis = instance.proxy;
- const ctx = instance.ctx;
- shouldCacheAccess = false;
- if (options.beforeCreate) {
- callHook$1(options.beforeCreate, instance, "bc");
- }
- const {
- // state
- data: dataOptions,
- computed: computedOptions,
- methods,
- watch: watchOptions,
- provide: provideOptions,
- inject: injectOptions,
- // lifecycle
- created,
- beforeMount,
- mounted,
- beforeUpdate,
- updated,
- activated,
- deactivated,
- beforeDestroy,
- beforeUnmount,
- destroyed,
- unmounted,
- render,
- renderTracked,
- renderTriggered,
- errorCaptured,
- serverPrefetch,
- // public API
- expose,
- inheritAttrs,
- // assets
- components,
- directives,
- filters
- } = options;
- const checkDuplicateProperties = null;
- if (injectOptions) {
- resolveInjections(injectOptions, ctx, checkDuplicateProperties);
- }
- if (methods) {
- for (const key in methods) {
- const methodHandler = methods[key];
- if (isFunction(methodHandler)) {
- {
- ctx[key] = methodHandler.bind(publicThis);
- }
- }
- }
- }
- if (dataOptions) {
- const data = dataOptions.call(publicThis, publicThis);
- if (!isObject(data))
- ;
- else {
- instance.data = reactive(data);
- }
- }
- shouldCacheAccess = true;
- if (computedOptions) {
- for (const key in computedOptions) {
- const opt = computedOptions[key];
- const get2 = isFunction(opt) ? opt.bind(publicThis, publicThis) : isFunction(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
- const set2 = !isFunction(opt) && isFunction(opt.set) ? opt.set.bind(publicThis) : NOOP;
- const c = computed({
- get: get2,
- set: set2
- });
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => c.value,
- set: (v) => c.value = v
- });
- }
- }
- if (watchOptions) {
- for (const key in watchOptions) {
- createWatcher(watchOptions[key], ctx, publicThis, key);
- }
- }
- if (provideOptions) {
- const provides = isFunction(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
- Reflect.ownKeys(provides).forEach((key) => {
- provide(key, provides[key]);
- });
- }
- if (created) {
- callHook$1(created, instance, "c");
- }
- function registerLifecycleHook(register, hook) {
- if (isArray$1(hook)) {
- hook.forEach((_hook) => register(_hook.bind(publicThis)));
- } else if (hook) {
- register(hook.bind(publicThis));
- }
- }
- registerLifecycleHook(onBeforeMount, beforeMount);
- registerLifecycleHook(onMounted, mounted);
- registerLifecycleHook(onBeforeUpdate, beforeUpdate);
- registerLifecycleHook(onUpdated, updated);
- registerLifecycleHook(onActivated, activated);
- registerLifecycleHook(onDeactivated, deactivated);
- registerLifecycleHook(onErrorCaptured, errorCaptured);
- registerLifecycleHook(onRenderTracked, renderTracked);
- registerLifecycleHook(onRenderTriggered, renderTriggered);
- registerLifecycleHook(onBeforeUnmount, beforeUnmount);
- registerLifecycleHook(onUnmounted, unmounted);
- registerLifecycleHook(onServerPrefetch, serverPrefetch);
- if (isArray$1(expose)) {
- if (expose.length) {
- const exposed = instance.exposed || (instance.exposed = {});
- expose.forEach((key) => {
- Object.defineProperty(exposed, key, {
- get: () => publicThis[key],
- set: (val) => publicThis[key] = val
- });
- });
- } else if (!instance.exposed) {
- instance.exposed = {};
- }
- }
- if (render && instance.render === NOOP) {
- instance.render = render;
- }
- if (inheritAttrs != null) {
- instance.inheritAttrs = inheritAttrs;
- }
- if (components)
- instance.components = components;
- if (directives)
- instance.directives = directives;
- if (serverPrefetch) {
- markAsyncBoundary(instance);
- }
- }
- function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
- if (isArray$1(injectOptions)) {
- injectOptions = normalizeInject(injectOptions);
- }
- for (const key in injectOptions) {
- const opt = injectOptions[key];
- let injected;
- if (isObject(opt)) {
- if ("default" in opt) {
- injected = inject(
- opt.from || key,
- opt.default,
- true
- );
- } else {
- injected = inject(opt.from || key);
- }
- } else {
- injected = inject(opt);
- }
- if (isRef(injected)) {
- Object.defineProperty(ctx, key, {
- enumerable: true,
- configurable: true,
- get: () => injected.value,
- set: (v) => injected.value = v
- });
- } else {
- ctx[key] = injected;
- }
- }
- }
- function callHook$1(hook, instance, type) {
- callWithAsyncErrorHandling(
- isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
- instance,
- type
- );
- }
- function createWatcher(raw, ctx, publicThis, key) {
- let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
- if (isString(raw)) {
- const handler = ctx[raw];
- if (isFunction(handler)) {
- {
- watch(getter, handler);
- }
- }
- } else if (isFunction(raw)) {
- {
- watch(getter, raw.bind(publicThis));
- }
- } else if (isObject(raw)) {
- if (isArray$1(raw)) {
- raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
- } else {
- const handler = isFunction(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
- if (isFunction(handler)) {
- watch(getter, handler, raw);
- }
- }
- } else
- ;
- }
- function resolveMergedOptions(instance) {
- const base2 = instance.type;
- const { mixins, extends: extendsOptions } = base2;
- const {
- mixins: globalMixins,
- optionsCache: cache,
- config: { optionMergeStrategies }
- } = instance.appContext;
- const cached = cache.get(base2);
- let resolved;
- if (cached) {
- resolved = cached;
- } else if (!globalMixins.length && !mixins && !extendsOptions) {
- {
- resolved = base2;
- }
- } else {
- resolved = {};
- if (globalMixins.length) {
- globalMixins.forEach(
- (m) => mergeOptions$1(resolved, m, optionMergeStrategies, true)
- );
- }
- mergeOptions$1(resolved, base2, optionMergeStrategies);
- }
- if (isObject(base2)) {
- cache.set(base2, resolved);
- }
- return resolved;
- }
- function mergeOptions$1(to, from, strats, asMixin = false) {
- const { mixins, extends: extendsOptions } = from;
- if (extendsOptions) {
- mergeOptions$1(to, extendsOptions, strats, true);
- }
- if (mixins) {
- mixins.forEach(
- (m) => mergeOptions$1(to, m, strats, true)
- );
- }
- for (const key in from) {
- if (asMixin && key === "expose")
- ;
- else {
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
- to[key] = strat ? strat(to[key], from[key]) : from[key];
- }
- }
- return to;
- }
- const internalOptionMergeStrats = {
- data: mergeDataFn,
- props: mergeEmitsOrPropsOptions,
- emits: mergeEmitsOrPropsOptions,
- // objects
- methods: mergeObjectOptions,
- computed: mergeObjectOptions,
- // lifecycle
- beforeCreate: mergeAsArray,
- created: mergeAsArray,
- beforeMount: mergeAsArray,
- mounted: mergeAsArray,
- beforeUpdate: mergeAsArray,
- updated: mergeAsArray,
- beforeDestroy: mergeAsArray,
- beforeUnmount: mergeAsArray,
- destroyed: mergeAsArray,
- unmounted: mergeAsArray,
- activated: mergeAsArray,
- deactivated: mergeAsArray,
- errorCaptured: mergeAsArray,
- serverPrefetch: mergeAsArray,
- // assets
- components: mergeObjectOptions,
- directives: mergeObjectOptions,
- // watch
- watch: mergeWatchOptions,
- // provide / inject
- provide: mergeDataFn,
- inject: mergeInject
- };
- function mergeDataFn(to, from) {
- if (!from) {
- return to;
- }
- if (!to) {
- return from;
- }
- return function mergedDataFn() {
- return extend(
- isFunction(to) ? to.call(this, this) : to,
- isFunction(from) ? from.call(this, this) : from
- );
- };
- }
- function mergeInject(to, from) {
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
- }
- function normalizeInject(raw) {
- if (isArray$1(raw)) {
- const res = {};
- for (let i = 0; i < raw.length; i++) {
- res[raw[i]] = raw[i];
- }
- return res;
- }
- return raw;
- }
- function mergeAsArray(to, from) {
- return to ? [...new Set([].concat(to, from))] : from;
- }
- function mergeObjectOptions(to, from) {
- return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
- }
- function mergeEmitsOrPropsOptions(to, from) {
- if (to) {
- if (isArray$1(to) && isArray$1(from)) {
- return [.../* @__PURE__ */ new Set([...to, ...from])];
- }
- return extend(
- /* @__PURE__ */ Object.create(null),
- normalizePropsOrEmits(to),
- normalizePropsOrEmits(from != null ? from : {})
- );
- } else {
- return from;
- }
- }
- function mergeWatchOptions(to, from) {
- if (!to)
- return from;
- if (!from)
- return to;
- const merged = extend(/* @__PURE__ */ Object.create(null), to);
- for (const key in from) {
- merged[key] = mergeAsArray(to[key], from[key]);
- }
- return merged;
- }
- function createAppContext() {
- return {
- app: null,
- config: {
- isNativeTag: NO,
- performance: false,
- globalProperties: {},
- optionMergeStrategies: {},
- errorHandler: void 0,
- warnHandler: void 0,
- compilerOptions: {}
- },
- mixins: [],
- components: {},
- directives: {},
- provides: /* @__PURE__ */ Object.create(null),
- optionsCache: /* @__PURE__ */ new WeakMap(),
- propsCache: /* @__PURE__ */ new WeakMap(),
- emitsCache: /* @__PURE__ */ new WeakMap()
- };
- }
- let uid$1 = 0;
- function createAppAPI(render, hydrate) {
- return function createApp2(rootComponent, rootProps = null) {
- if (!isFunction(rootComponent)) {
- rootComponent = extend({}, rootComponent);
- }
- if (rootProps != null && !isObject(rootProps)) {
- rootProps = null;
- }
- const context = createAppContext();
- const installedPlugins = /* @__PURE__ */ new WeakSet();
- const pluginCleanupFns = [];
- let isMounted = false;
- const app2 = context.app = {
- _uid: uid$1++,
- _component: rootComponent,
- _props: rootProps,
- _container: null,
- _context: context,
- _instance: null,
- version,
- get config() {
- return context.config;
- },
- set config(v) {
- },
- use(plugin, ...options) {
- if (installedPlugins.has(plugin))
- ;
- else if (plugin && isFunction(plugin.install)) {
- installedPlugins.add(plugin);
- plugin.install(app2, ...options);
- } else if (isFunction(plugin)) {
- installedPlugins.add(plugin);
- plugin(app2, ...options);
- } else
- ;
- return app2;
- },
- mixin(mixin) {
- {
- if (!context.mixins.includes(mixin)) {
- context.mixins.push(mixin);
- }
- }
- return app2;
- },
- component(name, component) {
- if (!component) {
- return context.components[name];
- }
- context.components[name] = component;
- return app2;
- },
- directive(name, directive) {
- if (!directive) {
- return context.directives[name];
- }
- context.directives[name] = directive;
- return app2;
- },
- mount(rootContainer, isHydrate, namespace) {
- if (!isMounted) {
- const vnode = app2._ceVNode || createVNode(rootComponent, rootProps);
- vnode.appContext = context;
- if (namespace === true) {
- namespace = "svg";
- } else if (namespace === false) {
- namespace = void 0;
- }
- if (isHydrate && hydrate) {
- hydrate(vnode, rootContainer);
- } else {
- render(vnode, rootContainer, namespace);
- }
- isMounted = true;
- app2._container = rootContainer;
- rootContainer.__vue_app__ = app2;
- return getComponentPublicInstance(vnode.component);
- }
- },
- onUnmount(cleanupFn) {
- pluginCleanupFns.push(cleanupFn);
- },
- unmount() {
- if (isMounted) {
- callWithAsyncErrorHandling(
- pluginCleanupFns,
- app2._instance,
- 16
- );
- render(null, app2._container);
- delete app2._container.__vue_app__;
- }
- },
- provide(key, value) {
- context.provides[key] = value;
- return app2;
- },
- runWithContext(fn) {
- const lastApp = currentApp;
- currentApp = app2;
- try {
- return fn();
- } finally {
- currentApp = lastApp;
- }
- }
- };
- return app2;
- };
- }
- let currentApp = null;
- function provide(key, value) {
- if (!currentInstance)
- ;
- else {
- let provides = currentInstance.provides;
- const parentProvides = currentInstance.parent && currentInstance.parent.provides;
- if (parentProvides === provides) {
- provides = currentInstance.provides = Object.create(parentProvides);
- }
- provides[key] = value;
- }
- }
- function inject(key, defaultValue, treatDefaultAsFactory = false) {
- const instance = currentInstance || currentRenderingInstance;
- if (instance || currentApp) {
- const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
- if (provides && key in provides) {
- return provides[key];
- } else if (arguments.length > 1) {
- return treatDefaultAsFactory && isFunction(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
- } else
- ;
- }
- }
- function hasInjectionContext() {
- return !!(currentInstance || currentRenderingInstance || currentApp);
- }
- const internalObjectProto = {};
- const createInternalObject = () => Object.create(internalObjectProto);
- const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
- function initProps(instance, rawProps, isStateful, isSSR = false) {
- const props = {};
- const attrs = createInternalObject();
- instance.propsDefaults = /* @__PURE__ */ Object.create(null);
- setFullProps(instance, rawProps, props, attrs);
- for (const key in instance.propsOptions[0]) {
- if (!(key in props)) {
- props[key] = void 0;
- }
- }
- if (isStateful) {
- instance.props = isSSR ? props : shallowReactive(props);
- } else {
- if (!instance.type.props) {
- instance.props = attrs;
- } else {
- instance.props = props;
- }
- }
- instance.attrs = attrs;
- }
- function updateProps(instance, rawProps, rawPrevProps, optimized) {
- const {
- props,
- attrs,
- vnode: { patchFlag }
- } = instance;
- const rawCurrentProps = toRaw(props);
- const [options] = instance.propsOptions;
- let hasAttrsChanged = false;
- if (
- // always force full diff in dev
- // - #1942 if hmr is enabled with sfc component
- // - vite#872 non-sfc component used by sfc component
- (optimized || patchFlag > 0) && !(patchFlag & 16)
- ) {
- if (patchFlag & 8) {
- const propsToUpdate = instance.vnode.dynamicProps;
- for (let i = 0; i < propsToUpdate.length; i++) {
- let key = propsToUpdate[i];
- if (isEmitListener(instance.emitsOptions, key)) {
- continue;
- }
- const value = rawProps[key];
- if (options) {
- if (hasOwn(attrs, key)) {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- } else {
- const camelizedKey = camelize(key);
- props[camelizedKey] = resolvePropValue(
- options,
- rawCurrentProps,
- camelizedKey,
- value,
- instance,
- false
- );
- }
- } else {
- if (value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- } else {
- if (setFullProps(instance, rawProps, props, attrs)) {
- hasAttrsChanged = true;
- }
- let kebabKey;
- for (const key in rawCurrentProps) {
- if (!rawProps || // for camelCase
- !hasOwn(rawProps, key) && // it's possible the original props was passed in as kebab-case
- // and converted to camelCase (#955)
- ((kebabKey = hyphenate(key)) === key || !hasOwn(rawProps, kebabKey))) {
- if (options) {
- if (rawPrevProps && // for camelCase
- (rawPrevProps[key] !== void 0 || // for kebab-case
- rawPrevProps[kebabKey] !== void 0)) {
- props[key] = resolvePropValue(
- options,
- rawCurrentProps,
- key,
- void 0,
- instance,
- true
- );
- }
- } else {
- delete props[key];
- }
- }
- }
- if (attrs !== rawCurrentProps) {
- for (const key in attrs) {
- if (!rawProps || !hasOwn(rawProps, key) && true) {
- delete attrs[key];
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (hasAttrsChanged) {
- trigger(instance.attrs, "set", "");
- }
- }
- function setFullProps(instance, rawProps, props, attrs) {
- const [options, needCastKeys] = instance.propsOptions;
- let hasAttrsChanged = false;
- let rawCastValues;
- if (rawProps) {
- for (let key in rawProps) {
- if (isReservedProp(key)) {
- continue;
- }
- const value = rawProps[key];
- let camelKey;
- if (options && hasOwn(options, camelKey = camelize(key))) {
- if (!needCastKeys || !needCastKeys.includes(camelKey)) {
- props[camelKey] = value;
- } else {
- (rawCastValues || (rawCastValues = {}))[camelKey] = value;
- }
- } else if (!isEmitListener(instance.emitsOptions, key)) {
- if (!(key in attrs) || value !== attrs[key]) {
- attrs[key] = value;
- hasAttrsChanged = true;
- }
- }
- }
- }
- if (needCastKeys) {
- const rawCurrentProps = toRaw(props);
- const castValues = rawCastValues || EMPTY_OBJ;
- for (let i = 0; i < needCastKeys.length; i++) {
- const key = needCastKeys[i];
- props[key] = resolvePropValue(
- options,
- rawCurrentProps,
- key,
- castValues[key],
- instance,
- !hasOwn(castValues, key)
- );
- }
- }
- return hasAttrsChanged;
- }
- function resolvePropValue(options, props, key, value, instance, isAbsent) {
- const opt = options[key];
- if (opt != null) {
- const hasDefault = hasOwn(opt, "default");
- if (hasDefault && value === void 0) {
- const defaultValue = opt.default;
- if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
- const { propsDefaults } = instance;
- if (key in propsDefaults) {
- value = propsDefaults[key];
- } else {
- const reset = setCurrentInstance(instance);
- value = propsDefaults[key] = defaultValue.call(
- null,
- props
- );
- reset();
- }
- } else {
- value = defaultValue;
- }
- if (instance.ce) {
- instance.ce._setProp(key, value);
- }
- }
- if (opt[
- 0
- /* shouldCast */
- ]) {
- if (isAbsent && !hasDefault) {
- value = false;
- } else if (opt[
- 1
- /* shouldCastTrue */
- ] && (value === "" || value === hyphenate(key))) {
- value = true;
- }
- }
- }
- return value;
- }
- const mixinPropsCache = /* @__PURE__ */ new WeakMap();
- function normalizePropsOptions(comp, appContext, asMixin = false) {
- const cache = asMixin ? mixinPropsCache : appContext.propsCache;
- const cached = cache.get(comp);
- if (cached) {
- return cached;
- }
- const raw = comp.props;
- const normalized = {};
- const needCastKeys = [];
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendProps = (raw2) => {
- hasExtends = true;
- const [props, keys] = normalizePropsOptions(raw2, appContext, true);
- extend(normalized, props);
- if (keys)
- needCastKeys.push(...keys);
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendProps);
- }
- if (comp.extends) {
- extendProps(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendProps);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject(comp)) {
- cache.set(comp, EMPTY_ARR);
- }
- return EMPTY_ARR;
- }
- if (isArray$1(raw)) {
- for (let i = 0; i < raw.length; i++) {
- const normalizedKey = camelize(raw[i]);
- if (validatePropName(normalizedKey)) {
- normalized[normalizedKey] = EMPTY_OBJ;
- }
- }
- } else if (raw) {
- for (const key in raw) {
- const normalizedKey = camelize(key);
- if (validatePropName(normalizedKey)) {
- const opt = raw[key];
- const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
- const propType = prop.type;
- let shouldCast = false;
- let shouldCastTrue = true;
- if (isArray$1(propType)) {
- for (let index2 = 0; index2 < propType.length; ++index2) {
- const type = propType[index2];
- const typeName = isFunction(type) && type.name;
- if (typeName === "Boolean") {
- shouldCast = true;
- break;
- } else if (typeName === "String") {
- shouldCastTrue = false;
- }
- }
- } else {
- shouldCast = isFunction(propType) && propType.name === "Boolean";
- }
- prop[
- 0
- /* shouldCast */
- ] = shouldCast;
- prop[
- 1
- /* shouldCastTrue */
- ] = shouldCastTrue;
- if (shouldCast || hasOwn(prop, "default")) {
- needCastKeys.push(normalizedKey);
- }
- }
- }
- }
- const res = [normalized, needCastKeys];
- if (isObject(comp)) {
- cache.set(comp, res);
- }
- return res;
- }
- function validatePropName(key) {
- if (key[0] !== "$" && !isReservedProp(key)) {
- return true;
- }
- return false;
- }
- const isInternalKey = (key) => key[0] === "_" || key === "$stable";
- const normalizeSlotValue = (value) => isArray$1(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
- const normalizeSlot$1 = (key, rawSlot, ctx) => {
- if (rawSlot._n) {
- return rawSlot;
- }
- const normalized = withCtx((...args) => {
- if (false)
- ;
- return normalizeSlotValue(rawSlot(...args));
- }, ctx);
- normalized._c = false;
- return normalized;
- };
- const normalizeObjectSlots = (rawSlots, slots, instance) => {
- const ctx = rawSlots._ctx;
- for (const key in rawSlots) {
- if (isInternalKey(key))
- continue;
- const value = rawSlots[key];
- if (isFunction(value)) {
- slots[key] = normalizeSlot$1(key, value, ctx);
- } else if (value != null) {
- const normalized = normalizeSlotValue(value);
- slots[key] = () => normalized;
- }
- }
- };
- const normalizeVNodeSlots = (instance, children) => {
- const normalized = normalizeSlotValue(children);
- instance.slots.default = () => normalized;
- };
- const assignSlots = (slots, children, optimized) => {
- for (const key in children) {
- if (optimized || key !== "_") {
- slots[key] = children[key];
- }
- }
- };
- const initSlots = (instance, children, optimized) => {
- const slots = instance.slots = createInternalObject();
- if (instance.vnode.shapeFlag & 32) {
- const type = children._;
- if (type) {
- assignSlots(slots, children, optimized);
- if (optimized) {
- def(slots, "_", type, true);
- }
- } else {
- normalizeObjectSlots(children, slots);
- }
- } else if (children) {
- normalizeVNodeSlots(instance, children);
- }
- };
- const updateSlots = (instance, children, optimized) => {
- const { vnode, slots } = instance;
- let needDeletionCheck = true;
- let deletionComparisonTarget = EMPTY_OBJ;
- if (vnode.shapeFlag & 32) {
- const type = children._;
- if (type) {
- if (optimized && type === 1) {
- needDeletionCheck = false;
- } else {
- assignSlots(slots, children, optimized);
- }
- } else {
- needDeletionCheck = !children.$stable;
- normalizeObjectSlots(children, slots);
- }
- deletionComparisonTarget = children;
- } else if (children) {
- normalizeVNodeSlots(instance, children);
- deletionComparisonTarget = { default: 1 };
- }
- if (needDeletionCheck) {
- for (const key in slots) {
- if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
- delete slots[key];
- }
- }
- }
- };
- const queuePostRenderEffect = queueEffectWithSuspense;
- function createRenderer(options) {
- return baseCreateRenderer(options);
- }
- function baseCreateRenderer(options, createHydrationFns) {
- const target = getGlobalThis();
- target.__VUE__ = true;
- const {
- insert: hostInsert,
- remove: hostRemove,
- patchProp: hostPatchProp,
- createElement: hostCreateElement,
- createText: hostCreateText,
- createComment: hostCreateComment,
- setText: hostSetText,
- setElementText: hostSetElementText,
- parentNode: hostParentNode,
- nextSibling: hostNextSibling,
- setScopeId: hostSetScopeId = NOOP,
- insertStaticContent: hostInsertStaticContent
- } = options;
- const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
- if (n1 === n2) {
- return;
- }
- if (n1 && !isSameVNodeType(n1, n2)) {
- anchor = getNextHostNode(n1);
- unmount(n1, parentComponent, parentSuspense, true);
- n1 = null;
- }
- if (n2.patchFlag === -2) {
- optimized = false;
- n2.dynamicChildren = null;
- }
- const { type, ref: ref2, shapeFlag } = n2;
- switch (type) {
- case Text:
- processText(n1, n2, container, anchor);
- break;
- case Comment:
- processCommentNode(n1, n2, container, anchor);
- break;
- case Static:
- if (n1 == null) {
- mountStaticNode(n2, container, anchor, namespace);
- }
- break;
- case Fragment:
- processFragment(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- break;
- default:
- if (shapeFlag & 1) {
- processElement(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (shapeFlag & 6) {
- processComponent(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (shapeFlag & 64) {
- type.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- } else if (shapeFlag & 128) {
- type.process(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- internals
- );
- } else
- ;
- }
- if (ref2 != null && parentComponent) {
- setRef(ref2, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
- }
- };
- const processText = (n1, n2, container, anchor) => {
- if (n1 == null) {
- hostInsert(
- n2.el = hostCreateText(n2.children),
- container,
- anchor
- );
- } else {
- const el = n2.el = n1.el;
- if (n2.children !== n1.children) {
- hostSetText(el, n2.children);
- }
- }
- };
- const processCommentNode = (n1, n2, container, anchor) => {
- if (n1 == null) {
- hostInsert(
- n2.el = hostCreateComment(n2.children || ""),
- container,
- anchor
- );
- } else {
- n2.el = n1.el;
- }
- };
- const mountStaticNode = (n2, container, anchor, namespace) => {
- [n2.el, n2.anchor] = hostInsertStaticContent(
- n2.children,
- container,
- anchor,
- namespace,
- n2.el,
- n2.anchor
- );
- };
- const moveStaticNode = ({ el, anchor }, container, nextSibling) => {
- let next;
- while (el && el !== anchor) {
- next = hostNextSibling(el);
- hostInsert(el, container, nextSibling);
- el = next;
- }
- hostInsert(anchor, container, nextSibling);
- };
- const removeStaticNode = ({ el, anchor }) => {
- let next;
- while (el && el !== anchor) {
- next = hostNextSibling(el);
- hostRemove(el);
- el = next;
- }
- hostRemove(anchor);
- };
- const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- if (n2.type === "svg") {
- namespace = "svg";
- } else if (n2.type === "math") {
- namespace = "mathml";
- }
- if (n1 == null) {
- mountElement(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- patchElement(
- n1,
- n2,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- let el;
- let vnodeHook;
- const { props, shapeFlag, transition, dirs } = vnode;
- el = vnode.el = hostCreateElement(
- vnode.type,
- namespace,
- props && props.is,
- props
- );
- if (shapeFlag & 8) {
- hostSetElementText(el, vnode.children);
- } else if (shapeFlag & 16) {
- mountChildren(
- vnode.children,
- el,
- null,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(vnode, namespace),
- slotScopeIds,
- optimized
- );
- }
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "created");
- }
- setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
- if (props) {
- for (const key in props) {
- if (key !== "value" && !isReservedProp(key)) {
- hostPatchProp(el, key, null, props[key], namespace, parentComponent);
- }
- }
- if ("value" in props) {
- hostPatchProp(el, "value", null, props.value, namespace);
- }
- if (vnodeHook = props.onVnodeBeforeMount) {
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
- }
- }
- if (dirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
- }
- const needCallTransitionHooks = needTransition(parentSuspense, transition);
- if (needCallTransitionHooks) {
- transition.beforeEnter(el);
- }
- hostInsert(el, container, anchor);
- if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
- needCallTransitionHooks && transition.enter(el);
- dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
- }, parentSuspense);
- }
- };
- const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
- if (scopeId) {
- hostSetScopeId(el, scopeId);
- }
- if (slotScopeIds) {
- for (let i = 0; i < slotScopeIds.length; i++) {
- hostSetScopeId(el, slotScopeIds[i]);
- }
- }
- if (parentComponent) {
- let subTree = parentComponent.subTree;
- if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
- const parentVNode = parentComponent.vnode;
- setScopeId(
- el,
- parentVNode,
- parentVNode.scopeId,
- parentVNode.slotScopeIds,
- parentComponent.parent
- );
- }
- }
- };
- const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
- for (let i = start; i < children.length; i++) {
- const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
- patch(
- null,
- child,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- };
- const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- const el = n2.el = n1.el;
- let { patchFlag, dynamicChildren, dirs } = n2;
- patchFlag |= n1.patchFlag & 16;
- const oldProps = n1.props || EMPTY_OBJ;
- const newProps = n2.props || EMPTY_OBJ;
- let vnodeHook;
- parentComponent && toggleRecurse(parentComponent, false);
- if (vnodeHook = newProps.onVnodeBeforeUpdate) {
- invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
- }
- if (dirs) {
- invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
- }
- parentComponent && toggleRecurse(parentComponent, true);
- if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
- hostSetElementText(el, "");
- }
- if (dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- el,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(n2, namespace),
- slotScopeIds
- );
- } else if (!optimized) {
- patchChildren(
- n1,
- n2,
- el,
- null,
- parentComponent,
- parentSuspense,
- resolveChildrenNamespace(n2, namespace),
- slotScopeIds,
- false
- );
- }
- if (patchFlag > 0) {
- if (patchFlag & 16) {
- patchProps(el, oldProps, newProps, parentComponent, namespace);
- } else {
- if (patchFlag & 2) {
- if (oldProps.class !== newProps.class) {
- hostPatchProp(el, "class", null, newProps.class, namespace);
- }
- }
- if (patchFlag & 4) {
- hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
- }
- if (patchFlag & 8) {
- const propsToUpdate = n2.dynamicProps;
- for (let i = 0; i < propsToUpdate.length; i++) {
- const key = propsToUpdate[i];
- const prev = oldProps[key];
- const next = newProps[key];
- if (next !== prev || key === "value") {
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
- }
- }
- }
- }
- if (patchFlag & 1) {
- if (n1.children !== n2.children) {
- hostSetElementText(el, n2.children);
- }
- }
- } else if (!optimized && dynamicChildren == null) {
- patchProps(el, oldProps, newProps, parentComponent, namespace);
- }
- if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
- dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
- }, parentSuspense);
- }
- };
- const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
- for (let i = 0; i < newChildren.length; i++) {
- const oldVNode = oldChildren[i];
- const newVNode = newChildren[i];
- const container = (
- // oldVNode may be an errored async setup() component inside Suspense
- // which will not have a mounted element
- oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
- // of the Fragment itself so it can move its children.
- (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
- // which also requires the correct parent container
- !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
- oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
- // In other cases, the parent container is not actually used so we
- // just pass the block element here to avoid a DOM parentNode call.
- fallbackContainer
- )
- );
- patch(
- oldVNode,
- newVNode,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- true
- );
- }
- };
- const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
- if (oldProps !== newProps) {
- if (oldProps !== EMPTY_OBJ) {
- for (const key in oldProps) {
- if (!isReservedProp(key) && !(key in newProps)) {
- hostPatchProp(
- el,
- key,
- oldProps[key],
- null,
- namespace,
- parentComponent
- );
- }
- }
- }
- for (const key in newProps) {
- if (isReservedProp(key))
- continue;
- const next = newProps[key];
- const prev = oldProps[key];
- if (next !== prev && key !== "value") {
- hostPatchProp(el, key, prev, next, namespace, parentComponent);
- }
- }
- if ("value" in newProps) {
- hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
- }
- }
- };
- const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
- const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
- let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
- if (fragmentSlotScopeIds) {
- slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
- }
- if (n1 == null) {
- hostInsert(fragmentStartAnchor, container, anchor);
- hostInsert(fragmentEndAnchor, container, anchor);
- mountChildren(
- // #10007
- // such fragment like `<></>` will be compiled into
- // a fragment which doesn't have a children.
- // In this case fallback to an empty array
- n2.children || [],
- container,
- fragmentEndAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
- // of renderSlot() with no valid children
- n1.dynamicChildren) {
- patchBlockChildren(
- n1.dynamicChildren,
- dynamicChildren,
- container,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds
- );
- if (
- // #2080 if the stable fragment has a key, it's a <template v-for> that may
- // get moved around. Make sure all root level vnodes inherit el.
- // #2134 or if it's a component root, it may also get moved around
- // as the component is being moved.
- n2.key != null || parentComponent && n2 === parentComponent.subTree
- ) {
- traverseStaticChildren(
- n1,
- n2,
- true
- /* shallow */
- );
- }
- } else {
- patchChildren(
- n1,
- n2,
- container,
- fragmentEndAnchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- }
- };
- const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- n2.slotScopeIds = slotScopeIds;
- if (n1 == null) {
- if (n2.shapeFlag & 512) {
- parentComponent.ctx.activate(
- n2,
- container,
- anchor,
- namespace,
- optimized
- );
- } else {
- mountComponent(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- optimized
- );
- }
- } else {
- updateComponent(n1, n2, optimized);
- }
- };
- const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
- const instance = initialVNode.component = createComponentInstance(
- initialVNode,
- parentComponent,
- parentSuspense
- );
- if (isKeepAlive(initialVNode)) {
- instance.ctx.renderer = internals;
- }
- {
- setupComponent(instance, false, optimized);
- }
- if (instance.asyncDep) {
- parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
- if (!initialVNode.el) {
- const placeholder = instance.subTree = createVNode(Comment);
- processCommentNode(null, placeholder, container, anchor);
- }
- } else {
- setupRenderEffect(
- instance,
- initialVNode,
- container,
- anchor,
- parentSuspense,
- namespace,
- optimized
- );
- }
- };
- const updateComponent = (n1, n2, optimized) => {
- const instance = n2.component = n1.component;
- if (shouldUpdateComponent(n1, n2, optimized)) {
- if (instance.asyncDep && !instance.asyncResolved) {
- updateComponentPreRender(instance, n2, optimized);
- return;
- } else {
- instance.next = n2;
- instance.update();
- }
- } else {
- n2.el = n1.el;
- instance.vnode = n2;
- }
- };
- const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
- const componentUpdateFn = () => {
- if (!instance.isMounted) {
- let vnodeHook;
- const { el, props } = initialVNode;
- const { bm, m, parent, root, type } = instance;
- const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
- toggleRecurse(instance, false);
- if (bm) {
- invokeArrayFns(bm);
- }
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) {
- invokeVNodeHook(vnodeHook, parent, initialVNode);
- }
- toggleRecurse(instance, true);
- if (el && hydrateNode) {
- const hydrateSubTree = () => {
- instance.subTree = renderComponentRoot(instance);
- hydrateNode(
- el,
- instance.subTree,
- instance,
- parentSuspense,
- null
- );
- };
- if (isAsyncWrapperVNode && type.__asyncHydrate) {
- type.__asyncHydrate(
- el,
- instance,
- hydrateSubTree
- );
- } else {
- hydrateSubTree();
- }
- } else {
- if (root.ce) {
- root.ce._injectChildStyle(type);
- }
- const subTree = instance.subTree = renderComponentRoot(instance);
- patch(
- null,
- subTree,
- container,
- anchor,
- instance,
- parentSuspense,
- namespace
- );
- initialVNode.el = subTree.el;
- }
- if (m) {
- queuePostRenderEffect(m, parentSuspense);
- }
- if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) {
- const scopedInitialVNode = initialVNode;
- queuePostRenderEffect(
- () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode),
- parentSuspense
- );
- }
- if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) {
- instance.a && queuePostRenderEffect(instance.a, parentSuspense);
- }
- instance.isMounted = true;
- initialVNode = container = anchor = null;
- } else {
- let { next, bu, u, parent, vnode } = instance;
- {
- const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
- if (nonHydratedAsyncRoot) {
- if (next) {
- next.el = vnode.el;
- updateComponentPreRender(instance, next, optimized);
- }
- nonHydratedAsyncRoot.asyncDep.then(() => {
- if (!instance.isUnmounted) {
- componentUpdateFn();
- }
- });
- return;
- }
- }
- let originNext = next;
- let vnodeHook;
- toggleRecurse(instance, false);
- if (next) {
- next.el = vnode.el;
- updateComponentPreRender(instance, next, optimized);
- } else {
- next = vnode;
- }
- if (bu) {
- invokeArrayFns(bu);
- }
- if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
- invokeVNodeHook(vnodeHook, parent, next, vnode);
- }
- toggleRecurse(instance, true);
- const nextTree = renderComponentRoot(instance);
- const prevTree = instance.subTree;
- instance.subTree = nextTree;
- patch(
- prevTree,
- nextTree,
- // parent may have changed if it's in a teleport
- hostParentNode(prevTree.el),
- // anchor may have changed if it's in a fragment
- getNextHostNode(prevTree),
- instance,
- parentSuspense,
- namespace
- );
- next.el = nextTree.el;
- if (originNext === null) {
- updateHOCHostEl(instance, nextTree.el);
- }
- if (u) {
- queuePostRenderEffect(u, parentSuspense);
- }
- if (vnodeHook = next.props && next.props.onVnodeUpdated) {
- queuePostRenderEffect(
- () => invokeVNodeHook(vnodeHook, parent, next, vnode),
- parentSuspense
- );
- }
- }
- };
- instance.scope.on();
- const effect = instance.effect = new ReactiveEffect(componentUpdateFn);
- instance.scope.off();
- const update = instance.update = effect.run.bind(effect);
- const job = instance.job = effect.runIfDirty.bind(effect);
- job.i = instance;
- job.id = instance.uid;
- effect.scheduler = () => queueJob(job);
- toggleRecurse(instance, true);
- update();
- };
- const updateComponentPreRender = (instance, nextVNode, optimized) => {
- nextVNode.component = instance;
- const prevProps = instance.vnode.props;
- instance.vnode = nextVNode;
- instance.next = null;
- updateProps(instance, nextVNode.props, prevProps, optimized);
- updateSlots(instance, nextVNode.children, optimized);
- pauseTracking();
- flushPreFlushCbs(instance);
- resetTracking();
- };
- const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
- const c1 = n1 && n1.children;
- const prevShapeFlag = n1 ? n1.shapeFlag : 0;
- const c2 = n2.children;
- const { patchFlag, shapeFlag } = n2;
- if (patchFlag > 0) {
- if (patchFlag & 128) {
- patchKeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- return;
- } else if (patchFlag & 256) {
- patchUnkeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- return;
- }
- }
- if (shapeFlag & 8) {
- if (prevShapeFlag & 16) {
- unmountChildren(c1, parentComponent, parentSuspense);
- }
- if (c2 !== c1) {
- hostSetElementText(container, c2);
- }
- } else {
- if (prevShapeFlag & 16) {
- if (shapeFlag & 16) {
- patchKeyedChildren(
- c1,
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- unmountChildren(c1, parentComponent, parentSuspense, true);
- }
- } else {
- if (prevShapeFlag & 8) {
- hostSetElementText(container, "");
- }
- if (shapeFlag & 16) {
- mountChildren(
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- }
- }
- };
- const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- c1 = c1 || EMPTY_ARR;
- c2 = c2 || EMPTY_ARR;
- const oldLength = c1.length;
- const newLength = c2.length;
- const commonLength = Math.min(oldLength, newLength);
- let i;
- for (i = 0; i < commonLength; i++) {
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- patch(
- c1[i],
- nextChild,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- }
- if (oldLength > newLength) {
- unmountChildren(
- c1,
- parentComponent,
- parentSuspense,
- true,
- false,
- commonLength
- );
- } else {
- mountChildren(
- c2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- commonLength
- );
- }
- };
- const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
- let i = 0;
- const l2 = c2.length;
- let e1 = c1.length - 1;
- let e2 = l2 - 1;
- while (i <= e1 && i <= e2) {
- const n1 = c1[i];
- const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- if (isSameVNodeType(n1, n2)) {
- patch(
- n1,
- n2,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- break;
- }
- i++;
- }
- while (i <= e1 && i <= e2) {
- const n1 = c1[e1];
- const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
- if (isSameVNodeType(n1, n2)) {
- patch(
- n1,
- n2,
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else {
- break;
- }
- e1--;
- e2--;
- }
- if (i > e1) {
- if (i <= e2) {
- const nextPos = e2 + 1;
- const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
- while (i <= e2) {
- patch(
- null,
- c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]),
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- i++;
- }
- }
- } else if (i > e2) {
- while (i <= e1) {
- unmount(c1[i], parentComponent, parentSuspense, true);
- i++;
- }
- } else {
- const s1 = i;
- const s2 = i;
- const keyToNewIndexMap = /* @__PURE__ */ new Map();
- for (i = s2; i <= e2; i++) {
- const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]);
- if (nextChild.key != null) {
- keyToNewIndexMap.set(nextChild.key, i);
- }
- }
- let j;
- let patched = 0;
- const toBePatched = e2 - s2 + 1;
- let moved = false;
- let maxNewIndexSoFar = 0;
- const newIndexToOldIndexMap = new Array(toBePatched);
- for (i = 0; i < toBePatched; i++)
- newIndexToOldIndexMap[i] = 0;
- for (i = s1; i <= e1; i++) {
- const prevChild = c1[i];
- if (patched >= toBePatched) {
- unmount(prevChild, parentComponent, parentSuspense, true);
- continue;
- }
- let newIndex;
- if (prevChild.key != null) {
- newIndex = keyToNewIndexMap.get(prevChild.key);
- } else {
- for (j = s2; j <= e2; j++) {
- if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
- newIndex = j;
- break;
- }
- }
- }
- if (newIndex === void 0) {
- unmount(prevChild, parentComponent, parentSuspense, true);
- } else {
- newIndexToOldIndexMap[newIndex - s2] = i + 1;
- if (newIndex >= maxNewIndexSoFar) {
- maxNewIndexSoFar = newIndex;
- } else {
- moved = true;
- }
- patch(
- prevChild,
- c2[newIndex],
- container,
- null,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- patched++;
- }
- }
- const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
- j = increasingNewIndexSequence.length - 1;
- for (i = toBePatched - 1; i >= 0; i--) {
- const nextIndex = s2 + i;
- const nextChild = c2[nextIndex];
- const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
- if (newIndexToOldIndexMap[i] === 0) {
- patch(
- null,
- nextChild,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized
- );
- } else if (moved) {
- if (j < 0 || i !== increasingNewIndexSequence[j]) {
- move(nextChild, container, anchor, 2);
- } else {
- j--;
- }
- }
- }
- }
- };
- const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
- const { el, type, transition, children, shapeFlag } = vnode;
- if (shapeFlag & 6) {
- move(vnode.component.subTree, container, anchor, moveType);
- return;
- }
- if (shapeFlag & 128) {
- vnode.suspense.move(container, anchor, moveType);
- return;
- }
- if (shapeFlag & 64) {
- type.move(vnode, container, anchor, internals);
- return;
- }
- if (type === Fragment) {
- hostInsert(el, container, anchor);
- for (let i = 0; i < children.length; i++) {
- move(children[i], container, anchor, moveType);
- }
- hostInsert(vnode.anchor, container, anchor);
- return;
- }
- if (type === Static) {
- moveStaticNode(vnode, container, anchor);
- return;
- }
- const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
- if (needTransition2) {
- if (moveType === 0) {
- transition.beforeEnter(el);
- hostInsert(el, container, anchor);
- queuePostRenderEffect(() => transition.enter(el), parentSuspense);
- } else {
- const { leave, delayLeave, afterLeave } = transition;
- const remove22 = () => hostInsert(el, container, anchor);
- const performLeave = () => {
- leave(el, () => {
- remove22();
- afterLeave && afterLeave();
- });
- };
- if (delayLeave) {
- delayLeave(el, remove22, performLeave);
- } else {
- performLeave();
- }
- }
- } else {
- hostInsert(el, container, anchor);
- }
- };
- const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
- const {
- type,
- props,
- ref: ref2,
- children,
- dynamicChildren,
- shapeFlag,
- patchFlag,
- dirs,
- cacheIndex
- } = vnode;
- if (patchFlag === -2) {
- optimized = false;
- }
- if (ref2 != null) {
- setRef(ref2, null, parentSuspense, vnode, true);
- }
- if (cacheIndex != null) {
- parentComponent.renderCache[cacheIndex] = void 0;
- }
- if (shapeFlag & 256) {
- parentComponent.ctx.deactivate(vnode);
- return;
- }
- const shouldInvokeDirs = shapeFlag & 1 && dirs;
- const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
- let vnodeHook;
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) {
- invokeVNodeHook(vnodeHook, parentComponent, vnode);
- }
- if (shapeFlag & 6) {
- unmountComponent(vnode.component, parentSuspense, doRemove);
- } else {
- if (shapeFlag & 128) {
- vnode.suspense.unmount(parentSuspense, doRemove);
- return;
- }
- if (shouldInvokeDirs) {
- invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
- }
- if (shapeFlag & 64) {
- vnode.type.remove(
- vnode,
- parentComponent,
- parentSuspense,
- internals,
- doRemove
- );
- } else if (dynamicChildren && // #5154
- // when v-once is used inside a block, setBlockTracking(-1) marks the
- // parent block with hasOnce: true
- // so that it doesn't take the fast path during unmount - otherwise
- // components nested in v-once are never unmounted.
- !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
- (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
- unmountChildren(
- dynamicChildren,
- parentComponent,
- parentSuspense,
- false,
- true
- );
- } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
- unmountChildren(children, parentComponent, parentSuspense);
- }
- if (doRemove) {
- remove2(vnode);
- }
- }
- if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) {
- queuePostRenderEffect(() => {
- vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
- shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
- }, parentSuspense);
- }
- };
- const remove2 = (vnode) => {
- const { type, el, anchor, transition } = vnode;
- if (type === Fragment) {
- {
- removeFragment(el, anchor);
- }
- return;
- }
- if (type === Static) {
- removeStaticNode(vnode);
- return;
- }
- const performRemove = () => {
- hostRemove(el);
- if (transition && !transition.persisted && transition.afterLeave) {
- transition.afterLeave();
- }
- };
- if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
- const { leave, delayLeave } = transition;
- const performLeave = () => leave(el, performRemove);
- if (delayLeave) {
- delayLeave(vnode.el, performRemove, performLeave);
- } else {
- performLeave();
- }
- } else {
- performRemove();
- }
- };
- const removeFragment = (cur, end) => {
- let next;
- while (cur !== end) {
- next = hostNextSibling(cur);
- hostRemove(cur);
- cur = next;
- }
- hostRemove(end);
- };
- const unmountComponent = (instance, parentSuspense, doRemove) => {
- const { bum, scope, job, subTree, um, m, a } = instance;
- invalidateMount(m);
- invalidateMount(a);
- if (bum) {
- invokeArrayFns(bum);
- }
- scope.stop();
- if (job) {
- job.flags |= 8;
- unmount(subTree, instance, parentSuspense, doRemove);
- }
- if (um) {
- queuePostRenderEffect(um, parentSuspense);
- }
- queuePostRenderEffect(() => {
- instance.isUnmounted = true;
- }, parentSuspense);
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
- parentSuspense.deps--;
- if (parentSuspense.deps === 0) {
- parentSuspense.resolve();
- }
- }
- };
- const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {
- for (let i = start; i < children.length; i++) {
- unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);
- }
- };
- const getNextHostNode = (vnode) => {
- if (vnode.shapeFlag & 6) {
- return getNextHostNode(vnode.component.subTree);
- }
- if (vnode.shapeFlag & 128) {
- return vnode.suspense.next();
- }
- const el = hostNextSibling(vnode.anchor || vnode.el);
- const teleportEnd = el && el[TeleportEndKey];
- return teleportEnd ? hostNextSibling(teleportEnd) : el;
- };
- let isFlushing2 = false;
- const render = (vnode, container, namespace) => {
- if (vnode == null) {
- if (container._vnode) {
- unmount(container._vnode, null, null, true);
- }
- } else {
- patch(
- container._vnode || null,
- vnode,
- container,
- null,
- null,
- null,
- namespace
- );
- }
- container._vnode = vnode;
- if (!isFlushing2) {
- isFlushing2 = true;
- flushPreFlushCbs();
- flushPostFlushCbs();
- isFlushing2 = false;
- }
- };
- const internals = {
- p: patch,
- um: unmount,
- m: move,
- r: remove2,
- mt: mountComponent,
- mc: mountChildren,
- pc: patchChildren,
- pbc: patchBlockChildren,
- n: getNextHostNode,
- o: options
- };
- let hydrate;
- let hydrateNode;
- if (createHydrationFns) {
- [hydrate, hydrateNode] = createHydrationFns(
- internals
- );
- }
- return {
- render,
- hydrate,
- createApp: createAppAPI(render, hydrate)
- };
- }
- function resolveChildrenNamespace({ type, props }, currentNamespace) {
- return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
- }
- function toggleRecurse({ effect, job }, allowed) {
- if (allowed) {
- effect.flags |= 32;
- job.flags |= 4;
- } else {
- effect.flags &= ~32;
- job.flags &= ~4;
- }
- }
- function needTransition(parentSuspense, transition) {
- return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
- }
- function traverseStaticChildren(n1, n2, shallow = false) {
- const ch1 = n1.children;
- const ch2 = n2.children;
- if (isArray$1(ch1) && isArray$1(ch2)) {
- for (let i = 0; i < ch1.length; i++) {
- const c1 = ch1[i];
- let c2 = ch2[i];
- if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
- if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
- c2 = ch2[i] = cloneIfMounted(ch2[i]);
- c2.el = c1.el;
- }
- if (!shallow && c2.patchFlag !== -2)
- traverseStaticChildren(c1, c2);
- }
- if (c2.type === Text) {
- c2.el = c1.el;
- }
- }
- }
- }
- function getSequence(arr) {
- const p2 = arr.slice();
- const result = [0];
- let i, j, u, v, c;
- const len = arr.length;
- for (i = 0; i < len; i++) {
- const arrI = arr[i];
- if (arrI !== 0) {
- j = result[result.length - 1];
- if (arr[j] < arrI) {
- p2[i] = j;
- result.push(i);
- continue;
- }
- u = 0;
- v = result.length - 1;
- while (u < v) {
- c = u + v >> 1;
- if (arr[result[c]] < arrI) {
- u = c + 1;
- } else {
- v = c;
- }
- }
- if (arrI < arr[result[u]]) {
- if (u > 0) {
- p2[i] = result[u - 1];
- }
- result[u] = i;
- }
- }
- }
- u = result.length;
- v = result[u - 1];
- while (u-- > 0) {
- result[u] = v;
- v = p2[v];
- }
- return result;
- }
- function locateNonHydratedAsyncRoot(instance) {
- const subComponent = instance.subTree.component;
- if (subComponent) {
- if (subComponent.asyncDep && !subComponent.asyncResolved) {
- return subComponent;
- } else {
- return locateNonHydratedAsyncRoot(subComponent);
- }
- }
- }
- function invalidateMount(hooks) {
- if (hooks) {
- for (let i = 0; i < hooks.length; i++)
- hooks[i].flags |= 8;
- }
- }
- const ssrContextKey = Symbol.for("v-scx");
- const useSSRContext = () => {
- {
- const ctx = inject(ssrContextKey);
- return ctx;
- }
- };
- function watchEffect(effect, options) {
- return doWatch(effect, null, options);
- }
- function watch(source, cb, options) {
- return doWatch(source, cb, options);
- }
- function doWatch(source, cb, options = EMPTY_OBJ) {
- const { immediate, deep, flush, once } = options;
- const baseWatchOptions = extend({}, options);
- let ssrCleanup;
- if (isInSSRComponentSetup) {
- if (flush === "sync") {
- const ctx = useSSRContext();
- ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
- } else if (!cb || immediate) {
- baseWatchOptions.once = true;
- } else {
- return {
- stop: NOOP,
- resume: NOOP,
- pause: NOOP
- };
- }
- }
- const instance = currentInstance;
- baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
- let isPre = false;
- if (flush === "post") {
- baseWatchOptions.scheduler = (job) => {
- queuePostRenderEffect(job, instance && instance.suspense);
- };
- } else if (flush !== "sync") {
- isPre = true;
- baseWatchOptions.scheduler = (job, isFirstRun) => {
- if (isFirstRun) {
- job();
- } else {
- queueJob(job);
- }
- };
- }
- baseWatchOptions.augmentJob = (job) => {
- if (cb) {
- job.flags |= 4;
- }
- if (isPre) {
- job.flags |= 2;
- if (instance) {
- job.id = instance.uid;
- job.i = instance;
- }
- }
- };
- const watchHandle = watch$1(source, cb, baseWatchOptions);
- if (ssrCleanup)
- ssrCleanup.push(watchHandle);
- return watchHandle;
- }
- function instanceWatch(source, value, options) {
- const publicThis = this.proxy;
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
- let cb;
- if (isFunction(value)) {
- cb = value;
- } else {
- cb = value.handler;
- options = value;
- }
- const reset = setCurrentInstance(this);
- const res = doWatch(getter, cb.bind(publicThis), options);
- reset();
- return res;
- }
- function createPathGetter(ctx, path) {
- const segments = path.split(".");
- return () => {
- let cur = ctx;
- for (let i = 0; i < segments.length && cur; i++) {
- cur = cur[segments[i]];
- }
- return cur;
- };
- }
- const getModelModifiers = (props, modelName) => {
- return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
- };
- function emit(instance, event, ...rawArgs) {
- if (instance.isUnmounted)
- return;
- const props = instance.vnode.props || EMPTY_OBJ;
- let args = rawArgs;
- const isModelListener2 = event.startsWith("update:");
- const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7));
- if (modifiers) {
- if (modifiers.trim) {
- args = rawArgs.map((a) => isString(a) ? a.trim() : a);
- }
- if (modifiers.number) {
- args = rawArgs.map(looseToNumber);
- }
- }
- let handlerName;
- let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
- props[handlerName = toHandlerKey(camelize(event))];
- if (!handler && isModelListener2) {
- handler = props[handlerName = toHandlerKey(hyphenate(event))];
- }
- if (handler) {
- callWithAsyncErrorHandling(
- handler,
- instance,
- 6,
- args
- );
- }
- const onceHandler = props[handlerName + `Once`];
- if (onceHandler) {
- if (!instance.emitted) {
- instance.emitted = {};
- } else if (instance.emitted[handlerName]) {
- return;
- }
- instance.emitted[handlerName] = true;
- callWithAsyncErrorHandling(
- onceHandler,
- instance,
- 6,
- args
- );
- }
- }
- function normalizeEmitsOptions(comp, appContext, asMixin = false) {
- const cache = appContext.emitsCache;
- const cached = cache.get(comp);
- if (cached !== void 0) {
- return cached;
- }
- const raw = comp.emits;
- let normalized = {};
- let hasExtends = false;
- if (!isFunction(comp)) {
- const extendEmits = (raw2) => {
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
- if (normalizedFromExtend) {
- hasExtends = true;
- extend(normalized, normalizedFromExtend);
- }
- };
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendEmits);
- }
- if (comp.extends) {
- extendEmits(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendEmits);
- }
- }
- if (!raw && !hasExtends) {
- if (isObject(comp)) {
- cache.set(comp, null);
- }
- return null;
- }
- if (isArray$1(raw)) {
- raw.forEach((key) => normalized[key] = null);
- } else {
- extend(normalized, raw);
- }
- if (isObject(comp)) {
- cache.set(comp, normalized);
- }
- return normalized;
- }
- function isEmitListener(options, key) {
- if (!options || !isOn(key)) {
- return false;
- }
- key = key.slice(2).replace(/Once$/, "");
- return hasOwn(options, key[0].toLowerCase() + key.slice(1)) || hasOwn(options, hyphenate(key)) || hasOwn(options, key);
- }
- function markAttrsAccessed() {
- }
- function renderComponentRoot(instance) {
- const {
- type: Component,
- vnode,
- proxy,
- withProxy,
- propsOptions: [propsOptions],
- slots,
- attrs,
- emit: emit2,
- render,
- renderCache,
- props,
- data,
- setupState,
- ctx,
- inheritAttrs
- } = instance;
- const prev = setCurrentRenderingInstance(instance);
- let result;
- let fallthroughAttrs;
- try {
- if (vnode.shapeFlag & 4) {
- const proxyToUse = withProxy || proxy;
- const thisProxy = false ? new Proxy(proxyToUse, {
- get(target, key, receiver) {
- warn$1(
- `Property '${String(
- key
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
- );
- return Reflect.get(target, key, receiver);
- }
- }) : proxyToUse;
- result = normalizeVNode(
- render.call(
- thisProxy,
- proxyToUse,
- renderCache,
- false ? shallowReadonly(props) : props,
- setupState,
- data,
- ctx
- )
- );
- fallthroughAttrs = attrs;
- } else {
- const render2 = Component;
- if (false)
- ;
- result = normalizeVNode(
- render2.length > 1 ? render2(
- false ? shallowReadonly(props) : props,
- false ? {
- get attrs() {
- markAttrsAccessed();
- return shallowReadonly(attrs);
- },
- slots,
- emit: emit2
- } : { attrs, slots, emit: emit2 }
- ) : render2(
- false ? shallowReadonly(props) : props,
- null
- )
- );
- fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
- }
- } catch (err) {
- blockStack.length = 0;
- handleError(err, instance, 1);
- result = createVNode(Comment);
- }
- let root = result;
- if (fallthroughAttrs && inheritAttrs !== false) {
- const keys = Object.keys(fallthroughAttrs);
- const { shapeFlag } = root;
- if (keys.length) {
- if (shapeFlag & (1 | 6)) {
- if (propsOptions && keys.some(isModelListener)) {
- fallthroughAttrs = filterModelListeners(
- fallthroughAttrs,
- propsOptions
- );
- }
- root = cloneVNode(root, fallthroughAttrs, false, true);
- }
- }
- }
- if (vnode.dirs) {
- root = cloneVNode(root, null, false, true);
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
- }
- if (vnode.transition) {
- setTransitionHooks(root, vnode.transition);
- }
- {
- result = root;
- }
- setCurrentRenderingInstance(prev);
- return result;
- }
- const getFunctionalFallthrough = (attrs) => {
- let res;
- for (const key in attrs) {
- if (key === "class" || key === "style" || isOn(key)) {
- (res || (res = {}))[key] = attrs[key];
- }
- }
- return res;
- };
- const filterModelListeners = (attrs, props) => {
- const res = {};
- for (const key in attrs) {
- if (!isModelListener(key) || !(key.slice(9) in props)) {
- res[key] = attrs[key];
- }
- }
- return res;
- };
- function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
- const { props: prevProps, children: prevChildren, component } = prevVNode;
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
- const emits = component.emitsOptions;
- if (nextVNode.dirs || nextVNode.transition) {
- return true;
- }
- if (optimized && patchFlag >= 0) {
- if (patchFlag & 1024) {
- return true;
- }
- if (patchFlag & 16) {
- if (!prevProps) {
- return !!nextProps;
- }
- return hasPropsChanged(prevProps, nextProps, emits);
- } else if (patchFlag & 8) {
- const dynamicProps = nextVNode.dynamicProps;
- for (let i = 0; i < dynamicProps.length; i++) {
- const key = dynamicProps[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
- return true;
- }
- }
- }
- } else {
- if (prevChildren || nextChildren) {
- if (!nextChildren || !nextChildren.$stable) {
- return true;
- }
- }
- if (prevProps === nextProps) {
- return false;
- }
- if (!prevProps) {
- return !!nextProps;
- }
- if (!nextProps) {
- return true;
- }
- return hasPropsChanged(prevProps, nextProps, emits);
- }
- return false;
- }
- function hasPropsChanged(prevProps, nextProps, emitsOptions) {
- const nextKeys = Object.keys(nextProps);
- if (nextKeys.length !== Object.keys(prevProps).length) {
- return true;
- }
- for (let i = 0; i < nextKeys.length; i++) {
- const key = nextKeys[i];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
- return true;
- }
- }
- return false;
- }
- function updateHOCHostEl({ vnode, parent }, el) {
- while (parent) {
- const root = parent.subTree;
- if (root.suspense && root.suspense.activeBranch === vnode) {
- root.el = vnode.el;
- }
- if (root === vnode) {
- (vnode = parent.vnode).el = el;
- parent = parent.parent;
- } else {
- break;
- }
- }
- }
- const isSuspense = (type) => type.__isSuspense;
- function queueEffectWithSuspense(fn, suspense) {
- if (suspense && suspense.pendingBranch) {
- if (isArray$1(fn)) {
- suspense.effects.push(...fn);
- } else {
- suspense.effects.push(fn);
- }
- } else {
- queuePostFlushCb(fn);
- }
- }
- const Fragment = Symbol.for("v-fgt");
- const Text = Symbol.for("v-txt");
- const Comment = Symbol.for("v-cmt");
- const Static = Symbol.for("v-stc");
- const blockStack = [];
- let currentBlock = null;
- function openBlock(disableTracking = false) {
- blockStack.push(currentBlock = disableTracking ? null : []);
- }
- function closeBlock() {
- blockStack.pop();
- currentBlock = blockStack[blockStack.length - 1] || null;
- }
- let isBlockTreeEnabled = 1;
- function setBlockTracking(value) {
- isBlockTreeEnabled += value;
- if (value < 0 && currentBlock) {
- currentBlock.hasOnce = true;
- }
- }
- function setupBlock(vnode) {
- vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
- closeBlock();
- if (isBlockTreeEnabled > 0 && currentBlock) {
- currentBlock.push(vnode);
- }
- return vnode;
- }
- function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {
- return setupBlock(
- createBaseVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- shapeFlag,
- true
- )
- );
- }
- function createBlock(type, props, children, patchFlag, dynamicProps) {
- return setupBlock(
- createVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- true
- )
- );
- }
- function isVNode(value) {
- return value ? value.__v_isVNode === true : false;
- }
- function isSameVNodeType(n1, n2) {
- return n1.type === n2.type && n1.key === n2.key;
- }
- const normalizeKey = ({ key }) => key != null ? key : null;
- const normalizeRef = ({
- ref: ref2,
- ref_key,
- ref_for
- }) => {
- if (typeof ref2 === "number") {
- ref2 = "" + ref2;
- }
- return ref2 != null ? isString(ref2) || isRef(ref2) || isFunction(ref2) ? { i: currentRenderingInstance, r: ref2, k: ref_key, f: !!ref_for } : ref2 : null;
- };
- function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
- const vnode = {
- __v_isVNode: true,
- __v_skip: true,
- type,
- props,
- key: props && normalizeKey(props),
- ref: props && normalizeRef(props),
- scopeId: currentScopeId,
- slotScopeIds: null,
- children,
- component: null,
- suspense: null,
- ssContent: null,
- ssFallback: null,
- dirs: null,
- transition: null,
- el: null,
- anchor: null,
- target: null,
- targetStart: null,
- targetAnchor: null,
- staticCount: 0,
- shapeFlag,
- patchFlag,
- dynamicProps,
- dynamicChildren: null,
- appContext: null,
- ctx: currentRenderingInstance
- };
- if (needFullChildrenNormalization) {
- normalizeChildren(vnode, children);
- if (shapeFlag & 128) {
- type.normalize(vnode);
- }
- } else if (children) {
- vnode.shapeFlag |= isString(children) ? 8 : 16;
- }
- if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
- !isBlockNode && // has current parent block
- currentBlock && // presence of a patch flag indicates this node needs patching on updates.
- // component nodes also should always be patched, because even if the
- // component doesn't need to update, it needs to persist the instance on to
- // the next vnode so that it can be properly unmounted later.
- (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
- // vnode should not be considered dynamic due to handler caching.
- vnode.patchFlag !== 32) {
- currentBlock.push(vnode);
- }
- return vnode;
- }
- const createVNode = _createVNode;
- function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
- if (!type || type === NULL_DYNAMIC_COMPONENT) {
- type = Comment;
- }
- if (isVNode(type)) {
- const cloned = cloneVNode(
- type,
- props,
- true
- /* mergeRef: true */
- );
- if (children) {
- normalizeChildren(cloned, children);
- }
- if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
- if (cloned.shapeFlag & 6) {
- currentBlock[currentBlock.indexOf(type)] = cloned;
- } else {
- currentBlock.push(cloned);
- }
- }
- cloned.patchFlag = -2;
- return cloned;
- }
- if (isClassComponent(type)) {
- type = type.__vccOpts;
- }
- if (props) {
- props = guardReactiveProps(props);
- let { class: klass, style: style2 } = props;
- if (klass && !isString(klass)) {
- props.class = normalizeClass(klass);
- }
- if (isObject(style2)) {
- if (isProxy(style2) && !isArray$1(style2)) {
- style2 = extend({}, style2);
- }
- props.style = normalizeStyle(style2);
- }
- }
- const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject(type) ? 4 : isFunction(type) ? 2 : 0;
- return createBaseVNode(
- type,
- props,
- children,
- patchFlag,
- dynamicProps,
- shapeFlag,
- isBlockNode,
- true
- );
- }
- function guardReactiveProps(props) {
- if (!props)
- return null;
- return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
- }
- function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
- const { props, ref: ref2, patchFlag, children, transition } = vnode;
- const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;
- const cloned = {
- __v_isVNode: true,
- __v_skip: true,
- type: vnode.type,
- props: mergedProps,
- key: mergedProps && normalizeKey(mergedProps),
- ref: extraProps && extraProps.ref ? (
- // #2078 in the case of <component :is="vnode" ref="extra"/>
- // if the vnode itself already has a ref, cloneVNode will need to merge
- // the refs so the single vnode can be set on multiple refs
- mergeRef && ref2 ? isArray$1(ref2) ? ref2.concat(normalizeRef(extraProps)) : [ref2, normalizeRef(extraProps)] : normalizeRef(extraProps)
- ) : ref2,
- scopeId: vnode.scopeId,
- slotScopeIds: vnode.slotScopeIds,
- children,
- target: vnode.target,
- targetStart: vnode.targetStart,
- targetAnchor: vnode.targetAnchor,
- staticCount: vnode.staticCount,
- shapeFlag: vnode.shapeFlag,
- // if the vnode is cloned with extra props, we can no longer assume its
- // existing patch flag to be reliable and need to add the FULL_PROPS flag.
- // note: preserve flag for fragments since they use the flag for children
- // fast paths only.
- patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
- dynamicProps: vnode.dynamicProps,
- dynamicChildren: vnode.dynamicChildren,
- appContext: vnode.appContext,
- dirs: vnode.dirs,
- transition,
- // These should technically only be non-null on mounted VNodes. However,
- // they *should* be copied for kept-alive vnodes. So we just always copy
- // them since them being non-null during a mount doesn't affect the logic as
- // they will simply be overwritten.
- component: vnode.component,
- suspense: vnode.suspense,
- ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
- ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
- el: vnode.el,
- anchor: vnode.anchor,
- ctx: vnode.ctx,
- ce: vnode.ce
- };
- if (transition && cloneTransition) {
- setTransitionHooks(
- cloned,
- transition.clone(cloned)
- );
- }
- return cloned;
- }
- function createTextVNode(text = " ", flag = 0) {
- return createVNode(Text, null, text, flag);
- }
- function createStaticVNode(content, numberOfNodes) {
- const vnode = createVNode(Static, null, content);
- vnode.staticCount = numberOfNodes;
- return vnode;
- }
- function createCommentVNode(text = "", asBlock = false) {
- return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
- }
- function normalizeVNode(child) {
- if (child == null || typeof child === "boolean") {
- return createVNode(Comment);
- } else if (isArray$1(child)) {
- return createVNode(
- Fragment,
- null,
- // #3666, avoid reference pollution when reusing vnode
- child.slice()
- );
- } else if (typeof child === "object") {
- return cloneIfMounted(child);
- } else {
- return createVNode(Text, null, String(child));
- }
- }
- function cloneIfMounted(child) {
- return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
- }
- function normalizeChildren(vnode, children) {
- let type = 0;
- const { shapeFlag } = vnode;
- if (children == null) {
- children = null;
- } else if (isArray$1(children)) {
- type = 16;
- } else if (typeof children === "object") {
- if (shapeFlag & (1 | 64)) {
- const slot = children.default;
- if (slot) {
- slot._c && (slot._d = false);
- normalizeChildren(vnode, slot());
- slot._c && (slot._d = true);
- }
- return;
- } else {
- type = 32;
- const slotFlag = children._;
- if (!slotFlag && !isInternalObject(children)) {
- children._ctx = currentRenderingInstance;
- } else if (slotFlag === 3 && currentRenderingInstance) {
- if (currentRenderingInstance.slots._ === 1) {
- children._ = 1;
- } else {
- children._ = 2;
- vnode.patchFlag |= 1024;
- }
- }
- }
- } else if (isFunction(children)) {
- children = { default: children, _ctx: currentRenderingInstance };
- type = 32;
- } else {
- children = String(children);
- if (shapeFlag & 64) {
- type = 16;
- children = [createTextVNode(children)];
- } else {
- type = 8;
- }
- }
- vnode.children = children;
- vnode.shapeFlag |= type;
- }
- function mergeProps(...args) {
- const ret = {};
- for (let i = 0; i < args.length; i++) {
- const toMerge = args[i];
- for (const key in toMerge) {
- if (key === "class") {
- if (ret.class !== toMerge.class) {
- ret.class = normalizeClass([ret.class, toMerge.class]);
- }
- } else if (key === "style") {
- ret.style = normalizeStyle([ret.style, toMerge.style]);
- } else if (isOn(key)) {
- const existing = ret[key];
- const incoming = toMerge[key];
- if (incoming && existing !== incoming && !(isArray$1(existing) && existing.includes(incoming))) {
- ret[key] = existing ? [].concat(existing, incoming) : incoming;
- }
- } else if (key !== "") {
- ret[key] = toMerge[key];
- }
- }
- }
- return ret;
- }
- function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
- callWithAsyncErrorHandling(hook, instance, 7, [
- vnode,
- prevVNode
- ]);
- }
- const emptyAppContext = createAppContext();
- let uid = 0;
- function createComponentInstance(vnode, parent, suspense) {
- const type = vnode.type;
- const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
- const instance = {
- uid: uid++,
- vnode,
- type,
- parent,
- appContext,
- root: null,
- // to be immediately set
- next: null,
- subTree: null,
- // will be set synchronously right after creation
- effect: null,
- update: null,
- // will be set synchronously right after creation
- job: null,
- scope: new EffectScope(
- true
- /* detached */
- ),
- render: null,
- proxy: null,
- exposed: null,
- exposeProxy: null,
- withProxy: null,
- provides: parent ? parent.provides : Object.create(appContext.provides),
- ids: parent ? parent.ids : ["", 0, 0],
- accessCache: null,
- renderCache: [],
- // local resolved assets
- components: null,
- directives: null,
- // resolved props and emits options
- propsOptions: normalizePropsOptions(type, appContext),
- emitsOptions: normalizeEmitsOptions(type, appContext),
- // emit
- emit: null,
- // to be set immediately
- emitted: null,
- // props default value
- propsDefaults: EMPTY_OBJ,
- // inheritAttrs
- inheritAttrs: type.inheritAttrs,
- // state
- ctx: EMPTY_OBJ,
- data: EMPTY_OBJ,
- props: EMPTY_OBJ,
- attrs: EMPTY_OBJ,
- slots: EMPTY_OBJ,
- refs: EMPTY_OBJ,
- setupState: EMPTY_OBJ,
- setupContext: null,
- // suspense related
- suspense,
- suspenseId: suspense ? suspense.pendingId : 0,
- asyncDep: null,
- asyncResolved: false,
- // lifecycle hooks
- // not using enums here because it results in computed properties
- isMounted: false,
- isUnmounted: false,
- isDeactivated: false,
- bc: null,
- c: null,
- bm: null,
- m: null,
- bu: null,
- u: null,
- um: null,
- bum: null,
- da: null,
- a: null,
- rtg: null,
- rtc: null,
- ec: null,
- sp: null
- };
- {
- instance.ctx = { _: instance };
- }
- instance.root = parent ? parent.root : instance;
- instance.emit = emit.bind(null, instance);
- if (vnode.ce) {
- vnode.ce(instance);
- }
- return instance;
- }
- let currentInstance = null;
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
- let internalSetCurrentInstance;
- let setInSSRSetupState;
- {
- const g = getGlobalThis();
- const registerGlobalSetter = (key, setter) => {
- let setters;
- if (!(setters = g[key]))
- setters = g[key] = [];
- setters.push(setter);
- return (v) => {
- if (setters.length > 1)
- setters.forEach((set2) => set2(v));
- else
- setters[0](v);
- };
- };
- internalSetCurrentInstance = registerGlobalSetter(
- `__VUE_INSTANCE_SETTERS__`,
- (v) => currentInstance = v
- );
- setInSSRSetupState = registerGlobalSetter(
- `__VUE_SSR_SETTERS__`,
- (v) => isInSSRComponentSetup = v
- );
- }
- const setCurrentInstance = (instance) => {
- const prev = currentInstance;
- internalSetCurrentInstance(instance);
- instance.scope.on();
- return () => {
- instance.scope.off();
- internalSetCurrentInstance(prev);
- };
- };
- const unsetCurrentInstance = () => {
- currentInstance && currentInstance.scope.off();
- internalSetCurrentInstance(null);
- };
- function isStatefulComponent(instance) {
- return instance.vnode.shapeFlag & 4;
- }
- let isInSSRComponentSetup = false;
- function setupComponent(instance, isSSR = false, optimized = false) {
- isSSR && setInSSRSetupState(isSSR);
- const { props, children } = instance.vnode;
- const isStateful = isStatefulComponent(instance);
- initProps(instance, props, isStateful, isSSR);
- initSlots(instance, children, optimized);
- const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
- isSSR && setInSSRSetupState(false);
- return setupResult;
- }
- function setupStatefulComponent(instance, isSSR) {
- const Component = instance.type;
- instance.accessCache = /* @__PURE__ */ Object.create(null);
- instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
- const { setup } = Component;
- if (setup) {
- const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
- const reset = setCurrentInstance(instance);
- pauseTracking();
- const setupResult = callWithErrorHandling(
- setup,
- instance,
- 0,
- [
- instance.props,
- setupContext
- ]
- );
- resetTracking();
- reset();
- if (isPromise(setupResult)) {
- if (!isAsyncWrapper(instance))
- markAsyncBoundary(instance);
- setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
- if (isSSR) {
- return setupResult.then((resolvedResult) => {
- handleSetupResult(instance, resolvedResult, isSSR);
- }).catch((e) => {
- handleError(e, instance, 0);
- });
- } else {
- instance.asyncDep = setupResult;
- }
- } else {
- handleSetupResult(instance, setupResult, isSSR);
- }
- } else {
- finishComponentSetup(instance, isSSR);
- }
- }
- function handleSetupResult(instance, setupResult, isSSR) {
- if (isFunction(setupResult)) {
- if (instance.type.__ssrInlineRender) {
- instance.ssrRender = setupResult;
- } else {
- instance.render = setupResult;
- }
- } else if (isObject(setupResult)) {
- instance.setupState = proxyRefs(setupResult);
- } else
- ;
- finishComponentSetup(instance, isSSR);
- }
- let compile;
- function finishComponentSetup(instance, isSSR, skipOptions) {
- const Component = instance.type;
- if (!instance.render) {
- if (!isSSR && compile && !Component.render) {
- const template = Component.template || resolveMergedOptions(instance).template;
- if (template) {
- const { isCustomElement, compilerOptions } = instance.appContext.config;
- const { delimiters, compilerOptions: componentCompilerOptions } = Component;
- const finalCompilerOptions = extend(
- extend(
- {
- isCustomElement,
- delimiters
- },
- compilerOptions
- ),
- componentCompilerOptions
- );
- Component.render = compile(template, finalCompilerOptions);
- }
- }
- instance.render = Component.render || NOOP;
- }
- {
- const reset = setCurrentInstance(instance);
- pauseTracking();
- try {
- applyOptions(instance);
- } finally {
- resetTracking();
- reset();
- }
- }
- }
- const attrsProxyHandlers = {
- get(target, key) {
- track(target, "get", "");
- return target[key];
- }
- };
- function createSetupContext(instance) {
- const expose = (exposed) => {
- instance.exposed = exposed || {};
- };
- {
- return {
- attrs: new Proxy(instance.attrs, attrsProxyHandlers),
- slots: instance.slots,
- emit: instance.emit,
- expose
- };
- }
- }
- function getComponentPublicInstance(instance) {
- if (instance.exposed) {
- return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
- get(target, key) {
- if (key in target) {
- return target[key];
- } else if (key in publicPropertiesMap) {
- return publicPropertiesMap[key](instance);
- }
- },
- has(target, key) {
- return key in target || key in publicPropertiesMap;
- }
- }));
- } else {
- return instance.proxy;
- }
- }
- const classifyRE = /(?:^|[-_])(\w)/g;
- const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
- function getComponentName(Component, includeInferred = true) {
- return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
- }
- function formatComponentName(instance, Component, isRoot = false) {
- let name = getComponentName(Component);
- if (!name && Component.__file) {
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
- if (match) {
- name = match[1];
- }
- }
- if (!name && instance && instance.parent) {
- const inferFromRegistry = (registry) => {
- for (const key in registry) {
- if (registry[key] === Component) {
- return key;
- }
- }
- };
- name = inferFromRegistry(
- instance.components || instance.parent.type.components
- ) || inferFromRegistry(instance.appContext.components);
- }
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
- }
- function isClassComponent(value) {
- return isFunction(value) && "__vccOpts" in value;
- }
- const computed = (getterOrOptions, debugOptions) => {
- const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
- return c;
- };
- function h(type, propsOrChildren, children) {
- const l = arguments.length;
- if (l === 2) {
- if (isObject(propsOrChildren) && !isArray$1(propsOrChildren)) {
- if (isVNode(propsOrChildren)) {
- return createVNode(type, null, [propsOrChildren]);
- }
- return createVNode(type, propsOrChildren);
- } else {
- return createVNode(type, null, propsOrChildren);
- }
- } else {
- if (l > 3) {
- children = Array.prototype.slice.call(arguments, 2);
- } else if (l === 3 && isVNode(children)) {
- children = [children];
- }
- return createVNode(type, propsOrChildren, children);
- }
- }
- const version = "3.5.4";
- /**
- * @vue/runtime-dom v3.5.4
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/
- let policy = void 0;
- const tt = typeof window !== "undefined" && window.trustedTypes;
- if (tt) {
- try {
- policy = /* @__PURE__ */ tt.createPolicy("vue", {
- createHTML: (val) => val
- });
- } catch (e) {
- }
- }
- const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
- const svgNS = "http://www.w3.org/2000/svg";
- const mathmlNS = "http://www.w3.org/1998/Math/MathML";
- const doc = typeof document !== "undefined" ? document : null;
- const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
- const nodeOps = {
- insert: (child, parent, anchor) => {
- parent.insertBefore(child, anchor || null);
- },
- remove: (child) => {
- const parent = child.parentNode;
- if (parent) {
- parent.removeChild(child);
- }
- },
- createElement: (tag, namespace, is, props) => {
- const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
- if (tag === "select" && props && props.multiple != null) {
- el.setAttribute("multiple", props.multiple);
- }
- return el;
- },
- createText: (text) => doc.createTextNode(text),
- createComment: (text) => doc.createComment(text),
- setText: (node, text) => {
- node.nodeValue = text;
- },
- setElementText: (el, text) => {
- el.textContent = text;
- },
- parentNode: (node) => node.parentNode,
- nextSibling: (node) => node.nextSibling,
- querySelector: (selector) => doc.querySelector(selector),
- setScopeId(el, id) {
- el.setAttribute(id, "");
- },
- // __UNSAFE__
- // Reason: innerHTML.
- // Static content here can only come from compiled templates.
- // As long as the user only uses trusted templates, this is safe.
- insertStaticContent(content, parent, anchor, namespace, start, end) {
- const before = anchor ? anchor.previousSibling : parent.lastChild;
- if (start && (start === end || start.nextSibling)) {
- while (true) {
- parent.insertBefore(start.cloneNode(true), anchor);
- if (start === end || !(start = start.nextSibling))
- break;
- }
- } else {
- templateContainer.innerHTML = unsafeToTrustedHTML(
- namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
- );
- const template = templateContainer.content;
- if (namespace === "svg" || namespace === "mathml") {
- const wrapper = template.firstChild;
- while (wrapper.firstChild) {
- template.appendChild(wrapper.firstChild);
- }
- template.removeChild(wrapper);
- }
- parent.insertBefore(template, anchor);
- }
- return [
- // first
- before ? before.nextSibling : parent.firstChild,
- // last
- anchor ? anchor.previousSibling : parent.lastChild
- ];
- }
- };
- const TRANSITION = "transition";
- const ANIMATION = "animation";
- const vtcKey = Symbol("_vtc");
- const DOMTransitionPropsValidators = {
- name: String,
- type: String,
- css: {
- type: Boolean,
- default: true
- },
- duration: [String, Number, Object],
- enterFromClass: String,
- enterActiveClass: String,
- enterToClass: String,
- appearFromClass: String,
- appearActiveClass: String,
- appearToClass: String,
- leaveFromClass: String,
- leaveActiveClass: String,
- leaveToClass: String
- };
- const TransitionPropsValidators = /* @__PURE__ */ extend(
- {},
- BaseTransitionPropsValidators,
- DOMTransitionPropsValidators
- );
- const decorate$1 = (t) => {
- t.displayName = "Transition";
- t.props = TransitionPropsValidators;
- return t;
- };
- const Transition = /* @__PURE__ */ decorate$1(
- (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
- );
- const callHook = (hook, args = []) => {
- if (isArray$1(hook)) {
- hook.forEach((h2) => h2(...args));
- } else if (hook) {
- hook(...args);
- }
- };
- const hasExplicitCallback = (hook) => {
- return hook ? isArray$1(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
- };
- function resolveTransitionProps(rawProps) {
- const baseProps = {};
- for (const key in rawProps) {
- if (!(key in DOMTransitionPropsValidators)) {
- baseProps[key] = rawProps[key];
- }
- }
- if (rawProps.css === false) {
- return baseProps;
- }
- const {
- name = "v",
- type,
- duration,
- enterFromClass = `${name}-enter-from`,
- enterActiveClass = `${name}-enter-active`,
- enterToClass = `${name}-enter-to`,
- appearFromClass = enterFromClass,
- appearActiveClass = enterActiveClass,
- appearToClass = enterToClass,
- leaveFromClass = `${name}-leave-from`,
- leaveActiveClass = `${name}-leave-active`,
- leaveToClass = `${name}-leave-to`
- } = rawProps;
- const durations = normalizeDuration(duration);
- const enterDuration = durations && durations[0];
- const leaveDuration = durations && durations[1];
- const {
- onBeforeEnter,
- onEnter,
- onEnterCancelled,
- onLeave,
- onLeaveCancelled,
- onBeforeAppear = onBeforeEnter,
- onAppear = onEnter,
- onAppearCancelled = onEnterCancelled
- } = baseProps;
- const finishEnter = (el, isAppear, done) => {
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
- done && done();
- };
- const finishLeave = (el, done) => {
- el._isLeaving = false;
- removeTransitionClass(el, leaveFromClass);
- removeTransitionClass(el, leaveToClass);
- removeTransitionClass(el, leaveActiveClass);
- done && done();
- };
- const makeEnterHook = (isAppear) => {
- return (el, done) => {
- const hook = isAppear ? onAppear : onEnter;
- const resolve2 = () => finishEnter(el, isAppear, done);
- callHook(hook, [el, resolve2]);
- nextFrame(() => {
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
- if (!hasExplicitCallback(hook)) {
- whenTransitionEnds(el, type, enterDuration, resolve2);
- }
- });
- };
- };
- return extend(baseProps, {
- onBeforeEnter(el) {
- callHook(onBeforeEnter, [el]);
- addTransitionClass(el, enterFromClass);
- addTransitionClass(el, enterActiveClass);
- },
- onBeforeAppear(el) {
- callHook(onBeforeAppear, [el]);
- addTransitionClass(el, appearFromClass);
- addTransitionClass(el, appearActiveClass);
- },
- onEnter: makeEnterHook(false),
- onAppear: makeEnterHook(true),
- onLeave(el, done) {
- el._isLeaving = true;
- const resolve2 = () => finishLeave(el, done);
- addTransitionClass(el, leaveFromClass);
- addTransitionClass(el, leaveActiveClass);
- forceReflow();
- nextFrame(() => {
- if (!el._isLeaving) {
- return;
- }
- removeTransitionClass(el, leaveFromClass);
- addTransitionClass(el, leaveToClass);
- if (!hasExplicitCallback(onLeave)) {
- whenTransitionEnds(el, type, leaveDuration, resolve2);
- }
- });
- callHook(onLeave, [el, resolve2]);
- },
- onEnterCancelled(el) {
- finishEnter(el, false);
- callHook(onEnterCancelled, [el]);
- },
- onAppearCancelled(el) {
- finishEnter(el, true);
- callHook(onAppearCancelled, [el]);
- },
- onLeaveCancelled(el) {
- finishLeave(el);
- callHook(onLeaveCancelled, [el]);
- }
- });
- }
- function normalizeDuration(duration) {
- if (duration == null) {
- return null;
- } else if (isObject(duration)) {
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
- } else {
- const n = NumberOf(duration);
- return [n, n];
- }
- }
- function NumberOf(val) {
- const res = toNumber(val);
- return res;
- }
- function addTransitionClass(el, cls) {
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
- (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
- }
- function removeTransitionClass(el, cls) {
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
- const _vtc = el[vtcKey];
- if (_vtc) {
- _vtc.delete(cls);
- if (!_vtc.size) {
- el[vtcKey] = void 0;
- }
- }
- }
- function nextFrame(cb) {
- requestAnimationFrame(() => {
- requestAnimationFrame(cb);
- });
- }
- let endId = 0;
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
- const id = el._endId = ++endId;
- const resolveIfNotStale = () => {
- if (id === el._endId) {
- resolve2();
- }
- };
- if (explicitTimeout) {
- return setTimeout(resolveIfNotStale, explicitTimeout);
- }
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
- if (!type) {
- return resolve2();
- }
- const endEvent = type + "end";
- let ended = 0;
- const end = () => {
- el.removeEventListener(endEvent, onEnd);
- resolveIfNotStale();
- };
- const onEnd = (e) => {
- if (e.target === el && ++ended >= propCount) {
- end();
- }
- };
- setTimeout(() => {
- if (ended < propCount) {
- end();
- }
- }, timeout + 1);
- el.addEventListener(endEvent, onEnd);
- }
- function getTransitionInfo(el, expectedType) {
- const styles = window.getComputedStyle(el);
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
- const animationTimeout = getTimeout(animationDelays, animationDurations);
- let type = null;
- let timeout = 0;
- let propCount = 0;
- if (expectedType === TRANSITION) {
- if (transitionTimeout > 0) {
- type = TRANSITION;
- timeout = transitionTimeout;
- propCount = transitionDurations.length;
- }
- } else if (expectedType === ANIMATION) {
- if (animationTimeout > 0) {
- type = ANIMATION;
- timeout = animationTimeout;
- propCount = animationDurations.length;
- }
- } else {
- timeout = Math.max(transitionTimeout, animationTimeout);
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
- }
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
- getStyleProperties(`${TRANSITION}Property`).toString()
- );
- return {
- type,
- timeout,
- propCount,
- hasTransform
- };
- }
- function getTimeout(delays, durations) {
- while (delays.length < durations.length) {
- delays = delays.concat(delays);
- }
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
- }
- function toMs(s) {
- if (s === "auto")
- return 0;
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
- }
- function forceReflow() {
- return document.body.offsetHeight;
- }
- function patchClass(el, value, isSVG) {
- const transitionClasses = el[vtcKey];
- if (transitionClasses) {
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
- }
- if (value == null) {
- el.removeAttribute("class");
- } else if (isSVG) {
- el.setAttribute("class", value);
- } else {
- el.className = value;
- }
- }
- const vShowOriginalDisplay = Symbol("_vod");
- const vShowHidden = Symbol("_vsh");
- const vShow = {
- beforeMount(el, { value }, { transition }) {
- el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
- if (transition && value) {
- transition.beforeEnter(el);
- } else {
- setDisplay(el, value);
- }
- },
- mounted(el, { value }, { transition }) {
- if (transition && value) {
- transition.enter(el);
- }
- },
- updated(el, { value, oldValue }, { transition }) {
- if (!value === !oldValue)
- return;
- if (transition) {
- if (value) {
- transition.beforeEnter(el);
- setDisplay(el, true);
- transition.enter(el);
- } else {
- transition.leave(el, () => {
- setDisplay(el, false);
- });
- }
- } else {
- setDisplay(el, value);
- }
- },
- beforeUnmount(el, { value }) {
- setDisplay(el, value);
- }
- };
- function setDisplay(el, value) {
- el.style.display = value ? el[vShowOriginalDisplay] : "none";
- el[vShowHidden] = !value;
- }
- const CSS_VAR_TEXT = Symbol("");
- const displayRE = /(^|;)\s*display\s*:/;
- function patchStyle(el, prev, next) {
- const style2 = el.style;
- const isCssString = isString(next);
- let hasControlledDisplay = false;
- if (next && !isCssString) {
- if (prev) {
- if (!isString(prev)) {
- for (const key in prev) {
- if (next[key] == null) {
- setStyle(style2, key, "");
- }
- }
- } else {
- for (const prevStyle of prev.split(";")) {
- const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
- if (next[key] == null) {
- setStyle(style2, key, "");
- }
- }
- }
- }
- for (const key in next) {
- if (key === "display") {
- hasControlledDisplay = true;
- }
- setStyle(style2, key, next[key]);
- }
- } else {
- if (isCssString) {
- if (prev !== next) {
- const cssVarText = style2[CSS_VAR_TEXT];
- if (cssVarText) {
- next += ";" + cssVarText;
- }
- style2.cssText = next;
- hasControlledDisplay = displayRE.test(next);
- }
- } else if (prev) {
- el.removeAttribute("style");
- }
- }
- if (vShowOriginalDisplay in el) {
- el[vShowOriginalDisplay] = hasControlledDisplay ? style2.display : "";
- if (el[vShowHidden]) {
- style2.display = "none";
- }
- }
- }
- const importantRE = /\s*!important$/;
- function setStyle(style2, name, val) {
- if (isArray$1(val)) {
- val.forEach((v) => setStyle(style2, name, v));
- } else {
- if (val == null)
- val = "";
- if (name.startsWith("--")) {
- style2.setProperty(name, val);
- } else {
- const prefixed = autoPrefix(style2, name);
- if (importantRE.test(val)) {
- style2.setProperty(
- hyphenate(prefixed),
- val.replace(importantRE, ""),
- "important"
- );
- } else {
- style2[prefixed] = val;
- }
- }
- }
- }
- const prefixes = ["Webkit", "Moz", "ms"];
- const prefixCache = {};
- function autoPrefix(style2, rawName) {
- const cached = prefixCache[rawName];
- if (cached) {
- return cached;
- }
- let name = camelize(rawName);
- if (name !== "filter" && name in style2) {
- return prefixCache[rawName] = name;
- }
- name = capitalize(name);
- for (let i = 0; i < prefixes.length; i++) {
- const prefixed = prefixes[i] + name;
- if (prefixed in style2) {
- return prefixCache[rawName] = prefixed;
- }
- }
- return rawName;
- }
- const xlinkNS = "http://www.w3.org/1999/xlink";
- function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
- if (isSVG && key.startsWith("xlink:")) {
- if (value == null) {
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
- } else {
- el.setAttributeNS(xlinkNS, key, value);
- }
- } else {
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
- el.removeAttribute(key);
- } else {
- el.setAttribute(
- key,
- isBoolean ? "" : isSymbol(value) ? String(value) : value
- );
- }
- }
- }
- function patchDOMProp(el, key, value, parentComponent) {
- if (key === "innerHTML" || key === "textContent") {
- if (value != null) {
- el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
- }
- return;
- }
- const tag = el.tagName;
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
- !tag.includes("-")) {
- const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
- const newValue = value == null ? (
- // #11647: value should be set as empty string for null and undefined,
- // but <input type="checkbox"> should be set as 'on'.
- el.type === "checkbox" ? "on" : ""
- ) : String(value);
- if (oldValue !== newValue || !("_value" in el)) {
- el.value = newValue;
- }
- if (value == null) {
- el.removeAttribute(key);
- }
- el._value = value;
- return;
- }
- let needRemove = false;
- if (value === "" || value == null) {
- const type = typeof el[key];
- if (type === "boolean") {
- value = includeBooleanAttr(value);
- } else if (value == null && type === "string") {
- value = "";
- needRemove = true;
- } else if (type === "number") {
- value = 0;
- needRemove = true;
- }
- }
- try {
- el[key] = value;
- } catch (e) {
- }
- needRemove && el.removeAttribute(key);
- }
- function addEventListener(el, event, handler, options) {
- el.addEventListener(event, handler, options);
- }
- function removeEventListener(el, event, handler, options) {
- el.removeEventListener(event, handler, options);
- }
- const veiKey = Symbol("_vei");
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
- const invokers = el[veiKey] || (el[veiKey] = {});
- const existingInvoker = invokers[rawName];
- if (nextValue && existingInvoker) {
- existingInvoker.value = nextValue;
- } else {
- const [name, options] = parseName(rawName);
- if (nextValue) {
- const invoker = invokers[rawName] = createInvoker(
- nextValue,
- instance
- );
- addEventListener(el, name, invoker, options);
- } else if (existingInvoker) {
- removeEventListener(el, name, existingInvoker, options);
- invokers[rawName] = void 0;
- }
- }
- }
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
- function parseName(name) {
- let options;
- if (optionsModifierRE.test(name)) {
- options = {};
- let m;
- while (m = name.match(optionsModifierRE)) {
- name = name.slice(0, name.length - m[0].length);
- options[m[0].toLowerCase()] = true;
- }
- }
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
- return [event, options];
- }
- let cachedNow = 0;
- const p = /* @__PURE__ */ Promise.resolve();
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
- function createInvoker(initialValue, instance) {
- const invoker = (e) => {
- if (!e._vts) {
- e._vts = Date.now();
- } else if (e._vts <= invoker.attached) {
- return;
- }
- callWithAsyncErrorHandling(
- patchStopImmediatePropagation(e, invoker.value),
- instance,
- 5,
- [e]
- );
- };
- invoker.value = initialValue;
- invoker.attached = getNow();
- return invoker;
- }
- function patchStopImmediatePropagation(e, value) {
- if (isArray$1(value)) {
- const originalStop = e.stopImmediatePropagation;
- e.stopImmediatePropagation = () => {
- originalStop.call(e);
- e._stopped = true;
- };
- return value.map(
- (fn) => (e2) => !e2._stopped && fn && fn(e2)
- );
- } else {
- return value;
- }
- }
- const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
- key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
- const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
- const isSVG = namespace === "svg";
- if (key === "class") {
- patchClass(el, nextValue, isSVG);
- } else if (key === "style") {
- patchStyle(el, prevValue, nextValue);
- } else if (isOn(key)) {
- if (!isModelListener(key)) {
- patchEvent(el, key, prevValue, nextValue, parentComponent);
- }
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
- patchDOMProp(el, key, nextValue);
- if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
- patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value");
- }
- } else {
- if (key === "true-value") {
- el._trueValue = nextValue;
- } else if (key === "false-value") {
- el._falseValue = nextValue;
- }
- patchAttr(el, key, nextValue, isSVG);
- }
- };
- function shouldSetAsProp(el, key, value, isSVG) {
- if (isSVG) {
- if (key === "innerHTML" || key === "textContent") {
- return true;
- }
- if (key in el && isNativeOn(key) && isFunction(value)) {
- return true;
- }
- return false;
- }
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
- return false;
- }
- if (key === "form") {
- return false;
- }
- if (key === "list" && el.tagName === "INPUT") {
- return false;
- }
- if (key === "type" && el.tagName === "TEXTAREA") {
- return false;
- }
- if (key === "width" || key === "height") {
- const tag = el.tagName;
- if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
- return false;
- }
- }
- if (isNativeOn(key) && isString(value)) {
- return false;
- }
- if (key in el) {
- return true;
- }
- if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
- return true;
- }
- return false;
- }
- const systemModifiers = ["ctrl", "shift", "alt", "meta"];
- const modifierGuards = {
- stop: (e) => e.stopPropagation(),
- prevent: (e) => e.preventDefault(),
- self: (e) => e.target !== e.currentTarget,
- ctrl: (e) => !e.ctrlKey,
- shift: (e) => !e.shiftKey,
- alt: (e) => !e.altKey,
- meta: (e) => !e.metaKey,
- left: (e) => "button" in e && e.button !== 0,
- middle: (e) => "button" in e && e.button !== 1,
- right: (e) => "button" in e && e.button !== 2,
- exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
- };
- const withModifiers = (fn, modifiers) => {
- const cache = fn._withMods || (fn._withMods = {});
- const cacheKey = modifiers.join(".");
- return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
- for (let i = 0; i < modifiers.length; i++) {
- const guard = modifierGuards[modifiers[i]];
- if (guard && guard(event, modifiers))
- return;
- }
- return fn(event, ...args);
- });
- };
- const keyNames = {
- esc: "escape",
- space: " ",
- up: "arrow-up",
- left: "arrow-left",
- right: "arrow-right",
- down: "arrow-down",
- delete: "backspace"
- };
- const withKeys = (fn, modifiers) => {
- const cache = fn._withKeys || (fn._withKeys = {});
- const cacheKey = modifiers.join(".");
- return cache[cacheKey] || (cache[cacheKey] = (event) => {
- if (!("key" in event)) {
- return;
- }
- const eventKey = hyphenate(event.key);
- if (modifiers.some(
- (k) => k === eventKey || keyNames[k] === eventKey
- )) {
- return fn(event);
- }
- });
- };
- const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
- let renderer;
- function ensureRenderer() {
- return renderer || (renderer = createRenderer(rendererOptions));
- }
- const createApp = (...args) => {
- const app2 = ensureRenderer().createApp(...args);
- const { mount } = app2;
- app2.mount = (containerOrSelector) => {
- const container = normalizeContainer(containerOrSelector);
- if (!container)
- return;
- const component = app2._component;
- if (!isFunction(component) && !component.render && !component.template) {
- component.template = container.innerHTML;
- }
- if (container.nodeType === 1) {
- container.textContent = "";
- }
- const proxy = mount(container, false, resolveRootNamespace(container));
- if (container instanceof Element) {
- container.removeAttribute("v-cloak");
- container.setAttribute("data-v-app", "");
- }
- return proxy;
- };
- return app2;
- };
- function resolveRootNamespace(container) {
- if (container instanceof SVGElement) {
- return "svg";
- }
- if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
- return "mathml";
- }
- }
- function normalizeContainer(container) {
- if (isString(container)) {
- const res = document.querySelector(container);
- return res;
- }
- return container;
- }
- const style = "";
- const _export_sfc = (sfc, props) => {
- const target = sfc.__vccOpts || sfc;
- for (const [key, val] of props) {
- target[key] = val;
- }
- return target;
- };
- const _sfc_main = {};
- function _sfc_render(_ctx, _cache) {
- const _component_router_view = resolveComponent("router-view");
- return openBlock(), createBlock(_component_router_view, null, {
- default: withCtx(({ Component, route }) => [
- route.meta.keepAlive ? (openBlock(), createBlock(KeepAlive, { key: 0 }, [
- (openBlock(), createBlock(resolveDynamicComponent(Component)))
- ], 1024)) : (openBlock(), createBlock(resolveDynamicComponent(Component), { key: 1 }))
- ]),
- _: 1
- });
- }
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
- const iconfont = "";
- const scriptRel = "modulepreload";
- const assetsURL = function(dep) {
- return "/" + dep;
- };
- const seen = {};
- const __vitePreload = function preload(baseModule, deps, importerUrl) {
- if (!deps || deps.length === 0) {
- return baseModule();
- }
- const links = document.getElementsByTagName("link");
- return Promise.all(deps.map((dep) => {
- dep = assetsURL(dep);
- if (dep in seen)
- return;
- seen[dep] = true;
- const isCss = dep.endsWith(".css");
- const cssSelector = isCss ? '[rel="stylesheet"]' : "";
- const isBaseRelative = !!importerUrl;
- if (isBaseRelative) {
- for (let i = links.length - 1; i >= 0; i--) {
- const link2 = links[i];
- if (link2.href === dep && (!isCss || link2.rel === "stylesheet")) {
- return;
- }
- }
- } else if (document.querySelector(`link[href="${dep}"]${cssSelector}`)) {
- return;
- }
- const link = document.createElement("link");
- link.rel = isCss ? "stylesheet" : scriptRel;
- if (!isCss) {
- link.as = "script";
- link.crossOrigin = "";
- }
- link.href = dep;
- document.head.appendChild(link);
- if (isCss) {
- return new Promise((res, rej) => {
- link.addEventListener("load", res);
- link.addEventListener("error", () => rej(new Error(`Unable to preload CSS for ${dep}`)));
- });
- }
- })).then(() => baseModule()).catch((err) => {
- const e = new Event("vite:preloadError", { cancelable: true });
- e.payload = err;
- window.dispatchEvent(e);
- if (!e.defaultPrevented) {
- throw err;
- }
- });
- };
- /*!
- * vue-router v4.4.4
- * (c) 2024 Eduardo San Martin Morote
- * @license MIT
- */
- const isBrowser = typeof document !== "undefined";
- function isRouteComponent(component) {
- return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
- }
- function isESModule(obj) {
- return obj.__esModule || obj[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
- // add the Module string tag
- obj.default && isRouteComponent(obj.default);
- }
- const assign$1 = Object.assign;
- function applyToParams(fn, params) {
- const newParams = {};
- for (const key in params) {
- const value = params[key];
- newParams[key] = isArray(value) ? value.map(fn) : fn(value);
- }
- return newParams;
- }
- const noop$1 = () => {
- };
- const isArray = Array.isArray;
- const HASH_RE = /#/g;
- const AMPERSAND_RE = /&/g;
- const SLASH_RE = /\//g;
- const EQUAL_RE = /=/g;
- const IM_RE = /\?/g;
- const PLUS_RE = /\+/g;
- const ENC_BRACKET_OPEN_RE = /%5B/g;
- const ENC_BRACKET_CLOSE_RE = /%5D/g;
- const ENC_CARET_RE = /%5E/g;
- const ENC_BACKTICK_RE = /%60/g;
- const ENC_CURLY_OPEN_RE = /%7B/g;
- const ENC_PIPE_RE = /%7C/g;
- const ENC_CURLY_CLOSE_RE = /%7D/g;
- const ENC_SPACE_RE = /%20/g;
- function commonEncode(text) {
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
- }
- function encodeHash(text) {
- return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
- }
- function encodeQueryValue(text) {
- return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
- }
- function encodeQueryKey(text) {
- return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
- }
- function encodePath(text) {
- return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
- }
- function encodeParam(text) {
- return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
- }
- function decode(text) {
- try {
- return decodeURIComponent("" + text);
- } catch (err) {
- }
- return "" + text;
- }
- const TRAILING_SLASH_RE = /\/$/;
- const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
- function parseURL(parseQuery2, location2, currentLocation = "/") {
- let path, query = {}, searchString = "", hash = "";
- const hashPos = location2.indexOf("#");
- let searchPos = location2.indexOf("?");
- if (hashPos < searchPos && hashPos >= 0) {
- searchPos = -1;
- }
- if (searchPos > -1) {
- path = location2.slice(0, searchPos);
- searchString = location2.slice(searchPos + 1, hashPos > -1 ? hashPos : location2.length);
- query = parseQuery2(searchString);
- }
- if (hashPos > -1) {
- path = path || location2.slice(0, hashPos);
- hash = location2.slice(hashPos, location2.length);
- }
- path = resolveRelativePath(path != null ? path : location2, currentLocation);
- return {
- fullPath: path + (searchString && "?") + searchString + hash,
- path,
- query,
- hash: decode(hash)
- };
- }
- function stringifyURL(stringifyQuery2, location2) {
- const query = location2.query ? stringifyQuery2(location2.query) : "";
- return location2.path + (query && "?") + query + (location2.hash || "");
- }
- function stripBase(pathname, base2) {
- if (!base2 || !pathname.toLowerCase().startsWith(base2.toLowerCase()))
- return pathname;
- return pathname.slice(base2.length) || "/";
- }
- function isSameRouteLocation(stringifyQuery2, a, b) {
- const aLastIndex = a.matched.length - 1;
- const bLastIndex = b.matched.length - 1;
- return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery2(a.query) === stringifyQuery2(b.query) && a.hash === b.hash;
- }
- function isSameRouteRecord(a, b) {
- return (a.aliasOf || a) === (b.aliasOf || b);
- }
- function isSameRouteLocationParams(a, b) {
- if (Object.keys(a).length !== Object.keys(b).length)
- return false;
- for (const key in a) {
- if (!isSameRouteLocationParamsValue(a[key], b[key]))
- return false;
- }
- return true;
- }
- function isSameRouteLocationParamsValue(a, b) {
- return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : a === b;
- }
- function isEquivalentArray(a, b) {
- return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
- }
- function resolveRelativePath(to, from) {
- if (to.startsWith("/"))
- return to;
- if (!to)
- return from;
- const fromSegments = from.split("/");
- const toSegments = to.split("/");
- const lastToSegment = toSegments[toSegments.length - 1];
- if (lastToSegment === ".." || lastToSegment === ".") {
- toSegments.push("");
- }
- let position = fromSegments.length - 1;
- let toPosition;
- let segment;
- for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
- segment = toSegments[toPosition];
- if (segment === ".")
- continue;
- if (segment === "..") {
- if (position > 1)
- position--;
- } else
- break;
- }
- return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
- }
- const START_LOCATION_NORMALIZED = {
- path: "/",
- // TODO: could we use a symbol in the future?
- name: void 0,
- params: {},
- query: {},
- hash: "",
- fullPath: "/",
- matched: [],
- meta: {},
- redirectedFrom: void 0
- };
- var NavigationType;
- (function(NavigationType2) {
- NavigationType2["pop"] = "pop";
- NavigationType2["push"] = "push";
- })(NavigationType || (NavigationType = {}));
- var NavigationDirection;
- (function(NavigationDirection2) {
- NavigationDirection2["back"] = "back";
- NavigationDirection2["forward"] = "forward";
- NavigationDirection2["unknown"] = "";
- })(NavigationDirection || (NavigationDirection = {}));
- function normalizeBase(base2) {
- if (!base2) {
- if (isBrowser) {
- const baseEl = document.querySelector("base");
- base2 = baseEl && baseEl.getAttribute("href") || "/";
- base2 = base2.replace(/^\w+:\/\/[^\/]+/, "");
- } else {
- base2 = "/";
- }
- }
- if (base2[0] !== "/" && base2[0] !== "#")
- base2 = "/" + base2;
- return removeTrailingSlash(base2);
- }
- const BEFORE_HASH_RE = /^[^#]+#/;
- function createHref(base2, location2) {
- return base2.replace(BEFORE_HASH_RE, "#") + location2;
- }
- function getElementPosition(el, offset) {
- const docRect = document.documentElement.getBoundingClientRect();
- const elRect = el.getBoundingClientRect();
- return {
- behavior: offset.behavior,
- left: elRect.left - docRect.left - (offset.left || 0),
- top: elRect.top - docRect.top - (offset.top || 0)
- };
- }
- const computeScrollPosition = () => ({
- left: window.scrollX,
- top: window.scrollY
- });
- function scrollToPosition(position) {
- let scrollToOptions;
- if ("el" in position) {
- const positionEl = position.el;
- const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
- const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
- if (!el) {
- return;
- }
- scrollToOptions = getElementPosition(el, position);
- } else {
- scrollToOptions = position;
- }
- if ("scrollBehavior" in document.documentElement.style)
- window.scrollTo(scrollToOptions);
- else {
- window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
- }
- }
- function getScrollKey(path, delta) {
- const position = history.state ? history.state.position - delta : -1;
- return position + path;
- }
- const scrollPositions = /* @__PURE__ */ new Map();
- function saveScrollPosition(key, scrollPosition) {
- scrollPositions.set(key, scrollPosition);
- }
- function getSavedScrollPosition(key) {
- const scroll = scrollPositions.get(key);
- scrollPositions.delete(key);
- return scroll;
- }
- let createBaseLocation = () => location.protocol + "//" + location.host;
- function createCurrentLocation(base2, location2) {
- const { pathname, search, hash } = location2;
- const hashPos = base2.indexOf("#");
- if (hashPos > -1) {
- let slicePos = hash.includes(base2.slice(hashPos)) ? base2.slice(hashPos).length : 1;
- let pathFromHash = hash.slice(slicePos);
- if (pathFromHash[0] !== "/")
- pathFromHash = "/" + pathFromHash;
- return stripBase(pathFromHash, "");
- }
- const path = stripBase(pathname, base2);
- return path + search + hash;
- }
- function useHistoryListeners(base2, historyState, currentLocation, replace) {
- let listeners = [];
- let teardowns = [];
- let pauseState = null;
- const popStateHandler = ({ state }) => {
- const to = createCurrentLocation(base2, location);
- const from = currentLocation.value;
- const fromState = historyState.value;
- let delta = 0;
- if (state) {
- currentLocation.value = to;
- historyState.value = state;
- if (pauseState && pauseState === from) {
- pauseState = null;
- return;
- }
- delta = fromState ? state.position - fromState.position : 0;
- } else {
- replace(to);
- }
- listeners.forEach((listener) => {
- listener(currentLocation.value, from, {
- delta,
- type: NavigationType.pop,
- direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
- });
- });
- };
- function pauseListeners() {
- pauseState = currentLocation.value;
- }
- function listen(callback) {
- listeners.push(callback);
- const teardown = () => {
- const index2 = listeners.indexOf(callback);
- if (index2 > -1)
- listeners.splice(index2, 1);
- };
- teardowns.push(teardown);
- return teardown;
- }
- function beforeUnloadListener() {
- const { history: history2 } = window;
- if (!history2.state)
- return;
- history2.replaceState(assign$1({}, history2.state, { scroll: computeScrollPosition() }), "");
- }
- function destroy() {
- for (const teardown of teardowns)
- teardown();
- teardowns = [];
- window.removeEventListener("popstate", popStateHandler);
- window.removeEventListener("beforeunload", beforeUnloadListener);
- }
- window.addEventListener("popstate", popStateHandler);
- window.addEventListener("beforeunload", beforeUnloadListener, {
- passive: true
- });
- return {
- pauseListeners,
- listen,
- destroy
- };
- }
- function buildState(back, current, forward, replaced = false, computeScroll = false) {
- return {
- back,
- current,
- forward,
- replaced,
- position: window.history.length,
- scroll: computeScroll ? computeScrollPosition() : null
- };
- }
- function useHistoryStateNavigation(base2) {
- const { history: history2, location: location2 } = window;
- const currentLocation = {
- value: createCurrentLocation(base2, location2)
- };
- const historyState = { value: history2.state };
- if (!historyState.value) {
- changeLocation(currentLocation.value, {
- back: null,
- current: currentLocation.value,
- forward: null,
- // the length is off by one, we need to decrease it
- position: history2.length - 1,
- replaced: true,
- // don't add a scroll as the user may have an anchor, and we want
- // scrollBehavior to be triggered without a saved position
- scroll: null
- }, true);
- }
- function changeLocation(to, state, replace2) {
- const hashIndex = base2.indexOf("#");
- const url = hashIndex > -1 ? (location2.host && document.querySelector("base") ? base2 : base2.slice(hashIndex)) + to : createBaseLocation() + base2 + to;
- try {
- history2[replace2 ? "replaceState" : "pushState"](state, "", url);
- historyState.value = state;
- } catch (err) {
- {
- console.error(err);
- }
- location2[replace2 ? "replace" : "assign"](url);
- }
- }
- function replace(to, data) {
- const state = assign$1({}, history2.state, buildState(
- historyState.value.back,
- // keep back and forward entries but override current position
- to,
- historyState.value.forward,
- true
- ), data, { position: historyState.value.position });
- changeLocation(to, state, true);
- currentLocation.value = to;
- }
- function push(to, data) {
- const currentState = assign$1(
- {},
- // use current history state to gracefully handle a wrong call to
- // history.replaceState
- // https://github.com/vuejs/router/issues/366
- historyState.value,
- history2.state,
- {
- forward: to,
- scroll: computeScrollPosition()
- }
- );
- changeLocation(currentState.current, currentState, true);
- const state = assign$1({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);
- changeLocation(to, state, false);
- currentLocation.value = to;
- }
- return {
- location: currentLocation,
- state: historyState,
- push,
- replace
- };
- }
- function createWebHistory(base2) {
- base2 = normalizeBase(base2);
- const historyNavigation = useHistoryStateNavigation(base2);
- const historyListeners = useHistoryListeners(base2, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
- function go(delta, triggerListeners = true) {
- if (!triggerListeners)
- historyListeners.pauseListeners();
- history.go(delta);
- }
- const routerHistory = assign$1({
- // it's overridden right after
- location: "",
- base: base2,
- go,
- createHref: createHref.bind(null, base2)
- }, historyNavigation, historyListeners);
- Object.defineProperty(routerHistory, "location", {
- enumerable: true,
- get: () => historyNavigation.location.value
- });
- Object.defineProperty(routerHistory, "state", {
- enumerable: true,
- get: () => historyNavigation.state.value
- });
- return routerHistory;
- }
- function createWebHashHistory(base2) {
- base2 = location.host ? base2 || location.pathname + location.search : "";
- if (!base2.includes("#"))
- base2 += "#";
- return createWebHistory(base2);
- }
- function isRouteLocation(route) {
- return typeof route === "string" || route && typeof route === "object";
- }
- function isRouteName(name) {
- return typeof name === "string" || typeof name === "symbol";
- }
- const NavigationFailureSymbol = Symbol("");
- var NavigationFailureType;
- (function(NavigationFailureType2) {
- NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
- NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
- NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
- })(NavigationFailureType || (NavigationFailureType = {}));
- function createRouterError(type, params) {
- {
- return assign$1(new Error(), {
- type,
- [NavigationFailureSymbol]: true
- }, params);
- }
- }
- function isNavigationFailure(error, type) {
- return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
- }
- const BASE_PARAM_PATTERN = "[^/]+?";
- const BASE_PATH_PARSER_OPTIONS = {
- sensitive: false,
- strict: false,
- start: true,
- end: true
- };
- const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
- function tokensToParser(segments, extraOptions) {
- const options = assign$1({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
- const score = [];
- let pattern = options.start ? "^" : "";
- const keys = [];
- for (const segment of segments) {
- const segmentScores = segment.length ? [] : [
- 90
- /* PathScore.Root */
- ];
- if (options.strict && !segment.length)
- pattern += "/";
- for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
- const token = segment[tokenIndex];
- let subSegmentScore = 40 + (options.sensitive ? 0.25 : 0);
- if (token.type === 0) {
- if (!tokenIndex)
- pattern += "/";
- pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
- subSegmentScore += 40;
- } else if (token.type === 1) {
- const { value, repeatable, optional, regexp } = token;
- keys.push({
- name: value,
- repeatable,
- optional
- });
- const re2 = regexp ? regexp : BASE_PARAM_PATTERN;
- if (re2 !== BASE_PARAM_PATTERN) {
- subSegmentScore += 10;
- try {
- new RegExp(`(${re2})`);
- } catch (err) {
- throw new Error(`Invalid custom RegExp for param "${value}" (${re2}): ` + err.message);
- }
- }
- let subPattern = repeatable ? `((?:${re2})(?:/(?:${re2}))*)` : `(${re2})`;
- if (!tokenIndex)
- subPattern = // avoid an optional / if there are more segments e.g. /:p?-static
- // or /:p?-:p2
- optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
- if (optional)
- subPattern += "?";
- pattern += subPattern;
- subSegmentScore += 20;
- if (optional)
- subSegmentScore += -8;
- if (repeatable)
- subSegmentScore += -20;
- if (re2 === ".*")
- subSegmentScore += -50;
- }
- segmentScores.push(subSegmentScore);
- }
- score.push(segmentScores);
- }
- if (options.strict && options.end) {
- const i = score.length - 1;
- score[i][score[i].length - 1] += 0.7000000000000001;
- }
- if (!options.strict)
- pattern += "/?";
- if (options.end)
- pattern += "$";
- else if (options.strict)
- pattern += "(?:/|$)";
- const re = new RegExp(pattern, options.sensitive ? "" : "i");
- function parse(path) {
- const match = path.match(re);
- const params = {};
- if (!match)
- return null;
- for (let i = 1; i < match.length; i++) {
- const value = match[i] || "";
- const key = keys[i - 1];
- params[key.name] = value && key.repeatable ? value.split("/") : value;
- }
- return params;
- }
- function stringify(params) {
- let path = "";
- let avoidDuplicatedSlash = false;
- for (const segment of segments) {
- if (!avoidDuplicatedSlash || !path.endsWith("/"))
- path += "/";
- avoidDuplicatedSlash = false;
- for (const token of segment) {
- if (token.type === 0) {
- path += token.value;
- } else if (token.type === 1) {
- const { value, repeatable, optional } = token;
- const param = value in params ? params[value] : "";
- if (isArray(param) && !repeatable) {
- throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
- }
- const text = isArray(param) ? param.join("/") : param;
- if (!text) {
- if (optional) {
- if (segment.length < 2) {
- if (path.endsWith("/"))
- path = path.slice(0, -1);
- else
- avoidDuplicatedSlash = true;
- }
- } else
- throw new Error(`Missing required param "${value}"`);
- }
- path += text;
- }
- }
- }
- return path || "/";
- }
- return {
- re,
- score,
- keys,
- parse,
- stringify
- };
- }
- function compareScoreArray(a, b) {
- let i = 0;
- while (i < a.length && i < b.length) {
- const diff = b[i] - a[i];
- if (diff)
- return diff;
- i++;
- }
- if (a.length < b.length) {
- return a.length === 1 && a[0] === 40 + 40 ? -1 : 1;
- } else if (a.length > b.length) {
- return b.length === 1 && b[0] === 40 + 40 ? 1 : -1;
- }
- return 0;
- }
- function comparePathParserScore(a, b) {
- let i = 0;
- const aScore = a.score;
- const bScore = b.score;
- while (i < aScore.length && i < bScore.length) {
- const comp = compareScoreArray(aScore[i], bScore[i]);
- if (comp)
- return comp;
- i++;
- }
- if (Math.abs(bScore.length - aScore.length) === 1) {
- if (isLastScoreNegative(aScore))
- return 1;
- if (isLastScoreNegative(bScore))
- return -1;
- }
- return bScore.length - aScore.length;
- }
- function isLastScoreNegative(score) {
- const last = score[score.length - 1];
- return score.length > 0 && last[last.length - 1] < 0;
- }
- const ROOT_TOKEN = {
- type: 0,
- value: ""
- };
- const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
- function tokenizePath(path) {
- if (!path)
- return [[]];
- if (path === "/")
- return [[ROOT_TOKEN]];
- if (!path.startsWith("/")) {
- throw new Error(`Invalid path "${path}"`);
- }
- function crash(message) {
- throw new Error(`ERR (${state})/"${buffer}": ${message}`);
- }
- let state = 0;
- let previousState = state;
- const tokens = [];
- let segment;
- function finalizeSegment() {
- if (segment)
- tokens.push(segment);
- segment = [];
- }
- let i = 0;
- let char;
- let buffer = "";
- let customRe = "";
- function consumeBuffer() {
- if (!buffer)
- return;
- if (state === 0) {
- segment.push({
- type: 0,
- value: buffer
- });
- } else if (state === 1 || state === 2 || state === 3) {
- if (segment.length > 1 && (char === "*" || char === "+"))
- crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
- segment.push({
- type: 1,
- value: buffer,
- regexp: customRe,
- repeatable: char === "*" || char === "+",
- optional: char === "*" || char === "?"
- });
- } else {
- crash("Invalid state to consume buffer");
- }
- buffer = "";
- }
- function addCharToBuffer() {
- buffer += char;
- }
- while (i < path.length) {
- char = path[i++];
- if (char === "\\" && state !== 2) {
- previousState = state;
- state = 4;
- continue;
- }
- switch (state) {
- case 0:
- if (char === "/") {
- if (buffer) {
- consumeBuffer();
- }
- finalizeSegment();
- } else if (char === ":") {
- consumeBuffer();
- state = 1;
- } else {
- addCharToBuffer();
- }
- break;
- case 4:
- addCharToBuffer();
- state = previousState;
- break;
- case 1:
- if (char === "(") {
- state = 2;
- } else if (VALID_PARAM_RE.test(char)) {
- addCharToBuffer();
- } else {
- consumeBuffer();
- state = 0;
- if (char !== "*" && char !== "?" && char !== "+")
- i--;
- }
- break;
- case 2:
- if (char === ")") {
- if (customRe[customRe.length - 1] == "\\")
- customRe = customRe.slice(0, -1) + char;
- else
- state = 3;
- } else {
- customRe += char;
- }
- break;
- case 3:
- consumeBuffer();
- state = 0;
- if (char !== "*" && char !== "?" && char !== "+")
- i--;
- customRe = "";
- break;
- default:
- crash("Unknown state");
- break;
- }
- }
- if (state === 2)
- crash(`Unfinished custom RegExp for param "${buffer}"`);
- consumeBuffer();
- finalizeSegment();
- return tokens;
- }
- function createRouteRecordMatcher(record, parent, options) {
- const parser = tokensToParser(tokenizePath(record.path), options);
- const matcher = assign$1(parser, {
- record,
- parent,
- // these needs to be populated by the parent
- children: [],
- alias: []
- });
- if (parent) {
- if (!matcher.record.aliasOf === !parent.record.aliasOf)
- parent.children.push(matcher);
- }
- return matcher;
- }
- function createRouterMatcher(routes2, globalOptions) {
- const matchers = [];
- const matcherMap = /* @__PURE__ */ new Map();
- globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);
- function getRecordMatcher(name) {
- return matcherMap.get(name);
- }
- function addRoute(record, parent, originalRecord) {
- const isRootAdd = !originalRecord;
- const mainNormalizedRecord = normalizeRouteRecord(record);
- mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
- const options = mergeOptions(globalOptions, record);
- const normalizedRecords = [
- mainNormalizedRecord
- ];
- if ("alias" in record) {
- const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
- for (const alias of aliases) {
- normalizedRecords.push(assign$1({}, mainNormalizedRecord, {
- // this allows us to hold a copy of the `components` option
- // so that async components cache is hold on the original record
- components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
- path: alias,
- // we might be the child of an alias
- aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
- // the aliases are always of the same kind as the original since they
- // are defined on the same record
- }));
- }
- }
- let matcher;
- let originalMatcher;
- for (const normalizedRecord of normalizedRecords) {
- const { path } = normalizedRecord;
- if (parent && path[0] !== "/") {
- const parentPath = parent.record.path;
- const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
- normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
- }
- matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
- if (originalRecord) {
- originalRecord.alias.push(matcher);
- } else {
- originalMatcher = originalMatcher || matcher;
- if (originalMatcher !== matcher)
- originalMatcher.alias.push(matcher);
- if (isRootAdd && record.name && !isAliasRecord(matcher))
- removeRoute(record.name);
- }
- if (isMatchable(matcher)) {
- insertMatcher(matcher);
- }
- if (mainNormalizedRecord.children) {
- const children = mainNormalizedRecord.children;
- for (let i = 0; i < children.length; i++) {
- addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
- }
- }
- originalRecord = originalRecord || matcher;
- }
- return originalMatcher ? () => {
- removeRoute(originalMatcher);
- } : noop$1;
- }
- function removeRoute(matcherRef) {
- if (isRouteName(matcherRef)) {
- const matcher = matcherMap.get(matcherRef);
- if (matcher) {
- matcherMap.delete(matcherRef);
- matchers.splice(matchers.indexOf(matcher), 1);
- matcher.children.forEach(removeRoute);
- matcher.alias.forEach(removeRoute);
- }
- } else {
- const index2 = matchers.indexOf(matcherRef);
- if (index2 > -1) {
- matchers.splice(index2, 1);
- if (matcherRef.record.name)
- matcherMap.delete(matcherRef.record.name);
- matcherRef.children.forEach(removeRoute);
- matcherRef.alias.forEach(removeRoute);
- }
- }
- }
- function getRoutes() {
- return matchers;
- }
- function insertMatcher(matcher) {
- const index2 = findInsertionIndex(matcher, matchers);
- matchers.splice(index2, 0, matcher);
- if (matcher.record.name && !isAliasRecord(matcher))
- matcherMap.set(matcher.record.name, matcher);
- }
- function resolve2(location2, currentLocation) {
- let matcher;
- let params = {};
- let path;
- let name;
- if ("name" in location2 && location2.name) {
- matcher = matcherMap.get(location2.name);
- if (!matcher)
- throw createRouterError(1, {
- location: location2
- });
- name = matcher.record.name;
- params = assign$1(
- // paramsFromLocation is a new object
- paramsFromLocation(
- currentLocation.params,
- // only keep params that exist in the resolved location
- // only keep optional params coming from a parent record
- matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)
- ),
- // discard any existing params in the current location that do not exist here
- // #1497 this ensures better active/exact matching
- location2.params && paramsFromLocation(location2.params, matcher.keys.map((k) => k.name))
- );
- path = matcher.stringify(params);
- } else if (location2.path != null) {
- path = location2.path;
- matcher = matchers.find((m) => m.re.test(path));
- if (matcher) {
- params = matcher.parse(path);
- name = matcher.record.name;
- }
- } else {
- matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
- if (!matcher)
- throw createRouterError(1, {
- location: location2,
- currentLocation
- });
- name = matcher.record.name;
- params = assign$1({}, currentLocation.params, location2.params);
- path = matcher.stringify(params);
- }
- const matched = [];
- let parentMatcher = matcher;
- while (parentMatcher) {
- matched.unshift(parentMatcher.record);
- parentMatcher = parentMatcher.parent;
- }
- return {
- name,
- path,
- params,
- matched,
- meta: mergeMetaFields(matched)
- };
- }
- routes2.forEach((route) => addRoute(route));
- function clearRoutes() {
- matchers.length = 0;
- matcherMap.clear();
- }
- return {
- addRoute,
- resolve: resolve2,
- removeRoute,
- clearRoutes,
- getRoutes,
- getRecordMatcher
- };
- }
- function paramsFromLocation(params, keys) {
- const newParams = {};
- for (const key of keys) {
- if (key in params)
- newParams[key] = params[key];
- }
- return newParams;
- }
- function normalizeRouteRecord(record) {
- return {
- path: record.path,
- redirect: record.redirect,
- name: record.name,
- meta: record.meta || {},
- aliasOf: void 0,
- beforeEnter: record.beforeEnter,
- props: normalizeRecordProps(record),
- children: record.children || [],
- instances: {},
- leaveGuards: /* @__PURE__ */ new Set(),
- updateGuards: /* @__PURE__ */ new Set(),
- enterCallbacks: {},
- mods: {},
- components: "components" in record ? record.components || null : record.component && { default: record.component }
- };
- }
- function normalizeRecordProps(record) {
- const propsObject = {};
- const props = record.props || false;
- if ("component" in record) {
- propsObject.default = props;
- } else {
- for (const name in record.components)
- propsObject[name] = typeof props === "object" ? props[name] : props;
- }
- return propsObject;
- }
- function isAliasRecord(record) {
- while (record) {
- if (record.record.aliasOf)
- return true;
- record = record.parent;
- }
- return false;
- }
- function mergeMetaFields(matched) {
- return matched.reduce((meta, record) => assign$1(meta, record.meta), {});
- }
- function mergeOptions(defaults, partialOptions) {
- const options = {};
- for (const key in defaults) {
- options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
- }
- return options;
- }
- function findInsertionIndex(matcher, matchers) {
- let lower = 0;
- let upper = matchers.length;
- while (lower !== upper) {
- const mid = lower + upper >> 1;
- const sortOrder = comparePathParserScore(matcher, matchers[mid]);
- if (sortOrder < 0) {
- upper = mid;
- } else {
- lower = mid + 1;
- }
- }
- const insertionAncestor = getInsertionAncestor(matcher);
- if (insertionAncestor) {
- upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
- }
- return upper;
- }
- function getInsertionAncestor(matcher) {
- let ancestor = matcher;
- while (ancestor = ancestor.parent) {
- if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) {
- return ancestor;
- }
- }
- return;
- }
- function isMatchable({ record }) {
- return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
- }
- function parseQuery(search) {
- const query = {};
- if (search === "" || search === "?")
- return query;
- const hasLeadingIM = search[0] === "?";
- const searchParams = (hasLeadingIM ? search.slice(1) : search).split("&");
- for (let i = 0; i < searchParams.length; ++i) {
- const searchParam = searchParams[i].replace(PLUS_RE, " ");
- const eqPos = searchParam.indexOf("=");
- const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
- const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
- if (key in query) {
- let currentValue = query[key];
- if (!isArray(currentValue)) {
- currentValue = query[key] = [currentValue];
- }
- currentValue.push(value);
- } else {
- query[key] = value;
- }
- }
- return query;
- }
- function stringifyQuery(query) {
- let search = "";
- for (let key in query) {
- const value = query[key];
- key = encodeQueryKey(key);
- if (value == null) {
- if (value !== void 0) {
- search += (search.length ? "&" : "") + key;
- }
- continue;
- }
- const values = isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)];
- values.forEach((value2) => {
- if (value2 !== void 0) {
- search += (search.length ? "&" : "") + key;
- if (value2 != null)
- search += "=" + value2;
- }
- });
- }
- return search;
- }
- function normalizeQuery(query) {
- const normalizedQuery = {};
- for (const key in query) {
- const value = query[key];
- if (value !== void 0) {
- normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
- }
- }
- return normalizedQuery;
- }
- const matchedRouteKey = Symbol("");
- const viewDepthKey = Symbol("");
- const routerKey = Symbol("");
- const routeLocationKey = Symbol("");
- const routerViewLocationKey = Symbol("");
- function useCallbacks() {
- let handlers = [];
- function add2(handler) {
- handlers.push(handler);
- return () => {
- const i = handlers.indexOf(handler);
- if (i > -1)
- handlers.splice(i, 1);
- };
- }
- function reset() {
- handlers = [];
- }
- return {
- add: add2,
- list: () => handlers.slice(),
- reset
- };
- }
- function registerGuard(record, name, guard) {
- const removeFromList = () => {
- record[name].delete(guard);
- };
- onUnmounted(removeFromList);
- onDeactivated(removeFromList);
- onActivated(() => {
- record[name].add(guard);
- });
- record[name].add(guard);
- }
- function onBeforeRouteLeave(leaveGuard) {
- const activeRecord = inject(
- matchedRouteKey,
- // to avoid warning
- {}
- ).value;
- if (!activeRecord) {
- return;
- }
- registerGuard(activeRecord, "leaveGuards", leaveGuard);
- }
- function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
- const enterCallbackArray = record && // name is defined if record is because of the function overload
- (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
- return () => new Promise((resolve2, reject) => {
- const next = (valid) => {
- if (valid === false) {
- reject(createRouterError(4, {
- from,
- to
- }));
- } else if (valid instanceof Error) {
- reject(valid);
- } else if (isRouteLocation(valid)) {
- reject(createRouterError(2, {
- from: to,
- to: valid
- }));
- } else {
- if (enterCallbackArray && // since enterCallbackArray is truthy, both record and name also are
- record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") {
- enterCallbackArray.push(valid);
- }
- resolve2();
- }
- };
- const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
- let guardCall = Promise.resolve(guardReturn);
- if (guard.length < 3)
- guardCall = guardCall.then(next);
- guardCall.catch((err) => reject(err));
- });
- }
- function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
- const guards = [];
- for (const record of matched) {
- for (const name in record.components) {
- let rawComponent = record.components[name];
- if (guardType !== "beforeRouteEnter" && !record.instances[name])
- continue;
- if (isRouteComponent(rawComponent)) {
- const options = rawComponent.__vccOpts || rawComponent;
- const guard = options[guardType];
- guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
- } else {
- let componentPromise = rawComponent();
- guards.push(() => componentPromise.then((resolved) => {
- if (!resolved)
- throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
- const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
- record.mods[name] = resolved;
- record.components[name] = resolvedComponent;
- const options = resolvedComponent.__vccOpts || resolvedComponent;
- const guard = options[guardType];
- return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
- }));
- }
- }
- }
- return guards;
- }
- function useLink(props) {
- const router2 = inject(routerKey);
- const currentRoute = inject(routeLocationKey);
- const route = computed(() => {
- const to = unref(props.to);
- return router2.resolve(to);
- });
- const activeRecordIndex = computed(() => {
- const { matched } = route.value;
- const { length } = matched;
- const routeMatched = matched[length - 1];
- const currentMatched = currentRoute.matched;
- if (!routeMatched || !currentMatched.length)
- return -1;
- const index2 = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
- if (index2 > -1)
- return index2;
- const parentRecordPath = getOriginalPath(matched[length - 2]);
- return (
- // we are dealing with nested routes
- length > 1 && // if the parent and matched route have the same path, this link is
- // referring to the empty child. Or we currently are on a different
- // child of the same parent
- getOriginalPath(routeMatched) === parentRecordPath && // avoid comparing the child with its parent
- currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index2
- );
- });
- const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
- const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
- function navigate(e = {}) {
- if (guardEvent(e)) {
- return router2[unref(props.replace) ? "replace" : "push"](
- unref(props.to)
- // avoid uncaught errors are they are logged anyway
- ).catch(noop$1);
- }
- return Promise.resolve();
- }
- return {
- route,
- href: computed(() => route.value.href),
- isActive,
- isExactActive,
- navigate
- };
- }
- const RouterLinkImpl = /* @__PURE__ */ defineComponent({
- name: "RouterLink",
- compatConfig: { MODE: 3 },
- props: {
- to: {
- type: [String, Object],
- required: true
- },
- replace: Boolean,
- activeClass: String,
- // inactiveClass: String,
- exactActiveClass: String,
- custom: Boolean,
- ariaCurrentValue: {
- type: String,
- default: "page"
- }
- },
- useLink,
- setup(props, { slots }) {
- const link = reactive(useLink(props));
- const { options } = inject(routerKey);
- const elClass = computed(() => ({
- [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
- // [getLinkClass(
- // props.inactiveClass,
- // options.linkInactiveClass,
- // 'router-link-inactive'
- // )]: !link.isExactActive,
- [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
- }));
- return () => {
- const children = slots.default && slots.default(link);
- return props.custom ? children : h("a", {
- "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
- href: link.href,
- // this would override user added attrs but Vue will still add
- // the listener, so we end up triggering both
- onClick: link.navigate,
- class: elClass.value
- }, children);
- };
- }
- });
- const RouterLink = RouterLinkImpl;
- function guardEvent(e) {
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
- return;
- if (e.defaultPrevented)
- return;
- if (e.button !== void 0 && e.button !== 0)
- return;
- if (e.currentTarget && e.currentTarget.getAttribute) {
- const target = e.currentTarget.getAttribute("target");
- if (/\b_blank\b/i.test(target))
- return;
- }
- if (e.preventDefault)
- e.preventDefault();
- return true;
- }
- function includesParams(outer, inner) {
- for (const key in inner) {
- const innerValue = inner[key];
- const outerValue = outer[key];
- if (typeof innerValue === "string") {
- if (innerValue !== outerValue)
- return false;
- } else {
- if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i]))
- return false;
- }
- }
- return true;
- }
- function getOriginalPath(record) {
- return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
- }
- const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
- const RouterViewImpl = /* @__PURE__ */ defineComponent({
- name: "RouterView",
- // #674 we manually inherit them
- inheritAttrs: false,
- props: {
- name: {
- type: String,
- default: "default"
- },
- route: Object
- },
- // Better compat for @vue/compat users
- // https://github.com/vuejs/router/issues/1315
- compatConfig: { MODE: 3 },
- setup(props, { attrs, slots }) {
- const injectedRoute = inject(routerViewLocationKey);
- const routeToDisplay = computed(() => props.route || injectedRoute.value);
- const injectedDepth = inject(viewDepthKey, 0);
- const depth = computed(() => {
- let initialDepth = unref(injectedDepth);
- const { matched } = routeToDisplay.value;
- let matchedRoute;
- while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) {
- initialDepth++;
- }
- return initialDepth;
- });
- const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
- provide(viewDepthKey, computed(() => depth.value + 1));
- provide(matchedRouteKey, matchedRouteRef);
- provide(routerViewLocationKey, routeToDisplay);
- const viewRef = ref();
- watch(() => [viewRef.value, matchedRouteRef.value, props.name], ([instance, to, name], [oldInstance, from, oldName]) => {
- if (to) {
- to.instances[name] = instance;
- if (from && from !== to && instance && instance === oldInstance) {
- if (!to.leaveGuards.size) {
- to.leaveGuards = from.leaveGuards;
- }
- if (!to.updateGuards.size) {
- to.updateGuards = from.updateGuards;
- }
- }
- }
- if (instance && to && // if there is no instance but to and from are the same this might be
- // the first visit
- (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
- (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
- }
- }, { flush: "post" });
- return () => {
- const route = routeToDisplay.value;
- const currentName = props.name;
- const matchedRoute = matchedRouteRef.value;
- const ViewComponent = matchedRoute && matchedRoute.components[currentName];
- if (!ViewComponent) {
- return normalizeSlot(slots.default, { Component: ViewComponent, route });
- }
- const routePropsOption = matchedRoute.props[currentName];
- const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
- const onVnodeUnmounted = (vnode) => {
- if (vnode.component.isUnmounted) {
- matchedRoute.instances[currentName] = null;
- }
- };
- const component = h(ViewComponent, assign$1({}, routeProps, attrs, {
- onVnodeUnmounted,
- ref: viewRef
- }));
- return (
- // pass the vnode to the slot as a prop.
- // h and <component :is="..."> both accept vnodes
- normalizeSlot(slots.default, { Component: component, route }) || component
- );
- };
- }
- });
- function normalizeSlot(slot, data) {
- if (!slot)
- return null;
- const slotContent = slot(data);
- return slotContent.length === 1 ? slotContent[0] : slotContent;
- }
- const RouterView = RouterViewImpl;
- function createRouter(options) {
- const matcher = createRouterMatcher(options.routes, options);
- const parseQuery$1 = options.parseQuery || parseQuery;
- const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
- const routerHistory = options.history;
- const beforeGuards = useCallbacks();
- const beforeResolveGuards = useCallbacks();
- const afterGuards = useCallbacks();
- const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
- let pendingLocation = START_LOCATION_NORMALIZED;
- if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) {
- history.scrollRestoration = "manual";
- }
- const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
- const encodeParams = applyToParams.bind(null, encodeParam);
- const decodeParams = (
- // @ts-expect-error: intentionally avoid the type check
- applyToParams.bind(null, decode)
- );
- function addRoute(parentOrRoute, route) {
- let parent;
- let record;
- if (isRouteName(parentOrRoute)) {
- parent = matcher.getRecordMatcher(parentOrRoute);
- record = route;
- } else {
- record = parentOrRoute;
- }
- return matcher.addRoute(record, parent);
- }
- function removeRoute(name) {
- const recordMatcher = matcher.getRecordMatcher(name);
- if (recordMatcher) {
- matcher.removeRoute(recordMatcher);
- }
- }
- function getRoutes() {
- return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
- }
- function hasRoute(name) {
- return !!matcher.getRecordMatcher(name);
- }
- function resolve2(rawLocation, currentLocation) {
- currentLocation = assign$1({}, currentLocation || currentRoute.value);
- if (typeof rawLocation === "string") {
- const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
- const matchedRoute2 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
- const href2 = routerHistory.createHref(locationNormalized.fullPath);
- return assign$1(locationNormalized, matchedRoute2, {
- params: decodeParams(matchedRoute2.params),
- hash: decode(locationNormalized.hash),
- redirectedFrom: void 0,
- href: href2
- });
- }
- let matcherLocation;
- if (rawLocation.path != null) {
- matcherLocation = assign$1({}, rawLocation, {
- path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path
- });
- } else {
- const targetParams = assign$1({}, rawLocation.params);
- for (const key in targetParams) {
- if (targetParams[key] == null) {
- delete targetParams[key];
- }
- }
- matcherLocation = assign$1({}, rawLocation, {
- params: encodeParams(targetParams)
- });
- currentLocation.params = encodeParams(currentLocation.params);
- }
- const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
- const hash = rawLocation.hash || "";
- matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
- const fullPath = stringifyURL(stringifyQuery$1, assign$1({}, rawLocation, {
- hash: encodeHash(hash),
- path: matchedRoute.path
- }));
- const href = routerHistory.createHref(fullPath);
- return assign$1({
- fullPath,
- // keep the hash encoded so fullPath is effectively path + encodedQuery +
- // hash
- hash,
- query: (
- // if the user is using a custom query lib like qs, we might have
- // nested objects, so we keep the query as is, meaning it can contain
- // numbers at `$route.query`, but at the point, the user will have to
- // use their own type anyway.
- // https://github.com/vuejs/router/issues/328#issuecomment-649481567
- stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
- )
- }, matchedRoute, {
- redirectedFrom: void 0,
- href
- });
- }
- function locationAsObject(to) {
- return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign$1({}, to);
- }
- function checkCanceledNavigation(to, from) {
- if (pendingLocation !== to) {
- return createRouterError(8, {
- from,
- to
- });
- }
- }
- function push(to) {
- return pushWithRedirect(to);
- }
- function replace(to) {
- return push(assign$1(locationAsObject(to), { replace: true }));
- }
- function handleRedirectRecord(to) {
- const lastMatched = to.matched[to.matched.length - 1];
- if (lastMatched && lastMatched.redirect) {
- const { redirect } = lastMatched;
- let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
- if (typeof newTargetLocation === "string") {
- newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : (
- // force empty params
- { path: newTargetLocation }
- );
- newTargetLocation.params = {};
- }
- return assign$1({
- query: to.query,
- hash: to.hash,
- // avoid transferring params if the redirect has a path
- params: newTargetLocation.path != null ? {} : to.params
- }, newTargetLocation);
- }
- }
- function pushWithRedirect(to, redirectedFrom) {
- const targetLocation = pendingLocation = resolve2(to);
- const from = currentRoute.value;
- const data = to.state;
- const force = to.force;
- const replace2 = to.replace === true;
- const shouldRedirect = handleRedirectRecord(targetLocation);
- if (shouldRedirect)
- return pushWithRedirect(
- assign$1(locationAsObject(shouldRedirect), {
- state: typeof shouldRedirect === "object" ? assign$1({}, data, shouldRedirect.state) : data,
- force,
- replace: replace2
- }),
- // keep original redirectedFrom if it exists
- redirectedFrom || targetLocation
- );
- const toLocation = targetLocation;
- toLocation.redirectedFrom = redirectedFrom;
- let failure;
- if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
- failure = createRouterError(16, { to: toLocation, from });
- handleScroll(
- from,
- from,
- // this is a push, the only way for it to be triggered from a
- // history.listen is with a redirect, which makes it become a push
- true,
- // This cannot be the first navigation because the initial location
- // cannot be manually navigated to
- false
- );
- }
- return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? (
- // navigation redirects still mark the router as ready
- isNavigationFailure(
- error,
- 2
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
- ) ? error : markAsReady(error)
- ) : (
- // reject any unknown error
- triggerError(error, toLocation, from)
- )).then((failure2) => {
- if (failure2) {
- if (isNavigationFailure(
- failure2,
- 2
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
- )) {
- return pushWithRedirect(
- // keep options
- assign$1({
- // preserve an existing replacement but allow the redirect to override it
- replace: replace2
- }, locationAsObject(failure2.to), {
- state: typeof failure2.to === "object" ? assign$1({}, data, failure2.to.state) : data,
- force
- }),
- // preserve the original redirectedFrom if any
- redirectedFrom || toLocation
- );
- }
- } else {
- failure2 = finalizeNavigation(toLocation, from, true, replace2, data);
- }
- triggerAfterEach(toLocation, from, failure2);
- return failure2;
- });
- }
- function checkCanceledNavigationAndReject(to, from) {
- const error = checkCanceledNavigation(to, from);
- return error ? Promise.reject(error) : Promise.resolve();
- }
- function runWithContext(fn) {
- const app2 = installedApps.values().next().value;
- return app2 && typeof app2.runWithContext === "function" ? app2.runWithContext(fn) : fn();
- }
- function navigate(to, from) {
- let guards;
- const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
- guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
- for (const record of leavingRecords) {
- record.leaveGuards.forEach((guard) => {
- guards.push(guardToPromiseFn(guard, to, from));
- });
- }
- const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards).then(() => {
- guards = [];
- for (const guard of beforeGuards.list()) {
- guards.push(guardToPromiseFn(guard, to, from));
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- }).then(() => {
- guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
- for (const record of updatingRecords) {
- record.updateGuards.forEach((guard) => {
- guards.push(guardToPromiseFn(guard, to, from));
- });
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- }).then(() => {
- guards = [];
- for (const record of enteringRecords) {
- if (record.beforeEnter) {
- if (isArray(record.beforeEnter)) {
- for (const beforeEnter of record.beforeEnter)
- guards.push(guardToPromiseFn(beforeEnter, to, from));
- } else {
- guards.push(guardToPromiseFn(record.beforeEnter, to, from));
- }
- }
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- }).then(() => {
- to.matched.forEach((record) => record.enterCallbacks = {});
- guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- }).then(() => {
- guards = [];
- for (const guard of beforeResolveGuards.list()) {
- guards.push(guardToPromiseFn(guard, to, from));
- }
- guards.push(canceledNavigationCheck);
- return runGuardQueue(guards);
- }).catch((err) => isNavigationFailure(
- err,
- 8
- /* ErrorTypes.NAVIGATION_CANCELLED */
- ) ? err : Promise.reject(err));
- }
- function triggerAfterEach(to, from, failure) {
- afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
- }
- function finalizeNavigation(toLocation, from, isPush, replace2, data) {
- const error = checkCanceledNavigation(toLocation, from);
- if (error)
- return error;
- const isFirstNavigation = from === START_LOCATION_NORMALIZED;
- const state = !isBrowser ? {} : history.state;
- if (isPush) {
- if (replace2 || isFirstNavigation)
- routerHistory.replace(toLocation.fullPath, assign$1({
- scroll: isFirstNavigation && state && state.scroll
- }, data));
- else
- routerHistory.push(toLocation.fullPath, data);
- }
- currentRoute.value = toLocation;
- handleScroll(toLocation, from, isPush, isFirstNavigation);
- markAsReady();
- }
- let removeHistoryListener;
- function setupListeners() {
- if (removeHistoryListener)
- return;
- removeHistoryListener = routerHistory.listen((to, _from, info) => {
- if (!router2.listening)
- return;
- const toLocation = resolve2(to);
- const shouldRedirect = handleRedirectRecord(toLocation);
- if (shouldRedirect) {
- pushWithRedirect(assign$1(shouldRedirect, { replace: true }), toLocation).catch(noop$1);
- return;
- }
- pendingLocation = toLocation;
- const from = currentRoute.value;
- if (isBrowser) {
- saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
- }
- navigate(toLocation, from).catch((error) => {
- if (isNavigationFailure(
- error,
- 4 | 8
- /* ErrorTypes.NAVIGATION_CANCELLED */
- )) {
- return error;
- }
- if (isNavigationFailure(
- error,
- 2
- /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
- )) {
- pushWithRedirect(
- error.to,
- toLocation
- // avoid an uncaught rejection, let push call triggerError
- ).then((failure) => {
- if (isNavigationFailure(
- failure,
- 4 | 16
- /* ErrorTypes.NAVIGATION_DUPLICATED */
- ) && !info.delta && info.type === NavigationType.pop) {
- routerHistory.go(-1, false);
- }
- }).catch(noop$1);
- return Promise.reject();
- }
- if (info.delta) {
- routerHistory.go(-info.delta, false);
- }
- return triggerError(error, toLocation, from);
- }).then((failure) => {
- failure = failure || finalizeNavigation(
- // after navigation, all matched components are resolved
- toLocation,
- from,
- false
- );
- if (failure) {
- if (info.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
- // entry while a different route is displayed
- !isNavigationFailure(
- failure,
- 8
- /* ErrorTypes.NAVIGATION_CANCELLED */
- )) {
- routerHistory.go(-info.delta, false);
- } else if (info.type === NavigationType.pop && isNavigationFailure(
- failure,
- 4 | 16
- /* ErrorTypes.NAVIGATION_DUPLICATED */
- )) {
- routerHistory.go(-1, false);
- }
- }
- triggerAfterEach(toLocation, from, failure);
- }).catch(noop$1);
- });
- }
- let readyHandlers = useCallbacks();
- let errorListeners = useCallbacks();
- let ready;
- function triggerError(error, to, from) {
- markAsReady(error);
- const list = errorListeners.list();
- if (list.length) {
- list.forEach((handler) => handler(error, to, from));
- } else {
- console.error(error);
- }
- return Promise.reject(error);
- }
- function isReady() {
- if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
- return Promise.resolve();
- return new Promise((resolve3, reject) => {
- readyHandlers.add([resolve3, reject]);
- });
- }
- function markAsReady(err) {
- if (!ready) {
- ready = !err;
- setupListeners();
- readyHandlers.list().forEach(([resolve3, reject]) => err ? reject(err) : resolve3());
- readyHandlers.reset();
- }
- return err;
- }
- function handleScroll(to, from, isPush, isFirstNavigation) {
- const { scrollBehavior } = options;
- if (!isBrowser || !scrollBehavior)
- return Promise.resolve();
- const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
- return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
- }
- const go = (delta) => routerHistory.go(delta);
- let started;
- const installedApps = /* @__PURE__ */ new Set();
- const router2 = {
- currentRoute,
- listening: true,
- addRoute,
- removeRoute,
- clearRoutes: matcher.clearRoutes,
- hasRoute,
- getRoutes,
- resolve: resolve2,
- options,
- push,
- replace,
- go,
- back: () => go(-1),
- forward: () => go(1),
- beforeEach: beforeGuards.add,
- beforeResolve: beforeResolveGuards.add,
- afterEach: afterGuards.add,
- onError: errorListeners.add,
- isReady,
- install(app2) {
- const router3 = this;
- app2.component("RouterLink", RouterLink);
- app2.component("RouterView", RouterView);
- app2.config.globalProperties.$router = router3;
- Object.defineProperty(app2.config.globalProperties, "$route", {
- enumerable: true,
- get: () => unref(currentRoute)
- });
- if (isBrowser && // used for the initial navigation client side to avoid pushing
- // multiple times when the router is used in multiple apps
- !started && currentRoute.value === START_LOCATION_NORMALIZED) {
- started = true;
- push(routerHistory.location).catch((err) => {
- });
- }
- const reactiveRoute = {};
- for (const key in START_LOCATION_NORMALIZED) {
- Object.defineProperty(reactiveRoute, key, {
- get: () => currentRoute.value[key],
- enumerable: true
- });
- }
- app2.provide(routerKey, router3);
- app2.provide(routeLocationKey, shallowReactive(reactiveRoute));
- app2.provide(routerViewLocationKey, currentRoute);
- const unmountApp = app2.unmount;
- installedApps.add(app2);
- app2.unmount = function() {
- installedApps.delete(app2);
- if (installedApps.size < 1) {
- pendingLocation = START_LOCATION_NORMALIZED;
- removeHistoryListener && removeHistoryListener();
- removeHistoryListener = null;
- currentRoute.value = START_LOCATION_NORMALIZED;
- started = false;
- ready = false;
- }
- unmountApp();
- };
- }
- };
- function runGuardQueue(guards) {
- return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
- }
- return router2;
- }
- function extractChangingRecords(to, from) {
- const leavingRecords = [];
- const updatingRecords = [];
- const enteringRecords = [];
- const len = Math.max(from.matched.length, to.matched.length);
- for (let i = 0; i < len; i++) {
- const recordFrom = from.matched[i];
- if (recordFrom) {
- if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
- updatingRecords.push(recordFrom);
- else
- leavingRecords.push(recordFrom);
- }
- const recordTo = to.matched[i];
- if (recordTo) {
- if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) {
- enteringRecords.push(recordTo);
- }
- }
- }
- return [leavingRecords, updatingRecords, enteringRecords];
- }
- function useRouter() {
- return inject(routerKey);
- }
- var isVue2 = false;
- /*!
- * pinia v2.2.2
- * (c) 2024 Eduardo San Martin Morote
- * @license MIT
- */
- let activePinia;
- const setActivePinia = (pinia2) => activePinia = pinia2;
- const piniaSymbol = (
- /* istanbul ignore next */
- Symbol()
- );
- function isPlainObject(o) {
- return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function";
- }
- var MutationType;
- (function(MutationType2) {
- MutationType2["direct"] = "direct";
- MutationType2["patchObject"] = "patch object";
- MutationType2["patchFunction"] = "patch function";
- })(MutationType || (MutationType = {}));
- function createPinia() {
- const scope = effectScope(true);
- const state = scope.run(() => ref({}));
- let _p = [];
- let toBeInstalled = [];
- const pinia2 = markRaw({
- install(app2) {
- setActivePinia(pinia2);
- {
- pinia2._a = app2;
- app2.provide(piniaSymbol, pinia2);
- app2.config.globalProperties.$pinia = pinia2;
- toBeInstalled.forEach((plugin) => _p.push(plugin));
- toBeInstalled = [];
- }
- },
- use(plugin) {
- if (!this._a && !isVue2) {
- toBeInstalled.push(plugin);
- } else {
- _p.push(plugin);
- }
- return this;
- },
- _p,
- // it's actually undefined here
- // @ts-expect-error
- _a: null,
- _e: scope,
- _s: /* @__PURE__ */ new Map(),
- state
- });
- return pinia2;
- }
- const noop = () => {
- };
- function addSubscription(subscriptions, callback, detached, onCleanup = noop) {
- subscriptions.push(callback);
- const removeSubscription = () => {
- const idx = subscriptions.indexOf(callback);
- if (idx > -1) {
- subscriptions.splice(idx, 1);
- onCleanup();
- }
- };
- if (!detached && getCurrentScope()) {
- onScopeDispose(removeSubscription);
- }
- return removeSubscription;
- }
- function triggerSubscriptions(subscriptions, ...args) {
- subscriptions.slice().forEach((callback) => {
- callback(...args);
- });
- }
- const fallbackRunWithContext = (fn) => fn();
- const ACTION_MARKER = Symbol();
- const ACTION_NAME = Symbol();
- function mergeReactiveObjects(target, patchToApply) {
- if (target instanceof Map && patchToApply instanceof Map) {
- patchToApply.forEach((value, key) => target.set(key, value));
- } else if (target instanceof Set && patchToApply instanceof Set) {
- patchToApply.forEach(target.add, target);
- }
- for (const key in patchToApply) {
- if (!patchToApply.hasOwnProperty(key))
- continue;
- const subPatch = patchToApply[key];
- const targetValue = target[key];
- if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) {
- target[key] = mergeReactiveObjects(targetValue, subPatch);
- } else {
- target[key] = subPatch;
- }
- }
- return target;
- }
- const skipHydrateSymbol = (
- /* istanbul ignore next */
- Symbol()
- );
- function shouldHydrate(obj) {
- return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol);
- }
- const { assign } = Object;
- function isComputed(o) {
- return !!(isRef(o) && o.effect);
- }
- function createOptionsStore(id, options, pinia2, hot) {
- const { state, actions, getters } = options;
- const initialState = pinia2.state.value[id];
- let store;
- function setup() {
- if (!initialState && true) {
- {
- pinia2.state.value[id] = state ? state() : {};
- }
- }
- const localState = toRefs(pinia2.state.value[id]);
- return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {
- computedGetters[name] = markRaw(computed(() => {
- setActivePinia(pinia2);
- const store2 = pinia2._s.get(id);
- return getters[name].call(store2, store2);
- }));
- return computedGetters;
- }, {}));
- }
- store = createSetupStore(id, setup, options, pinia2, hot, true);
- return store;
- }
- function createSetupStore($id, setup, options = {}, pinia2, hot, isOptionsStore) {
- let scope;
- const optionsForPlugin = assign({ actions: {} }, options);
- const $subscribeOptions = { deep: true };
- let isListening;
- let isSyncListening;
- let subscriptions = [];
- let actionSubscriptions = [];
- let debuggerEvents;
- const initialState = pinia2.state.value[$id];
- if (!isOptionsStore && !initialState && true) {
- {
- pinia2.state.value[$id] = {};
- }
- }
- ref({});
- let activeListener;
- function $patch(partialStateOrMutator) {
- let subscriptionMutation;
- isListening = isSyncListening = false;
- if (typeof partialStateOrMutator === "function") {
- partialStateOrMutator(pinia2.state.value[$id]);
- subscriptionMutation = {
- type: MutationType.patchFunction,
- storeId: $id,
- events: debuggerEvents
- };
- } else {
- mergeReactiveObjects(pinia2.state.value[$id], partialStateOrMutator);
- subscriptionMutation = {
- type: MutationType.patchObject,
- payload: partialStateOrMutator,
- storeId: $id,
- events: debuggerEvents
- };
- }
- const myListenerId = activeListener = Symbol();
- nextTick().then(() => {
- if (activeListener === myListenerId) {
- isListening = true;
- }
- });
- isSyncListening = true;
- triggerSubscriptions(subscriptions, subscriptionMutation, pinia2.state.value[$id]);
- }
- const $reset = isOptionsStore ? function $reset2() {
- const { state } = options;
- const newState = state ? state() : {};
- this.$patch(($state) => {
- assign($state, newState);
- });
- } : (
- /* istanbul ignore next */
- noop
- );
- function $dispose() {
- scope.stop();
- subscriptions = [];
- actionSubscriptions = [];
- pinia2._s.delete($id);
- }
- const action = (fn, name = "") => {
- if (ACTION_MARKER in fn) {
- fn[ACTION_NAME] = name;
- return fn;
- }
- const wrappedAction = function() {
- setActivePinia(pinia2);
- const args = Array.from(arguments);
- const afterCallbackList = [];
- const onErrorCallbackList = [];
- function after(callback) {
- afterCallbackList.push(callback);
- }
- function onError(callback) {
- onErrorCallbackList.push(callback);
- }
- triggerSubscriptions(actionSubscriptions, {
- args,
- name: wrappedAction[ACTION_NAME],
- store,
- after,
- onError
- });
- let ret;
- try {
- ret = fn.apply(this && this.$id === $id ? this : store, args);
- } catch (error) {
- triggerSubscriptions(onErrorCallbackList, error);
- throw error;
- }
- if (ret instanceof Promise) {
- return ret.then((value) => {
- triggerSubscriptions(afterCallbackList, value);
- return value;
- }).catch((error) => {
- triggerSubscriptions(onErrorCallbackList, error);
- return Promise.reject(error);
- });
- }
- triggerSubscriptions(afterCallbackList, ret);
- return ret;
- };
- wrappedAction[ACTION_MARKER] = true;
- wrappedAction[ACTION_NAME] = name;
- return wrappedAction;
- };
- const partialStore = {
- _p: pinia2,
- // _s: scope,
- $id,
- $onAction: addSubscription.bind(null, actionSubscriptions),
- $patch,
- $reset,
- $subscribe(callback, options2 = {}) {
- const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher());
- const stopWatcher = scope.run(() => watch(() => pinia2.state.value[$id], (state) => {
- if (options2.flush === "sync" ? isSyncListening : isListening) {
- callback({
- storeId: $id,
- type: MutationType.direct,
- events: debuggerEvents
- }, state);
- }
- }, assign({}, $subscribeOptions, options2)));
- return removeSubscription;
- },
- $dispose
- };
- const store = reactive(partialStore);
- pinia2._s.set($id, store);
- const runWithContext = pinia2._a && pinia2._a.runWithContext || fallbackRunWithContext;
- const setupStore = runWithContext(() => pinia2._e.run(() => (scope = effectScope()).run(() => setup({ action }))));
- for (const key in setupStore) {
- const prop = setupStore[key];
- if (isRef(prop) && !isComputed(prop) || isReactive(prop)) {
- if (!isOptionsStore) {
- if (initialState && shouldHydrate(prop)) {
- if (isRef(prop)) {
- prop.value = initialState[key];
- } else {
- mergeReactiveObjects(prop, initialState[key]);
- }
- }
- {
- pinia2.state.value[$id][key] = prop;
- }
- }
- } else if (typeof prop === "function") {
- const actionValue = action(prop, key);
- {
- setupStore[key] = actionValue;
- }
- optionsForPlugin.actions[key] = prop;
- } else
- ;
- }
- {
- assign(store, setupStore);
- assign(toRaw(store), setupStore);
- }
- Object.defineProperty(store, "$state", {
- get: () => pinia2.state.value[$id],
- set: (state) => {
- $patch(($state) => {
- assign($state, state);
- });
- }
- });
- pinia2._p.forEach((extender) => {
- {
- assign(store, scope.run(() => extender({
- store,
- app: pinia2._a,
- pinia: pinia2,
- options: optionsForPlugin
- })));
- }
- });
- if (initialState && isOptionsStore && options.hydrate) {
- options.hydrate(store.$state, initialState);
- }
- isListening = true;
- isSyncListening = true;
- return store;
- }
- // @__NO_SIDE_EFFECTS__
- function defineStore(idOrOptions, setup, setupOptions) {
- let id;
- let options;
- const isSetupStore = typeof setup === "function";
- if (typeof idOrOptions === "string") {
- id = idOrOptions;
- options = isSetupStore ? setupOptions : setup;
- } else {
- options = idOrOptions;
- id = idOrOptions.id;
- }
- function useStore(pinia2, hot) {
- const hasContext = hasInjectionContext();
- pinia2 = // in test mode, ignore the argument provided as we can always retrieve a
- // pinia instance with getActivePinia()
- pinia2 || (hasContext ? inject(piniaSymbol, null) : null);
- if (pinia2)
- setActivePinia(pinia2);
- pinia2 = activePinia;
- if (!pinia2._s.has(id)) {
- if (isSetupStore) {
- createSetupStore(id, setup, options, pinia2);
- } else {
- createOptionsStore(id, options, pinia2);
- }
- }
- const store = pinia2._s.get(id);
- return store;
- }
- useStore.$id = id;
- return useStore;
- }
- const useStoreOfUserInfo = /* @__PURE__ */ defineStore("userInfo", {
- state: () => {
- return {
- id: "",
- mobile: "",
- username: "",
- password: "",
- token: "",
- roles: [],
- isLogin: false,
- isRememberMe: false
- };
- },
- persist: {
- enabled: true,
- encryptionKey: "userInfo",
- storage: localStorage
- }
- });
- const routes = [
- {
- path: "/wap",
- redirect: "/wap/home"
- },
- {
- path: "/wap/home1",
- component: () => __vitePreload(() => import("./Index-1a616312.js"), true ? ["wap/assets/Index-1a616312.js","wap/assets/index-487cde8c.js","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/use-route-726f0d0b.js","wap/assets/Index-5f1ab155.css"] : void 0),
- meta: {
- keepAlive: true
- },
- children: [
- // {
- // path: '/home',
- // component: ()=> import('@/pages/home/Index.vue'),
- // meta: {
- // keepAlive: true,
- // }
- // },
- {
- path: "/wap/home",
- component: () => __vitePreload(() => import("./Index-cf160516.js"), true ? ["wap/assets/Index-cf160516.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/index-d3364b49.js","wap/assets/index-4345ad0b.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/Index-919d086a.js","wap/assets/vue-qrcode-reader-d831402f.js","wap/assets/Index-9a8bf70a.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/device",
- component: () => __vitePreload(() => import("./Index-cf160516.js"), true ? ["wap/assets/Index-cf160516.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/index-d3364b49.js","wap/assets/index-4345ad0b.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/Index-919d086a.js","wap/assets/vue-qrcode-reader-d831402f.js","wap/assets/Index-9a8bf70a.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/mine",
- component: () => __vitePreload(() => import("./Index-3728f235.js"), true ? ["wap/assets/Index-3728f235.js","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-487cde8c.js","wap/assets/index-f0784bc6.css","wap/assets/index-b1054607.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-f1ec0231.js","wap/assets/index-09ccac2b.css","wap/assets/Index-1932fd7a.css"] : void 0),
- meta: {
- keepAlive: true
- }
- }
- ]
- },
- {
- path: "/wap/sales/add",
- component: () => __vitePreload(() => import("./Index-ee20539c.js"), true ? ["wap/assets/Index-ee20539c.js","wap/assets/Index-847fa614.js","wap/assets/index-487cde8c.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/Index-81d286e0.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-73d5a905.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-d43e462e.css","wap/assets/index-3a8cf159.js","wap/assets/index-5f12e0f5.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/index-fefbbdb7.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/index-86652afb.css","wap/assets/function-call-dc072a29.js","wap/assets/Index-4d8a0bb8.css"] : void 0)
- },
- {
- path: "/wap/sales/list",
- component: () => __vitePreload(() => import("./Index-c0deaf04.js"), true ? ["wap/assets/Index-c0deaf04.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/util-88d32f50.js","wap/assets/index-0f48f786.js","wap/assets/index-c73aaf1f.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/util-fdf6bc77.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-3a8cf159.js","wap/assets/index-5f12e0f5.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/Index-4537c057.css"] : void 0)
- },
- {
- path: "/wap/recycle/add",
- component: () => __vitePreload(() => import("./Index-8f0ad845.js"), true ? ["wap/assets/Index-8f0ad845.js","wap/assets/Index-847fa614.js","wap/assets/index-487cde8c.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/Index-81d286e0.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-73d5a905.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-d43e462e.css","wap/assets/index-3a8cf159.js","wap/assets/index-5f12e0f5.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/index-fefbbdb7.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/index-86652afb.css","wap/assets/function-call-dc072a29.js","wap/assets/Index-67761f1f.css"] : void 0)
- },
- {
- path: "/wap/recycle/list",
- component: () => __vitePreload(() => import("./Index-97473d99.js"), true ? ["wap/assets/Index-97473d99.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/util-88d32f50.js","wap/assets/index-0f48f786.js","wap/assets/index-c73aaf1f.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/util-fdf6bc77.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-3a8cf159.js","wap/assets/index-5f12e0f5.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/Index-dd7c9b8f.css"] : void 0)
- },
- {
- path: "/wap/login",
- component: () => __vitePreload(() => import("./Index-b1985b54.js"), true ? ["wap/assets/Index-b1985b54.js","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-487cde8c.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-3a8cf159.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-5f12e0f5.css","wap/assets/index-f1ec0231.js","wap/assets/index-09ccac2b.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-d3364b49.js","wap/assets/index-4345ad0b.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/index-eef3af38.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-0229ad12.js","wap/assets/Index-46b7e7ca.css"] : void 0)
- },
- {
- path: "/wap/register",
- component: () => __vitePreload(() => import("./Index-46f00f0a.js"), true ? ["wap/assets/Index-46f00f0a.js","wap/assets/index-3a8cf159.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-487cde8c.js","wap/assets/index-5f12e0f5.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/index-eef3af38.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-0229ad12.js","wap/assets/Index-357e19ad.css"] : void 0)
- },
- {
- path: "/wap/findpassword",
- component: () => __vitePreload(() => import("./Index-760bbdce.js"), true ? ["wap/assets/Index-760bbdce.js","wap/assets/index-3a8cf159.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-487cde8c.js","wap/assets/index-5f12e0f5.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/index-0229ad12.js","wap/assets/Index-441fdb15.css"] : void 0)
- },
- {
- path: "/wap/changepassword",
- component: () => __vitePreload(() => import("./Changepassword-b9f16465.js"), true ? ["wap/assets/Changepassword-b9f16465.js","wap/assets/index-3a8cf159.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-487cde8c.js","wap/assets/index-5f12e0f5.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/request-76e4192b.js","wap/assets/axios-8cd254ce.js","wap/assets/index-0229ad12.js","wap/assets/Changepassword-22899196.css"] : void 0)
- },
- {
- path: "/wap/search",
- component: () => __vitePreload(() => import("./Index-89cb68e2.js"), true ? ["wap/assets/Index-89cb68e2.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/index-f1ec0231.js","wap/assets/index-09ccac2b.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/article",
- component: () => __vitePreload(() => import("./Index-e0b19cb0.js"), true ? ["wap/assets/Index-e0b19cb0.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/index-f1ec0231.js","wap/assets/index-09ccac2b.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/article/detail/:articleId",
- component: () => __vitePreload(() => import("./Detail-46443295.js"), true ? ["wap/assets/Detail-46443295.js","wap/assets/CusNavigation-87012716.js","wap/assets/index-eef3af38.js","wap/assets/index-487cde8c.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/CusNavigation-cecd89a4.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/device/detail/:deviceId",
- component: () => __vitePreload(() => import("./Index-430409d8.js"), true ? ["wap/assets/Index-430409d8.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/index-b1054607.js","wap/assets/index-6125a673.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css","wap/assets/index-dd255780.js","wap/assets/index-d3364b49.js","wap/assets/index-4345ad0b.css","wap/assets/Index-919d086a.js","wap/assets/vue-qrcode-reader-d831402f.js","wap/assets/Index-9a8bf70a.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/device/ascend/:deviceId",
- component: () => __vitePreload(() => import("./Index-b0165bbb.js"), true ? ["wap/assets/Index-b0165bbb.js","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-487cde8c.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/index-f1ec0231.js","wap/assets/index-09ccac2b.css","wap/assets/Index-726604dc.css"] : void 0),
- meta: {
- title: "驼人物联网平台终端设备追溯",
- keepAlive: true
- }
- },
- {
- path: "/wap/device/location/:deviceId",
- component: () => __vitePreload(() => import("./Location-fa750809.js"), true ? ["wap/assets/Location-fa750809.js","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/index-487cde8c.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-eef3af38.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/device/log/:deviceId",
- component: () => __vitePreload(() => import("./Log-fb070c89.js"), true ? ["wap/assets/Log-fb070c89.js","wap/assets/index-9e456003.js","wap/assets/index-487cde8c.js","wap/assets/index-e4fe1374.css","wap/assets/index-e8b8fc91.js","wap/assets/index-eef3af38.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-217c49a0.js","wap/assets/index-8387a057.css","wap/assets/index-73d5a905.js","wap/assets/index-d43e462e.css","wap/assets/index-8540448e.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-f0784bc6.css","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/index-dd255780.js","wap/assets/Log-c9a23984.css"] : void 0),
- meta: {
- keepAlive: true
- }
- },
- {
- path: "/wap/demo",
- component: () => __vitePreload(() => import("./Index3-9e732855.js"), true ? ["wap/assets/Index3-9e732855.js","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-487cde8c.js","wap/assets/index-217c49a0.js","wap/assets/index-6125a673.css","wap/assets/vue-qrcode-reader-d831402f.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-eef3af38.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/Index3-c6180da9.css"] : void 0)
- },
- {
- path: "/wap/mine/wifi",
- component: () => __vitePreload(() => import("./Index-fde06628.js"), true ? ["wap/assets/Index-fde06628.js","wap/assets/index-0f48f786.js","wap/assets/index-487cde8c.js","wap/assets/use-scope-id-0b5b8615.js","wap/assets/index-217c49a0.js","wap/assets/index-eef3af38.js","wap/assets/on-popup-reopen-c5ca1603.js","wap/assets/index-c73aaf1f.css","wap/assets/index-9e456003.js","wap/assets/index-e4fe1374.css","wap/assets/index-b1054607.js","wap/assets/use-route-726f0d0b.js","wap/assets/index-6125a673.css","wap/assets/index-3a8cf159.js","wap/assets/index-5f12e0f5.css","wap/assets/index-8540448e.js","wap/assets/index-f0784bc6.css","wap/assets/index-41ec7e28.js","wap/assets/index-fbff4b7c.css","wap/assets/CusNavigation-87012716.js","wap/assets/CusNavigation-cecd89a4.css","wap/assets/index-18735c56.js","wap/assets/axios-8cd254ce.js","wap/assets/function-call-dc072a29.js","wap/assets/mount-component-2b0f7b23.js","wap/assets/index-fefbbdb7.js","wap/assets/use-placeholder-16d7c5d7.js","wap/assets/index-86652afb.css","wap/assets/index-0229ad12.js","wap/assets/Index-16170745.css"] : void 0)
- }
- ];
- const router = createRouter({
- // history: createWebHistory(),
- history: createWebHashHistory(),
- routes
- });
- const title = "驼人物联网平台";
- const loginPath = "/wap/login";
- const ascendPath = "/wap/device/ascend";
- const accessList = [loginPath, "/wap/register", "/wap/findpassword", "/wap/demo", "article"];
- router.beforeEach((to, from) => {
- const userInfo = useStoreOfUserInfo();
- console.log("导航守卫", to, from);
- if (to.meta && to.meta.title) {
- document.title = to.meta.title;
- } else {
- document.title = title;
- }
- if (userInfo.isLogin) {
- return;
- }
- if (accessList.includes(to.path)) {
- return;
- }
- if (to.path.includes(ascendPath)) {
- return;
- }
- if (to.path.includes("/wap/article/detail")) {
- return;
- }
- return {
- path: loginPath
- };
- });
- function refreshCurrentRoute() {
- const userInfo = useStoreOfUserInfo();
- const current = router.currentRoute.value;
- if (!accessList.includes(current.path) && !userInfo.isLogin) {
- router.replace(loginPath);
- }
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- function getDefaultExportFromCjs(x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
- }
- function getAugmentedNamespace(n) {
- if (n.__esModule)
- return n;
- var f = n.default;
- if (typeof f == "function") {
- var a = function a2() {
- if (this instanceof a2) {
- return Reflect.construct(f, arguments, this.constructor);
- }
- return f.apply(this, arguments);
- };
- a.prototype = f.prototype;
- } else
- a = {};
- Object.defineProperty(a, "__esModule", { value: true });
- Object.keys(n).forEach(function(k) {
- var d = Object.getOwnPropertyDescriptor(n, k);
- Object.defineProperty(a, k, d.get ? d : {
- enumerable: true,
- get: function() {
- return n[k];
- }
- });
- });
- return a;
- }
- var cryptoJs = { exports: {} };
- function commonjsRequire(path) {
- throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
- }
- var core = { exports: {} };
- const __viteBrowserExternal = {};
- const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: __viteBrowserExternal
- }, Symbol.toStringTag, { value: "Module" }));
- const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
- var hasRequiredCore;
- function requireCore() {
- if (hasRequiredCore)
- return core.exports;
- hasRequiredCore = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory();
- }
- })(commonjsGlobal, function() {
- var CryptoJS = CryptoJS || function(Math2, undefined$1) {
- var crypto;
- if (typeof window !== "undefined" && window.crypto) {
- crypto = window.crypto;
- }
- if (typeof self !== "undefined" && self.crypto) {
- crypto = self.crypto;
- }
- if (typeof globalThis !== "undefined" && globalThis.crypto) {
- crypto = globalThis.crypto;
- }
- if (!crypto && typeof window !== "undefined" && window.msCrypto) {
- crypto = window.msCrypto;
- }
- if (!crypto && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
- crypto = commonjsGlobal.crypto;
- }
- if (!crypto && typeof commonjsRequire === "function") {
- try {
- crypto = require$$0;
- } catch (err) {
- }
- }
- var cryptoSecureRandomInt = function() {
- if (crypto) {
- if (typeof crypto.getRandomValues === "function") {
- try {
- return crypto.getRandomValues(new Uint32Array(1))[0];
- } catch (err) {
- }
- }
- if (typeof crypto.randomBytes === "function") {
- try {
- return crypto.randomBytes(4).readInt32LE();
- } catch (err) {
- }
- }
- }
- throw new Error("Native crypto module could not be used to get secure random number.");
- };
- var create = Object.create || function() {
- function F() {
- }
- return function(obj) {
- var subtype;
- F.prototype = obj;
- subtype = new F();
- F.prototype = null;
- return subtype;
- };
- }();
- var C = {};
- var C_lib = C.lib = {};
- var Base = C_lib.Base = function() {
- return {
- /**
- * Creates a new object that inherits from this object.
- *
- * @param {Object} overrides Properties to copy into the new object.
- *
- * @return {Object} The new object.
- *
- * @static
- *
- * @example
- *
- * var MyType = CryptoJS.lib.Base.extend({
- * field: 'value',
- *
- * method: function () {
- * }
- * });
- */
- extend: function(overrides) {
- var subtype = create(this);
- if (overrides) {
- subtype.mixIn(overrides);
- }
- if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
- subtype.init = function() {
- subtype.$super.init.apply(this, arguments);
- };
- }
- subtype.init.prototype = subtype;
- subtype.$super = this;
- return subtype;
- },
- /**
- * Extends this object and runs the init method.
- * Arguments to create() will be passed to init().
- *
- * @return {Object} The new object.
- *
- * @static
- *
- * @example
- *
- * var instance = MyType.create();
- */
- create: function() {
- var instance = this.extend();
- instance.init.apply(instance, arguments);
- return instance;
- },
- /**
- * Initializes a newly created object.
- * Override this method to add some logic when your objects are created.
- *
- * @example
- *
- * var MyType = CryptoJS.lib.Base.extend({
- * init: function () {
- * // ...
- * }
- * });
- */
- init: function() {
- },
- /**
- * Copies properties into this object.
- *
- * @param {Object} properties The properties to mix in.
- *
- * @example
- *
- * MyType.mixIn({
- * field: 'value'
- * });
- */
- mixIn: function(properties) {
- for (var propertyName in properties) {
- if (properties.hasOwnProperty(propertyName)) {
- this[propertyName] = properties[propertyName];
- }
- }
- if (properties.hasOwnProperty("toString")) {
- this.toString = properties.toString;
- }
- },
- /**
- * Creates a copy of this object.
- *
- * @return {Object} The clone.
- *
- * @example
- *
- * var clone = instance.clone();
- */
- clone: function() {
- return this.init.prototype.extend(this);
- }
- };
- }();
- var WordArray = C_lib.WordArray = Base.extend({
- /**
- * Initializes a newly created word array.
- *
- * @param {Array} words (Optional) An array of 32-bit words.
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
- *
- * @example
- *
- * var wordArray = CryptoJS.lib.WordArray.create();
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
- */
- init: function(words, sigBytes) {
- words = this.words = words || [];
- if (sigBytes != undefined$1) {
- this.sigBytes = sigBytes;
- } else {
- this.sigBytes = words.length * 4;
- }
- },
- /**
- * Converts this word array to a string.
- *
- * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
- *
- * @return {string} The stringified word array.
- *
- * @example
- *
- * var string = wordArray + '';
- * var string = wordArray.toString();
- * var string = wordArray.toString(CryptoJS.enc.Utf8);
- */
- toString: function(encoder) {
- return (encoder || Hex).stringify(this);
- },
- /**
- * Concatenates a word array to this word array.
- *
- * @param {WordArray} wordArray The word array to append.
- *
- * @return {WordArray} This word array.
- *
- * @example
- *
- * wordArray1.concat(wordArray2);
- */
- concat: function(wordArray) {
- var thisWords = this.words;
- var thatWords = wordArray.words;
- var thisSigBytes = this.sigBytes;
- var thatSigBytes = wordArray.sigBytes;
- this.clamp();
- if (thisSigBytes % 4) {
- for (var i = 0; i < thatSigBytes; i++) {
- var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255;
- thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
- }
- } else {
- for (var j = 0; j < thatSigBytes; j += 4) {
- thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2];
- }
- }
- this.sigBytes += thatSigBytes;
- return this;
- },
- /**
- * Removes insignificant bits.
- *
- * @example
- *
- * wordArray.clamp();
- */
- clamp: function() {
- var words = this.words;
- var sigBytes = this.sigBytes;
- words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
- words.length = Math2.ceil(sigBytes / 4);
- },
- /**
- * Creates a copy of this word array.
- *
- * @return {WordArray} The clone.
- *
- * @example
- *
- * var clone = wordArray.clone();
- */
- clone: function() {
- var clone = Base.clone.call(this);
- clone.words = this.words.slice(0);
- return clone;
- },
- /**
- * Creates a word array filled with random bytes.
- *
- * @param {number} nBytes The number of random bytes to generate.
- *
- * @return {WordArray} The random word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.lib.WordArray.random(16);
- */
- random: function(nBytes) {
- var words = [];
- for (var i = 0; i < nBytes; i += 4) {
- words.push(cryptoSecureRandomInt());
- }
- return new WordArray.init(words, nBytes);
- }
- });
- var C_enc = C.enc = {};
- var Hex = C_enc.Hex = {
- /**
- * Converts a word array to a hex string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The hex string.
- *
- * @static
- *
- * @example
- *
- * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
- */
- stringify: function(wordArray) {
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var hexChars = [];
- for (var i = 0; i < sigBytes; i++) {
- var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
- hexChars.push((bite >>> 4).toString(16));
- hexChars.push((bite & 15).toString(16));
- }
- return hexChars.join("");
- },
- /**
- * Converts a hex string to a word array.
- *
- * @param {string} hexStr The hex string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Hex.parse(hexString);
- */
- parse: function(hexStr) {
- var hexStrLength = hexStr.length;
- var words = [];
- for (var i = 0; i < hexStrLength; i += 2) {
- words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
- }
- return new WordArray.init(words, hexStrLength / 2);
- }
- };
- var Latin1 = C_enc.Latin1 = {
- /**
- * Converts a word array to a Latin1 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The Latin1 string.
- *
- * @static
- *
- * @example
- *
- * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
- */
- stringify: function(wordArray) {
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var latin1Chars = [];
- for (var i = 0; i < sigBytes; i++) {
- var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
- latin1Chars.push(String.fromCharCode(bite));
- }
- return latin1Chars.join("");
- },
- /**
- * Converts a Latin1 string to a word array.
- *
- * @param {string} latin1Str The Latin1 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
- */
- parse: function(latin1Str) {
- var latin1StrLength = latin1Str.length;
- var words = [];
- for (var i = 0; i < latin1StrLength; i++) {
- words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
- }
- return new WordArray.init(words, latin1StrLength);
- }
- };
- var Utf8 = C_enc.Utf8 = {
- /**
- * Converts a word array to a UTF-8 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-8 string.
- *
- * @static
- *
- * @example
- *
- * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
- */
- stringify: function(wordArray) {
- try {
- return decodeURIComponent(escape(Latin1.stringify(wordArray)));
- } catch (e) {
- throw new Error("Malformed UTF-8 data");
- }
- },
- /**
- * Converts a UTF-8 string to a word array.
- *
- * @param {string} utf8Str The UTF-8 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
- */
- parse: function(utf8Str) {
- return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
- }
- };
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
- /**
- * Resets this block algorithm's data buffer to its initial state.
- *
- * @example
- *
- * bufferedBlockAlgorithm.reset();
- */
- reset: function() {
- this._data = new WordArray.init();
- this._nDataBytes = 0;
- },
- /**
- * Adds new data to this block algorithm's buffer.
- *
- * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
- *
- * @example
- *
- * bufferedBlockAlgorithm._append('data');
- * bufferedBlockAlgorithm._append(wordArray);
- */
- _append: function(data) {
- if (typeof data == "string") {
- data = Utf8.parse(data);
- }
- this._data.concat(data);
- this._nDataBytes += data.sigBytes;
- },
- /**
- * Processes available data blocks.
- *
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
- *
- * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
- *
- * @return {WordArray} The processed data.
- *
- * @example
- *
- * var processedData = bufferedBlockAlgorithm._process();
- * var processedData = bufferedBlockAlgorithm._process(!!'flush');
- */
- _process: function(doFlush) {
- var processedWords;
- var data = this._data;
- var dataWords = data.words;
- var dataSigBytes = data.sigBytes;
- var blockSize = this.blockSize;
- var blockSizeBytes = blockSize * 4;
- var nBlocksReady = dataSigBytes / blockSizeBytes;
- if (doFlush) {
- nBlocksReady = Math2.ceil(nBlocksReady);
- } else {
- nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
- }
- var nWordsReady = nBlocksReady * blockSize;
- var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
- if (nWordsReady) {
- for (var offset = 0; offset < nWordsReady; offset += blockSize) {
- this._doProcessBlock(dataWords, offset);
- }
- processedWords = dataWords.splice(0, nWordsReady);
- data.sigBytes -= nBytesReady;
- }
- return new WordArray.init(processedWords, nBytesReady);
- },
- /**
- * Creates a copy of this object.
- *
- * @return {Object} The clone.
- *
- * @example
- *
- * var clone = bufferedBlockAlgorithm.clone();
- */
- clone: function() {
- var clone = Base.clone.call(this);
- clone._data = this._data.clone();
- return clone;
- },
- _minBufferSize: 0
- });
- C_lib.Hasher = BufferedBlockAlgorithm.extend({
- /**
- * Configuration options.
- */
- cfg: Base.extend(),
- /**
- * Initializes a newly created hasher.
- *
- * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
- *
- * @example
- *
- * var hasher = CryptoJS.algo.SHA256.create();
- */
- init: function(cfg) {
- this.cfg = this.cfg.extend(cfg);
- this.reset();
- },
- /**
- * Resets this hasher to its initial state.
- *
- * @example
- *
- * hasher.reset();
- */
- reset: function() {
- BufferedBlockAlgorithm.reset.call(this);
- this._doReset();
- },
- /**
- * Updates this hasher with a message.
- *
- * @param {WordArray|string} messageUpdate The message to append.
- *
- * @return {Hasher} This hasher.
- *
- * @example
- *
- * hasher.update('message');
- * hasher.update(wordArray);
- */
- update: function(messageUpdate) {
- this._append(messageUpdate);
- this._process();
- return this;
- },
- /**
- * Finalizes the hash computation.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
- *
- * @return {WordArray} The hash.
- *
- * @example
- *
- * var hash = hasher.finalize();
- * var hash = hasher.finalize('message');
- * var hash = hasher.finalize(wordArray);
- */
- finalize: function(messageUpdate) {
- if (messageUpdate) {
- this._append(messageUpdate);
- }
- var hash = this._doFinalize();
- return hash;
- },
- blockSize: 512 / 32,
- /**
- * Creates a shortcut function to a hasher's object interface.
- *
- * @param {Hasher} hasher The hasher to create a helper for.
- *
- * @return {Function} The shortcut function.
- *
- * @static
- *
- * @example
- *
- * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
- */
- _createHelper: function(hasher) {
- return function(message, cfg) {
- return new hasher.init(cfg).finalize(message);
- };
- },
- /**
- * Creates a shortcut function to the HMAC's object interface.
- *
- * @param {Hasher} hasher The hasher to use in this HMAC helper.
- *
- * @return {Function} The shortcut function.
- *
- * @static
- *
- * @example
- *
- * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
- */
- _createHmacHelper: function(hasher) {
- return function(message, key) {
- return new C_algo.HMAC.init(hasher, key).finalize(message);
- };
- }
- });
- var C_algo = C.algo = {};
- return C;
- }(Math);
- return CryptoJS;
- });
- })(core);
- return core.exports;
- }
- var x64Core = { exports: {} };
- var hasRequiredX64Core;
- function requireX64Core() {
- if (hasRequiredX64Core)
- return x64Core.exports;
- hasRequiredX64Core = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function(undefined$1) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var X32WordArray = C_lib.WordArray;
- var C_x64 = C.x64 = {};
- C_x64.Word = Base.extend({
- /**
- * Initializes a newly created 64-bit word.
- *
- * @param {number} high The high 32 bits.
- * @param {number} low The low 32 bits.
- *
- * @example
- *
- * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
- */
- init: function(high, low) {
- this.high = high;
- this.low = low;
- }
- /**
- * Bitwise NOTs this word.
- *
- * @return {X64Word} A new x64-Word object after negating.
- *
- * @example
- *
- * var negated = x64Word.not();
- */
- // not: function () {
- // var high = ~this.high;
- // var low = ~this.low;
- // return X64Word.create(high, low);
- // },
- /**
- * Bitwise ANDs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to AND with this word.
- *
- * @return {X64Word} A new x64-Word object after ANDing.
- *
- * @example
- *
- * var anded = x64Word.and(anotherX64Word);
- */
- // and: function (word) {
- // var high = this.high & word.high;
- // var low = this.low & word.low;
- // return X64Word.create(high, low);
- // },
- /**
- * Bitwise ORs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to OR with this word.
- *
- * @return {X64Word} A new x64-Word object after ORing.
- *
- * @example
- *
- * var ored = x64Word.or(anotherX64Word);
- */
- // or: function (word) {
- // var high = this.high | word.high;
- // var low = this.low | word.low;
- // return X64Word.create(high, low);
- // },
- /**
- * Bitwise XORs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to XOR with this word.
- *
- * @return {X64Word} A new x64-Word object after XORing.
- *
- * @example
- *
- * var xored = x64Word.xor(anotherX64Word);
- */
- // xor: function (word) {
- // var high = this.high ^ word.high;
- // var low = this.low ^ word.low;
- // return X64Word.create(high, low);
- // },
- /**
- * Shifts this word n bits to the left.
- *
- * @param {number} n The number of bits to shift.
- *
- * @return {X64Word} A new x64-Word object after shifting.
- *
- * @example
- *
- * var shifted = x64Word.shiftL(25);
- */
- // shiftL: function (n) {
- // if (n < 32) {
- // var high = (this.high << n) | (this.low >>> (32 - n));
- // var low = this.low << n;
- // } else {
- // var high = this.low << (n - 32);
- // var low = 0;
- // }
- // return X64Word.create(high, low);
- // },
- /**
- * Shifts this word n bits to the right.
- *
- * @param {number} n The number of bits to shift.
- *
- * @return {X64Word} A new x64-Word object after shifting.
- *
- * @example
- *
- * var shifted = x64Word.shiftR(7);
- */
- // shiftR: function (n) {
- // if (n < 32) {
- // var low = (this.low >>> n) | (this.high << (32 - n));
- // var high = this.high >>> n;
- // } else {
- // var low = this.high >>> (n - 32);
- // var high = 0;
- // }
- // return X64Word.create(high, low);
- // },
- /**
- * Rotates this word n bits to the left.
- *
- * @param {number} n The number of bits to rotate.
- *
- * @return {X64Word} A new x64-Word object after rotating.
- *
- * @example
- *
- * var rotated = x64Word.rotL(25);
- */
- // rotL: function (n) {
- // return this.shiftL(n).or(this.shiftR(64 - n));
- // },
- /**
- * Rotates this word n bits to the right.
- *
- * @param {number} n The number of bits to rotate.
- *
- * @return {X64Word} A new x64-Word object after rotating.
- *
- * @example
- *
- * var rotated = x64Word.rotR(7);
- */
- // rotR: function (n) {
- // return this.shiftR(n).or(this.shiftL(64 - n));
- // },
- /**
- * Adds this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to add with this word.
- *
- * @return {X64Word} A new x64-Word object after adding.
- *
- * @example
- *
- * var added = x64Word.add(anotherX64Word);
- */
- // add: function (word) {
- // var low = (this.low + word.low) | 0;
- // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
- // var high = (this.high + word.high + carry) | 0;
- // return X64Word.create(high, low);
- // }
- });
- C_x64.WordArray = Base.extend({
- /**
- * Initializes a newly created word array.
- *
- * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
- *
- * @example
- *
- * var wordArray = CryptoJS.x64.WordArray.create();
- *
- * var wordArray = CryptoJS.x64.WordArray.create([
- * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
- * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
- * ]);
- *
- * var wordArray = CryptoJS.x64.WordArray.create([
- * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
- * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
- * ], 10);
- */
- init: function(words, sigBytes) {
- words = this.words = words || [];
- if (sigBytes != undefined$1) {
- this.sigBytes = sigBytes;
- } else {
- this.sigBytes = words.length * 8;
- }
- },
- /**
- * Converts this 64-bit word array to a 32-bit word array.
- *
- * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
- *
- * @example
- *
- * var x32WordArray = x64WordArray.toX32();
- */
- toX32: function() {
- var x64Words = this.words;
- var x64WordsLength = x64Words.length;
- var x32Words = [];
- for (var i = 0; i < x64WordsLength; i++) {
- var x64Word = x64Words[i];
- x32Words.push(x64Word.high);
- x32Words.push(x64Word.low);
- }
- return X32WordArray.create(x32Words, this.sigBytes);
- },
- /**
- * Creates a copy of this word array.
- *
- * @return {X64WordArray} The clone.
- *
- * @example
- *
- * var clone = x64WordArray.clone();
- */
- clone: function() {
- var clone = Base.clone.call(this);
- var words = clone.words = this.words.slice(0);
- var wordsLength = words.length;
- for (var i = 0; i < wordsLength; i++) {
- words[i] = words[i].clone();
- }
- return clone;
- }
- });
- })();
- return CryptoJS;
- });
- })(x64Core);
- return x64Core.exports;
- }
- var libTypedarrays = { exports: {} };
- var hasRequiredLibTypedarrays;
- function requireLibTypedarrays() {
- if (hasRequiredLibTypedarrays)
- return libTypedarrays.exports;
- hasRequiredLibTypedarrays = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- if (typeof ArrayBuffer != "function") {
- return;
- }
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var superInit = WordArray.init;
- var subInit = WordArray.init = function(typedArray) {
- if (typedArray instanceof ArrayBuffer) {
- typedArray = new Uint8Array(typedArray);
- }
- if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {
- typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
- }
- if (typedArray instanceof Uint8Array) {
- var typedArrayByteLength = typedArray.byteLength;
- var words = [];
- for (var i = 0; i < typedArrayByteLength; i++) {
- words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;
- }
- superInit.call(this, words, typedArrayByteLength);
- } else {
- superInit.apply(this, arguments);
- }
- };
- subInit.prototype = WordArray;
- })();
- return CryptoJS.lib.WordArray;
- });
- })(libTypedarrays);
- return libTypedarrays.exports;
- }
- var encUtf16 = { exports: {} };
- var hasRequiredEncUtf16;
- function requireEncUtf16() {
- if (hasRequiredEncUtf16)
- return encUtf16.exports;
- hasRequiredEncUtf16 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
- C_enc.Utf16 = C_enc.Utf16BE = {
- /**
- * Converts a word array to a UTF-16 BE string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-16 BE string.
- *
- * @static
- *
- * @example
- *
- * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
- */
- stringify: function(wordArray) {
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var utf16Chars = [];
- for (var i = 0; i < sigBytes; i += 2) {
- var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 65535;
- utf16Chars.push(String.fromCharCode(codePoint));
- }
- return utf16Chars.join("");
- },
- /**
- * Converts a UTF-16 BE string to a word array.
- *
- * @param {string} utf16Str The UTF-16 BE string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
- */
- parse: function(utf16Str) {
- var utf16StrLength = utf16Str.length;
- var words = [];
- for (var i = 0; i < utf16StrLength; i++) {
- words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;
- }
- return WordArray.create(words, utf16StrLength * 2);
- }
- };
- C_enc.Utf16LE = {
- /**
- * Converts a word array to a UTF-16 LE string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-16 LE string.
- *
- * @static
- *
- * @example
- *
- * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
- */
- stringify: function(wordArray) {
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var utf16Chars = [];
- for (var i = 0; i < sigBytes; i += 2) {
- var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 65535);
- utf16Chars.push(String.fromCharCode(codePoint));
- }
- return utf16Chars.join("");
- },
- /**
- * Converts a UTF-16 LE string to a word array.
- *
- * @param {string} utf16Str The UTF-16 LE string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
- */
- parse: function(utf16Str) {
- var utf16StrLength = utf16Str.length;
- var words = [];
- for (var i = 0; i < utf16StrLength; i++) {
- words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);
- }
- return WordArray.create(words, utf16StrLength * 2);
- }
- };
- function swapEndian(word) {
- return word << 8 & 4278255360 | word >>> 8 & 16711935;
- }
- })();
- return CryptoJS.enc.Utf16;
- });
- })(encUtf16);
- return encUtf16.exports;
- }
- var encBase64 = { exports: {} };
- var hasRequiredEncBase64;
- function requireEncBase64() {
- if (hasRequiredEncBase64)
- return encBase64.exports;
- hasRequiredEncBase64 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
- C_enc.Base64 = {
- /**
- * Converts a word array to a Base64 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The Base64 string.
- *
- * @static
- *
- * @example
- *
- * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
- */
- stringify: function(wordArray) {
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var map = this._map;
- wordArray.clamp();
- var base64Chars = [];
- for (var i = 0; i < sigBytes; i += 3) {
- var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
- var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
- var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
- var triplet = byte1 << 16 | byte2 << 8 | byte3;
- for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
- base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
- }
- }
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- while (base64Chars.length % 4) {
- base64Chars.push(paddingChar);
- }
- }
- return base64Chars.join("");
- },
- /**
- * Converts a Base64 string to a word array.
- *
- * @param {string} base64Str The Base64 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Base64.parse(base64String);
- */
- parse: function(base64Str) {
- var base64StrLength = base64Str.length;
- var map = this._map;
- var reverseMap = this._reverseMap;
- if (!reverseMap) {
- reverseMap = this._reverseMap = [];
- for (var j = 0; j < map.length; j++) {
- reverseMap[map.charCodeAt(j)] = j;
- }
- }
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- var paddingIndex = base64Str.indexOf(paddingChar);
- if (paddingIndex !== -1) {
- base64StrLength = paddingIndex;
- }
- }
- return parseLoop(base64Str, base64StrLength, reverseMap);
- },
- _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
- };
- function parseLoop(base64Str, base64StrLength, reverseMap) {
- var words = [];
- var nBytes = 0;
- for (var i = 0; i < base64StrLength; i++) {
- if (i % 4) {
- var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
- var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
- var bitsCombined = bits1 | bits2;
- words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
- nBytes++;
- }
- }
- return WordArray.create(words, nBytes);
- }
- })();
- return CryptoJS.enc.Base64;
- });
- })(encBase64);
- return encBase64.exports;
- }
- var encBase64url = { exports: {} };
- var hasRequiredEncBase64url;
- function requireEncBase64url() {
- if (hasRequiredEncBase64url)
- return encBase64url.exports;
- hasRequiredEncBase64url = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
- C_enc.Base64url = {
- /**
- * Converts a word array to a Base64url string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @param {boolean} urlSafe Whether to use url safe
- *
- * @return {string} The Base64url string.
- *
- * @static
- *
- * @example
- *
- * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
- */
- stringify: function(wordArray, urlSafe) {
- if (urlSafe === void 0) {
- urlSafe = true;
- }
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var map = urlSafe ? this._safe_map : this._map;
- wordArray.clamp();
- var base64Chars = [];
- for (var i = 0; i < sigBytes; i += 3) {
- var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
- var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
- var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
- var triplet = byte1 << 16 | byte2 << 8 | byte3;
- for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
- base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
- }
- }
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- while (base64Chars.length % 4) {
- base64Chars.push(paddingChar);
- }
- }
- return base64Chars.join("");
- },
- /**
- * Converts a Base64url string to a word array.
- *
- * @param {string} base64Str The Base64url string.
- *
- * @param {boolean} urlSafe Whether to use url safe
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Base64url.parse(base64String);
- */
- parse: function(base64Str, urlSafe) {
- if (urlSafe === void 0) {
- urlSafe = true;
- }
- var base64StrLength = base64Str.length;
- var map = urlSafe ? this._safe_map : this._map;
- var reverseMap = this._reverseMap;
- if (!reverseMap) {
- reverseMap = this._reverseMap = [];
- for (var j = 0; j < map.length; j++) {
- reverseMap[map.charCodeAt(j)] = j;
- }
- }
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- var paddingIndex = base64Str.indexOf(paddingChar);
- if (paddingIndex !== -1) {
- base64StrLength = paddingIndex;
- }
- }
- return parseLoop(base64Str, base64StrLength, reverseMap);
- },
- _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
- _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
- };
- function parseLoop(base64Str, base64StrLength, reverseMap) {
- var words = [];
- var nBytes = 0;
- for (var i = 0; i < base64StrLength; i++) {
- if (i % 4) {
- var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
- var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
- var bitsCombined = bits1 | bits2;
- words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
- nBytes++;
- }
- }
- return WordArray.create(words, nBytes);
- }
- })();
- return CryptoJS.enc.Base64url;
- });
- })(encBase64url);
- return encBase64url.exports;
- }
- var md5 = { exports: {} };
- var hasRequiredMd5;
- function requireMd5() {
- if (hasRequiredMd5)
- return md5.exports;
- hasRequiredMd5 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function(Math2) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
- var T = [];
- (function() {
- for (var i = 0; i < 64; i++) {
- T[i] = Math2.abs(Math2.sin(i + 1)) * 4294967296 | 0;
- }
- })();
- var MD5 = C_algo.MD5 = Hasher.extend({
- _doReset: function() {
- this._hash = new WordArray.init([
- 1732584193,
- 4023233417,
- 2562383102,
- 271733878
- ]);
- },
- _doProcessBlock: function(M, offset) {
- for (var i = 0; i < 16; i++) {
- var offset_i = offset + i;
- var M_offset_i = M[offset_i];
- M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
- }
- var H = this._hash.words;
- var M_offset_0 = M[offset + 0];
- var M_offset_1 = M[offset + 1];
- var M_offset_2 = M[offset + 2];
- var M_offset_3 = M[offset + 3];
- var M_offset_4 = M[offset + 4];
- var M_offset_5 = M[offset + 5];
- var M_offset_6 = M[offset + 6];
- var M_offset_7 = M[offset + 7];
- var M_offset_8 = M[offset + 8];
- var M_offset_9 = M[offset + 9];
- var M_offset_10 = M[offset + 10];
- var M_offset_11 = M[offset + 11];
- var M_offset_12 = M[offset + 12];
- var M_offset_13 = M[offset + 13];
- var M_offset_14 = M[offset + 14];
- var M_offset_15 = M[offset + 15];
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
- a = FF(a, b, c, d, M_offset_0, 7, T[0]);
- d = FF(d, a, b, c, M_offset_1, 12, T[1]);
- c = FF(c, d, a, b, M_offset_2, 17, T[2]);
- b = FF(b, c, d, a, M_offset_3, 22, T[3]);
- a = FF(a, b, c, d, M_offset_4, 7, T[4]);
- d = FF(d, a, b, c, M_offset_5, 12, T[5]);
- c = FF(c, d, a, b, M_offset_6, 17, T[6]);
- b = FF(b, c, d, a, M_offset_7, 22, T[7]);
- a = FF(a, b, c, d, M_offset_8, 7, T[8]);
- d = FF(d, a, b, c, M_offset_9, 12, T[9]);
- c = FF(c, d, a, b, M_offset_10, 17, T[10]);
- b = FF(b, c, d, a, M_offset_11, 22, T[11]);
- a = FF(a, b, c, d, M_offset_12, 7, T[12]);
- d = FF(d, a, b, c, M_offset_13, 12, T[13]);
- c = FF(c, d, a, b, M_offset_14, 17, T[14]);
- b = FF(b, c, d, a, M_offset_15, 22, T[15]);
- a = GG(a, b, c, d, M_offset_1, 5, T[16]);
- d = GG(d, a, b, c, M_offset_6, 9, T[17]);
- c = GG(c, d, a, b, M_offset_11, 14, T[18]);
- b = GG(b, c, d, a, M_offset_0, 20, T[19]);
- a = GG(a, b, c, d, M_offset_5, 5, T[20]);
- d = GG(d, a, b, c, M_offset_10, 9, T[21]);
- c = GG(c, d, a, b, M_offset_15, 14, T[22]);
- b = GG(b, c, d, a, M_offset_4, 20, T[23]);
- a = GG(a, b, c, d, M_offset_9, 5, T[24]);
- d = GG(d, a, b, c, M_offset_14, 9, T[25]);
- c = GG(c, d, a, b, M_offset_3, 14, T[26]);
- b = GG(b, c, d, a, M_offset_8, 20, T[27]);
- a = GG(a, b, c, d, M_offset_13, 5, T[28]);
- d = GG(d, a, b, c, M_offset_2, 9, T[29]);
- c = GG(c, d, a, b, M_offset_7, 14, T[30]);
- b = GG(b, c, d, a, M_offset_12, 20, T[31]);
- a = HH(a, b, c, d, M_offset_5, 4, T[32]);
- d = HH(d, a, b, c, M_offset_8, 11, T[33]);
- c = HH(c, d, a, b, M_offset_11, 16, T[34]);
- b = HH(b, c, d, a, M_offset_14, 23, T[35]);
- a = HH(a, b, c, d, M_offset_1, 4, T[36]);
- d = HH(d, a, b, c, M_offset_4, 11, T[37]);
- c = HH(c, d, a, b, M_offset_7, 16, T[38]);
- b = HH(b, c, d, a, M_offset_10, 23, T[39]);
- a = HH(a, b, c, d, M_offset_13, 4, T[40]);
- d = HH(d, a, b, c, M_offset_0, 11, T[41]);
- c = HH(c, d, a, b, M_offset_3, 16, T[42]);
- b = HH(b, c, d, a, M_offset_6, 23, T[43]);
- a = HH(a, b, c, d, M_offset_9, 4, T[44]);
- d = HH(d, a, b, c, M_offset_12, 11, T[45]);
- c = HH(c, d, a, b, M_offset_15, 16, T[46]);
- b = HH(b, c, d, a, M_offset_2, 23, T[47]);
- a = II(a, b, c, d, M_offset_0, 6, T[48]);
- d = II(d, a, b, c, M_offset_7, 10, T[49]);
- c = II(c, d, a, b, M_offset_14, 15, T[50]);
- b = II(b, c, d, a, M_offset_5, 21, T[51]);
- a = II(a, b, c, d, M_offset_12, 6, T[52]);
- d = II(d, a, b, c, M_offset_3, 10, T[53]);
- c = II(c, d, a, b, M_offset_10, 15, T[54]);
- b = II(b, c, d, a, M_offset_1, 21, T[55]);
- a = II(a, b, c, d, M_offset_8, 6, T[56]);
- d = II(d, a, b, c, M_offset_15, 10, T[57]);
- c = II(c, d, a, b, M_offset_6, 15, T[58]);
- b = II(b, c, d, a, M_offset_13, 21, T[59]);
- a = II(a, b, c, d, M_offset_4, 6, T[60]);
- d = II(d, a, b, c, M_offset_11, 10, T[61]);
- c = II(c, d, a, b, M_offset_2, 15, T[62]);
- b = II(b, c, d, a, M_offset_9, 21, T[63]);
- H[0] = H[0] + a | 0;
- H[1] = H[1] + b | 0;
- H[2] = H[2] + c | 0;
- H[3] = H[3] + d | 0;
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
- var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
- var nBitsTotalL = nBitsTotal;
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
- data.sigBytes = (dataWords.length + 1) * 4;
- this._process();
- var hash = this._hash;
- var H = hash.words;
- for (var i = 0; i < 4; i++) {
- var H_i = H[i];
- H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
- }
- return hash;
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
- return clone;
- }
- });
- function FF(a, b, c, d, x, s, t) {
- var n = a + (b & c | ~b & d) + x + t;
- return (n << s | n >>> 32 - s) + b;
- }
- function GG(a, b, c, d, x, s, t) {
- var n = a + (b & d | c & ~d) + x + t;
- return (n << s | n >>> 32 - s) + b;
- }
- function HH(a, b, c, d, x, s, t) {
- var n = a + (b ^ c ^ d) + x + t;
- return (n << s | n >>> 32 - s) + b;
- }
- function II(a, b, c, d, x, s, t) {
- var n = a + (c ^ (b | ~d)) + x + t;
- return (n << s | n >>> 32 - s) + b;
- }
- C.MD5 = Hasher._createHelper(MD5);
- C.HmacMD5 = Hasher._createHmacHelper(MD5);
- })(Math);
- return CryptoJS.MD5;
- });
- })(md5);
- return md5.exports;
- }
- var sha1 = { exports: {} };
- var hasRequiredSha1;
- function requireSha1() {
- if (hasRequiredSha1)
- return sha1.exports;
- hasRequiredSha1 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
- var W = [];
- var SHA1 = C_algo.SHA1 = Hasher.extend({
- _doReset: function() {
- this._hash = new WordArray.init([
- 1732584193,
- 4023233417,
- 2562383102,
- 271733878,
- 3285377520
- ]);
- },
- _doProcessBlock: function(M, offset) {
- var H = this._hash.words;
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
- var e = H[4];
- for (var i = 0; i < 80; i++) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
- W[i] = n << 1 | n >>> 31;
- }
- var t = (a << 5 | a >>> 27) + e + W[i];
- if (i < 20) {
- t += (b & c | ~b & d) + 1518500249;
- } else if (i < 40) {
- t += (b ^ c ^ d) + 1859775393;
- } else if (i < 60) {
- t += (b & c | b & d | c & d) - 1894007588;
- } else {
- t += (b ^ c ^ d) - 899497514;
- }
- e = d;
- d = c;
- c = b << 30 | b >>> 2;
- b = a;
- a = t;
- }
- H[0] = H[0] + a | 0;
- H[1] = H[1] + b | 0;
- H[2] = H[2] + c | 0;
- H[3] = H[3] + d | 0;
- H[4] = H[4] + e | 0;
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 4294967296);
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
- this._process();
- return this._hash;
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
- return clone;
- }
- });
- C.SHA1 = Hasher._createHelper(SHA1);
- C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
- })();
- return CryptoJS.SHA1;
- });
- })(sha1);
- return sha1.exports;
- }
- var sha256 = { exports: {} };
- var hasRequiredSha256;
- function requireSha256() {
- if (hasRequiredSha256)
- return sha256.exports;
- hasRequiredSha256 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function(Math2) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
- var H = [];
- var K = [];
- (function() {
- function isPrime(n2) {
- var sqrtN = Math2.sqrt(n2);
- for (var factor = 2; factor <= sqrtN; factor++) {
- if (!(n2 % factor)) {
- return false;
- }
- }
- return true;
- }
- function getFractionalBits(n2) {
- return (n2 - (n2 | 0)) * 4294967296 | 0;
- }
- var n = 2;
- var nPrime = 0;
- while (nPrime < 64) {
- if (isPrime(n)) {
- if (nPrime < 8) {
- H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2));
- }
- K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3));
- nPrime++;
- }
- n++;
- }
- })();
- var W = [];
- var SHA256 = C_algo.SHA256 = Hasher.extend({
- _doReset: function() {
- this._hash = new WordArray.init(H.slice(0));
- },
- _doProcessBlock: function(M, offset) {
- var H2 = this._hash.words;
- var a = H2[0];
- var b = H2[1];
- var c = H2[2];
- var d = H2[3];
- var e = H2[4];
- var f = H2[5];
- var g = H2[6];
- var h2 = H2[7];
- for (var i = 0; i < 64; i++) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- var gamma0x = W[i - 15];
- var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
- var gamma1x = W[i - 2];
- var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
- W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
- }
- var ch = e & f ^ ~e & g;
- var maj = a & b ^ a & c ^ b & c;
- var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
- var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
- var t1 = h2 + sigma1 + ch + K[i] + W[i];
- var t2 = sigma0 + maj;
- h2 = g;
- g = f;
- f = e;
- e = d + t1 | 0;
- d = c;
- c = b;
- b = a;
- a = t1 + t2 | 0;
- }
- H2[0] = H2[0] + a | 0;
- H2[1] = H2[1] + b | 0;
- H2[2] = H2[2] + c | 0;
- H2[3] = H2[3] + d | 0;
- H2[4] = H2[4] + e | 0;
- H2[5] = H2[5] + f | 0;
- H2[6] = H2[6] + g | 0;
- H2[7] = H2[7] + h2 | 0;
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296);
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
- this._process();
- return this._hash;
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
- return clone;
- }
- });
- C.SHA256 = Hasher._createHelper(SHA256);
- C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
- })(Math);
- return CryptoJS.SHA256;
- });
- })(sha256);
- return sha256.exports;
- }
- var sha224 = { exports: {} };
- var hasRequiredSha224;
- function requireSha224() {
- if (hasRequiredSha224)
- return sha224.exports;
- hasRequiredSha224 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireSha256());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var SHA256 = C_algo.SHA256;
- var SHA224 = C_algo.SHA224 = SHA256.extend({
- _doReset: function() {
- this._hash = new WordArray.init([
- 3238371032,
- 914150663,
- 812702999,
- 4144912697,
- 4290775857,
- 1750603025,
- 1694076839,
- 3204075428
- ]);
- },
- _doFinalize: function() {
- var hash = SHA256._doFinalize.call(this);
- hash.sigBytes -= 4;
- return hash;
- }
- });
- C.SHA224 = SHA256._createHelper(SHA224);
- C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
- })();
- return CryptoJS.SHA224;
- });
- })(sha224);
- return sha224.exports;
- }
- var sha512 = { exports: {} };
- var hasRequiredSha512;
- function requireSha512() {
- if (hasRequiredSha512)
- return sha512.exports;
- hasRequiredSha512 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireX64Core());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Hasher = C_lib.Hasher;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var X64WordArray = C_x64.WordArray;
- var C_algo = C.algo;
- function X64Word_create() {
- return X64Word.create.apply(X64Word, arguments);
- }
- var K = [
- X64Word_create(1116352408, 3609767458),
- X64Word_create(1899447441, 602891725),
- X64Word_create(3049323471, 3964484399),
- X64Word_create(3921009573, 2173295548),
- X64Word_create(961987163, 4081628472),
- X64Word_create(1508970993, 3053834265),
- X64Word_create(2453635748, 2937671579),
- X64Word_create(2870763221, 3664609560),
- X64Word_create(3624381080, 2734883394),
- X64Word_create(310598401, 1164996542),
- X64Word_create(607225278, 1323610764),
- X64Word_create(1426881987, 3590304994),
- X64Word_create(1925078388, 4068182383),
- X64Word_create(2162078206, 991336113),
- X64Word_create(2614888103, 633803317),
- X64Word_create(3248222580, 3479774868),
- X64Word_create(3835390401, 2666613458),
- X64Word_create(4022224774, 944711139),
- X64Word_create(264347078, 2341262773),
- X64Word_create(604807628, 2007800933),
- X64Word_create(770255983, 1495990901),
- X64Word_create(1249150122, 1856431235),
- X64Word_create(1555081692, 3175218132),
- X64Word_create(1996064986, 2198950837),
- X64Word_create(2554220882, 3999719339),
- X64Word_create(2821834349, 766784016),
- X64Word_create(2952996808, 2566594879),
- X64Word_create(3210313671, 3203337956),
- X64Word_create(3336571891, 1034457026),
- X64Word_create(3584528711, 2466948901),
- X64Word_create(113926993, 3758326383),
- X64Word_create(338241895, 168717936),
- X64Word_create(666307205, 1188179964),
- X64Word_create(773529912, 1546045734),
- X64Word_create(1294757372, 1522805485),
- X64Word_create(1396182291, 2643833823),
- X64Word_create(1695183700, 2343527390),
- X64Word_create(1986661051, 1014477480),
- X64Word_create(2177026350, 1206759142),
- X64Word_create(2456956037, 344077627),
- X64Word_create(2730485921, 1290863460),
- X64Word_create(2820302411, 3158454273),
- X64Word_create(3259730800, 3505952657),
- X64Word_create(3345764771, 106217008),
- X64Word_create(3516065817, 3606008344),
- X64Word_create(3600352804, 1432725776),
- X64Word_create(4094571909, 1467031594),
- X64Word_create(275423344, 851169720),
- X64Word_create(430227734, 3100823752),
- X64Word_create(506948616, 1363258195),
- X64Word_create(659060556, 3750685593),
- X64Word_create(883997877, 3785050280),
- X64Word_create(958139571, 3318307427),
- X64Word_create(1322822218, 3812723403),
- X64Word_create(1537002063, 2003034995),
- X64Word_create(1747873779, 3602036899),
- X64Word_create(1955562222, 1575990012),
- X64Word_create(2024104815, 1125592928),
- X64Word_create(2227730452, 2716904306),
- X64Word_create(2361852424, 442776044),
- X64Word_create(2428436474, 593698344),
- X64Word_create(2756734187, 3733110249),
- X64Word_create(3204031479, 2999351573),
- X64Word_create(3329325298, 3815920427),
- X64Word_create(3391569614, 3928383900),
- X64Word_create(3515267271, 566280711),
- X64Word_create(3940187606, 3454069534),
- X64Word_create(4118630271, 4000239992),
- X64Word_create(116418474, 1914138554),
- X64Word_create(174292421, 2731055270),
- X64Word_create(289380356, 3203993006),
- X64Word_create(460393269, 320620315),
- X64Word_create(685471733, 587496836),
- X64Word_create(852142971, 1086792851),
- X64Word_create(1017036298, 365543100),
- X64Word_create(1126000580, 2618297676),
- X64Word_create(1288033470, 3409855158),
- X64Word_create(1501505948, 4234509866),
- X64Word_create(1607167915, 987167468),
- X64Word_create(1816402316, 1246189591)
- ];
- var W = [];
- (function() {
- for (var i = 0; i < 80; i++) {
- W[i] = X64Word_create();
- }
- })();
- var SHA512 = C_algo.SHA512 = Hasher.extend({
- _doReset: function() {
- this._hash = new X64WordArray.init([
- new X64Word.init(1779033703, 4089235720),
- new X64Word.init(3144134277, 2227873595),
- new X64Word.init(1013904242, 4271175723),
- new X64Word.init(2773480762, 1595750129),
- new X64Word.init(1359893119, 2917565137),
- new X64Word.init(2600822924, 725511199),
- new X64Word.init(528734635, 4215389547),
- new X64Word.init(1541459225, 327033209)
- ]);
- },
- _doProcessBlock: function(M, offset) {
- var H = this._hash.words;
- var H0 = H[0];
- var H1 = H[1];
- var H2 = H[2];
- var H3 = H[3];
- var H4 = H[4];
- var H5 = H[5];
- var H6 = H[6];
- var H7 = H[7];
- var H0h = H0.high;
- var H0l = H0.low;
- var H1h = H1.high;
- var H1l = H1.low;
- var H2h = H2.high;
- var H2l = H2.low;
- var H3h = H3.high;
- var H3l = H3.low;
- var H4h = H4.high;
- var H4l = H4.low;
- var H5h = H5.high;
- var H5l = H5.low;
- var H6h = H6.high;
- var H6l = H6.low;
- var H7h = H7.high;
- var H7l = H7.low;
- var ah = H0h;
- var al = H0l;
- var bh = H1h;
- var bl = H1l;
- var ch = H2h;
- var cl = H2l;
- var dh = H3h;
- var dl = H3l;
- var eh = H4h;
- var el = H4l;
- var fh = H5h;
- var fl = H5l;
- var gh = H6h;
- var gl = H6l;
- var hh = H7h;
- var hl = H7l;
- for (var i = 0; i < 80; i++) {
- var Wil;
- var Wih;
- var Wi = W[i];
- if (i < 16) {
- Wih = Wi.high = M[offset + i * 2] | 0;
- Wil = Wi.low = M[offset + i * 2 + 1] | 0;
- } else {
- var gamma0x = W[i - 15];
- var gamma0xh = gamma0x.high;
- var gamma0xl = gamma0x.low;
- var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;
- var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);
- var gamma1x = W[i - 2];
- var gamma1xh = gamma1x.high;
- var gamma1xl = gamma1x.low;
- var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;
- var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);
- var Wi7 = W[i - 7];
- var Wi7h = Wi7.high;
- var Wi7l = Wi7.low;
- var Wi16 = W[i - 16];
- var Wi16h = Wi16.high;
- var Wi16l = Wi16.low;
- Wil = gamma0l + Wi7l;
- Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);
- Wil = Wil + gamma1l;
- Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);
- Wil = Wil + Wi16l;
- Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);
- Wi.high = Wih;
- Wi.low = Wil;
- }
- var chh = eh & fh ^ ~eh & gh;
- var chl = el & fl ^ ~el & gl;
- var majh = ah & bh ^ ah & ch ^ bh & ch;
- var majl = al & bl ^ al & cl ^ bl & cl;
- var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);
- var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);
- var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);
- var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);
- var Ki = K[i];
- var Kih = Ki.high;
- var Kil = Ki.low;
- var t1l = hl + sigma1l;
- var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);
- var t1l = t1l + chl;
- var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);
- var t1l = t1l + Kil;
- var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);
- var t1l = t1l + Wil;
- var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);
- var t2l = sigma0l + majl;
- var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);
- hh = gh;
- hl = gl;
- gh = fh;
- gl = fl;
- fh = eh;
- fl = el;
- el = dl + t1l | 0;
- eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
- dh = ch;
- dl = cl;
- ch = bh;
- cl = bl;
- bh = ah;
- bl = al;
- al = t1l + t2l | 0;
- ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;
- }
- H0l = H0.low = H0l + al;
- H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);
- H1l = H1.low = H1l + bl;
- H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);
- H2l = H2.low = H2l + cl;
- H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);
- H3l = H3.low = H3l + dl;
- H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);
- H4l = H4.low = H4l + el;
- H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);
- H5l = H5.low = H5l + fl;
- H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);
- H6l = H6.low = H6l + gl;
- H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);
- H7l = H7.low = H7l + hl;
- H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
- dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 4294967296);
- dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
- this._process();
- var hash = this._hash.toX32();
- return hash;
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
- return clone;
- },
- blockSize: 1024 / 32
- });
- C.SHA512 = Hasher._createHelper(SHA512);
- C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
- })();
- return CryptoJS.SHA512;
- });
- })(sha512);
- return sha512.exports;
- }
- var sha384 = { exports: {} };
- var hasRequiredSha384;
- function requireSha384() {
- if (hasRequiredSha384)
- return sha384.exports;
- hasRequiredSha384 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireX64Core(), requireSha512());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var X64WordArray = C_x64.WordArray;
- var C_algo = C.algo;
- var SHA512 = C_algo.SHA512;
- var SHA384 = C_algo.SHA384 = SHA512.extend({
- _doReset: function() {
- this._hash = new X64WordArray.init([
- new X64Word.init(3418070365, 3238371032),
- new X64Word.init(1654270250, 914150663),
- new X64Word.init(2438529370, 812702999),
- new X64Word.init(355462360, 4144912697),
- new X64Word.init(1731405415, 4290775857),
- new X64Word.init(2394180231, 1750603025),
- new X64Word.init(3675008525, 1694076839),
- new X64Word.init(1203062813, 3204075428)
- ]);
- },
- _doFinalize: function() {
- var hash = SHA512._doFinalize.call(this);
- hash.sigBytes -= 16;
- return hash;
- }
- });
- C.SHA384 = SHA512._createHelper(SHA384);
- C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
- })();
- return CryptoJS.SHA384;
- });
- })(sha384);
- return sha384.exports;
- }
- var sha3 = { exports: {} };
- var hasRequiredSha3;
- function requireSha3() {
- if (hasRequiredSha3)
- return sha3.exports;
- hasRequiredSha3 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireX64Core());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function(Math2) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var C_algo = C.algo;
- var RHO_OFFSETS = [];
- var PI_INDEXES = [];
- var ROUND_CONSTANTS = [];
- (function() {
- var x = 1, y = 0;
- for (var t = 0; t < 24; t++) {
- RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;
- var newX = y % 5;
- var newY = (2 * x + 3 * y) % 5;
- x = newX;
- y = newY;
- }
- for (var x = 0; x < 5; x++) {
- for (var y = 0; y < 5; y++) {
- PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;
- }
- }
- var LFSR = 1;
- for (var i = 0; i < 24; i++) {
- var roundConstantMsw = 0;
- var roundConstantLsw = 0;
- for (var j = 0; j < 7; j++) {
- if (LFSR & 1) {
- var bitPosition = (1 << j) - 1;
- if (bitPosition < 32) {
- roundConstantLsw ^= 1 << bitPosition;
- } else {
- roundConstantMsw ^= 1 << bitPosition - 32;
- }
- }
- if (LFSR & 128) {
- LFSR = LFSR << 1 ^ 113;
- } else {
- LFSR <<= 1;
- }
- }
- ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
- }
- })();
- var T = [];
- (function() {
- for (var i = 0; i < 25; i++) {
- T[i] = X64Word.create();
- }
- })();
- var SHA3 = C_algo.SHA3 = Hasher.extend({
- /**
- * Configuration options.
- *
- * @property {number} outputLength
- * The desired number of bits in the output hash.
- * Only values permitted are: 224, 256, 384, 512.
- * Default: 512
- */
- cfg: Hasher.cfg.extend({
- outputLength: 512
- }),
- _doReset: function() {
- var state = this._state = [];
- for (var i = 0; i < 25; i++) {
- state[i] = new X64Word.init();
- }
- this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
- },
- _doProcessBlock: function(M, offset) {
- var state = this._state;
- var nBlockSizeLanes = this.blockSize / 2;
- for (var i = 0; i < nBlockSizeLanes; i++) {
- var M2i = M[offset + 2 * i];
- var M2i1 = M[offset + 2 * i + 1];
- M2i = (M2i << 8 | M2i >>> 24) & 16711935 | (M2i << 24 | M2i >>> 8) & 4278255360;
- M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 16711935 | (M2i1 << 24 | M2i1 >>> 8) & 4278255360;
- var lane = state[i];
- lane.high ^= M2i1;
- lane.low ^= M2i;
- }
- for (var round = 0; round < 24; round++) {
- for (var x = 0; x < 5; x++) {
- var tMsw = 0, tLsw = 0;
- for (var y = 0; y < 5; y++) {
- var lane = state[x + 5 * y];
- tMsw ^= lane.high;
- tLsw ^= lane.low;
- }
- var Tx = T[x];
- Tx.high = tMsw;
- Tx.low = tLsw;
- }
- for (var x = 0; x < 5; x++) {
- var Tx4 = T[(x + 4) % 5];
- var Tx1 = T[(x + 1) % 5];
- var Tx1Msw = Tx1.high;
- var Tx1Lsw = Tx1.low;
- var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);
- var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);
- for (var y = 0; y < 5; y++) {
- var lane = state[x + 5 * y];
- lane.high ^= tMsw;
- lane.low ^= tLsw;
- }
- }
- for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
- var tMsw;
- var tLsw;
- var lane = state[laneIndex];
- var laneMsw = lane.high;
- var laneLsw = lane.low;
- var rhoOffset = RHO_OFFSETS[laneIndex];
- if (rhoOffset < 32) {
- tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;
- tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;
- } else {
- tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;
- tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;
- }
- var TPiLane = T[PI_INDEXES[laneIndex]];
- TPiLane.high = tMsw;
- TPiLane.low = tLsw;
- }
- var T0 = T[0];
- var state0 = state[0];
- T0.high = state0.high;
- T0.low = state0.low;
- for (var x = 0; x < 5; x++) {
- for (var y = 0; y < 5; y++) {
- var laneIndex = x + 5 * y;
- var lane = state[laneIndex];
- var TLane = T[laneIndex];
- var Tx1Lane = T[(x + 1) % 5 + 5 * y];
- var Tx2Lane = T[(x + 2) % 5 + 5 * y];
- lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;
- lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;
- }
- }
- var lane = state[0];
- var roundConstant = ROUND_CONSTANTS[round];
- lane.high ^= roundConstant.high;
- lane.low ^= roundConstant.low;
- }
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- var blockSizeBits = this.blockSize * 32;
- dataWords[nBitsLeft >>> 5] |= 1 << 24 - nBitsLeft % 32;
- dataWords[(Math2.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 128;
- data.sigBytes = dataWords.length * 4;
- this._process();
- var state = this._state;
- var outputLengthBytes = this.cfg.outputLength / 8;
- var outputLengthLanes = outputLengthBytes / 8;
- var hashWords = [];
- for (var i = 0; i < outputLengthLanes; i++) {
- var lane = state[i];
- var laneMsw = lane.high;
- var laneLsw = lane.low;
- laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 16711935 | (laneMsw << 24 | laneMsw >>> 8) & 4278255360;
- laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 16711935 | (laneLsw << 24 | laneLsw >>> 8) & 4278255360;
- hashWords.push(laneLsw);
- hashWords.push(laneMsw);
- }
- return new WordArray.init(hashWords, outputLengthBytes);
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- var state = clone._state = this._state.slice(0);
- for (var i = 0; i < 25; i++) {
- state[i] = state[i].clone();
- }
- return clone;
- }
- });
- C.SHA3 = Hasher._createHelper(SHA3);
- C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
- })(Math);
- return CryptoJS.SHA3;
- });
- })(sha3);
- return sha3.exports;
- }
- var ripemd160 = { exports: {} };
- var hasRequiredRipemd160;
- function requireRipemd160() {
- if (hasRequiredRipemd160)
- return ripemd160.exports;
- hasRequiredRipemd160 = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- /** @preserve
- (c) 2012 by Cédric Mesnil. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
- (function(Math2) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
- var _zl = WordArray.create([
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9,
- 10,
- 11,
- 12,
- 13,
- 14,
- 15,
- 7,
- 4,
- 13,
- 1,
- 10,
- 6,
- 15,
- 3,
- 12,
- 0,
- 9,
- 5,
- 2,
- 14,
- 11,
- 8,
- 3,
- 10,
- 14,
- 4,
- 9,
- 15,
- 8,
- 1,
- 2,
- 7,
- 0,
- 6,
- 13,
- 11,
- 5,
- 12,
- 1,
- 9,
- 11,
- 10,
- 0,
- 8,
- 12,
- 4,
- 13,
- 3,
- 7,
- 15,
- 14,
- 5,
- 6,
- 2,
- 4,
- 0,
- 5,
- 9,
- 7,
- 12,
- 2,
- 10,
- 14,
- 1,
- 3,
- 8,
- 11,
- 6,
- 15,
- 13
- ]);
- var _zr = WordArray.create([
- 5,
- 14,
- 7,
- 0,
- 9,
- 2,
- 11,
- 4,
- 13,
- 6,
- 15,
- 8,
- 1,
- 10,
- 3,
- 12,
- 6,
- 11,
- 3,
- 7,
- 0,
- 13,
- 5,
- 10,
- 14,
- 15,
- 8,
- 12,
- 4,
- 9,
- 1,
- 2,
- 15,
- 5,
- 1,
- 3,
- 7,
- 14,
- 6,
- 9,
- 11,
- 8,
- 12,
- 2,
- 10,
- 0,
- 4,
- 13,
- 8,
- 6,
- 4,
- 1,
- 3,
- 11,
- 15,
- 0,
- 5,
- 12,
- 2,
- 13,
- 9,
- 7,
- 10,
- 14,
- 12,
- 15,
- 10,
- 4,
- 1,
- 5,
- 8,
- 7,
- 6,
- 2,
- 13,
- 14,
- 0,
- 3,
- 9,
- 11
- ]);
- var _sl = WordArray.create([
- 11,
- 14,
- 15,
- 12,
- 5,
- 8,
- 7,
- 9,
- 11,
- 13,
- 14,
- 15,
- 6,
- 7,
- 9,
- 8,
- 7,
- 6,
- 8,
- 13,
- 11,
- 9,
- 7,
- 15,
- 7,
- 12,
- 15,
- 9,
- 11,
- 7,
- 13,
- 12,
- 11,
- 13,
- 6,
- 7,
- 14,
- 9,
- 13,
- 15,
- 14,
- 8,
- 13,
- 6,
- 5,
- 12,
- 7,
- 5,
- 11,
- 12,
- 14,
- 15,
- 14,
- 15,
- 9,
- 8,
- 9,
- 14,
- 5,
- 6,
- 8,
- 6,
- 5,
- 12,
- 9,
- 15,
- 5,
- 11,
- 6,
- 8,
- 13,
- 12,
- 5,
- 12,
- 13,
- 14,
- 11,
- 8,
- 5,
- 6
- ]);
- var _sr = WordArray.create([
- 8,
- 9,
- 9,
- 11,
- 13,
- 15,
- 15,
- 5,
- 7,
- 7,
- 8,
- 11,
- 14,
- 14,
- 12,
- 6,
- 9,
- 13,
- 15,
- 7,
- 12,
- 8,
- 9,
- 11,
- 7,
- 7,
- 12,
- 7,
- 6,
- 15,
- 13,
- 11,
- 9,
- 7,
- 15,
- 11,
- 8,
- 6,
- 6,
- 14,
- 12,
- 13,
- 5,
- 14,
- 13,
- 13,
- 7,
- 5,
- 15,
- 5,
- 8,
- 11,
- 14,
- 14,
- 6,
- 14,
- 6,
- 9,
- 12,
- 9,
- 12,
- 5,
- 15,
- 8,
- 8,
- 5,
- 12,
- 9,
- 12,
- 5,
- 14,
- 6,
- 8,
- 13,
- 6,
- 5,
- 15,
- 13,
- 11,
- 11
- ]);
- var _hl = WordArray.create([0, 1518500249, 1859775393, 2400959708, 2840853838]);
- var _hr = WordArray.create([1352829926, 1548603684, 1836072691, 2053994217, 0]);
- var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
- _doReset: function() {
- this._hash = WordArray.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
- },
- _doProcessBlock: function(M, offset) {
- for (var i = 0; i < 16; i++) {
- var offset_i = offset + i;
- var M_offset_i = M[offset_i];
- M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
- }
- var H = this._hash.words;
- var hl = _hl.words;
- var hr = _hr.words;
- var zl = _zl.words;
- var zr = _zr.words;
- var sl = _sl.words;
- var sr = _sr.words;
- var al, bl, cl, dl, el;
- var ar, br, cr, dr, er;
- ar = al = H[0];
- br = bl = H[1];
- cr = cl = H[2];
- dr = dl = H[3];
- er = el = H[4];
- var t;
- for (var i = 0; i < 80; i += 1) {
- t = al + M[offset + zl[i]] | 0;
- if (i < 16) {
- t += f1(bl, cl, dl) + hl[0];
- } else if (i < 32) {
- t += f2(bl, cl, dl) + hl[1];
- } else if (i < 48) {
- t += f3(bl, cl, dl) + hl[2];
- } else if (i < 64) {
- t += f4(bl, cl, dl) + hl[3];
- } else {
- t += f5(bl, cl, dl) + hl[4];
- }
- t = t | 0;
- t = rotl(t, sl[i]);
- t = t + el | 0;
- al = el;
- el = dl;
- dl = rotl(cl, 10);
- cl = bl;
- bl = t;
- t = ar + M[offset + zr[i]] | 0;
- if (i < 16) {
- t += f5(br, cr, dr) + hr[0];
- } else if (i < 32) {
- t += f4(br, cr, dr) + hr[1];
- } else if (i < 48) {
- t += f3(br, cr, dr) + hr[2];
- } else if (i < 64) {
- t += f2(br, cr, dr) + hr[3];
- } else {
- t += f1(br, cr, dr) + hr[4];
- }
- t = t | 0;
- t = rotl(t, sr[i]);
- t = t + er | 0;
- ar = er;
- er = dr;
- dr = rotl(cr, 10);
- cr = br;
- br = t;
- }
- t = H[1] + cl + dr | 0;
- H[1] = H[2] + dl + er | 0;
- H[2] = H[3] + el + ar | 0;
- H[3] = H[4] + al + br | 0;
- H[4] = H[0] + bl + cr | 0;
- H[0] = t;
- },
- _doFinalize: function() {
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
- dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 16711935 | (nBitsTotal << 24 | nBitsTotal >>> 8) & 4278255360;
- data.sigBytes = (dataWords.length + 1) * 4;
- this._process();
- var hash = this._hash;
- var H = hash.words;
- for (var i = 0; i < 5; i++) {
- var H_i = H[i];
- H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
- }
- return hash;
- },
- clone: function() {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
- return clone;
- }
- });
- function f1(x, y, z) {
- return x ^ y ^ z;
- }
- function f2(x, y, z) {
- return x & y | ~x & z;
- }
- function f3(x, y, z) {
- return (x | ~y) ^ z;
- }
- function f4(x, y, z) {
- return x & z | y & ~z;
- }
- function f5(x, y, z) {
- return x ^ (y | ~z);
- }
- function rotl(x, n) {
- return x << n | x >>> 32 - n;
- }
- C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
- C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
- })();
- return CryptoJS.RIPEMD160;
- });
- })(ripemd160);
- return ripemd160.exports;
- }
- var hmac = { exports: {} };
- var hasRequiredHmac;
- function requireHmac() {
- if (hasRequiredHmac)
- return hmac.exports;
- hasRequiredHmac = 1;
- (function(module, exports) {
- (function(root, factory) {
- {
- module.exports = factory(requireCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var C_enc = C.enc;
- var Utf8 = C_enc.Utf8;
- var C_algo = C.algo;
- C_algo.HMAC = Base.extend({
- /**
- * Initializes a newly created HMAC.
- *
- * @param {Hasher} hasher The hash algorithm to use.
- * @param {WordArray|string} key The secret key.
- *
- * @example
- *
- * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
- */
- init: function(hasher, key) {
- hasher = this._hasher = new hasher.init();
- if (typeof key == "string") {
- key = Utf8.parse(key);
- }
- var hasherBlockSize = hasher.blockSize;
- var hasherBlockSizeBytes = hasherBlockSize * 4;
- if (key.sigBytes > hasherBlockSizeBytes) {
- key = hasher.finalize(key);
- }
- key.clamp();
- var oKey = this._oKey = key.clone();
- var iKey = this._iKey = key.clone();
- var oKeyWords = oKey.words;
- var iKeyWords = iKey.words;
- for (var i = 0; i < hasherBlockSize; i++) {
- oKeyWords[i] ^= 1549556828;
- iKeyWords[i] ^= 909522486;
- }
- oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
- this.reset();
- },
- /**
- * Resets this HMAC to its initial state.
- *
- * @example
- *
- * hmacHasher.reset();
- */
- reset: function() {
- var hasher = this._hasher;
- hasher.reset();
- hasher.update(this._iKey);
- },
- /**
- * Updates this HMAC with a message.
- *
- * @param {WordArray|string} messageUpdate The message to append.
- *
- * @return {HMAC} This HMAC instance.
- *
- * @example
- *
- * hmacHasher.update('message');
- * hmacHasher.update(wordArray);
- */
- update: function(messageUpdate) {
- this._hasher.update(messageUpdate);
- return this;
- },
- /**
- * Finalizes the HMAC computation.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
- *
- * @return {WordArray} The HMAC.
- *
- * @example
- *
- * var hmac = hmacHasher.finalize();
- * var hmac = hmacHasher.finalize('message');
- * var hmac = hmacHasher.finalize(wordArray);
- */
- finalize: function(messageUpdate) {
- var hasher = this._hasher;
- var innerHash = hasher.finalize(messageUpdate);
- hasher.reset();
- var hmac2 = hasher.finalize(this._oKey.clone().concat(innerHash));
- return hmac2;
- }
- });
- })();
- });
- })(hmac);
- return hmac.exports;
- }
- var pbkdf2 = { exports: {} };
- var hasRequiredPbkdf2;
- function requirePbkdf2() {
- if (hasRequiredPbkdf2)
- return pbkdf2.exports;
- hasRequiredPbkdf2 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireSha256(), requireHmac());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var SHA256 = C_algo.SHA256;
- var HMAC = C_algo.HMAC;
- var PBKDF2 = C_algo.PBKDF2 = Base.extend({
- /**
- * Configuration options.
- *
- * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
- * @property {Hasher} hasher The hasher to use. Default: SHA256
- * @property {number} iterations The number of iterations to perform. Default: 250000
- */
- cfg: Base.extend({
- keySize: 128 / 32,
- hasher: SHA256,
- iterations: 25e4
- }),
- /**
- * Initializes a newly created key derivation function.
- *
- * @param {Object} cfg (Optional) The configuration options to use for the derivation.
- *
- * @example
- *
- * var kdf = CryptoJS.algo.PBKDF2.create();
- * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
- * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
- */
- init: function(cfg) {
- this.cfg = this.cfg.extend(cfg);
- },
- /**
- * Computes the Password-Based Key Derivation Function 2.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- *
- * @return {WordArray} The derived key.
- *
- * @example
- *
- * var key = kdf.compute(password, salt);
- */
- compute: function(password, salt) {
- var cfg = this.cfg;
- var hmac2 = HMAC.create(cfg.hasher, password);
- var derivedKey = WordArray.create();
- var blockIndex = WordArray.create([1]);
- var derivedKeyWords = derivedKey.words;
- var blockIndexWords = blockIndex.words;
- var keySize = cfg.keySize;
- var iterations = cfg.iterations;
- while (derivedKeyWords.length < keySize) {
- var block = hmac2.update(salt).finalize(blockIndex);
- hmac2.reset();
- var blockWords = block.words;
- var blockWordsLength = blockWords.length;
- var intermediate = block;
- for (var i = 1; i < iterations; i++) {
- intermediate = hmac2.finalize(intermediate);
- hmac2.reset();
- var intermediateWords = intermediate.words;
- for (var j = 0; j < blockWordsLength; j++) {
- blockWords[j] ^= intermediateWords[j];
- }
- }
- derivedKey.concat(block);
- blockIndexWords[0]++;
- }
- derivedKey.sigBytes = keySize * 4;
- return derivedKey;
- }
- });
- C.PBKDF2 = function(password, salt, cfg) {
- return PBKDF2.create(cfg).compute(password, salt);
- };
- })();
- return CryptoJS.PBKDF2;
- });
- })(pbkdf2);
- return pbkdf2.exports;
- }
- var evpkdf = { exports: {} };
- var hasRequiredEvpkdf;
- function requireEvpkdf() {
- if (hasRequiredEvpkdf)
- return evpkdf.exports;
- hasRequiredEvpkdf = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireSha1(), requireHmac());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var MD5 = C_algo.MD5;
- var EvpKDF = C_algo.EvpKDF = Base.extend({
- /**
- * Configuration options.
- *
- * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
- * @property {Hasher} hasher The hash algorithm to use. Default: MD5
- * @property {number} iterations The number of iterations to perform. Default: 1
- */
- cfg: Base.extend({
- keySize: 128 / 32,
- hasher: MD5,
- iterations: 1
- }),
- /**
- * Initializes a newly created key derivation function.
- *
- * @param {Object} cfg (Optional) The configuration options to use for the derivation.
- *
- * @example
- *
- * var kdf = CryptoJS.algo.EvpKDF.create();
- * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
- * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
- */
- init: function(cfg) {
- this.cfg = this.cfg.extend(cfg);
- },
- /**
- * Derives a key from a password.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- *
- * @return {WordArray} The derived key.
- *
- * @example
- *
- * var key = kdf.compute(password, salt);
- */
- compute: function(password, salt) {
- var block;
- var cfg = this.cfg;
- var hasher = cfg.hasher.create();
- var derivedKey = WordArray.create();
- var derivedKeyWords = derivedKey.words;
- var keySize = cfg.keySize;
- var iterations = cfg.iterations;
- while (derivedKeyWords.length < keySize) {
- if (block) {
- hasher.update(block);
- }
- block = hasher.update(password).finalize(salt);
- hasher.reset();
- for (var i = 1; i < iterations; i++) {
- block = hasher.finalize(block);
- hasher.reset();
- }
- derivedKey.concat(block);
- }
- derivedKey.sigBytes = keySize * 4;
- return derivedKey;
- }
- });
- C.EvpKDF = function(password, salt, cfg) {
- return EvpKDF.create(cfg).compute(password, salt);
- };
- })();
- return CryptoJS.EvpKDF;
- });
- })(evpkdf);
- return evpkdf.exports;
- }
- var cipherCore = { exports: {} };
- var hasRequiredCipherCore;
- function requireCipherCore() {
- if (hasRequiredCipherCore)
- return cipherCore.exports;
- hasRequiredCipherCore = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEvpkdf());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.lib.Cipher || function(undefined$1) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
- var C_enc = C.enc;
- C_enc.Utf8;
- var Base64 = C_enc.Base64;
- var C_algo = C.algo;
- var EvpKDF = C_algo.EvpKDF;
- var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
- /**
- * Configuration options.
- *
- * @property {WordArray} iv The IV to use for this operation.
- */
- cfg: Base.extend(),
- /**
- * Creates this cipher in encryption mode.
- *
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {Cipher} A cipher instance.
- *
- * @static
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
- */
- createEncryptor: function(key, cfg) {
- return this.create(this._ENC_XFORM_MODE, key, cfg);
- },
- /**
- * Creates this cipher in decryption mode.
- *
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {Cipher} A cipher instance.
- *
- * @static
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
- */
- createDecryptor: function(key, cfg) {
- return this.create(this._DEC_XFORM_MODE, key, cfg);
- },
- /**
- * Initializes a newly created cipher.
- *
- * @param {number} xformMode Either the encryption or decryption transormation mode constant.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
- */
- init: function(xformMode, key, cfg) {
- this.cfg = this.cfg.extend(cfg);
- this._xformMode = xformMode;
- this._key = key;
- this.reset();
- },
- /**
- * Resets this cipher to its initial state.
- *
- * @example
- *
- * cipher.reset();
- */
- reset: function() {
- BufferedBlockAlgorithm.reset.call(this);
- this._doReset();
- },
- /**
- * Adds data to be encrypted or decrypted.
- *
- * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
- *
- * @return {WordArray} The data after processing.
- *
- * @example
- *
- * var encrypted = cipher.process('data');
- * var encrypted = cipher.process(wordArray);
- */
- process: function(dataUpdate) {
- this._append(dataUpdate);
- return this._process();
- },
- /**
- * Finalizes the encryption or decryption process.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
- *
- * @return {WordArray} The data after final processing.
- *
- * @example
- *
- * var encrypted = cipher.finalize();
- * var encrypted = cipher.finalize('data');
- * var encrypted = cipher.finalize(wordArray);
- */
- finalize: function(dataUpdate) {
- if (dataUpdate) {
- this._append(dataUpdate);
- }
- var finalProcessedData = this._doFinalize();
- return finalProcessedData;
- },
- keySize: 128 / 32,
- ivSize: 128 / 32,
- _ENC_XFORM_MODE: 1,
- _DEC_XFORM_MODE: 2,
- /**
- * Creates shortcut functions to a cipher's object interface.
- *
- * @param {Cipher} cipher The cipher to create a helper for.
- *
- * @return {Object} An object with encrypt and decrypt shortcut functions.
- *
- * @static
- *
- * @example
- *
- * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
- */
- _createHelper: function() {
- function selectCipherStrategy(key) {
- if (typeof key == "string") {
- return PasswordBasedCipher;
- } else {
- return SerializableCipher;
- }
- }
- return function(cipher) {
- return {
- encrypt: function(message, key, cfg) {
- return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
- },
- decrypt: function(ciphertext, key, cfg) {
- return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
- }
- };
- };
- }()
- });
- C_lib.StreamCipher = Cipher.extend({
- _doFinalize: function() {
- var finalProcessedBlocks = this._process(true);
- return finalProcessedBlocks;
- },
- blockSize: 1
- });
- var C_mode = C.mode = {};
- var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
- /**
- * Creates this mode for encryption.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @static
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
- */
- createEncryptor: function(cipher, iv) {
- return this.Encryptor.create(cipher, iv);
- },
- /**
- * Creates this mode for decryption.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @static
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
- */
- createDecryptor: function(cipher, iv) {
- return this.Decryptor.create(cipher, iv);
- },
- /**
- * Initializes a newly created mode.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
- */
- init: function(cipher, iv) {
- this._cipher = cipher;
- this._iv = iv;
- }
- });
- var CBC = C_mode.CBC = function() {
- var CBC2 = BlockCipherMode.extend();
- CBC2.Encryptor = CBC2.extend({
- /**
- * Processes the data block at offset.
- *
- * @param {Array} words The data words to operate on.
- * @param {number} offset The offset where the block starts.
- *
- * @example
- *
- * mode.processBlock(data.words, offset);
- */
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- xorBlock.call(this, words, offset, blockSize);
- cipher.encryptBlock(words, offset);
- this._prevBlock = words.slice(offset, offset + blockSize);
- }
- });
- CBC2.Decryptor = CBC2.extend({
- /**
- * Processes the data block at offset.
- *
- * @param {Array} words The data words to operate on.
- * @param {number} offset The offset where the block starts.
- *
- * @example
- *
- * mode.processBlock(data.words, offset);
- */
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- var thisBlock = words.slice(offset, offset + blockSize);
- cipher.decryptBlock(words, offset);
- xorBlock.call(this, words, offset, blockSize);
- this._prevBlock = thisBlock;
- }
- });
- function xorBlock(words, offset, blockSize) {
- var block;
- var iv = this._iv;
- if (iv) {
- block = iv;
- this._iv = undefined$1;
- } else {
- block = this._prevBlock;
- }
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= block[i];
- }
- }
- return CBC2;
- }();
- var C_pad = C.pad = {};
- var Pkcs7 = C_pad.Pkcs7 = {
- /**
- * Pads data using the algorithm defined in PKCS #5/7.
- *
- * @param {WordArray} data The data to pad.
- * @param {number} blockSize The multiple that the data should be padded to.
- *
- * @static
- *
- * @example
- *
- * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
- */
- pad: function(data, blockSize) {
- var blockSizeBytes = blockSize * 4;
- var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
- var paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes;
- var paddingWords = [];
- for (var i = 0; i < nPaddingBytes; i += 4) {
- paddingWords.push(paddingWord);
- }
- var padding = WordArray.create(paddingWords, nPaddingBytes);
- data.concat(padding);
- },
- /**
- * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
- *
- * @param {WordArray} data The data to unpad.
- *
- * @static
- *
- * @example
- *
- * CryptoJS.pad.Pkcs7.unpad(wordArray);
- */
- unpad: function(data) {
- var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
- data.sigBytes -= nPaddingBytes;
- }
- };
- C_lib.BlockCipher = Cipher.extend({
- /**
- * Configuration options.
- *
- * @property {Mode} mode The block mode to use. Default: CBC
- * @property {Padding} padding The padding strategy to use. Default: Pkcs7
- */
- cfg: Cipher.cfg.extend({
- mode: CBC,
- padding: Pkcs7
- }),
- reset: function() {
- var modeCreator;
- Cipher.reset.call(this);
- var cfg = this.cfg;
- var iv = cfg.iv;
- var mode = cfg.mode;
- if (this._xformMode == this._ENC_XFORM_MODE) {
- modeCreator = mode.createEncryptor;
- } else {
- modeCreator = mode.createDecryptor;
- this._minBufferSize = 1;
- }
- if (this._mode && this._mode.__creator == modeCreator) {
- this._mode.init(this, iv && iv.words);
- } else {
- this._mode = modeCreator.call(mode, this, iv && iv.words);
- this._mode.__creator = modeCreator;
- }
- },
- _doProcessBlock: function(words, offset) {
- this._mode.processBlock(words, offset);
- },
- _doFinalize: function() {
- var finalProcessedBlocks;
- var padding = this.cfg.padding;
- if (this._xformMode == this._ENC_XFORM_MODE) {
- padding.pad(this._data, this.blockSize);
- finalProcessedBlocks = this._process(true);
- } else {
- finalProcessedBlocks = this._process(true);
- padding.unpad(finalProcessedBlocks);
- }
- return finalProcessedBlocks;
- },
- blockSize: 128 / 32
- });
- var CipherParams = C_lib.CipherParams = Base.extend({
- /**
- * Initializes a newly created cipher params object.
- *
- * @param {Object} cipherParams An object with any of the possible cipher parameters.
- *
- * @example
- *
- * var cipherParams = CryptoJS.lib.CipherParams.create({
- * ciphertext: ciphertextWordArray,
- * key: keyWordArray,
- * iv: ivWordArray,
- * salt: saltWordArray,
- * algorithm: CryptoJS.algo.AES,
- * mode: CryptoJS.mode.CBC,
- * padding: CryptoJS.pad.PKCS7,
- * blockSize: 4,
- * formatter: CryptoJS.format.OpenSSL
- * });
- */
- init: function(cipherParams) {
- this.mixIn(cipherParams);
- },
- /**
- * Converts this cipher params object to a string.
- *
- * @param {Format} formatter (Optional) The formatting strategy to use.
- *
- * @return {string} The stringified cipher params.
- *
- * @throws Error If neither the formatter nor the default formatter is set.
- *
- * @example
- *
- * var string = cipherParams + '';
- * var string = cipherParams.toString();
- * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
- */
- toString: function(formatter) {
- return (formatter || this.formatter).stringify(this);
- }
- });
- var C_format = C.format = {};
- var OpenSSLFormatter = C_format.OpenSSL = {
- /**
- * Converts a cipher params object to an OpenSSL-compatible string.
- *
- * @param {CipherParams} cipherParams The cipher params object.
- *
- * @return {string} The OpenSSL-compatible string.
- *
- * @static
- *
- * @example
- *
- * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
- */
- stringify: function(cipherParams) {
- var wordArray;
- var ciphertext = cipherParams.ciphertext;
- var salt = cipherParams.salt;
- if (salt) {
- wordArray = WordArray.create([1398893684, 1701076831]).concat(salt).concat(ciphertext);
- } else {
- wordArray = ciphertext;
- }
- return wordArray.toString(Base64);
- },
- /**
- * Converts an OpenSSL-compatible string to a cipher params object.
- *
- * @param {string} openSSLStr The OpenSSL-compatible string.
- *
- * @return {CipherParams} The cipher params object.
- *
- * @static
- *
- * @example
- *
- * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
- */
- parse: function(openSSLStr) {
- var salt;
- var ciphertext = Base64.parse(openSSLStr);
- var ciphertextWords = ciphertext.words;
- if (ciphertextWords[0] == 1398893684 && ciphertextWords[1] == 1701076831) {
- salt = WordArray.create(ciphertextWords.slice(2, 4));
- ciphertextWords.splice(0, 4);
- ciphertext.sigBytes -= 16;
- }
- return CipherParams.create({ ciphertext, salt });
- }
- };
- var SerializableCipher = C_lib.SerializableCipher = Base.extend({
- /**
- * Configuration options.
- *
- * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
- */
- cfg: Base.extend({
- format: OpenSSLFormatter
- }),
- /**
- * Encrypts a message.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {WordArray|string} message The message to encrypt.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {CipherParams} A cipher params object.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- */
- encrypt: function(cipher, message, key, cfg) {
- cfg = this.cfg.extend(cfg);
- var encryptor = cipher.createEncryptor(key, cfg);
- var ciphertext = encryptor.finalize(message);
- var cipherCfg = encryptor.cfg;
- return CipherParams.create({
- ciphertext,
- key,
- iv: cipherCfg.iv,
- algorithm: cipher,
- mode: cipherCfg.mode,
- padding: cipherCfg.padding,
- blockSize: cipher.blockSize,
- formatter: cfg.format
- });
- },
- /**
- * Decrypts serialized ciphertext.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {WordArray} The plaintext.
- *
- * @static
- *
- * @example
- *
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- */
- decrypt: function(cipher, ciphertext, key, cfg) {
- cfg = this.cfg.extend(cfg);
- ciphertext = this._parse(ciphertext, cfg.format);
- var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
- return plaintext;
- },
- /**
- * Converts serialized ciphertext to CipherParams,
- * else assumed CipherParams already and returns ciphertext unchanged.
- *
- * @param {CipherParams|string} ciphertext The ciphertext.
- * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
- *
- * @return {CipherParams} The unserialized ciphertext.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
- */
- _parse: function(ciphertext, format) {
- if (typeof ciphertext == "string") {
- return format.parse(ciphertext, this);
- } else {
- return ciphertext;
- }
- }
- });
- var C_kdf = C.kdf = {};
- var OpenSSLKdf = C_kdf.OpenSSL = {
- /**
- * Derives a key and IV from a password.
- *
- * @param {string} password The password to derive from.
- * @param {number} keySize The size in words of the key to generate.
- * @param {number} ivSize The size in words of the IV to generate.
- * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
- *
- * @return {CipherParams} A cipher params object with the key, IV, and salt.
- *
- * @static
- *
- * @example
- *
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
- */
- execute: function(password, keySize, ivSize, salt, hasher) {
- if (!salt) {
- salt = WordArray.random(64 / 8);
- }
- if (!hasher) {
- var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
- } else {
- var key = EvpKDF.create({ keySize: keySize + ivSize, hasher }).compute(password, salt);
- }
- var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
- key.sigBytes = keySize * 4;
- return CipherParams.create({ key, iv, salt });
- }
- };
- var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
- /**
- * Configuration options.
- *
- * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
- */
- cfg: SerializableCipher.cfg.extend({
- kdf: OpenSSLKdf
- }),
- /**
- * Encrypts a message using a password.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {WordArray|string} message The message to encrypt.
- * @param {string} password The password.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {CipherParams} A cipher params object.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
- */
- encrypt: function(cipher, message, password, cfg) {
- cfg = this.cfg.extend(cfg);
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, cfg.salt, cfg.hasher);
- cfg.iv = derivedParams.iv;
- var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
- ciphertext.mixIn(derivedParams);
- return ciphertext;
- },
- /**
- * Decrypts serialized ciphertext using a password.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
- * @param {string} password The password.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {WordArray} The plaintext.
- *
- * @static
- *
- * @example
- *
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
- */
- decrypt: function(cipher, ciphertext, password, cfg) {
- cfg = this.cfg.extend(cfg);
- ciphertext = this._parse(ciphertext, cfg.format);
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt, cfg.hasher);
- cfg.iv = derivedParams.iv;
- var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
- return plaintext;
- }
- });
- }();
- });
- })(cipherCore);
- return cipherCore.exports;
- }
- var modeCfb = { exports: {} };
- var hasRequiredModeCfb;
- function requireModeCfb() {
- if (hasRequiredModeCfb)
- return modeCfb.exports;
- hasRequiredModeCfb = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.mode.CFB = function() {
- var CFB = CryptoJS.lib.BlockCipherMode.extend();
- CFB.Encryptor = CFB.extend({
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
- this._prevBlock = words.slice(offset, offset + blockSize);
- }
- });
- CFB.Decryptor = CFB.extend({
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- var thisBlock = words.slice(offset, offset + blockSize);
- generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
- this._prevBlock = thisBlock;
- }
- });
- function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
- var keystream;
- var iv = this._iv;
- if (iv) {
- keystream = iv.slice(0);
- this._iv = void 0;
- } else {
- keystream = this._prevBlock;
- }
- cipher.encryptBlock(keystream, 0);
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- return CFB;
- }();
- return CryptoJS.mode.CFB;
- });
- })(modeCfb);
- return modeCfb.exports;
- }
- var modeCtr = { exports: {} };
- var hasRequiredModeCtr;
- function requireModeCtr() {
- if (hasRequiredModeCtr)
- return modeCtr.exports;
- hasRequiredModeCtr = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.mode.CTR = function() {
- var CTR = CryptoJS.lib.BlockCipherMode.extend();
- var Encryptor = CTR.Encryptor = CTR.extend({
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var counter = this._counter;
- if (iv) {
- counter = this._counter = iv.slice(0);
- this._iv = void 0;
- }
- var keystream = counter.slice(0);
- cipher.encryptBlock(keystream, 0);
- counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
- CTR.Decryptor = Encryptor;
- return CTR;
- }();
- return CryptoJS.mode.CTR;
- });
- })(modeCtr);
- return modeCtr.exports;
- }
- var modeCtrGladman = { exports: {} };
- var hasRequiredModeCtrGladman;
- function requireModeCtrGladman() {
- if (hasRequiredModeCtrGladman)
- return modeCtrGladman.exports;
- hasRequiredModeCtrGladman = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- /** @preserve
- * Counter block mode compatible with Dr Brian Gladman fileenc.c
- * derived from CryptoJS.mode.CTR
- * Jan Hruby jhruby.web@gmail.com
- */
- CryptoJS.mode.CTRGladman = function() {
- var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
- function incWord(word) {
- if ((word >> 24 & 255) === 255) {
- var b1 = word >> 16 & 255;
- var b2 = word >> 8 & 255;
- var b3 = word & 255;
- if (b1 === 255) {
- b1 = 0;
- if (b2 === 255) {
- b2 = 0;
- if (b3 === 255) {
- b3 = 0;
- } else {
- ++b3;
- }
- } else {
- ++b2;
- }
- } else {
- ++b1;
- }
- word = 0;
- word += b1 << 16;
- word += b2 << 8;
- word += b3;
- } else {
- word += 1 << 24;
- }
- return word;
- }
- function incCounter(counter) {
- if ((counter[0] = incWord(counter[0])) === 0) {
- counter[1] = incWord(counter[1]);
- }
- return counter;
- }
- var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var counter = this._counter;
- if (iv) {
- counter = this._counter = iv.slice(0);
- this._iv = void 0;
- }
- incCounter(counter);
- var keystream = counter.slice(0);
- cipher.encryptBlock(keystream, 0);
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
- CTRGladman.Decryptor = Encryptor;
- return CTRGladman;
- }();
- return CryptoJS.mode.CTRGladman;
- });
- })(modeCtrGladman);
- return modeCtrGladman.exports;
- }
- var modeOfb = { exports: {} };
- var hasRequiredModeOfb;
- function requireModeOfb() {
- if (hasRequiredModeOfb)
- return modeOfb.exports;
- hasRequiredModeOfb = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.mode.OFB = function() {
- var OFB = CryptoJS.lib.BlockCipherMode.extend();
- var Encryptor = OFB.Encryptor = OFB.extend({
- processBlock: function(words, offset) {
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var keystream = this._keystream;
- if (iv) {
- keystream = this._keystream = iv.slice(0);
- this._iv = void 0;
- }
- cipher.encryptBlock(keystream, 0);
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
- OFB.Decryptor = Encryptor;
- return OFB;
- }();
- return CryptoJS.mode.OFB;
- });
- })(modeOfb);
- return modeOfb.exports;
- }
- var modeEcb = { exports: {} };
- var hasRequiredModeEcb;
- function requireModeEcb() {
- if (hasRequiredModeEcb)
- return modeEcb.exports;
- hasRequiredModeEcb = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.mode.ECB = function() {
- var ECB = CryptoJS.lib.BlockCipherMode.extend();
- ECB.Encryptor = ECB.extend({
- processBlock: function(words, offset) {
- this._cipher.encryptBlock(words, offset);
- }
- });
- ECB.Decryptor = ECB.extend({
- processBlock: function(words, offset) {
- this._cipher.decryptBlock(words, offset);
- }
- });
- return ECB;
- }();
- return CryptoJS.mode.ECB;
- });
- })(modeEcb);
- return modeEcb.exports;
- }
- var padAnsix923 = { exports: {} };
- var hasRequiredPadAnsix923;
- function requirePadAnsix923() {
- if (hasRequiredPadAnsix923)
- return padAnsix923.exports;
- hasRequiredPadAnsix923 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.pad.AnsiX923 = {
- pad: function(data, blockSize) {
- var dataSigBytes = data.sigBytes;
- var blockSizeBytes = blockSize * 4;
- var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
- var lastBytePos = dataSigBytes + nPaddingBytes - 1;
- data.clamp();
- data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;
- data.sigBytes += nPaddingBytes;
- },
- unpad: function(data) {
- var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
- data.sigBytes -= nPaddingBytes;
- }
- };
- return CryptoJS.pad.Ansix923;
- });
- })(padAnsix923);
- return padAnsix923.exports;
- }
- var padIso10126 = { exports: {} };
- var hasRequiredPadIso10126;
- function requirePadIso10126() {
- if (hasRequiredPadIso10126)
- return padIso10126.exports;
- hasRequiredPadIso10126 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.pad.Iso10126 = {
- pad: function(data, blockSize) {
- var blockSizeBytes = blockSize * 4;
- var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
- data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
- },
- unpad: function(data) {
- var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
- data.sigBytes -= nPaddingBytes;
- }
- };
- return CryptoJS.pad.Iso10126;
- });
- })(padIso10126);
- return padIso10126.exports;
- }
- var padIso97971 = { exports: {} };
- var hasRequiredPadIso97971;
- function requirePadIso97971() {
- if (hasRequiredPadIso97971)
- return padIso97971.exports;
- hasRequiredPadIso97971 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.pad.Iso97971 = {
- pad: function(data, blockSize) {
- data.concat(CryptoJS.lib.WordArray.create([2147483648], 1));
- CryptoJS.pad.ZeroPadding.pad(data, blockSize);
- },
- unpad: function(data) {
- CryptoJS.pad.ZeroPadding.unpad(data);
- data.sigBytes--;
- }
- };
- return CryptoJS.pad.Iso97971;
- });
- })(padIso97971);
- return padIso97971.exports;
- }
- var padZeropadding = { exports: {} };
- var hasRequiredPadZeropadding;
- function requirePadZeropadding() {
- if (hasRequiredPadZeropadding)
- return padZeropadding.exports;
- hasRequiredPadZeropadding = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.pad.ZeroPadding = {
- pad: function(data, blockSize) {
- var blockSizeBytes = blockSize * 4;
- data.clamp();
- data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes);
- },
- unpad: function(data) {
- var dataWords = data.words;
- var i = data.sigBytes - 1;
- for (var i = data.sigBytes - 1; i >= 0; i--) {
- if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 255) {
- data.sigBytes = i + 1;
- break;
- }
- }
- }
- };
- return CryptoJS.pad.ZeroPadding;
- });
- })(padZeropadding);
- return padZeropadding.exports;
- }
- var padNopadding = { exports: {} };
- var hasRequiredPadNopadding;
- function requirePadNopadding() {
- if (hasRequiredPadNopadding)
- return padNopadding.exports;
- hasRequiredPadNopadding = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- CryptoJS.pad.NoPadding = {
- pad: function() {
- },
- unpad: function() {
- }
- };
- return CryptoJS.pad.NoPadding;
- });
- })(padNopadding);
- return padNopadding.exports;
- }
- var formatHex = { exports: {} };
- var hasRequiredFormatHex;
- function requireFormatHex() {
- if (hasRequiredFormatHex)
- return formatHex.exports;
- hasRequiredFormatHex = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function(undefined$1) {
- var C = CryptoJS;
- var C_lib = C.lib;
- var CipherParams = C_lib.CipherParams;
- var C_enc = C.enc;
- var Hex = C_enc.Hex;
- var C_format = C.format;
- C_format.Hex = {
- /**
- * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
- *
- * @param {CipherParams} cipherParams The cipher params object.
- *
- * @return {string} The hexadecimally encoded string.
- *
- * @static
- *
- * @example
- *
- * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
- */
- stringify: function(cipherParams) {
- return cipherParams.ciphertext.toString(Hex);
- },
- /**
- * Converts a hexadecimally encoded ciphertext string to a cipher params object.
- *
- * @param {string} input The hexadecimally encoded string.
- *
- * @return {CipherParams} The cipher params object.
- *
- * @static
- *
- * @example
- *
- * var cipherParams = CryptoJS.format.Hex.parse(hexString);
- */
- parse: function(input) {
- var ciphertext = Hex.parse(input);
- return CipherParams.create({ ciphertext });
- }
- };
- })();
- return CryptoJS.format.Hex;
- });
- })(formatHex);
- return formatHex.exports;
- }
- var aes = { exports: {} };
- var hasRequiredAes;
- function requireAes() {
- if (hasRequiredAes)
- return aes.exports;
- hasRequiredAes = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var BlockCipher = C_lib.BlockCipher;
- var C_algo = C.algo;
- var SBOX = [];
- var INV_SBOX = [];
- var SUB_MIX_0 = [];
- var SUB_MIX_1 = [];
- var SUB_MIX_2 = [];
- var SUB_MIX_3 = [];
- var INV_SUB_MIX_0 = [];
- var INV_SUB_MIX_1 = [];
- var INV_SUB_MIX_2 = [];
- var INV_SUB_MIX_3 = [];
- (function() {
- var d = [];
- for (var i = 0; i < 256; i++) {
- if (i < 128) {
- d[i] = i << 1;
- } else {
- d[i] = i << 1 ^ 283;
- }
- }
- var x = 0;
- var xi = 0;
- for (var i = 0; i < 256; i++) {
- var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
- sx = sx >>> 8 ^ sx & 255 ^ 99;
- SBOX[x] = sx;
- INV_SBOX[sx] = x;
- var x2 = d[x];
- var x4 = d[x2];
- var x8 = d[x4];
- var t = d[sx] * 257 ^ sx * 16843008;
- SUB_MIX_0[x] = t << 24 | t >>> 8;
- SUB_MIX_1[x] = t << 16 | t >>> 16;
- SUB_MIX_2[x] = t << 8 | t >>> 24;
- SUB_MIX_3[x] = t;
- var t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
- INV_SUB_MIX_0[sx] = t << 24 | t >>> 8;
- INV_SUB_MIX_1[sx] = t << 16 | t >>> 16;
- INV_SUB_MIX_2[sx] = t << 8 | t >>> 24;
- INV_SUB_MIX_3[sx] = t;
- if (!x) {
- x = xi = 1;
- } else {
- x = x2 ^ d[d[d[x8 ^ x2]]];
- xi ^= d[d[xi]];
- }
- }
- })();
- var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
- var AES = C_algo.AES = BlockCipher.extend({
- _doReset: function() {
- var t;
- if (this._nRounds && this._keyPriorReset === this._key) {
- return;
- }
- var key = this._keyPriorReset = this._key;
- var keyWords = key.words;
- var keySize = key.sigBytes / 4;
- var nRounds = this._nRounds = keySize + 6;
- var ksRows = (nRounds + 1) * 4;
- var keySchedule = this._keySchedule = [];
- for (var ksRow = 0; ksRow < ksRows; ksRow++) {
- if (ksRow < keySize) {
- keySchedule[ksRow] = keyWords[ksRow];
- } else {
- t = keySchedule[ksRow - 1];
- if (!(ksRow % keySize)) {
- t = t << 8 | t >>> 24;
- t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
- t ^= RCON[ksRow / keySize | 0] << 24;
- } else if (keySize > 6 && ksRow % keySize == 4) {
- t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
- }
- keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
- }
- }
- var invKeySchedule = this._invKeySchedule = [];
- for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
- var ksRow = ksRows - invKsRow;
- if (invKsRow % 4) {
- var t = keySchedule[ksRow];
- } else {
- var t = keySchedule[ksRow - 4];
- }
- if (invKsRow < 4 || ksRow <= 4) {
- invKeySchedule[invKsRow] = t;
- } else {
- invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 255]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 255]] ^ INV_SUB_MIX_3[SBOX[t & 255]];
- }
- }
- },
- encryptBlock: function(M, offset) {
- this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
- },
- decryptBlock: function(M, offset) {
- var t = M[offset + 1];
- M[offset + 1] = M[offset + 3];
- M[offset + 3] = t;
- this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
- var t = M[offset + 1];
- M[offset + 1] = M[offset + 3];
- M[offset + 3] = t;
- },
- _doCryptBlock: function(M, offset, keySchedule, SUB_MIX_02, SUB_MIX_12, SUB_MIX_22, SUB_MIX_32, SBOX2) {
- var nRounds = this._nRounds;
- var s0 = M[offset] ^ keySchedule[0];
- var s1 = M[offset + 1] ^ keySchedule[1];
- var s2 = M[offset + 2] ^ keySchedule[2];
- var s3 = M[offset + 3] ^ keySchedule[3];
- var ksRow = 4;
- for (var round = 1; round < nRounds; round++) {
- var t0 = SUB_MIX_02[s0 >>> 24] ^ SUB_MIX_12[s1 >>> 16 & 255] ^ SUB_MIX_22[s2 >>> 8 & 255] ^ SUB_MIX_32[s3 & 255] ^ keySchedule[ksRow++];
- var t1 = SUB_MIX_02[s1 >>> 24] ^ SUB_MIX_12[s2 >>> 16 & 255] ^ SUB_MIX_22[s3 >>> 8 & 255] ^ SUB_MIX_32[s0 & 255] ^ keySchedule[ksRow++];
- var t2 = SUB_MIX_02[s2 >>> 24] ^ SUB_MIX_12[s3 >>> 16 & 255] ^ SUB_MIX_22[s0 >>> 8 & 255] ^ SUB_MIX_32[s1 & 255] ^ keySchedule[ksRow++];
- var t3 = SUB_MIX_02[s3 >>> 24] ^ SUB_MIX_12[s0 >>> 16 & 255] ^ SUB_MIX_22[s1 >>> 8 & 255] ^ SUB_MIX_32[s2 & 255] ^ keySchedule[ksRow++];
- s0 = t0;
- s1 = t1;
- s2 = t2;
- s3 = t3;
- }
- var t0 = (SBOX2[s0 >>> 24] << 24 | SBOX2[s1 >>> 16 & 255] << 16 | SBOX2[s2 >>> 8 & 255] << 8 | SBOX2[s3 & 255]) ^ keySchedule[ksRow++];
- var t1 = (SBOX2[s1 >>> 24] << 24 | SBOX2[s2 >>> 16 & 255] << 16 | SBOX2[s3 >>> 8 & 255] << 8 | SBOX2[s0 & 255]) ^ keySchedule[ksRow++];
- var t2 = (SBOX2[s2 >>> 24] << 24 | SBOX2[s3 >>> 16 & 255] << 16 | SBOX2[s0 >>> 8 & 255] << 8 | SBOX2[s1 & 255]) ^ keySchedule[ksRow++];
- var t3 = (SBOX2[s3 >>> 24] << 24 | SBOX2[s0 >>> 16 & 255] << 16 | SBOX2[s1 >>> 8 & 255] << 8 | SBOX2[s2 & 255]) ^ keySchedule[ksRow++];
- M[offset] = t0;
- M[offset + 1] = t1;
- M[offset + 2] = t2;
- M[offset + 3] = t3;
- },
- keySize: 256 / 32
- });
- C.AES = BlockCipher._createHelper(AES);
- })();
- return CryptoJS.AES;
- });
- })(aes);
- return aes.exports;
- }
- var tripledes = { exports: {} };
- var hasRequiredTripledes;
- function requireTripledes() {
- if (hasRequiredTripledes)
- return tripledes.exports;
- hasRequiredTripledes = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var BlockCipher = C_lib.BlockCipher;
- var C_algo = C.algo;
- var PC1 = [
- 57,
- 49,
- 41,
- 33,
- 25,
- 17,
- 9,
- 1,
- 58,
- 50,
- 42,
- 34,
- 26,
- 18,
- 10,
- 2,
- 59,
- 51,
- 43,
- 35,
- 27,
- 19,
- 11,
- 3,
- 60,
- 52,
- 44,
- 36,
- 63,
- 55,
- 47,
- 39,
- 31,
- 23,
- 15,
- 7,
- 62,
- 54,
- 46,
- 38,
- 30,
- 22,
- 14,
- 6,
- 61,
- 53,
- 45,
- 37,
- 29,
- 21,
- 13,
- 5,
- 28,
- 20,
- 12,
- 4
- ];
- var PC2 = [
- 14,
- 17,
- 11,
- 24,
- 1,
- 5,
- 3,
- 28,
- 15,
- 6,
- 21,
- 10,
- 23,
- 19,
- 12,
- 4,
- 26,
- 8,
- 16,
- 7,
- 27,
- 20,
- 13,
- 2,
- 41,
- 52,
- 31,
- 37,
- 47,
- 55,
- 30,
- 40,
- 51,
- 45,
- 33,
- 48,
- 44,
- 49,
- 39,
- 56,
- 34,
- 53,
- 46,
- 42,
- 50,
- 36,
- 29,
- 32
- ];
- var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
- var SBOX_P = [
- {
- 0: 8421888,
- 268435456: 32768,
- 536870912: 8421378,
- 805306368: 2,
- 1073741824: 512,
- 1342177280: 8421890,
- 1610612736: 8389122,
- 1879048192: 8388608,
- 2147483648: 514,
- 2415919104: 8389120,
- 2684354560: 33280,
- 2952790016: 8421376,
- 3221225472: 32770,
- 3489660928: 8388610,
- 3758096384: 0,
- 4026531840: 33282,
- 134217728: 0,
- 402653184: 8421890,
- 671088640: 33282,
- 939524096: 32768,
- 1207959552: 8421888,
- 1476395008: 512,
- 1744830464: 8421378,
- 2013265920: 2,
- 2281701376: 8389120,
- 2550136832: 33280,
- 2818572288: 8421376,
- 3087007744: 8389122,
- 3355443200: 8388610,
- 3623878656: 32770,
- 3892314112: 514,
- 4160749568: 8388608,
- 1: 32768,
- 268435457: 2,
- 536870913: 8421888,
- 805306369: 8388608,
- 1073741825: 8421378,
- 1342177281: 33280,
- 1610612737: 512,
- 1879048193: 8389122,
- 2147483649: 8421890,
- 2415919105: 8421376,
- 2684354561: 8388610,
- 2952790017: 33282,
- 3221225473: 514,
- 3489660929: 8389120,
- 3758096385: 32770,
- 4026531841: 0,
- 134217729: 8421890,
- 402653185: 8421376,
- 671088641: 8388608,
- 939524097: 512,
- 1207959553: 32768,
- 1476395009: 8388610,
- 1744830465: 2,
- 2013265921: 33282,
- 2281701377: 32770,
- 2550136833: 8389122,
- 2818572289: 514,
- 3087007745: 8421888,
- 3355443201: 8389120,
- 3623878657: 0,
- 3892314113: 33280,
- 4160749569: 8421378
- },
- {
- 0: 1074282512,
- 16777216: 16384,
- 33554432: 524288,
- 50331648: 1074266128,
- 67108864: 1073741840,
- 83886080: 1074282496,
- 100663296: 1073758208,
- 117440512: 16,
- 134217728: 540672,
- 150994944: 1073758224,
- 167772160: 1073741824,
- 184549376: 540688,
- 201326592: 524304,
- 218103808: 0,
- 234881024: 16400,
- 251658240: 1074266112,
- 8388608: 1073758208,
- 25165824: 540688,
- 41943040: 16,
- 58720256: 1073758224,
- 75497472: 1074282512,
- 92274688: 1073741824,
- 109051904: 524288,
- 125829120: 1074266128,
- 142606336: 524304,
- 159383552: 0,
- 176160768: 16384,
- 192937984: 1074266112,
- 209715200: 1073741840,
- 226492416: 540672,
- 243269632: 1074282496,
- 260046848: 16400,
- 268435456: 0,
- 285212672: 1074266128,
- 301989888: 1073758224,
- 318767104: 1074282496,
- 335544320: 1074266112,
- 352321536: 16,
- 369098752: 540688,
- 385875968: 16384,
- 402653184: 16400,
- 419430400: 524288,
- 436207616: 524304,
- 452984832: 1073741840,
- 469762048: 540672,
- 486539264: 1073758208,
- 503316480: 1073741824,
- 520093696: 1074282512,
- 276824064: 540688,
- 293601280: 524288,
- 310378496: 1074266112,
- 327155712: 16384,
- 343932928: 1073758208,
- 360710144: 1074282512,
- 377487360: 16,
- 394264576: 1073741824,
- 411041792: 1074282496,
- 427819008: 1073741840,
- 444596224: 1073758224,
- 461373440: 524304,
- 478150656: 0,
- 494927872: 16400,
- 511705088: 1074266128,
- 528482304: 540672
- },
- {
- 0: 260,
- 1048576: 0,
- 2097152: 67109120,
- 3145728: 65796,
- 4194304: 65540,
- 5242880: 67108868,
- 6291456: 67174660,
- 7340032: 67174400,
- 8388608: 67108864,
- 9437184: 67174656,
- 10485760: 65792,
- 11534336: 67174404,
- 12582912: 67109124,
- 13631488: 65536,
- 14680064: 4,
- 15728640: 256,
- 524288: 67174656,
- 1572864: 67174404,
- 2621440: 0,
- 3670016: 67109120,
- 4718592: 67108868,
- 5767168: 65536,
- 6815744: 65540,
- 7864320: 260,
- 8912896: 4,
- 9961472: 256,
- 11010048: 67174400,
- 12058624: 65796,
- 13107200: 65792,
- 14155776: 67109124,
- 15204352: 67174660,
- 16252928: 67108864,
- 16777216: 67174656,
- 17825792: 65540,
- 18874368: 65536,
- 19922944: 67109120,
- 20971520: 256,
- 22020096: 67174660,
- 23068672: 67108868,
- 24117248: 0,
- 25165824: 67109124,
- 26214400: 67108864,
- 27262976: 4,
- 28311552: 65792,
- 29360128: 67174400,
- 30408704: 260,
- 31457280: 65796,
- 32505856: 67174404,
- 17301504: 67108864,
- 18350080: 260,
- 19398656: 67174656,
- 20447232: 0,
- 21495808: 65540,
- 22544384: 67109120,
- 23592960: 256,
- 24641536: 67174404,
- 25690112: 65536,
- 26738688: 67174660,
- 27787264: 65796,
- 28835840: 67108868,
- 29884416: 67109124,
- 30932992: 67174400,
- 31981568: 4,
- 33030144: 65792
- },
- {
- 0: 2151682048,
- 65536: 2147487808,
- 131072: 4198464,
- 196608: 2151677952,
- 262144: 0,
- 327680: 4198400,
- 393216: 2147483712,
- 458752: 4194368,
- 524288: 2147483648,
- 589824: 4194304,
- 655360: 64,
- 720896: 2147487744,
- 786432: 2151678016,
- 851968: 4160,
- 917504: 4096,
- 983040: 2151682112,
- 32768: 2147487808,
- 98304: 64,
- 163840: 2151678016,
- 229376: 2147487744,
- 294912: 4198400,
- 360448: 2151682112,
- 425984: 0,
- 491520: 2151677952,
- 557056: 4096,
- 622592: 2151682048,
- 688128: 4194304,
- 753664: 4160,
- 819200: 2147483648,
- 884736: 4194368,
- 950272: 4198464,
- 1015808: 2147483712,
- 1048576: 4194368,
- 1114112: 4198400,
- 1179648: 2147483712,
- 1245184: 0,
- 1310720: 4160,
- 1376256: 2151678016,
- 1441792: 2151682048,
- 1507328: 2147487808,
- 1572864: 2151682112,
- 1638400: 2147483648,
- 1703936: 2151677952,
- 1769472: 4198464,
- 1835008: 2147487744,
- 1900544: 4194304,
- 1966080: 64,
- 2031616: 4096,
- 1081344: 2151677952,
- 1146880: 2151682112,
- 1212416: 0,
- 1277952: 4198400,
- 1343488: 4194368,
- 1409024: 2147483648,
- 1474560: 2147487808,
- 1540096: 64,
- 1605632: 2147483712,
- 1671168: 4096,
- 1736704: 2147487744,
- 1802240: 2151678016,
- 1867776: 4160,
- 1933312: 2151682048,
- 1998848: 4194304,
- 2064384: 4198464
- },
- {
- 0: 128,
- 4096: 17039360,
- 8192: 262144,
- 12288: 536870912,
- 16384: 537133184,
- 20480: 16777344,
- 24576: 553648256,
- 28672: 262272,
- 32768: 16777216,
- 36864: 537133056,
- 40960: 536871040,
- 45056: 553910400,
- 49152: 553910272,
- 53248: 0,
- 57344: 17039488,
- 61440: 553648128,
- 2048: 17039488,
- 6144: 553648256,
- 10240: 128,
- 14336: 17039360,
- 18432: 262144,
- 22528: 537133184,
- 26624: 553910272,
- 30720: 536870912,
- 34816: 537133056,
- 38912: 0,
- 43008: 553910400,
- 47104: 16777344,
- 51200: 536871040,
- 55296: 553648128,
- 59392: 16777216,
- 63488: 262272,
- 65536: 262144,
- 69632: 128,
- 73728: 536870912,
- 77824: 553648256,
- 81920: 16777344,
- 86016: 553910272,
- 90112: 537133184,
- 94208: 16777216,
- 98304: 553910400,
- 102400: 553648128,
- 106496: 17039360,
- 110592: 537133056,
- 114688: 262272,
- 118784: 536871040,
- 122880: 0,
- 126976: 17039488,
- 67584: 553648256,
- 71680: 16777216,
- 75776: 17039360,
- 79872: 537133184,
- 83968: 536870912,
- 88064: 17039488,
- 92160: 128,
- 96256: 553910272,
- 100352: 262272,
- 104448: 553910400,
- 108544: 0,
- 112640: 553648128,
- 116736: 16777344,
- 120832: 262144,
- 124928: 537133056,
- 129024: 536871040
- },
- {
- 0: 268435464,
- 256: 8192,
- 512: 270532608,
- 768: 270540808,
- 1024: 268443648,
- 1280: 2097152,
- 1536: 2097160,
- 1792: 268435456,
- 2048: 0,
- 2304: 268443656,
- 2560: 2105344,
- 2816: 8,
- 3072: 270532616,
- 3328: 2105352,
- 3584: 8200,
- 3840: 270540800,
- 128: 270532608,
- 384: 270540808,
- 640: 8,
- 896: 2097152,
- 1152: 2105352,
- 1408: 268435464,
- 1664: 268443648,
- 1920: 8200,
- 2176: 2097160,
- 2432: 8192,
- 2688: 268443656,
- 2944: 270532616,
- 3200: 0,
- 3456: 270540800,
- 3712: 2105344,
- 3968: 268435456,
- 4096: 268443648,
- 4352: 270532616,
- 4608: 270540808,
- 4864: 8200,
- 5120: 2097152,
- 5376: 268435456,
- 5632: 268435464,
- 5888: 2105344,
- 6144: 2105352,
- 6400: 0,
- 6656: 8,
- 6912: 270532608,
- 7168: 8192,
- 7424: 268443656,
- 7680: 270540800,
- 7936: 2097160,
- 4224: 8,
- 4480: 2105344,
- 4736: 2097152,
- 4992: 268435464,
- 5248: 268443648,
- 5504: 8200,
- 5760: 270540808,
- 6016: 270532608,
- 6272: 270540800,
- 6528: 270532616,
- 6784: 8192,
- 7040: 2105352,
- 7296: 2097160,
- 7552: 0,
- 7808: 268435456,
- 8064: 268443656
- },
- {
- 0: 1048576,
- 16: 33555457,
- 32: 1024,
- 48: 1049601,
- 64: 34604033,
- 80: 0,
- 96: 1,
- 112: 34603009,
- 128: 33555456,
- 144: 1048577,
- 160: 33554433,
- 176: 34604032,
- 192: 34603008,
- 208: 1025,
- 224: 1049600,
- 240: 33554432,
- 8: 34603009,
- 24: 0,
- 40: 33555457,
- 56: 34604032,
- 72: 1048576,
- 88: 33554433,
- 104: 33554432,
- 120: 1025,
- 136: 1049601,
- 152: 33555456,
- 168: 34603008,
- 184: 1048577,
- 200: 1024,
- 216: 34604033,
- 232: 1,
- 248: 1049600,
- 256: 33554432,
- 272: 1048576,
- 288: 33555457,
- 304: 34603009,
- 320: 1048577,
- 336: 33555456,
- 352: 34604032,
- 368: 1049601,
- 384: 1025,
- 400: 34604033,
- 416: 1049600,
- 432: 1,
- 448: 0,
- 464: 34603008,
- 480: 33554433,
- 496: 1024,
- 264: 1049600,
- 280: 33555457,
- 296: 34603009,
- 312: 1,
- 328: 33554432,
- 344: 1048576,
- 360: 1025,
- 376: 34604032,
- 392: 33554433,
- 408: 34603008,
- 424: 0,
- 440: 34604033,
- 456: 1049601,
- 472: 1024,
- 488: 33555456,
- 504: 1048577
- },
- {
- 0: 134219808,
- 1: 131072,
- 2: 134217728,
- 3: 32,
- 4: 131104,
- 5: 134350880,
- 6: 134350848,
- 7: 2048,
- 8: 134348800,
- 9: 134219776,
- 10: 133120,
- 11: 134348832,
- 12: 2080,
- 13: 0,
- 14: 134217760,
- 15: 133152,
- 2147483648: 2048,
- 2147483649: 134350880,
- 2147483650: 134219808,
- 2147483651: 134217728,
- 2147483652: 134348800,
- 2147483653: 133120,
- 2147483654: 133152,
- 2147483655: 32,
- 2147483656: 134217760,
- 2147483657: 2080,
- 2147483658: 131104,
- 2147483659: 134350848,
- 2147483660: 0,
- 2147483661: 134348832,
- 2147483662: 134219776,
- 2147483663: 131072,
- 16: 133152,
- 17: 134350848,
- 18: 32,
- 19: 2048,
- 20: 134219776,
- 21: 134217760,
- 22: 134348832,
- 23: 131072,
- 24: 0,
- 25: 131104,
- 26: 134348800,
- 27: 134219808,
- 28: 134350880,
- 29: 133120,
- 30: 2080,
- 31: 134217728,
- 2147483664: 131072,
- 2147483665: 2048,
- 2147483666: 134348832,
- 2147483667: 133152,
- 2147483668: 32,
- 2147483669: 134348800,
- 2147483670: 134217728,
- 2147483671: 134219808,
- 2147483672: 134350880,
- 2147483673: 134217760,
- 2147483674: 134219776,
- 2147483675: 0,
- 2147483676: 133120,
- 2147483677: 2080,
- 2147483678: 131104,
- 2147483679: 134350848
- }
- ];
- var SBOX_MASK = [
- 4160749569,
- 528482304,
- 33030144,
- 2064384,
- 129024,
- 8064,
- 504,
- 2147483679
- ];
- var DES = C_algo.DES = BlockCipher.extend({
- _doReset: function() {
- var key = this._key;
- var keyWords = key.words;
- var keyBits = [];
- for (var i = 0; i < 56; i++) {
- var keyBitPos = PC1[i] - 1;
- keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;
- }
- var subKeys = this._subKeys = [];
- for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
- var subKey = subKeys[nSubKey] = [];
- var bitShift = BIT_SHIFTS[nSubKey];
- for (var i = 0; i < 24; i++) {
- subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;
- subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;
- }
- subKey[0] = subKey[0] << 1 | subKey[0] >>> 31;
- for (var i = 1; i < 7; i++) {
- subKey[i] = subKey[i] >>> (i - 1) * 4 + 3;
- }
- subKey[7] = subKey[7] << 5 | subKey[7] >>> 27;
- }
- var invSubKeys = this._invSubKeys = [];
- for (var i = 0; i < 16; i++) {
- invSubKeys[i] = subKeys[15 - i];
- }
- },
- encryptBlock: function(M, offset) {
- this._doCryptBlock(M, offset, this._subKeys);
- },
- decryptBlock: function(M, offset) {
- this._doCryptBlock(M, offset, this._invSubKeys);
- },
- _doCryptBlock: function(M, offset, subKeys) {
- this._lBlock = M[offset];
- this._rBlock = M[offset + 1];
- exchangeLR.call(this, 4, 252645135);
- exchangeLR.call(this, 16, 65535);
- exchangeRL.call(this, 2, 858993459);
- exchangeRL.call(this, 8, 16711935);
- exchangeLR.call(this, 1, 1431655765);
- for (var round = 0; round < 16; round++) {
- var subKey = subKeys[round];
- var lBlock = this._lBlock;
- var rBlock = this._rBlock;
- var f = 0;
- for (var i = 0; i < 8; i++) {
- f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
- }
- this._lBlock = rBlock;
- this._rBlock = lBlock ^ f;
- }
- var t = this._lBlock;
- this._lBlock = this._rBlock;
- this._rBlock = t;
- exchangeLR.call(this, 1, 1431655765);
- exchangeRL.call(this, 8, 16711935);
- exchangeRL.call(this, 2, 858993459);
- exchangeLR.call(this, 16, 65535);
- exchangeLR.call(this, 4, 252645135);
- M[offset] = this._lBlock;
- M[offset + 1] = this._rBlock;
- },
- keySize: 64 / 32,
- ivSize: 64 / 32,
- blockSize: 64 / 32
- });
- function exchangeLR(offset, mask) {
- var t = (this._lBlock >>> offset ^ this._rBlock) & mask;
- this._rBlock ^= t;
- this._lBlock ^= t << offset;
- }
- function exchangeRL(offset, mask) {
- var t = (this._rBlock >>> offset ^ this._lBlock) & mask;
- this._lBlock ^= t;
- this._rBlock ^= t << offset;
- }
- C.DES = BlockCipher._createHelper(DES);
- var TripleDES = C_algo.TripleDES = BlockCipher.extend({
- _doReset: function() {
- var key = this._key;
- var keyWords = key.words;
- if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
- throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
- }
- var key1 = keyWords.slice(0, 2);
- var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
- var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
- this._des1 = DES.createEncryptor(WordArray.create(key1));
- this._des2 = DES.createEncryptor(WordArray.create(key2));
- this._des3 = DES.createEncryptor(WordArray.create(key3));
- },
- encryptBlock: function(M, offset) {
- this._des1.encryptBlock(M, offset);
- this._des2.decryptBlock(M, offset);
- this._des3.encryptBlock(M, offset);
- },
- decryptBlock: function(M, offset) {
- this._des3.decryptBlock(M, offset);
- this._des2.encryptBlock(M, offset);
- this._des1.decryptBlock(M, offset);
- },
- keySize: 192 / 32,
- ivSize: 64 / 32,
- blockSize: 64 / 32
- });
- C.TripleDES = BlockCipher._createHelper(TripleDES);
- })();
- return CryptoJS.TripleDES;
- });
- })(tripledes);
- return tripledes.exports;
- }
- var rc4 = { exports: {} };
- var hasRequiredRc4;
- function requireRc4() {
- if (hasRequiredRc4)
- return rc4.exports;
- hasRequiredRc4 = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
- var RC4 = C_algo.RC4 = StreamCipher.extend({
- _doReset: function() {
- var key = this._key;
- var keyWords = key.words;
- var keySigBytes = key.sigBytes;
- var S = this._S = [];
- for (var i = 0; i < 256; i++) {
- S[i] = i;
- }
- for (var i = 0, j = 0; i < 256; i++) {
- var keyByteIndex = i % keySigBytes;
- var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 255;
- j = (j + S[i] + keyByte) % 256;
- var t = S[i];
- S[i] = S[j];
- S[j] = t;
- }
- this._i = this._j = 0;
- },
- _doProcessBlock: function(M, offset) {
- M[offset] ^= generateKeystreamWord.call(this);
- },
- keySize: 256 / 32,
- ivSize: 0
- });
- function generateKeystreamWord() {
- var S = this._S;
- var i = this._i;
- var j = this._j;
- var keystreamWord = 0;
- for (var n = 0; n < 4; n++) {
- i = (i + 1) % 256;
- j = (j + S[i]) % 256;
- var t = S[i];
- S[i] = S[j];
- S[j] = t;
- keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;
- }
- this._i = i;
- this._j = j;
- return keystreamWord;
- }
- C.RC4 = StreamCipher._createHelper(RC4);
- var RC4Drop = C_algo.RC4Drop = RC4.extend({
- /**
- * Configuration options.
- *
- * @property {number} drop The number of keystream words to drop. Default 192
- */
- cfg: RC4.cfg.extend({
- drop: 192
- }),
- _doReset: function() {
- RC4._doReset.call(this);
- for (var i = this.cfg.drop; i > 0; i--) {
- generateKeystreamWord.call(this);
- }
- }
- });
- C.RC4Drop = StreamCipher._createHelper(RC4Drop);
- })();
- return CryptoJS.RC4;
- });
- })(rc4);
- return rc4.exports;
- }
- var rabbit = { exports: {} };
- var hasRequiredRabbit;
- function requireRabbit() {
- if (hasRequiredRabbit)
- return rabbit.exports;
- hasRequiredRabbit = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
- var S = [];
- var C_ = [];
- var G = [];
- var Rabbit = C_algo.Rabbit = StreamCipher.extend({
- _doReset: function() {
- var K = this._key.words;
- var iv = this.cfg.iv;
- for (var i = 0; i < 4; i++) {
- K[i] = (K[i] << 8 | K[i] >>> 24) & 16711935 | (K[i] << 24 | K[i] >>> 8) & 4278255360;
- }
- var X = this._X = [
- K[0],
- K[3] << 16 | K[2] >>> 16,
- K[1],
- K[0] << 16 | K[3] >>> 16,
- K[2],
- K[1] << 16 | K[0] >>> 16,
- K[3],
- K[2] << 16 | K[1] >>> 16
- ];
- var C2 = this._C = [
- K[2] << 16 | K[2] >>> 16,
- K[0] & 4294901760 | K[1] & 65535,
- K[3] << 16 | K[3] >>> 16,
- K[1] & 4294901760 | K[2] & 65535,
- K[0] << 16 | K[0] >>> 16,
- K[2] & 4294901760 | K[3] & 65535,
- K[1] << 16 | K[1] >>> 16,
- K[3] & 4294901760 | K[0] & 65535
- ];
- this._b = 0;
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- for (var i = 0; i < 8; i++) {
- C2[i] ^= X[i + 4 & 7];
- }
- if (iv) {
- var IV = iv.words;
- var IV_0 = IV[0];
- var IV_1 = IV[1];
- var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
- var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
- var i1 = i0 >>> 16 | i2 & 4294901760;
- var i3 = i2 << 16 | i0 & 65535;
- C2[0] ^= i0;
- C2[1] ^= i1;
- C2[2] ^= i2;
- C2[3] ^= i3;
- C2[4] ^= i0;
- C2[5] ^= i1;
- C2[6] ^= i2;
- C2[7] ^= i3;
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- }
- },
- _doProcessBlock: function(M, offset) {
- var X = this._X;
- nextState.call(this);
- S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
- S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
- S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
- S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
- for (var i = 0; i < 4; i++) {
- S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
- M[offset + i] ^= S[i];
- }
- },
- blockSize: 128 / 32,
- ivSize: 64 / 32
- });
- function nextState() {
- var X = this._X;
- var C2 = this._C;
- for (var i = 0; i < 8; i++) {
- C_[i] = C2[i];
- }
- C2[0] = C2[0] + 1295307597 + this._b | 0;
- C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
- C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
- C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
- C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
- C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
- C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
- C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
- this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
- for (var i = 0; i < 8; i++) {
- var gx = X[i] + C2[i];
- var ga = gx & 65535;
- var gb = gx >>> 16;
- var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
- var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
- G[i] = gh ^ gl;
- }
- X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
- X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
- X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
- X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
- X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
- X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
- X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
- X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
- }
- C.Rabbit = StreamCipher._createHelper(Rabbit);
- })();
- return CryptoJS.Rabbit;
- });
- })(rabbit);
- return rabbit.exports;
- }
- var rabbitLegacy = { exports: {} };
- var hasRequiredRabbitLegacy;
- function requireRabbitLegacy() {
- if (hasRequiredRabbitLegacy)
- return rabbitLegacy.exports;
- hasRequiredRabbitLegacy = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
- var S = [];
- var C_ = [];
- var G = [];
- var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
- _doReset: function() {
- var K = this._key.words;
- var iv = this.cfg.iv;
- var X = this._X = [
- K[0],
- K[3] << 16 | K[2] >>> 16,
- K[1],
- K[0] << 16 | K[3] >>> 16,
- K[2],
- K[1] << 16 | K[0] >>> 16,
- K[3],
- K[2] << 16 | K[1] >>> 16
- ];
- var C2 = this._C = [
- K[2] << 16 | K[2] >>> 16,
- K[0] & 4294901760 | K[1] & 65535,
- K[3] << 16 | K[3] >>> 16,
- K[1] & 4294901760 | K[2] & 65535,
- K[0] << 16 | K[0] >>> 16,
- K[2] & 4294901760 | K[3] & 65535,
- K[1] << 16 | K[1] >>> 16,
- K[3] & 4294901760 | K[0] & 65535
- ];
- this._b = 0;
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- for (var i = 0; i < 8; i++) {
- C2[i] ^= X[i + 4 & 7];
- }
- if (iv) {
- var IV = iv.words;
- var IV_0 = IV[0];
- var IV_1 = IV[1];
- var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
- var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
- var i1 = i0 >>> 16 | i2 & 4294901760;
- var i3 = i2 << 16 | i0 & 65535;
- C2[0] ^= i0;
- C2[1] ^= i1;
- C2[2] ^= i2;
- C2[3] ^= i3;
- C2[4] ^= i0;
- C2[5] ^= i1;
- C2[6] ^= i2;
- C2[7] ^= i3;
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- }
- },
- _doProcessBlock: function(M, offset) {
- var X = this._X;
- nextState.call(this);
- S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
- S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
- S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
- S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
- for (var i = 0; i < 4; i++) {
- S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
- M[offset + i] ^= S[i];
- }
- },
- blockSize: 128 / 32,
- ivSize: 64 / 32
- });
- function nextState() {
- var X = this._X;
- var C2 = this._C;
- for (var i = 0; i < 8; i++) {
- C_[i] = C2[i];
- }
- C2[0] = C2[0] + 1295307597 + this._b | 0;
- C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
- C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
- C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
- C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
- C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
- C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
- C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
- this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
- for (var i = 0; i < 8; i++) {
- var gx = X[i] + C2[i];
- var ga = gx & 65535;
- var gb = gx >>> 16;
- var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
- var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
- G[i] = gh ^ gl;
- }
- X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
- X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
- X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
- X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
- X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
- X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
- X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
- X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
- }
- C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
- })();
- return CryptoJS.RabbitLegacy;
- });
- })(rabbitLegacy);
- return rabbitLegacy.exports;
- }
- var blowfish = { exports: {} };
- var hasRequiredBlowfish;
- function requireBlowfish() {
- if (hasRequiredBlowfish)
- return blowfish.exports;
- hasRequiredBlowfish = 1;
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireEncBase64(), requireMd5(), requireEvpkdf(), requireCipherCore());
- }
- })(commonjsGlobal, function(CryptoJS) {
- (function() {
- var C = CryptoJS;
- var C_lib = C.lib;
- var BlockCipher = C_lib.BlockCipher;
- var C_algo = C.algo;
- const N = 16;
- const ORIG_P = [
- 608135816,
- 2242054355,
- 320440878,
- 57701188,
- 2752067618,
- 698298832,
- 137296536,
- 3964562569,
- 1160258022,
- 953160567,
- 3193202383,
- 887688300,
- 3232508343,
- 3380367581,
- 1065670069,
- 3041331479,
- 2450970073,
- 2306472731
- ];
- const ORIG_S = [
- [
- 3509652390,
- 2564797868,
- 805139163,
- 3491422135,
- 3101798381,
- 1780907670,
- 3128725573,
- 4046225305,
- 614570311,
- 3012652279,
- 134345442,
- 2240740374,
- 1667834072,
- 1901547113,
- 2757295779,
- 4103290238,
- 227898511,
- 1921955416,
- 1904987480,
- 2182433518,
- 2069144605,
- 3260701109,
- 2620446009,
- 720527379,
- 3318853667,
- 677414384,
- 3393288472,
- 3101374703,
- 2390351024,
- 1614419982,
- 1822297739,
- 2954791486,
- 3608508353,
- 3174124327,
- 2024746970,
- 1432378464,
- 3864339955,
- 2857741204,
- 1464375394,
- 1676153920,
- 1439316330,
- 715854006,
- 3033291828,
- 289532110,
- 2706671279,
- 2087905683,
- 3018724369,
- 1668267050,
- 732546397,
- 1947742710,
- 3462151702,
- 2609353502,
- 2950085171,
- 1814351708,
- 2050118529,
- 680887927,
- 999245976,
- 1800124847,
- 3300911131,
- 1713906067,
- 1641548236,
- 4213287313,
- 1216130144,
- 1575780402,
- 4018429277,
- 3917837745,
- 3693486850,
- 3949271944,
- 596196993,
- 3549867205,
- 258830323,
- 2213823033,
- 772490370,
- 2760122372,
- 1774776394,
- 2652871518,
- 566650946,
- 4142492826,
- 1728879713,
- 2882767088,
- 1783734482,
- 3629395816,
- 2517608232,
- 2874225571,
- 1861159788,
- 326777828,
- 3124490320,
- 2130389656,
- 2716951837,
- 967770486,
- 1724537150,
- 2185432712,
- 2364442137,
- 1164943284,
- 2105845187,
- 998989502,
- 3765401048,
- 2244026483,
- 1075463327,
- 1455516326,
- 1322494562,
- 910128902,
- 469688178,
- 1117454909,
- 936433444,
- 3490320968,
- 3675253459,
- 1240580251,
- 122909385,
- 2157517691,
- 634681816,
- 4142456567,
- 3825094682,
- 3061402683,
- 2540495037,
- 79693498,
- 3249098678,
- 1084186820,
- 1583128258,
- 426386531,
- 1761308591,
- 1047286709,
- 322548459,
- 995290223,
- 1845252383,
- 2603652396,
- 3431023940,
- 2942221577,
- 3202600964,
- 3727903485,
- 1712269319,
- 422464435,
- 3234572375,
- 1170764815,
- 3523960633,
- 3117677531,
- 1434042557,
- 442511882,
- 3600875718,
- 1076654713,
- 1738483198,
- 4213154764,
- 2393238008,
- 3677496056,
- 1014306527,
- 4251020053,
- 793779912,
- 2902807211,
- 842905082,
- 4246964064,
- 1395751752,
- 1040244610,
- 2656851899,
- 3396308128,
- 445077038,
- 3742853595,
- 3577915638,
- 679411651,
- 2892444358,
- 2354009459,
- 1767581616,
- 3150600392,
- 3791627101,
- 3102740896,
- 284835224,
- 4246832056,
- 1258075500,
- 768725851,
- 2589189241,
- 3069724005,
- 3532540348,
- 1274779536,
- 3789419226,
- 2764799539,
- 1660621633,
- 3471099624,
- 4011903706,
- 913787905,
- 3497959166,
- 737222580,
- 2514213453,
- 2928710040,
- 3937242737,
- 1804850592,
- 3499020752,
- 2949064160,
- 2386320175,
- 2390070455,
- 2415321851,
- 4061277028,
- 2290661394,
- 2416832540,
- 1336762016,
- 1754252060,
- 3520065937,
- 3014181293,
- 791618072,
- 3188594551,
- 3933548030,
- 2332172193,
- 3852520463,
- 3043980520,
- 413987798,
- 3465142937,
- 3030929376,
- 4245938359,
- 2093235073,
- 3534596313,
- 375366246,
- 2157278981,
- 2479649556,
- 555357303,
- 3870105701,
- 2008414854,
- 3344188149,
- 4221384143,
- 3956125452,
- 2067696032,
- 3594591187,
- 2921233993,
- 2428461,
- 544322398,
- 577241275,
- 1471733935,
- 610547355,
- 4027169054,
- 1432588573,
- 1507829418,
- 2025931657,
- 3646575487,
- 545086370,
- 48609733,
- 2200306550,
- 1653985193,
- 298326376,
- 1316178497,
- 3007786442,
- 2064951626,
- 458293330,
- 2589141269,
- 3591329599,
- 3164325604,
- 727753846,
- 2179363840,
- 146436021,
- 1461446943,
- 4069977195,
- 705550613,
- 3059967265,
- 3887724982,
- 4281599278,
- 3313849956,
- 1404054877,
- 2845806497,
- 146425753,
- 1854211946
- ],
- [
- 1266315497,
- 3048417604,
- 3681880366,
- 3289982499,
- 290971e4,
- 1235738493,
- 2632868024,
- 2414719590,
- 3970600049,
- 1771706367,
- 1449415276,
- 3266420449,
- 422970021,
- 1963543593,
- 2690192192,
- 3826793022,
- 1062508698,
- 1531092325,
- 1804592342,
- 2583117782,
- 2714934279,
- 4024971509,
- 1294809318,
- 4028980673,
- 1289560198,
- 2221992742,
- 1669523910,
- 35572830,
- 157838143,
- 1052438473,
- 1016535060,
- 1802137761,
- 1753167236,
- 1386275462,
- 3080475397,
- 2857371447,
- 1040679964,
- 2145300060,
- 2390574316,
- 1461121720,
- 2956646967,
- 4031777805,
- 4028374788,
- 33600511,
- 2920084762,
- 1018524850,
- 629373528,
- 3691585981,
- 3515945977,
- 2091462646,
- 2486323059,
- 586499841,
- 988145025,
- 935516892,
- 3367335476,
- 2599673255,
- 2839830854,
- 265290510,
- 3972581182,
- 2759138881,
- 3795373465,
- 1005194799,
- 847297441,
- 406762289,
- 1314163512,
- 1332590856,
- 1866599683,
- 4127851711,
- 750260880,
- 613907577,
- 1450815602,
- 3165620655,
- 3734664991,
- 3650291728,
- 3012275730,
- 3704569646,
- 1427272223,
- 778793252,
- 1343938022,
- 2676280711,
- 2052605720,
- 1946737175,
- 3164576444,
- 3914038668,
- 3967478842,
- 3682934266,
- 1661551462,
- 3294938066,
- 4011595847,
- 840292616,
- 3712170807,
- 616741398,
- 312560963,
- 711312465,
- 1351876610,
- 322626781,
- 1910503582,
- 271666773,
- 2175563734,
- 1594956187,
- 70604529,
- 3617834859,
- 1007753275,
- 1495573769,
- 4069517037,
- 2549218298,
- 2663038764,
- 504708206,
- 2263041392,
- 3941167025,
- 2249088522,
- 1514023603,
- 1998579484,
- 1312622330,
- 694541497,
- 2582060303,
- 2151582166,
- 1382467621,
- 776784248,
- 2618340202,
- 3323268794,
- 2497899128,
- 2784771155,
- 503983604,
- 4076293799,
- 907881277,
- 423175695,
- 432175456,
- 1378068232,
- 4145222326,
- 3954048622,
- 3938656102,
- 3820766613,
- 2793130115,
- 2977904593,
- 26017576,
- 3274890735,
- 3194772133,
- 1700274565,
- 1756076034,
- 4006520079,
- 3677328699,
- 720338349,
- 1533947780,
- 354530856,
- 688349552,
- 3973924725,
- 1637815568,
- 332179504,
- 3949051286,
- 53804574,
- 2852348879,
- 3044236432,
- 1282449977,
- 3583942155,
- 3416972820,
- 4006381244,
- 1617046695,
- 2628476075,
- 3002303598,
- 1686838959,
- 431878346,
- 2686675385,
- 1700445008,
- 1080580658,
- 1009431731,
- 832498133,
- 3223435511,
- 2605976345,
- 2271191193,
- 2516031870,
- 1648197032,
- 4164389018,
- 2548247927,
- 300782431,
- 375919233,
- 238389289,
- 3353747414,
- 2531188641,
- 2019080857,
- 1475708069,
- 455242339,
- 2609103871,
- 448939670,
- 3451063019,
- 1395535956,
- 2413381860,
- 1841049896,
- 1491858159,
- 885456874,
- 4264095073,
- 4001119347,
- 1565136089,
- 3898914787,
- 1108368660,
- 540939232,
- 1173283510,
- 2745871338,
- 3681308437,
- 4207628240,
- 3343053890,
- 4016749493,
- 1699691293,
- 1103962373,
- 3625875870,
- 2256883143,
- 3830138730,
- 1031889488,
- 3479347698,
- 1535977030,
- 4236805024,
- 3251091107,
- 2132092099,
- 1774941330,
- 1199868427,
- 1452454533,
- 157007616,
- 2904115357,
- 342012276,
- 595725824,
- 1480756522,
- 206960106,
- 497939518,
- 591360097,
- 863170706,
- 2375253569,
- 3596610801,
- 1814182875,
- 2094937945,
- 3421402208,
- 1082520231,
- 3463918190,
- 2785509508,
- 435703966,
- 3908032597,
- 1641649973,
- 2842273706,
- 3305899714,
- 1510255612,
- 2148256476,
- 2655287854,
- 3276092548,
- 4258621189,
- 236887753,
- 3681803219,
- 274041037,
- 1734335097,
- 3815195456,
- 3317970021,
- 1899903192,
- 1026095262,
- 4050517792,
- 356393447,
- 2410691914,
- 3873677099,
- 3682840055
- ],
- [
- 3913112168,
- 2491498743,
- 4132185628,
- 2489919796,
- 1091903735,
- 1979897079,
- 3170134830,
- 3567386728,
- 3557303409,
- 857797738,
- 1136121015,
- 1342202287,
- 507115054,
- 2535736646,
- 337727348,
- 3213592640,
- 1301675037,
- 2528481711,
- 1895095763,
- 1721773893,
- 3216771564,
- 62756741,
- 2142006736,
- 835421444,
- 2531993523,
- 1442658625,
- 3659876326,
- 2882144922,
- 676362277,
- 1392781812,
- 170690266,
- 3921047035,
- 1759253602,
- 3611846912,
- 1745797284,
- 664899054,
- 1329594018,
- 3901205900,
- 3045908486,
- 2062866102,
- 2865634940,
- 3543621612,
- 3464012697,
- 1080764994,
- 553557557,
- 3656615353,
- 3996768171,
- 991055499,
- 499776247,
- 1265440854,
- 648242737,
- 3940784050,
- 980351604,
- 3713745714,
- 1749149687,
- 3396870395,
- 4211799374,
- 3640570775,
- 1161844396,
- 3125318951,
- 1431517754,
- 545492359,
- 4268468663,
- 3499529547,
- 1437099964,
- 2702547544,
- 3433638243,
- 2581715763,
- 2787789398,
- 1060185593,
- 1593081372,
- 2418618748,
- 4260947970,
- 69676912,
- 2159744348,
- 86519011,
- 2512459080,
- 3838209314,
- 1220612927,
- 3339683548,
- 133810670,
- 1090789135,
- 1078426020,
- 1569222167,
- 845107691,
- 3583754449,
- 4072456591,
- 1091646820,
- 628848692,
- 1613405280,
- 3757631651,
- 526609435,
- 236106946,
- 48312990,
- 2942717905,
- 3402727701,
- 1797494240,
- 859738849,
- 992217954,
- 4005476642,
- 2243076622,
- 3870952857,
- 3732016268,
- 765654824,
- 3490871365,
- 2511836413,
- 1685915746,
- 3888969200,
- 1414112111,
- 2273134842,
- 3281911079,
- 4080962846,
- 172450625,
- 2569994100,
- 980381355,
- 4109958455,
- 2819808352,
- 2716589560,
- 2568741196,
- 3681446669,
- 3329971472,
- 1835478071,
- 660984891,
- 3704678404,
- 4045999559,
- 3422617507,
- 3040415634,
- 1762651403,
- 1719377915,
- 3470491036,
- 2693910283,
- 3642056355,
- 3138596744,
- 1364962596,
- 2073328063,
- 1983633131,
- 926494387,
- 3423689081,
- 2150032023,
- 4096667949,
- 1749200295,
- 3328846651,
- 309677260,
- 2016342300,
- 1779581495,
- 3079819751,
- 111262694,
- 1274766160,
- 443224088,
- 298511866,
- 1025883608,
- 3806446537,
- 1145181785,
- 168956806,
- 3641502830,
- 3584813610,
- 1689216846,
- 3666258015,
- 3200248200,
- 1692713982,
- 2646376535,
- 4042768518,
- 1618508792,
- 1610833997,
- 3523052358,
- 4130873264,
- 2001055236,
- 3610705100,
- 2202168115,
- 4028541809,
- 2961195399,
- 1006657119,
- 2006996926,
- 3186142756,
- 1430667929,
- 3210227297,
- 1314452623,
- 4074634658,
- 4101304120,
- 2273951170,
- 1399257539,
- 3367210612,
- 3027628629,
- 1190975929,
- 2062231137,
- 2333990788,
- 2221543033,
- 2438960610,
- 1181637006,
- 548689776,
- 2362791313,
- 3372408396,
- 3104550113,
- 3145860560,
- 296247880,
- 1970579870,
- 3078560182,
- 3769228297,
- 1714227617,
- 3291629107,
- 3898220290,
- 166772364,
- 1251581989,
- 493813264,
- 448347421,
- 195405023,
- 2709975567,
- 677966185,
- 3703036547,
- 1463355134,
- 2715995803,
- 1338867538,
- 1343315457,
- 2802222074,
- 2684532164,
- 233230375,
- 2599980071,
- 2000651841,
- 3277868038,
- 1638401717,
- 4028070440,
- 3237316320,
- 6314154,
- 819756386,
- 300326615,
- 590932579,
- 1405279636,
- 3267499572,
- 3150704214,
- 2428286686,
- 3959192993,
- 3461946742,
- 1862657033,
- 1266418056,
- 963775037,
- 2089974820,
- 2263052895,
- 1917689273,
- 448879540,
- 3550394620,
- 3981727096,
- 150775221,
- 3627908307,
- 1303187396,
- 508620638,
- 2975983352,
- 2726630617,
- 1817252668,
- 1876281319,
- 1457606340,
- 908771278,
- 3720792119,
- 3617206836,
- 2455994898,
- 1729034894,
- 1080033504
- ],
- [
- 976866871,
- 3556439503,
- 2881648439,
- 1522871579,
- 1555064734,
- 1336096578,
- 3548522304,
- 2579274686,
- 3574697629,
- 3205460757,
- 3593280638,
- 3338716283,
- 3079412587,
- 564236357,
- 2993598910,
- 1781952180,
- 1464380207,
- 3163844217,
- 3332601554,
- 1699332808,
- 1393555694,
- 1183702653,
- 3581086237,
- 1288719814,
- 691649499,
- 2847557200,
- 2895455976,
- 3193889540,
- 2717570544,
- 1781354906,
- 1676643554,
- 2592534050,
- 3230253752,
- 1126444790,
- 2770207658,
- 2633158820,
- 2210423226,
- 2615765581,
- 2414155088,
- 3127139286,
- 673620729,
- 2805611233,
- 1269405062,
- 4015350505,
- 3341807571,
- 4149409754,
- 1057255273,
- 2012875353,
- 2162469141,
- 2276492801,
- 2601117357,
- 993977747,
- 3918593370,
- 2654263191,
- 753973209,
- 36408145,
- 2530585658,
- 25011837,
- 3520020182,
- 2088578344,
- 530523599,
- 2918365339,
- 1524020338,
- 1518925132,
- 3760827505,
- 3759777254,
- 1202760957,
- 3985898139,
- 3906192525,
- 674977740,
- 4174734889,
- 2031300136,
- 2019492241,
- 3983892565,
- 4153806404,
- 3822280332,
- 352677332,
- 2297720250,
- 60907813,
- 90501309,
- 3286998549,
- 1016092578,
- 2535922412,
- 2839152426,
- 457141659,
- 509813237,
- 4120667899,
- 652014361,
- 1966332200,
- 2975202805,
- 55981186,
- 2327461051,
- 676427537,
- 3255491064,
- 2882294119,
- 3433927263,
- 1307055953,
- 942726286,
- 933058658,
- 2468411793,
- 3933900994,
- 4215176142,
- 1361170020,
- 2001714738,
- 2830558078,
- 3274259782,
- 1222529897,
- 1679025792,
- 2729314320,
- 3714953764,
- 1770335741,
- 151462246,
- 3013232138,
- 1682292957,
- 1483529935,
- 471910574,
- 1539241949,
- 458788160,
- 3436315007,
- 1807016891,
- 3718408830,
- 978976581,
- 1043663428,
- 3165965781,
- 1927990952,
- 4200891579,
- 2372276910,
- 3208408903,
- 3533431907,
- 1412390302,
- 2931980059,
- 4132332400,
- 1947078029,
- 3881505623,
- 4168226417,
- 2941484381,
- 1077988104,
- 1320477388,
- 886195818,
- 18198404,
- 3786409e3,
- 2509781533,
- 112762804,
- 3463356488,
- 1866414978,
- 891333506,
- 18488651,
- 661792760,
- 1628790961,
- 3885187036,
- 3141171499,
- 876946877,
- 2693282273,
- 1372485963,
- 791857591,
- 2686433993,
- 3759982718,
- 3167212022,
- 3472953795,
- 2716379847,
- 445679433,
- 3561995674,
- 3504004811,
- 3574258232,
- 54117162,
- 3331405415,
- 2381918588,
- 3769707343,
- 4154350007,
- 1140177722,
- 4074052095,
- 668550556,
- 3214352940,
- 367459370,
- 261225585,
- 2610173221,
- 4209349473,
- 3468074219,
- 3265815641,
- 314222801,
- 3066103646,
- 3808782860,
- 282218597,
- 3406013506,
- 3773591054,
- 379116347,
- 1285071038,
- 846784868,
- 2669647154,
- 3771962079,
- 3550491691,
- 2305946142,
- 453669953,
- 1268987020,
- 3317592352,
- 3279303384,
- 3744833421,
- 2610507566,
- 3859509063,
- 266596637,
- 3847019092,
- 517658769,
- 3462560207,
- 3443424879,
- 370717030,
- 4247526661,
- 2224018117,
- 4143653529,
- 4112773975,
- 2788324899,
- 2477274417,
- 1456262402,
- 2901442914,
- 1517677493,
- 1846949527,
- 2295493580,
- 3734397586,
- 2176403920,
- 1280348187,
- 1908823572,
- 3871786941,
- 846861322,
- 1172426758,
- 3287448474,
- 3383383037,
- 1655181056,
- 3139813346,
- 901632758,
- 1897031941,
- 2986607138,
- 3066810236,
- 3447102507,
- 1393639104,
- 373351379,
- 950779232,
- 625454576,
- 3124240540,
- 4148612726,
- 2007998917,
- 544563296,
- 2244738638,
- 2330496472,
- 2058025392,
- 1291430526,
- 424198748,
- 50039436,
- 29584100,
- 3605783033,
- 2429876329,
- 2791104160,
- 1057563949,
- 3255363231,
- 3075367218,
- 3463963227,
- 1469046755,
- 985887462
- ]
- ];
- var BLOWFISH_CTX = {
- pbox: [],
- sbox: []
- };
- function F(ctx, x) {
- let a = x >> 24 & 255;
- let b = x >> 16 & 255;
- let c = x >> 8 & 255;
- let d = x & 255;
- let y = ctx.sbox[0][a] + ctx.sbox[1][b];
- y = y ^ ctx.sbox[2][c];
- y = y + ctx.sbox[3][d];
- return y;
- }
- function BlowFish_Encrypt(ctx, left, right) {
- let Xl = left;
- let Xr = right;
- let temp;
- for (let i = 0; i < N; ++i) {
- Xl = Xl ^ ctx.pbox[i];
- Xr = F(ctx, Xl) ^ Xr;
- temp = Xl;
- Xl = Xr;
- Xr = temp;
- }
- temp = Xl;
- Xl = Xr;
- Xr = temp;
- Xr = Xr ^ ctx.pbox[N];
- Xl = Xl ^ ctx.pbox[N + 1];
- return { left: Xl, right: Xr };
- }
- function BlowFish_Decrypt(ctx, left, right) {
- let Xl = left;
- let Xr = right;
- let temp;
- for (let i = N + 1; i > 1; --i) {
- Xl = Xl ^ ctx.pbox[i];
- Xr = F(ctx, Xl) ^ Xr;
- temp = Xl;
- Xl = Xr;
- Xr = temp;
- }
- temp = Xl;
- Xl = Xr;
- Xr = temp;
- Xr = Xr ^ ctx.pbox[1];
- Xl = Xl ^ ctx.pbox[0];
- return { left: Xl, right: Xr };
- }
- function BlowFishInit(ctx, key, keysize) {
- for (let Row = 0; Row < 4; Row++) {
- ctx.sbox[Row] = [];
- for (let Col = 0; Col < 256; Col++) {
- ctx.sbox[Row][Col] = ORIG_S[Row][Col];
- }
- }
- let keyIndex = 0;
- for (let index2 = 0; index2 < N + 2; index2++) {
- ctx.pbox[index2] = ORIG_P[index2] ^ key[keyIndex];
- keyIndex++;
- if (keyIndex >= keysize) {
- keyIndex = 0;
- }
- }
- let Data1 = 0;
- let Data2 = 0;
- let res = 0;
- for (let i = 0; i < N + 2; i += 2) {
- res = BlowFish_Encrypt(ctx, Data1, Data2);
- Data1 = res.left;
- Data2 = res.right;
- ctx.pbox[i] = Data1;
- ctx.pbox[i + 1] = Data2;
- }
- for (let i = 0; i < 4; i++) {
- for (let j = 0; j < 256; j += 2) {
- res = BlowFish_Encrypt(ctx, Data1, Data2);
- Data1 = res.left;
- Data2 = res.right;
- ctx.sbox[i][j] = Data1;
- ctx.sbox[i][j + 1] = Data2;
- }
- }
- return true;
- }
- var Blowfish = C_algo.Blowfish = BlockCipher.extend({
- _doReset: function() {
- if (this._keyPriorReset === this._key) {
- return;
- }
- var key = this._keyPriorReset = this._key;
- var keyWords = key.words;
- var keySize = key.sigBytes / 4;
- BlowFishInit(BLOWFISH_CTX, keyWords, keySize);
- },
- encryptBlock: function(M, offset) {
- var res = BlowFish_Encrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);
- M[offset] = res.left;
- M[offset + 1] = res.right;
- },
- decryptBlock: function(M, offset) {
- var res = BlowFish_Decrypt(BLOWFISH_CTX, M[offset], M[offset + 1]);
- M[offset] = res.left;
- M[offset + 1] = res.right;
- },
- blockSize: 64 / 32,
- keySize: 128 / 32,
- ivSize: 64 / 32
- });
- C.Blowfish = BlockCipher._createHelper(Blowfish);
- })();
- return CryptoJS.Blowfish;
- });
- })(blowfish);
- return blowfish.exports;
- }
- (function(module, exports) {
- (function(root, factory, undef) {
- {
- module.exports = factory(requireCore(), requireX64Core(), requireLibTypedarrays(), requireEncUtf16(), requireEncBase64(), requireEncBase64url(), requireMd5(), requireSha1(), requireSha256(), requireSha224(), requireSha512(), requireSha384(), requireSha3(), requireRipemd160(), requireHmac(), requirePbkdf2(), requireEvpkdf(), requireCipherCore(), requireModeCfb(), requireModeCtr(), requireModeCtrGladman(), requireModeOfb(), requireModeEcb(), requirePadAnsix923(), requirePadIso10126(), requirePadIso97971(), requirePadZeropadding(), requirePadNopadding(), requireFormatHex(), requireAes(), requireTripledes(), requireRc4(), requireRabbit(), requireRabbitLegacy(), requireBlowfish());
- }
- })(commonjsGlobal, function(CryptoJS) {
- return CryptoJS;
- });
- })(cryptoJs);
- var cryptoJsExports = cryptoJs.exports;
- var stateEncrypt = (state, key) => {
- return key ? cryptoJsExports.AES.encrypt(JSON.stringify(state), key).toString() : JSON.stringify(state);
- };
- var storageSet = (store, storage, encryptionKey, keys) => {
- if (!keys) {
- const state = stateEncrypt(store.$state, encryptionKey);
- storage.setItem(store.$id, state);
- } else {
- const state = {};
- keys.forEach((key) => {
- const value = store.$state[key];
- if (value !== void 0 && value !== null) {
- state[key] = store.$state[key];
- } else {
- console.warn("Persist key not found", key, store.$id);
- }
- });
- storage.setItem(store.$id, stateEncrypt(state, encryptionKey));
- }
- };
- var storageSync = (store, storage, oldState, encryptionKey, keys) => {
- if (oldState) {
- let stateObj;
- if (encryptionKey) {
- const bytes = cryptoJsExports.AES.decrypt(oldState, encryptionKey);
- const originalText = bytes.toString(cryptoJsExports.enc.Utf8);
- stateObj = JSON.parse(originalText);
- } else {
- stateObj = JSON.parse(oldState);
- }
- if (!keys) {
- store.$patch(stateObj);
- } else {
- keys.forEach((key) => {
- store.$patch((state) => {
- if ((state == null ? void 0 : state[key]) !== void 0 && (state == null ? void 0 : state[key]) !== null) {
- state[key] = stateObj[key];
- } else {
- console.warn(`${store.$id} not found key ${key}`);
- }
- });
- });
- }
- } else {
- storageSet(store, storage, encryptionKey, keys);
- }
- };
- function usePersist({ store, options: { persist } }) {
- if (persist == null ? void 0 : persist.enabled) {
- if (persist.keys && !Array.isArray(persist.keys)) {
- console.warn("Persist keys is String[]", store.$id);
- }
- const keys = persist == null ? void 0 : persist.keys;
- const storage = (persist == null ? void 0 : persist.storage) || localStorage;
- const encryptionKey = persist == null ? void 0 : persist.encryptionKey;
- try {
- const oldState = storage.getItem(store.$id);
- storageSync(store, storage, oldState, encryptionKey, keys);
- } catch (error) {
- console.error("Persist error", error);
- }
- store.$subscribe(() => {
- storageSet(store, storage, encryptionKey, keys);
- }, {
- detached: (persist == null ? void 0 : persist.detached) || true,
- deep: true
- });
- }
- }
- const base = "";
- const index$6 = "";
- const index$5 = "";
- const index$4 = "";
- const index$3 = "";
- const index$2 = "";
- const index$1 = "";
- const index = "";
- const app = createApp(App);
- app.use(router);
- const pinia = createPinia();
- pinia.use(usePersist);
- app.use(pinia);
- app.mount("#app");
- export {
- useStoreOfUserInfo as A,
- unref as B,
- createCommentVNode as C,
- commonjsGlobal as D,
- getDefaultExportFromCjs as E,
- Fragment as F,
- onUnmounted as G,
- defineStore as H,
- createStaticVNode as I,
- createSlots as J,
- KeepAlive as K,
- Transition as L,
- onBeforeUnmount as M,
- resolveDirective as N,
- normalizeStyle as O,
- renderSlot as P,
- refreshCurrentRoute as Q,
- withKeys as R,
- watchEffect as S,
- Teleport as T,
- provide as U,
- onDeactivated as V,
- createApp as W,
- inject as X,
- isRef as Y,
- isVNode as Z,
- _export_sfc as _,
- computed as a,
- createElementBlock as b,
- createVNode as c,
- defineComponent as d,
- createBaseVNode as e,
- withCtx as f,
- getCurrentInstance as g,
- withDirectives as h,
- resolveComponent as i,
- openBlock as j,
- createBlock as k,
- resolveDynamicComponent as l,
- mergeProps as m,
- reactive as n,
- onMounted as o,
- onActivated as p,
- onBeforeRouteLeave as q,
- ref as r,
- createTextVNode as s,
- toDisplayString as t,
- useRouter as u,
- vShow as v,
- watch as w,
- renderList as x,
- withModifiers as y,
- nextTick as z
- };
|