index.js 450 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817
  1. import {getServerConf} from "./ljw.js?v=6"
  2. import {F as $t, J as Yt, L as Re, l as P4, m as r, P as ua, s as Xt, z as H4} from "./vendor.js?v=0b990c6e";
  3. import {ids as langIds, lang} from './lang.js?v=6'
  4. var Zt = Object.defineProperty;
  5. var Qt = (u, e, i) => e in u ? Zt(u, e, {enumerable: !0, configurable: !0, writable: !0, value: i}) : u[e] = i;
  6. var d = (u, e, i) => (Qt(u, typeof e != "symbol" ? e + "" : e, i), i), Y4 = (u, e, i) => {
  7. if (!e.has(u)) throw TypeError("Cannot " + i)
  8. };
  9. var g = (u, e, i) => (Y4(u, e, "read from private field"), i ? i.call(u) : e.get(u)), pu = (u, e, i) => {
  10. if (e.has(u)) throw TypeError("Cannot add the same private member more than once");
  11. e instanceof WeakSet ? e.add(u) : e.set(u, i)
  12. }, C4 = (u, e, i, o) => (Y4(u, e, "write to private field"), o ? o.call(u, i) : e.set(u, i), i), ze = (u, e, i, o) => ({
  13. set _(a) {
  14. C4(u, e, a, i)
  15. }, get _() {
  16. return g(u, e, o)
  17. }
  18. }), Pe = (u, e, i) => (Y4(u, e, "access private method"), i);
  19. const ea = function () {
  20. const e = document.createElement("link").relList;
  21. if (e && e.supports && e.supports("modulepreload")) return;
  22. for (const a of document.querySelectorAll('link[rel="modulepreload"]')) o(a);
  23. new MutationObserver(a => {
  24. for (const t of a) if (t.type === "childList") for (const s of t.addedNodes) s.tagName === "LINK" && s.rel === "modulepreload" && o(s)
  25. }).observe(document, {childList: !0, subtree: !0});
  26. function i(a) {
  27. const t = {};
  28. return a.integrity && (t.integrity = a.integrity), a.referrerpolicy && (t.referrerPolicy = a.referrerpolicy), a.crossorigin === "use-credentials" ? t.credentials = "include" : a.crossorigin === "anonymous" ? t.credentials = "omit" : t.credentials = "same-origin", t
  29. }
  30. function o(a) {
  31. if (a.ep) return;
  32. a.ep = !0;
  33. const t = i(a);
  34. fetch(a.href, t)
  35. }
  36. };
  37. ea();
  38. var ie = (u => (u[u.I420 = 0] = "I420", u[u.I444 = 1] = "I444", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ie || {});
  39. function ia(u) {
  40. switch (u) {
  41. case 0:
  42. case"I420":
  43. return 0;
  44. case 1:
  45. case"I444":
  46. return 1;
  47. case-1:
  48. case"UNRECOGNIZED":
  49. default:
  50. return -1
  51. }
  52. }
  53. function ta(u) {
  54. switch (u) {
  55. case 0:
  56. return "I420";
  57. case 1:
  58. return "I444";
  59. case-1:
  60. default:
  61. return "UNRECOGNIZED"
  62. }
  63. }
  64. var c4 = (u => (u[u.Legacy = 0] = "Legacy", u[u.Map = 1] = "Map", u[u.Translate = 2] = "Translate", u[u.Auto = 3] = "Auto", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(c4 || {});
  65. function aa(u) {
  66. switch (u) {
  67. case 0:
  68. case"Legacy":
  69. return 0;
  70. case 1:
  71. case"Map":
  72. return 1;
  73. case 2:
  74. case"Translate":
  75. return 2;
  76. case 3:
  77. case"Auto":
  78. return 3;
  79. case-1:
  80. case"UNRECOGNIZED":
  81. default:
  82. return -1
  83. }
  84. }
  85. function oa(u) {
  86. switch (u) {
  87. case 0:
  88. return "Legacy";
  89. case 1:
  90. return "Map";
  91. case 2:
  92. return "Translate";
  93. case 3:
  94. return "Auto";
  95. case-1:
  96. default:
  97. return "UNRECOGNIZED"
  98. }
  99. }
  100. var N = (u => (u[u.Unknown = 0] = "Unknown", u[u.Alt = 1] = "Alt", u[u.Backspace = 2] = "Backspace", u[u.CapsLock = 3] = "CapsLock", u[u.Control = 4] = "Control", u[u.Delete = 5] = "Delete", u[u.DownArrow = 6] = "DownArrow", u[u.End = 7] = "End", u[u.Escape = 8] = "Escape", u[u.F1 = 9] = "F1", u[u.F10 = 10] = "F10", u[u.F11 = 11] = "F11", u[u.F12 = 12] = "F12", u[u.F2 = 13] = "F2", u[u.F3 = 14] = "F3", u[u.F4 = 15] = "F4", u[u.F5 = 16] = "F5", u[u.F6 = 17] = "F6", u[u.F7 = 18] = "F7", u[u.F8 = 19] = "F8", u[u.F9 = 20] = "F9", u[u.Home = 21] = "Home", u[u.LeftArrow = 22] = "LeftArrow", u[u.Meta = 23] = "Meta", u[u.Option = 24] = "Option", u[u.PageDown = 25] = "PageDown", u[u.PageUp = 26] = "PageUp", u[u.Return = 27] = "Return", u[u.RightArrow = 28] = "RightArrow", u[u.Shift = 29] = "Shift", u[u.Space = 30] = "Space", u[u.Tab = 31] = "Tab", u[u.UpArrow = 32] = "UpArrow", u[u.Numpad0 = 33] = "Numpad0", u[u.Numpad1 = 34] = "Numpad1", u[u.Numpad2 = 35] = "Numpad2", u[u.Numpad3 = 36] = "Numpad3", u[u.Numpad4 = 37] = "Numpad4", u[u.Numpad5 = 38] = "Numpad5", u[u.Numpad6 = 39] = "Numpad6", u[u.Numpad7 = 40] = "Numpad7", u[u.Numpad8 = 41] = "Numpad8", u[u.Numpad9 = 42] = "Numpad9", u[u.Cancel = 43] = "Cancel", u[u.Clear = 44] = "Clear", u[u.Menu = 45] = "Menu", u[u.Pause = 46] = "Pause", u[u.Kana = 47] = "Kana", u[u.Hangul = 48] = "Hangul", u[u.Junja = 49] = "Junja", u[u.Final = 50] = "Final", u[u.Hanja = 51] = "Hanja", u[u.Kanji = 52] = "Kanji", u[u.Convert = 53] = "Convert", u[u.Select = 54] = "Select", u[u.Print = 55] = "Print", u[u.Execute = 56] = "Execute", u[u.Snapshot = 57] = "Snapshot", u[u.Insert = 58] = "Insert", u[u.Help = 59] = "Help", u[u.Sleep = 60] = "Sleep", u[u.Separator = 61] = "Separator", u[u.Scroll = 62] = "Scroll", u[u.NumLock = 63] = "NumLock", u[u.RWin = 64] = "RWin", u[u.Apps = 65] = "Apps", u[u.Multiply = 66] = "Multiply", u[u.Add = 67] = "Add", u[u.Subtract = 68] = "Subtract", u[u.Decimal = 69] = "Decimal", u[u.Divide = 70] = "Divide", u[u.Equals = 71] = "Equals", u[u.NumpadEnter = 72] = "NumpadEnter", u[u.RShift = 73] = "RShift", u[u.RControl = 74] = "RControl", u[u.RAlt = 75] = "RAlt", u[u.VolumeMute = 76] = "VolumeMute", u[u.VolumeUp = 77] = "VolumeUp", u[u.VolumeDown = 78] = "VolumeDown", u[u.Power = 79] = "Power", u[u.CtrlAltDel = 100] = "CtrlAltDel", u[u.LockScreen = 101] = "LockScreen", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(N || {});
  101. function A4(u) {
  102. switch (u) {
  103. case 0:
  104. case"Unknown":
  105. return 0;
  106. case 1:
  107. case"Alt":
  108. return 1;
  109. case 2:
  110. case"Backspace":
  111. return 2;
  112. case 3:
  113. case"CapsLock":
  114. return 3;
  115. case 4:
  116. case"Control":
  117. return 4;
  118. case 5:
  119. case"Delete":
  120. return 5;
  121. case 6:
  122. case"DownArrow":
  123. return 6;
  124. case 7:
  125. case"End":
  126. return 7;
  127. case 8:
  128. case"Escape":
  129. return 8;
  130. case 9:
  131. case"F1":
  132. return 9;
  133. case 10:
  134. case"F10":
  135. return 10;
  136. case 11:
  137. case"F11":
  138. return 11;
  139. case 12:
  140. case"F12":
  141. return 12;
  142. case 13:
  143. case"F2":
  144. return 13;
  145. case 14:
  146. case"F3":
  147. return 14;
  148. case 15:
  149. case"F4":
  150. return 15;
  151. case 16:
  152. case"F5":
  153. return 16;
  154. case 17:
  155. case"F6":
  156. return 17;
  157. case 18:
  158. case"F7":
  159. return 18;
  160. case 19:
  161. case"F8":
  162. return 19;
  163. case 20:
  164. case"F9":
  165. return 20;
  166. case 21:
  167. case"Home":
  168. return 21;
  169. case 22:
  170. case"LeftArrow":
  171. return 22;
  172. case 23:
  173. case"Meta":
  174. return 23;
  175. case 24:
  176. case"Option":
  177. return 24;
  178. case 25:
  179. case"PageDown":
  180. return 25;
  181. case 26:
  182. case"PageUp":
  183. return 26;
  184. case 27:
  185. case"Return":
  186. return 27;
  187. case 28:
  188. case"RightArrow":
  189. return 28;
  190. case 29:
  191. case"Shift":
  192. return 29;
  193. case 30:
  194. case"Space":
  195. return 30;
  196. case 31:
  197. case"Tab":
  198. return 31;
  199. case 32:
  200. case"UpArrow":
  201. return 32;
  202. case 33:
  203. case"Numpad0":
  204. return 33;
  205. case 34:
  206. case"Numpad1":
  207. return 34;
  208. case 35:
  209. case"Numpad2":
  210. return 35;
  211. case 36:
  212. case"Numpad3":
  213. return 36;
  214. case 37:
  215. case"Numpad4":
  216. return 37;
  217. case 38:
  218. case"Numpad5":
  219. return 38;
  220. case 39:
  221. case"Numpad6":
  222. return 39;
  223. case 40:
  224. case"Numpad7":
  225. return 40;
  226. case 41:
  227. case"Numpad8":
  228. return 41;
  229. case 42:
  230. case"Numpad9":
  231. return 42;
  232. case 43:
  233. case"Cancel":
  234. return 43;
  235. case 44:
  236. case"Clear":
  237. return 44;
  238. case 45:
  239. case"Menu":
  240. return 45;
  241. case 46:
  242. case"Pause":
  243. return 46;
  244. case 47:
  245. case"Kana":
  246. return 47;
  247. case 48:
  248. case"Hangul":
  249. return 48;
  250. case 49:
  251. case"Junja":
  252. return 49;
  253. case 50:
  254. case"Final":
  255. return 50;
  256. case 51:
  257. case"Hanja":
  258. return 51;
  259. case 52:
  260. case"Kanji":
  261. return 52;
  262. case 53:
  263. case"Convert":
  264. return 53;
  265. case 54:
  266. case"Select":
  267. return 54;
  268. case 55:
  269. case"Print":
  270. return 55;
  271. case 56:
  272. case"Execute":
  273. return 56;
  274. case 57:
  275. case"Snapshot":
  276. return 57;
  277. case 58:
  278. case"Insert":
  279. return 58;
  280. case 59:
  281. case"Help":
  282. return 59;
  283. case 60:
  284. case"Sleep":
  285. return 60;
  286. case 61:
  287. case"Separator":
  288. return 61;
  289. case 62:
  290. case"Scroll":
  291. return 62;
  292. case 63:
  293. case"NumLock":
  294. return 63;
  295. case 64:
  296. case"RWin":
  297. return 64;
  298. case 65:
  299. case"Apps":
  300. return 65;
  301. case 66:
  302. case"Multiply":
  303. return 66;
  304. case 67:
  305. case"Add":
  306. return 67;
  307. case 68:
  308. case"Subtract":
  309. return 68;
  310. case 69:
  311. case"Decimal":
  312. return 69;
  313. case 70:
  314. case"Divide":
  315. return 70;
  316. case 71:
  317. case"Equals":
  318. return 71;
  319. case 72:
  320. case"NumpadEnter":
  321. return 72;
  322. case 73:
  323. case"RShift":
  324. return 73;
  325. case 74:
  326. case"RControl":
  327. return 74;
  328. case 75:
  329. case"RAlt":
  330. return 75;
  331. case 76:
  332. case"VolumeMute":
  333. return 76;
  334. case 77:
  335. case"VolumeUp":
  336. return 77;
  337. case 78:
  338. case"VolumeDown":
  339. return 78;
  340. case 79:
  341. case"Power":
  342. return 79;
  343. case 100:
  344. case"CtrlAltDel":
  345. return 100;
  346. case 101:
  347. case"LockScreen":
  348. return 101;
  349. case-1:
  350. case"UNRECOGNIZED":
  351. default:
  352. return -1
  353. }
  354. }
  355. function R4(u) {
  356. switch (u) {
  357. case 0:
  358. return "Unknown";
  359. case 1:
  360. return "Alt";
  361. case 2:
  362. return "Backspace";
  363. case 3:
  364. return "CapsLock";
  365. case 4:
  366. return "Control";
  367. case 5:
  368. return "Delete";
  369. case 6:
  370. return "DownArrow";
  371. case 7:
  372. return "End";
  373. case 8:
  374. return "Escape";
  375. case 9:
  376. return "F1";
  377. case 10:
  378. return "F10";
  379. case 11:
  380. return "F11";
  381. case 12:
  382. return "F12";
  383. case 13:
  384. return "F2";
  385. case 14:
  386. return "F3";
  387. case 15:
  388. return "F4";
  389. case 16:
  390. return "F5";
  391. case 17:
  392. return "F6";
  393. case 18:
  394. return "F7";
  395. case 19:
  396. return "F8";
  397. case 20:
  398. return "F9";
  399. case 21:
  400. return "Home";
  401. case 22:
  402. return "LeftArrow";
  403. case 23:
  404. return "Meta";
  405. case 24:
  406. return "Option";
  407. case 25:
  408. return "PageDown";
  409. case 26:
  410. return "PageUp";
  411. case 27:
  412. return "Return";
  413. case 28:
  414. return "RightArrow";
  415. case 29:
  416. return "Shift";
  417. case 30:
  418. return "Space";
  419. case 31:
  420. return "Tab";
  421. case 32:
  422. return "UpArrow";
  423. case 33:
  424. return "Numpad0";
  425. case 34:
  426. return "Numpad1";
  427. case 35:
  428. return "Numpad2";
  429. case 36:
  430. return "Numpad3";
  431. case 37:
  432. return "Numpad4";
  433. case 38:
  434. return "Numpad5";
  435. case 39:
  436. return "Numpad6";
  437. case 40:
  438. return "Numpad7";
  439. case 41:
  440. return "Numpad8";
  441. case 42:
  442. return "Numpad9";
  443. case 43:
  444. return "Cancel";
  445. case 44:
  446. return "Clear";
  447. case 45:
  448. return "Menu";
  449. case 46:
  450. return "Pause";
  451. case 47:
  452. return "Kana";
  453. case 48:
  454. return "Hangul";
  455. case 49:
  456. return "Junja";
  457. case 50:
  458. return "Final";
  459. case 51:
  460. return "Hanja";
  461. case 52:
  462. return "Kanji";
  463. case 53:
  464. return "Convert";
  465. case 54:
  466. return "Select";
  467. case 55:
  468. return "Print";
  469. case 56:
  470. return "Execute";
  471. case 57:
  472. return "Snapshot";
  473. case 58:
  474. return "Insert";
  475. case 59:
  476. return "Help";
  477. case 60:
  478. return "Sleep";
  479. case 61:
  480. return "Separator";
  481. case 62:
  482. return "Scroll";
  483. case 63:
  484. return "NumLock";
  485. case 64:
  486. return "RWin";
  487. case 65:
  488. return "Apps";
  489. case 66:
  490. return "Multiply";
  491. case 67:
  492. return "Add";
  493. case 68:
  494. return "Subtract";
  495. case 69:
  496. return "Decimal";
  497. case 70:
  498. return "Divide";
  499. case 71:
  500. return "Equals";
  501. case 72:
  502. return "NumpadEnter";
  503. case 73:
  504. return "RShift";
  505. case 74:
  506. return "RControl";
  507. case 75:
  508. return "RAlt";
  509. case 76:
  510. return "VolumeMute";
  511. case 77:
  512. return "VolumeUp";
  513. case 78:
  514. return "VolumeDown";
  515. case 79:
  516. return "Power";
  517. case 100:
  518. return "CtrlAltDel";
  519. case 101:
  520. return "LockScreen";
  521. case-1:
  522. default:
  523. return "UNRECOGNIZED"
  524. }
  525. }
  526. var du = (u => (u[u.Text = 0] = "Text", u[u.Rtf = 1] = "Rtf", u[u.Html = 2] = "Html", u[u.ImageRgba = 21] = "ImageRgba", u[u.ImagePng = 22] = "ImagePng", u[u.ImageSvg = 23] = "ImageSvg", u[u.Special = 31] = "Special", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(du || {});
  527. function na(u) {
  528. switch (u) {
  529. case 0:
  530. case"Text":
  531. return 0;
  532. case 1:
  533. case"Rtf":
  534. return 1;
  535. case 2:
  536. case"Html":
  537. return 2;
  538. case 21:
  539. case"ImageRgba":
  540. return 21;
  541. case 22:
  542. case"ImagePng":
  543. return 22;
  544. case 23:
  545. case"ImageSvg":
  546. return 23;
  547. case 31:
  548. case"Special":
  549. return 31;
  550. case-1:
  551. case"UNRECOGNIZED":
  552. default:
  553. return -1
  554. }
  555. }
  556. function ra(u) {
  557. switch (u) {
  558. case 0:
  559. return "Text";
  560. case 1:
  561. return "Rtf";
  562. case 2:
  563. return "Html";
  564. case 21:
  565. return "ImageRgba";
  566. case 22:
  567. return "ImagePng";
  568. case 23:
  569. return "ImageSvg";
  570. case 31:
  571. return "Special";
  572. case-1:
  573. default:
  574. return "UNRECOGNIZED"
  575. }
  576. }
  577. function sa(u) {
  578. switch (u) {
  579. case 0:
  580. case"Dir":
  581. return 0;
  582. case 2:
  583. case"DirLink":
  584. return 2;
  585. case 3:
  586. case"DirDrive":
  587. return 3;
  588. case 4:
  589. case"File":
  590. return 4;
  591. case 5:
  592. case"FileLink":
  593. return 5;
  594. case-1:
  595. case"UNRECOGNIZED":
  596. default:
  597. return -1
  598. }
  599. }
  600. function la(u) {
  601. switch (u) {
  602. case 0:
  603. return "Dir";
  604. case 2:
  605. return "DirLink";
  606. case 3:
  607. return "DirDrive";
  608. case 4:
  609. return "File";
  610. case 5:
  611. return "FileLink";
  612. case-1:
  613. default:
  614. return "UNRECOGNIZED"
  615. }
  616. }
  617. var x4 = (u => (u[u.NotSet = 0] = "NotSet", u[u.Low = 2] = "Low", u[u.Balanced = 3] = "Balanced", u[u.Best = 4] = "Best", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(x4 || {});
  618. function Ea(u) {
  619. switch (u) {
  620. case 0:
  621. case"NotSet":
  622. return 0;
  623. case 2:
  624. case"Low":
  625. return 2;
  626. case 3:
  627. case"Balanced":
  628. return 3;
  629. case 4:
  630. case"Best":
  631. return 4;
  632. case-1:
  633. case"UNRECOGNIZED":
  634. default:
  635. return -1
  636. }
  637. }
  638. function da(u) {
  639. switch (u) {
  640. case 0:
  641. return "NotSet";
  642. case 2:
  643. return "Low";
  644. case 3:
  645. return "Balanced";
  646. case 4:
  647. return "Best";
  648. case-1:
  649. default:
  650. return "UNRECOGNIZED"
  651. }
  652. }
  653. var i0 = (u => (u[u.Keyboard = 0] = "Keyboard", u[u.Clipboard = 2] = "Clipboard", u[u.Audio = 3] = "Audio", u[u.File = 4] = "File", u[u.Restart = 5] = "Restart", u[u.Recording = 6] = "Recording", u[u.BlockInput = 7] = "BlockInput", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(i0 || {});
  654. function ca(u) {
  655. switch (u) {
  656. case 0:
  657. case"Keyboard":
  658. return 0;
  659. case 2:
  660. case"Clipboard":
  661. return 2;
  662. case 3:
  663. case"Audio":
  664. return 3;
  665. case 4:
  666. case"File":
  667. return 4;
  668. case 5:
  669. case"Restart":
  670. return 5;
  671. case 6:
  672. case"Recording":
  673. return 6;
  674. case 7:
  675. case"BlockInput":
  676. return 7;
  677. case-1:
  678. case"UNRECOGNIZED":
  679. default:
  680. return -1
  681. }
  682. }
  683. function Ca(u) {
  684. switch (u) {
  685. case 0:
  686. return "Keyboard";
  687. case 2:
  688. return "Clipboard";
  689. case 3:
  690. return "Audio";
  691. case 4:
  692. return "File";
  693. case 5:
  694. return "Restart";
  695. case 6:
  696. return "Recording";
  697. case 7:
  698. return "BlockInput";
  699. case-1:
  700. default:
  701. return "UNRECOGNIZED"
  702. }
  703. }
  704. var mu = (u => (u[u.Auto = 0] = "Auto", u[u.VP9 = 1] = "VP9", u[u.H264 = 2] = "H264", u[u.H265 = 3] = "H265", u[u.VP8 = 4] = "VP8", u[u.AV1 = 5] = "AV1", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(mu || {});
  705. function pa(u) {
  706. switch (u) {
  707. case 0:
  708. case"Auto":
  709. return 0;
  710. case 1:
  711. case"VP9":
  712. return 1;
  713. case 2:
  714. case"H264":
  715. return 2;
  716. case 3:
  717. case"H265":
  718. return 3;
  719. case 4:
  720. case"VP8":
  721. return 4;
  722. case 5:
  723. case"AV1":
  724. return 5;
  725. case-1:
  726. case"UNRECOGNIZED":
  727. default:
  728. return -1
  729. }
  730. }
  731. function Da(u) {
  732. switch (u) {
  733. case 0:
  734. return "Auto";
  735. case 1:
  736. return "VP9";
  737. case 2:
  738. return "H264";
  739. case 3:
  740. return "H265";
  741. case 4:
  742. return "VP8";
  743. case 5:
  744. return "AV1";
  745. case-1:
  746. default:
  747. return "UNRECOGNIZED"
  748. }
  749. }
  750. var x = (u => (u[u.NotSet = 0] = "NotSet", u[u.No = 1] = "No", u[u.Yes = 2] = "Yes", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(x || {});
  751. function iu(u) {
  752. switch (u) {
  753. case 0:
  754. case"NotSet":
  755. return 0;
  756. case 1:
  757. case"No":
  758. return 1;
  759. case 2:
  760. case"Yes":
  761. return 2;
  762. case-1:
  763. case"UNRECOGNIZED":
  764. default:
  765. return -1
  766. }
  767. }
  768. function tu(u) {
  769. switch (u) {
  770. case 0:
  771. return "NotSet";
  772. case 1:
  773. return "No";
  774. case 2:
  775. return "Yes";
  776. case-1:
  777. default:
  778. return "UNRECOGNIZED"
  779. }
  780. }
  781. var D4 = (u => (u[u.BlkStateUnknown = 0] = "BlkStateUnknown", u[u.BlkOnSucceeded = 2] = "BlkOnSucceeded", u[u.BlkOnFailed = 3] = "BlkOnFailed", u[u.BlkOffSucceeded = 4] = "BlkOffSucceeded", u[u.BlkOffFailed = 5] = "BlkOffFailed", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(D4 || {});
  782. function Ba(u) {
  783. switch (u) {
  784. case 0:
  785. case"BlkStateUnknown":
  786. return 0;
  787. case 2:
  788. case"BlkOnSucceeded":
  789. return 2;
  790. case 3:
  791. case"BlkOnFailed":
  792. return 3;
  793. case 4:
  794. case"BlkOffSucceeded":
  795. return 4;
  796. case 5:
  797. case"BlkOffFailed":
  798. return 5;
  799. case-1:
  800. case"UNRECOGNIZED":
  801. default:
  802. return -1
  803. }
  804. }
  805. function Aa(u) {
  806. switch (u) {
  807. case 0:
  808. return "BlkStateUnknown";
  809. case 2:
  810. return "BlkOnSucceeded";
  811. case 3:
  812. return "BlkOnFailed";
  813. case 4:
  814. return "BlkOffSucceeded";
  815. case 5:
  816. return "BlkOffFailed";
  817. case-1:
  818. default:
  819. return "UNRECOGNIZED"
  820. }
  821. }
  822. var au = (u => (u[u.PrvStateUnknown = 0] = "PrvStateUnknown", u[u.PrvOnByOther = 2] = "PrvOnByOther", u[u.PrvNotSupported = 3] = "PrvNotSupported", u[u.PrvOnSucceeded = 4] = "PrvOnSucceeded", u[u.PrvOnFailedDenied = 5] = "PrvOnFailedDenied", u[u.PrvOnFailedPlugin = 6] = "PrvOnFailedPlugin", u[u.PrvOnFailed = 7] = "PrvOnFailed", u[u.PrvOffSucceeded = 8] = "PrvOffSucceeded", u[u.PrvOffByPeer = 9] = "PrvOffByPeer", u[u.PrvOffFailed = 10] = "PrvOffFailed", u[u.PrvOffUnknown = 11] = "PrvOffUnknown", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(au || {});
  823. function ma(u) {
  824. switch (u) {
  825. case 0:
  826. case"PrvStateUnknown":
  827. return 0;
  828. case 2:
  829. case"PrvOnByOther":
  830. return 2;
  831. case 3:
  832. case"PrvNotSupported":
  833. return 3;
  834. case 4:
  835. case"PrvOnSucceeded":
  836. return 4;
  837. case 5:
  838. case"PrvOnFailedDenied":
  839. return 5;
  840. case 6:
  841. case"PrvOnFailedPlugin":
  842. return 6;
  843. case 7:
  844. case"PrvOnFailed":
  845. return 7;
  846. case 8:
  847. case"PrvOffSucceeded":
  848. return 8;
  849. case 9:
  850. case"PrvOffByPeer":
  851. return 9;
  852. case 10:
  853. case"PrvOffFailed":
  854. return 10;
  855. case 11:
  856. case"PrvOffUnknown":
  857. return 11;
  858. case-1:
  859. case"UNRECOGNIZED":
  860. default:
  861. return -1
  862. }
  863. }
  864. function Fa(u) {
  865. switch (u) {
  866. case 0:
  867. return "PrvStateUnknown";
  868. case 2:
  869. return "PrvOnByOther";
  870. case 3:
  871. return "PrvNotSupported";
  872. case 4:
  873. return "PrvOnSucceeded";
  874. case 5:
  875. return "PrvOnFailedDenied";
  876. case 6:
  877. return "PrvOnFailedPlugin";
  878. case 7:
  879. return "PrvOnFailed";
  880. case 8:
  881. return "PrvOffSucceeded";
  882. case 9:
  883. return "PrvOffByPeer";
  884. case 10:
  885. return "PrvOffFailed";
  886. case 11:
  887. return "PrvOffUnknown";
  888. case-1:
  889. default:
  890. return "UNRECOGNIZED"
  891. }
  892. }
  893. function Ie() {
  894. return {data: new Uint8Array(0), key: !1, pts: 0}
  895. }
  896. const t0 = {
  897. encode(u, e = r.Writer.create()) {
  898. return u.data.length !== 0 && e.uint32(10).bytes(u.data), u.key !== !1 && e.uint32(16).bool(u.key), u.pts !== 0 && e.uint32(24).int64(u.pts), e
  899. }, decode(u, e) {
  900. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  901. let o = e === void 0 ? i.len : i.pos + e;
  902. const a = Ie();
  903. for (; i.pos < o;) {
  904. const t = i.uint32();
  905. switch (t >>> 3) {
  906. case 1:
  907. if (t !== 10) break;
  908. a.data = i.bytes();
  909. continue;
  910. case 2:
  911. if (t !== 16) break;
  912. a.key = i.bool();
  913. continue;
  914. case 3:
  915. if (t !== 24) break;
  916. a.pts = V(i.int64());
  917. continue
  918. }
  919. if ((t & 7) === 4 || t === 0) break;
  920. i.skipType(t & 7)
  921. }
  922. return a
  923. }, fromJSON(u) {
  924. return {
  925. data: n(u.data) ? z(u.data) : new Uint8Array(0),
  926. key: n(u.key) ? globalThis.Boolean(u.key) : !1,
  927. pts: n(u.pts) ? globalThis.Number(u.pts) : 0
  928. }
  929. }, toJSON(u) {
  930. const e = {};
  931. return u.data.length !== 0 && (e.data = P(u.data)), u.key !== !1 && (e.key = u.key), u.pts !== 0 && (e.pts = Math.round(u.pts)), e
  932. }, create(u) {
  933. return t0.fromPartial(u != null ? u : {})
  934. }, fromPartial(u) {
  935. var i, o, a;
  936. const e = Ie();
  937. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e.key = (o = u.key) != null ? o : !1, e.pts = (a = u.pts) != null ? a : 0, e
  938. }
  939. };
  940. function Te() {
  941. return {frames: []}
  942. }
  943. const k = {
  944. encode(u, e = r.Writer.create()) {
  945. for (const i of u.frames) t0.encode(i, e.uint32(10).fork()).ldelim();
  946. return e
  947. }, decode(u, e) {
  948. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  949. let o = e === void 0 ? i.len : i.pos + e;
  950. const a = Te();
  951. for (; i.pos < o;) {
  952. const t = i.uint32();
  953. switch (t >>> 3) {
  954. case 1:
  955. if (t !== 10) break;
  956. a.frames.push(t0.decode(i, i.uint32()));
  957. continue
  958. }
  959. if ((t & 7) === 4 || t === 0) break;
  960. i.skipType(t & 7)
  961. }
  962. return a
  963. }, fromJSON(u) {
  964. return {frames: globalThis.Array.isArray(u == null ? void 0 : u.frames) ? u.frames.map(e => t0.fromJSON(e)) : []}
  965. }, toJSON(u) {
  966. var i;
  967. const e = {};
  968. return (i = u.frames) != null && i.length && (e.frames = u.frames.map(o => t0.toJSON(o))), e
  969. }, create(u) {
  970. return k.fromPartial(u != null ? u : {})
  971. }, fromPartial(u) {
  972. var i;
  973. const e = Te();
  974. return e.frames = ((i = u.frames) == null ? void 0 : i.map(o => t0.fromPartial(o))) || [], e
  975. }
  976. };
  977. function je() {
  978. return {compress: !1}
  979. }
  980. const a0 = {
  981. encode(u, e = r.Writer.create()) {
  982. return u.compress !== !1 && e.uint32(8).bool(u.compress), e
  983. }, decode(u, e) {
  984. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  985. let o = e === void 0 ? i.len : i.pos + e;
  986. const a = je();
  987. for (; i.pos < o;) {
  988. const t = i.uint32();
  989. switch (t >>> 3) {
  990. case 1:
  991. if (t !== 8) break;
  992. a.compress = i.bool();
  993. continue
  994. }
  995. if ((t & 7) === 4 || t === 0) break;
  996. i.skipType(t & 7)
  997. }
  998. return a
  999. }, fromJSON(u) {
  1000. return {compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1}
  1001. }, toJSON(u) {
  1002. const e = {};
  1003. return u.compress !== !1 && (e.compress = u.compress), e
  1004. }, create(u) {
  1005. return a0.fromPartial(u != null ? u : {})
  1006. }, fromPartial(u) {
  1007. var i;
  1008. const e = je();
  1009. return e.compress = (i = u.compress) != null ? i : !1, e
  1010. }
  1011. };
  1012. function Ne() {
  1013. return {compress: !1, stride: 0}
  1014. }
  1015. const o0 = {
  1016. encode(u, e = r.Writer.create()) {
  1017. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.stride !== 0 && e.uint32(16).int32(u.stride), e
  1018. }, decode(u, e) {
  1019. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1020. let o = e === void 0 ? i.len : i.pos + e;
  1021. const a = Ne();
  1022. for (; i.pos < o;) {
  1023. const t = i.uint32();
  1024. switch (t >>> 3) {
  1025. case 1:
  1026. if (t !== 8) break;
  1027. a.compress = i.bool();
  1028. continue;
  1029. case 2:
  1030. if (t !== 16) break;
  1031. a.stride = i.int32();
  1032. continue
  1033. }
  1034. if ((t & 7) === 4 || t === 0) break;
  1035. i.skipType(t & 7)
  1036. }
  1037. return a
  1038. }, fromJSON(u) {
  1039. return {
  1040. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  1041. stride: n(u.stride) ? globalThis.Number(u.stride) : 0
  1042. }
  1043. }, toJSON(u) {
  1044. const e = {};
  1045. return u.compress !== !1 && (e.compress = u.compress), u.stride !== 0 && (e.stride = Math.round(u.stride)), e
  1046. }, create(u) {
  1047. return o0.fromPartial(u != null ? u : {})
  1048. }, fromPartial(u) {
  1049. var i, o;
  1050. const e = Ne();
  1051. return e.compress = (i = u.compress) != null ? i : !1, e.stride = (o = u.stride) != null ? o : 0, e
  1052. }
  1053. };
  1054. function Oe() {
  1055. return {
  1056. vp9s: void 0,
  1057. rgb: void 0,
  1058. yuv: void 0,
  1059. h264s: void 0,
  1060. h265s: void 0,
  1061. vp8s: void 0,
  1062. av1s: void 0,
  1063. display: 0
  1064. }
  1065. }
  1066. const n0 = {
  1067. encode(u, e = r.Writer.create()) {
  1068. return u.vp9s !== void 0 && k.encode(u.vp9s, e.uint32(50).fork()).ldelim(), u.rgb !== void 0 && a0.encode(u.rgb, e.uint32(58).fork()).ldelim(), u.yuv !== void 0 && o0.encode(u.yuv, e.uint32(66).fork()).ldelim(), u.h264s !== void 0 && k.encode(u.h264s, e.uint32(82).fork()).ldelim(), u.h265s !== void 0 && k.encode(u.h265s, e.uint32(90).fork()).ldelim(), u.vp8s !== void 0 && k.encode(u.vp8s, e.uint32(98).fork()).ldelim(), u.av1s !== void 0 && k.encode(u.av1s, e.uint32(106).fork()).ldelim(), u.display !== 0 && e.uint32(112).int32(u.display), e
  1069. }, decode(u, e) {
  1070. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1071. let o = e === void 0 ? i.len : i.pos + e;
  1072. const a = Oe();
  1073. for (; i.pos < o;) {
  1074. const t = i.uint32();
  1075. switch (t >>> 3) {
  1076. case 6:
  1077. if (t !== 50) break;
  1078. a.vp9s = k.decode(i, i.uint32());
  1079. continue;
  1080. case 7:
  1081. if (t !== 58) break;
  1082. a.rgb = a0.decode(i, i.uint32());
  1083. continue;
  1084. case 8:
  1085. if (t !== 66) break;
  1086. a.yuv = o0.decode(i, i.uint32());
  1087. continue;
  1088. case 10:
  1089. if (t !== 82) break;
  1090. a.h264s = k.decode(i, i.uint32());
  1091. continue;
  1092. case 11:
  1093. if (t !== 90) break;
  1094. a.h265s = k.decode(i, i.uint32());
  1095. continue;
  1096. case 12:
  1097. if (t !== 98) break;
  1098. a.vp8s = k.decode(i, i.uint32());
  1099. continue;
  1100. case 13:
  1101. if (t !== 106) break;
  1102. a.av1s = k.decode(i, i.uint32());
  1103. continue;
  1104. case 14:
  1105. if (t !== 112) break;
  1106. a.display = i.int32();
  1107. continue
  1108. }
  1109. if ((t & 7) === 4 || t === 0) break;
  1110. i.skipType(t & 7)
  1111. }
  1112. return a
  1113. }, fromJSON(u) {
  1114. return {
  1115. vp9s: n(u.vp9s) ? k.fromJSON(u.vp9s) : void 0,
  1116. rgb: n(u.rgb) ? a0.fromJSON(u.rgb) : void 0,
  1117. yuv: n(u.yuv) ? o0.fromJSON(u.yuv) : void 0,
  1118. h264s: n(u.h264s) ? k.fromJSON(u.h264s) : void 0,
  1119. h265s: n(u.h265s) ? k.fromJSON(u.h265s) : void 0,
  1120. vp8s: n(u.vp8s) ? k.fromJSON(u.vp8s) : void 0,
  1121. av1s: n(u.av1s) ? k.fromJSON(u.av1s) : void 0,
  1122. display: n(u.display) ? globalThis.Number(u.display) : 0
  1123. }
  1124. }, toJSON(u) {
  1125. const e = {};
  1126. return u.vp9s !== void 0 && (e.vp9s = k.toJSON(u.vp9s)), u.rgb !== void 0 && (e.rgb = a0.toJSON(u.rgb)), u.yuv !== void 0 && (e.yuv = o0.toJSON(u.yuv)), u.h264s !== void 0 && (e.h264s = k.toJSON(u.h264s)), u.h265s !== void 0 && (e.h265s = k.toJSON(u.h265s)), u.vp8s !== void 0 && (e.vp8s = k.toJSON(u.vp8s)), u.av1s !== void 0 && (e.av1s = k.toJSON(u.av1s)), u.display !== 0 && (e.display = Math.round(u.display)), e
  1127. }, create(u) {
  1128. return n0.fromPartial(u != null ? u : {})
  1129. }, fromPartial(u) {
  1130. var i;
  1131. const e = Oe();
  1132. return e.vp9s = u.vp9s !== void 0 && u.vp9s !== null ? k.fromPartial(u.vp9s) : void 0, e.rgb = u.rgb !== void 0 && u.rgb !== null ? a0.fromPartial(u.rgb) : void 0, e.yuv = u.yuv !== void 0 && u.yuv !== null ? o0.fromPartial(u.yuv) : void 0, e.h264s = u.h264s !== void 0 && u.h264s !== null ? k.fromPartial(u.h264s) : void 0, e.h265s = u.h265s !== void 0 && u.h265s !== null ? k.fromPartial(u.h265s) : void 0, e.vp8s = u.vp8s !== void 0 && u.vp8s !== null ? k.fromPartial(u.vp8s) : void 0, e.av1s = u.av1s !== void 0 && u.av1s !== null ? k.fromPartial(u.av1s) : void 0, e.display = (i = u.display) != null ? i : 0, e
  1133. }
  1134. };
  1135. function Me() {
  1136. return {id: "", pk: new Uint8Array(0)}
  1137. }
  1138. const te = {
  1139. encode(u, e = r.Writer.create()) {
  1140. return u.id !== "" && e.uint32(10).string(u.id), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), e
  1141. }, decode(u, e) {
  1142. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1143. let o = e === void 0 ? i.len : i.pos + e;
  1144. const a = Me();
  1145. for (; i.pos < o;) {
  1146. const t = i.uint32();
  1147. switch (t >>> 3) {
  1148. case 1:
  1149. if (t !== 10) break;
  1150. a.id = i.string();
  1151. continue;
  1152. case 2:
  1153. if (t !== 18) break;
  1154. a.pk = i.bytes();
  1155. continue
  1156. }
  1157. if ((t & 7) === 4 || t === 0) break;
  1158. i.skipType(t & 7)
  1159. }
  1160. return a
  1161. }, fromJSON(u) {
  1162. return {id: n(u.id) ? globalThis.String(u.id) : "", pk: n(u.pk) ? z(u.pk) : new Uint8Array(0)}
  1163. }, toJSON(u) {
  1164. const e = {};
  1165. return u.id !== "" && (e.id = u.id), u.pk.length !== 0 && (e.pk = P(u.pk)), e
  1166. }, create(u) {
  1167. return te.fromPartial(u != null ? u : {})
  1168. }, fromPartial(u) {
  1169. var i, o;
  1170. const e = Me();
  1171. return e.id = (i = u.id) != null ? i : "", e.pk = (o = u.pk) != null ? o : new Uint8Array(0), e
  1172. }
  1173. };
  1174. function Le() {
  1175. return {
  1176. x: 0,
  1177. y: 0,
  1178. width: 0,
  1179. height: 0,
  1180. name: "",
  1181. online: !1,
  1182. cursor_embedded: !1,
  1183. original_resolution: void 0,
  1184. scale: 0
  1185. }
  1186. }
  1187. const r0 = {
  1188. encode(u, e = r.Writer.create()) {
  1189. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.name !== "" && e.uint32(42).string(u.name), u.online !== !1 && e.uint32(48).bool(u.online), u.cursor_embedded !== !1 && e.uint32(56).bool(u.cursor_embedded), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), u.scale !== 0 && e.uint32(73).double(u.scale), e
  1190. }, decode(u, e) {
  1191. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1192. let o = e === void 0 ? i.len : i.pos + e;
  1193. const a = Le();
  1194. for (; i.pos < o;) {
  1195. const t = i.uint32();
  1196. switch (t >>> 3) {
  1197. case 1:
  1198. if (t !== 8) break;
  1199. a.x = i.sint32();
  1200. continue;
  1201. case 2:
  1202. if (t !== 16) break;
  1203. a.y = i.sint32();
  1204. continue;
  1205. case 3:
  1206. if (t !== 24) break;
  1207. a.width = i.int32();
  1208. continue;
  1209. case 4:
  1210. if (t !== 32) break;
  1211. a.height = i.int32();
  1212. continue;
  1213. case 5:
  1214. if (t !== 42) break;
  1215. a.name = i.string();
  1216. continue;
  1217. case 6:
  1218. if (t !== 48) break;
  1219. a.online = i.bool();
  1220. continue;
  1221. case 7:
  1222. if (t !== 56) break;
  1223. a.cursor_embedded = i.bool();
  1224. continue;
  1225. case 8:
  1226. if (t !== 66) break;
  1227. a.original_resolution = v.decode(i, i.uint32());
  1228. continue;
  1229. case 9:
  1230. if (t !== 73) break;
  1231. a.scale = i.double();
  1232. continue
  1233. }
  1234. if ((t & 7) === 4 || t === 0) break;
  1235. i.skipType(t & 7)
  1236. }
  1237. return a
  1238. }, fromJSON(u) {
  1239. return {
  1240. x: n(u.x) ? globalThis.Number(u.x) : 0,
  1241. y: n(u.y) ? globalThis.Number(u.y) : 0,
  1242. width: n(u.width) ? globalThis.Number(u.width) : 0,
  1243. height: n(u.height) ? globalThis.Number(u.height) : 0,
  1244. name: n(u.name) ? globalThis.String(u.name) : "",
  1245. online: n(u.online) ? globalThis.Boolean(u.online) : !1,
  1246. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  1247. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0,
  1248. scale: n(u.scale) ? globalThis.Number(u.scale) : 0
  1249. }
  1250. }, toJSON(u) {
  1251. const e = {};
  1252. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.name !== "" && (e.name = u.name), u.online !== !1 && (e.online = u.online), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), u.scale !== 0 && (e.scale = u.scale), e
  1253. }, create(u) {
  1254. return r0.fromPartial(u != null ? u : {})
  1255. }, fromPartial(u) {
  1256. var i, o, a, t, s, l, E, c;
  1257. const e = Le();
  1258. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.name = (s = u.name) != null ? s : "", e.online = (l = u.online) != null ? l : !1, e.cursor_embedded = (E = u.cursor_embedded) != null ? E : !1, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e.scale = (c = u.scale) != null ? c : 0, e
  1259. }
  1260. };
  1261. function Ue() {
  1262. return {host: "", port: 0}
  1263. }
  1264. const s0 = {
  1265. encode(u, e = r.Writer.create()) {
  1266. return u.host !== "" && e.uint32(10).string(u.host), u.port !== 0 && e.uint32(16).int32(u.port), e
  1267. }, decode(u, e) {
  1268. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1269. let o = e === void 0 ? i.len : i.pos + e;
  1270. const a = Ue();
  1271. for (; i.pos < o;) {
  1272. const t = i.uint32();
  1273. switch (t >>> 3) {
  1274. case 1:
  1275. if (t !== 10) break;
  1276. a.host = i.string();
  1277. continue;
  1278. case 2:
  1279. if (t !== 16) break;
  1280. a.port = i.int32();
  1281. continue
  1282. }
  1283. if ((t & 7) === 4 || t === 0) break;
  1284. i.skipType(t & 7)
  1285. }
  1286. return a
  1287. }, fromJSON(u) {
  1288. return {host: n(u.host) ? globalThis.String(u.host) : "", port: n(u.port) ? globalThis.Number(u.port) : 0}
  1289. }, toJSON(u) {
  1290. const e = {};
  1291. return u.host !== "" && (e.host = u.host), u.port !== 0 && (e.port = Math.round(u.port)), e
  1292. }, create(u) {
  1293. return s0.fromPartial(u != null ? u : {})
  1294. }, fromPartial(u) {
  1295. var i, o;
  1296. const e = Ue();
  1297. return e.host = (i = u.host) != null ? i : "", e.port = (o = u.port) != null ? o : 0, e
  1298. }
  1299. };
  1300. function We() {
  1301. return {dir: "", show_hidden: !1}
  1302. }
  1303. const Fu = {
  1304. encode(u, e = r.Writer.create()) {
  1305. return u.dir !== "" && e.uint32(10).string(u.dir), u.show_hidden !== !1 && e.uint32(16).bool(u.show_hidden), e
  1306. }, decode(u, e) {
  1307. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1308. let o = e === void 0 ? i.len : i.pos + e;
  1309. const a = We();
  1310. for (; i.pos < o;) {
  1311. const t = i.uint32();
  1312. switch (t >>> 3) {
  1313. case 1:
  1314. if (t !== 10) break;
  1315. a.dir = i.string();
  1316. continue;
  1317. case 2:
  1318. if (t !== 16) break;
  1319. a.show_hidden = i.bool();
  1320. continue
  1321. }
  1322. if ((t & 7) === 4 || t === 0) break;
  1323. i.skipType(t & 7)
  1324. }
  1325. return a
  1326. }, fromJSON(u) {
  1327. return {
  1328. dir: n(u.dir) ? globalThis.String(u.dir) : "",
  1329. show_hidden: n(u.show_hidden) ? globalThis.Boolean(u.show_hidden) : !1
  1330. }
  1331. }, toJSON(u) {
  1332. const e = {};
  1333. return u.dir !== "" && (e.dir = u.dir), u.show_hidden !== !1 && (e.show_hidden = u.show_hidden), e
  1334. }, create(u) {
  1335. return Fu.fromPartial(u != null ? u : {})
  1336. }, fromPartial(u) {
  1337. var i, o;
  1338. const e = We();
  1339. return e.dir = (i = u.dir) != null ? i : "", e.show_hidden = (o = u.show_hidden) != null ? o : !1, e
  1340. }
  1341. };
  1342. function Ve() {
  1343. return {username: "", password: ""}
  1344. }
  1345. const l0 = {
  1346. encode(u, e = r.Writer.create()) {
  1347. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  1348. }, decode(u, e) {
  1349. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1350. let o = e === void 0 ? i.len : i.pos + e;
  1351. const a = Ve();
  1352. for (; i.pos < o;) {
  1353. const t = i.uint32();
  1354. switch (t >>> 3) {
  1355. case 1:
  1356. if (t !== 10) break;
  1357. a.username = i.string();
  1358. continue;
  1359. case 2:
  1360. if (t !== 18) break;
  1361. a.password = i.string();
  1362. continue
  1363. }
  1364. if ((t & 7) === 4 || t === 0) break;
  1365. i.skipType(t & 7)
  1366. }
  1367. return a
  1368. }, fromJSON(u) {
  1369. return {
  1370. username: n(u.username) ? globalThis.String(u.username) : "",
  1371. password: n(u.password) ? globalThis.String(u.password) : ""
  1372. }
  1373. }, toJSON(u) {
  1374. const e = {};
  1375. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  1376. }, create(u) {
  1377. return l0.fromPartial(u != null ? u : {})
  1378. }, fromPartial(u) {
  1379. var i, o;
  1380. const e = Ve();
  1381. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  1382. }
  1383. };
  1384. function qe() {
  1385. return {
  1386. username: "",
  1387. password: new Uint8Array(0),
  1388. my_id: "",
  1389. my_name: "",
  1390. option: void 0,
  1391. file_transfer: void 0,
  1392. port_forward: void 0,
  1393. video_ack_required: !1,
  1394. session_id: 0,
  1395. version: "",
  1396. os_login: void 0,
  1397. my_platform: "",
  1398. hwid: new Uint8Array(0)
  1399. }
  1400. }
  1401. const H = {
  1402. encode(u, e = r.Writer.create()) {
  1403. return u.username !== "" && e.uint32(10).string(u.username), u.password.length !== 0 && e.uint32(18).bytes(u.password), u.my_id !== "" && e.uint32(34).string(u.my_id), u.my_name !== "" && e.uint32(42).string(u.my_name), u.option !== void 0 && S.encode(u.option, e.uint32(50).fork()).ldelim(), u.file_transfer !== void 0 && Fu.encode(u.file_transfer, e.uint32(58).fork()).ldelim(), u.port_forward !== void 0 && s0.encode(u.port_forward, e.uint32(66).fork()).ldelim(), u.video_ack_required !== !1 && e.uint32(72).bool(u.video_ack_required), u.session_id !== 0 && e.uint32(80).uint64(u.session_id), u.version !== "" && e.uint32(90).string(u.version), u.os_login !== void 0 && l0.encode(u.os_login, e.uint32(98).fork()).ldelim(), u.my_platform !== "" && e.uint32(106).string(u.my_platform), u.hwid.length !== 0 && e.uint32(114).bytes(u.hwid), e
  1404. }, decode(u, e) {
  1405. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1406. let o = e === void 0 ? i.len : i.pos + e;
  1407. const a = qe();
  1408. for (; i.pos < o;) {
  1409. const t = i.uint32();
  1410. switch (t >>> 3) {
  1411. case 1:
  1412. if (t !== 10) break;
  1413. a.username = i.string();
  1414. continue;
  1415. case 2:
  1416. if (t !== 18) break;
  1417. a.password = i.bytes();
  1418. continue;
  1419. case 4:
  1420. if (t !== 34) break;
  1421. a.my_id = i.string();
  1422. continue;
  1423. case 5:
  1424. if (t !== 42) break;
  1425. a.my_name = i.string();
  1426. continue;
  1427. case 6:
  1428. if (t !== 50) break;
  1429. a.option = S.decode(i, i.uint32());
  1430. continue;
  1431. case 7:
  1432. if (t !== 58) break;
  1433. a.file_transfer = Fu.decode(i, i.uint32());
  1434. continue;
  1435. case 8:
  1436. if (t !== 66) break;
  1437. a.port_forward = s0.decode(i, i.uint32());
  1438. continue;
  1439. case 9:
  1440. if (t !== 72) break;
  1441. a.video_ack_required = i.bool();
  1442. continue;
  1443. case 10:
  1444. if (t !== 80) break;
  1445. a.session_id = V(i.uint64());
  1446. continue;
  1447. case 11:
  1448. if (t !== 90) break;
  1449. a.version = i.string();
  1450. continue;
  1451. case 12:
  1452. if (t !== 98) break;
  1453. a.os_login = l0.decode(i, i.uint32());
  1454. continue;
  1455. case 13:
  1456. if (t !== 106) break;
  1457. a.my_platform = i.string();
  1458. continue;
  1459. case 14:
  1460. if (t !== 114) break;
  1461. a.hwid = i.bytes();
  1462. continue
  1463. }
  1464. if ((t & 7) === 4 || t === 0) break;
  1465. i.skipType(t & 7)
  1466. }
  1467. return a
  1468. }, fromJSON(u) {
  1469. return {
  1470. username: n(u.username) ? globalThis.String(u.username) : "",
  1471. password: n(u.password) ? z(u.password) : new Uint8Array(0),
  1472. my_id: n(u.my_id) ? globalThis.String(u.my_id) : "",
  1473. my_name: n(u.my_name) ? globalThis.String(u.my_name) : "",
  1474. option: n(u.option) ? S.fromJSON(u.option) : void 0,
  1475. file_transfer: n(u.file_transfer) ? Fu.fromJSON(u.file_transfer) : void 0,
  1476. port_forward: n(u.port_forward) ? s0.fromJSON(u.port_forward) : void 0,
  1477. video_ack_required: n(u.video_ack_required) ? globalThis.Boolean(u.video_ack_required) : !1,
  1478. session_id: n(u.session_id) ? globalThis.Number(u.session_id) : 0,
  1479. version: n(u.version) ? globalThis.String(u.version) : "",
  1480. os_login: n(u.os_login) ? l0.fromJSON(u.os_login) : void 0,
  1481. my_platform: n(u.my_platform) ? globalThis.String(u.my_platform) : "",
  1482. hwid: n(u.hwid) ? z(u.hwid) : new Uint8Array(0)
  1483. }
  1484. }, toJSON(u) {
  1485. const e = {};
  1486. return u.username !== "" && (e.username = u.username), u.password.length !== 0 && (e.password = P(u.password)), u.my_id !== "" && (e.my_id = u.my_id), u.my_name !== "" && (e.my_name = u.my_name), u.option !== void 0 && (e.option = S.toJSON(u.option)), u.file_transfer !== void 0 && (e.file_transfer = Fu.toJSON(u.file_transfer)), u.port_forward !== void 0 && (e.port_forward = s0.toJSON(u.port_forward)), u.video_ack_required !== !1 && (e.video_ack_required = u.video_ack_required), u.session_id !== 0 && (e.session_id = Math.round(u.session_id)), u.version !== "" && (e.version = u.version), u.os_login !== void 0 && (e.os_login = l0.toJSON(u.os_login)), u.my_platform !== "" && (e.my_platform = u.my_platform), u.hwid.length !== 0 && (e.hwid = P(u.hwid)), e
  1487. }, create(u) {
  1488. return H.fromPartial(u != null ? u : {})
  1489. }, fromPartial(u) {
  1490. var i, o, a, t, s, l, E, c, C;
  1491. const e = qe();
  1492. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : new Uint8Array(0), e.my_id = (a = u.my_id) != null ? a : "", e.my_name = (t = u.my_name) != null ? t : "", e.option = u.option !== void 0 && u.option !== null ? S.fromPartial(u.option) : void 0, e.file_transfer = u.file_transfer !== void 0 && u.file_transfer !== null ? Fu.fromPartial(u.file_transfer) : void 0, e.port_forward = u.port_forward !== void 0 && u.port_forward !== null ? s0.fromPartial(u.port_forward) : void 0, e.video_ack_required = (s = u.video_ack_required) != null ? s : !1, e.session_id = (l = u.session_id) != null ? l : 0, e.version = (E = u.version) != null ? E : "", e.os_login = u.os_login !== void 0 && u.os_login !== null ? l0.fromPartial(u.os_login) : void 0, e.my_platform = (c = u.my_platform) != null ? c : "", e.hwid = (C = u.hwid) != null ? C : new Uint8Array(0), e
  1493. }
  1494. };
  1495. function Ke() {
  1496. return {code: "", hwid: new Uint8Array(0)}
  1497. }
  1498. const _u = {
  1499. encode(u, e = r.Writer.create()) {
  1500. return u.code !== "" && e.uint32(10).string(u.code), u.hwid.length !== 0 && e.uint32(18).bytes(u.hwid), e
  1501. }, decode(u, e) {
  1502. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1503. let o = e === void 0 ? i.len : i.pos + e;
  1504. const a = Ke();
  1505. for (; i.pos < o;) {
  1506. const t = i.uint32();
  1507. switch (t >>> 3) {
  1508. case 1:
  1509. if (t !== 10) break;
  1510. a.code = i.string();
  1511. continue;
  1512. case 2:
  1513. if (t !== 18) break;
  1514. a.hwid = i.bytes();
  1515. continue
  1516. }
  1517. if ((t & 7) === 4 || t === 0) break;
  1518. i.skipType(t & 7)
  1519. }
  1520. return a
  1521. }, fromJSON(u) {
  1522. return {code: n(u.code) ? globalThis.String(u.code) : "", hwid: n(u.hwid) ? z(u.hwid) : new Uint8Array(0)}
  1523. }, toJSON(u) {
  1524. const e = {};
  1525. return u.code !== "" && (e.code = u.code), u.hwid.length !== 0 && (e.hwid = P(u.hwid)), e
  1526. }, create(u) {
  1527. return _u.fromPartial(u != null ? u : {})
  1528. }, fromPartial(u) {
  1529. var i, o;
  1530. const e = Ke();
  1531. return e.code = (i = u.code) != null ? i : "", e.hwid = (o = u.hwid) != null ? o : new Uint8Array(0), e
  1532. }
  1533. };
  1534. function He() {
  1535. return {text: ""}
  1536. }
  1537. const vu = {
  1538. encode(u, e = r.Writer.create()) {
  1539. return u.text !== "" && e.uint32(10).string(u.text), e
  1540. }, decode(u, e) {
  1541. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1542. let o = e === void 0 ? i.len : i.pos + e;
  1543. const a = He();
  1544. for (; i.pos < o;) {
  1545. const t = i.uint32();
  1546. switch (t >>> 3) {
  1547. case 1:
  1548. if (t !== 10) break;
  1549. a.text = i.string();
  1550. continue
  1551. }
  1552. if ((t & 7) === 4 || t === 0) break;
  1553. i.skipType(t & 7)
  1554. }
  1555. return a
  1556. }, fromJSON(u) {
  1557. return {text: n(u.text) ? globalThis.String(u.text) : ""}
  1558. }, toJSON(u) {
  1559. const e = {};
  1560. return u.text !== "" && (e.text = u.text), e
  1561. }, create(u) {
  1562. return vu.fromPartial(u != null ? u : {})
  1563. }, fromPartial(u) {
  1564. var i;
  1565. const e = He();
  1566. return e.text = (i = u.text) != null ? i : "", e
  1567. }
  1568. };
  1569. function Je() {
  1570. return {privacy_mode: !1}
  1571. }
  1572. const E0 = {
  1573. encode(u, e = r.Writer.create()) {
  1574. return u.privacy_mode !== !1 && e.uint32(8).bool(u.privacy_mode), e
  1575. }, decode(u, e) {
  1576. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1577. let o = e === void 0 ? i.len : i.pos + e;
  1578. const a = Je();
  1579. for (; i.pos < o;) {
  1580. const t = i.uint32();
  1581. switch (t >>> 3) {
  1582. case 1:
  1583. if (t !== 8) break;
  1584. a.privacy_mode = i.bool();
  1585. continue
  1586. }
  1587. if ((t & 7) === 4 || t === 0) break;
  1588. i.skipType(t & 7)
  1589. }
  1590. return a
  1591. }, fromJSON(u) {
  1592. return {privacy_mode: n(u.privacy_mode) ? globalThis.Boolean(u.privacy_mode) : !1}
  1593. }, toJSON(u) {
  1594. const e = {};
  1595. return u.privacy_mode !== !1 && (e.privacy_mode = u.privacy_mode), e
  1596. }, create(u) {
  1597. return E0.fromPartial(u != null ? u : {})
  1598. }, fromPartial(u) {
  1599. var i;
  1600. const e = Je();
  1601. return e.privacy_mode = (i = u.privacy_mode) != null ? i : !1, e
  1602. }
  1603. };
  1604. function Ge() {
  1605. return {vp8: !1, vp9: !1, av1: !1, h264: !1, h265: !1}
  1606. }
  1607. const J = {
  1608. encode(u, e = r.Writer.create()) {
  1609. return u.vp8 !== !1 && e.uint32(8).bool(u.vp8), u.vp9 !== !1 && e.uint32(16).bool(u.vp9), u.av1 !== !1 && e.uint32(24).bool(u.av1), u.h264 !== !1 && e.uint32(32).bool(u.h264), u.h265 !== !1 && e.uint32(40).bool(u.h265), e
  1610. }, decode(u, e) {
  1611. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1612. let o = e === void 0 ? i.len : i.pos + e;
  1613. const a = Ge();
  1614. for (; i.pos < o;) {
  1615. const t = i.uint32();
  1616. switch (t >>> 3) {
  1617. case 1:
  1618. if (t !== 8) break;
  1619. a.vp8 = i.bool();
  1620. continue;
  1621. case 2:
  1622. if (t !== 16) break;
  1623. a.vp9 = i.bool();
  1624. continue;
  1625. case 3:
  1626. if (t !== 24) break;
  1627. a.av1 = i.bool();
  1628. continue;
  1629. case 4:
  1630. if (t !== 32) break;
  1631. a.h264 = i.bool();
  1632. continue;
  1633. case 5:
  1634. if (t !== 40) break;
  1635. a.h265 = i.bool();
  1636. continue
  1637. }
  1638. if ((t & 7) === 4 || t === 0) break;
  1639. i.skipType(t & 7)
  1640. }
  1641. return a
  1642. }, fromJSON(u) {
  1643. return {
  1644. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1645. vp9: n(u.vp9) ? globalThis.Boolean(u.vp9) : !1,
  1646. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1647. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1648. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1
  1649. }
  1650. }, toJSON(u) {
  1651. const e = {};
  1652. return u.vp8 !== !1 && (e.vp8 = u.vp8), u.vp9 !== !1 && (e.vp9 = u.vp9), u.av1 !== !1 && (e.av1 = u.av1), u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), e
  1653. }, create(u) {
  1654. return J.fromPartial(u != null ? u : {})
  1655. }, fromPartial(u) {
  1656. var i, o, a, t, s;
  1657. const e = Ge();
  1658. return e.vp8 = (i = u.vp8) != null ? i : !1, e.vp9 = (o = u.vp9) != null ? o : !1, e.av1 = (a = u.av1) != null ? a : !1, e.h264 = (t = u.h264) != null ? t : !1, e.h265 = (s = u.h265) != null ? s : !1, e
  1659. }
  1660. };
  1661. function Ze() {
  1662. return {h264: !1, h265: !1, vp8: !1, av1: !1, i444: void 0}
  1663. }
  1664. const G = {
  1665. encode(u, e = r.Writer.create()) {
  1666. return u.h264 !== !1 && e.uint32(8).bool(u.h264), u.h265 !== !1 && e.uint32(16).bool(u.h265), u.vp8 !== !1 && e.uint32(24).bool(u.vp8), u.av1 !== !1 && e.uint32(32).bool(u.av1), u.i444 !== void 0 && J.encode(u.i444, e.uint32(42).fork()).ldelim(), e
  1667. }, decode(u, e) {
  1668. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1669. let o = e === void 0 ? i.len : i.pos + e;
  1670. const a = Ze();
  1671. for (; i.pos < o;) {
  1672. const t = i.uint32();
  1673. switch (t >>> 3) {
  1674. case 1:
  1675. if (t !== 8) break;
  1676. a.h264 = i.bool();
  1677. continue;
  1678. case 2:
  1679. if (t !== 16) break;
  1680. a.h265 = i.bool();
  1681. continue;
  1682. case 3:
  1683. if (t !== 24) break;
  1684. a.vp8 = i.bool();
  1685. continue;
  1686. case 4:
  1687. if (t !== 32) break;
  1688. a.av1 = i.bool();
  1689. continue;
  1690. case 5:
  1691. if (t !== 42) break;
  1692. a.i444 = J.decode(i, i.uint32());
  1693. continue
  1694. }
  1695. if ((t & 7) === 4 || t === 0) break;
  1696. i.skipType(t & 7)
  1697. }
  1698. return a
  1699. }, fromJSON(u) {
  1700. return {
  1701. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1702. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1,
  1703. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1704. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1705. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0
  1706. }
  1707. }, toJSON(u) {
  1708. const e = {};
  1709. return u.h264 !== !1 && (e.h264 = u.h264), u.h265 !== !1 && (e.h265 = u.h265), u.vp8 !== !1 && (e.vp8 = u.vp8), u.av1 !== !1 && (e.av1 = u.av1), u.i444 !== void 0 && (e.i444 = J.toJSON(u.i444)), e
  1710. }, create(u) {
  1711. return G.fromPartial(u != null ? u : {})
  1712. }, fromPartial(u) {
  1713. var i, o, a, t;
  1714. const e = Ze();
  1715. return e.h264 = (i = u.h264) != null ? i : !1, e.h265 = (o = u.h265) != null ? o : !1, e.vp8 = (a = u.vp8) != null ? a : !1, e.av1 = (t = u.av1) != null ? t : !1, e.i444 = u.i444 !== void 0 && u.i444 !== null ? J.fromPartial(u.i444) : void 0, e
  1716. }
  1717. };
  1718. function Qe() {
  1719. return {
  1720. username: "",
  1721. hostname: "",
  1722. platform: "",
  1723. displays: [],
  1724. current_display: 0,
  1725. sas_enabled: !1,
  1726. version: "",
  1727. features: void 0,
  1728. encoding: void 0,
  1729. resolutions: void 0,
  1730. platform_additions: "",
  1731. windows_sessions: void 0
  1732. }
  1733. }
  1734. const Y = {
  1735. encode(u, e = r.Writer.create()) {
  1736. u.username !== "" && e.uint32(10).string(u.username), u.hostname !== "" && e.uint32(18).string(u.hostname), u.platform !== "" && e.uint32(26).string(u.platform);
  1737. for (const i of u.displays) r0.encode(i, e.uint32(34).fork()).ldelim();
  1738. return u.current_display !== 0 && e.uint32(40).int32(u.current_display), u.sas_enabled !== !1 && e.uint32(48).bool(u.sas_enabled), u.version !== "" && e.uint32(58).string(u.version), u.features !== void 0 && E0.encode(u.features, e.uint32(74).fork()).ldelim(), u.encoding !== void 0 && G.encode(u.encoding, e.uint32(82).fork()).ldelim(), u.resolutions !== void 0 && $.encode(u.resolutions, e.uint32(90).fork()).ldelim(), u.platform_additions !== "" && e.uint32(98).string(u.platform_additions), u.windows_sessions !== void 0 && q0.encode(u.windows_sessions, e.uint32(106).fork()).ldelim(), e
  1739. }, decode(u, e) {
  1740. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1741. let o = e === void 0 ? i.len : i.pos + e;
  1742. const a = Qe();
  1743. for (; i.pos < o;) {
  1744. const t = i.uint32();
  1745. switch (t >>> 3) {
  1746. case 1:
  1747. if (t !== 10) break;
  1748. a.username = i.string();
  1749. continue;
  1750. case 2:
  1751. if (t !== 18) break;
  1752. a.hostname = i.string();
  1753. continue;
  1754. case 3:
  1755. if (t !== 26) break;
  1756. a.platform = i.string();
  1757. continue;
  1758. case 4:
  1759. if (t !== 34) break;
  1760. a.displays.push(r0.decode(i, i.uint32()));
  1761. continue;
  1762. case 5:
  1763. if (t !== 40) break;
  1764. a.current_display = i.int32();
  1765. continue;
  1766. case 6:
  1767. if (t !== 48) break;
  1768. a.sas_enabled = i.bool();
  1769. continue;
  1770. case 7:
  1771. if (t !== 58) break;
  1772. a.version = i.string();
  1773. continue;
  1774. case 9:
  1775. if (t !== 74) break;
  1776. a.features = E0.decode(i, i.uint32());
  1777. continue;
  1778. case 10:
  1779. if (t !== 82) break;
  1780. a.encoding = G.decode(i, i.uint32());
  1781. continue;
  1782. case 11:
  1783. if (t !== 90) break;
  1784. a.resolutions = $.decode(i, i.uint32());
  1785. continue;
  1786. case 12:
  1787. if (t !== 98) break;
  1788. a.platform_additions = i.string();
  1789. continue;
  1790. case 13:
  1791. if (t !== 106) break;
  1792. a.windows_sessions = q0.decode(i, i.uint32());
  1793. continue
  1794. }
  1795. if ((t & 7) === 4 || t === 0) break;
  1796. i.skipType(t & 7)
  1797. }
  1798. return a
  1799. }, fromJSON(u) {
  1800. return {
  1801. username: n(u.username) ? globalThis.String(u.username) : "",
  1802. hostname: n(u.hostname) ? globalThis.String(u.hostname) : "",
  1803. platform: n(u.platform) ? globalThis.String(u.platform) : "",
  1804. displays: globalThis.Array.isArray(u == null ? void 0 : u.displays) ? u.displays.map(e => r0.fromJSON(e)) : [],
  1805. current_display: n(u.current_display) ? globalThis.Number(u.current_display) : 0,
  1806. sas_enabled: n(u.sas_enabled) ? globalThis.Boolean(u.sas_enabled) : !1,
  1807. version: n(u.version) ? globalThis.String(u.version) : "",
  1808. features: n(u.features) ? E0.fromJSON(u.features) : void 0,
  1809. encoding: n(u.encoding) ? G.fromJSON(u.encoding) : void 0,
  1810. resolutions: n(u.resolutions) ? $.fromJSON(u.resolutions) : void 0,
  1811. platform_additions: n(u.platform_additions) ? globalThis.String(u.platform_additions) : "",
  1812. windows_sessions: n(u.windows_sessions) ? q0.fromJSON(u.windows_sessions) : void 0
  1813. }
  1814. }, toJSON(u) {
  1815. var i;
  1816. const e = {};
  1817. return u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), (i = u.displays) != null && i.length && (e.displays = u.displays.map(o => r0.toJSON(o))), u.current_display !== 0 && (e.current_display = Math.round(u.current_display)), u.sas_enabled !== !1 && (e.sas_enabled = u.sas_enabled), u.version !== "" && (e.version = u.version), u.features !== void 0 && (e.features = E0.toJSON(u.features)), u.encoding !== void 0 && (e.encoding = G.toJSON(u.encoding)), u.resolutions !== void 0 && (e.resolutions = $.toJSON(u.resolutions)), u.platform_additions !== "" && (e.platform_additions = u.platform_additions), u.windows_sessions !== void 0 && (e.windows_sessions = q0.toJSON(u.windows_sessions)), e
  1818. }, create(u) {
  1819. return Y.fromPartial(u != null ? u : {})
  1820. }, fromPartial(u) {
  1821. var i, o, a, t, s, l, E, c;
  1822. const e = Qe();
  1823. return e.username = (i = u.username) != null ? i : "", e.hostname = (o = u.hostname) != null ? o : "", e.platform = (a = u.platform) != null ? a : "", e.displays = ((t = u.displays) == null ? void 0 : t.map(C => r0.fromPartial(C))) || [], e.current_display = (s = u.current_display) != null ? s : 0, e.sas_enabled = (l = u.sas_enabled) != null ? l : !1, e.version = (E = u.version) != null ? E : "", e.features = u.features !== void 0 && u.features !== null ? E0.fromPartial(u.features) : void 0, e.encoding = u.encoding !== void 0 && u.encoding !== null ? G.fromPartial(u.encoding) : void 0, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? $.fromPartial(u.resolutions) : void 0, e.platform_additions = (c = u.platform_additions) != null ? c : "", e.windows_sessions = u.windows_sessions !== void 0 && u.windows_sessions !== null ? q0.fromPartial(u.windows_sessions) : void 0, e
  1824. }
  1825. };
  1826. function Xe() {
  1827. return {sid: 0, name: ""}
  1828. }
  1829. const d0 = {
  1830. encode(u, e = r.Writer.create()) {
  1831. return u.sid !== 0 && e.uint32(8).uint32(u.sid), u.name !== "" && e.uint32(18).string(u.name), e
  1832. }, decode(u, e) {
  1833. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1834. let o = e === void 0 ? i.len : i.pos + e;
  1835. const a = Xe();
  1836. for (; i.pos < o;) {
  1837. const t = i.uint32();
  1838. switch (t >>> 3) {
  1839. case 1:
  1840. if (t !== 8) break;
  1841. a.sid = i.uint32();
  1842. continue;
  1843. case 2:
  1844. if (t !== 18) break;
  1845. a.name = i.string();
  1846. continue
  1847. }
  1848. if ((t & 7) === 4 || t === 0) break;
  1849. i.skipType(t & 7)
  1850. }
  1851. return a
  1852. }, fromJSON(u) {
  1853. return {sid: n(u.sid) ? globalThis.Number(u.sid) : 0, name: n(u.name) ? globalThis.String(u.name) : ""}
  1854. }, toJSON(u) {
  1855. const e = {};
  1856. return u.sid !== 0 && (e.sid = Math.round(u.sid)), u.name !== "" && (e.name = u.name), e
  1857. }, create(u) {
  1858. return d0.fromPartial(u != null ? u : {})
  1859. }, fromPartial(u) {
  1860. var i, o;
  1861. const e = Xe();
  1862. return e.sid = (i = u.sid) != null ? i : 0, e.name = (o = u.name) != null ? o : "", e
  1863. }
  1864. };
  1865. function Ye() {
  1866. return {error: void 0, peer_info: void 0, enable_trusted_devices: !1}
  1867. }
  1868. const c0 = {
  1869. encode(u, e = r.Writer.create()) {
  1870. return u.error !== void 0 && e.uint32(10).string(u.error), u.peer_info !== void 0 && Y.encode(u.peer_info, e.uint32(18).fork()).ldelim(), u.enable_trusted_devices !== !1 && e.uint32(24).bool(u.enable_trusted_devices), e
  1871. }, decode(u, e) {
  1872. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1873. let o = e === void 0 ? i.len : i.pos + e;
  1874. const a = Ye();
  1875. for (; i.pos < o;) {
  1876. const t = i.uint32();
  1877. switch (t >>> 3) {
  1878. case 1:
  1879. if (t !== 10) break;
  1880. a.error = i.string();
  1881. continue;
  1882. case 2:
  1883. if (t !== 18) break;
  1884. a.peer_info = Y.decode(i, i.uint32());
  1885. continue;
  1886. case 3:
  1887. if (t !== 24) break;
  1888. a.enable_trusted_devices = i.bool();
  1889. continue
  1890. }
  1891. if ((t & 7) === 4 || t === 0) break;
  1892. i.skipType(t & 7)
  1893. }
  1894. return a
  1895. }, fromJSON(u) {
  1896. return {
  1897. error: n(u.error) ? globalThis.String(u.error) : void 0,
  1898. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  1899. enable_trusted_devices: n(u.enable_trusted_devices) ? globalThis.Boolean(u.enable_trusted_devices) : !1
  1900. }
  1901. }, toJSON(u) {
  1902. const e = {};
  1903. return u.error !== void 0 && (e.error = u.error), u.peer_info !== void 0 && (e.peer_info = Y.toJSON(u.peer_info)), u.enable_trusted_devices !== !1 && (e.enable_trusted_devices = u.enable_trusted_devices), e
  1904. }, create(u) {
  1905. return c0.fromPartial(u != null ? u : {})
  1906. }, fromPartial(u) {
  1907. var i, o;
  1908. const e = Ye();
  1909. return e.error = (i = u.error) != null ? i : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? Y.fromPartial(u.peer_info) : void 0, e.enable_trusted_devices = (o = u.enable_trusted_devices) != null ? o : !1, e
  1910. }
  1911. };
  1912. function $e() {
  1913. return {scale: 0}
  1914. }
  1915. const C0 = {
  1916. encode(u, e = r.Writer.create()) {
  1917. return u.scale !== 0 && e.uint32(8).int32(u.scale), e
  1918. }, decode(u, e) {
  1919. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1920. let o = e === void 0 ? i.len : i.pos + e;
  1921. const a = $e();
  1922. for (; i.pos < o;) {
  1923. const t = i.uint32();
  1924. switch (t >>> 3) {
  1925. case 1:
  1926. if (t !== 8) break;
  1927. a.scale = i.int32();
  1928. continue
  1929. }
  1930. if ((t & 7) === 4 || t === 0) break;
  1931. i.skipType(t & 7)
  1932. }
  1933. return a
  1934. }, fromJSON(u) {
  1935. return {scale: n(u.scale) ? globalThis.Number(u.scale) : 0}
  1936. }, toJSON(u) {
  1937. const e = {};
  1938. return u.scale !== 0 && (e.scale = Math.round(u.scale)), e
  1939. }, create(u) {
  1940. return C0.fromPartial(u != null ? u : {})
  1941. }, fromPartial(u) {
  1942. var i;
  1943. const e = $e();
  1944. return e.scale = (i = u.scale) != null ? i : 0, e
  1945. }
  1946. };
  1947. function u3() {
  1948. return {x: 0, y: 0}
  1949. }
  1950. const p0 = {
  1951. encode(u, e = r.Writer.create()) {
  1952. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1953. }, decode(u, e) {
  1954. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1955. let o = e === void 0 ? i.len : i.pos + e;
  1956. const a = u3();
  1957. for (; i.pos < o;) {
  1958. const t = i.uint32();
  1959. switch (t >>> 3) {
  1960. case 1:
  1961. if (t !== 8) break;
  1962. a.x = i.int32();
  1963. continue;
  1964. case 2:
  1965. if (t !== 16) break;
  1966. a.y = i.int32();
  1967. continue
  1968. }
  1969. if ((t & 7) === 4 || t === 0) break;
  1970. i.skipType(t & 7)
  1971. }
  1972. return a
  1973. }, fromJSON(u) {
  1974. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  1975. }, toJSON(u) {
  1976. const e = {};
  1977. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  1978. }, create(u) {
  1979. return p0.fromPartial(u != null ? u : {})
  1980. }, fromPartial(u) {
  1981. var i, o;
  1982. const e = u3();
  1983. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  1984. }
  1985. };
  1986. function e3() {
  1987. return {x: 0, y: 0}
  1988. }
  1989. const D0 = {
  1990. encode(u, e = r.Writer.create()) {
  1991. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1992. }, decode(u, e) {
  1993. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1994. let o = e === void 0 ? i.len : i.pos + e;
  1995. const a = e3();
  1996. for (; i.pos < o;) {
  1997. const t = i.uint32();
  1998. switch (t >>> 3) {
  1999. case 1:
  2000. if (t !== 8) break;
  2001. a.x = i.int32();
  2002. continue;
  2003. case 2:
  2004. if (t !== 16) break;
  2005. a.y = i.int32();
  2006. continue
  2007. }
  2008. if ((t & 7) === 4 || t === 0) break;
  2009. i.skipType(t & 7)
  2010. }
  2011. return a
  2012. }, fromJSON(u) {
  2013. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2014. }, toJSON(u) {
  2015. const e = {};
  2016. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2017. }, create(u) {
  2018. return D0.fromPartial(u != null ? u : {})
  2019. }, fromPartial(u) {
  2020. var i, o;
  2021. const e = e3();
  2022. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2023. }
  2024. };
  2025. function i3() {
  2026. return {x: 0, y: 0}
  2027. }
  2028. const B0 = {
  2029. encode(u, e = r.Writer.create()) {
  2030. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2031. }, decode(u, e) {
  2032. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2033. let o = e === void 0 ? i.len : i.pos + e;
  2034. const a = i3();
  2035. for (; i.pos < o;) {
  2036. const t = i.uint32();
  2037. switch (t >>> 3) {
  2038. case 1:
  2039. if (t !== 8) break;
  2040. a.x = i.int32();
  2041. continue;
  2042. case 2:
  2043. if (t !== 16) break;
  2044. a.y = i.int32();
  2045. continue
  2046. }
  2047. if ((t & 7) === 4 || t === 0) break;
  2048. i.skipType(t & 7)
  2049. }
  2050. return a
  2051. }, fromJSON(u) {
  2052. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2053. }, toJSON(u) {
  2054. const e = {};
  2055. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2056. }, create(u) {
  2057. return B0.fromPartial(u != null ? u : {})
  2058. }, fromPartial(u) {
  2059. var i, o;
  2060. const e = i3();
  2061. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2062. }
  2063. };
  2064. function t3() {
  2065. return {scale_update: void 0, pan_start: void 0, pan_update: void 0, pan_end: void 0}
  2066. }
  2067. const A0 = {
  2068. encode(u, e = r.Writer.create()) {
  2069. return u.scale_update !== void 0 && C0.encode(u.scale_update, e.uint32(10).fork()).ldelim(), u.pan_start !== void 0 && p0.encode(u.pan_start, e.uint32(18).fork()).ldelim(), u.pan_update !== void 0 && D0.encode(u.pan_update, e.uint32(26).fork()).ldelim(), u.pan_end !== void 0 && B0.encode(u.pan_end, e.uint32(34).fork()).ldelim(), e
  2070. }, decode(u, e) {
  2071. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2072. let o = e === void 0 ? i.len : i.pos + e;
  2073. const a = t3();
  2074. for (; i.pos < o;) {
  2075. const t = i.uint32();
  2076. switch (t >>> 3) {
  2077. case 1:
  2078. if (t !== 10) break;
  2079. a.scale_update = C0.decode(i, i.uint32());
  2080. continue;
  2081. case 2:
  2082. if (t !== 18) break;
  2083. a.pan_start = p0.decode(i, i.uint32());
  2084. continue;
  2085. case 3:
  2086. if (t !== 26) break;
  2087. a.pan_update = D0.decode(i, i.uint32());
  2088. continue;
  2089. case 4:
  2090. if (t !== 34) break;
  2091. a.pan_end = B0.decode(i, i.uint32());
  2092. continue
  2093. }
  2094. if ((t & 7) === 4 || t === 0) break;
  2095. i.skipType(t & 7)
  2096. }
  2097. return a
  2098. }, fromJSON(u) {
  2099. return {
  2100. scale_update: n(u.scale_update) ? C0.fromJSON(u.scale_update) : void 0,
  2101. pan_start: n(u.pan_start) ? p0.fromJSON(u.pan_start) : void 0,
  2102. pan_update: n(u.pan_update) ? D0.fromJSON(u.pan_update) : void 0,
  2103. pan_end: n(u.pan_end) ? B0.fromJSON(u.pan_end) : void 0
  2104. }
  2105. }, toJSON(u) {
  2106. const e = {};
  2107. return u.scale_update !== void 0 && (e.scale_update = C0.toJSON(u.scale_update)), u.pan_start !== void 0 && (e.pan_start = p0.toJSON(u.pan_start)), u.pan_update !== void 0 && (e.pan_update = D0.toJSON(u.pan_update)), u.pan_end !== void 0 && (e.pan_end = B0.toJSON(u.pan_end)), e
  2108. }, create(u) {
  2109. return A0.fromPartial(u != null ? u : {})
  2110. }, fromPartial(u) {
  2111. const e = t3();
  2112. return e.scale_update = u.scale_update !== void 0 && u.scale_update !== null ? C0.fromPartial(u.scale_update) : void 0, e.pan_start = u.pan_start !== void 0 && u.pan_start !== null ? p0.fromPartial(u.pan_start) : void 0, e.pan_update = u.pan_update !== void 0 && u.pan_update !== null ? D0.fromPartial(u.pan_update) : void 0, e.pan_end = u.pan_end !== void 0 && u.pan_end !== null ? B0.fromPartial(u.pan_end) : void 0, e
  2113. }
  2114. };
  2115. function a3() {
  2116. return {touch_event: void 0, modifiers: []}
  2117. }
  2118. const m0 = {
  2119. encode(u, e = r.Writer.create()) {
  2120. u.touch_event !== void 0 && A0.encode(u.touch_event, e.uint32(10).fork()).ldelim(), e.uint32(18).fork();
  2121. for (const i of u.modifiers) e.int32(i);
  2122. return e.ldelim(), e
  2123. }, decode(u, e) {
  2124. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2125. let o = e === void 0 ? i.len : i.pos + e;
  2126. const a = a3();
  2127. for (; i.pos < o;) {
  2128. const t = i.uint32();
  2129. switch (t >>> 3) {
  2130. case 1:
  2131. if (t !== 10) break;
  2132. a.touch_event = A0.decode(i, i.uint32());
  2133. continue;
  2134. case 2:
  2135. if (t === 16) {
  2136. a.modifiers.push(i.int32());
  2137. continue
  2138. }
  2139. if (t === 18) {
  2140. const s = i.uint32() + i.pos;
  2141. for (; i.pos < s;) a.modifiers.push(i.int32());
  2142. continue
  2143. }
  2144. break
  2145. }
  2146. if ((t & 7) === 4 || t === 0) break;
  2147. i.skipType(t & 7)
  2148. }
  2149. return a
  2150. }, fromJSON(u) {
  2151. return {
  2152. touch_event: n(u.touch_event) ? A0.fromJSON(u.touch_event) : void 0,
  2153. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => A4(e)) : []
  2154. }
  2155. }, toJSON(u) {
  2156. var i;
  2157. const e = {};
  2158. return u.touch_event !== void 0 && (e.touch_event = A0.toJSON(u.touch_event)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => R4(o))), e
  2159. }, create(u) {
  2160. return m0.fromPartial(u != null ? u : {})
  2161. }, fromPartial(u) {
  2162. var i;
  2163. const e = a3();
  2164. return e.touch_event = u.touch_event !== void 0 && u.touch_event !== null ? A0.fromPartial(u.touch_event) : void 0, e.modifiers = ((i = u.modifiers) == null ? void 0 : i.map(o => o)) || [], e
  2165. }
  2166. };
  2167. function o3() {
  2168. return {mask: 0, x: 0, y: 0, modifiers: []}
  2169. }
  2170. const ku = {
  2171. encode(u, e = r.Writer.create()) {
  2172. u.mask !== 0 && e.uint32(8).int32(u.mask), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), e.uint32(34).fork();
  2173. for (const i of u.modifiers) e.int32(i);
  2174. return e.ldelim(), e
  2175. }, decode(u, e) {
  2176. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2177. let o = e === void 0 ? i.len : i.pos + e;
  2178. const a = o3();
  2179. for (; i.pos < o;) {
  2180. const t = i.uint32();
  2181. switch (t >>> 3) {
  2182. case 1:
  2183. if (t !== 8) break;
  2184. a.mask = i.int32();
  2185. continue;
  2186. case 2:
  2187. if (t !== 16) break;
  2188. a.x = i.sint32();
  2189. continue;
  2190. case 3:
  2191. if (t !== 24) break;
  2192. a.y = i.sint32();
  2193. continue;
  2194. case 4:
  2195. if (t === 32) {
  2196. a.modifiers.push(i.int32());
  2197. continue
  2198. }
  2199. if (t === 34) {
  2200. const s = i.uint32() + i.pos;
  2201. for (; i.pos < s;) a.modifiers.push(i.int32());
  2202. continue
  2203. }
  2204. break
  2205. }
  2206. if ((t & 7) === 4 || t === 0) break;
  2207. i.skipType(t & 7)
  2208. }
  2209. return a
  2210. }, fromJSON(u) {
  2211. return {
  2212. mask: n(u.mask) ? globalThis.Number(u.mask) : 0,
  2213. x: n(u.x) ? globalThis.Number(u.x) : 0,
  2214. y: n(u.y) ? globalThis.Number(u.y) : 0,
  2215. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => A4(e)) : []
  2216. }
  2217. }, toJSON(u) {
  2218. var i;
  2219. const e = {};
  2220. return u.mask !== 0 && (e.mask = Math.round(u.mask)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => R4(o))), e
  2221. }, create(u) {
  2222. return ku.fromPartial(u != null ? u : {})
  2223. }, fromPartial(u) {
  2224. var i, o, a, t;
  2225. const e = o3();
  2226. return e.mask = (i = u.mask) != null ? i : 0, e.x = (o = u.x) != null ? o : 0, e.y = (a = u.y) != null ? a : 0, e.modifiers = ((t = u.modifiers) == null ? void 0 : t.map(s => s)) || [], e
  2227. }
  2228. };
  2229. function n3() {
  2230. return {
  2231. down: !1,
  2232. press: !1,
  2233. control_key: void 0,
  2234. chr: void 0,
  2235. unicode: void 0,
  2236. seq: void 0,
  2237. win2win_hotkey: void 0,
  2238. modifiers: [],
  2239. mode: 0
  2240. }
  2241. }
  2242. const w = {
  2243. encode(u, e = r.Writer.create()) {
  2244. u.down !== !1 && e.uint32(8).bool(u.down), u.press !== !1 && e.uint32(16).bool(u.press), u.control_key !== void 0 && e.uint32(24).int32(u.control_key), u.chr !== void 0 && e.uint32(32).uint32(u.chr), u.unicode !== void 0 && e.uint32(40).uint32(u.unicode), u.seq !== void 0 && e.uint32(50).string(u.seq), u.win2win_hotkey !== void 0 && e.uint32(56).uint32(u.win2win_hotkey), e.uint32(66).fork();
  2245. for (const i of u.modifiers) e.int32(i);
  2246. return e.ldelim(), u.mode !== 0 && e.uint32(72).int32(u.mode), e
  2247. }, decode(u, e) {
  2248. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2249. let o = e === void 0 ? i.len : i.pos + e;
  2250. const a = n3();
  2251. for (; i.pos < o;) {
  2252. const t = i.uint32();
  2253. switch (t >>> 3) {
  2254. case 1:
  2255. if (t !== 8) break;
  2256. a.down = i.bool();
  2257. continue;
  2258. case 2:
  2259. if (t !== 16) break;
  2260. a.press = i.bool();
  2261. continue;
  2262. case 3:
  2263. if (t !== 24) break;
  2264. a.control_key = i.int32();
  2265. continue;
  2266. case 4:
  2267. if (t !== 32) break;
  2268. a.chr = i.uint32();
  2269. continue;
  2270. case 5:
  2271. if (t !== 40) break;
  2272. a.unicode = i.uint32();
  2273. continue;
  2274. case 6:
  2275. if (t !== 50) break;
  2276. a.seq = i.string();
  2277. continue;
  2278. case 7:
  2279. if (t !== 56) break;
  2280. a.win2win_hotkey = i.uint32();
  2281. continue;
  2282. case 8:
  2283. if (t === 64) {
  2284. a.modifiers.push(i.int32());
  2285. continue
  2286. }
  2287. if (t === 66) {
  2288. const s = i.uint32() + i.pos;
  2289. for (; i.pos < s;) a.modifiers.push(i.int32());
  2290. continue
  2291. }
  2292. break;
  2293. case 9:
  2294. if (t !== 72) break;
  2295. a.mode = i.int32();
  2296. continue
  2297. }
  2298. if ((t & 7) === 4 || t === 0) break;
  2299. i.skipType(t & 7)
  2300. }
  2301. return a
  2302. }, fromJSON(u) {
  2303. return {
  2304. down: n(u.down) ? globalThis.Boolean(u.down) : !1,
  2305. press: n(u.press) ? globalThis.Boolean(u.press) : !1,
  2306. control_key: n(u.control_key) ? A4(u.control_key) : void 0,
  2307. chr: n(u.chr) ? globalThis.Number(u.chr) : void 0,
  2308. unicode: n(u.unicode) ? globalThis.Number(u.unicode) : void 0,
  2309. seq: n(u.seq) ? globalThis.String(u.seq) : void 0,
  2310. win2win_hotkey: n(u.win2win_hotkey) ? globalThis.Number(u.win2win_hotkey) : void 0,
  2311. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => A4(e)) : [],
  2312. mode: n(u.mode) ? aa(u.mode) : 0
  2313. }
  2314. }, toJSON(u) {
  2315. var i;
  2316. const e = {};
  2317. return u.down !== !1 && (e.down = u.down), u.press !== !1 && (e.press = u.press), u.control_key !== void 0 && (e.control_key = R4(u.control_key)), u.chr !== void 0 && (e.chr = Math.round(u.chr)), u.unicode !== void 0 && (e.unicode = Math.round(u.unicode)), u.seq !== void 0 && (e.seq = u.seq), u.win2win_hotkey !== void 0 && (e.win2win_hotkey = Math.round(u.win2win_hotkey)), (i = u.modifiers) != null && i.length && (e.modifiers = u.modifiers.map(o => R4(o))), u.mode !== 0 && (e.mode = oa(u.mode)), e
  2318. }, create(u) {
  2319. return w.fromPartial(u != null ? u : {})
  2320. }, fromPartial(u) {
  2321. var i, o, a, t, s, l, E, c, C;
  2322. const e = n3();
  2323. return e.down = (i = u.down) != null ? i : !1, e.press = (o = u.press) != null ? o : !1, e.control_key = (a = u.control_key) != null ? a : void 0, e.chr = (t = u.chr) != null ? t : void 0, e.unicode = (s = u.unicode) != null ? s : void 0, e.seq = (l = u.seq) != null ? l : void 0, e.win2win_hotkey = (E = u.win2win_hotkey) != null ? E : void 0, e.modifiers = ((c = u.modifiers) == null ? void 0 : c.map(D => D)) || [], e.mode = (C = u.mode) != null ? C : 0, e
  2324. }
  2325. };
  2326. function r3() {
  2327. return {id: 0, hotx: 0, hoty: 0, width: 0, height: 0, colors: new Uint8Array(0)}
  2328. }
  2329. const F0 = {
  2330. encode(u, e = r.Writer.create()) {
  2331. return u.id !== 0 && e.uint32(8).uint64(u.id), u.hotx !== 0 && e.uint32(16).sint32(u.hotx), u.hoty !== 0 && e.uint32(24).sint32(u.hoty), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.colors.length !== 0 && e.uint32(50).bytes(u.colors), e
  2332. }, decode(u, e) {
  2333. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2334. let o = e === void 0 ? i.len : i.pos + e;
  2335. const a = r3();
  2336. for (; i.pos < o;) {
  2337. const t = i.uint32();
  2338. switch (t >>> 3) {
  2339. case 1:
  2340. if (t !== 8) break;
  2341. a.id = V(i.uint64());
  2342. continue;
  2343. case 2:
  2344. if (t !== 16) break;
  2345. a.hotx = i.sint32();
  2346. continue;
  2347. case 3:
  2348. if (t !== 24) break;
  2349. a.hoty = i.sint32();
  2350. continue;
  2351. case 4:
  2352. if (t !== 32) break;
  2353. a.width = i.int32();
  2354. continue;
  2355. case 5:
  2356. if (t !== 40) break;
  2357. a.height = i.int32();
  2358. continue;
  2359. case 6:
  2360. if (t !== 50) break;
  2361. a.colors = i.bytes();
  2362. continue
  2363. }
  2364. if ((t & 7) === 4 || t === 0) break;
  2365. i.skipType(t & 7)
  2366. }
  2367. return a
  2368. }, fromJSON(u) {
  2369. return {
  2370. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2371. hotx: n(u.hotx) ? globalThis.Number(u.hotx) : 0,
  2372. hoty: n(u.hoty) ? globalThis.Number(u.hoty) : 0,
  2373. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2374. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2375. colors: n(u.colors) ? z(u.colors) : new Uint8Array(0)
  2376. }
  2377. }, toJSON(u) {
  2378. const e = {};
  2379. return u.id !== 0 && (e.id = Math.round(u.id)), u.hotx !== 0 && (e.hotx = Math.round(u.hotx)), u.hoty !== 0 && (e.hoty = Math.round(u.hoty)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.colors.length !== 0 && (e.colors = P(u.colors)), e
  2380. }, create(u) {
  2381. return F0.fromPartial(u != null ? u : {})
  2382. }, fromPartial(u) {
  2383. var i, o, a, t, s, l;
  2384. const e = r3();
  2385. return e.id = (i = u.id) != null ? i : 0, e.hotx = (o = u.hotx) != null ? o : 0, e.hoty = (a = u.hoty) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.colors = (l = u.colors) != null ? l : new Uint8Array(0), e
  2386. }
  2387. };
  2388. function s3() {
  2389. return {x: 0, y: 0}
  2390. }
  2391. const _0 = {
  2392. encode(u, e = r.Writer.create()) {
  2393. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), e
  2394. }, decode(u, e) {
  2395. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2396. let o = e === void 0 ? i.len : i.pos + e;
  2397. const a = s3();
  2398. for (; i.pos < o;) {
  2399. const t = i.uint32();
  2400. switch (t >>> 3) {
  2401. case 1:
  2402. if (t !== 8) break;
  2403. a.x = i.sint32();
  2404. continue;
  2405. case 2:
  2406. if (t !== 16) break;
  2407. a.y = i.sint32();
  2408. continue
  2409. }
  2410. if ((t & 7) === 4 || t === 0) break;
  2411. i.skipType(t & 7)
  2412. }
  2413. return a
  2414. }, fromJSON(u) {
  2415. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2416. }, toJSON(u) {
  2417. const e = {};
  2418. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2419. }, create(u) {
  2420. return _0.fromPartial(u != null ? u : {})
  2421. }, fromPartial(u) {
  2422. var i, o;
  2423. const e = s3();
  2424. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2425. }
  2426. };
  2427. function l3() {
  2428. return {salt: "", challenge: ""}
  2429. }
  2430. const v0 = {
  2431. encode(u, e = r.Writer.create()) {
  2432. return u.salt !== "" && e.uint32(10).string(u.salt), u.challenge !== "" && e.uint32(18).string(u.challenge), e
  2433. }, decode(u, e) {
  2434. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2435. let o = e === void 0 ? i.len : i.pos + e;
  2436. const a = l3();
  2437. for (; i.pos < o;) {
  2438. const t = i.uint32();
  2439. switch (t >>> 3) {
  2440. case 1:
  2441. if (t !== 10) break;
  2442. a.salt = i.string();
  2443. continue;
  2444. case 2:
  2445. if (t !== 18) break;
  2446. a.challenge = i.string();
  2447. continue
  2448. }
  2449. if ((t & 7) === 4 || t === 0) break;
  2450. i.skipType(t & 7)
  2451. }
  2452. return a
  2453. }, fromJSON(u) {
  2454. return {
  2455. salt: n(u.salt) ? globalThis.String(u.salt) : "",
  2456. challenge: n(u.challenge) ? globalThis.String(u.challenge) : ""
  2457. }
  2458. }, toJSON(u) {
  2459. const e = {};
  2460. return u.salt !== "" && (e.salt = u.salt), u.challenge !== "" && (e.challenge = u.challenge), e
  2461. }, create(u) {
  2462. return v0.fromPartial(u != null ? u : {})
  2463. }, fromPartial(u) {
  2464. var i, o;
  2465. const e = l3();
  2466. return e.salt = (i = u.salt) != null ? i : "", e.challenge = (o = u.challenge) != null ? o : "", e
  2467. }
  2468. };
  2469. function E3() {
  2470. return {compress: !1, content: new Uint8Array(0), width: 0, height: 0, format: 0, special_name: ""}
  2471. }
  2472. const U = {
  2473. encode(u, e = r.Writer.create()) {
  2474. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.content.length !== 0 && e.uint32(18).bytes(u.content), u.width !== 0 && e.uint32(24).int32(u.width), u.height !== 0 && e.uint32(32).int32(u.height), u.format !== 0 && e.uint32(40).int32(u.format), u.special_name !== "" && e.uint32(50).string(u.special_name), e
  2475. }, decode(u, e) {
  2476. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2477. let o = e === void 0 ? i.len : i.pos + e;
  2478. const a = E3();
  2479. for (; i.pos < o;) {
  2480. const t = i.uint32();
  2481. switch (t >>> 3) {
  2482. case 1:
  2483. if (t !== 8) break;
  2484. a.compress = i.bool();
  2485. continue;
  2486. case 2:
  2487. if (t !== 18) break;
  2488. a.content = i.bytes();
  2489. continue;
  2490. case 3:
  2491. if (t !== 24) break;
  2492. a.width = i.int32();
  2493. continue;
  2494. case 4:
  2495. if (t !== 32) break;
  2496. a.height = i.int32();
  2497. continue;
  2498. case 5:
  2499. if (t !== 40) break;
  2500. a.format = i.int32();
  2501. continue;
  2502. case 6:
  2503. if (t !== 50) break;
  2504. a.special_name = i.string();
  2505. continue
  2506. }
  2507. if ((t & 7) === 4 || t === 0) break;
  2508. i.skipType(t & 7)
  2509. }
  2510. return a
  2511. }, fromJSON(u) {
  2512. return {
  2513. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  2514. content: n(u.content) ? z(u.content) : new Uint8Array(0),
  2515. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2516. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2517. format: n(u.format) ? na(u.format) : 0,
  2518. special_name: n(u.special_name) ? globalThis.String(u.special_name) : ""
  2519. }
  2520. }, toJSON(u) {
  2521. const e = {};
  2522. return u.compress !== !1 && (e.compress = u.compress), u.content.length !== 0 && (e.content = P(u.content)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.format !== 0 && (e.format = ra(u.format)), u.special_name !== "" && (e.special_name = u.special_name), e
  2523. }, create(u) {
  2524. return U.fromPartial(u != null ? u : {})
  2525. }, fromPartial(u) {
  2526. var i, o, a, t, s, l;
  2527. const e = E3();
  2528. return e.compress = (i = u.compress) != null ? i : !1, e.content = (o = u.content) != null ? o : new Uint8Array(0), e.width = (a = u.width) != null ? a : 0, e.height = (t = u.height) != null ? t : 0, e.format = (s = u.format) != null ? s : 0, e.special_name = (l = u.special_name) != null ? l : "", e
  2529. }
  2530. };
  2531. function d3() {
  2532. return {clipboards: []}
  2533. }
  2534. const gu = {
  2535. encode(u, e = r.Writer.create()) {
  2536. for (const i of u.clipboards) U.encode(i, e.uint32(10).fork()).ldelim();
  2537. return e
  2538. }, decode(u, e) {
  2539. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2540. let o = e === void 0 ? i.len : i.pos + e;
  2541. const a = d3();
  2542. for (; i.pos < o;) {
  2543. const t = i.uint32();
  2544. switch (t >>> 3) {
  2545. case 1:
  2546. if (t !== 10) break;
  2547. a.clipboards.push(U.decode(i, i.uint32()));
  2548. continue
  2549. }
  2550. if ((t & 7) === 4 || t === 0) break;
  2551. i.skipType(t & 7)
  2552. }
  2553. return a
  2554. }, fromJSON(u) {
  2555. return {clipboards: globalThis.Array.isArray(u == null ? void 0 : u.clipboards) ? u.clipboards.map(e => U.fromJSON(e)) : []}
  2556. }, toJSON(u) {
  2557. var i;
  2558. const e = {};
  2559. return (i = u.clipboards) != null && i.length && (e.clipboards = u.clipboards.map(o => U.toJSON(o))), e
  2560. }, create(u) {
  2561. return gu.fromPartial(u != null ? u : {})
  2562. }, fromPartial(u) {
  2563. var i;
  2564. const e = d3();
  2565. return e.clipboards = ((i = u.clipboards) == null ? void 0 : i.map(o => U.fromPartial(o))) || [], e
  2566. }
  2567. };
  2568. function c3() {
  2569. return {entry_type: 0, name: "", is_hidden: !1, size: 0, modified_time: 0}
  2570. }
  2571. const W = {
  2572. encode(u, e = r.Writer.create()) {
  2573. return u.entry_type !== 0 && e.uint32(8).int32(u.entry_type), u.name !== "" && e.uint32(18).string(u.name), u.is_hidden !== !1 && e.uint32(24).bool(u.is_hidden), u.size !== 0 && e.uint32(32).uint64(u.size), u.modified_time !== 0 && e.uint32(40).uint64(u.modified_time), e
  2574. }, decode(u, e) {
  2575. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2576. let o = e === void 0 ? i.len : i.pos + e;
  2577. const a = c3();
  2578. for (; i.pos < o;) {
  2579. const t = i.uint32();
  2580. switch (t >>> 3) {
  2581. case 1:
  2582. if (t !== 8) break;
  2583. a.entry_type = i.int32();
  2584. continue;
  2585. case 2:
  2586. if (t !== 18) break;
  2587. a.name = i.string();
  2588. continue;
  2589. case 3:
  2590. if (t !== 24) break;
  2591. a.is_hidden = i.bool();
  2592. continue;
  2593. case 4:
  2594. if (t !== 32) break;
  2595. a.size = V(i.uint64());
  2596. continue;
  2597. case 5:
  2598. if (t !== 40) break;
  2599. a.modified_time = V(i.uint64());
  2600. continue
  2601. }
  2602. if ((t & 7) === 4 || t === 0) break;
  2603. i.skipType(t & 7)
  2604. }
  2605. return a
  2606. }, fromJSON(u) {
  2607. return {
  2608. entry_type: n(u.entry_type) ? sa(u.entry_type) : 0,
  2609. name: n(u.name) ? globalThis.String(u.name) : "",
  2610. is_hidden: n(u.is_hidden) ? globalThis.Boolean(u.is_hidden) : !1,
  2611. size: n(u.size) ? globalThis.Number(u.size) : 0,
  2612. modified_time: n(u.modified_time) ? globalThis.Number(u.modified_time) : 0
  2613. }
  2614. }, toJSON(u) {
  2615. const e = {};
  2616. return u.entry_type !== 0 && (e.entry_type = la(u.entry_type)), u.name !== "" && (e.name = u.name), u.is_hidden !== !1 && (e.is_hidden = u.is_hidden), u.size !== 0 && (e.size = Math.round(u.size)), u.modified_time !== 0 && (e.modified_time = Math.round(u.modified_time)), e
  2617. }, create(u) {
  2618. return W.fromPartial(u != null ? u : {})
  2619. }, fromPartial(u) {
  2620. var i, o, a, t, s;
  2621. const e = c3();
  2622. return e.entry_type = (i = u.entry_type) != null ? i : 0, e.name = (o = u.name) != null ? o : "", e.is_hidden = (a = u.is_hidden) != null ? a : !1, e.size = (t = u.size) != null ? t : 0, e.modified_time = (s = u.modified_time) != null ? s : 0, e
  2623. }
  2624. };
  2625. function C3() {
  2626. return {id: 0, path: "", entries: []}
  2627. }
  2628. const k0 = {
  2629. encode(u, e = r.Writer.create()) {
  2630. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  2631. for (const i of u.entries) W.encode(i, e.uint32(26).fork()).ldelim();
  2632. return e
  2633. }, decode(u, e) {
  2634. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2635. let o = e === void 0 ? i.len : i.pos + e;
  2636. const a = C3();
  2637. for (; i.pos < o;) {
  2638. const t = i.uint32();
  2639. switch (t >>> 3) {
  2640. case 1:
  2641. if (t !== 8) break;
  2642. a.id = i.int32();
  2643. continue;
  2644. case 2:
  2645. if (t !== 18) break;
  2646. a.path = i.string();
  2647. continue;
  2648. case 3:
  2649. if (t !== 26) break;
  2650. a.entries.push(W.decode(i, i.uint32()));
  2651. continue
  2652. }
  2653. if ((t & 7) === 4 || t === 0) break;
  2654. i.skipType(t & 7)
  2655. }
  2656. return a
  2657. }, fromJSON(u) {
  2658. return {
  2659. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2660. path: n(u.path) ? globalThis.String(u.path) : "",
  2661. entries: globalThis.Array.isArray(u == null ? void 0 : u.entries) ? u.entries.map(e => W.fromJSON(e)) : []
  2662. }
  2663. }, toJSON(u) {
  2664. var i;
  2665. const e = {};
  2666. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.entries) != null && i.length && (e.entries = u.entries.map(o => W.toJSON(o))), e
  2667. }, create(u) {
  2668. return k0.fromPartial(u != null ? u : {})
  2669. }, fromPartial(u) {
  2670. var i, o, a;
  2671. const e = C3();
  2672. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.entries = ((a = u.entries) == null ? void 0 : a.map(t => W.fromPartial(t))) || [], e
  2673. }
  2674. };
  2675. function p3() {
  2676. return {path: "", include_hidden: !1}
  2677. }
  2678. const hu = {
  2679. encode(u, e = r.Writer.create()) {
  2680. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2681. }, decode(u, e) {
  2682. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2683. let o = e === void 0 ? i.len : i.pos + e;
  2684. const a = p3();
  2685. for (; i.pos < o;) {
  2686. const t = i.uint32();
  2687. switch (t >>> 3) {
  2688. case 1:
  2689. if (t !== 10) break;
  2690. a.path = i.string();
  2691. continue;
  2692. case 2:
  2693. if (t !== 16) break;
  2694. a.include_hidden = i.bool();
  2695. continue
  2696. }
  2697. if ((t & 7) === 4 || t === 0) break;
  2698. i.skipType(t & 7)
  2699. }
  2700. return a
  2701. }, fromJSON(u) {
  2702. return {
  2703. path: n(u.path) ? globalThis.String(u.path) : "",
  2704. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2705. }
  2706. }, toJSON(u) {
  2707. const e = {};
  2708. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2709. }, create(u) {
  2710. return hu.fromPartial(u != null ? u : {})
  2711. }, fromPartial(u) {
  2712. var i, o;
  2713. const e = p3();
  2714. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (o = u.include_hidden) != null ? o : !1, e
  2715. }
  2716. };
  2717. function D3() {
  2718. return {id: 0, path: "", include_hidden: !1}
  2719. }
  2720. const fu = {
  2721. encode(u, e = r.Writer.create()) {
  2722. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), e
  2723. }, decode(u, e) {
  2724. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2725. let o = e === void 0 ? i.len : i.pos + e;
  2726. const a = D3();
  2727. for (; i.pos < o;) {
  2728. const t = i.uint32();
  2729. switch (t >>> 3) {
  2730. case 1:
  2731. if (t !== 8) break;
  2732. a.id = i.int32();
  2733. continue;
  2734. case 2:
  2735. if (t !== 18) break;
  2736. a.path = i.string();
  2737. continue;
  2738. case 3:
  2739. if (t !== 24) break;
  2740. a.include_hidden = i.bool();
  2741. continue
  2742. }
  2743. if ((t & 7) === 4 || t === 0) break;
  2744. i.skipType(t & 7)
  2745. }
  2746. return a
  2747. }, fromJSON(u) {
  2748. return {
  2749. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2750. path: n(u.path) ? globalThis.String(u.path) : "",
  2751. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2752. }
  2753. }, toJSON(u) {
  2754. const e = {};
  2755. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2756. }, create(u) {
  2757. return fu.fromPartial(u != null ? u : {})
  2758. }, fromPartial(u) {
  2759. var i, o, a;
  2760. const e = D3();
  2761. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e
  2762. }
  2763. };
  2764. function B3() {
  2765. return {id: 0, path: "", new_name: ""}
  2766. }
  2767. const xu = {
  2768. encode(u, e = r.Writer.create()) {
  2769. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.new_name !== "" && e.uint32(26).string(u.new_name), e
  2770. }, decode(u, e) {
  2771. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2772. let o = e === void 0 ? i.len : i.pos + e;
  2773. const a = B3();
  2774. for (; i.pos < o;) {
  2775. const t = i.uint32();
  2776. switch (t >>> 3) {
  2777. case 1:
  2778. if (t !== 8) break;
  2779. a.id = i.int32();
  2780. continue;
  2781. case 2:
  2782. if (t !== 18) break;
  2783. a.path = i.string();
  2784. continue;
  2785. case 3:
  2786. if (t !== 26) break;
  2787. a.new_name = i.string();
  2788. continue
  2789. }
  2790. if ((t & 7) === 4 || t === 0) break;
  2791. i.skipType(t & 7)
  2792. }
  2793. return a
  2794. }, fromJSON(u) {
  2795. return {
  2796. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2797. path: n(u.path) ? globalThis.String(u.path) : "",
  2798. new_name: n(u.new_name) ? globalThis.String(u.new_name) : ""
  2799. }
  2800. }, toJSON(u) {
  2801. const e = {};
  2802. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.new_name !== "" && (e.new_name = u.new_name), e
  2803. }, create(u) {
  2804. return xu.fromPartial(u != null ? u : {})
  2805. }, fromPartial(u) {
  2806. var i, o, a;
  2807. const e = B3();
  2808. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.new_name = (a = u.new_name) != null ? a : "", e
  2809. }
  2810. };
  2811. function A3() {
  2812. return {
  2813. read_dir: void 0,
  2814. send: void 0,
  2815. receive: void 0,
  2816. create: void 0,
  2817. remove_dir: void 0,
  2818. remove_file: void 0,
  2819. all_files: void 0,
  2820. cancel: void 0,
  2821. send_confirm: void 0,
  2822. rename: void 0
  2823. }
  2824. }
  2825. const T = {
  2826. encode(u, e = r.Writer.create()) {
  2827. return u.read_dir !== void 0 && hu.encode(u.read_dir, e.uint32(10).fork()).ldelim(), u.send !== void 0 && zu.encode(u.send, e.uint32(18).fork()).ldelim(), u.receive !== void 0 && Ru.encode(u.receive, e.uint32(26).fork()).ldelim(), u.create !== void 0 && ju.encode(u.create, e.uint32(34).fork()).ldelim(), u.remove_dir !== void 0 && Iu.encode(u.remove_dir, e.uint32(42).fork()).ldelim(), u.remove_file !== void 0 && Tu.encode(u.remove_file, e.uint32(50).fork()).ldelim(), u.all_files !== void 0 && fu.encode(u.all_files, e.uint32(58).fork()).ldelim(), u.cancel !== void 0 && yu.encode(u.cancel, e.uint32(66).fork()).ldelim(), u.send_confirm !== void 0 && cu.encode(u.send_confirm, e.uint32(74).fork()).ldelim(), u.rename !== void 0 && xu.encode(u.rename, e.uint32(82).fork()).ldelim(), e
  2828. }, decode(u, e) {
  2829. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2830. let o = e === void 0 ? i.len : i.pos + e;
  2831. const a = A3();
  2832. for (; i.pos < o;) {
  2833. const t = i.uint32();
  2834. switch (t >>> 3) {
  2835. case 1:
  2836. if (t !== 10) break;
  2837. a.read_dir = hu.decode(i, i.uint32());
  2838. continue;
  2839. case 2:
  2840. if (t !== 18) break;
  2841. a.send = zu.decode(i, i.uint32());
  2842. continue;
  2843. case 3:
  2844. if (t !== 26) break;
  2845. a.receive = Ru.decode(i, i.uint32());
  2846. continue;
  2847. case 4:
  2848. if (t !== 34) break;
  2849. a.create = ju.decode(i, i.uint32());
  2850. continue;
  2851. case 5:
  2852. if (t !== 42) break;
  2853. a.remove_dir = Iu.decode(i, i.uint32());
  2854. continue;
  2855. case 6:
  2856. if (t !== 50) break;
  2857. a.remove_file = Tu.decode(i, i.uint32());
  2858. continue;
  2859. case 7:
  2860. if (t !== 58) break;
  2861. a.all_files = fu.decode(i, i.uint32());
  2862. continue;
  2863. case 8:
  2864. if (t !== 66) break;
  2865. a.cancel = yu.decode(i, i.uint32());
  2866. continue;
  2867. case 9:
  2868. if (t !== 74) break;
  2869. a.send_confirm = cu.decode(i, i.uint32());
  2870. continue;
  2871. case 10:
  2872. if (t !== 82) break;
  2873. a.rename = xu.decode(i, i.uint32());
  2874. continue
  2875. }
  2876. if ((t & 7) === 4 || t === 0) break;
  2877. i.skipType(t & 7)
  2878. }
  2879. return a
  2880. }, fromJSON(u) {
  2881. return {
  2882. read_dir: n(u.read_dir) ? hu.fromJSON(u.read_dir) : void 0,
  2883. send: n(u.send) ? zu.fromJSON(u.send) : void 0,
  2884. receive: n(u.receive) ? Ru.fromJSON(u.receive) : void 0,
  2885. create: n(u.create) ? ju.fromJSON(u.create) : void 0,
  2886. remove_dir: n(u.remove_dir) ? Iu.fromJSON(u.remove_dir) : void 0,
  2887. remove_file: n(u.remove_file) ? Tu.fromJSON(u.remove_file) : void 0,
  2888. all_files: n(u.all_files) ? fu.fromJSON(u.all_files) : void 0,
  2889. cancel: n(u.cancel) ? yu.fromJSON(u.cancel) : void 0,
  2890. send_confirm: n(u.send_confirm) ? cu.fromJSON(u.send_confirm) : void 0,
  2891. rename: n(u.rename) ? xu.fromJSON(u.rename) : void 0
  2892. }
  2893. }, toJSON(u) {
  2894. const e = {};
  2895. return u.read_dir !== void 0 && (e.read_dir = hu.toJSON(u.read_dir)), u.send !== void 0 && (e.send = zu.toJSON(u.send)), u.receive !== void 0 && (e.receive = Ru.toJSON(u.receive)), u.create !== void 0 && (e.create = ju.toJSON(u.create)), u.remove_dir !== void 0 && (e.remove_dir = Iu.toJSON(u.remove_dir)), u.remove_file !== void 0 && (e.remove_file = Tu.toJSON(u.remove_file)), u.all_files !== void 0 && (e.all_files = fu.toJSON(u.all_files)), u.cancel !== void 0 && (e.cancel = yu.toJSON(u.cancel)), u.send_confirm !== void 0 && (e.send_confirm = cu.toJSON(u.send_confirm)), u.rename !== void 0 && (e.rename = xu.toJSON(u.rename)), e
  2896. }, create(u) {
  2897. return T.fromPartial(u != null ? u : {})
  2898. }, fromPartial(u) {
  2899. const e = A3();
  2900. return e.read_dir = u.read_dir !== void 0 && u.read_dir !== null ? hu.fromPartial(u.read_dir) : void 0, e.send = u.send !== void 0 && u.send !== null ? zu.fromPartial(u.send) : void 0, e.receive = u.receive !== void 0 && u.receive !== null ? Ru.fromPartial(u.receive) : void 0, e.create = u.create !== void 0 && u.create !== null ? ju.fromPartial(u.create) : void 0, e.remove_dir = u.remove_dir !== void 0 && u.remove_dir !== null ? Iu.fromPartial(u.remove_dir) : void 0, e.remove_file = u.remove_file !== void 0 && u.remove_file !== null ? Tu.fromPartial(u.remove_file) : void 0, e.all_files = u.all_files !== void 0 && u.all_files !== null ? fu.fromPartial(u.all_files) : void 0, e.cancel = u.cancel !== void 0 && u.cancel !== null ? yu.fromPartial(u.cancel) : void 0, e.send_confirm = u.send_confirm !== void 0 && u.send_confirm !== null ? cu.fromPartial(u.send_confirm) : void 0, e.rename = u.rename !== void 0 && u.rename !== null ? xu.fromPartial(u.rename) : void 0, e
  2901. }
  2902. };
  2903. function m3() {
  2904. return {id: 0}
  2905. }
  2906. const yu = {
  2907. encode(u, e = r.Writer.create()) {
  2908. return u.id !== 0 && e.uint32(8).int32(u.id), e
  2909. }, decode(u, e) {
  2910. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2911. let o = e === void 0 ? i.len : i.pos + e;
  2912. const a = m3();
  2913. for (; i.pos < o;) {
  2914. const t = i.uint32();
  2915. switch (t >>> 3) {
  2916. case 1:
  2917. if (t !== 8) break;
  2918. a.id = i.int32();
  2919. continue
  2920. }
  2921. if ((t & 7) === 4 || t === 0) break;
  2922. i.skipType(t & 7)
  2923. }
  2924. return a
  2925. }, fromJSON(u) {
  2926. return {id: n(u.id) ? globalThis.Number(u.id) : 0}
  2927. }, toJSON(u) {
  2928. const e = {};
  2929. return u.id !== 0 && (e.id = Math.round(u.id)), e
  2930. }, create(u) {
  2931. return yu.fromPartial(u != null ? u : {})
  2932. }, fromPartial(u) {
  2933. var i;
  2934. const e = m3();
  2935. return e.id = (i = u.id) != null ? i : 0, e
  2936. }
  2937. };
  2938. function F3() {
  2939. return {dir: void 0, block: void 0, error: void 0, done: void 0, digest: void 0}
  2940. }
  2941. const ou = {
  2942. encode(u, e = r.Writer.create()) {
  2943. return u.dir !== void 0 && k0.encode(u.dir, e.uint32(10).fork()).ldelim(), u.block !== void 0 && wu.encode(u.block, e.uint32(18).fork()).ldelim(), u.error !== void 0 && Su.encode(u.error, e.uint32(26).fork()).ldelim(), u.done !== void 0 && Pu.encode(u.done, e.uint32(34).fork()).ldelim(), u.digest !== void 0 && bu.encode(u.digest, e.uint32(42).fork()).ldelim(), e
  2944. }, decode(u, e) {
  2945. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2946. let o = e === void 0 ? i.len : i.pos + e;
  2947. const a = F3();
  2948. for (; i.pos < o;) {
  2949. const t = i.uint32();
  2950. switch (t >>> 3) {
  2951. case 1:
  2952. if (t !== 10) break;
  2953. a.dir = k0.decode(i, i.uint32());
  2954. continue;
  2955. case 2:
  2956. if (t !== 18) break;
  2957. a.block = wu.decode(i, i.uint32());
  2958. continue;
  2959. case 3:
  2960. if (t !== 26) break;
  2961. a.error = Su.decode(i, i.uint32());
  2962. continue;
  2963. case 4:
  2964. if (t !== 34) break;
  2965. a.done = Pu.decode(i, i.uint32());
  2966. continue;
  2967. case 5:
  2968. if (t !== 42) break;
  2969. a.digest = bu.decode(i, i.uint32());
  2970. continue
  2971. }
  2972. if ((t & 7) === 4 || t === 0) break;
  2973. i.skipType(t & 7)
  2974. }
  2975. return a
  2976. }, fromJSON(u) {
  2977. return {
  2978. dir: n(u.dir) ? k0.fromJSON(u.dir) : void 0,
  2979. block: n(u.block) ? wu.fromJSON(u.block) : void 0,
  2980. error: n(u.error) ? Su.fromJSON(u.error) : void 0,
  2981. done: n(u.done) ? Pu.fromJSON(u.done) : void 0,
  2982. digest: n(u.digest) ? bu.fromJSON(u.digest) : void 0
  2983. }
  2984. }, toJSON(u) {
  2985. const e = {};
  2986. return u.dir !== void 0 && (e.dir = k0.toJSON(u.dir)), u.block !== void 0 && (e.block = wu.toJSON(u.block)), u.error !== void 0 && (e.error = Su.toJSON(u.error)), u.done !== void 0 && (e.done = Pu.toJSON(u.done)), u.digest !== void 0 && (e.digest = bu.toJSON(u.digest)), e
  2987. }, create(u) {
  2988. return ou.fromPartial(u != null ? u : {})
  2989. }, fromPartial(u) {
  2990. const e = F3();
  2991. return e.dir = u.dir !== void 0 && u.dir !== null ? k0.fromPartial(u.dir) : void 0, e.block = u.block !== void 0 && u.block !== null ? wu.fromPartial(u.block) : void 0, e.error = u.error !== void 0 && u.error !== null ? Su.fromPartial(u.error) : void 0, e.done = u.done !== void 0 && u.done !== null ? Pu.fromPartial(u.done) : void 0, e.digest = u.digest !== void 0 && u.digest !== null ? bu.fromPartial(u.digest) : void 0, e
  2992. }
  2993. };
  2994. function _3() {
  2995. return {id: 0, file_num: 0, last_modified: 0, file_size: 0, is_upload: !1, is_identical: !1}
  2996. }
  2997. const bu = {
  2998. encode(u, e = r.Writer.create()) {
  2999. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.last_modified !== 0 && e.uint32(24).uint64(u.last_modified), u.file_size !== 0 && e.uint32(32).uint64(u.file_size), u.is_upload !== !1 && e.uint32(40).bool(u.is_upload), u.is_identical !== !1 && e.uint32(48).bool(u.is_identical), e
  3000. }, decode(u, e) {
  3001. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3002. let o = e === void 0 ? i.len : i.pos + e;
  3003. const a = _3();
  3004. for (; i.pos < o;) {
  3005. const t = i.uint32();
  3006. switch (t >>> 3) {
  3007. case 1:
  3008. if (t !== 8) break;
  3009. a.id = i.int32();
  3010. continue;
  3011. case 2:
  3012. if (t !== 16) break;
  3013. a.file_num = i.sint32();
  3014. continue;
  3015. case 3:
  3016. if (t !== 24) break;
  3017. a.last_modified = V(i.uint64());
  3018. continue;
  3019. case 4:
  3020. if (t !== 32) break;
  3021. a.file_size = V(i.uint64());
  3022. continue;
  3023. case 5:
  3024. if (t !== 40) break;
  3025. a.is_upload = i.bool();
  3026. continue;
  3027. case 6:
  3028. if (t !== 48) break;
  3029. a.is_identical = i.bool();
  3030. continue
  3031. }
  3032. if ((t & 7) === 4 || t === 0) break;
  3033. i.skipType(t & 7)
  3034. }
  3035. return a
  3036. }, fromJSON(u) {
  3037. return {
  3038. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3039. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3040. last_modified: n(u.last_modified) ? globalThis.Number(u.last_modified) : 0,
  3041. file_size: n(u.file_size) ? globalThis.Number(u.file_size) : 0,
  3042. is_upload: n(u.is_upload) ? globalThis.Boolean(u.is_upload) : !1,
  3043. is_identical: n(u.is_identical) ? globalThis.Boolean(u.is_identical) : !1
  3044. }
  3045. }, toJSON(u) {
  3046. const e = {};
  3047. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.last_modified !== 0 && (e.last_modified = Math.round(u.last_modified)), u.file_size !== 0 && (e.file_size = Math.round(u.file_size)), u.is_upload !== !1 && (e.is_upload = u.is_upload), u.is_identical !== !1 && (e.is_identical = u.is_identical), e
  3048. }, create(u) {
  3049. return bu.fromPartial(u != null ? u : {})
  3050. }, fromPartial(u) {
  3051. var i, o, a, t, s, l;
  3052. const e = _3();
  3053. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.last_modified = (a = u.last_modified) != null ? a : 0, e.file_size = (t = u.file_size) != null ? t : 0, e.is_upload = (s = u.is_upload) != null ? s : !1, e.is_identical = (l = u.is_identical) != null ? l : !1, e
  3054. }
  3055. };
  3056. function v3() {
  3057. return {id: 0, file_num: 0, data: new Uint8Array(0), compressed: !1, blk_id: 0}
  3058. }
  3059. const wu = {
  3060. encode(u, e = r.Writer.create()) {
  3061. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.data.length !== 0 && e.uint32(26).bytes(u.data), u.compressed !== !1 && e.uint32(32).bool(u.compressed), u.blk_id !== 0 && e.uint32(40).uint32(u.blk_id), e
  3062. }, decode(u, e) {
  3063. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3064. let o = e === void 0 ? i.len : i.pos + e;
  3065. const a = v3();
  3066. for (; i.pos < o;) {
  3067. const t = i.uint32();
  3068. switch (t >>> 3) {
  3069. case 1:
  3070. if (t !== 8) break;
  3071. a.id = i.int32();
  3072. continue;
  3073. case 2:
  3074. if (t !== 16) break;
  3075. a.file_num = i.sint32();
  3076. continue;
  3077. case 3:
  3078. if (t !== 26) break;
  3079. a.data = i.bytes();
  3080. continue;
  3081. case 4:
  3082. if (t !== 32) break;
  3083. a.compressed = i.bool();
  3084. continue;
  3085. case 5:
  3086. if (t !== 40) break;
  3087. a.blk_id = i.uint32();
  3088. continue
  3089. }
  3090. if ((t & 7) === 4 || t === 0) break;
  3091. i.skipType(t & 7)
  3092. }
  3093. return a
  3094. }, fromJSON(u) {
  3095. return {
  3096. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3097. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3098. data: n(u.data) ? z(u.data) : new Uint8Array(0),
  3099. compressed: n(u.compressed) ? globalThis.Boolean(u.compressed) : !1,
  3100. blk_id: n(u.blk_id) ? globalThis.Number(u.blk_id) : 0
  3101. }
  3102. }, toJSON(u) {
  3103. const e = {};
  3104. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.data.length !== 0 && (e.data = P(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), u.blk_id !== 0 && (e.blk_id = Math.round(u.blk_id)), e
  3105. }, create(u) {
  3106. return wu.fromPartial(u != null ? u : {})
  3107. }, fromPartial(u) {
  3108. var i, o, a, t, s;
  3109. const e = v3();
  3110. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.data = (a = u.data) != null ? a : new Uint8Array(0), e.compressed = (t = u.compressed) != null ? t : !1, e.blk_id = (s = u.blk_id) != null ? s : 0, e
  3111. }
  3112. };
  3113. function k3() {
  3114. return {id: 0, error: "", file_num: 0}
  3115. }
  3116. const Su = {
  3117. encode(u, e = r.Writer.create()) {
  3118. return u.id !== 0 && e.uint32(8).int32(u.id), u.error !== "" && e.uint32(18).string(u.error), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3119. }, decode(u, e) {
  3120. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3121. let o = e === void 0 ? i.len : i.pos + e;
  3122. const a = k3();
  3123. for (; i.pos < o;) {
  3124. const t = i.uint32();
  3125. switch (t >>> 3) {
  3126. case 1:
  3127. if (t !== 8) break;
  3128. a.id = i.int32();
  3129. continue;
  3130. case 2:
  3131. if (t !== 18) break;
  3132. a.error = i.string();
  3133. continue;
  3134. case 3:
  3135. if (t !== 24) break;
  3136. a.file_num = i.sint32();
  3137. continue
  3138. }
  3139. if ((t & 7) === 4 || t === 0) break;
  3140. i.skipType(t & 7)
  3141. }
  3142. return a
  3143. }, fromJSON(u) {
  3144. return {
  3145. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3146. error: n(u.error) ? globalThis.String(u.error) : "",
  3147. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3148. }
  3149. }, toJSON(u) {
  3150. const e = {};
  3151. return u.id !== 0 && (e.id = Math.round(u.id)), u.error !== "" && (e.error = u.error), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3152. }, create(u) {
  3153. return Su.fromPartial(u != null ? u : {})
  3154. }, fromPartial(u) {
  3155. var i, o, a;
  3156. const e = k3();
  3157. return e.id = (i = u.id) != null ? i : 0, e.error = (o = u.error) != null ? o : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3158. }
  3159. };
  3160. function g3() {
  3161. return {id: 0, path: "", include_hidden: !1, file_num: 0}
  3162. }
  3163. const zu = {
  3164. encode(u, e = r.Writer.create()) {
  3165. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.include_hidden !== !1 && e.uint32(24).bool(u.include_hidden), u.file_num !== 0 && e.uint32(32).int32(u.file_num), e
  3166. }, decode(u, e) {
  3167. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3168. let o = e === void 0 ? i.len : i.pos + e;
  3169. const a = g3();
  3170. for (; i.pos < o;) {
  3171. const t = i.uint32();
  3172. switch (t >>> 3) {
  3173. case 1:
  3174. if (t !== 8) break;
  3175. a.id = i.int32();
  3176. continue;
  3177. case 2:
  3178. if (t !== 18) break;
  3179. a.path = i.string();
  3180. continue;
  3181. case 3:
  3182. if (t !== 24) break;
  3183. a.include_hidden = i.bool();
  3184. continue;
  3185. case 4:
  3186. if (t !== 32) break;
  3187. a.file_num = i.int32();
  3188. continue
  3189. }
  3190. if ((t & 7) === 4 || t === 0) break;
  3191. i.skipType(t & 7)
  3192. }
  3193. return a
  3194. }, fromJSON(u) {
  3195. return {
  3196. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3197. path: n(u.path) ? globalThis.String(u.path) : "",
  3198. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1,
  3199. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3200. }
  3201. }, toJSON(u) {
  3202. const e = {};
  3203. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3204. }, create(u) {
  3205. return zu.fromPartial(u != null ? u : {})
  3206. }, fromPartial(u) {
  3207. var i, o, a, t;
  3208. const e = g3();
  3209. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.include_hidden = (a = u.include_hidden) != null ? a : !1, e.file_num = (t = u.file_num) != null ? t : 0, e
  3210. }
  3211. };
  3212. function h3() {
  3213. return {id: 0, file_num: 0, skip: void 0, offset_blk: void 0}
  3214. }
  3215. const cu = {
  3216. encode(u, e = r.Writer.create()) {
  3217. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), u.skip !== void 0 && e.uint32(24).bool(u.skip), u.offset_blk !== void 0 && e.uint32(32).uint32(u.offset_blk), e
  3218. }, decode(u, e) {
  3219. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3220. let o = e === void 0 ? i.len : i.pos + e;
  3221. const a = h3();
  3222. for (; i.pos < o;) {
  3223. const t = i.uint32();
  3224. switch (t >>> 3) {
  3225. case 1:
  3226. if (t !== 8) break;
  3227. a.id = i.int32();
  3228. continue;
  3229. case 2:
  3230. if (t !== 16) break;
  3231. a.file_num = i.sint32();
  3232. continue;
  3233. case 3:
  3234. if (t !== 24) break;
  3235. a.skip = i.bool();
  3236. continue;
  3237. case 4:
  3238. if (t !== 32) break;
  3239. a.offset_blk = i.uint32();
  3240. continue
  3241. }
  3242. if ((t & 7) === 4 || t === 0) break;
  3243. i.skipType(t & 7)
  3244. }
  3245. return a
  3246. }, fromJSON(u) {
  3247. return {
  3248. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3249. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3250. skip: n(u.skip) ? globalThis.Boolean(u.skip) : void 0,
  3251. offset_blk: n(u.offset_blk) ? globalThis.Number(u.offset_blk) : void 0
  3252. }
  3253. }, toJSON(u) {
  3254. const e = {};
  3255. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.skip !== void 0 && (e.skip = u.skip), u.offset_blk !== void 0 && (e.offset_blk = Math.round(u.offset_blk)), e
  3256. }, create(u) {
  3257. return cu.fromPartial(u != null ? u : {})
  3258. }, fromPartial(u) {
  3259. var i, o, a, t;
  3260. const e = h3();
  3261. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e.skip = (a = u.skip) != null ? a : void 0, e.offset_blk = (t = u.offset_blk) != null ? t : void 0, e
  3262. }
  3263. };
  3264. function f3() {
  3265. return {id: 0, file_num: 0}
  3266. }
  3267. const Pu = {
  3268. encode(u, e = r.Writer.create()) {
  3269. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), e
  3270. }, decode(u, e) {
  3271. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3272. let o = e === void 0 ? i.len : i.pos + e;
  3273. const a = f3();
  3274. for (; i.pos < o;) {
  3275. const t = i.uint32();
  3276. switch (t >>> 3) {
  3277. case 1:
  3278. if (t !== 8) break;
  3279. a.id = i.int32();
  3280. continue;
  3281. case 2:
  3282. if (t !== 16) break;
  3283. a.file_num = i.sint32();
  3284. continue
  3285. }
  3286. if ((t & 7) === 4 || t === 0) break;
  3287. i.skipType(t & 7)
  3288. }
  3289. return a
  3290. }, fromJSON(u) {
  3291. return {id: n(u.id) ? globalThis.Number(u.id) : 0, file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0}
  3292. }, toJSON(u) {
  3293. const e = {};
  3294. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3295. }, create(u) {
  3296. return Pu.fromPartial(u != null ? u : {})
  3297. }, fromPartial(u) {
  3298. var i, o;
  3299. const e = f3();
  3300. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e
  3301. }
  3302. };
  3303. function x3() {
  3304. return {id: 0, path: "", files: [], file_num: 0, total_size: 0}
  3305. }
  3306. const Ru = {
  3307. encode(u, e = r.Writer.create()) {
  3308. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  3309. for (const i of u.files) W.encode(i, e.uint32(26).fork()).ldelim();
  3310. return u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.total_size !== 0 && e.uint32(40).uint64(u.total_size), e
  3311. }, decode(u, e) {
  3312. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3313. let o = e === void 0 ? i.len : i.pos + e;
  3314. const a = x3();
  3315. for (; i.pos < o;) {
  3316. const t = i.uint32();
  3317. switch (t >>> 3) {
  3318. case 1:
  3319. if (t !== 8) break;
  3320. a.id = i.int32();
  3321. continue;
  3322. case 2:
  3323. if (t !== 18) break;
  3324. a.path = i.string();
  3325. continue;
  3326. case 3:
  3327. if (t !== 26) break;
  3328. a.files.push(W.decode(i, i.uint32()));
  3329. continue;
  3330. case 4:
  3331. if (t !== 32) break;
  3332. a.file_num = i.int32();
  3333. continue;
  3334. case 5:
  3335. if (t !== 40) break;
  3336. a.total_size = V(i.uint64());
  3337. continue
  3338. }
  3339. if ((t & 7) === 4 || t === 0) break;
  3340. i.skipType(t & 7)
  3341. }
  3342. return a
  3343. }, fromJSON(u) {
  3344. return {
  3345. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3346. path: n(u.path) ? globalThis.String(u.path) : "",
  3347. files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => W.fromJSON(e)) : [],
  3348. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3349. total_size: n(u.total_size) ? globalThis.Number(u.total_size) : 0
  3350. }
  3351. }, toJSON(u) {
  3352. var i;
  3353. const e = {};
  3354. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), (i = u.files) != null && i.length && (e.files = u.files.map(o => W.toJSON(o))), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), u.total_size !== 0 && (e.total_size = Math.round(u.total_size)), e
  3355. }, create(u) {
  3356. return Ru.fromPartial(u != null ? u : {})
  3357. }, fromPartial(u) {
  3358. var i, o, a, t, s;
  3359. const e = x3();
  3360. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.files = ((a = u.files) == null ? void 0 : a.map(l => W.fromPartial(l))) || [], e.file_num = (t = u.file_num) != null ? t : 0, e.total_size = (s = u.total_size) != null ? s : 0, e
  3361. }
  3362. };
  3363. function y3() {
  3364. return {id: 0, path: "", recursive: !1}
  3365. }
  3366. const Iu = {
  3367. encode(u, e = r.Writer.create()) {
  3368. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.recursive !== !1 && e.uint32(24).bool(u.recursive), e
  3369. }, decode(u, e) {
  3370. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3371. let o = e === void 0 ? i.len : i.pos + e;
  3372. const a = y3();
  3373. for (; i.pos < o;) {
  3374. const t = i.uint32();
  3375. switch (t >>> 3) {
  3376. case 1:
  3377. if (t !== 8) break;
  3378. a.id = i.int32();
  3379. continue;
  3380. case 2:
  3381. if (t !== 18) break;
  3382. a.path = i.string();
  3383. continue;
  3384. case 3:
  3385. if (t !== 24) break;
  3386. a.recursive = i.bool();
  3387. continue
  3388. }
  3389. if ((t & 7) === 4 || t === 0) break;
  3390. i.skipType(t & 7)
  3391. }
  3392. return a
  3393. }, fromJSON(u) {
  3394. return {
  3395. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3396. path: n(u.path) ? globalThis.String(u.path) : "",
  3397. recursive: n(u.recursive) ? globalThis.Boolean(u.recursive) : !1
  3398. }
  3399. }, toJSON(u) {
  3400. const e = {};
  3401. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.recursive !== !1 && (e.recursive = u.recursive), e
  3402. }, create(u) {
  3403. return Iu.fromPartial(u != null ? u : {})
  3404. }, fromPartial(u) {
  3405. var i, o, a;
  3406. const e = y3();
  3407. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.recursive = (a = u.recursive) != null ? a : !1, e
  3408. }
  3409. };
  3410. function b3() {
  3411. return {id: 0, path: "", file_num: 0}
  3412. }
  3413. const Tu = {
  3414. encode(u, e = r.Writer.create()) {
  3415. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), u.file_num !== 0 && e.uint32(24).sint32(u.file_num), e
  3416. }, decode(u, e) {
  3417. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3418. let o = e === void 0 ? i.len : i.pos + e;
  3419. const a = b3();
  3420. for (; i.pos < o;) {
  3421. const t = i.uint32();
  3422. switch (t >>> 3) {
  3423. case 1:
  3424. if (t !== 8) break;
  3425. a.id = i.int32();
  3426. continue;
  3427. case 2:
  3428. if (t !== 18) break;
  3429. a.path = i.string();
  3430. continue;
  3431. case 3:
  3432. if (t !== 24) break;
  3433. a.file_num = i.sint32();
  3434. continue
  3435. }
  3436. if ((t & 7) === 4 || t === 0) break;
  3437. i.skipType(t & 7)
  3438. }
  3439. return a
  3440. }, fromJSON(u) {
  3441. return {
  3442. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3443. path: n(u.path) ? globalThis.String(u.path) : "",
  3444. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3445. }
  3446. }, toJSON(u) {
  3447. const e = {};
  3448. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3449. }, create(u) {
  3450. return Tu.fromPartial(u != null ? u : {})
  3451. }, fromPartial(u) {
  3452. var i, o, a;
  3453. const e = b3();
  3454. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e.file_num = (a = u.file_num) != null ? a : 0, e
  3455. }
  3456. };
  3457. function w3() {
  3458. return {id: 0, path: ""}
  3459. }
  3460. const ju = {
  3461. encode(u, e = r.Writer.create()) {
  3462. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), e
  3463. }, decode(u, e) {
  3464. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3465. let o = e === void 0 ? i.len : i.pos + e;
  3466. const a = w3();
  3467. for (; i.pos < o;) {
  3468. const t = i.uint32();
  3469. switch (t >>> 3) {
  3470. case 1:
  3471. if (t !== 8) break;
  3472. a.id = i.int32();
  3473. continue;
  3474. case 2:
  3475. if (t !== 18) break;
  3476. a.path = i.string();
  3477. continue
  3478. }
  3479. if ((t & 7) === 4 || t === 0) break;
  3480. i.skipType(t & 7)
  3481. }
  3482. return a
  3483. }, fromJSON(u) {
  3484. return {id: n(u.id) ? globalThis.Number(u.id) : 0, path: n(u.path) ? globalThis.String(u.path) : ""}
  3485. }, toJSON(u) {
  3486. const e = {};
  3487. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), e
  3488. }, create(u) {
  3489. return ju.fromPartial(u != null ? u : {})
  3490. }, fromPartial(u) {
  3491. var i, o;
  3492. const e = w3();
  3493. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e
  3494. }
  3495. };
  3496. function S3() {
  3497. return {}
  3498. }
  3499. const g0 = {
  3500. encode(u, e = r.Writer.create()) {
  3501. return e
  3502. }, decode(u, e) {
  3503. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3504. let o = e === void 0 ? i.len : i.pos + e;
  3505. const a = S3();
  3506. for (; i.pos < o;) {
  3507. const t = i.uint32();
  3508. if ((t & 7) === 4 || t === 0) break;
  3509. i.skipType(t & 7)
  3510. }
  3511. return a
  3512. }, fromJSON(u) {
  3513. return {}
  3514. }, toJSON(u) {
  3515. return {}
  3516. }, create(u) {
  3517. return g0.fromPartial(u != null ? u : {})
  3518. }, fromPartial(u) {
  3519. return S3()
  3520. }
  3521. };
  3522. function z3() {
  3523. return {id: 0, format: ""}
  3524. }
  3525. const h0 = {
  3526. encode(u, e = r.Writer.create()) {
  3527. return u.id !== 0 && e.uint32(16).int32(u.id), u.format !== "" && e.uint32(26).string(u.format), e
  3528. }, decode(u, e) {
  3529. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3530. let o = e === void 0 ? i.len : i.pos + e;
  3531. const a = z3();
  3532. for (; i.pos < o;) {
  3533. const t = i.uint32();
  3534. switch (t >>> 3) {
  3535. case 2:
  3536. if (t !== 16) break;
  3537. a.id = i.int32();
  3538. continue;
  3539. case 3:
  3540. if (t !== 26) break;
  3541. a.format = i.string();
  3542. continue
  3543. }
  3544. if ((t & 7) === 4 || t === 0) break;
  3545. i.skipType(t & 7)
  3546. }
  3547. return a
  3548. }, fromJSON(u) {
  3549. return {id: n(u.id) ? globalThis.Number(u.id) : 0, format: n(u.format) ? globalThis.String(u.format) : ""}
  3550. }, toJSON(u) {
  3551. const e = {};
  3552. return u.id !== 0 && (e.id = Math.round(u.id)), u.format !== "" && (e.format = u.format), e
  3553. }, create(u) {
  3554. return h0.fromPartial(u != null ? u : {})
  3555. }, fromPartial(u) {
  3556. var i, o;
  3557. const e = z3();
  3558. return e.id = (i = u.id) != null ? i : 0, e.format = (o = u.format) != null ? o : "", e
  3559. }
  3560. };
  3561. function P3() {
  3562. return {formats: []}
  3563. }
  3564. const f0 = {
  3565. encode(u, e = r.Writer.create()) {
  3566. for (const i of u.formats) h0.encode(i, e.uint32(18).fork()).ldelim();
  3567. return e
  3568. }, decode(u, e) {
  3569. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3570. let o = e === void 0 ? i.len : i.pos + e;
  3571. const a = P3();
  3572. for (; i.pos < o;) {
  3573. const t = i.uint32();
  3574. switch (t >>> 3) {
  3575. case 2:
  3576. if (t !== 18) break;
  3577. a.formats.push(h0.decode(i, i.uint32()));
  3578. continue
  3579. }
  3580. if ((t & 7) === 4 || t === 0) break;
  3581. i.skipType(t & 7)
  3582. }
  3583. return a
  3584. }, fromJSON(u) {
  3585. return {formats: globalThis.Array.isArray(u == null ? void 0 : u.formats) ? u.formats.map(e => h0.fromJSON(e)) : []}
  3586. }, toJSON(u) {
  3587. var i;
  3588. const e = {};
  3589. return (i = u.formats) != null && i.length && (e.formats = u.formats.map(o => h0.toJSON(o))), e
  3590. }, create(u) {
  3591. return f0.fromPartial(u != null ? u : {})
  3592. }, fromPartial(u) {
  3593. var i;
  3594. const e = P3();
  3595. return e.formats = ((i = u.formats) == null ? void 0 : i.map(o => h0.fromPartial(o))) || [], e
  3596. }
  3597. };
  3598. function R3() {
  3599. return {msg_flags: 0}
  3600. }
  3601. const x0 = {
  3602. encode(u, e = r.Writer.create()) {
  3603. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), e
  3604. }, decode(u, e) {
  3605. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3606. let o = e === void 0 ? i.len : i.pos + e;
  3607. const a = R3();
  3608. for (; i.pos < o;) {
  3609. const t = i.uint32();
  3610. switch (t >>> 3) {
  3611. case 2:
  3612. if (t !== 16) break;
  3613. a.msg_flags = i.int32();
  3614. continue
  3615. }
  3616. if ((t & 7) === 4 || t === 0) break;
  3617. i.skipType(t & 7)
  3618. }
  3619. return a
  3620. }, fromJSON(u) {
  3621. return {msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0}
  3622. }, toJSON(u) {
  3623. const e = {};
  3624. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), e
  3625. }, create(u) {
  3626. return x0.fromPartial(u != null ? u : {})
  3627. }, fromPartial(u) {
  3628. var i;
  3629. const e = R3();
  3630. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e
  3631. }
  3632. };
  3633. function I3() {
  3634. return {requested_format_id: 0}
  3635. }
  3636. const y0 = {
  3637. encode(u, e = r.Writer.create()) {
  3638. return u.requested_format_id !== 0 && e.uint32(16).int32(u.requested_format_id), e
  3639. }, decode(u, e) {
  3640. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3641. let o = e === void 0 ? i.len : i.pos + e;
  3642. const a = I3();
  3643. for (; i.pos < o;) {
  3644. const t = i.uint32();
  3645. switch (t >>> 3) {
  3646. case 2:
  3647. if (t !== 16) break;
  3648. a.requested_format_id = i.int32();
  3649. continue
  3650. }
  3651. if ((t & 7) === 4 || t === 0) break;
  3652. i.skipType(t & 7)
  3653. }
  3654. return a
  3655. }, fromJSON(u) {
  3656. return {requested_format_id: n(u.requested_format_id) ? globalThis.Number(u.requested_format_id) : 0}
  3657. }, toJSON(u) {
  3658. const e = {};
  3659. return u.requested_format_id !== 0 && (e.requested_format_id = Math.round(u.requested_format_id)), e
  3660. }, create(u) {
  3661. return y0.fromPartial(u != null ? u : {})
  3662. }, fromPartial(u) {
  3663. var i;
  3664. const e = I3();
  3665. return e.requested_format_id = (i = u.requested_format_id) != null ? i : 0, e
  3666. }
  3667. };
  3668. function T3() {
  3669. return {msg_flags: 0, format_data: new Uint8Array(0)}
  3670. }
  3671. const b0 = {
  3672. encode(u, e = r.Writer.create()) {
  3673. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), u.format_data.length !== 0 && e.uint32(26).bytes(u.format_data), e
  3674. }, decode(u, e) {
  3675. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3676. let o = e === void 0 ? i.len : i.pos + e;
  3677. const a = T3();
  3678. for (; i.pos < o;) {
  3679. const t = i.uint32();
  3680. switch (t >>> 3) {
  3681. case 2:
  3682. if (t !== 16) break;
  3683. a.msg_flags = i.int32();
  3684. continue;
  3685. case 3:
  3686. if (t !== 26) break;
  3687. a.format_data = i.bytes();
  3688. continue
  3689. }
  3690. if ((t & 7) === 4 || t === 0) break;
  3691. i.skipType(t & 7)
  3692. }
  3693. return a
  3694. }, fromJSON(u) {
  3695. return {
  3696. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3697. format_data: n(u.format_data) ? z(u.format_data) : new Uint8Array(0)
  3698. }
  3699. }, toJSON(u) {
  3700. const e = {};
  3701. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.format_data.length !== 0 && (e.format_data = P(u.format_data)), e
  3702. }, create(u) {
  3703. return b0.fromPartial(u != null ? u : {})
  3704. }, fromPartial(u) {
  3705. var i, o;
  3706. const e = T3();
  3707. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.format_data = (o = u.format_data) != null ? o : new Uint8Array(0), e
  3708. }
  3709. };
  3710. function j3() {
  3711. return {
  3712. stream_id: 0,
  3713. list_index: 0,
  3714. dw_flags: 0,
  3715. n_position_low: 0,
  3716. n_position_high: 0,
  3717. cb_requested: 0,
  3718. have_clip_data_id: !1,
  3719. clip_data_id: 0
  3720. }
  3721. }
  3722. const w0 = {
  3723. encode(u, e = r.Writer.create()) {
  3724. return u.stream_id !== 0 && e.uint32(16).int32(u.stream_id), u.list_index !== 0 && e.uint32(24).int32(u.list_index), u.dw_flags !== 0 && e.uint32(32).int32(u.dw_flags), u.n_position_low !== 0 && e.uint32(40).int32(u.n_position_low), u.n_position_high !== 0 && e.uint32(48).int32(u.n_position_high), u.cb_requested !== 0 && e.uint32(56).int32(u.cb_requested), u.have_clip_data_id !== !1 && e.uint32(64).bool(u.have_clip_data_id), u.clip_data_id !== 0 && e.uint32(72).int32(u.clip_data_id), e
  3725. }, decode(u, e) {
  3726. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3727. let o = e === void 0 ? i.len : i.pos + e;
  3728. const a = j3();
  3729. for (; i.pos < o;) {
  3730. const t = i.uint32();
  3731. switch (t >>> 3) {
  3732. case 2:
  3733. if (t !== 16) break;
  3734. a.stream_id = i.int32();
  3735. continue;
  3736. case 3:
  3737. if (t !== 24) break;
  3738. a.list_index = i.int32();
  3739. continue;
  3740. case 4:
  3741. if (t !== 32) break;
  3742. a.dw_flags = i.int32();
  3743. continue;
  3744. case 5:
  3745. if (t !== 40) break;
  3746. a.n_position_low = i.int32();
  3747. continue;
  3748. case 6:
  3749. if (t !== 48) break;
  3750. a.n_position_high = i.int32();
  3751. continue;
  3752. case 7:
  3753. if (t !== 56) break;
  3754. a.cb_requested = i.int32();
  3755. continue;
  3756. case 8:
  3757. if (t !== 64) break;
  3758. a.have_clip_data_id = i.bool();
  3759. continue;
  3760. case 9:
  3761. if (t !== 72) break;
  3762. a.clip_data_id = i.int32();
  3763. continue
  3764. }
  3765. if ((t & 7) === 4 || t === 0) break;
  3766. i.skipType(t & 7)
  3767. }
  3768. return a
  3769. }, fromJSON(u) {
  3770. return {
  3771. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3772. list_index: n(u.list_index) ? globalThis.Number(u.list_index) : 0,
  3773. dw_flags: n(u.dw_flags) ? globalThis.Number(u.dw_flags) : 0,
  3774. n_position_low: n(u.n_position_low) ? globalThis.Number(u.n_position_low) : 0,
  3775. n_position_high: n(u.n_position_high) ? globalThis.Number(u.n_position_high) : 0,
  3776. cb_requested: n(u.cb_requested) ? globalThis.Number(u.cb_requested) : 0,
  3777. have_clip_data_id: n(u.have_clip_data_id) ? globalThis.Boolean(u.have_clip_data_id) : !1,
  3778. clip_data_id: n(u.clip_data_id) ? globalThis.Number(u.clip_data_id) : 0
  3779. }
  3780. }, toJSON(u) {
  3781. const e = {};
  3782. return u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.list_index !== 0 && (e.list_index = Math.round(u.list_index)), u.dw_flags !== 0 && (e.dw_flags = Math.round(u.dw_flags)), u.n_position_low !== 0 && (e.n_position_low = Math.round(u.n_position_low)), u.n_position_high !== 0 && (e.n_position_high = Math.round(u.n_position_high)), u.cb_requested !== 0 && (e.cb_requested = Math.round(u.cb_requested)), u.have_clip_data_id !== !1 && (e.have_clip_data_id = u.have_clip_data_id), u.clip_data_id !== 0 && (e.clip_data_id = Math.round(u.clip_data_id)), e
  3783. }, create(u) {
  3784. return w0.fromPartial(u != null ? u : {})
  3785. }, fromPartial(u) {
  3786. var i, o, a, t, s, l, E, c;
  3787. const e = j3();
  3788. return e.stream_id = (i = u.stream_id) != null ? i : 0, e.list_index = (o = u.list_index) != null ? o : 0, e.dw_flags = (a = u.dw_flags) != null ? a : 0, e.n_position_low = (t = u.n_position_low) != null ? t : 0, e.n_position_high = (s = u.n_position_high) != null ? s : 0, e.cb_requested = (l = u.cb_requested) != null ? l : 0, e.have_clip_data_id = (E = u.have_clip_data_id) != null ? E : !1, e.clip_data_id = (c = u.clip_data_id) != null ? c : 0, e
  3789. }
  3790. };
  3791. function N3() {
  3792. return {msg_flags: 0, stream_id: 0, requested_data: new Uint8Array(0)}
  3793. }
  3794. const S0 = {
  3795. encode(u, e = r.Writer.create()) {
  3796. return u.msg_flags !== 0 && e.uint32(24).int32(u.msg_flags), u.stream_id !== 0 && e.uint32(32).int32(u.stream_id), u.requested_data.length !== 0 && e.uint32(42).bytes(u.requested_data), e
  3797. }, decode(u, e) {
  3798. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3799. let o = e === void 0 ? i.len : i.pos + e;
  3800. const a = N3();
  3801. for (; i.pos < o;) {
  3802. const t = i.uint32();
  3803. switch (t >>> 3) {
  3804. case 3:
  3805. if (t !== 24) break;
  3806. a.msg_flags = i.int32();
  3807. continue;
  3808. case 4:
  3809. if (t !== 32) break;
  3810. a.stream_id = i.int32();
  3811. continue;
  3812. case 5:
  3813. if (t !== 42) break;
  3814. a.requested_data = i.bytes();
  3815. continue
  3816. }
  3817. if ((t & 7) === 4 || t === 0) break;
  3818. i.skipType(t & 7)
  3819. }
  3820. return a
  3821. }, fromJSON(u) {
  3822. return {
  3823. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3824. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3825. requested_data: n(u.requested_data) ? z(u.requested_data) : new Uint8Array(0)
  3826. }
  3827. }, toJSON(u) {
  3828. const e = {};
  3829. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.stream_id !== 0 && (e.stream_id = Math.round(u.stream_id)), u.requested_data.length !== 0 && (e.requested_data = P(u.requested_data)), e
  3830. }, create(u) {
  3831. return S0.fromPartial(u != null ? u : {})
  3832. }, fromPartial(u) {
  3833. var i, o, a;
  3834. const e = N3();
  3835. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.stream_id = (o = u.stream_id) != null ? o : 0, e.requested_data = (a = u.requested_data) != null ? a : new Uint8Array(0), e
  3836. }
  3837. };
  3838. function O3() {
  3839. return {
  3840. ready: void 0,
  3841. format_list: void 0,
  3842. format_list_response: void 0,
  3843. format_data_request: void 0,
  3844. format_data_response: void 0,
  3845. file_contents_request: void 0,
  3846. file_contents_response: void 0
  3847. }
  3848. }
  3849. const z0 = {
  3850. encode(u, e = r.Writer.create()) {
  3851. return u.ready !== void 0 && g0.encode(u.ready, e.uint32(10).fork()).ldelim(), u.format_list !== void 0 && f0.encode(u.format_list, e.uint32(18).fork()).ldelim(), u.format_list_response !== void 0 && x0.encode(u.format_list_response, e.uint32(26).fork()).ldelim(), u.format_data_request !== void 0 && y0.encode(u.format_data_request, e.uint32(34).fork()).ldelim(), u.format_data_response !== void 0 && b0.encode(u.format_data_response, e.uint32(42).fork()).ldelim(), u.file_contents_request !== void 0 && w0.encode(u.file_contents_request, e.uint32(50).fork()).ldelim(), u.file_contents_response !== void 0 && S0.encode(u.file_contents_response, e.uint32(58).fork()).ldelim(), e
  3852. }, decode(u, e) {
  3853. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3854. let o = e === void 0 ? i.len : i.pos + e;
  3855. const a = O3();
  3856. for (; i.pos < o;) {
  3857. const t = i.uint32();
  3858. switch (t >>> 3) {
  3859. case 1:
  3860. if (t !== 10) break;
  3861. a.ready = g0.decode(i, i.uint32());
  3862. continue;
  3863. case 2:
  3864. if (t !== 18) break;
  3865. a.format_list = f0.decode(i, i.uint32());
  3866. continue;
  3867. case 3:
  3868. if (t !== 26) break;
  3869. a.format_list_response = x0.decode(i, i.uint32());
  3870. continue;
  3871. case 4:
  3872. if (t !== 34) break;
  3873. a.format_data_request = y0.decode(i, i.uint32());
  3874. continue;
  3875. case 5:
  3876. if (t !== 42) break;
  3877. a.format_data_response = b0.decode(i, i.uint32());
  3878. continue;
  3879. case 6:
  3880. if (t !== 50) break;
  3881. a.file_contents_request = w0.decode(i, i.uint32());
  3882. continue;
  3883. case 7:
  3884. if (t !== 58) break;
  3885. a.file_contents_response = S0.decode(i, i.uint32());
  3886. continue
  3887. }
  3888. if ((t & 7) === 4 || t === 0) break;
  3889. i.skipType(t & 7)
  3890. }
  3891. return a
  3892. }, fromJSON(u) {
  3893. return {
  3894. ready: n(u.ready) ? g0.fromJSON(u.ready) : void 0,
  3895. format_list: n(u.format_list) ? f0.fromJSON(u.format_list) : void 0,
  3896. format_list_response: n(u.format_list_response) ? x0.fromJSON(u.format_list_response) : void 0,
  3897. format_data_request: n(u.format_data_request) ? y0.fromJSON(u.format_data_request) : void 0,
  3898. format_data_response: n(u.format_data_response) ? b0.fromJSON(u.format_data_response) : void 0,
  3899. file_contents_request: n(u.file_contents_request) ? w0.fromJSON(u.file_contents_request) : void 0,
  3900. file_contents_response: n(u.file_contents_response) ? S0.fromJSON(u.file_contents_response) : void 0
  3901. }
  3902. }, toJSON(u) {
  3903. const e = {};
  3904. return u.ready !== void 0 && (e.ready = g0.toJSON(u.ready)), u.format_list !== void 0 && (e.format_list = f0.toJSON(u.format_list)), u.format_list_response !== void 0 && (e.format_list_response = x0.toJSON(u.format_list_response)), u.format_data_request !== void 0 && (e.format_data_request = y0.toJSON(u.format_data_request)), u.format_data_response !== void 0 && (e.format_data_response = b0.toJSON(u.format_data_response)), u.file_contents_request !== void 0 && (e.file_contents_request = w0.toJSON(u.file_contents_request)), u.file_contents_response !== void 0 && (e.file_contents_response = S0.toJSON(u.file_contents_response)), e
  3905. }, create(u) {
  3906. return z0.fromPartial(u != null ? u : {})
  3907. }, fromPartial(u) {
  3908. const e = O3();
  3909. return e.ready = u.ready !== void 0 && u.ready !== null ? g0.fromPartial(u.ready) : void 0, e.format_list = u.format_list !== void 0 && u.format_list !== null ? f0.fromPartial(u.format_list) : void 0, e.format_list_response = u.format_list_response !== void 0 && u.format_list_response !== null ? x0.fromPartial(u.format_list_response) : void 0, e.format_data_request = u.format_data_request !== void 0 && u.format_data_request !== null ? y0.fromPartial(u.format_data_request) : void 0, e.format_data_response = u.format_data_response !== void 0 && u.format_data_response !== null ? b0.fromPartial(u.format_data_response) : void 0, e.file_contents_request = u.file_contents_request !== void 0 && u.file_contents_request !== null ? w0.fromPartial(u.file_contents_request) : void 0, e.file_contents_response = u.file_contents_response !== void 0 && u.file_contents_response !== null ? S0.fromPartial(u.file_contents_response) : void 0, e
  3910. }
  3911. };
  3912. function M3() {
  3913. return {width: 0, height: 0}
  3914. }
  3915. const v = {
  3916. encode(u, e = r.Writer.create()) {
  3917. return u.width !== 0 && e.uint32(8).int32(u.width), u.height !== 0 && e.uint32(16).int32(u.height), e
  3918. }, decode(u, e) {
  3919. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3920. let o = e === void 0 ? i.len : i.pos + e;
  3921. const a = M3();
  3922. for (; i.pos < o;) {
  3923. const t = i.uint32();
  3924. switch (t >>> 3) {
  3925. case 1:
  3926. if (t !== 8) break;
  3927. a.width = i.int32();
  3928. continue;
  3929. case 2:
  3930. if (t !== 16) break;
  3931. a.height = i.int32();
  3932. continue
  3933. }
  3934. if ((t & 7) === 4 || t === 0) break;
  3935. i.skipType(t & 7)
  3936. }
  3937. return a
  3938. }, fromJSON(u) {
  3939. return {
  3940. width: n(u.width) ? globalThis.Number(u.width) : 0,
  3941. height: n(u.height) ? globalThis.Number(u.height) : 0
  3942. }
  3943. }, toJSON(u) {
  3944. const e = {};
  3945. return u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), e
  3946. }, create(u) {
  3947. return v.fromPartial(u != null ? u : {})
  3948. }, fromPartial(u) {
  3949. var i, o;
  3950. const e = M3();
  3951. return e.width = (i = u.width) != null ? i : 0, e.height = (o = u.height) != null ? o : 0, e
  3952. }
  3953. };
  3954. function L3() {
  3955. return {display: 0, resolution: void 0}
  3956. }
  3957. const Nu = {
  3958. encode(u, e = r.Writer.create()) {
  3959. return u.display !== 0 && e.uint32(8).int32(u.display), u.resolution !== void 0 && v.encode(u.resolution, e.uint32(18).fork()).ldelim(), e
  3960. }, decode(u, e) {
  3961. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3962. let o = e === void 0 ? i.len : i.pos + e;
  3963. const a = L3();
  3964. for (; i.pos < o;) {
  3965. const t = i.uint32();
  3966. switch (t >>> 3) {
  3967. case 1:
  3968. if (t !== 8) break;
  3969. a.display = i.int32();
  3970. continue;
  3971. case 2:
  3972. if (t !== 18) break;
  3973. a.resolution = v.decode(i, i.uint32());
  3974. continue
  3975. }
  3976. if ((t & 7) === 4 || t === 0) break;
  3977. i.skipType(t & 7)
  3978. }
  3979. return a
  3980. }, fromJSON(u) {
  3981. return {
  3982. display: n(u.display) ? globalThis.Number(u.display) : 0,
  3983. resolution: n(u.resolution) ? v.fromJSON(u.resolution) : void 0
  3984. }
  3985. }, toJSON(u) {
  3986. const e = {};
  3987. return u.display !== 0 && (e.display = Math.round(u.display)), u.resolution !== void 0 && (e.resolution = v.toJSON(u.resolution)), e
  3988. }, create(u) {
  3989. return Nu.fromPartial(u != null ? u : {})
  3990. }, fromPartial(u) {
  3991. var i;
  3992. const e = L3();
  3993. return e.display = (i = u.display) != null ? i : 0, e.resolution = u.resolution !== void 0 && u.resolution !== null ? v.fromPartial(u.resolution) : void 0, e
  3994. }
  3995. };
  3996. function U3() {
  3997. return {resolutions: []}
  3998. }
  3999. const $ = {
  4000. encode(u, e = r.Writer.create()) {
  4001. for (const i of u.resolutions) v.encode(i, e.uint32(10).fork()).ldelim();
  4002. return e
  4003. }, decode(u, e) {
  4004. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4005. let o = e === void 0 ? i.len : i.pos + e;
  4006. const a = U3();
  4007. for (; i.pos < o;) {
  4008. const t = i.uint32();
  4009. switch (t >>> 3) {
  4010. case 1:
  4011. if (t !== 10) break;
  4012. a.resolutions.push(v.decode(i, i.uint32()));
  4013. continue
  4014. }
  4015. if ((t & 7) === 4 || t === 0) break;
  4016. i.skipType(t & 7)
  4017. }
  4018. return a
  4019. }, fromJSON(u) {
  4020. return {resolutions: globalThis.Array.isArray(u == null ? void 0 : u.resolutions) ? u.resolutions.map(e => v.fromJSON(e)) : []}
  4021. }, toJSON(u) {
  4022. var i;
  4023. const e = {};
  4024. return (i = u.resolutions) != null && i.length && (e.resolutions = u.resolutions.map(o => v.toJSON(o))), e
  4025. }, create(u) {
  4026. return $.fromPartial(u != null ? u : {})
  4027. }, fromPartial(u) {
  4028. var i;
  4029. const e = U3();
  4030. return e.resolutions = ((i = u.resolutions) == null ? void 0 : i.map(o => v.fromPartial(o))) || [], e
  4031. }
  4032. };
  4033. function W3() {
  4034. return {
  4035. display: 0,
  4036. x: 0,
  4037. y: 0,
  4038. width: 0,
  4039. height: 0,
  4040. cursor_embedded: !1,
  4041. resolutions: void 0,
  4042. original_resolution: void 0
  4043. }
  4044. }
  4045. const Ou = {
  4046. encode(u, e = r.Writer.create()) {
  4047. return u.display !== 0 && e.uint32(8).int32(u.display), u.x !== 0 && e.uint32(16).sint32(u.x), u.y !== 0 && e.uint32(24).sint32(u.y), u.width !== 0 && e.uint32(32).int32(u.width), u.height !== 0 && e.uint32(40).int32(u.height), u.cursor_embedded !== !1 && e.uint32(48).bool(u.cursor_embedded), u.resolutions !== void 0 && $.encode(u.resolutions, e.uint32(58).fork()).ldelim(), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), e
  4048. }, decode(u, e) {
  4049. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4050. let o = e === void 0 ? i.len : i.pos + e;
  4051. const a = W3();
  4052. for (; i.pos < o;) {
  4053. const t = i.uint32();
  4054. switch (t >>> 3) {
  4055. case 1:
  4056. if (t !== 8) break;
  4057. a.display = i.int32();
  4058. continue;
  4059. case 2:
  4060. if (t !== 16) break;
  4061. a.x = i.sint32();
  4062. continue;
  4063. case 3:
  4064. if (t !== 24) break;
  4065. a.y = i.sint32();
  4066. continue;
  4067. case 4:
  4068. if (t !== 32) break;
  4069. a.width = i.int32();
  4070. continue;
  4071. case 5:
  4072. if (t !== 40) break;
  4073. a.height = i.int32();
  4074. continue;
  4075. case 6:
  4076. if (t !== 48) break;
  4077. a.cursor_embedded = i.bool();
  4078. continue;
  4079. case 7:
  4080. if (t !== 58) break;
  4081. a.resolutions = $.decode(i, i.uint32());
  4082. continue;
  4083. case 8:
  4084. if (t !== 66) break;
  4085. a.original_resolution = v.decode(i, i.uint32());
  4086. continue
  4087. }
  4088. if ((t & 7) === 4 || t === 0) break;
  4089. i.skipType(t & 7)
  4090. }
  4091. return a
  4092. }, fromJSON(u) {
  4093. return {
  4094. display: n(u.display) ? globalThis.Number(u.display) : 0,
  4095. x: n(u.x) ? globalThis.Number(u.x) : 0,
  4096. y: n(u.y) ? globalThis.Number(u.y) : 0,
  4097. width: n(u.width) ? globalThis.Number(u.width) : 0,
  4098. height: n(u.height) ? globalThis.Number(u.height) : 0,
  4099. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  4100. resolutions: n(u.resolutions) ? $.fromJSON(u.resolutions) : void 0,
  4101. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0
  4102. }
  4103. }, toJSON(u) {
  4104. const e = {};
  4105. return u.display !== 0 && (e.display = Math.round(u.display)), u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), u.cursor_embedded !== !1 && (e.cursor_embedded = u.cursor_embedded), u.resolutions !== void 0 && (e.resolutions = $.toJSON(u.resolutions)), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), e
  4106. }, create(u) {
  4107. return Ou.fromPartial(u != null ? u : {})
  4108. }, fromPartial(u) {
  4109. var i, o, a, t, s, l;
  4110. const e = W3();
  4111. return e.display = (i = u.display) != null ? i : 0, e.x = (o = u.x) != null ? o : 0, e.y = (a = u.y) != null ? a : 0, e.width = (t = u.width) != null ? t : 0, e.height = (s = u.height) != null ? s : 0, e.cursor_embedded = (l = u.cursor_embedded) != null ? l : !1, e.resolutions = u.resolutions !== void 0 && u.resolutions !== null ? $.fromPartial(u.resolutions) : void 0, e.original_resolution = u.original_resolution !== void 0 && u.original_resolution !== null ? v.fromPartial(u.original_resolution) : void 0, e
  4112. }
  4113. };
  4114. function V3() {
  4115. return {add: [], sub: [], set: []}
  4116. }
  4117. const Mu = {
  4118. encode(u, e = r.Writer.create()) {
  4119. e.uint32(10).fork();
  4120. for (const i of u.add) e.int32(i);
  4121. e.ldelim(), e.uint32(18).fork();
  4122. for (const i of u.sub) e.int32(i);
  4123. e.ldelim(), e.uint32(26).fork();
  4124. for (const i of u.set) e.int32(i);
  4125. return e.ldelim(), e
  4126. }, decode(u, e) {
  4127. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4128. let o = e === void 0 ? i.len : i.pos + e;
  4129. const a = V3();
  4130. for (; i.pos < o;) {
  4131. const t = i.uint32();
  4132. switch (t >>> 3) {
  4133. case 1:
  4134. if (t === 8) {
  4135. a.add.push(i.int32());
  4136. continue
  4137. }
  4138. if (t === 10) {
  4139. const s = i.uint32() + i.pos;
  4140. for (; i.pos < s;) a.add.push(i.int32());
  4141. continue
  4142. }
  4143. break;
  4144. case 2:
  4145. if (t === 16) {
  4146. a.sub.push(i.int32());
  4147. continue
  4148. }
  4149. if (t === 18) {
  4150. const s = i.uint32() + i.pos;
  4151. for (; i.pos < s;) a.sub.push(i.int32());
  4152. continue
  4153. }
  4154. break;
  4155. case 3:
  4156. if (t === 24) {
  4157. a.set.push(i.int32());
  4158. continue
  4159. }
  4160. if (t === 26) {
  4161. const s = i.uint32() + i.pos;
  4162. for (; i.pos < s;) a.set.push(i.int32());
  4163. continue
  4164. }
  4165. break
  4166. }
  4167. if ((t & 7) === 4 || t === 0) break;
  4168. i.skipType(t & 7)
  4169. }
  4170. return a
  4171. }, fromJSON(u) {
  4172. return {
  4173. add: globalThis.Array.isArray(u == null ? void 0 : u.add) ? u.add.map(e => globalThis.Number(e)) : [],
  4174. sub: globalThis.Array.isArray(u == null ? void 0 : u.sub) ? u.sub.map(e => globalThis.Number(e)) : [],
  4175. set: globalThis.Array.isArray(u == null ? void 0 : u.set) ? u.set.map(e => globalThis.Number(e)) : []
  4176. }
  4177. }, toJSON(u) {
  4178. var i, o, a;
  4179. const e = {};
  4180. return (i = u.add) != null && i.length && (e.add = u.add.map(t => Math.round(t))), (o = u.sub) != null && o.length && (e.sub = u.sub.map(t => Math.round(t))), (a = u.set) != null && a.length && (e.set = u.set.map(t => Math.round(t))), e
  4181. }, create(u) {
  4182. return Mu.fromPartial(u != null ? u : {})
  4183. }, fromPartial(u) {
  4184. var i, o, a;
  4185. const e = V3();
  4186. return e.add = ((i = u.add) == null ? void 0 : i.map(t => t)) || [], e.sub = ((o = u.sub) == null ? void 0 : o.map(t => t)) || [], e.set = ((a = u.set) == null ? void 0 : a.map(t => t)) || [], e
  4187. }
  4188. };
  4189. function q3() {
  4190. return {display: 0, on: !1}
  4191. }
  4192. const Lu = {
  4193. encode(u, e = r.Writer.create()) {
  4194. return u.display !== 0 && e.uint32(8).int32(u.display), u.on !== !1 && e.uint32(16).bool(u.on), e
  4195. }, decode(u, e) {
  4196. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4197. let o = e === void 0 ? i.len : i.pos + e;
  4198. const a = q3();
  4199. for (; i.pos < o;) {
  4200. const t = i.uint32();
  4201. switch (t >>> 3) {
  4202. case 1:
  4203. if (t !== 8) break;
  4204. a.display = i.int32();
  4205. continue;
  4206. case 2:
  4207. if (t !== 16) break;
  4208. a.on = i.bool();
  4209. continue
  4210. }
  4211. if ((t & 7) === 4 || t === 0) break;
  4212. i.skipType(t & 7)
  4213. }
  4214. return a
  4215. }, fromJSON(u) {
  4216. return {display: n(u.display) ? globalThis.Number(u.display) : 0, on: n(u.on) ? globalThis.Boolean(u.on) : !1}
  4217. }, toJSON(u) {
  4218. const e = {};
  4219. return u.display !== 0 && (e.display = Math.round(u.display)), u.on !== !1 && (e.on = u.on), e
  4220. }, create(u) {
  4221. return Lu.fromPartial(u != null ? u : {})
  4222. }, fromPartial(u) {
  4223. var i, o;
  4224. const e = q3();
  4225. return e.display = (i = u.display) != null ? i : 0, e.on = (o = u.on) != null ? o : !1, e
  4226. }
  4227. };
  4228. function K3() {
  4229. return {impl_key: "", on: !1}
  4230. }
  4231. const Uu = {
  4232. encode(u, e = r.Writer.create()) {
  4233. return u.impl_key !== "" && e.uint32(10).string(u.impl_key), u.on !== !1 && e.uint32(16).bool(u.on), e
  4234. }, decode(u, e) {
  4235. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4236. let o = e === void 0 ? i.len : i.pos + e;
  4237. const a = K3();
  4238. for (; i.pos < o;) {
  4239. const t = i.uint32();
  4240. switch (t >>> 3) {
  4241. case 1:
  4242. if (t !== 10) break;
  4243. a.impl_key = i.string();
  4244. continue;
  4245. case 2:
  4246. if (t !== 16) break;
  4247. a.on = i.bool();
  4248. continue
  4249. }
  4250. if ((t & 7) === 4 || t === 0) break;
  4251. i.skipType(t & 7)
  4252. }
  4253. return a
  4254. }, fromJSON(u) {
  4255. return {
  4256. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : "",
  4257. on: n(u.on) ? globalThis.Boolean(u.on) : !1
  4258. }
  4259. }, toJSON(u) {
  4260. const e = {};
  4261. return u.impl_key !== "" && (e.impl_key = u.impl_key), u.on !== !1 && (e.on = u.on), e
  4262. }, create(u) {
  4263. return Uu.fromPartial(u != null ? u : {})
  4264. }, fromPartial(u) {
  4265. var i, o;
  4266. const e = K3();
  4267. return e.impl_key = (i = u.impl_key) != null ? i : "", e.on = (o = u.on) != null ? o : !1, e
  4268. }
  4269. };
  4270. function H3() {
  4271. return {permission: 0, enabled: !1}
  4272. }
  4273. const P0 = {
  4274. encode(u, e = r.Writer.create()) {
  4275. return u.permission !== 0 && e.uint32(8).int32(u.permission), u.enabled !== !1 && e.uint32(16).bool(u.enabled), e
  4276. }, decode(u, e) {
  4277. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4278. let o = e === void 0 ? i.len : i.pos + e;
  4279. const a = H3();
  4280. for (; i.pos < o;) {
  4281. const t = i.uint32();
  4282. switch (t >>> 3) {
  4283. case 1:
  4284. if (t !== 8) break;
  4285. a.permission = i.int32();
  4286. continue;
  4287. case 2:
  4288. if (t !== 16) break;
  4289. a.enabled = i.bool();
  4290. continue
  4291. }
  4292. if ((t & 7) === 4 || t === 0) break;
  4293. i.skipType(t & 7)
  4294. }
  4295. return a
  4296. }, fromJSON(u) {
  4297. return {
  4298. permission: n(u.permission) ? ca(u.permission) : 0,
  4299. enabled: n(u.enabled) ? globalThis.Boolean(u.enabled) : !1
  4300. }
  4301. }, toJSON(u) {
  4302. const e = {};
  4303. return u.permission !== 0 && (e.permission = Ca(u.permission)), u.enabled !== !1 && (e.enabled = u.enabled), e
  4304. }, create(u) {
  4305. return P0.fromPartial(u != null ? u : {})
  4306. }, fromPartial(u) {
  4307. var i, o;
  4308. const e = H3();
  4309. return e.permission = (i = u.permission) != null ? i : 0, e.enabled = (o = u.enabled) != null ? o : !1, e
  4310. }
  4311. };
  4312. function J3() {
  4313. return {
  4314. ability_vp9: 0,
  4315. ability_h264: 0,
  4316. ability_h265: 0,
  4317. prefer: 0,
  4318. ability_vp8: 0,
  4319. ability_av1: 0,
  4320. i444: void 0,
  4321. prefer_chroma: 0
  4322. }
  4323. }
  4324. const Wu = {
  4325. encode(u, e = r.Writer.create()) {
  4326. return u.ability_vp9 !== 0 && e.uint32(8).int32(u.ability_vp9), u.ability_h264 !== 0 && e.uint32(16).int32(u.ability_h264), u.ability_h265 !== 0 && e.uint32(24).int32(u.ability_h265), u.prefer !== 0 && e.uint32(32).int32(u.prefer), u.ability_vp8 !== 0 && e.uint32(40).int32(u.ability_vp8), u.ability_av1 !== 0 && e.uint32(48).int32(u.ability_av1), u.i444 !== void 0 && J.encode(u.i444, e.uint32(58).fork()).ldelim(), u.prefer_chroma !== 0 && e.uint32(64).int32(u.prefer_chroma), e
  4327. }, decode(u, e) {
  4328. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4329. let o = e === void 0 ? i.len : i.pos + e;
  4330. const a = J3();
  4331. for (; i.pos < o;) {
  4332. const t = i.uint32();
  4333. switch (t >>> 3) {
  4334. case 1:
  4335. if (t !== 8) break;
  4336. a.ability_vp9 = i.int32();
  4337. continue;
  4338. case 2:
  4339. if (t !== 16) break;
  4340. a.ability_h264 = i.int32();
  4341. continue;
  4342. case 3:
  4343. if (t !== 24) break;
  4344. a.ability_h265 = i.int32();
  4345. continue;
  4346. case 4:
  4347. if (t !== 32) break;
  4348. a.prefer = i.int32();
  4349. continue;
  4350. case 5:
  4351. if (t !== 40) break;
  4352. a.ability_vp8 = i.int32();
  4353. continue;
  4354. case 6:
  4355. if (t !== 48) break;
  4356. a.ability_av1 = i.int32();
  4357. continue;
  4358. case 7:
  4359. if (t !== 58) break;
  4360. a.i444 = J.decode(i, i.uint32());
  4361. continue;
  4362. case 8:
  4363. if (t !== 64) break;
  4364. a.prefer_chroma = i.int32();
  4365. continue
  4366. }
  4367. if ((t & 7) === 4 || t === 0) break;
  4368. i.skipType(t & 7)
  4369. }
  4370. return a
  4371. }, fromJSON(u) {
  4372. return {
  4373. ability_vp9: n(u.ability_vp9) ? globalThis.Number(u.ability_vp9) : 0,
  4374. ability_h264: n(u.ability_h264) ? globalThis.Number(u.ability_h264) : 0,
  4375. ability_h265: n(u.ability_h265) ? globalThis.Number(u.ability_h265) : 0,
  4376. prefer: n(u.prefer) ? pa(u.prefer) : 0,
  4377. ability_vp8: n(u.ability_vp8) ? globalThis.Number(u.ability_vp8) : 0,
  4378. ability_av1: n(u.ability_av1) ? globalThis.Number(u.ability_av1) : 0,
  4379. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0,
  4380. prefer_chroma: n(u.prefer_chroma) ? ia(u.prefer_chroma) : 0
  4381. }
  4382. }, toJSON(u) {
  4383. const e = {};
  4384. return u.ability_vp9 !== 0 && (e.ability_vp9 = Math.round(u.ability_vp9)), u.ability_h264 !== 0 && (e.ability_h264 = Math.round(u.ability_h264)), u.ability_h265 !== 0 && (e.ability_h265 = Math.round(u.ability_h265)), u.prefer !== 0 && (e.prefer = Da(u.prefer)), u.ability_vp8 !== 0 && (e.ability_vp8 = Math.round(u.ability_vp8)), u.ability_av1 !== 0 && (e.ability_av1 = Math.round(u.ability_av1)), u.i444 !== void 0 && (e.i444 = J.toJSON(u.i444)), u.prefer_chroma !== 0 && (e.prefer_chroma = ta(u.prefer_chroma)), e
  4385. }, create(u) {
  4386. return Wu.fromPartial(u != null ? u : {})
  4387. }, fromPartial(u) {
  4388. var i, o, a, t, s, l, E;
  4389. const e = J3();
  4390. return e.ability_vp9 = (i = u.ability_vp9) != null ? i : 0, e.ability_h264 = (o = u.ability_h264) != null ? o : 0, e.ability_h265 = (a = u.ability_h265) != null ? a : 0, e.prefer = (t = u.prefer) != null ? t : 0, e.ability_vp8 = (s = u.ability_vp8) != null ? s : 0, e.ability_av1 = (l = u.ability_av1) != null ? l : 0, e.i444 = u.i444 !== void 0 && u.i444 !== null ? J.fromPartial(u.i444) : void 0, e.prefer_chroma = (E = u.prefer_chroma) != null ? E : 0, e
  4391. }
  4392. };
  4393. function G3() {
  4394. return {
  4395. image_quality: 0,
  4396. lock_after_session_end: 0,
  4397. show_remote_cursor: 0,
  4398. privacy_mode: 0,
  4399. block_input: 0,
  4400. custom_image_quality: 0,
  4401. disable_audio: 0,
  4402. disable_clipboard: 0,
  4403. enable_file_transfer: 0,
  4404. supported_decoding: void 0,
  4405. custom_fps: 0,
  4406. disable_keyboard: 0,
  4407. follow_remote_cursor: 0,
  4408. follow_remote_window: 0
  4409. }
  4410. }
  4411. const S = {
  4412. encode(u, e = r.Writer.create()) {
  4413. return u.image_quality !== 0 && e.uint32(8).int32(u.image_quality), u.lock_after_session_end !== 0 && e.uint32(16).int32(u.lock_after_session_end), u.show_remote_cursor !== 0 && e.uint32(24).int32(u.show_remote_cursor), u.privacy_mode !== 0 && e.uint32(32).int32(u.privacy_mode), u.block_input !== 0 && e.uint32(40).int32(u.block_input), u.custom_image_quality !== 0 && e.uint32(48).int32(u.custom_image_quality), u.disable_audio !== 0 && e.uint32(56).int32(u.disable_audio), u.disable_clipboard !== 0 && e.uint32(64).int32(u.disable_clipboard), u.enable_file_transfer !== 0 && e.uint32(72).int32(u.enable_file_transfer), u.supported_decoding !== void 0 && Wu.encode(u.supported_decoding, e.uint32(82).fork()).ldelim(), u.custom_fps !== 0 && e.uint32(88).int32(u.custom_fps), u.disable_keyboard !== 0 && e.uint32(96).int32(u.disable_keyboard), u.follow_remote_cursor !== 0 && e.uint32(120).int32(u.follow_remote_cursor), u.follow_remote_window !== 0 && e.uint32(128).int32(u.follow_remote_window), e
  4414. }, decode(u, e) {
  4415. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4416. let o = e === void 0 ? i.len : i.pos + e;
  4417. const a = G3();
  4418. for (; i.pos < o;) {
  4419. const t = i.uint32();
  4420. switch (t >>> 3) {
  4421. case 1:
  4422. if (t !== 8) break;
  4423. a.image_quality = i.int32();
  4424. continue;
  4425. case 2:
  4426. if (t !== 16) break;
  4427. a.lock_after_session_end = i.int32();
  4428. continue;
  4429. case 3:
  4430. if (t !== 24) break;
  4431. a.show_remote_cursor = i.int32();
  4432. continue;
  4433. case 4:
  4434. if (t !== 32) break;
  4435. a.privacy_mode = i.int32();
  4436. continue;
  4437. case 5:
  4438. if (t !== 40) break;
  4439. a.block_input = i.int32();
  4440. continue;
  4441. case 6:
  4442. if (t !== 48) break;
  4443. a.custom_image_quality = i.int32();
  4444. continue;
  4445. case 7:
  4446. if (t !== 56) break;
  4447. a.disable_audio = i.int32();
  4448. continue;
  4449. case 8:
  4450. if (t !== 64) break;
  4451. a.disable_clipboard = i.int32();
  4452. continue;
  4453. case 9:
  4454. if (t !== 72) break;
  4455. a.enable_file_transfer = i.int32();
  4456. continue;
  4457. case 10:
  4458. if (t !== 82) break;
  4459. a.supported_decoding = Wu.decode(i, i.uint32());
  4460. continue;
  4461. case 11:
  4462. if (t !== 88) break;
  4463. a.custom_fps = i.int32();
  4464. continue;
  4465. case 12:
  4466. if (t !== 96) break;
  4467. a.disable_keyboard = i.int32();
  4468. continue;
  4469. case 15:
  4470. if (t !== 120) break;
  4471. a.follow_remote_cursor = i.int32();
  4472. continue;
  4473. case 16:
  4474. if (t !== 128) break;
  4475. a.follow_remote_window = i.int32();
  4476. continue
  4477. }
  4478. if ((t & 7) === 4 || t === 0) break;
  4479. i.skipType(t & 7)
  4480. }
  4481. return a
  4482. }, fromJSON(u) {
  4483. return {
  4484. image_quality: n(u.image_quality) ? Ea(u.image_quality) : 0,
  4485. lock_after_session_end: n(u.lock_after_session_end) ? iu(u.lock_after_session_end) : 0,
  4486. show_remote_cursor: n(u.show_remote_cursor) ? iu(u.show_remote_cursor) : 0,
  4487. privacy_mode: n(u.privacy_mode) ? iu(u.privacy_mode) : 0,
  4488. block_input: n(u.block_input) ? iu(u.block_input) : 0,
  4489. custom_image_quality: n(u.custom_image_quality) ? globalThis.Number(u.custom_image_quality) : 0,
  4490. disable_audio: n(u.disable_audio) ? iu(u.disable_audio) : 0,
  4491. disable_clipboard: n(u.disable_clipboard) ? iu(u.disable_clipboard) : 0,
  4492. enable_file_transfer: n(u.enable_file_transfer) ? iu(u.enable_file_transfer) : 0,
  4493. supported_decoding: n(u.supported_decoding) ? Wu.fromJSON(u.supported_decoding) : void 0,
  4494. custom_fps: n(u.custom_fps) ? globalThis.Number(u.custom_fps) : 0,
  4495. disable_keyboard: n(u.disable_keyboard) ? iu(u.disable_keyboard) : 0,
  4496. follow_remote_cursor: n(u.follow_remote_cursor) ? iu(u.follow_remote_cursor) : 0,
  4497. follow_remote_window: n(u.follow_remote_window) ? iu(u.follow_remote_window) : 0
  4498. }
  4499. }, toJSON(u) {
  4500. const e = {};
  4501. return u.image_quality !== 0 && (e.image_quality = da(u.image_quality)), u.lock_after_session_end !== 0 && (e.lock_after_session_end = tu(u.lock_after_session_end)), u.show_remote_cursor !== 0 && (e.show_remote_cursor = tu(u.show_remote_cursor)), u.privacy_mode !== 0 && (e.privacy_mode = tu(u.privacy_mode)), u.block_input !== 0 && (e.block_input = tu(u.block_input)), u.custom_image_quality !== 0 && (e.custom_image_quality = Math.round(u.custom_image_quality)), u.disable_audio !== 0 && (e.disable_audio = tu(u.disable_audio)), u.disable_clipboard !== 0 && (e.disable_clipboard = tu(u.disable_clipboard)), u.enable_file_transfer !== 0 && (e.enable_file_transfer = tu(u.enable_file_transfer)), u.supported_decoding !== void 0 && (e.supported_decoding = Wu.toJSON(u.supported_decoding)), u.custom_fps !== 0 && (e.custom_fps = Math.round(u.custom_fps)), u.disable_keyboard !== 0 && (e.disable_keyboard = tu(u.disable_keyboard)), u.follow_remote_cursor !== 0 && (e.follow_remote_cursor = tu(u.follow_remote_cursor)), u.follow_remote_window !== 0 && (e.follow_remote_window = tu(u.follow_remote_window)), e
  4502. }, create(u) {
  4503. return S.fromPartial(u != null ? u : {})
  4504. }, fromPartial(u) {
  4505. var i, o, a, t, s, l, E, c, C, D, B, m, f;
  4506. const e = G3();
  4507. return e.image_quality = (i = u.image_quality) != null ? i : 0, e.lock_after_session_end = (o = u.lock_after_session_end) != null ? o : 0, e.show_remote_cursor = (a = u.show_remote_cursor) != null ? a : 0, e.privacy_mode = (t = u.privacy_mode) != null ? t : 0, e.block_input = (s = u.block_input) != null ? s : 0, e.custom_image_quality = (l = u.custom_image_quality) != null ? l : 0, e.disable_audio = (E = u.disable_audio) != null ? E : 0, e.disable_clipboard = (c = u.disable_clipboard) != null ? c : 0, e.enable_file_transfer = (C = u.enable_file_transfer) != null ? C : 0, e.supported_decoding = u.supported_decoding !== void 0 && u.supported_decoding !== null ? Wu.fromPartial(u.supported_decoding) : void 0, e.custom_fps = (D = u.custom_fps) != null ? D : 0, e.disable_keyboard = (B = u.disable_keyboard) != null ? B : 0, e.follow_remote_cursor = (m = u.follow_remote_cursor) != null ? m : 0, e.follow_remote_window = (f = u.follow_remote_window) != null ? f : 0, e
  4508. }
  4509. };
  4510. function Z3() {
  4511. return {time: 0, from_client: !1, last_delay: 0, target_bitrate: 0}
  4512. }
  4513. const R0 = {
  4514. encode(u, e = r.Writer.create()) {
  4515. return u.time !== 0 && e.uint32(8).int64(u.time), u.from_client !== !1 && e.uint32(16).bool(u.from_client), u.last_delay !== 0 && e.uint32(24).uint32(u.last_delay), u.target_bitrate !== 0 && e.uint32(32).uint32(u.target_bitrate), e
  4516. }, decode(u, e) {
  4517. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4518. let o = e === void 0 ? i.len : i.pos + e;
  4519. const a = Z3();
  4520. for (; i.pos < o;) {
  4521. const t = i.uint32();
  4522. switch (t >>> 3) {
  4523. case 1:
  4524. if (t !== 8) break;
  4525. a.time = V(i.int64());
  4526. continue;
  4527. case 2:
  4528. if (t !== 16) break;
  4529. a.from_client = i.bool();
  4530. continue;
  4531. case 3:
  4532. if (t !== 24) break;
  4533. a.last_delay = i.uint32();
  4534. continue;
  4535. case 4:
  4536. if (t !== 32) break;
  4537. a.target_bitrate = i.uint32();
  4538. continue
  4539. }
  4540. if ((t & 7) === 4 || t === 0) break;
  4541. i.skipType(t & 7)
  4542. }
  4543. return a
  4544. }, fromJSON(u) {
  4545. return {
  4546. time: n(u.time) ? globalThis.Number(u.time) : 0,
  4547. from_client: n(u.from_client) ? globalThis.Boolean(u.from_client) : !1,
  4548. last_delay: n(u.last_delay) ? globalThis.Number(u.last_delay) : 0,
  4549. target_bitrate: n(u.target_bitrate) ? globalThis.Number(u.target_bitrate) : 0
  4550. }
  4551. }, toJSON(u) {
  4552. const e = {};
  4553. return u.time !== 0 && (e.time = Math.round(u.time)), u.from_client !== !1 && (e.from_client = u.from_client), u.last_delay !== 0 && (e.last_delay = Math.round(u.last_delay)), u.target_bitrate !== 0 && (e.target_bitrate = Math.round(u.target_bitrate)), e
  4554. }, create(u) {
  4555. return R0.fromPartial(u != null ? u : {})
  4556. }, fromPartial(u) {
  4557. var i, o, a, t;
  4558. const e = Z3();
  4559. return e.time = (i = u.time) != null ? i : 0, e.from_client = (o = u.from_client) != null ? o : !1, e.last_delay = (a = u.last_delay) != null ? a : 0, e.target_bitrate = (t = u.target_bitrate) != null ? t : 0, e
  4560. }
  4561. };
  4562. function Q3() {
  4563. return {asymmetric_value: new Uint8Array(0), symmetric_value: new Uint8Array(0)}
  4564. }
  4565. const K = {
  4566. encode(u, e = r.Writer.create()) {
  4567. return u.asymmetric_value.length !== 0 && e.uint32(10).bytes(u.asymmetric_value), u.symmetric_value.length !== 0 && e.uint32(18).bytes(u.symmetric_value), e
  4568. }, decode(u, e) {
  4569. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4570. let o = e === void 0 ? i.len : i.pos + e;
  4571. const a = Q3();
  4572. for (; i.pos < o;) {
  4573. const t = i.uint32();
  4574. switch (t >>> 3) {
  4575. case 1:
  4576. if (t !== 10) break;
  4577. a.asymmetric_value = i.bytes();
  4578. continue;
  4579. case 2:
  4580. if (t !== 18) break;
  4581. a.symmetric_value = i.bytes();
  4582. continue
  4583. }
  4584. if ((t & 7) === 4 || t === 0) break;
  4585. i.skipType(t & 7)
  4586. }
  4587. return a
  4588. }, fromJSON(u) {
  4589. return {
  4590. asymmetric_value: n(u.asymmetric_value) ? z(u.asymmetric_value) : new Uint8Array(0),
  4591. symmetric_value: n(u.symmetric_value) ? z(u.symmetric_value) : new Uint8Array(0)
  4592. }
  4593. }, toJSON(u) {
  4594. const e = {};
  4595. return u.asymmetric_value.length !== 0 && (e.asymmetric_value = P(u.asymmetric_value)), u.symmetric_value.length !== 0 && (e.symmetric_value = P(u.symmetric_value)), e
  4596. }, create(u) {
  4597. return K.fromPartial(u != null ? u : {})
  4598. }, fromPartial(u) {
  4599. var i, o;
  4600. const e = Q3();
  4601. return e.asymmetric_value = (i = u.asymmetric_value) != null ? i : new Uint8Array(0), e.symmetric_value = (o = u.symmetric_value) != null ? o : new Uint8Array(0), e
  4602. }
  4603. };
  4604. function X3() {
  4605. return {id: new Uint8Array(0)}
  4606. }
  4607. const I0 = {
  4608. encode(u, e = r.Writer.create()) {
  4609. return u.id.length !== 0 && e.uint32(10).bytes(u.id), e
  4610. }, decode(u, e) {
  4611. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4612. let o = e === void 0 ? i.len : i.pos + e;
  4613. const a = X3();
  4614. for (; i.pos < o;) {
  4615. const t = i.uint32();
  4616. switch (t >>> 3) {
  4617. case 1:
  4618. if (t !== 10) break;
  4619. a.id = i.bytes();
  4620. continue
  4621. }
  4622. if ((t & 7) === 4 || t === 0) break;
  4623. i.skipType(t & 7)
  4624. }
  4625. return a
  4626. }, fromJSON(u) {
  4627. return {id: n(u.id) ? z(u.id) : new Uint8Array(0)}
  4628. }, toJSON(u) {
  4629. const e = {};
  4630. return u.id.length !== 0 && (e.id = P(u.id)), e
  4631. }, create(u) {
  4632. return I0.fromPartial(u != null ? u : {})
  4633. }, fromPartial(u) {
  4634. var i;
  4635. const e = X3();
  4636. return e.id = (i = u.id) != null ? i : new Uint8Array(0), e
  4637. }
  4638. };
  4639. function Y3() {
  4640. return {sample_rate: 0, channels: 0}
  4641. }
  4642. const T0 = {
  4643. encode(u, e = r.Writer.create()) {
  4644. return u.sample_rate !== 0 && e.uint32(8).uint32(u.sample_rate), u.channels !== 0 && e.uint32(16).uint32(u.channels), e
  4645. }, decode(u, e) {
  4646. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4647. let o = e === void 0 ? i.len : i.pos + e;
  4648. const a = Y3();
  4649. for (; i.pos < o;) {
  4650. const t = i.uint32();
  4651. switch (t >>> 3) {
  4652. case 1:
  4653. if (t !== 8) break;
  4654. a.sample_rate = i.uint32();
  4655. continue;
  4656. case 2:
  4657. if (t !== 16) break;
  4658. a.channels = i.uint32();
  4659. continue
  4660. }
  4661. if ((t & 7) === 4 || t === 0) break;
  4662. i.skipType(t & 7)
  4663. }
  4664. return a
  4665. }, fromJSON(u) {
  4666. return {
  4667. sample_rate: n(u.sample_rate) ? globalThis.Number(u.sample_rate) : 0,
  4668. channels: n(u.channels) ? globalThis.Number(u.channels) : 0
  4669. }
  4670. }, toJSON(u) {
  4671. const e = {};
  4672. return u.sample_rate !== 0 && (e.sample_rate = Math.round(u.sample_rate)), u.channels !== 0 && (e.channels = Math.round(u.channels)), e
  4673. }, create(u) {
  4674. return T0.fromPartial(u != null ? u : {})
  4675. }, fromPartial(u) {
  4676. var i, o;
  4677. const e = Y3();
  4678. return e.sample_rate = (i = u.sample_rate) != null ? i : 0, e.channels = (o = u.channels) != null ? o : 0, e
  4679. }
  4680. };
  4681. function $3() {
  4682. return {data: new Uint8Array(0)}
  4683. }
  4684. const j0 = {
  4685. encode(u, e = r.Writer.create()) {
  4686. return u.data.length !== 0 && e.uint32(10).bytes(u.data), e
  4687. }, decode(u, e) {
  4688. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4689. let o = e === void 0 ? i.len : i.pos + e;
  4690. const a = $3();
  4691. for (; i.pos < o;) {
  4692. const t = i.uint32();
  4693. switch (t >>> 3) {
  4694. case 1:
  4695. if (t !== 10) break;
  4696. a.data = i.bytes();
  4697. continue
  4698. }
  4699. if ((t & 7) === 4 || t === 0) break;
  4700. i.skipType(t & 7)
  4701. }
  4702. return a
  4703. }, fromJSON(u) {
  4704. return {data: n(u.data) ? z(u.data) : new Uint8Array(0)}
  4705. }, toJSON(u) {
  4706. const e = {};
  4707. return u.data.length !== 0 && (e.data = P(u.data)), e
  4708. }, create(u) {
  4709. return j0.fromPartial(u != null ? u : {})
  4710. }, fromPartial(u) {
  4711. var i;
  4712. const e = $3();
  4713. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e
  4714. }
  4715. };
  4716. function ui() {
  4717. return {msgtype: "", title: "", text: "", link: ""}
  4718. }
  4719. const N0 = {
  4720. encode(u, e = r.Writer.create()) {
  4721. return u.msgtype !== "" && e.uint32(10).string(u.msgtype), u.title !== "" && e.uint32(18).string(u.title), u.text !== "" && e.uint32(26).string(u.text), u.link !== "" && e.uint32(34).string(u.link), e
  4722. }, decode(u, e) {
  4723. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4724. let o = e === void 0 ? i.len : i.pos + e;
  4725. const a = ui();
  4726. for (; i.pos < o;) {
  4727. const t = i.uint32();
  4728. switch (t >>> 3) {
  4729. case 1:
  4730. if (t !== 10) break;
  4731. a.msgtype = i.string();
  4732. continue;
  4733. case 2:
  4734. if (t !== 18) break;
  4735. a.title = i.string();
  4736. continue;
  4737. case 3:
  4738. if (t !== 26) break;
  4739. a.text = i.string();
  4740. continue;
  4741. case 4:
  4742. if (t !== 34) break;
  4743. a.link = i.string();
  4744. continue
  4745. }
  4746. if ((t & 7) === 4 || t === 0) break;
  4747. i.skipType(t & 7)
  4748. }
  4749. return a
  4750. }, fromJSON(u) {
  4751. return {
  4752. msgtype: n(u.msgtype) ? globalThis.String(u.msgtype) : "",
  4753. title: n(u.title) ? globalThis.String(u.title) : "",
  4754. text: n(u.text) ? globalThis.String(u.text) : "",
  4755. link: n(u.link) ? globalThis.String(u.link) : ""
  4756. }
  4757. }, toJSON(u) {
  4758. const e = {};
  4759. return u.msgtype !== "" && (e.msgtype = u.msgtype), u.title !== "" && (e.title = u.title), u.text !== "" && (e.text = u.text), u.link !== "" && (e.link = u.link), e
  4760. }, create(u) {
  4761. return N0.fromPartial(u != null ? u : {})
  4762. }, fromPartial(u) {
  4763. var i, o, a, t;
  4764. const e = ui();
  4765. return e.msgtype = (i = u.msgtype) != null ? i : "", e.title = (o = u.title) != null ? o : "", e.text = (a = u.text) != null ? a : "", e.link = (t = u.link) != null ? t : "", e
  4766. }
  4767. };
  4768. function ei() {
  4769. return {privacy_mode_state: void 0, block_input_state: void 0, details: "", impl_key: ""}
  4770. }
  4771. const O0 = {
  4772. encode(u, e = r.Writer.create()) {
  4773. return u.privacy_mode_state !== void 0 && e.uint32(8).int32(u.privacy_mode_state), u.block_input_state !== void 0 && e.uint32(16).int32(u.block_input_state), u.details !== "" && e.uint32(26).string(u.details), u.impl_key !== "" && e.uint32(34).string(u.impl_key), e
  4774. }, decode(u, e) {
  4775. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4776. let o = e === void 0 ? i.len : i.pos + e;
  4777. const a = ei();
  4778. for (; i.pos < o;) {
  4779. const t = i.uint32();
  4780. switch (t >>> 3) {
  4781. case 1:
  4782. if (t !== 8) break;
  4783. a.privacy_mode_state = i.int32();
  4784. continue;
  4785. case 2:
  4786. if (t !== 16) break;
  4787. a.block_input_state = i.int32();
  4788. continue;
  4789. case 3:
  4790. if (t !== 26) break;
  4791. a.details = i.string();
  4792. continue;
  4793. case 4:
  4794. if (t !== 34) break;
  4795. a.impl_key = i.string();
  4796. continue
  4797. }
  4798. if ((t & 7) === 4 || t === 0) break;
  4799. i.skipType(t & 7)
  4800. }
  4801. return a
  4802. }, fromJSON(u) {
  4803. return {
  4804. privacy_mode_state: n(u.privacy_mode_state) ? ma(u.privacy_mode_state) : void 0,
  4805. block_input_state: n(u.block_input_state) ? Ba(u.block_input_state) : void 0,
  4806. details: n(u.details) ? globalThis.String(u.details) : "",
  4807. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : ""
  4808. }
  4809. }, toJSON(u) {
  4810. const e = {};
  4811. return u.privacy_mode_state !== void 0 && (e.privacy_mode_state = Fa(u.privacy_mode_state)), u.block_input_state !== void 0 && (e.block_input_state = Aa(u.block_input_state)), u.details !== "" && (e.details = u.details), u.impl_key !== "" && (e.impl_key = u.impl_key), e
  4812. }, create(u) {
  4813. return O0.fromPartial(u != null ? u : {})
  4814. }, fromPartial(u) {
  4815. var i, o, a, t;
  4816. const e = ei();
  4817. return e.privacy_mode_state = (i = u.privacy_mode_state) != null ? i : void 0, e.block_input_state = (o = u.block_input_state) != null ? o : void 0, e.details = (a = u.details) != null ? a : "", e.impl_key = (t = u.impl_key) != null ? t : "", e
  4818. }
  4819. };
  4820. function ii() {
  4821. return {username: "", password: ""}
  4822. }
  4823. const Vu = {
  4824. encode(u, e = r.Writer.create()) {
  4825. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  4826. }, decode(u, e) {
  4827. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4828. let o = e === void 0 ? i.len : i.pos + e;
  4829. const a = ii();
  4830. for (; i.pos < o;) {
  4831. const t = i.uint32();
  4832. switch (t >>> 3) {
  4833. case 1:
  4834. if (t !== 10) break;
  4835. a.username = i.string();
  4836. continue;
  4837. case 2:
  4838. if (t !== 18) break;
  4839. a.password = i.string();
  4840. continue
  4841. }
  4842. if ((t & 7) === 4 || t === 0) break;
  4843. i.skipType(t & 7)
  4844. }
  4845. return a
  4846. }, fromJSON(u) {
  4847. return {
  4848. username: n(u.username) ? globalThis.String(u.username) : "",
  4849. password: n(u.password) ? globalThis.String(u.password) : ""
  4850. }
  4851. }, toJSON(u) {
  4852. const e = {};
  4853. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  4854. }, create(u) {
  4855. return Vu.fromPartial(u != null ? u : {})
  4856. }, fromPartial(u) {
  4857. var i, o;
  4858. const e = ii();
  4859. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  4860. }
  4861. };
  4862. function ti() {
  4863. return {direct: void 0, logon: void 0}
  4864. }
  4865. const Du = {
  4866. encode(u, e = r.Writer.create()) {
  4867. return u.direct !== void 0 && e.uint32(8).bool(u.direct), u.logon !== void 0 && Vu.encode(u.logon, e.uint32(18).fork()).ldelim(), e
  4868. }, decode(u, e) {
  4869. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4870. let o = e === void 0 ? i.len : i.pos + e;
  4871. const a = ti();
  4872. for (; i.pos < o;) {
  4873. const t = i.uint32();
  4874. switch (t >>> 3) {
  4875. case 1:
  4876. if (t !== 8) break;
  4877. a.direct = i.bool();
  4878. continue;
  4879. case 2:
  4880. if (t !== 18) break;
  4881. a.logon = Vu.decode(i, i.uint32());
  4882. continue
  4883. }
  4884. if ((t & 7) === 4 || t === 0) break;
  4885. i.skipType(t & 7)
  4886. }
  4887. return a
  4888. }, fromJSON(u) {
  4889. return {
  4890. direct: n(u.direct) ? globalThis.Boolean(u.direct) : void 0,
  4891. logon: n(u.logon) ? Vu.fromJSON(u.logon) : void 0
  4892. }
  4893. }, toJSON(u) {
  4894. const e = {};
  4895. return u.direct !== void 0 && (e.direct = u.direct), u.logon !== void 0 && (e.logon = Vu.toJSON(u.logon)), e
  4896. }, create(u) {
  4897. return Du.fromPartial(u != null ? u : {})
  4898. }, fromPartial(u) {
  4899. var i;
  4900. const e = ti();
  4901. return e.direct = (i = u.direct) != null ? i : void 0, e.logon = u.logon !== void 0 && u.logon !== null ? Vu.fromPartial(u.logon) : void 0, e
  4902. }
  4903. };
  4904. function ai() {
  4905. return {uuid: new Uint8Array(0)}
  4906. }
  4907. const M0 = {
  4908. encode(u, e = r.Writer.create()) {
  4909. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), e
  4910. }, decode(u, e) {
  4911. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4912. let o = e === void 0 ? i.len : i.pos + e;
  4913. const a = ai();
  4914. for (; i.pos < o;) {
  4915. const t = i.uint32();
  4916. switch (t >>> 3) {
  4917. case 1:
  4918. if (t !== 10) break;
  4919. a.uuid = i.bytes();
  4920. continue
  4921. }
  4922. if ((t & 7) === 4 || t === 0) break;
  4923. i.skipType(t & 7)
  4924. }
  4925. return a
  4926. }, fromJSON(u) {
  4927. return {uuid: n(u.uuid) ? z(u.uuid) : new Uint8Array(0)}
  4928. }, toJSON(u) {
  4929. const e = {};
  4930. return u.uuid.length !== 0 && (e.uuid = P(u.uuid)), e
  4931. }, create(u) {
  4932. return M0.fromPartial(u != null ? u : {})
  4933. }, fromPartial(u) {
  4934. var i;
  4935. const e = ai();
  4936. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e
  4937. }
  4938. };
  4939. function oi() {
  4940. return {uuid: new Uint8Array(0), lr: void 0}
  4941. }
  4942. const L0 = {
  4943. encode(u, e = r.Writer.create()) {
  4944. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), u.lr !== void 0 && H.encode(u.lr, e.uint32(18).fork()).ldelim(), e
  4945. }, decode(u, e) {
  4946. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4947. let o = e === void 0 ? i.len : i.pos + e;
  4948. const a = oi();
  4949. for (; i.pos < o;) {
  4950. const t = i.uint32();
  4951. switch (t >>> 3) {
  4952. case 1:
  4953. if (t !== 10) break;
  4954. a.uuid = i.bytes();
  4955. continue;
  4956. case 2:
  4957. if (t !== 18) break;
  4958. a.lr = H.decode(i, i.uint32());
  4959. continue
  4960. }
  4961. if ((t & 7) === 4 || t === 0) break;
  4962. i.skipType(t & 7)
  4963. }
  4964. return a
  4965. }, fromJSON(u) {
  4966. return {uuid: n(u.uuid) ? z(u.uuid) : new Uint8Array(0), lr: n(u.lr) ? H.fromJSON(u.lr) : void 0}
  4967. }, toJSON(u) {
  4968. const e = {};
  4969. return u.uuid.length !== 0 && (e.uuid = P(u.uuid)), u.lr !== void 0 && (e.lr = H.toJSON(u.lr)), e
  4970. }, create(u) {
  4971. return L0.fromPartial(u != null ? u : {})
  4972. }, fromPartial(u) {
  4973. var i;
  4974. const e = oi();
  4975. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e.lr = u.lr !== void 0 && u.lr !== null ? H.fromPartial(u.lr) : void 0, e
  4976. }
  4977. };
  4978. function ni() {
  4979. return {}
  4980. }
  4981. const U0 = {
  4982. encode(u, e = r.Writer.create()) {
  4983. return e
  4984. }, decode(u, e) {
  4985. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4986. let o = e === void 0 ? i.len : i.pos + e;
  4987. const a = ni();
  4988. for (; i.pos < o;) {
  4989. const t = i.uint32();
  4990. if ((t & 7) === 4 || t === 0) break;
  4991. i.skipType(t & 7)
  4992. }
  4993. return a
  4994. }, fromJSON(u) {
  4995. return {}
  4996. }, toJSON(u) {
  4997. return {}
  4998. }, create(u) {
  4999. return U0.fromPartial(u != null ? u : {})
  5000. }, fromPartial(u) {
  5001. return ni()
  5002. }
  5003. };
  5004. function ri() {
  5005. return {id: "", content: new Uint8Array(0)}
  5006. }
  5007. const W0 = {
  5008. encode(u, e = r.Writer.create()) {
  5009. return u.id !== "" && e.uint32(10).string(u.id), u.content.length !== 0 && e.uint32(18).bytes(u.content), e
  5010. }, decode(u, e) {
  5011. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5012. let o = e === void 0 ? i.len : i.pos + e;
  5013. const a = ri();
  5014. for (; i.pos < o;) {
  5015. const t = i.uint32();
  5016. switch (t >>> 3) {
  5017. case 1:
  5018. if (t !== 10) break;
  5019. a.id = i.string();
  5020. continue;
  5021. case 2:
  5022. if (t !== 18) break;
  5023. a.content = i.bytes();
  5024. continue
  5025. }
  5026. if ((t & 7) === 4 || t === 0) break;
  5027. i.skipType(t & 7)
  5028. }
  5029. return a
  5030. }, fromJSON(u) {
  5031. return {id: n(u.id) ? globalThis.String(u.id) : "", content: n(u.content) ? z(u.content) : new Uint8Array(0)}
  5032. }, toJSON(u) {
  5033. const e = {};
  5034. return u.id !== "" && (e.id = u.id), u.content.length !== 0 && (e.content = P(u.content)), e
  5035. }, create(u) {
  5036. return W0.fromPartial(u != null ? u : {})
  5037. }, fromPartial(u) {
  5038. var i, o;
  5039. const e = ri();
  5040. return e.id = (i = u.id) != null ? i : "", e.content = (o = u.content) != null ? o : new Uint8Array(0), e
  5041. }
  5042. };
  5043. function si() {
  5044. return {id: "", name: "", msg: ""}
  5045. }
  5046. const V0 = {
  5047. encode(u, e = r.Writer.create()) {
  5048. return u.id !== "" && e.uint32(10).string(u.id), u.name !== "" && e.uint32(18).string(u.name), u.msg !== "" && e.uint32(26).string(u.msg), e
  5049. }, decode(u, e) {
  5050. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5051. let o = e === void 0 ? i.len : i.pos + e;
  5052. const a = si();
  5053. for (; i.pos < o;) {
  5054. const t = i.uint32();
  5055. switch (t >>> 3) {
  5056. case 1:
  5057. if (t !== 10) break;
  5058. a.id = i.string();
  5059. continue;
  5060. case 2:
  5061. if (t !== 18) break;
  5062. a.name = i.string();
  5063. continue;
  5064. case 3:
  5065. if (t !== 26) break;
  5066. a.msg = i.string();
  5067. continue
  5068. }
  5069. if ((t & 7) === 4 || t === 0) break;
  5070. i.skipType(t & 7)
  5071. }
  5072. return a
  5073. }, fromJSON(u) {
  5074. return {
  5075. id: n(u.id) ? globalThis.String(u.id) : "",
  5076. name: n(u.name) ? globalThis.String(u.name) : "",
  5077. msg: n(u.msg) ? globalThis.String(u.msg) : ""
  5078. }
  5079. }, toJSON(u) {
  5080. const e = {};
  5081. return u.id !== "" && (e.id = u.id), u.name !== "" && (e.name = u.name), u.msg !== "" && (e.msg = u.msg), e
  5082. }, create(u) {
  5083. return V0.fromPartial(u != null ? u : {})
  5084. }, fromPartial(u) {
  5085. var i, o, a;
  5086. const e = si();
  5087. return e.id = (i = u.id) != null ? i : "", e.name = (o = u.name) != null ? o : "", e.msg = (a = u.msg) != null ? a : "", e
  5088. }
  5089. };
  5090. function li() {
  5091. return {sessions: [], current_sid: 0}
  5092. }
  5093. const q0 = {
  5094. encode(u, e = r.Writer.create()) {
  5095. for (const i of u.sessions) d0.encode(i, e.uint32(10).fork()).ldelim();
  5096. return u.current_sid !== 0 && e.uint32(16).uint32(u.current_sid), e
  5097. }, decode(u, e) {
  5098. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5099. let o = e === void 0 ? i.len : i.pos + e;
  5100. const a = li();
  5101. for (; i.pos < o;) {
  5102. const t = i.uint32();
  5103. switch (t >>> 3) {
  5104. case 1:
  5105. if (t !== 10) break;
  5106. a.sessions.push(d0.decode(i, i.uint32()));
  5107. continue;
  5108. case 2:
  5109. if (t !== 16) break;
  5110. a.current_sid = i.uint32();
  5111. continue
  5112. }
  5113. if ((t & 7) === 4 || t === 0) break;
  5114. i.skipType(t & 7)
  5115. }
  5116. return a
  5117. }, fromJSON(u) {
  5118. return {
  5119. sessions: globalThis.Array.isArray(u == null ? void 0 : u.sessions) ? u.sessions.map(e => d0.fromJSON(e)) : [],
  5120. current_sid: n(u.current_sid) ? globalThis.Number(u.current_sid) : 0
  5121. }
  5122. }, toJSON(u) {
  5123. var i;
  5124. const e = {};
  5125. return (i = u.sessions) != null && i.length && (e.sessions = u.sessions.map(o => d0.toJSON(o))), u.current_sid !== 0 && (e.current_sid = Math.round(u.current_sid)), e
  5126. }, create(u) {
  5127. return q0.fromPartial(u != null ? u : {})
  5128. }, fromPartial(u) {
  5129. var i, o;
  5130. const e = li();
  5131. return e.sessions = ((i = u.sessions) == null ? void 0 : i.map(a => d0.fromPartial(a))) || [], e.current_sid = (o = u.current_sid) != null ? o : 0, e
  5132. }
  5133. };
  5134. function Ei() {
  5135. return {switch_display: 0}
  5136. }
  5137. const K0 = {
  5138. encode(u, e = r.Writer.create()) {
  5139. return u.switch_display !== 0 && e.uint32(8).int32(u.switch_display), e
  5140. }, decode(u, e) {
  5141. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5142. let o = e === void 0 ? i.len : i.pos + e;
  5143. const a = Ei();
  5144. for (; i.pos < o;) {
  5145. const t = i.uint32();
  5146. switch (t >>> 3) {
  5147. case 1:
  5148. if (t !== 8) break;
  5149. a.switch_display = i.int32();
  5150. continue
  5151. }
  5152. if ((t & 7) === 4 || t === 0) break;
  5153. i.skipType(t & 7)
  5154. }
  5155. return a
  5156. }, fromJSON(u) {
  5157. return {switch_display: n(u.switch_display) ? globalThis.Number(u.switch_display) : 0}
  5158. }, toJSON(u) {
  5159. const e = {};
  5160. return u.switch_display !== 0 && (e.switch_display = Math.round(u.switch_display)), e
  5161. }, create(u) {
  5162. return K0.fromPartial(u != null ? u : {})
  5163. }, fromPartial(u) {
  5164. var i;
  5165. const e = Ei();
  5166. return e.switch_display = (i = u.switch_display) != null ? i : 0, e
  5167. }
  5168. };
  5169. function di() {
  5170. return {
  5171. chat_message: void 0,
  5172. switch_display: void 0,
  5173. permission_info: void 0,
  5174. option: void 0,
  5175. audio_format: void 0,
  5176. close_reason: void 0,
  5177. refresh_video: void 0,
  5178. video_received: void 0,
  5179. back_notification: void 0,
  5180. restart_remote_device: void 0,
  5181. uac: void 0,
  5182. foreground_window_elevated: void 0,
  5183. stop_service: void 0,
  5184. elevation_request: void 0,
  5185. elevation_response: void 0,
  5186. portable_service_running: void 0,
  5187. switch_sides_request: void 0,
  5188. switch_back: void 0,
  5189. change_resolution: void 0,
  5190. plugin_request: void 0,
  5191. plugin_failure: void 0,
  5192. full_speed_fps: void 0,
  5193. auto_adjust_fps: void 0,
  5194. client_record_status: void 0,
  5195. capture_displays: void 0,
  5196. refresh_video_display: void 0,
  5197. toggle_virtual_display: void 0,
  5198. toggle_privacy_mode: void 0,
  5199. supported_encoding: void 0,
  5200. selected_sid: void 0,
  5201. change_display_resolution: void 0,
  5202. message_query: void 0,
  5203. follow_current_display: void 0
  5204. }
  5205. }
  5206. const h = {
  5207. encode(u, e = r.Writer.create()) {
  5208. return u.chat_message !== void 0 && vu.encode(u.chat_message, e.uint32(34).fork()).ldelim(), u.switch_display !== void 0 && Ou.encode(u.switch_display, e.uint32(42).fork()).ldelim(), u.permission_info !== void 0 && P0.encode(u.permission_info, e.uint32(50).fork()).ldelim(), u.option !== void 0 && S.encode(u.option, e.uint32(58).fork()).ldelim(), u.audio_format !== void 0 && T0.encode(u.audio_format, e.uint32(66).fork()).ldelim(), u.close_reason !== void 0 && e.uint32(74).string(u.close_reason), u.refresh_video !== void 0 && e.uint32(80).bool(u.refresh_video), u.video_received !== void 0 && e.uint32(96).bool(u.video_received), u.back_notification !== void 0 && O0.encode(u.back_notification, e.uint32(106).fork()).ldelim(), u.restart_remote_device !== void 0 && e.uint32(112).bool(u.restart_remote_device), u.uac !== void 0 && e.uint32(120).bool(u.uac), u.foreground_window_elevated !== void 0 && e.uint32(128).bool(u.foreground_window_elevated), u.stop_service !== void 0 && e.uint32(136).bool(u.stop_service), u.elevation_request !== void 0 && Du.encode(u.elevation_request, e.uint32(146).fork()).ldelim(), u.elevation_response !== void 0 && e.uint32(154).string(u.elevation_response), u.portable_service_running !== void 0 && e.uint32(160).bool(u.portable_service_running), u.switch_sides_request !== void 0 && M0.encode(u.switch_sides_request, e.uint32(170).fork()).ldelim(), u.switch_back !== void 0 && U0.encode(u.switch_back, e.uint32(178).fork()).ldelim(), u.change_resolution !== void 0 && v.encode(u.change_resolution, e.uint32(194).fork()).ldelim(), u.plugin_request !== void 0 && W0.encode(u.plugin_request, e.uint32(202).fork()).ldelim(), u.plugin_failure !== void 0 && V0.encode(u.plugin_failure, e.uint32(210).fork()).ldelim(), u.full_speed_fps !== void 0 && e.uint32(216).uint32(u.full_speed_fps), u.auto_adjust_fps !== void 0 && e.uint32(224).uint32(u.auto_adjust_fps), u.client_record_status !== void 0 && e.uint32(232).bool(u.client_record_status), u.capture_displays !== void 0 && Mu.encode(u.capture_displays, e.uint32(242).fork()).ldelim(), u.refresh_video_display !== void 0 && e.uint32(248).int32(u.refresh_video_display), u.toggle_virtual_display !== void 0 && Lu.encode(u.toggle_virtual_display, e.uint32(258).fork()).ldelim(), u.toggle_privacy_mode !== void 0 && Uu.encode(u.toggle_privacy_mode, e.uint32(266).fork()).ldelim(), u.supported_encoding !== void 0 && G.encode(u.supported_encoding, e.uint32(274).fork()).ldelim(), u.selected_sid !== void 0 && e.uint32(280).uint32(u.selected_sid), u.change_display_resolution !== void 0 && Nu.encode(u.change_display_resolution, e.uint32(290).fork()).ldelim(), u.message_query !== void 0 && K0.encode(u.message_query, e.uint32(298).fork()).ldelim(), u.follow_current_display !== void 0 && e.uint32(304).int32(u.follow_current_display), e
  5209. }, decode(u, e) {
  5210. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5211. let o = e === void 0 ? i.len : i.pos + e;
  5212. const a = di();
  5213. for (; i.pos < o;) {
  5214. const t = i.uint32();
  5215. switch (t >>> 3) {
  5216. case 4:
  5217. if (t !== 34) break;
  5218. a.chat_message = vu.decode(i, i.uint32());
  5219. continue;
  5220. case 5:
  5221. if (t !== 42) break;
  5222. a.switch_display = Ou.decode(i, i.uint32());
  5223. continue;
  5224. case 6:
  5225. if (t !== 50) break;
  5226. a.permission_info = P0.decode(i, i.uint32());
  5227. continue;
  5228. case 7:
  5229. if (t !== 58) break;
  5230. a.option = S.decode(i, i.uint32());
  5231. continue;
  5232. case 8:
  5233. if (t !== 66) break;
  5234. a.audio_format = T0.decode(i, i.uint32());
  5235. continue;
  5236. case 9:
  5237. if (t !== 74) break;
  5238. a.close_reason = i.string();
  5239. continue;
  5240. case 10:
  5241. if (t !== 80) break;
  5242. a.refresh_video = i.bool();
  5243. continue;
  5244. case 12:
  5245. if (t !== 96) break;
  5246. a.video_received = i.bool();
  5247. continue;
  5248. case 13:
  5249. if (t !== 106) break;
  5250. a.back_notification = O0.decode(i, i.uint32());
  5251. continue;
  5252. case 14:
  5253. if (t !== 112) break;
  5254. a.restart_remote_device = i.bool();
  5255. continue;
  5256. case 15:
  5257. if (t !== 120) break;
  5258. a.uac = i.bool();
  5259. continue;
  5260. case 16:
  5261. if (t !== 128) break;
  5262. a.foreground_window_elevated = i.bool();
  5263. continue;
  5264. case 17:
  5265. if (t !== 136) break;
  5266. a.stop_service = i.bool();
  5267. continue;
  5268. case 18:
  5269. if (t !== 146) break;
  5270. a.elevation_request = Du.decode(i, i.uint32());
  5271. continue;
  5272. case 19:
  5273. if (t !== 154) break;
  5274. a.elevation_response = i.string();
  5275. continue;
  5276. case 20:
  5277. if (t !== 160) break;
  5278. a.portable_service_running = i.bool();
  5279. continue;
  5280. case 21:
  5281. if (t !== 170) break;
  5282. a.switch_sides_request = M0.decode(i, i.uint32());
  5283. continue;
  5284. case 22:
  5285. if (t !== 178) break;
  5286. a.switch_back = U0.decode(i, i.uint32());
  5287. continue;
  5288. case 24:
  5289. if (t !== 194) break;
  5290. a.change_resolution = v.decode(i, i.uint32());
  5291. continue;
  5292. case 25:
  5293. if (t !== 202) break;
  5294. a.plugin_request = W0.decode(i, i.uint32());
  5295. continue;
  5296. case 26:
  5297. if (t !== 210) break;
  5298. a.plugin_failure = V0.decode(i, i.uint32());
  5299. continue;
  5300. case 27:
  5301. if (t !== 216) break;
  5302. a.full_speed_fps = i.uint32();
  5303. continue;
  5304. case 28:
  5305. if (t !== 224) break;
  5306. a.auto_adjust_fps = i.uint32();
  5307. continue;
  5308. case 29:
  5309. if (t !== 232) break;
  5310. a.client_record_status = i.bool();
  5311. continue;
  5312. case 30:
  5313. if (t !== 242) break;
  5314. a.capture_displays = Mu.decode(i, i.uint32());
  5315. continue;
  5316. case 31:
  5317. if (t !== 248) break;
  5318. a.refresh_video_display = i.int32();
  5319. continue;
  5320. case 32:
  5321. if (t !== 258) break;
  5322. a.toggle_virtual_display = Lu.decode(i, i.uint32());
  5323. continue;
  5324. case 33:
  5325. if (t !== 266) break;
  5326. a.toggle_privacy_mode = Uu.decode(i, i.uint32());
  5327. continue;
  5328. case 34:
  5329. if (t !== 274) break;
  5330. a.supported_encoding = G.decode(i, i.uint32());
  5331. continue;
  5332. case 35:
  5333. if (t !== 280) break;
  5334. a.selected_sid = i.uint32();
  5335. continue;
  5336. case 36:
  5337. if (t !== 290) break;
  5338. a.change_display_resolution = Nu.decode(i, i.uint32());
  5339. continue;
  5340. case 37:
  5341. if (t !== 298) break;
  5342. a.message_query = K0.decode(i, i.uint32());
  5343. continue;
  5344. case 38:
  5345. if (t !== 304) break;
  5346. a.follow_current_display = i.int32();
  5347. continue
  5348. }
  5349. if ((t & 7) === 4 || t === 0) break;
  5350. i.skipType(t & 7)
  5351. }
  5352. return a
  5353. }, fromJSON(u) {
  5354. return {
  5355. chat_message: n(u.chat_message) ? vu.fromJSON(u.chat_message) : void 0,
  5356. switch_display: n(u.switch_display) ? Ou.fromJSON(u.switch_display) : void 0,
  5357. permission_info: n(u.permission_info) ? P0.fromJSON(u.permission_info) : void 0,
  5358. option: n(u.option) ? S.fromJSON(u.option) : void 0,
  5359. audio_format: n(u.audio_format) ? T0.fromJSON(u.audio_format) : void 0,
  5360. close_reason: n(u.close_reason) ? globalThis.String(u.close_reason) : void 0,
  5361. refresh_video: n(u.refresh_video) ? globalThis.Boolean(u.refresh_video) : void 0,
  5362. video_received: n(u.video_received) ? globalThis.Boolean(u.video_received) : void 0,
  5363. back_notification: n(u.back_notification) ? O0.fromJSON(u.back_notification) : void 0,
  5364. restart_remote_device: n(u.restart_remote_device) ? globalThis.Boolean(u.restart_remote_device) : void 0,
  5365. uac: n(u.uac) ? globalThis.Boolean(u.uac) : void 0,
  5366. foreground_window_elevated: n(u.foreground_window_elevated) ? globalThis.Boolean(u.foreground_window_elevated) : void 0,
  5367. stop_service: n(u.stop_service) ? globalThis.Boolean(u.stop_service) : void 0,
  5368. elevation_request: n(u.elevation_request) ? Du.fromJSON(u.elevation_request) : void 0,
  5369. elevation_response: n(u.elevation_response) ? globalThis.String(u.elevation_response) : void 0,
  5370. portable_service_running: n(u.portable_service_running) ? globalThis.Boolean(u.portable_service_running) : void 0,
  5371. switch_sides_request: n(u.switch_sides_request) ? M0.fromJSON(u.switch_sides_request) : void 0,
  5372. switch_back: n(u.switch_back) ? U0.fromJSON(u.switch_back) : void 0,
  5373. change_resolution: n(u.change_resolution) ? v.fromJSON(u.change_resolution) : void 0,
  5374. plugin_request: n(u.plugin_request) ? W0.fromJSON(u.plugin_request) : void 0,
  5375. plugin_failure: n(u.plugin_failure) ? V0.fromJSON(u.plugin_failure) : void 0,
  5376. full_speed_fps: n(u.full_speed_fps) ? globalThis.Number(u.full_speed_fps) : void 0,
  5377. auto_adjust_fps: n(u.auto_adjust_fps) ? globalThis.Number(u.auto_adjust_fps) : void 0,
  5378. client_record_status: n(u.client_record_status) ? globalThis.Boolean(u.client_record_status) : void 0,
  5379. capture_displays: n(u.capture_displays) ? Mu.fromJSON(u.capture_displays) : void 0,
  5380. refresh_video_display: n(u.refresh_video_display) ? globalThis.Number(u.refresh_video_display) : void 0,
  5381. toggle_virtual_display: n(u.toggle_virtual_display) ? Lu.fromJSON(u.toggle_virtual_display) : void 0,
  5382. toggle_privacy_mode: n(u.toggle_privacy_mode) ? Uu.fromJSON(u.toggle_privacy_mode) : void 0,
  5383. supported_encoding: n(u.supported_encoding) ? G.fromJSON(u.supported_encoding) : void 0,
  5384. selected_sid: n(u.selected_sid) ? globalThis.Number(u.selected_sid) : void 0,
  5385. change_display_resolution: n(u.change_display_resolution) ? Nu.fromJSON(u.change_display_resolution) : void 0,
  5386. message_query: n(u.message_query) ? K0.fromJSON(u.message_query) : void 0,
  5387. follow_current_display: n(u.follow_current_display) ? globalThis.Number(u.follow_current_display) : void 0
  5388. }
  5389. }, toJSON(u) {
  5390. const e = {};
  5391. return u.chat_message !== void 0 && (e.chat_message = vu.toJSON(u.chat_message)), u.switch_display !== void 0 && (e.switch_display = Ou.toJSON(u.switch_display)), u.permission_info !== void 0 && (e.permission_info = P0.toJSON(u.permission_info)), u.option !== void 0 && (e.option = S.toJSON(u.option)), u.audio_format !== void 0 && (e.audio_format = T0.toJSON(u.audio_format)), u.close_reason !== void 0 && (e.close_reason = u.close_reason), u.refresh_video !== void 0 && (e.refresh_video = u.refresh_video), u.video_received !== void 0 && (e.video_received = u.video_received), u.back_notification !== void 0 && (e.back_notification = O0.toJSON(u.back_notification)), u.restart_remote_device !== void 0 && (e.restart_remote_device = u.restart_remote_device), u.uac !== void 0 && (e.uac = u.uac), u.foreground_window_elevated !== void 0 && (e.foreground_window_elevated = u.foreground_window_elevated), u.stop_service !== void 0 && (e.stop_service = u.stop_service), u.elevation_request !== void 0 && (e.elevation_request = Du.toJSON(u.elevation_request)), u.elevation_response !== void 0 && (e.elevation_response = u.elevation_response), u.portable_service_running !== void 0 && (e.portable_service_running = u.portable_service_running), u.switch_sides_request !== void 0 && (e.switch_sides_request = M0.toJSON(u.switch_sides_request)), u.switch_back !== void 0 && (e.switch_back = U0.toJSON(u.switch_back)), u.change_resolution !== void 0 && (e.change_resolution = v.toJSON(u.change_resolution)), u.plugin_request !== void 0 && (e.plugin_request = W0.toJSON(u.plugin_request)), u.plugin_failure !== void 0 && (e.plugin_failure = V0.toJSON(u.plugin_failure)), u.full_speed_fps !== void 0 && (e.full_speed_fps = Math.round(u.full_speed_fps)), u.auto_adjust_fps !== void 0 && (e.auto_adjust_fps = Math.round(u.auto_adjust_fps)), u.client_record_status !== void 0 && (e.client_record_status = u.client_record_status), u.capture_displays !== void 0 && (e.capture_displays = Mu.toJSON(u.capture_displays)), u.refresh_video_display !== void 0 && (e.refresh_video_display = Math.round(u.refresh_video_display)), u.toggle_virtual_display !== void 0 && (e.toggle_virtual_display = Lu.toJSON(u.toggle_virtual_display)), u.toggle_privacy_mode !== void 0 && (e.toggle_privacy_mode = Uu.toJSON(u.toggle_privacy_mode)), u.supported_encoding !== void 0 && (e.supported_encoding = G.toJSON(u.supported_encoding)), u.selected_sid !== void 0 && (e.selected_sid = Math.round(u.selected_sid)), u.change_display_resolution !== void 0 && (e.change_display_resolution = Nu.toJSON(u.change_display_resolution)), u.message_query !== void 0 && (e.message_query = K0.toJSON(u.message_query)), u.follow_current_display !== void 0 && (e.follow_current_display = Math.round(u.follow_current_display)), e
  5392. }, create(u) {
  5393. return h.fromPartial(u != null ? u : {})
  5394. }, fromPartial(u) {
  5395. var i, o, a, t, s, l, E, c, C, D, B, m, f, R, I;
  5396. const e = di();
  5397. return e.chat_message = u.chat_message !== void 0 && u.chat_message !== null ? vu.fromPartial(u.chat_message) : void 0, e.switch_display = u.switch_display !== void 0 && u.switch_display !== null ? Ou.fromPartial(u.switch_display) : void 0, e.permission_info = u.permission_info !== void 0 && u.permission_info !== null ? P0.fromPartial(u.permission_info) : void 0, e.option = u.option !== void 0 && u.option !== null ? S.fromPartial(u.option) : void 0, e.audio_format = u.audio_format !== void 0 && u.audio_format !== null ? T0.fromPartial(u.audio_format) : void 0, e.close_reason = (i = u.close_reason) != null ? i : void 0, e.refresh_video = (o = u.refresh_video) != null ? o : void 0, e.video_received = (a = u.video_received) != null ? a : void 0, e.back_notification = u.back_notification !== void 0 && u.back_notification !== null ? O0.fromPartial(u.back_notification) : void 0, e.restart_remote_device = (t = u.restart_remote_device) != null ? t : void 0, e.uac = (s = u.uac) != null ? s : void 0, e.foreground_window_elevated = (l = u.foreground_window_elevated) != null ? l : void 0, e.stop_service = (E = u.stop_service) != null ? E : void 0, e.elevation_request = u.elevation_request !== void 0 && u.elevation_request !== null ? Du.fromPartial(u.elevation_request) : void 0, e.elevation_response = (c = u.elevation_response) != null ? c : void 0, e.portable_service_running = (C = u.portable_service_running) != null ? C : void 0, e.switch_sides_request = u.switch_sides_request !== void 0 && u.switch_sides_request !== null ? M0.fromPartial(u.switch_sides_request) : void 0, e.switch_back = u.switch_back !== void 0 && u.switch_back !== null ? U0.fromPartial(u.switch_back) : void 0, e.change_resolution = u.change_resolution !== void 0 && u.change_resolution !== null ? v.fromPartial(u.change_resolution) : void 0, e.plugin_request = u.plugin_request !== void 0 && u.plugin_request !== null ? W0.fromPartial(u.plugin_request) : void 0, e.plugin_failure = u.plugin_failure !== void 0 && u.plugin_failure !== null ? V0.fromPartial(u.plugin_failure) : void 0, e.full_speed_fps = (D = u.full_speed_fps) != null ? D : void 0, e.auto_adjust_fps = (B = u.auto_adjust_fps) != null ? B : void 0, e.client_record_status = (m = u.client_record_status) != null ? m : void 0, e.capture_displays = u.capture_displays !== void 0 && u.capture_displays !== null ? Mu.fromPartial(u.capture_displays) : void 0, e.refresh_video_display = (f = u.refresh_video_display) != null ? f : void 0, e.toggle_virtual_display = u.toggle_virtual_display !== void 0 && u.toggle_virtual_display !== null ? Lu.fromPartial(u.toggle_virtual_display) : void 0, e.toggle_privacy_mode = u.toggle_privacy_mode !== void 0 && u.toggle_privacy_mode !== null ? Uu.fromPartial(u.toggle_privacy_mode) : void 0, e.supported_encoding = u.supported_encoding !== void 0 && u.supported_encoding !== null ? G.fromPartial(u.supported_encoding) : void 0, e.selected_sid = (R = u.selected_sid) != null ? R : void 0, e.change_display_resolution = u.change_display_resolution !== void 0 && u.change_display_resolution !== null ? Nu.fromPartial(u.change_display_resolution) : void 0, e.message_query = u.message_query !== void 0 && u.message_query !== null ? K0.fromPartial(u.message_query) : void 0, e.follow_current_display = (I = u.follow_current_display) != null ? I : void 0, e
  5398. }
  5399. };
  5400. function ci() {
  5401. return {req_timestamp: 0, is_connect: !1}
  5402. }
  5403. const H0 = {
  5404. encode(u, e = r.Writer.create()) {
  5405. return u.req_timestamp !== 0 && e.uint32(8).int64(u.req_timestamp), u.is_connect !== !1 && e.uint32(16).bool(u.is_connect), e
  5406. }, decode(u, e) {
  5407. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5408. let o = e === void 0 ? i.len : i.pos + e;
  5409. const a = ci();
  5410. for (; i.pos < o;) {
  5411. const t = i.uint32();
  5412. switch (t >>> 3) {
  5413. case 1:
  5414. if (t !== 8) break;
  5415. a.req_timestamp = V(i.int64());
  5416. continue;
  5417. case 2:
  5418. if (t !== 16) break;
  5419. a.is_connect = i.bool();
  5420. continue
  5421. }
  5422. if ((t & 7) === 4 || t === 0) break;
  5423. i.skipType(t & 7)
  5424. }
  5425. return a
  5426. }, fromJSON(u) {
  5427. return {
  5428. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5429. is_connect: n(u.is_connect) ? globalThis.Boolean(u.is_connect) : !1
  5430. }
  5431. }, toJSON(u) {
  5432. const e = {};
  5433. return u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.is_connect !== !1 && (e.is_connect = u.is_connect), e
  5434. }, create(u) {
  5435. return H0.fromPartial(u != null ? u : {})
  5436. }, fromPartial(u) {
  5437. var i, o;
  5438. const e = ci();
  5439. return e.req_timestamp = (i = u.req_timestamp) != null ? i : 0, e.is_connect = (o = u.is_connect) != null ? o : !1, e
  5440. }
  5441. };
  5442. function Ci() {
  5443. return {accepted: !1, req_timestamp: 0, ack_timestamp: 0}
  5444. }
  5445. const J0 = {
  5446. encode(u, e = r.Writer.create()) {
  5447. return u.accepted !== !1 && e.uint32(8).bool(u.accepted), u.req_timestamp !== 0 && e.uint32(16).int64(u.req_timestamp), u.ack_timestamp !== 0 && e.uint32(24).int64(u.ack_timestamp), e
  5448. }, decode(u, e) {
  5449. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5450. let o = e === void 0 ? i.len : i.pos + e;
  5451. const a = Ci();
  5452. for (; i.pos < o;) {
  5453. const t = i.uint32();
  5454. switch (t >>> 3) {
  5455. case 1:
  5456. if (t !== 8) break;
  5457. a.accepted = i.bool();
  5458. continue;
  5459. case 2:
  5460. if (t !== 16) break;
  5461. a.req_timestamp = V(i.int64());
  5462. continue;
  5463. case 3:
  5464. if (t !== 24) break;
  5465. a.ack_timestamp = V(i.int64());
  5466. continue
  5467. }
  5468. if ((t & 7) === 4 || t === 0) break;
  5469. i.skipType(t & 7)
  5470. }
  5471. return a
  5472. }, fromJSON(u) {
  5473. return {
  5474. accepted: n(u.accepted) ? globalThis.Boolean(u.accepted) : !1,
  5475. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5476. ack_timestamp: n(u.ack_timestamp) ? globalThis.Number(u.ack_timestamp) : 0
  5477. }
  5478. }, toJSON(u) {
  5479. const e = {};
  5480. return u.accepted !== !1 && (e.accepted = u.accepted), u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.ack_timestamp !== 0 && (e.ack_timestamp = Math.round(u.ack_timestamp)), e
  5481. }, create(u) {
  5482. return J0.fromPartial(u != null ? u : {})
  5483. }, fromPartial(u) {
  5484. var i, o, a;
  5485. const e = Ci();
  5486. return e.accepted = (i = u.accepted) != null ? i : !1, e.req_timestamp = (o = u.req_timestamp) != null ? o : 0, e.ack_timestamp = (a = u.ack_timestamp) != null ? a : 0, e
  5487. }
  5488. };
  5489. function pi() {
  5490. return {
  5491. signed_id: void 0,
  5492. public_key: void 0,
  5493. test_delay: void 0,
  5494. video_frame: void 0,
  5495. login_request: void 0,
  5496. login_response: void 0,
  5497. hash: void 0,
  5498. mouse_event: void 0,
  5499. audio_frame: void 0,
  5500. cursor_data: void 0,
  5501. cursor_position: void 0,
  5502. cursor_id: void 0,
  5503. key_event: void 0,
  5504. clipboard: void 0,
  5505. file_action: void 0,
  5506. file_response: void 0,
  5507. misc: void 0,
  5508. cliprdr: void 0,
  5509. message_box: void 0,
  5510. switch_sides_response: void 0,
  5511. voice_call_request: void 0,
  5512. voice_call_response: void 0,
  5513. peer_info: void 0,
  5514. pointer_device_event: void 0,
  5515. auth_2fa: void 0,
  5516. multi_clipboards: void 0
  5517. }
  5518. }
  5519. const eu = {
  5520. encode(u, e = r.Writer.create()) {
  5521. return u.signed_id !== void 0 && I0.encode(u.signed_id, e.uint32(26).fork()).ldelim(), u.public_key !== void 0 && K.encode(u.public_key, e.uint32(34).fork()).ldelim(), u.test_delay !== void 0 && R0.encode(u.test_delay, e.uint32(42).fork()).ldelim(), u.video_frame !== void 0 && n0.encode(u.video_frame, e.uint32(50).fork()).ldelim(), u.login_request !== void 0 && H.encode(u.login_request, e.uint32(58).fork()).ldelim(), u.login_response !== void 0 && c0.encode(u.login_response, e.uint32(66).fork()).ldelim(), u.hash !== void 0 && v0.encode(u.hash, e.uint32(74).fork()).ldelim(), u.mouse_event !== void 0 && ku.encode(u.mouse_event, e.uint32(82).fork()).ldelim(), u.audio_frame !== void 0 && j0.encode(u.audio_frame, e.uint32(90).fork()).ldelim(), u.cursor_data !== void 0 && F0.encode(u.cursor_data, e.uint32(98).fork()).ldelim(), u.cursor_position !== void 0 && _0.encode(u.cursor_position, e.uint32(106).fork()).ldelim(), u.cursor_id !== void 0 && e.uint32(112).uint64(u.cursor_id), u.key_event !== void 0 && w.encode(u.key_event, e.uint32(122).fork()).ldelim(), u.clipboard !== void 0 && U.encode(u.clipboard, e.uint32(130).fork()).ldelim(), u.file_action !== void 0 && T.encode(u.file_action, e.uint32(138).fork()).ldelim(), u.file_response !== void 0 && ou.encode(u.file_response, e.uint32(146).fork()).ldelim(), u.misc !== void 0 && h.encode(u.misc, e.uint32(154).fork()).ldelim(), u.cliprdr !== void 0 && z0.encode(u.cliprdr, e.uint32(162).fork()).ldelim(), u.message_box !== void 0 && N0.encode(u.message_box, e.uint32(170).fork()).ldelim(), u.switch_sides_response !== void 0 && L0.encode(u.switch_sides_response, e.uint32(178).fork()).ldelim(), u.voice_call_request !== void 0 && H0.encode(u.voice_call_request, e.uint32(186).fork()).ldelim(), u.voice_call_response !== void 0 && J0.encode(u.voice_call_response, e.uint32(194).fork()).ldelim(), u.peer_info !== void 0 && Y.encode(u.peer_info, e.uint32(202).fork()).ldelim(), u.pointer_device_event !== void 0 && m0.encode(u.pointer_device_event, e.uint32(210).fork()).ldelim(), u.auth_2fa !== void 0 && _u.encode(u.auth_2fa, e.uint32(218).fork()).ldelim(), u.multi_clipboards !== void 0 && gu.encode(u.multi_clipboards, e.uint32(226).fork()).ldelim(), e
  5522. }, decode(u, e) {
  5523. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5524. let o = e === void 0 ? i.len : i.pos + e;
  5525. const a = pi();
  5526. for (; i.pos < o;) {
  5527. const t = i.uint32();
  5528. switch (t >>> 3) {
  5529. case 3:
  5530. if (t !== 26) break;
  5531. a.signed_id = I0.decode(i, i.uint32());
  5532. continue;
  5533. case 4:
  5534. if (t !== 34) break;
  5535. a.public_key = K.decode(i, i.uint32());
  5536. continue;
  5537. case 5:
  5538. if (t !== 42) break;
  5539. a.test_delay = R0.decode(i, i.uint32());
  5540. continue;
  5541. case 6:
  5542. if (t !== 50) break;
  5543. a.video_frame = n0.decode(i, i.uint32());
  5544. continue;
  5545. case 7:
  5546. if (t !== 58) break;
  5547. a.login_request = H.decode(i, i.uint32());
  5548. continue;
  5549. case 8:
  5550. if (t !== 66) break;
  5551. a.login_response = c0.decode(i, i.uint32());
  5552. continue;
  5553. case 9:
  5554. if (t !== 74) break;
  5555. a.hash = v0.decode(i, i.uint32());
  5556. continue;
  5557. case 10:
  5558. if (t !== 82) break;
  5559. a.mouse_event = ku.decode(i, i.uint32());
  5560. continue;
  5561. case 11:
  5562. if (t !== 90) break;
  5563. a.audio_frame = j0.decode(i, i.uint32());
  5564. continue;
  5565. case 12:
  5566. if (t !== 98) break;
  5567. a.cursor_data = F0.decode(i, i.uint32());
  5568. continue;
  5569. case 13:
  5570. if (t !== 106) break;
  5571. a.cursor_position = _0.decode(i, i.uint32());
  5572. continue;
  5573. case 14:
  5574. if (t !== 112) break;
  5575. a.cursor_id = V(i.uint64());
  5576. continue;
  5577. case 15:
  5578. if (t !== 122) break;
  5579. a.key_event = w.decode(i, i.uint32());
  5580. continue;
  5581. case 16:
  5582. if (t !== 130) break;
  5583. a.clipboard = U.decode(i, i.uint32());
  5584. continue;
  5585. case 17:
  5586. if (t !== 138) break;
  5587. a.file_action = T.decode(i, i.uint32());
  5588. continue;
  5589. case 18:
  5590. if (t !== 146) break;
  5591. a.file_response = ou.decode(i, i.uint32());
  5592. continue;
  5593. case 19:
  5594. if (t !== 154) break;
  5595. a.misc = h.decode(i, i.uint32());
  5596. continue;
  5597. case 20:
  5598. if (t !== 162) break;
  5599. a.cliprdr = z0.decode(i, i.uint32());
  5600. continue;
  5601. case 21:
  5602. if (t !== 170) break;
  5603. a.message_box = N0.decode(i, i.uint32());
  5604. continue;
  5605. case 22:
  5606. if (t !== 178) break;
  5607. a.switch_sides_response = L0.decode(i, i.uint32());
  5608. continue;
  5609. case 23:
  5610. if (t !== 186) break;
  5611. a.voice_call_request = H0.decode(i, i.uint32());
  5612. continue;
  5613. case 24:
  5614. if (t !== 194) break;
  5615. a.voice_call_response = J0.decode(i, i.uint32());
  5616. continue;
  5617. case 25:
  5618. if (t !== 202) break;
  5619. a.peer_info = Y.decode(i, i.uint32());
  5620. continue;
  5621. case 26:
  5622. if (t !== 210) break;
  5623. a.pointer_device_event = m0.decode(i, i.uint32());
  5624. continue;
  5625. case 27:
  5626. if (t !== 218) break;
  5627. a.auth_2fa = _u.decode(i, i.uint32());
  5628. continue;
  5629. case 28:
  5630. if (t !== 226) break;
  5631. a.multi_clipboards = gu.decode(i, i.uint32());
  5632. continue
  5633. }
  5634. if ((t & 7) === 4 || t === 0) break;
  5635. i.skipType(t & 7)
  5636. }
  5637. return a
  5638. }, fromJSON(u) {
  5639. return {
  5640. signed_id: n(u.signed_id) ? I0.fromJSON(u.signed_id) : void 0,
  5641. public_key: n(u.public_key) ? K.fromJSON(u.public_key) : void 0,
  5642. test_delay: n(u.test_delay) ? R0.fromJSON(u.test_delay) : void 0,
  5643. video_frame: n(u.video_frame) ? n0.fromJSON(u.video_frame) : void 0,
  5644. login_request: n(u.login_request) ? H.fromJSON(u.login_request) : void 0,
  5645. login_response: n(u.login_response) ? c0.fromJSON(u.login_response) : void 0,
  5646. hash: n(u.hash) ? v0.fromJSON(u.hash) : void 0,
  5647. mouse_event: n(u.mouse_event) ? ku.fromJSON(u.mouse_event) : void 0,
  5648. audio_frame: n(u.audio_frame) ? j0.fromJSON(u.audio_frame) : void 0,
  5649. cursor_data: n(u.cursor_data) ? F0.fromJSON(u.cursor_data) : void 0,
  5650. cursor_position: n(u.cursor_position) ? _0.fromJSON(u.cursor_position) : void 0,
  5651. cursor_id: n(u.cursor_id) ? globalThis.Number(u.cursor_id) : void 0,
  5652. key_event: n(u.key_event) ? w.fromJSON(u.key_event) : void 0,
  5653. clipboard: n(u.clipboard) ? U.fromJSON(u.clipboard) : void 0,
  5654. file_action: n(u.file_action) ? T.fromJSON(u.file_action) : void 0,
  5655. file_response: n(u.file_response) ? ou.fromJSON(u.file_response) : void 0,
  5656. misc: n(u.misc) ? h.fromJSON(u.misc) : void 0,
  5657. cliprdr: n(u.cliprdr) ? z0.fromJSON(u.cliprdr) : void 0,
  5658. message_box: n(u.message_box) ? N0.fromJSON(u.message_box) : void 0,
  5659. switch_sides_response: n(u.switch_sides_response) ? L0.fromJSON(u.switch_sides_response) : void 0,
  5660. voice_call_request: n(u.voice_call_request) ? H0.fromJSON(u.voice_call_request) : void 0,
  5661. voice_call_response: n(u.voice_call_response) ? J0.fromJSON(u.voice_call_response) : void 0,
  5662. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  5663. pointer_device_event: n(u.pointer_device_event) ? m0.fromJSON(u.pointer_device_event) : void 0,
  5664. auth_2fa: n(u.auth_2fa) ? _u.fromJSON(u.auth_2fa) : void 0,
  5665. multi_clipboards: n(u.multi_clipboards) ? gu.fromJSON(u.multi_clipboards) : void 0
  5666. }
  5667. }, toJSON(u) {
  5668. const e = {};
  5669. return u.signed_id !== void 0 && (e.signed_id = I0.toJSON(u.signed_id)), u.public_key !== void 0 && (e.public_key = K.toJSON(u.public_key)), u.test_delay !== void 0 && (e.test_delay = R0.toJSON(u.test_delay)), u.video_frame !== void 0 && (e.video_frame = n0.toJSON(u.video_frame)), u.login_request !== void 0 && (e.login_request = H.toJSON(u.login_request)), u.login_response !== void 0 && (e.login_response = c0.toJSON(u.login_response)), u.hash !== void 0 && (e.hash = v0.toJSON(u.hash)), u.mouse_event !== void 0 && (e.mouse_event = ku.toJSON(u.mouse_event)), u.audio_frame !== void 0 && (e.audio_frame = j0.toJSON(u.audio_frame)), u.cursor_data !== void 0 && (e.cursor_data = F0.toJSON(u.cursor_data)), u.cursor_position !== void 0 && (e.cursor_position = _0.toJSON(u.cursor_position)), u.cursor_id !== void 0 && (e.cursor_id = Math.round(u.cursor_id)), u.key_event !== void 0 && (e.key_event = w.toJSON(u.key_event)), u.clipboard !== void 0 && (e.clipboard = U.toJSON(u.clipboard)), u.file_action !== void 0 && (e.file_action = T.toJSON(u.file_action)), u.file_response !== void 0 && (e.file_response = ou.toJSON(u.file_response)), u.misc !== void 0 && (e.misc = h.toJSON(u.misc)), u.cliprdr !== void 0 && (e.cliprdr = z0.toJSON(u.cliprdr)), u.message_box !== void 0 && (e.message_box = N0.toJSON(u.message_box)), u.switch_sides_response !== void 0 && (e.switch_sides_response = L0.toJSON(u.switch_sides_response)), u.voice_call_request !== void 0 && (e.voice_call_request = H0.toJSON(u.voice_call_request)), u.voice_call_response !== void 0 && (e.voice_call_response = J0.toJSON(u.voice_call_response)), u.peer_info !== void 0 && (e.peer_info = Y.toJSON(u.peer_info)), u.pointer_device_event !== void 0 && (e.pointer_device_event = m0.toJSON(u.pointer_device_event)), u.auth_2fa !== void 0 && (e.auth_2fa = _u.toJSON(u.auth_2fa)), u.multi_clipboards !== void 0 && (e.multi_clipboards = gu.toJSON(u.multi_clipboards)), e
  5670. }, create(u) {
  5671. return eu.fromPartial(u != null ? u : {})
  5672. }, fromPartial(u) {
  5673. var i;
  5674. const e = pi();
  5675. return e.signed_id = u.signed_id !== void 0 && u.signed_id !== null ? I0.fromPartial(u.signed_id) : void 0, e.public_key = u.public_key !== void 0 && u.public_key !== null ? K.fromPartial(u.public_key) : void 0, e.test_delay = u.test_delay !== void 0 && u.test_delay !== null ? R0.fromPartial(u.test_delay) : void 0, e.video_frame = u.video_frame !== void 0 && u.video_frame !== null ? n0.fromPartial(u.video_frame) : void 0, e.login_request = u.login_request !== void 0 && u.login_request !== null ? H.fromPartial(u.login_request) : void 0, e.login_response = u.login_response !== void 0 && u.login_response !== null ? c0.fromPartial(u.login_response) : void 0, e.hash = u.hash !== void 0 && u.hash !== null ? v0.fromPartial(u.hash) : void 0, e.mouse_event = u.mouse_event !== void 0 && u.mouse_event !== null ? ku.fromPartial(u.mouse_event) : void 0, e.audio_frame = u.audio_frame !== void 0 && u.audio_frame !== null ? j0.fromPartial(u.audio_frame) : void 0, e.cursor_data = u.cursor_data !== void 0 && u.cursor_data !== null ? F0.fromPartial(u.cursor_data) : void 0, e.cursor_position = u.cursor_position !== void 0 && u.cursor_position !== null ? _0.fromPartial(u.cursor_position) : void 0, e.cursor_id = (i = u.cursor_id) != null ? i : void 0, e.key_event = u.key_event !== void 0 && u.key_event !== null ? w.fromPartial(u.key_event) : void 0, e.clipboard = u.clipboard !== void 0 && u.clipboard !== null ? U.fromPartial(u.clipboard) : void 0, e.file_action = u.file_action !== void 0 && u.file_action !== null ? T.fromPartial(u.file_action) : void 0, e.file_response = u.file_response !== void 0 && u.file_response !== null ? ou.fromPartial(u.file_response) : void 0, e.misc = u.misc !== void 0 && u.misc !== null ? h.fromPartial(u.misc) : void 0, e.cliprdr = u.cliprdr !== void 0 && u.cliprdr !== null ? z0.fromPartial(u.cliprdr) : void 0, e.message_box = u.message_box !== void 0 && u.message_box !== null ? N0.fromPartial(u.message_box) : void 0, e.switch_sides_response = u.switch_sides_response !== void 0 && u.switch_sides_response !== null ? L0.fromPartial(u.switch_sides_response) : void 0, e.voice_call_request = u.voice_call_request !== void 0 && u.voice_call_request !== null ? H0.fromPartial(u.voice_call_request) : void 0, e.voice_call_response = u.voice_call_response !== void 0 && u.voice_call_response !== null ? J0.fromPartial(u.voice_call_response) : void 0, e.peer_info = u.peer_info !== void 0 && u.peer_info !== null ? Y.fromPartial(u.peer_info) : void 0, e.pointer_device_event = u.pointer_device_event !== void 0 && u.pointer_device_event !== null ? m0.fromPartial(u.pointer_device_event) : void 0, e.auth_2fa = u.auth_2fa !== void 0 && u.auth_2fa !== null ? _u.fromPartial(u.auth_2fa) : void 0, e.multi_clipboards = u.multi_clipboards !== void 0 && u.multi_clipboards !== null ? gu.fromPartial(u.multi_clipboards) : void 0, e
  5676. }
  5677. };
  5678. function z(u) {
  5679. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  5680. {
  5681. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  5682. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  5683. return i
  5684. }
  5685. }
  5686. function P(u) {
  5687. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  5688. {
  5689. const e = [];
  5690. return u.forEach(i => {
  5691. e.push(globalThis.String.fromCharCode(i))
  5692. }), globalThis.btoa(e.join(""))
  5693. }
  5694. }
  5695. function V(u) {
  5696. if (u.gt(globalThis.Number.MAX_SAFE_INTEGER)) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
  5697. if (u.lt(globalThis.Number.MIN_SAFE_INTEGER)) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
  5698. return u.toNumber()
  5699. }
  5700. r.util.Long !== Re && (r.util.Long = Re, r.configure());
  5701. function n(u) {
  5702. return u != null
  5703. }
  5704. var ae = (u => (u[u.DEFAULT_CONN = 0] = "DEFAULT_CONN", u[u.FILE_TRANSFER = 1] = "FILE_TRANSFER", u[u.PORT_FORWARD = 2] = "PORT_FORWARD", u[u.RDP = 3] = "RDP", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ae || {});
  5705. function nt(u) {
  5706. switch (u) {
  5707. case 0:
  5708. case"DEFAULT_CONN":
  5709. return 0;
  5710. case 1:
  5711. case"FILE_TRANSFER":
  5712. return 1;
  5713. case 2:
  5714. case"PORT_FORWARD":
  5715. return 2;
  5716. case 3:
  5717. case"RDP":
  5718. return 3;
  5719. case-1:
  5720. case"UNRECOGNIZED":
  5721. default:
  5722. return -1
  5723. }
  5724. }
  5725. function rt(u) {
  5726. switch (u) {
  5727. case 0:
  5728. return "DEFAULT_CONN";
  5729. case 1:
  5730. return "FILE_TRANSFER";
  5731. case 2:
  5732. return "PORT_FORWARD";
  5733. case 3:
  5734. return "RDP";
  5735. case-1:
  5736. default:
  5737. return "UNRECOGNIZED"
  5738. }
  5739. }
  5740. var st = (u => (u[u.UNKNOWN_NAT = 0] = "UNKNOWN_NAT", u[u.ASYMMETRIC = 1] = "ASYMMETRIC", u[u.SYMMETRIC = 2] = "SYMMETRIC", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(st || {});
  5741. function J4(u) {
  5742. switch (u) {
  5743. case 0:
  5744. case"UNKNOWN_NAT":
  5745. return 0;
  5746. case 1:
  5747. case"ASYMMETRIC":
  5748. return 1;
  5749. case 2:
  5750. case"SYMMETRIC":
  5751. return 2;
  5752. case-1:
  5753. case"UNRECOGNIZED":
  5754. default:
  5755. return -1
  5756. }
  5757. }
  5758. function G4(u) {
  5759. switch (u) {
  5760. case 0:
  5761. return "UNKNOWN_NAT";
  5762. case 1:
  5763. return "ASYMMETRIC";
  5764. case 2:
  5765. return "SYMMETRIC";
  5766. case-1:
  5767. default:
  5768. return "UNRECOGNIZED"
  5769. }
  5770. }
  5771. function _a(u) {
  5772. switch (u) {
  5773. case 0:
  5774. case"OK":
  5775. return 0;
  5776. case 2:
  5777. case"UUID_MISMATCH":
  5778. return 2;
  5779. case 3:
  5780. case"ID_EXISTS":
  5781. return 3;
  5782. case 4:
  5783. case"TOO_FREQUENT":
  5784. return 4;
  5785. case 5:
  5786. case"INVALID_ID_FORMAT":
  5787. return 5;
  5788. case 6:
  5789. case"NOT_SUPPORT":
  5790. return 6;
  5791. case 7:
  5792. case"SERVER_ERROR":
  5793. return 7;
  5794. case-1:
  5795. case"UNRECOGNIZED":
  5796. default:
  5797. return -1
  5798. }
  5799. }
  5800. function va(u) {
  5801. switch (u) {
  5802. case 0:
  5803. return "OK";
  5804. case 2:
  5805. return "UUID_MISMATCH";
  5806. case 3:
  5807. return "ID_EXISTS";
  5808. case 4:
  5809. return "TOO_FREQUENT";
  5810. case 5:
  5811. return "INVALID_ID_FORMAT";
  5812. case 6:
  5813. return "NOT_SUPPORT";
  5814. case 7:
  5815. return "SERVER_ERROR";
  5816. case-1:
  5817. default:
  5818. return "UNRECOGNIZED"
  5819. }
  5820. }
  5821. var G0 = (u => (u[u.ID_NOT_EXIST = 0] = "ID_NOT_EXIST", u[u.OFFLINE = 2] = "OFFLINE", u[u.LICENSE_MISMATCH = 3] = "LICENSE_MISMATCH", u[u.LICENSE_OVERUSE = 4] = "LICENSE_OVERUSE", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(G0 || {});
  5822. function ka(u) {
  5823. switch (u) {
  5824. case 0:
  5825. case"ID_NOT_EXIST":
  5826. return 0;
  5827. case 2:
  5828. case"OFFLINE":
  5829. return 2;
  5830. case 3:
  5831. case"LICENSE_MISMATCH":
  5832. return 3;
  5833. case 4:
  5834. case"LICENSE_OVERUSE":
  5835. return 4;
  5836. case-1:
  5837. case"UNRECOGNIZED":
  5838. default:
  5839. return -1
  5840. }
  5841. }
  5842. function ga(u) {
  5843. switch (u) {
  5844. case 0:
  5845. return "ID_NOT_EXIST";
  5846. case 2:
  5847. return "OFFLINE";
  5848. case 3:
  5849. return "LICENSE_MISMATCH";
  5850. case 4:
  5851. return "LICENSE_OVERUSE";
  5852. case-1:
  5853. default:
  5854. return "UNRECOGNIZED"
  5855. }
  5856. }
  5857. function Di() {
  5858. return {id: "", serial: 0}
  5859. }
  5860. const Z0 = {
  5861. encode(u, e = r.Writer.create()) {
  5862. return u.id !== "" && e.uint32(10).string(u.id), u.serial !== 0 && e.uint32(16).int32(u.serial), e
  5863. }, decode(u, e) {
  5864. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5865. let o = e === void 0 ? i.len : i.pos + e;
  5866. const a = Di();
  5867. for (; i.pos < o;) {
  5868. const t = i.uint32();
  5869. switch (t >>> 3) {
  5870. case 1:
  5871. if (t !== 10) break;
  5872. a.id = i.string();
  5873. continue;
  5874. case 2:
  5875. if (t !== 16) break;
  5876. a.serial = i.int32();
  5877. continue
  5878. }
  5879. if ((t & 7) === 4 || t === 0) break;
  5880. i.skipType(t & 7)
  5881. }
  5882. return a
  5883. }, fromJSON(u) {
  5884. return {id: p(u.id) ? globalThis.String(u.id) : "", serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  5885. }, toJSON(u) {
  5886. const e = {};
  5887. return u.id !== "" && (e.id = u.id), u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  5888. }, create(u) {
  5889. return Z0.fromPartial(u != null ? u : {})
  5890. }, fromPartial(u) {
  5891. var i, o;
  5892. const e = Di();
  5893. return e.id = (i = u.id) != null ? i : "", e.serial = (o = u.serial) != null ? o : 0, e
  5894. }
  5895. };
  5896. function Bi() {
  5897. return {request_pk: !1}
  5898. }
  5899. const Q0 = {
  5900. encode(u, e = r.Writer.create()) {
  5901. return u.request_pk !== !1 && e.uint32(16).bool(u.request_pk), e
  5902. }, decode(u, e) {
  5903. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5904. let o = e === void 0 ? i.len : i.pos + e;
  5905. const a = Bi();
  5906. for (; i.pos < o;) {
  5907. const t = i.uint32();
  5908. switch (t >>> 3) {
  5909. case 2:
  5910. if (t !== 16) break;
  5911. a.request_pk = i.bool();
  5912. continue
  5913. }
  5914. if ((t & 7) === 4 || t === 0) break;
  5915. i.skipType(t & 7)
  5916. }
  5917. return a
  5918. }, fromJSON(u) {
  5919. return {request_pk: p(u.request_pk) ? globalThis.Boolean(u.request_pk) : !1}
  5920. }, toJSON(u) {
  5921. const e = {};
  5922. return u.request_pk !== !1 && (e.request_pk = u.request_pk), e
  5923. }, create(u) {
  5924. return Q0.fromPartial(u != null ? u : {})
  5925. }, fromPartial(u) {
  5926. var i;
  5927. const e = Bi();
  5928. return e.request_pk = (i = u.request_pk) != null ? i : !1, e
  5929. }
  5930. };
  5931. function Ai() {
  5932. return {id: "", nat_type: 0, licence_key: "", conn_type: 0, token: "", version: ""}
  5933. }
  5934. const qu = {
  5935. encode(u, e = r.Writer.create()) {
  5936. return u.id !== "" && e.uint32(10).string(u.id), u.nat_type !== 0 && e.uint32(16).int32(u.nat_type), u.licence_key !== "" && e.uint32(26).string(u.licence_key), u.conn_type !== 0 && e.uint32(32).int32(u.conn_type), u.token !== "" && e.uint32(42).string(u.token), u.version !== "" && e.uint32(50).string(u.version), e
  5937. }, decode(u, e) {
  5938. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5939. let o = e === void 0 ? i.len : i.pos + e;
  5940. const a = Ai();
  5941. for (; i.pos < o;) {
  5942. const t = i.uint32();
  5943. switch (t >>> 3) {
  5944. case 1:
  5945. if (t !== 10) break;
  5946. a.id = i.string();
  5947. continue;
  5948. case 2:
  5949. if (t !== 16) break;
  5950. a.nat_type = i.int32();
  5951. continue;
  5952. case 3:
  5953. if (t !== 26) break;
  5954. a.licence_key = i.string();
  5955. continue;
  5956. case 4:
  5957. if (t !== 32) break;
  5958. a.conn_type = i.int32();
  5959. continue;
  5960. case 5:
  5961. if (t !== 42) break;
  5962. a.token = i.string();
  5963. continue;
  5964. case 6:
  5965. if (t !== 50) break;
  5966. a.version = i.string();
  5967. continue
  5968. }
  5969. if ((t & 7) === 4 || t === 0) break;
  5970. i.skipType(t & 7)
  5971. }
  5972. return a
  5973. }, fromJSON(u) {
  5974. return {
  5975. id: p(u.id) ? globalThis.String(u.id) : "",
  5976. nat_type: p(u.nat_type) ? J4(u.nat_type) : 0,
  5977. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  5978. conn_type: p(u.conn_type) ? nt(u.conn_type) : 0,
  5979. token: p(u.token) ? globalThis.String(u.token) : "",
  5980. version: p(u.version) ? globalThis.String(u.version) : ""
  5981. }
  5982. }, toJSON(u) {
  5983. const e = {};
  5984. return u.id !== "" && (e.id = u.id), u.nat_type !== 0 && (e.nat_type = G4(u.nat_type)), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = rt(u.conn_type)), u.token !== "" && (e.token = u.token), u.version !== "" && (e.version = u.version), e
  5985. }, create(u) {
  5986. return qu.fromPartial(u != null ? u : {})
  5987. }, fromPartial(u) {
  5988. var i, o, a, t, s, l;
  5989. const e = Ai();
  5990. return e.id = (i = u.id) != null ? i : "", e.nat_type = (o = u.nat_type) != null ? o : 0, e.licence_key = (a = u.licence_key) != null ? a : "", e.conn_type = (t = u.conn_type) != null ? t : 0, e.token = (s = u.token) != null ? s : "", e.version = (l = u.version) != null ? l : "", e
  5991. }
  5992. };
  5993. function mi() {
  5994. return {socket_addr: new Uint8Array(0), relay_server: "", nat_type: 0}
  5995. }
  5996. const X0 = {
  5997. encode(u, e = r.Writer.create()) {
  5998. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), u.nat_type !== 0 && e.uint32(24).int32(u.nat_type), e
  5999. }, decode(u, e) {
  6000. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6001. let o = e === void 0 ? i.len : i.pos + e;
  6002. const a = mi();
  6003. for (; i.pos < o;) {
  6004. const t = i.uint32();
  6005. switch (t >>> 3) {
  6006. case 1:
  6007. if (t !== 10) break;
  6008. a.socket_addr = i.bytes();
  6009. continue;
  6010. case 2:
  6011. if (t !== 18) break;
  6012. a.relay_server = i.string();
  6013. continue;
  6014. case 3:
  6015. if (t !== 24) break;
  6016. a.nat_type = i.int32();
  6017. continue
  6018. }
  6019. if ((t & 7) === 4 || t === 0) break;
  6020. i.skipType(t & 7)
  6021. }
  6022. return a
  6023. }, fromJSON(u) {
  6024. return {
  6025. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6026. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6027. nat_type: p(u.nat_type) ? J4(u.nat_type) : 0
  6028. }
  6029. }, toJSON(u) {
  6030. const e = {};
  6031. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = G4(u.nat_type)), e
  6032. }, create(u) {
  6033. return X0.fromPartial(u != null ? u : {})
  6034. }, fromPartial(u) {
  6035. var i, o, a;
  6036. const e = mi();
  6037. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (o = u.relay_server) != null ? o : "", e.nat_type = (a = u.nat_type) != null ? a : 0, e
  6038. }
  6039. };
  6040. function Fi() {
  6041. return {serial: 0}
  6042. }
  6043. const Y0 = {
  6044. encode(u, e = r.Writer.create()) {
  6045. return u.serial !== 0 && e.uint32(8).int32(u.serial), e
  6046. }, decode(u, e) {
  6047. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6048. let o = e === void 0 ? i.len : i.pos + e;
  6049. const a = Fi();
  6050. for (; i.pos < o;) {
  6051. const t = i.uint32();
  6052. switch (t >>> 3) {
  6053. case 1:
  6054. if (t !== 8) break;
  6055. a.serial = i.int32();
  6056. continue
  6057. }
  6058. if ((t & 7) === 4 || t === 0) break;
  6059. i.skipType(t & 7)
  6060. }
  6061. return a
  6062. }, fromJSON(u) {
  6063. return {serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  6064. }, toJSON(u) {
  6065. const e = {};
  6066. return u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6067. }, create(u) {
  6068. return Y0.fromPartial(u != null ? u : {})
  6069. }, fromPartial(u) {
  6070. var i;
  6071. const e = Fi();
  6072. return e.serial = (i = u.serial) != null ? i : 0, e
  6073. }
  6074. };
  6075. function _i() {
  6076. return {port: 0, cu: void 0}
  6077. }
  6078. const $0 = {
  6079. encode(u, e = r.Writer.create()) {
  6080. return u.port !== 0 && e.uint32(8).int32(u.port), u.cu !== void 0 && uu.encode(u.cu, e.uint32(18).fork()).ldelim(), e
  6081. }, decode(u, e) {
  6082. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6083. let o = e === void 0 ? i.len : i.pos + e;
  6084. const a = _i();
  6085. for (; i.pos < o;) {
  6086. const t = i.uint32();
  6087. switch (t >>> 3) {
  6088. case 1:
  6089. if (t !== 8) break;
  6090. a.port = i.int32();
  6091. continue;
  6092. case 2:
  6093. if (t !== 18) break;
  6094. a.cu = uu.decode(i, i.uint32());
  6095. continue
  6096. }
  6097. if ((t & 7) === 4 || t === 0) break;
  6098. i.skipType(t & 7)
  6099. }
  6100. return a
  6101. }, fromJSON(u) {
  6102. return {port: p(u.port) ? globalThis.Number(u.port) : 0, cu: p(u.cu) ? uu.fromJSON(u.cu) : void 0}
  6103. }, toJSON(u) {
  6104. const e = {};
  6105. return u.port !== 0 && (e.port = Math.round(u.port)), u.cu !== void 0 && (e.cu = uu.toJSON(u.cu)), e
  6106. }, create(u) {
  6107. return $0.fromPartial(u != null ? u : {})
  6108. }, fromPartial(u) {
  6109. var i;
  6110. const e = _i();
  6111. return e.port = (i = u.port) != null ? i : 0, e.cu = u.cu !== void 0 && u.cu !== null ? uu.fromPartial(u.cu) : void 0, e
  6112. }
  6113. };
  6114. function vi() {
  6115. return {socket_addr: new Uint8Array(0), id: "", relay_server: "", nat_type: 0, version: ""}
  6116. }
  6117. const u4 = {
  6118. encode(u, e = r.Writer.create()) {
  6119. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.id !== "" && e.uint32(18).string(u.id), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.nat_type !== 0 && e.uint32(32).int32(u.nat_type), u.version !== "" && e.uint32(42).string(u.version), e
  6120. }, decode(u, e) {
  6121. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6122. let o = e === void 0 ? i.len : i.pos + e;
  6123. const a = vi();
  6124. for (; i.pos < o;) {
  6125. const t = i.uint32();
  6126. switch (t >>> 3) {
  6127. case 1:
  6128. if (t !== 10) break;
  6129. a.socket_addr = i.bytes();
  6130. continue;
  6131. case 2:
  6132. if (t !== 18) break;
  6133. a.id = i.string();
  6134. continue;
  6135. case 3:
  6136. if (t !== 26) break;
  6137. a.relay_server = i.string();
  6138. continue;
  6139. case 4:
  6140. if (t !== 32) break;
  6141. a.nat_type = i.int32();
  6142. continue;
  6143. case 5:
  6144. if (t !== 42) break;
  6145. a.version = i.string();
  6146. continue
  6147. }
  6148. if ((t & 7) === 4 || t === 0) break;
  6149. i.skipType(t & 7)
  6150. }
  6151. return a
  6152. }, fromJSON(u) {
  6153. return {
  6154. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6155. id: p(u.id) ? globalThis.String(u.id) : "",
  6156. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6157. nat_type: p(u.nat_type) ? J4(u.nat_type) : 0,
  6158. version: p(u.version) ? globalThis.String(u.version) : ""
  6159. }
  6160. }, toJSON(u) {
  6161. const e = {};
  6162. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.id !== "" && (e.id = u.id), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = G4(u.nat_type)), u.version !== "" && (e.version = u.version), e
  6163. }, create(u) {
  6164. return u4.fromPartial(u != null ? u : {})
  6165. }, fromPartial(u) {
  6166. var i, o, a, t, s;
  6167. const e = vi();
  6168. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.id = (o = u.id) != null ? o : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.nat_type = (t = u.nat_type) != null ? t : 0, e.version = (s = u.version) != null ? s : "", e
  6169. }
  6170. };
  6171. function ki() {
  6172. return {id: "", uuid: new Uint8Array(0), pk: new Uint8Array(0), old_id: ""}
  6173. }
  6174. const e4 = {
  6175. encode(u, e = r.Writer.create()) {
  6176. return u.id !== "" && e.uint32(10).string(u.id), u.uuid.length !== 0 && e.uint32(18).bytes(u.uuid), u.pk.length !== 0 && e.uint32(26).bytes(u.pk), u.old_id !== "" && e.uint32(34).string(u.old_id), e
  6177. }, decode(u, e) {
  6178. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6179. let o = e === void 0 ? i.len : i.pos + e;
  6180. const a = ki();
  6181. for (; i.pos < o;) {
  6182. const t = i.uint32();
  6183. switch (t >>> 3) {
  6184. case 1:
  6185. if (t !== 10) break;
  6186. a.id = i.string();
  6187. continue;
  6188. case 2:
  6189. if (t !== 18) break;
  6190. a.uuid = i.bytes();
  6191. continue;
  6192. case 3:
  6193. if (t !== 26) break;
  6194. a.pk = i.bytes();
  6195. continue;
  6196. case 4:
  6197. if (t !== 34) break;
  6198. a.old_id = i.string();
  6199. continue
  6200. }
  6201. if ((t & 7) === 4 || t === 0) break;
  6202. i.skipType(t & 7)
  6203. }
  6204. return a
  6205. }, fromJSON(u) {
  6206. return {
  6207. id: p(u.id) ? globalThis.String(u.id) : "",
  6208. uuid: p(u.uuid) ? M(u.uuid) : new Uint8Array(0),
  6209. pk: p(u.pk) ? M(u.pk) : new Uint8Array(0),
  6210. old_id: p(u.old_id) ? globalThis.String(u.old_id) : ""
  6211. }
  6212. }, toJSON(u) {
  6213. const e = {};
  6214. return u.id !== "" && (e.id = u.id), u.uuid.length !== 0 && (e.uuid = L(u.uuid)), u.pk.length !== 0 && (e.pk = L(u.pk)), u.old_id !== "" && (e.old_id = u.old_id), e
  6215. }, create(u) {
  6216. return e4.fromPartial(u != null ? u : {})
  6217. }, fromPartial(u) {
  6218. var i, o, a, t;
  6219. const e = ki();
  6220. return e.id = (i = u.id) != null ? i : "", e.uuid = (o = u.uuid) != null ? o : new Uint8Array(0), e.pk = (a = u.pk) != null ? a : new Uint8Array(0), e.old_id = (t = u.old_id) != null ? t : "", e
  6221. }
  6222. };
  6223. function gi() {
  6224. return {result: 0, keep_alive: 0}
  6225. }
  6226. const i4 = {
  6227. encode(u, e = r.Writer.create()) {
  6228. return u.result !== 0 && e.uint32(8).int32(u.result), u.keep_alive !== 0 && e.uint32(16).int32(u.keep_alive), e
  6229. }, decode(u, e) {
  6230. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6231. let o = e === void 0 ? i.len : i.pos + e;
  6232. const a = gi();
  6233. for (; i.pos < o;) {
  6234. const t = i.uint32();
  6235. switch (t >>> 3) {
  6236. case 1:
  6237. if (t !== 8) break;
  6238. a.result = i.int32();
  6239. continue;
  6240. case 2:
  6241. if (t !== 16) break;
  6242. a.keep_alive = i.int32();
  6243. continue
  6244. }
  6245. if ((t & 7) === 4 || t === 0) break;
  6246. i.skipType(t & 7)
  6247. }
  6248. return a
  6249. }, fromJSON(u) {
  6250. return {
  6251. result: p(u.result) ? _a(u.result) : 0,
  6252. keep_alive: p(u.keep_alive) ? globalThis.Number(u.keep_alive) : 0
  6253. }
  6254. }, toJSON(u) {
  6255. const e = {};
  6256. return u.result !== 0 && (e.result = va(u.result)), u.keep_alive !== 0 && (e.keep_alive = Math.round(u.keep_alive)), e
  6257. }, create(u) {
  6258. return i4.fromPartial(u != null ? u : {})
  6259. }, fromPartial(u) {
  6260. var i, o;
  6261. const e = gi();
  6262. return e.result = (i = u.result) != null ? i : 0, e.keep_alive = (o = u.keep_alive) != null ? o : 0, e
  6263. }
  6264. };
  6265. function hi() {
  6266. return {
  6267. socket_addr: new Uint8Array(0),
  6268. pk: new Uint8Array(0),
  6269. failure: 0,
  6270. relay_server: "",
  6271. nat_type: void 0,
  6272. is_local: void 0,
  6273. other_failure: "",
  6274. feedback: 0
  6275. }
  6276. }
  6277. const t4 = {
  6278. encode(u, e = r.Writer.create()) {
  6279. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), u.failure !== 0 && e.uint32(24).int32(u.failure), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.nat_type !== void 0 && e.uint32(40).int32(u.nat_type), u.is_local !== void 0 && e.uint32(48).bool(u.is_local), u.other_failure !== "" && e.uint32(58).string(u.other_failure), u.feedback !== 0 && e.uint32(64).int32(u.feedback), e
  6280. }, decode(u, e) {
  6281. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6282. let o = e === void 0 ? i.len : i.pos + e;
  6283. const a = hi();
  6284. for (; i.pos < o;) {
  6285. const t = i.uint32();
  6286. switch (t >>> 3) {
  6287. case 1:
  6288. if (t !== 10) break;
  6289. a.socket_addr = i.bytes();
  6290. continue;
  6291. case 2:
  6292. if (t !== 18) break;
  6293. a.pk = i.bytes();
  6294. continue;
  6295. case 3:
  6296. if (t !== 24) break;
  6297. a.failure = i.int32();
  6298. continue;
  6299. case 4:
  6300. if (t !== 34) break;
  6301. a.relay_server = i.string();
  6302. continue;
  6303. case 5:
  6304. if (t !== 40) break;
  6305. a.nat_type = i.int32();
  6306. continue;
  6307. case 6:
  6308. if (t !== 48) break;
  6309. a.is_local = i.bool();
  6310. continue;
  6311. case 7:
  6312. if (t !== 58) break;
  6313. a.other_failure = i.string();
  6314. continue;
  6315. case 8:
  6316. if (t !== 64) break;
  6317. a.feedback = i.int32();
  6318. continue
  6319. }
  6320. if ((t & 7) === 4 || t === 0) break;
  6321. i.skipType(t & 7)
  6322. }
  6323. return a
  6324. }, fromJSON(u) {
  6325. return {
  6326. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6327. pk: p(u.pk) ? M(u.pk) : new Uint8Array(0),
  6328. failure: p(u.failure) ? ka(u.failure) : 0,
  6329. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6330. nat_type: p(u.nat_type) ? J4(u.nat_type) : void 0,
  6331. is_local: p(u.is_local) ? globalThis.Boolean(u.is_local) : void 0,
  6332. other_failure: p(u.other_failure) ? globalThis.String(u.other_failure) : "",
  6333. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6334. }
  6335. }, toJSON(u) {
  6336. const e = {};
  6337. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.pk.length !== 0 && (e.pk = L(u.pk)), u.failure !== 0 && (e.failure = ga(u.failure)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== void 0 && (e.nat_type = G4(u.nat_type)), u.is_local !== void 0 && (e.is_local = u.is_local), u.other_failure !== "" && (e.other_failure = u.other_failure), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6338. }, create(u) {
  6339. return t4.fromPartial(u != null ? u : {})
  6340. }, fromPartial(u) {
  6341. var i, o, a, t, s, l, E, c;
  6342. const e = hi();
  6343. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.pk = (o = u.pk) != null ? o : new Uint8Array(0), e.failure = (a = u.failure) != null ? a : 0, e.relay_server = (t = u.relay_server) != null ? t : "", e.nat_type = (s = u.nat_type) != null ? s : void 0, e.is_local = (l = u.is_local) != null ? l : void 0, e.other_failure = (E = u.other_failure) != null ? E : "", e.feedback = (c = u.feedback) != null ? c : 0, e
  6344. }
  6345. };
  6346. function fi() {
  6347. return {serial: 0, rendezvous_servers: []}
  6348. }
  6349. const uu = {
  6350. encode(u, e = r.Writer.create()) {
  6351. u.serial !== 0 && e.uint32(8).int32(u.serial);
  6352. for (const i of u.rendezvous_servers) e.uint32(18).string(i);
  6353. return e
  6354. }, decode(u, e) {
  6355. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6356. let o = e === void 0 ? i.len : i.pos + e;
  6357. const a = fi();
  6358. for (; i.pos < o;) {
  6359. const t = i.uint32();
  6360. switch (t >>> 3) {
  6361. case 1:
  6362. if (t !== 8) break;
  6363. a.serial = i.int32();
  6364. continue;
  6365. case 2:
  6366. if (t !== 18) break;
  6367. a.rendezvous_servers.push(i.string());
  6368. continue
  6369. }
  6370. if ((t & 7) === 4 || t === 0) break;
  6371. i.skipType(t & 7)
  6372. }
  6373. return a
  6374. }, fromJSON(u) {
  6375. return {
  6376. serial: p(u.serial) ? globalThis.Number(u.serial) : 0,
  6377. rendezvous_servers: globalThis.Array.isArray(u == null ? void 0 : u.rendezvous_servers) ? u.rendezvous_servers.map(e => globalThis.String(e)) : []
  6378. }
  6379. }, toJSON(u) {
  6380. var i;
  6381. const e = {};
  6382. return u.serial !== 0 && (e.serial = Math.round(u.serial)), (i = u.rendezvous_servers) != null && i.length && (e.rendezvous_servers = u.rendezvous_servers), e
  6383. }, create(u) {
  6384. return uu.fromPartial(u != null ? u : {})
  6385. }, fromPartial(u) {
  6386. var i, o;
  6387. const e = fi();
  6388. return e.serial = (i = u.serial) != null ? i : 0, e.rendezvous_servers = ((o = u.rendezvous_servers) == null ? void 0 : o.map(a => a)) || [], e
  6389. }
  6390. };
  6391. function xi() {
  6392. return {
  6393. id: "",
  6394. uuid: "",
  6395. socket_addr: new Uint8Array(0),
  6396. relay_server: "",
  6397. secure: !1,
  6398. licence_key: "",
  6399. conn_type: 0,
  6400. token: ""
  6401. }
  6402. }
  6403. const Ku = {
  6404. encode(u, e = r.Writer.create()) {
  6405. return u.id !== "" && e.uint32(10).string(u.id), u.uuid !== "" && e.uint32(18).string(u.uuid), u.socket_addr.length !== 0 && e.uint32(26).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(34).string(u.relay_server), u.secure !== !1 && e.uint32(40).bool(u.secure), u.licence_key !== "" && e.uint32(50).string(u.licence_key), u.conn_type !== 0 && e.uint32(56).int32(u.conn_type), u.token !== "" && e.uint32(66).string(u.token), e
  6406. }, decode(u, e) {
  6407. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6408. let o = e === void 0 ? i.len : i.pos + e;
  6409. const a = xi();
  6410. for (; i.pos < o;) {
  6411. const t = i.uint32();
  6412. switch (t >>> 3) {
  6413. case 1:
  6414. if (t !== 10) break;
  6415. a.id = i.string();
  6416. continue;
  6417. case 2:
  6418. if (t !== 18) break;
  6419. a.uuid = i.string();
  6420. continue;
  6421. case 3:
  6422. if (t !== 26) break;
  6423. a.socket_addr = i.bytes();
  6424. continue;
  6425. case 4:
  6426. if (t !== 34) break;
  6427. a.relay_server = i.string();
  6428. continue;
  6429. case 5:
  6430. if (t !== 40) break;
  6431. a.secure = i.bool();
  6432. continue;
  6433. case 6:
  6434. if (t !== 50) break;
  6435. a.licence_key = i.string();
  6436. continue;
  6437. case 7:
  6438. if (t !== 56) break;
  6439. a.conn_type = i.int32();
  6440. continue;
  6441. case 8:
  6442. if (t !== 66) break;
  6443. a.token = i.string();
  6444. continue
  6445. }
  6446. if ((t & 7) === 4 || t === 0) break;
  6447. i.skipType(t & 7)
  6448. }
  6449. return a
  6450. }, fromJSON(u) {
  6451. return {
  6452. id: p(u.id) ? globalThis.String(u.id) : "",
  6453. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6454. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6455. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6456. secure: p(u.secure) ? globalThis.Boolean(u.secure) : !1,
  6457. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6458. conn_type: p(u.conn_type) ? nt(u.conn_type) : 0,
  6459. token: p(u.token) ? globalThis.String(u.token) : ""
  6460. }
  6461. }, toJSON(u) {
  6462. const e = {};
  6463. return u.id !== "" && (e.id = u.id), u.uuid !== "" && (e.uuid = u.uuid), u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.secure !== !1 && (e.secure = u.secure), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = rt(u.conn_type)), u.token !== "" && (e.token = u.token), e
  6464. }, create(u) {
  6465. return Ku.fromPartial(u != null ? u : {})
  6466. }, fromPartial(u) {
  6467. var i, o, a, t, s, l, E, c;
  6468. const e = xi();
  6469. return e.id = (i = u.id) != null ? i : "", e.uuid = (o = u.uuid) != null ? o : "", e.socket_addr = (a = u.socket_addr) != null ? a : new Uint8Array(0), e.relay_server = (t = u.relay_server) != null ? t : "", e.secure = (s = u.secure) != null ? s : !1, e.licence_key = (l = u.licence_key) != null ? l : "", e.conn_type = (E = u.conn_type) != null ? E : 0, e.token = (c = u.token) != null ? c : "", e
  6470. }
  6471. };
  6472. function yi() {
  6473. return {
  6474. socket_addr: new Uint8Array(0),
  6475. uuid: "",
  6476. relay_server: "",
  6477. id: void 0,
  6478. pk: void 0,
  6479. refuse_reason: "",
  6480. version: "",
  6481. feedback: 0
  6482. }
  6483. }
  6484. const a4 = {
  6485. encode(u, e = r.Writer.create()) {
  6486. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.uuid !== "" && e.uint32(18).string(u.uuid), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== void 0 && e.uint32(34).string(u.id), u.pk !== void 0 && e.uint32(42).bytes(u.pk), u.refuse_reason !== "" && e.uint32(50).string(u.refuse_reason), u.version !== "" && e.uint32(58).string(u.version), u.feedback !== 0 && e.uint32(72).int32(u.feedback), e
  6487. }, decode(u, e) {
  6488. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6489. let o = e === void 0 ? i.len : i.pos + e;
  6490. const a = yi();
  6491. for (; i.pos < o;) {
  6492. const t = i.uint32();
  6493. switch (t >>> 3) {
  6494. case 1:
  6495. if (t !== 10) break;
  6496. a.socket_addr = i.bytes();
  6497. continue;
  6498. case 2:
  6499. if (t !== 18) break;
  6500. a.uuid = i.string();
  6501. continue;
  6502. case 3:
  6503. if (t !== 26) break;
  6504. a.relay_server = i.string();
  6505. continue;
  6506. case 4:
  6507. if (t !== 34) break;
  6508. a.id = i.string();
  6509. continue;
  6510. case 5:
  6511. if (t !== 42) break;
  6512. a.pk = i.bytes();
  6513. continue;
  6514. case 6:
  6515. if (t !== 50) break;
  6516. a.refuse_reason = i.string();
  6517. continue;
  6518. case 7:
  6519. if (t !== 58) break;
  6520. a.version = i.string();
  6521. continue;
  6522. case 9:
  6523. if (t !== 72) break;
  6524. a.feedback = i.int32();
  6525. continue
  6526. }
  6527. if ((t & 7) === 4 || t === 0) break;
  6528. i.skipType(t & 7)
  6529. }
  6530. return a
  6531. }, fromJSON(u) {
  6532. return {
  6533. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6534. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6535. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6536. id: p(u.id) ? globalThis.String(u.id) : void 0,
  6537. pk: p(u.pk) ? M(u.pk) : void 0,
  6538. refuse_reason: p(u.refuse_reason) ? globalThis.String(u.refuse_reason) : "",
  6539. version: p(u.version) ? globalThis.String(u.version) : "",
  6540. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6541. }
  6542. }, toJSON(u) {
  6543. const e = {};
  6544. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.uuid !== "" && (e.uuid = u.uuid), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== void 0 && (e.id = u.id), u.pk !== void 0 && (e.pk = L(u.pk)), u.refuse_reason !== "" && (e.refuse_reason = u.refuse_reason), u.version !== "" && (e.version = u.version), u.feedback !== 0 && (e.feedback = Math.round(u.feedback)), e
  6545. }, create(u) {
  6546. return a4.fromPartial(u != null ? u : {})
  6547. }, fromPartial(u) {
  6548. var i, o, a, t, s, l, E, c;
  6549. const e = yi();
  6550. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.uuid = (o = u.uuid) != null ? o : "", e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : void 0, e.pk = (s = u.pk) != null ? s : void 0, e.refuse_reason = (l = u.refuse_reason) != null ? l : "", e.version = (E = u.version) != null ? E : "", e.feedback = (c = u.feedback) != null ? c : 0, e
  6551. }
  6552. };
  6553. function bi() {
  6554. return {url: ""}
  6555. }
  6556. const o4 = {
  6557. encode(u, e = r.Writer.create()) {
  6558. return u.url !== "" && e.uint32(10).string(u.url), e
  6559. }, decode(u, e) {
  6560. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6561. let o = e === void 0 ? i.len : i.pos + e;
  6562. const a = bi();
  6563. for (; i.pos < o;) {
  6564. const t = i.uint32();
  6565. switch (t >>> 3) {
  6566. case 1:
  6567. if (t !== 10) break;
  6568. a.url = i.string();
  6569. continue
  6570. }
  6571. if ((t & 7) === 4 || t === 0) break;
  6572. i.skipType(t & 7)
  6573. }
  6574. return a
  6575. }, fromJSON(u) {
  6576. return {url: p(u.url) ? globalThis.String(u.url) : ""}
  6577. }, toJSON(u) {
  6578. const e = {};
  6579. return u.url !== "" && (e.url = u.url), e
  6580. }, create(u) {
  6581. return o4.fromPartial(u != null ? u : {})
  6582. }, fromPartial(u) {
  6583. var i;
  6584. const e = bi();
  6585. return e.url = (i = u.url) != null ? i : "", e
  6586. }
  6587. };
  6588. function wi() {
  6589. return {socket_addr: new Uint8Array(0), relay_server: ""}
  6590. }
  6591. const n4 = {
  6592. encode(u, e = r.Writer.create()) {
  6593. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), e
  6594. }, decode(u, e) {
  6595. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6596. let o = e === void 0 ? i.len : i.pos + e;
  6597. const a = wi();
  6598. for (; i.pos < o;) {
  6599. const t = i.uint32();
  6600. switch (t >>> 3) {
  6601. case 1:
  6602. if (t !== 10) break;
  6603. a.socket_addr = i.bytes();
  6604. continue;
  6605. case 2:
  6606. if (t !== 18) break;
  6607. a.relay_server = i.string();
  6608. continue
  6609. }
  6610. if ((t & 7) === 4 || t === 0) break;
  6611. i.skipType(t & 7)
  6612. }
  6613. return a
  6614. }, fromJSON(u) {
  6615. return {
  6616. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6617. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : ""
  6618. }
  6619. }, toJSON(u) {
  6620. const e = {};
  6621. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), e
  6622. }, create(u) {
  6623. return n4.fromPartial(u != null ? u : {})
  6624. }, fromPartial(u) {
  6625. var i, o;
  6626. const e = wi();
  6627. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (o = u.relay_server) != null ? o : "", e
  6628. }
  6629. };
  6630. function Si() {
  6631. return {socket_addr: new Uint8Array(0), local_addr: new Uint8Array(0), relay_server: "", id: "", version: ""}
  6632. }
  6633. const r4 = {
  6634. encode(u, e = r.Writer.create()) {
  6635. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.local_addr.length !== 0 && e.uint32(18).bytes(u.local_addr), u.relay_server !== "" && e.uint32(26).string(u.relay_server), u.id !== "" && e.uint32(34).string(u.id), u.version !== "" && e.uint32(42).string(u.version), e
  6636. }, decode(u, e) {
  6637. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6638. let o = e === void 0 ? i.len : i.pos + e;
  6639. const a = Si();
  6640. for (; i.pos < o;) {
  6641. const t = i.uint32();
  6642. switch (t >>> 3) {
  6643. case 1:
  6644. if (t !== 10) break;
  6645. a.socket_addr = i.bytes();
  6646. continue;
  6647. case 2:
  6648. if (t !== 18) break;
  6649. a.local_addr = i.bytes();
  6650. continue;
  6651. case 3:
  6652. if (t !== 26) break;
  6653. a.relay_server = i.string();
  6654. continue;
  6655. case 4:
  6656. if (t !== 34) break;
  6657. a.id = i.string();
  6658. continue;
  6659. case 5:
  6660. if (t !== 42) break;
  6661. a.version = i.string();
  6662. continue
  6663. }
  6664. if ((t & 7) === 4 || t === 0) break;
  6665. i.skipType(t & 7)
  6666. }
  6667. return a
  6668. }, fromJSON(u) {
  6669. return {
  6670. socket_addr: p(u.socket_addr) ? M(u.socket_addr) : new Uint8Array(0),
  6671. local_addr: p(u.local_addr) ? M(u.local_addr) : new Uint8Array(0),
  6672. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6673. id: p(u.id) ? globalThis.String(u.id) : "",
  6674. version: p(u.version) ? globalThis.String(u.version) : ""
  6675. }
  6676. }, toJSON(u) {
  6677. const e = {};
  6678. return u.socket_addr.length !== 0 && (e.socket_addr = L(u.socket_addr)), u.local_addr.length !== 0 && (e.local_addr = L(u.local_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.id !== "" && (e.id = u.id), u.version !== "" && (e.version = u.version), e
  6679. }, create(u) {
  6680. return r4.fromPartial(u != null ? u : {})
  6681. }, fromPartial(u) {
  6682. var i, o, a, t, s;
  6683. const e = Si();
  6684. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.local_addr = (o = u.local_addr) != null ? o : new Uint8Array(0), e.relay_server = (a = u.relay_server) != null ? a : "", e.id = (t = u.id) != null ? t : "", e.version = (s = u.version) != null ? s : "", e
  6685. }
  6686. };
  6687. function zi() {
  6688. return {cmd: "", mac: "", id: "", username: "", hostname: "", platform: "", misc: ""}
  6689. }
  6690. const s4 = {
  6691. encode(u, e = r.Writer.create()) {
  6692. return u.cmd !== "" && e.uint32(10).string(u.cmd), u.mac !== "" && e.uint32(18).string(u.mac), u.id !== "" && e.uint32(26).string(u.id), u.username !== "" && e.uint32(34).string(u.username), u.hostname !== "" && e.uint32(42).string(u.hostname), u.platform !== "" && e.uint32(50).string(u.platform), u.misc !== "" && e.uint32(58).string(u.misc), e
  6693. }, decode(u, e) {
  6694. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6695. let o = e === void 0 ? i.len : i.pos + e;
  6696. const a = zi();
  6697. for (; i.pos < o;) {
  6698. const t = i.uint32();
  6699. switch (t >>> 3) {
  6700. case 1:
  6701. if (t !== 10) break;
  6702. a.cmd = i.string();
  6703. continue;
  6704. case 2:
  6705. if (t !== 18) break;
  6706. a.mac = i.string();
  6707. continue;
  6708. case 3:
  6709. if (t !== 26) break;
  6710. a.id = i.string();
  6711. continue;
  6712. case 4:
  6713. if (t !== 34) break;
  6714. a.username = i.string();
  6715. continue;
  6716. case 5:
  6717. if (t !== 42) break;
  6718. a.hostname = i.string();
  6719. continue;
  6720. case 6:
  6721. if (t !== 50) break;
  6722. a.platform = i.string();
  6723. continue;
  6724. case 7:
  6725. if (t !== 58) break;
  6726. a.misc = i.string();
  6727. continue
  6728. }
  6729. if ((t & 7) === 4 || t === 0) break;
  6730. i.skipType(t & 7)
  6731. }
  6732. return a
  6733. }, fromJSON(u) {
  6734. return {
  6735. cmd: p(u.cmd) ? globalThis.String(u.cmd) : "",
  6736. mac: p(u.mac) ? globalThis.String(u.mac) : "",
  6737. id: p(u.id) ? globalThis.String(u.id) : "",
  6738. username: p(u.username) ? globalThis.String(u.username) : "",
  6739. hostname: p(u.hostname) ? globalThis.String(u.hostname) : "",
  6740. platform: p(u.platform) ? globalThis.String(u.platform) : "",
  6741. misc: p(u.misc) ? globalThis.String(u.misc) : ""
  6742. }
  6743. }, toJSON(u) {
  6744. const e = {};
  6745. return u.cmd !== "" && (e.cmd = u.cmd), u.mac !== "" && (e.mac = u.mac), u.id !== "" && (e.id = u.id), u.username !== "" && (e.username = u.username), u.hostname !== "" && (e.hostname = u.hostname), u.platform !== "" && (e.platform = u.platform), u.misc !== "" && (e.misc = u.misc), e
  6746. }, create(u) {
  6747. return s4.fromPartial(u != null ? u : {})
  6748. }, fromPartial(u) {
  6749. var i, o, a, t, s, l, E;
  6750. const e = zi();
  6751. return e.cmd = (i = u.cmd) != null ? i : "", e.mac = (o = u.mac) != null ? o : "", e.id = (a = u.id) != null ? a : "", e.username = (t = u.username) != null ? t : "", e.hostname = (s = u.hostname) != null ? s : "", e.platform = (l = u.platform) != null ? l : "", e.misc = (E = u.misc) != null ? E : "", e
  6752. }
  6753. };
  6754. function Pi() {
  6755. return {id: "", peers: []}
  6756. }
  6757. const Hu = {
  6758. encode(u, e = r.Writer.create()) {
  6759. u.id !== "" && e.uint32(10).string(u.id);
  6760. for (const i of u.peers) e.uint32(18).string(i);
  6761. return e
  6762. }, decode(u, e) {
  6763. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6764. let o = e === void 0 ? i.len : i.pos + e;
  6765. const a = Pi();
  6766. for (; i.pos < o;) {
  6767. const t = i.uint32();
  6768. switch (t >>> 3) {
  6769. case 1:
  6770. if (t !== 10) break;
  6771. a.id = i.string();
  6772. continue;
  6773. case 2:
  6774. if (t !== 18) break;
  6775. a.peers.push(i.string());
  6776. continue
  6777. }
  6778. if ((t & 7) === 4 || t === 0) break;
  6779. i.skipType(t & 7)
  6780. }
  6781. return a
  6782. }, fromJSON(u) {
  6783. return {
  6784. id: p(u.id) ? globalThis.String(u.id) : "",
  6785. peers: globalThis.Array.isArray(u == null ? void 0 : u.peers) ? u.peers.map(e => globalThis.String(e)) : []
  6786. }
  6787. }, toJSON(u) {
  6788. var i;
  6789. const e = {};
  6790. return u.id !== "" && (e.id = u.id), (i = u.peers) != null && i.length && (e.peers = u.peers), e
  6791. }, create(u) {
  6792. return Hu.fromPartial(u != null ? u : {})
  6793. }, fromPartial(u) {
  6794. var i, o;
  6795. const e = Pi();
  6796. return e.id = (i = u.id) != null ? i : "", e.peers = ((o = u.peers) == null ? void 0 : o.map(a => a)) || [], e
  6797. }
  6798. };
  6799. function Ri() {
  6800. return {states: new Uint8Array(0)}
  6801. }
  6802. const l4 = {
  6803. encode(u, e = r.Writer.create()) {
  6804. return u.states.length !== 0 && e.uint32(10).bytes(u.states), e
  6805. }, decode(u, e) {
  6806. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6807. let o = e === void 0 ? i.len : i.pos + e;
  6808. const a = Ri();
  6809. for (; i.pos < o;) {
  6810. const t = i.uint32();
  6811. switch (t >>> 3) {
  6812. case 1:
  6813. if (t !== 10) break;
  6814. a.states = i.bytes();
  6815. continue
  6816. }
  6817. if ((t & 7) === 4 || t === 0) break;
  6818. i.skipType(t & 7)
  6819. }
  6820. return a
  6821. }, fromJSON(u) {
  6822. return {states: p(u.states) ? M(u.states) : new Uint8Array(0)}
  6823. }, toJSON(u) {
  6824. const e = {};
  6825. return u.states.length !== 0 && (e.states = L(u.states)), e
  6826. }, create(u) {
  6827. return l4.fromPartial(u != null ? u : {})
  6828. }, fromPartial(u) {
  6829. var i;
  6830. const e = Ri();
  6831. return e.states = (i = u.states) != null ? i : new Uint8Array(0), e
  6832. }
  6833. };
  6834. function Ii() {
  6835. return {keys: []}
  6836. }
  6837. const E4 = {
  6838. encode(u, e = r.Writer.create()) {
  6839. for (const i of u.keys) e.uint32(10).bytes(i);
  6840. return e
  6841. }, decode(u, e) {
  6842. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6843. let o = e === void 0 ? i.len : i.pos + e;
  6844. const a = Ii();
  6845. for (; i.pos < o;) {
  6846. const t = i.uint32();
  6847. switch (t >>> 3) {
  6848. case 1:
  6849. if (t !== 10) break;
  6850. a.keys.push(i.bytes());
  6851. continue
  6852. }
  6853. if ((t & 7) === 4 || t === 0) break;
  6854. i.skipType(t & 7)
  6855. }
  6856. return a
  6857. }, fromJSON(u) {
  6858. return {keys: globalThis.Array.isArray(u == null ? void 0 : u.keys) ? u.keys.map(e => M(e)) : []}
  6859. }, toJSON(u) {
  6860. var i;
  6861. const e = {};
  6862. return (i = u.keys) != null && i.length && (e.keys = u.keys.map(o => L(o))), e
  6863. }, create(u) {
  6864. return E4.fromPartial(u != null ? u : {})
  6865. }, fromPartial(u) {
  6866. var i;
  6867. const e = Ii();
  6868. return e.keys = ((i = u.keys) == null ? void 0 : i.map(o => o)) || [], e
  6869. }
  6870. };
  6871. function Ti() {
  6872. return {token: ""}
  6873. }
  6874. const Ju = {
  6875. encode(u, e = r.Writer.create()) {
  6876. return u.token !== "" && e.uint32(10).string(u.token), e
  6877. }, decode(u, e) {
  6878. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6879. let o = e === void 0 ? i.len : i.pos + e;
  6880. const a = Ti();
  6881. for (; i.pos < o;) {
  6882. const t = i.uint32();
  6883. switch (t >>> 3) {
  6884. case 1:
  6885. if (t !== 10) break;
  6886. a.token = i.string();
  6887. continue
  6888. }
  6889. if ((t & 7) === 4 || t === 0) break;
  6890. i.skipType(t & 7)
  6891. }
  6892. return a
  6893. }, fromJSON(u) {
  6894. return {token: p(u.token) ? globalThis.String(u.token) : ""}
  6895. }, toJSON(u) {
  6896. const e = {};
  6897. return u.token !== "" && (e.token = u.token), e
  6898. }, create(u) {
  6899. return Ju.fromPartial(u != null ? u : {})
  6900. }, fromPartial(u) {
  6901. var i;
  6902. const e = Ti();
  6903. return e.token = (i = u.token) != null ? i : "", e
  6904. }
  6905. };
  6906. function ji() {
  6907. return {
  6908. register_peer: void 0,
  6909. register_peer_response: void 0,
  6910. punch_hole_request: void 0,
  6911. punch_hole: void 0,
  6912. punch_hole_sent: void 0,
  6913. punch_hole_response: void 0,
  6914. fetch_local_addr: void 0,
  6915. local_addr: void 0,
  6916. configure_update: void 0,
  6917. register_pk: void 0,
  6918. register_pk_response: void 0,
  6919. software_update: void 0,
  6920. request_relay: void 0,
  6921. relay_response: void 0,
  6922. test_nat_request: void 0,
  6923. test_nat_response: void 0,
  6924. peer_discovery: void 0,
  6925. online_request: void 0,
  6926. online_response: void 0,
  6927. key_exchange: void 0,
  6928. hc: void 0
  6929. }
  6930. }
  6931. const y4 = {
  6932. encode(u, e = r.Writer.create()) {
  6933. return u.register_peer !== void 0 && Z0.encode(u.register_peer, e.uint32(50).fork()).ldelim(), u.register_peer_response !== void 0 && Q0.encode(u.register_peer_response, e.uint32(58).fork()).ldelim(), u.punch_hole_request !== void 0 && qu.encode(u.punch_hole_request, e.uint32(66).fork()).ldelim(), u.punch_hole !== void 0 && X0.encode(u.punch_hole, e.uint32(74).fork()).ldelim(), u.punch_hole_sent !== void 0 && u4.encode(u.punch_hole_sent, e.uint32(82).fork()).ldelim(), u.punch_hole_response !== void 0 && t4.encode(u.punch_hole_response, e.uint32(90).fork()).ldelim(), u.fetch_local_addr !== void 0 && n4.encode(u.fetch_local_addr, e.uint32(98).fork()).ldelim(), u.local_addr !== void 0 && r4.encode(u.local_addr, e.uint32(106).fork()).ldelim(), u.configure_update !== void 0 && uu.encode(u.configure_update, e.uint32(114).fork()).ldelim(), u.register_pk !== void 0 && e4.encode(u.register_pk, e.uint32(122).fork()).ldelim(), u.register_pk_response !== void 0 && i4.encode(u.register_pk_response, e.uint32(130).fork()).ldelim(), u.software_update !== void 0 && o4.encode(u.software_update, e.uint32(138).fork()).ldelim(), u.request_relay !== void 0 && Ku.encode(u.request_relay, e.uint32(146).fork()).ldelim(), u.relay_response !== void 0 && a4.encode(u.relay_response, e.uint32(154).fork()).ldelim(), u.test_nat_request !== void 0 && Y0.encode(u.test_nat_request, e.uint32(162).fork()).ldelim(), u.test_nat_response !== void 0 && $0.encode(u.test_nat_response, e.uint32(170).fork()).ldelim(), u.peer_discovery !== void 0 && s4.encode(u.peer_discovery, e.uint32(178).fork()).ldelim(), u.online_request !== void 0 && Hu.encode(u.online_request, e.uint32(186).fork()).ldelim(), u.online_response !== void 0 && l4.encode(u.online_response, e.uint32(194).fork()).ldelim(), u.key_exchange !== void 0 && E4.encode(u.key_exchange, e.uint32(202).fork()).ldelim(), u.hc !== void 0 && Ju.encode(u.hc, e.uint32(210).fork()).ldelim(), e
  6934. }, decode(u, e) {
  6935. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6936. let o = e === void 0 ? i.len : i.pos + e;
  6937. const a = ji();
  6938. for (; i.pos < o;) {
  6939. const t = i.uint32();
  6940. switch (t >>> 3) {
  6941. case 6:
  6942. if (t !== 50) break;
  6943. a.register_peer = Z0.decode(i, i.uint32());
  6944. continue;
  6945. case 7:
  6946. if (t !== 58) break;
  6947. a.register_peer_response = Q0.decode(i, i.uint32());
  6948. continue;
  6949. case 8:
  6950. if (t !== 66) break;
  6951. a.punch_hole_request = qu.decode(i, i.uint32());
  6952. continue;
  6953. case 9:
  6954. if (t !== 74) break;
  6955. a.punch_hole = X0.decode(i, i.uint32());
  6956. continue;
  6957. case 10:
  6958. if (t !== 82) break;
  6959. a.punch_hole_sent = u4.decode(i, i.uint32());
  6960. continue;
  6961. case 11:
  6962. if (t !== 90) break;
  6963. a.punch_hole_response = t4.decode(i, i.uint32());
  6964. continue;
  6965. case 12:
  6966. if (t !== 98) break;
  6967. a.fetch_local_addr = n4.decode(i, i.uint32());
  6968. continue;
  6969. case 13:
  6970. if (t !== 106) break;
  6971. a.local_addr = r4.decode(i, i.uint32());
  6972. continue;
  6973. case 14:
  6974. if (t !== 114) break;
  6975. a.configure_update = uu.decode(i, i.uint32());
  6976. continue;
  6977. case 15:
  6978. if (t !== 122) break;
  6979. a.register_pk = e4.decode(i, i.uint32());
  6980. continue;
  6981. case 16:
  6982. if (t !== 130) break;
  6983. a.register_pk_response = i4.decode(i, i.uint32());
  6984. continue;
  6985. case 17:
  6986. if (t !== 138) break;
  6987. a.software_update = o4.decode(i, i.uint32());
  6988. continue;
  6989. case 18:
  6990. if (t !== 146) break;
  6991. a.request_relay = Ku.decode(i, i.uint32());
  6992. continue;
  6993. case 19:
  6994. if (t !== 154) break;
  6995. a.relay_response = a4.decode(i, i.uint32());
  6996. continue;
  6997. case 20:
  6998. if (t !== 162) break;
  6999. a.test_nat_request = Y0.decode(i, i.uint32());
  7000. continue;
  7001. case 21:
  7002. if (t !== 170) break;
  7003. a.test_nat_response = $0.decode(i, i.uint32());
  7004. continue;
  7005. case 22:
  7006. if (t !== 178) break;
  7007. a.peer_discovery = s4.decode(i, i.uint32());
  7008. continue;
  7009. case 23:
  7010. if (t !== 186) break;
  7011. a.online_request = Hu.decode(i, i.uint32());
  7012. continue;
  7013. case 24:
  7014. if (t !== 194) break;
  7015. a.online_response = l4.decode(i, i.uint32());
  7016. continue;
  7017. case 25:
  7018. if (t !== 202) break;
  7019. a.key_exchange = E4.decode(i, i.uint32());
  7020. continue;
  7021. case 26:
  7022. if (t !== 210) break;
  7023. a.hc = Ju.decode(i, i.uint32());
  7024. continue
  7025. }
  7026. if ((t & 7) === 4 || t === 0) break;
  7027. i.skipType(t & 7)
  7028. }
  7029. return a
  7030. }, fromJSON(u) {
  7031. return {
  7032. register_peer: p(u.register_peer) ? Z0.fromJSON(u.register_peer) : void 0,
  7033. register_peer_response: p(u.register_peer_response) ? Q0.fromJSON(u.register_peer_response) : void 0,
  7034. punch_hole_request: p(u.punch_hole_request) ? qu.fromJSON(u.punch_hole_request) : void 0,
  7035. punch_hole: p(u.punch_hole) ? X0.fromJSON(u.punch_hole) : void 0,
  7036. punch_hole_sent: p(u.punch_hole_sent) ? u4.fromJSON(u.punch_hole_sent) : void 0,
  7037. punch_hole_response: p(u.punch_hole_response) ? t4.fromJSON(u.punch_hole_response) : void 0,
  7038. fetch_local_addr: p(u.fetch_local_addr) ? n4.fromJSON(u.fetch_local_addr) : void 0,
  7039. local_addr: p(u.local_addr) ? r4.fromJSON(u.local_addr) : void 0,
  7040. configure_update: p(u.configure_update) ? uu.fromJSON(u.configure_update) : void 0,
  7041. register_pk: p(u.register_pk) ? e4.fromJSON(u.register_pk) : void 0,
  7042. register_pk_response: p(u.register_pk_response) ? i4.fromJSON(u.register_pk_response) : void 0,
  7043. software_update: p(u.software_update) ? o4.fromJSON(u.software_update) : void 0,
  7044. request_relay: p(u.request_relay) ? Ku.fromJSON(u.request_relay) : void 0,
  7045. relay_response: p(u.relay_response) ? a4.fromJSON(u.relay_response) : void 0,
  7046. test_nat_request: p(u.test_nat_request) ? Y0.fromJSON(u.test_nat_request) : void 0,
  7047. test_nat_response: p(u.test_nat_response) ? $0.fromJSON(u.test_nat_response) : void 0,
  7048. peer_discovery: p(u.peer_discovery) ? s4.fromJSON(u.peer_discovery) : void 0,
  7049. online_request: p(u.online_request) ? Hu.fromJSON(u.online_request) : void 0,
  7050. online_response: p(u.online_response) ? l4.fromJSON(u.online_response) : void 0,
  7051. key_exchange: p(u.key_exchange) ? E4.fromJSON(u.key_exchange) : void 0,
  7052. hc: p(u.hc) ? Ju.fromJSON(u.hc) : void 0
  7053. }
  7054. }, toJSON(u) {
  7055. const e = {};
  7056. return u.register_peer !== void 0 && (e.register_peer = Z0.toJSON(u.register_peer)), u.register_peer_response !== void 0 && (e.register_peer_response = Q0.toJSON(u.register_peer_response)), u.punch_hole_request !== void 0 && (e.punch_hole_request = qu.toJSON(u.punch_hole_request)), u.punch_hole !== void 0 && (e.punch_hole = X0.toJSON(u.punch_hole)), u.punch_hole_sent !== void 0 && (e.punch_hole_sent = u4.toJSON(u.punch_hole_sent)), u.punch_hole_response !== void 0 && (e.punch_hole_response = t4.toJSON(u.punch_hole_response)), u.fetch_local_addr !== void 0 && (e.fetch_local_addr = n4.toJSON(u.fetch_local_addr)), u.local_addr !== void 0 && (e.local_addr = r4.toJSON(u.local_addr)), u.configure_update !== void 0 && (e.configure_update = uu.toJSON(u.configure_update)), u.register_pk !== void 0 && (e.register_pk = e4.toJSON(u.register_pk)), u.register_pk_response !== void 0 && (e.register_pk_response = i4.toJSON(u.register_pk_response)), u.software_update !== void 0 && (e.software_update = o4.toJSON(u.software_update)), u.request_relay !== void 0 && (e.request_relay = Ku.toJSON(u.request_relay)), u.relay_response !== void 0 && (e.relay_response = a4.toJSON(u.relay_response)), u.test_nat_request !== void 0 && (e.test_nat_request = Y0.toJSON(u.test_nat_request)), u.test_nat_response !== void 0 && (e.test_nat_response = $0.toJSON(u.test_nat_response)), u.peer_discovery !== void 0 && (e.peer_discovery = s4.toJSON(u.peer_discovery)), u.online_request !== void 0 && (e.online_request = Hu.toJSON(u.online_request)), u.online_response !== void 0 && (e.online_response = l4.toJSON(u.online_response)), u.key_exchange !== void 0 && (e.key_exchange = E4.toJSON(u.key_exchange)), u.hc !== void 0 && (e.hc = Ju.toJSON(u.hc)), e
  7057. }, create(u) {
  7058. return y4.fromPartial(u != null ? u : {})
  7059. }, fromPartial(u) {
  7060. const e = ji();
  7061. return e.register_peer = u.register_peer !== void 0 && u.register_peer !== null ? Z0.fromPartial(u.register_peer) : void 0, e.register_peer_response = u.register_peer_response !== void 0 && u.register_peer_response !== null ? Q0.fromPartial(u.register_peer_response) : void 0, e.punch_hole_request = u.punch_hole_request !== void 0 && u.punch_hole_request !== null ? qu.fromPartial(u.punch_hole_request) : void 0, e.punch_hole = u.punch_hole !== void 0 && u.punch_hole !== null ? X0.fromPartial(u.punch_hole) : void 0, e.punch_hole_sent = u.punch_hole_sent !== void 0 && u.punch_hole_sent !== null ? u4.fromPartial(u.punch_hole_sent) : void 0, e.punch_hole_response = u.punch_hole_response !== void 0 && u.punch_hole_response !== null ? t4.fromPartial(u.punch_hole_response) : void 0, e.fetch_local_addr = u.fetch_local_addr !== void 0 && u.fetch_local_addr !== null ? n4.fromPartial(u.fetch_local_addr) : void 0, e.local_addr = u.local_addr !== void 0 && u.local_addr !== null ? r4.fromPartial(u.local_addr) : void 0, e.configure_update = u.configure_update !== void 0 && u.configure_update !== null ? uu.fromPartial(u.configure_update) : void 0, e.register_pk = u.register_pk !== void 0 && u.register_pk !== null ? e4.fromPartial(u.register_pk) : void 0, e.register_pk_response = u.register_pk_response !== void 0 && u.register_pk_response !== null ? i4.fromPartial(u.register_pk_response) : void 0, e.software_update = u.software_update !== void 0 && u.software_update !== null ? o4.fromPartial(u.software_update) : void 0, e.request_relay = u.request_relay !== void 0 && u.request_relay !== null ? Ku.fromPartial(u.request_relay) : void 0, e.relay_response = u.relay_response !== void 0 && u.relay_response !== null ? a4.fromPartial(u.relay_response) : void 0, e.test_nat_request = u.test_nat_request !== void 0 && u.test_nat_request !== null ? Y0.fromPartial(u.test_nat_request) : void 0, e.test_nat_response = u.test_nat_response !== void 0 && u.test_nat_response !== null ? $0.fromPartial(u.test_nat_response) : void 0, e.peer_discovery = u.peer_discovery !== void 0 && u.peer_discovery !== null ? s4.fromPartial(u.peer_discovery) : void 0, e.online_request = u.online_request !== void 0 && u.online_request !== null ? Hu.fromPartial(u.online_request) : void 0, e.online_response = u.online_response !== void 0 && u.online_response !== null ? l4.fromPartial(u.online_response) : void 0, e.key_exchange = u.key_exchange !== void 0 && u.key_exchange !== null ? E4.fromPartial(u.key_exchange) : void 0, e.hc = u.hc !== void 0 && u.hc !== null ? Ju.fromPartial(u.hc) : void 0, e
  7062. }
  7063. };
  7064. function M(u) {
  7065. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  7066. {
  7067. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  7068. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  7069. return i
  7070. }
  7071. }
  7072. function L(u) {
  7073. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  7074. {
  7075. const e = [];
  7076. return u.forEach(i => {
  7077. e.push(globalThis.String.fromCharCode(i))
  7078. }), globalThis.btoa(e.join(""))
  7079. }
  7080. }
  7081. function p(u) {
  7082. return u != null
  7083. }
  7084. class I4 {
  7085. constructor(e, i = !0, o = "") {
  7086. d(this, "_websocket");
  7087. d(this, "_eventHandlers");
  7088. d(this, "_buf");
  7089. d(this, "_status");
  7090. d(this, "_latency");
  7091. d(this, "_secretKey");
  7092. d(this, "_uri");
  7093. d(this, "_isRendezvous");
  7094. d(this, "_recvDataCount");
  7095. d(this, "_tag");
  7096. d(this, "_isProcessing");
  7097. this._eventHandlers = {
  7098. message: void 0,
  7099. open: void 0,
  7100. close: void 0,
  7101. error: void 0,
  7102. status_change: void 0
  7103. }, this._uri = e, this._status = "", this._buf = [], this._websocket = new WebSocket(e), this._websocket.onmessage = this._recv_message.bind(this), this._websocket.binaryType = "arraybuffer", this._latency = new Date().getTime(), this._isRendezvous = i, this._recvDataCount = 0, this._tag = o, this._isProcessing = !1
  7104. }
  7105. resetRecvDataCount() {
  7106. this._recvDataCount = 0
  7107. }
  7108. getRecvDataCount() {
  7109. return this._recvDataCount
  7110. }
  7111. latency() {
  7112. return this._latency
  7113. }
  7114. setSecretKey(e) {
  7115. this._secretKey = [e, 0, 0]
  7116. }
  7117. sendMessage(e) {
  7118. let i = eu.encode(eu.fromPartial(e)).finish(), o = this._secretKey;
  7119. o && (o[1] += 1, i = tt(i, o[1], o[0])), this._websocket.send(i)
  7120. }
  7121. sendRendezvous(e) {
  7122. this._websocket.send(y4.encode(y4.fromPartial(e)).finish())
  7123. }
  7124. sendBytes(e) {
  7125. let i = this._secretKey;
  7126. i && (i[1] += 1, e = tt(e, i[1], i[0])), this._websocket.send(e)
  7127. }
  7128. parseMessage(e) {
  7129. return eu.decode(e)
  7130. }
  7131. parseRendezvous(e) {
  7132. return y4.decode(e)
  7133. }
  7134. off(e) {
  7135. this._eventHandlers[e] = void 0
  7136. }
  7137. on(e, i) {
  7138. this._eventHandlers[e] = i
  7139. }
  7140. setStatus(e) {
  7141. this._status = e, this._eventHandlers.status_change && this._eventHandlers.status_change(e)
  7142. }
  7143. async open(e = 12e3) {
  7144. return new Promise((i, o) => {
  7145. setTimeout(() => {
  7146. this._status != "open" && o(this._status || "Timeout")
  7147. }, e), this._websocket.onopen = () => {
  7148. var a;
  7149. this._latency = new Date().getTime() - this._latency, this.setStatus("open"), console.debug(">> WebSock.onopen " + this._tag), (a = this._websocket) != null && a.protocol && console.info("Server " + this._tag + " choose sub-protocol: " + this._websocket.protocol), this._eventHandlers.open && this._eventHandlers.open(), console.info("WebSock.onopen " + this._tag), i(this)
  7150. }, this._websocket.onclose = a => {
  7151. this._status == "open", this.setStatus(a), this._tag == "query onlines" ? console.info("WebSock.onclose " + this._tag) : a.code == 1e3 ? console.info("WebSock.onclose " + this._tag + ": " + a.reason) : (console.error("WebSock.onclose: " + this._tag), console.error(a)), this._eventHandlers.close && this._eventHandlers.close(a), o("Reset by the peer")
  7152. }, this._websocket.onerror = a => {
  7153. if (!this._status) {
  7154. o("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server, " + this._uri);
  7155. return
  7156. }
  7157. this.setStatus(a), console.error("WebSock.onerror: " + this._tag), console.error(a), this._eventHandlers.error && this._eventHandlers.error(a)
  7158. }
  7159. })
  7160. }
  7161. async next(e = 12e3) {
  7162. let i = this._eventHandlers.message;
  7163. this.off("message");
  7164. try {
  7165. let o = await this._next(e);
  7166. return this.on("message", i), o
  7167. } catch (o) {
  7168. throw this.on("message", i), o
  7169. }
  7170. }
  7171. async _next(e = 12e3) {
  7172. const i = (o, a, t) => {
  7173. if (this._buf.length) o(this._buf[0]), this._buf.splice(0, 1); else {
  7174. if (this._status != "open") {
  7175. a(this._status);
  7176. return
  7177. }
  7178. new Date().getTime() > t + e ? a("Timeout") : setTimeout(() => i(o, a, t), 1)
  7179. }
  7180. };
  7181. return new Promise((o, a) => {
  7182. i(o, a, new Date().getTime())
  7183. })
  7184. }
  7185. close() {
  7186. this.setStatus(""), this._websocket && ((this._websocket.readyState === WebSocket.OPEN || this._websocket.readyState === WebSocket.CONNECTING) && (console.info("Closing WebSocket(" + this._tag + ") connection"), this._websocket.close(1e3, "Normal closure")), this._websocket.onmessage = () => {
  7187. })
  7188. }
  7189. _recv_message(e) {
  7190. if (e.data instanceof window.ArrayBuffer) {
  7191. let i = new Uint8Array(e.data);
  7192. this._recvDataCount += i.length;
  7193. const o = this._secretKey;
  7194. o && (o[2] += 1, i = zn(i, o[2], o[0]));
  7195. let a;
  7196. i.length == 0 ? a = new Uint8Array : a = this._isRendezvous ? this.parseRendezvous(i) : this.parseMessage(i), this._buf.push(a), this._eventHandlers.message && (this._isProcessing || this.processQueue())
  7197. }
  7198. }
  7199. async processQueue() {
  7200. this._isProcessing = !0;
  7201. try {
  7202. for (; this._buf.length > 0 && this._eventHandlers.message;) {
  7203. const e = this._buf.shift();
  7204. await this._eventHandlers.message(e)
  7205. }
  7206. } catch (e) {
  7207. console.log("Error in processQueue: " + e)
  7208. }
  7209. this._isProcessing = !1
  7210. }
  7211. }
  7212. let Au = null;
  7213. const Ni = ".";
  7214. var X, Bu, Yu, q4, Eu, K4, lt, v4;
  7215. class ha {
  7216. constructor() {
  7217. pu(this, K4);
  7218. pu(this, X, null);
  7219. pu(this, Bu, {});
  7220. pu(this, Yu, {});
  7221. pu(this, q4, 0);
  7222. pu(this, Eu, []);
  7223. pu(this, v4, async (e, i) => {
  7224. const o = await (await fetch(e)).arrayBuffer(), a = new Blob([o], {type: i});
  7225. return URL.createObjectURL(a)
  7226. })
  7227. }
  7228. async load() {
  7229. if (!g(this, X)) {
  7230. C4(this, X, new Worker("./ffmpeg.js?v=dddac33a", {type: "module"})), Pe(this, K4, lt).call(this);
  7231. const e = await g(this, v4).call(this, `${Ni}/ffmpeg-core.js?v=16fa4bb1`, "text/javascript"),
  7232. i = await g(this, v4).call(this, `${Ni}/ffmpeg-core.wasm?v=241ebe18`, "application/wasm");
  7233. return this.send({type: "LOAD", data: {coreURL: e, wasmURL: i}})
  7234. }
  7235. }
  7236. async decode(e, i) {
  7237. let o = [i];
  7238. var a = null;
  7239. return g(this, Eu).length > 0 && (a = g(this, Eu).pop(), o.push(a)), this.send({
  7240. type: "DECODE",
  7241. data: {codec: e, data: i, arrayBuffer: a}
  7242. }, o)
  7243. }
  7244. async send({type: e, data: i}, o) {
  7245. return g(this, X) ? new Promise((a, t) => {
  7246. const s = ze(this, q4)._++;
  7247. g(this, Bu)[s] = a, g(this, Yu)[s] = t, g(this, X).postMessage({id: s, type: e, data: i}, o)
  7248. }) : Promise.reject("FFmpeg not loaded")
  7249. }
  7250. close() {
  7251. g(this, X) && (this.send({type: "CLOSE", data: {}}), g(this, X).terminate(), C4(this, X, null))
  7252. }
  7253. }
  7254. X = new WeakMap, Bu = new WeakMap, Yu = new WeakMap, q4 = new WeakMap, Eu = new WeakMap, K4 = new WeakSet, lt = function () {
  7255. g(this, X).onmessage = ({data: {id: e, type: i, data: o}}) => {
  7256. i == "LOAD" ? (console.log("FFmpeg loaded"), g(this, Bu)[e](o)) : i == "DECODE" ? (g(this, Eu).push(o.data.data), g(this, Eu).length > 8 && g(this, Eu).shift(), g(this, Bu)[e](o)) : i == "CLOSE" ? (C4(this, Eu, []), g(this, Bu)[e](o)) : i == "ERROR" ? g(this, Yu)[e](o) : g(this, Yu)[e](o), delete g(this, Bu)[e], delete g(this, Yu)[e]
  7257. }
  7258. }, v4 = new WeakMap;
  7259. async function fa() {
  7260. try {
  7261. return Au = new ha, Au ? Au.load() : Promise.reject("Failed to create FFmpeg instance")
  7262. } catch (u) {
  7263. return console.log("Failed to load FFmpeg", u), Promise.reject("Failed to load FFmpeg")
  7264. }
  7265. }
  7266. async function xa(u, e) {
  7267. return Au ? Au.decode(u, e) : Promise.reject("FFmpeg is uninitialized")
  7268. }
  7269. async function ya() {
  7270. Au && (Au.close(), Au = null)
  7271. }
  7272. const ba = "Desktop session not ready", wa = "Desktop xsession failed", Sa = "Desktop session another user login",
  7273. za = "Desktop xorg not found", Pa = "Desktop none", Ra = "Desktop session not ready, password empty",
  7274. Ia = "Desktop session not ready, password wrong", Ta = "Empty Password", ja = "Wrong Password",
  7275. Na = "Wrong 2FA Code", Oi = "2FA Required", Oa = "No Password Access", Ma = "Wayland login screen is not supported",
  7276. La = "x11 expected", Et = "https://rustdesk.com/docs/en/manual/linux/#x11-required",
  7277. Ua = "https://rustdesk.com/docs/en/", Wa = Et,
  7278. Va = "https://github.com/rustdesk/rustdesk/wiki/Headless-Linux-Support",
  7279. Mi = {"rustdesk docs home": Ua, "rustdesk docs x11-required": Wa, "rustdesk x11 headless": Va},
  7280. Li = "Input source 1", qa = "map", Ui = "translate", Ka = "ShiftLeft", Ha = "ShiftRight", B4 = "ControlLeft",
  7281. dt = "ControlRight", ce = "AltLeft", ct = "AltRight", Ct = "MetaLeft", pt = "MetaRight", Z4 = "Windows",
  7282. Q4 = "Linux", Ce = "Mac OS", Dt = "Android", Ja = "iOS", Ga = "web", Za = "ISO", Qa = 1, Xa = 2, Wi = 3, Vi = 4,
  7283. g4 = 1, h4 = 2, Ya = 4, $a = 8, uo = 16, $4 = "public", qi = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=",
  7284. eo = 1e3, io = 6e4, oe = lang, to = langIds;
  7285. function ao(u, e, i, o) {
  7286. return u == "error" && e == "Connection Error" && ((i.indexOf("10054") < 0 || i.indexOf("104") < 0) && o || i.toLowerCase().indexOf("offline") < 0 && i.toLowerCase().indexOf("exist") < 0 && i.toLowerCase().indexOf("handshake") < 0 && i.toLowerCase().indexOf("failed") < 0 && i.toLowerCase().indexOf("resolve") < 0 && i.toLowerCase().indexOf("mismatch") < 0 && i.toLowerCase().indexOf("manually") < 0 && i.toLowerCase().indexOf("not allowed") < 0)
  7287. }
  7288. const oo = {
  7289. VK_A: "a",
  7290. VK_B: "b",
  7291. VK_C: "c",
  7292. VK_D: "d",
  7293. VK_E: "e",
  7294. VK_F: "f",
  7295. VK_G: "g",
  7296. VK_H: "h",
  7297. VK_I: "i",
  7298. VK_J: "j",
  7299. VK_K: "k",
  7300. VK_L: "l",
  7301. VK_M: "m",
  7302. VK_N: "n",
  7303. VK_O: "o",
  7304. VK_P: "p",
  7305. VK_Q: "q",
  7306. VK_R: "r",
  7307. VK_S: "s",
  7308. VK_T: "t",
  7309. VK_U: "u",
  7310. VK_V: "v",
  7311. VK_W: "w",
  7312. VK_X: "x",
  7313. VK_Y: "y",
  7314. VK_Z: "z",
  7315. VK_0: "0",
  7316. VK_1: "1",
  7317. VK_2: "2",
  7318. VK_3: "3",
  7319. VK_4: "4",
  7320. VK_5: "5",
  7321. VK_6: "6",
  7322. VK_7: "7",
  7323. VK_8: "8",
  7324. VK_9: "9",
  7325. VK_COMMA: ",",
  7326. VK_SLASH: "/",
  7327. VK_SEMICOLON: ";",
  7328. VK_QUOTE: "'",
  7329. VK_LBRACKET: "[",
  7330. VK_RBRACKET: "]",
  7331. VK_BACKSLASH: "\\",
  7332. VK_MINUS: "-",
  7333. VK_PLUS: "=",
  7334. VK_DIVIDE: "Divide",
  7335. VK_MULTIPLY: "Multiply",
  7336. VK_SUBTRACT: "Subtract",
  7337. VK_ADD: "Add",
  7338. VK_DECIMAL: "Decimal",
  7339. VK_F1: "F1",
  7340. VK_F2: "F2",
  7341. VK_F3: "F3",
  7342. VK_F4: "F4",
  7343. VK_F5: "F5",
  7344. VK_F6: "F6",
  7345. VK_F7: "F7",
  7346. VK_F8: "F8",
  7347. VK_F9: "F9",
  7348. VK_F10: "F10",
  7349. VK_F11: "F11",
  7350. VK_F12: "F12",
  7351. VK_ENTER: "Return",
  7352. VK_CANCEL: "Cancel",
  7353. VK_BACK: "Backspace",
  7354. VK_TAB: "Tab",
  7355. VK_CLEAR: "Clear",
  7356. VK_RETURN: "Return",
  7357. VK_SHIFT: "Shift",
  7358. VK_CONTROL: "Control",
  7359. VK_MENU: "Alt",
  7360. VK_PAUSE: "Pause",
  7361. VK_CAPITAL: "CapsLock",
  7362. VK_KANA: "Kana",
  7363. VK_HANGUL: "Hangul",
  7364. VK_JUNJA: "Junja",
  7365. VK_FINAL: "Final",
  7366. VK_HANJA: "Hanja",
  7367. VK_KANJI: "Kanji",
  7368. VK_ESCAPE: "Escape",
  7369. VK_CONVERT: "Convert",
  7370. VK_SPACE: "Space",
  7371. VK_PRIOR: "PageUp",
  7372. VK_NEXT: "PageDown",
  7373. VK_END: "End",
  7374. VK_HOME: "Home",
  7375. VK_LEFT: "LeftArrow",
  7376. VK_UP: "UpArrow",
  7377. VK_RIGHT: "RightArrow",
  7378. VK_DOWN: "DownArrow",
  7379. VK_SELECT: "Select",
  7380. VK_PRINT: "Print",
  7381. VK_EXECUTE: "Execute",
  7382. VK_SNAPSHOT: "Snapshot",
  7383. VK_INSERT: "Insert",
  7384. VK_DELETE: "Delete",
  7385. VK_HELP: "Help",
  7386. VK_SLEEP: "Sleep",
  7387. VK_SEPARATOR: "Separator",
  7388. VK_NUMPAD0: "Numpad0",
  7389. VK_NUMPAD1: "Numpad1",
  7390. VK_NUMPAD2: "Numpad2",
  7391. VK_NUMPAD3: "Numpad3",
  7392. VK_NUMPAD4: "Numpad4",
  7393. VK_NUMPAD5: "Numpad5",
  7394. VK_NUMPAD6: "Numpad6",
  7395. VK_NUMPAD7: "Numpad7",
  7396. VK_NUMPAD8: "Numpad8",
  7397. VK_NUMPAD9: "Numpad9",
  7398. Apps: "Apps",
  7399. Meta: "Meta",
  7400. RAlt: "RAlt",
  7401. RWin: "RWin",
  7402. RControl: "RControl",
  7403. RShift: "RShift",
  7404. CTRL_ALT_DEL: "CtrlAltDel",
  7405. LOCK_SCREEN: "LockScreen"
  7406. }, ne = "1.3.3", no = "2024-11-22 02:03";
  7407. class A {
  7408. static setItem(e, i) {
  7409. localStorage.setItem(this.prefix + e, i)
  7410. }
  7411. static getItem(e) {
  7412. return localStorage.getItem(this.prefix + e)
  7413. }
  7414. static removeItem(e) {
  7415. localStorage.removeItem(this.prefix + e)
  7416. }
  7417. static clear() {
  7418. for (let e = localStorage.length - 1; e >= 0; e--) {
  7419. const i = localStorage.key(e);
  7420. i && i.startsWith(this.prefix) && localStorage.removeItem(i)
  7421. }
  7422. }
  7423. }
  7424. d(A, "prefix", "wc-");
  7425. class O {
  7426. static async init() {
  7427. if (!this.db) return new Promise((e, i) => {
  7428. const o = indexedDB.open(this.dbName, 1);
  7429. o.onupgradeneeded = a => {
  7430. const t = a.target.result;
  7431. t.objectStoreNames.contains(this.storeName) || t.createObjectStore(this.storeName)
  7432. }, o.onsuccess = async a => {
  7433. this.db = a.target.result;
  7434. try {
  7435. await this.loadCache(), e()
  7436. } catch (t) {
  7437. i(t)
  7438. }
  7439. }, o.onerror = a => {
  7440. i(a.target.error)
  7441. }
  7442. })
  7443. }
  7444. static async loadCache() {
  7445. return new Promise((e, i) => {
  7446. const a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName), t = a.getAllKeys();
  7447. t.onsuccess = s => {
  7448. const E = s.target.result.map(c => new Promise((C, D) => {
  7449. const B = a.get(c);
  7450. B.onsuccess = m => {
  7451. this.cache[c] = m.target.result, C()
  7452. }, B.onerror = m => {
  7453. D(m.target.error)
  7454. }
  7455. }));
  7456. Promise.all(E).then(() => e()).catch(i)
  7457. }, t.onerror = s => {
  7458. i(s.target.error)
  7459. }
  7460. })
  7461. }
  7462. static setItem(e, i) {
  7463. this.cache[this.prefix + e] = i;
  7464. const t = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(i, this.prefix + e);
  7465. t.onerror = s => {
  7466. console.error("IndexedDB setItem error:", s.target.error)
  7467. }
  7468. }
  7469. static getItem(e) {
  7470. var i;
  7471. return (i = this.cache[this.prefix + e]) != null ? i : null
  7472. }
  7473. static removeItem(e) {
  7474. delete this.cache[this.prefix + e];
  7475. const a = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(this.prefix + e);
  7476. a.onerror = t => {
  7477. console.error("IndexedDB removeItem error:", t.target.error)
  7478. }
  7479. }
  7480. static clear() {
  7481. this.cache = {};
  7482. const o = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
  7483. o.onerror = a => {
  7484. console.error("IndexedDB clear error:", a.target.error)
  7485. }
  7486. }
  7487. }
  7488. d(O, "dbName", "wc-database"), d(O, "storeName", "wc-store"), d(O, "prefix", "wc-"), d(O, "db", null), d(O, "cache", {});
  7489. const Cu = () => {
  7490. try {
  7491. return JSON.parse(O.getItem("peers")) || {}
  7492. } catch {
  7493. return {}
  7494. }
  7495. }, pe = u => {
  7496. O.setItem("peers", JSON.stringify(u))
  7497. }, ro = u => {
  7498. const e = Cu();
  7499. delete e[u], pe(e)
  7500. }, re = u => Cu()[u], so = (u, e) => {
  7501. const i = Cu();
  7502. i[u] = e, pe(i)
  7503. }, lo = (u, e) => {
  7504. var o;
  7505. return (o = re(u)[e]) != null ? o : $u(e)
  7506. }, Bt = (u, e, i) => {
  7507. const o = Cu(), a = o[u] || {};
  7508. i == null ? delete a[e] : a[e] = i, a.tm = new Date().getTime(), o[u] = a, pe(o)
  7509. }, De = u => A.getItem(`option:local:${u}`), At = (u, e) => {
  7510. A.setItem(`option:local:${u}`, e)
  7511. }, Eo = u => A.getItem(`option:flutter:local:${u}`), co = (u, e) => {
  7512. A.setItem(`option:flutter:local:${u}`, e)
  7513. }, mt = async u => {
  7514. const e = Lt(), i = Qu.publicKey, o = X4(0), a = e.from_string(u), t = await Ht(a),
  7515. s = e.crypto_secretbox_easy(t, o, i);
  7516. return Z(s)
  7517. }, Ft = async u => {
  7518. const e = Lt(), i = Qu.publicKey, o = d4(u), a = e.crypto_secretbox_open_easy(o, X4(0), i), t = await Jt(a);
  7519. return e.to_string(t)
  7520. }, Co = async u => {
  7521. let e = await mt(u);
  7522. O.setItem("ab", e)
  7523. }, _t = async () => {
  7524. try {
  7525. let u = O.getItem("ab");
  7526. if (u) return JSON.parse(await Ft(u))
  7527. } catch (u) {
  7528. console.error("loadAb error", u)
  7529. }
  7530. return {access_token: "", ab_entries: []}
  7531. }, po = () => {
  7532. O.removeItem("ab")
  7533. }, Do = async u => {
  7534. let e = await mt(u);
  7535. O.setItem("group", e)
  7536. }, Bo = async () => {
  7537. try {
  7538. let u = O.getItem("group");
  7539. if (u) return JSON.parse(await Ft(u))
  7540. } catch (u) {
  7541. console.error("loadGroup error", u)
  7542. }
  7543. return {access_token: "", users: [], peers: []}
  7544. }, Ao = () => {
  7545. O.removeItem("group")
  7546. }, mo = u => u.name == "My address book" || u.name == "Legacy address book";
  7547. var vt = kt();
  7548. function Fo() {
  7549. vt = kt()
  7550. }
  7551. function _o(u, e) {
  7552. const i = vt || u.substring(u.length - 2).toLowerCase();
  7553. let o = oe.en, a = oe[i];
  7554. a || (a = o);
  7555. let t = a[e];
  7556. return !t && i != "en" && (t = o[e]), t || e
  7557. }
  7558. const vo = "z".charCodeAt(0), ko = "a".charCodeAt(0);
  7559. function go(u, e) {
  7560. const i = oo[u] || u;
  7561. if (i.length == 1) {
  7562. const a = i.charCodeAt(0);
  7563. return !e && (a > vo || a < ko) ? w.fromPartial({unicode: a}) : w.fromPartial({chr: a})
  7564. }
  7565. const o = A4(i);
  7566. return o == N.UNRECOGNIZED && console.error("Unknown control key " + i), w.fromPartial({control_key: o})
  7567. }
  7568. async function ue(u) {
  7569. await new Promise(e => setTimeout(e, u))
  7570. }
  7571. function kt() {
  7572. let u = A.getItem("option:local:lang");
  7573. if (u && (u.includes("-") && (u = u.split("-")[1]), u.includes("_") && (u = u.split("_")[1]), oe.hasOwnProperty(u))) return u;
  7574. try {
  7575. const e = window.location.search;
  7576. return new URLSearchParams(e).get("lang") || ""
  7577. } catch {
  7578. return ""
  7579. }
  7580. }
  7581. var Qu = {privateKey: new Uint8Array([]), publicKey: new Uint8Array([])};
  7582. async function ho() {
  7583. try {
  7584. const u = "app-data";
  7585. try {
  7586. const i = A.getItem(u);
  7587. if (i) {
  7588. const o = JSON.parse(i);
  7589. if (Qu = {
  7590. privateKey: new Uint8Array(d4(o.a)),
  7591. publicKey: new Uint8Array(d4(o.b))
  7592. }, Qu.publicKey.length === 32 && Qu.privateKey.length === 64) return
  7593. }
  7594. } catch (i) {
  7595. console.error(i)
  7596. }
  7597. const e = await fo();
  7598. A.setItem(u, JSON.stringify({a: Z(e.privateKey), b: Z(e.publicKey)})), Qu = e
  7599. } catch (u) {
  7600. console.error("failed to init key pair", u)
  7601. }
  7602. }
  7603. function Z(u) {
  7604. return yn(u)
  7605. }
  7606. function d4(u) {
  7607. return Ut(u)
  7608. }
  7609. async function fo() {
  7610. return await Mn()
  7611. }
  7612. function T4() {
  7613. return "web"
  7614. }
  7615. function gt() {
  7616. return "web"
  7617. }
  7618. function ht() {
  7619. return Z(Qu.publicKey)
  7620. }
  7621. function xo() {
  7622. return Gu([ht()])
  7623. }
  7624. function Gu(u) {
  7625. const e = new Xt.exports.Hash;
  7626. return u.forEach(i => (typeof i == "string" && (i = new TextEncoder().encode(i)), e.update(i))), e.digest()
  7627. }
  7628. function ft() {
  7629. const u = navigator.userAgent.toLowerCase();
  7630. return u.includes("win") ? Z4 : u.includes("mac") ? Ce : u.includes("linux") ? Q4 : u.includes("android") ? Dt : u.includes("iphone") || u.includes("ipad") ? Ja : "Unknown OS"
  7631. }
  7632. async function yo(u, e) {
  7633. for (let i = 0; i < 2; i++) {
  7634. const a = e === void 0 ? await u.next() : await u.next(e);
  7635. if (!(!a || (a == null ? void 0 : a.key_exchange))) return a
  7636. }
  7637. }
  7638. function bo() {
  7639. return A.getItem("key") || void 0
  7640. }
  7641. function xt() {
  7642. return A.getItem("option:local:access_token") || void 0
  7643. }
  7644. function wo() {
  7645. return A.getItem("option:local:user_info") || void 0
  7646. }
  7647. function b4() {
  7648. return Xu
  7649. }
  7650. const Be = {
  7651. Alt: 56,
  7652. AltGr: 57400,
  7653. Backspace: 14,
  7654. CapsLock: 58,
  7655. ControlLeft: 29,
  7656. ControlRight: 57373,
  7657. Delete: 57427,
  7658. UpArrow: 57416,
  7659. DownArrow: 57424,
  7660. LeftArrow: 57419,
  7661. RightArrow: 57421,
  7662. End: 57423,
  7663. Escape: 1,
  7664. F1: 59,
  7665. F2: 60,
  7666. F3: 61,
  7667. F4: 62,
  7668. F5: 63,
  7669. F6: 64,
  7670. F7: 65,
  7671. F8: 66,
  7672. F9: 67,
  7673. F10: 68,
  7674. F11: 87,
  7675. F12: 88,
  7676. F13: 100,
  7677. F14: 101,
  7678. F15: 102,
  7679. F16: 103,
  7680. F17: 104,
  7681. F18: 105,
  7682. F19: 106,
  7683. F20: 107,
  7684. F21: 108,
  7685. F22: 109,
  7686. F23: 110,
  7687. F24: 118,
  7688. Home: 57415,
  7689. MetaLeft: 57435,
  7690. PageDown: 57425,
  7691. PageUp: 57417,
  7692. Return: 28,
  7693. ShiftLeft: 42,
  7694. ShiftRight: 54,
  7695. Space: 57,
  7696. Tab: 15,
  7697. PrintScreen: 57399,
  7698. ScrollLock: 70,
  7699. NumLock: 69,
  7700. BackQuote: 41,
  7701. Num1: 2,
  7702. Num2: 3,
  7703. Num3: 4,
  7704. Num4: 5,
  7705. Num5: 6,
  7706. Num6: 7,
  7707. Num7: 8,
  7708. Num8: 9,
  7709. Num9: 10,
  7710. Num0: 11,
  7711. Minus: 12,
  7712. Equal: 13,
  7713. KeyQ: 16,
  7714. KeyW: 17,
  7715. KeyE: 18,
  7716. KeyR: 19,
  7717. KeyT: 20,
  7718. KeyY: 21,
  7719. KeyU: 22,
  7720. KeyI: 23,
  7721. KeyO: 24,
  7722. KeyP: 25,
  7723. LeftBracket: 26,
  7724. RightBracket: 27,
  7725. BackSlash: 43,
  7726. KeyA: 30,
  7727. KeyS: 31,
  7728. KeyD: 32,
  7729. KeyF: 33,
  7730. KeyG: 34,
  7731. KeyH: 35,
  7732. KeyJ: 36,
  7733. KeyK: 37,
  7734. KeyL: 38,
  7735. SemiColon: 39,
  7736. Quote: 40,
  7737. IntlBackslash: 86,
  7738. IntlRo: 115,
  7739. IntlYen: 125,
  7740. KanaMode: 112,
  7741. KeyZ: 44,
  7742. KeyX: 45,
  7743. KeyC: 46,
  7744. KeyV: 47,
  7745. KeyB: 48,
  7746. KeyN: 49,
  7747. KeyM: 50,
  7748. Comma: 51,
  7749. Dot: 52,
  7750. Slash: 53,
  7751. Insert: 57426,
  7752. KpMinus: 74,
  7753. KpPlus: 78,
  7754. KpMultiply: 55,
  7755. KpDivide: 57397,
  7756. KpDecimal: 83,
  7757. KpReturn: 57372,
  7758. KpEqual: 89,
  7759. KpComma: 126,
  7760. Kp0: 82,
  7761. Kp1: 79,
  7762. Kp2: 80,
  7763. Kp3: 81,
  7764. Kp4: 75,
  7765. Kp5: 76,
  7766. Kp6: 77,
  7767. Kp7: 71,
  7768. Kp8: 72,
  7769. Kp9: 73,
  7770. MetaRight: 57436,
  7771. Apps: 57437,
  7772. VolumeUp: 57392,
  7773. VolumeDown: 57390,
  7774. VolumeMute: 57376,
  7775. Lang1: 123,
  7776. Lang2: 121,
  7777. Lang3: 120,
  7778. Lang4: 119,
  7779. Lang5: 118,
  7780. Kana: 128,
  7781. Hanja: 241
  7782. }, So = {
  7783. Alt: 64,
  7784. AltGr: 108,
  7785. Backspace: 22,
  7786. CapsLock: 66,
  7787. ControlLeft: 37,
  7788. ControlRight: 105,
  7789. Delete: 119,
  7790. DownArrow: 116,
  7791. End: 115,
  7792. Escape: 9,
  7793. F1: 67,
  7794. F10: 76,
  7795. F11: 95,
  7796. F12: 96,
  7797. F13: 191,
  7798. F14: 192,
  7799. F15: 193,
  7800. F16: 194,
  7801. F17: 195,
  7802. F18: 196,
  7803. F19: 197,
  7804. F20: 198,
  7805. F21: 199,
  7806. F22: 200,
  7807. F23: 201,
  7808. F24: 202,
  7809. F2: 68,
  7810. F3: 69,
  7811. F4: 70,
  7812. F5: 71,
  7813. F6: 72,
  7814. F7: 73,
  7815. F8: 74,
  7816. F9: 75,
  7817. Home: 110,
  7818. LeftArrow: 113,
  7819. MetaLeft: 133,
  7820. PageDown: 117,
  7821. PageUp: 112,
  7822. Return: 36,
  7823. RightArrow: 114,
  7824. ShiftLeft: 50,
  7825. ShiftRight: 62,
  7826. Space: 65,
  7827. Tab: 23,
  7828. UpArrow: 111,
  7829. PrintScreen: 107,
  7830. ScrollLock: 78,
  7831. Pause: 127,
  7832. NumLock: 77,
  7833. BackQuote: 49,
  7834. Num1: 10,
  7835. Num2: 11,
  7836. Num3: 12,
  7837. Num4: 13,
  7838. Num5: 14,
  7839. Num6: 15,
  7840. Num7: 16,
  7841. Num8: 17,
  7842. Num9: 18,
  7843. Num0: 19,
  7844. Minus: 20,
  7845. Equal: 21,
  7846. KeyQ: 24,
  7847. KeyW: 25,
  7848. KeyE: 26,
  7849. KeyR: 27,
  7850. KeyT: 28,
  7851. KeyY: 29,
  7852. KeyU: 30,
  7853. KeyI: 31,
  7854. KeyO: 32,
  7855. KeyP: 33,
  7856. LeftBracket: 34,
  7857. RightBracket: 35,
  7858. KeyA: 38,
  7859. KeyS: 39,
  7860. KeyD: 40,
  7861. KeyF: 41,
  7862. KeyG: 42,
  7863. KeyH: 43,
  7864. KeyJ: 44,
  7865. KeyK: 45,
  7866. KeyL: 46,
  7867. SemiColon: 47,
  7868. Quote: 48,
  7869. BackSlash: 51,
  7870. IntlBackslash: 94,
  7871. IntlRo: 97,
  7872. IntlYen: 132,
  7873. KanaMode: 101,
  7874. KeyZ: 52,
  7875. KeyX: 53,
  7876. KeyC: 54,
  7877. KeyV: 55,
  7878. KeyB: 56,
  7879. KeyN: 57,
  7880. KeyM: 58,
  7881. Comma: 59,
  7882. Dot: 60,
  7883. Slash: 61,
  7884. Insert: 118,
  7885. KpDecimal: 91,
  7886. KpReturn: 104,
  7887. KpMinus: 82,
  7888. KpPlus: 86,
  7889. KpMultiply: 63,
  7890. KpDivide: 106,
  7891. KpEqual: 125,
  7892. KpComma: 129,
  7893. Kp0: 90,
  7894. Kp1: 87,
  7895. Kp2: 88,
  7896. Kp3: 89,
  7897. Kp4: 83,
  7898. Kp5: 84,
  7899. Kp6: 85,
  7900. Kp7: 79,
  7901. Kp8: 80,
  7902. Kp9: 81,
  7903. MetaRight: 134,
  7904. Apps: 135,
  7905. VolumeUp: 123,
  7906. VolumeDown: 122,
  7907. VolumeMute: 121,
  7908. Lang1: 102,
  7909. Lang2: 100,
  7910. Lang3: 98,
  7911. Lang4: 99,
  7912. Lang5: 93
  7913. }, zo = {
  7914. Alt: 57,
  7915. AltGr: 58,
  7916. Backspace: 67,
  7917. CapsLock: 115,
  7918. ControlLeft: 113,
  7919. ControlRight: 114,
  7920. Delete: 112,
  7921. DownArrow: 20,
  7922. End: 123,
  7923. Escape: 111,
  7924. F1: 131,
  7925. F10: 140,
  7926. F11: 141,
  7927. F12: 142,
  7928. F2: 132,
  7929. F3: 133,
  7930. F4: 134,
  7931. F5: 135,
  7932. F6: 136,
  7933. F7: 137,
  7934. F8: 138,
  7935. F9: 139,
  7936. Home: 3,
  7937. LeftArrow: 21,
  7938. MetaLeft: 117,
  7939. PageDown: 93,
  7940. PageUp: 92,
  7941. Return: 66,
  7942. RightArrow: 22,
  7943. ShiftLeft: 59,
  7944. ShiftRight: 60,
  7945. Space: 62,
  7946. Tab: 61,
  7947. UpArrow: 19,
  7948. PrintScreen: 120,
  7949. ScrollLock: 116,
  7950. NumLock: 143,
  7951. Pause: 121,
  7952. BackQuote: 75,
  7953. Num1: 8,
  7954. Num2: 9,
  7955. Num3: 10,
  7956. Num4: 11,
  7957. Num5: 12,
  7958. Num6: 13,
  7959. Num7: 14,
  7960. Num8: 15,
  7961. Num9: 16,
  7962. Num0: 7,
  7963. Minus: 69,
  7964. Equal: 70,
  7965. KeyA: 29,
  7966. KeyB: 30,
  7967. KeyC: 31,
  7968. KeyD: 32,
  7969. KeyE: 33,
  7970. KeyF: 34,
  7971. KeyG: 35,
  7972. KeyH: 36,
  7973. KeyI: 37,
  7974. KeyJ: 38,
  7975. KeyK: 39,
  7976. KeyL: 40,
  7977. KeyM: 41,
  7978. KeyN: 42,
  7979. KeyO: 43,
  7980. KeyP: 44,
  7981. KeyQ: 45,
  7982. KeyR: 46,
  7983. KeyS: 47,
  7984. KeyT: 48,
  7985. KeyU: 49,
  7986. KeyV: 50,
  7987. KeyW: 51,
  7988. KeyX: 52,
  7989. KeyY: 53,
  7990. KeyZ: 54,
  7991. LeftBracket: 71,
  7992. RightBracket: 72,
  7993. SemiColon: 74,
  7994. Quote: 75,
  7995. BackSlash: 73,
  7996. KanaMode: 218,
  7997. Comma: 55,
  7998. Dot: 56,
  7999. Slash: 76,
  8000. Insert: 124
  8001. }, Po = {
  8002. 226: "Alt",
  8003. 230: "AltGr",
  8004. 42: "Backspace",
  8005. 57: "CapsLock",
  8006. 224: "ControlLeft",
  8007. 228: "ControlRight",
  8008. 76: "Delete",
  8009. 82: "UpArrow",
  8010. 81: "DownArrow",
  8011. 80: "LeftArrow",
  8012. 79: "RightArrow",
  8013. 77: "End",
  8014. 41: "Escape",
  8015. 58: "F1",
  8016. 59: "F2",
  8017. 60: "F3",
  8018. 61: "F4",
  8019. 62: "F5",
  8020. 63: "F6",
  8021. 64: "F7",
  8022. 65: "F8",
  8023. 66: "F9",
  8024. 67: "F10",
  8025. 68: "F11",
  8026. 69: "F12",
  8027. 104: "F13",
  8028. 105: "F14",
  8029. 106: "F15",
  8030. 107: "F16",
  8031. 108: "F17",
  8032. 109: "F18",
  8033. 110: "F19",
  8034. 111: "F20",
  8035. 112: "F21",
  8036. 113: "F22",
  8037. 114: "F23",
  8038. 115: "F24",
  8039. 74: "Home",
  8040. 227: "MetaLeft",
  8041. 78: "PageDown",
  8042. 75: "PageUp",
  8043. 40: "Return",
  8044. 225: "ShiftLeft",
  8045. 229: "ShiftRight",
  8046. 44: "Space",
  8047. 43: "Tab",
  8048. 70: "PrintScreen",
  8049. 71: "ScrollLock",
  8050. 83: "NumLock",
  8051. 53: "BackQuote",
  8052. 30: "Num1",
  8053. 31: "Num2",
  8054. 32: "Num3",
  8055. 33: "Num4",
  8056. 34: "Num5",
  8057. 35: "Num6",
  8058. 36: "Num7",
  8059. 37: "Num8",
  8060. 38: "Num9",
  8061. 39: "Num0",
  8062. 45: "Minus",
  8063. 46: "Equal",
  8064. 20: "KeyQ",
  8065. 26: "KeyW",
  8066. 8: "KeyE",
  8067. 21: "KeyR",
  8068. 23: "KeyT",
  8069. 28: "KeyY",
  8070. 24: "KeyU",
  8071. 12: "KeyI",
  8072. 18: "KeyO",
  8073. 19: "KeyP",
  8074. 47: "LeftBracket",
  8075. 48: "RightBracket",
  8076. 49: "BackSlash",
  8077. 4: "KeyA",
  8078. 22: "KeyS",
  8079. 7: "KeyD",
  8080. 9: "KeyF",
  8081. 10: "KeyG",
  8082. 11: "KeyH",
  8083. 13: "KeyJ",
  8084. 14: "KeyK",
  8085. 15: "KeyL",
  8086. 51: "SemiColon",
  8087. 52: "Quote",
  8088. 100: "IntlBackslash",
  8089. 135: "IntlRo",
  8090. 137: "IntlYen",
  8091. 29: "KeyZ",
  8092. 27: "KeyX",
  8093. 6: "KeyC",
  8094. 25: "KeyV",
  8095. 5: "KeyB",
  8096. 17: "KeyN",
  8097. 16: "KeyM",
  8098. 54: "Comma",
  8099. 55: "Dot",
  8100. 56: "Slash",
  8101. 73: "Insert",
  8102. 86: "KpMinus",
  8103. 87: "KpPlus",
  8104. 85: "KpMultiply",
  8105. 84: "KpDivide",
  8106. 99: "KpDecimal",
  8107. 88: "KpReturn",
  8108. 103: "KpEqual",
  8109. 133: "KpComma",
  8110. 98: "Kp0",
  8111. 89: "Kp1",
  8112. 90: "Kp2",
  8113. 91: "Kp3",
  8114. 92: "Kp4",
  8115. 93: "Kp5",
  8116. 94: "Kp6",
  8117. 95: "Kp7",
  8118. 96: "Kp8",
  8119. 97: "Kp9",
  8120. 231: "MetaRight",
  8121. 128: "VolumeUp",
  8122. 129: "VolumeDown",
  8123. 127: "VolumeMute",
  8124. 139: "Lang1",
  8125. 138: "Lang2",
  8126. 146: "Lang3",
  8127. 147: "Lang4",
  8128. 148: "Lang5",
  8129. 155: "Cancel",
  8130. 156: "Clear",
  8131. 136: "Kana",
  8132. 145: "Hanja",
  8133. 119: "Select",
  8134. 116: "Execute",
  8135. 117: "Help",
  8136. 159: "Separator"
  8137. }, Ro = {
  8138. KeyA: 0,
  8139. KeyS: 1,
  8140. KeyD: 2,
  8141. KeyF: 3,
  8142. KeyH: 4,
  8143. KeyG: 5,
  8144. KeyZ: 6,
  8145. KeyX: 7,
  8146. KeyC: 8,
  8147. KeyV: 9,
  8148. IntlBackslash: 10,
  8149. KeyB: 11,
  8150. KeyQ: 12,
  8151. KeyW: 13,
  8152. KeyE: 14,
  8153. KeyR: 15,
  8154. KeyY: 16,
  8155. KeyT: 17,
  8156. Num1: 18,
  8157. Num2: 19,
  8158. Num3: 20,
  8159. Num4: 21,
  8160. Num6: 22,
  8161. Num5: 23,
  8162. Equal: 24,
  8163. Num9: 25,
  8164. Num7: 26,
  8165. Minus: 27,
  8166. Num8: 28,
  8167. Num0: 29,
  8168. RightBracket: 30,
  8169. KeyO: 31,
  8170. KeyU: 32,
  8171. LeftBracket: 33,
  8172. KeyI: 34,
  8173. KeyP: 35,
  8174. Return: 36,
  8175. KeyL: 37,
  8176. KeyJ: 38,
  8177. Quote: 39,
  8178. KeyK: 40,
  8179. SemiColon: 41,
  8180. BackSlash: 42,
  8181. Comma: 43,
  8182. Slash: 44,
  8183. KeyN: 45,
  8184. KeyM: 46,
  8185. Dot: 47,
  8186. Tab: 48,
  8187. Space: 49,
  8188. BackQuote: 50,
  8189. Backspace: 51,
  8190. Escape: 53,
  8191. MetaRight: 54,
  8192. MetaLeft: 55,
  8193. ShiftLeft: 56,
  8194. CapsLock: 57,
  8195. Alt: 58,
  8196. ControlLeft: 59,
  8197. ShiftRight: 60,
  8198. AltGr: 61,
  8199. ControlRight: 62,
  8200. Function: 63,
  8201. F17: 64,
  8202. KpDecimal: 65,
  8203. KpMultiply: 67,
  8204. KpPlus: 69,
  8205. NumLock: 71,
  8206. VolumeUp: 72,
  8207. VolumeDown: 73,
  8208. VolumeMute: 74,
  8209. KpDivide: 75,
  8210. KpReturn: 76,
  8211. KpMinus: 78,
  8212. F18: 79,
  8213. F19: 80,
  8214. KpEqual: 81,
  8215. Kp0: 82,
  8216. Kp1: 83,
  8217. Kp2: 84,
  8218. Kp3: 85,
  8219. Kp4: 86,
  8220. Kp5: 87,
  8221. Kp6: 88,
  8222. Kp7: 89,
  8223. F20: 90,
  8224. Kp8: 91,
  8225. Kp9: 92,
  8226. IntlYen: 93,
  8227. IntlRo: 94,
  8228. KpComma: 95,
  8229. F5: 96,
  8230. F6: 97,
  8231. F7: 98,
  8232. F3: 99,
  8233. F8: 100,
  8234. F9: 101,
  8235. Lang2: 102,
  8236. F11: 103,
  8237. Lang1: 104,
  8238. F13: 105,
  8239. F16: 106,
  8240. F14: 107,
  8241. F10: 109,
  8242. F12: 111,
  8243. F15: 113,
  8244. Insert: 114,
  8245. Home: 115,
  8246. PageUp: 116,
  8247. Delete: 117,
  8248. F4: 118,
  8249. End: 119,
  8250. F2: 120,
  8251. PageDown: 121,
  8252. F1: 122,
  8253. LeftArrow: 123,
  8254. RightArrow: 124,
  8255. DownArrow: 125,
  8256. UpArrow: 126,
  8257. Apps: 110
  8258. }, Io = {
  8259. AltLeft: "Alt",
  8260. AltRight: "AltGr",
  8261. Backspace: "Backspace",
  8262. CapsLock: "CapsLock",
  8263. ControlLeft: "ControlLeft",
  8264. ControlRight: "ControlRight",
  8265. Delete: "Delete",
  8266. ArrowUp: "UpArrow",
  8267. ArrowDown: "DownArrow",
  8268. ArrowLeft: "LeftArrow",
  8269. ArrowRight: "RightArrow",
  8270. End: "End",
  8271. Escape: "Escape",
  8272. F1: "F1",
  8273. F2: "F2",
  8274. F3: "F3",
  8275. F4: "F4",
  8276. F5: "F5",
  8277. F6: "F6",
  8278. F7: "F7",
  8279. F8: "F8",
  8280. F9: "F9",
  8281. F10: "F10",
  8282. F11: "F11",
  8283. F12: "F12",
  8284. F13: "F13",
  8285. F14: "F14",
  8286. F15: "F15",
  8287. F16: "F16",
  8288. F17: "F17",
  8289. F18: "F18",
  8290. F19: "F19",
  8291. F20: "F20",
  8292. F21: "F21",
  8293. F22: "F22",
  8294. F23: "F23",
  8295. F24: "F24",
  8296. Home: "Home",
  8297. MetaLeft: "MetaLeft",
  8298. PageDown: "PageDown",
  8299. PageUp: "PageUp",
  8300. Enter: "Return",
  8301. ShiftLeft: "ShiftLeft",
  8302. ShiftRight: "ShiftRight",
  8303. Space: "Space",
  8304. Tab: "Tab",
  8305. PrintScreen: "PrintScreen",
  8306. ScrollLock: "ScrollLock",
  8307. NumLock: "NumLock",
  8308. Backquote: "BackQuote",
  8309. Digit1: "Num1",
  8310. Digit2: "Num2",
  8311. Digit3: "Num3",
  8312. Digit4: "Num4",
  8313. Digit5: "Num5",
  8314. Digit6: "Num6",
  8315. Digit7: "Num7",
  8316. Digit8: "Num8",
  8317. Digit9: "Num9",
  8318. Digit0: "Num0",
  8319. Minus: "Minus",
  8320. Equal: "Equal",
  8321. KeyQ: "KeyQ",
  8322. KeyW: "KeyW",
  8323. KeyE: "KeyE",
  8324. KeyR: "KeyR",
  8325. KeyT: "KeyT",
  8326. KeyY: "KeyY",
  8327. KeyU: "KeyU",
  8328. KeyI: "KeyI",
  8329. KeyO: "KeyO",
  8330. KeyP: "KeyP",
  8331. BracketLeft: "LeftBracket",
  8332. BracketRight: "RightBracket",
  8333. Backslash: "BackSlash",
  8334. KeyA: "KeyA",
  8335. KeyS: "KeyS",
  8336. KeyD: "KeyD",
  8337. KeyF: "KeyF",
  8338. KeyG: "KeyG",
  8339. KeyH: "KeyH",
  8340. KeyJ: "KeyJ",
  8341. KeyK: "KeyK",
  8342. KeyL: "KeyL",
  8343. Semicolon: "SemiColon",
  8344. Quote: "Quote",
  8345. IntlBackslash: "IntlBackslash",
  8346. IntlRo: "IntlRo",
  8347. IntlYen: "IntlYen",
  8348. KanaMode: "KanaMode",
  8349. KeyZ: "KeyZ",
  8350. KeyX: "KeyX",
  8351. KeyC: "KeyC",
  8352. KeyV: "KeyV",
  8353. KeyB: "KeyB",
  8354. KeyN: "KeyN",
  8355. KeyM: "KeyM",
  8356. Comma: "Comma",
  8357. Period: "Dot",
  8358. Slash: "Slash",
  8359. Insert: "Insert",
  8360. NumpadSubtract: "KpMinus",
  8361. NumpadAdd: "KpPlus",
  8362. NumpadMultiply: "KpMultiply",
  8363. NumpadDivide: "KpDivide",
  8364. NumpadDecimal: "KpDecimal",
  8365. NumpadEnter: "KpReturn",
  8366. NumpadEqual: "KpEqual",
  8367. NumpadComma: "KpComma",
  8368. Numpad0: "Kp0",
  8369. Numpad1: "Kp1",
  8370. Numpad2: "Kp2",
  8371. Numpad3: "Kp3",
  8372. Numpad4: "Kp4",
  8373. Numpad5: "Kp5",
  8374. Numpad6: "Kp6",
  8375. Numpad7: "Kp7",
  8376. Numpad8: "Kp8",
  8377. Numpad9: "Kp9",
  8378. MetaRight: "MetaRight",
  8379. ContextMenu: "Apps",
  8380. AudioVolumeUp: "VolumeUp",
  8381. AudioVolumeDown: "VolumeDown",
  8382. AudioVolumeMute: "VolumeMute",
  8383. NonConvert: "Lang1",
  8384. Convert: "Lang2",
  8385. Lang3: "Lang3",
  8386. Lang4: "Lang4",
  8387. Lang5: "Lang5"
  8388. }, To = new Set(["ShiftLeft", "ShiftRight", "ControlLeft", "ControlRight", "MetaLeft", "MetaRight", "Alt", "AltGr"]),
  8389. jo = new Set(["BackQuote", "Num1", "Num2", "Num3", "Num4", "Num5", "Num6", "Num7", "Num8", "Num9", "Num0", "Minus", "Equal", "KeyA", "KeyB", "KeyC", "KeyD", "KeyE", "KeyF", "KeyG", "KeyH", "KeyI", "KeyJ", "KeyK", "KeyL", "KeyM", "KeyN", "KeyO", "KeyP", "KeyQ", "KeyR", "KeyS", "KeyT", "KeyU", "KeyV", "KeyW", "KeyX", "KeyY", "KeyZ", "LeftBracket", "RightBracket", "BackSlash", "SemiColon", "Quote", "Comma", "Dot", "Slash", "IntlBackslash", "Space"]),
  8390. No = new Set(["Kp0", "Kp1", "Kp2", "Kp3", "Kp4", "Kp5", "Kp6", "Kp7", "Kp8", "Kp9", "KpMinus", "KpMultiply", "KpDivide", "KpPlus", "KpDecimal"]);
  8391. let p4 = !1, ru = !1;
  8392. const b = {};
  8393. b[Ka] = !1;
  8394. b[Ha] = !1;
  8395. b[B4] = !1;
  8396. b[dt] = !1;
  8397. b[ce] = !1;
  8398. b[ct] = !1;
  8399. b[Ct] = !1;
  8400. b[pt] = !1;
  8401. const m4 = {}, Ae = u => No.has(u), me = u => jo.has(u), Oo = u => To.has(u),
  8402. Mo = () => b[B4] || b[dt] || b[ce] || b[ct] || b[Ct] || b[pt];
  8403. let _, j4 = !1;
  8404. function Lo() {
  8405. if (j4) {
  8406. console.info("Keyboard event listener is already started");
  8407. return
  8408. }
  8409. document.addEventListener("keydown", N4), document.addEventListener("keyup", N4), _ || (_ = document.createElement("div"), _.setAttribute("contenteditable", "true"), _.id = "hiddenInput", _.style.position = "absolute", _.style.left = "-9999px", _.style.height = "1px", _.style.width = "1px", document.body.appendChild(_), Xu ? _.addEventListener("input", O4) : (V4 || Zu) && _.addEventListener("compositionend", O4), _.focus()), j4 = !0, console.info("Keyboard event listener started")
  8410. }
  8411. function se() {
  8412. if (!j4) {
  8413. console.info("Keyboard event listener is not started");
  8414. return
  8415. }
  8416. document.removeEventListener("keydown", N4), document.removeEventListener("keyup", N4), _ && (Xu || V4 ? _.removeEventListener("input", O4) : Zu && _.removeEventListener("compositionend", O4), _.remove(), _ = void 0), j4 = !1, console.info("Keyboard event listener stopped")
  8417. }
  8418. function Fe(u, e) {
  8419. u.sendMessage({key_event: e})
  8420. }
  8421. function N4(u) {
  8422. const e = u0();
  8423. if (!e) return;
  8424. const i = u.type === "keydown";
  8425. i && !ru && u.preventDefault(), yt(e, u, i)
  8426. }
  8427. function O4(u) {
  8428. var a, t;
  8429. const e = u0();
  8430. if (!e) return;
  8431. u.preventDefault();
  8432. let i = null;
  8433. if ((u instanceof InputEvent || u instanceof CompositionEvent) && (i = u.data), !i) return;
  8434. const o = w.fromPartial({seq: i, mode: c4.Translate, down: !0, press: !0});
  8435. Fe(e, o), ((t = (a = _ == null ? void 0 : _.textContent) == null ? void 0 : a.length) != null ? t : 0) > 10 && (_.textContent = "")
  8436. }
  8437. function yt(u, e, i) {
  8438. const o = Vo(u, e, i);
  8439. for (const a of o) Fe(u, a)
  8440. }
  8441. function Uo(u, e, i, o) {
  8442. const a = Po[e];
  8443. if (!a) {
  8444. console.error("Unknown USB HID code " + e);
  8445. return
  8446. }
  8447. const t = M4(u, a, i);
  8448. if (!t) return;
  8449. const s = Ae(a), l = me(a);
  8450. (l || s) && bt(t, o, s, l);
  8451. for (const E of t) Fe(u, E)
  8452. }
  8453. function Wo() {
  8454. const u = u0();
  8455. if (!!u) for (const e in m4) {
  8456. const i = m4[e];
  8457. i && yt(u, i, !1)
  8458. }
  8459. }
  8460. function Vo(u, e, i) {
  8461. var c;
  8462. const o = e.code, a = Io[o];
  8463. if (!a) return console.error("Key code is not supported " + o), [];
  8464. const t = u.getOption("keyboard_mode"), s = qo(e);
  8465. Jo(e, i), i ? m4[o] = e : delete m4[o];
  8466. let l = [];
  8467. switch (t) {
  8468. case qa:
  8469. l = (c = M4(u, a, i)) != null ? c : [];
  8470. break;
  8471. case Ui:
  8472. l = Go(u, e, a, i);
  8473. break
  8474. }
  8475. if (!l) return [];
  8476. const E = Ae(a);
  8477. if (t !== Ui || E) {
  8478. const C = me(a);
  8479. bt(l, s, E, C)
  8480. }
  8481. return l
  8482. }
  8483. function bt(u, e, i, o) {
  8484. for (const s of u) o && (e & 1 << 1) != 0 && s.modifiers.push(N.CapsLock), i && (e & 1 << 2) != 0 && s.modifiers.push(N.NumLock)
  8485. }
  8486. function qo(u) {
  8487. let a = 0;
  8488. return u.getModifierState("CapsLock") && (a |= 1 << 1), u.getModifierState("NumLock") && (a |= 1 << 2), u.getModifierState("ScrollLock") && (a |= 1 << 3), a
  8489. }
  8490. function Ko(u, e) {
  8491. return u == Z4 ? Be[e] : u == Q4 ? So[e] : u == Dt ? zo[e] : u == Ce ? (A.getItem("option:local:kb_layout") == Za && (e == "IntlBackslash" ? e = "BackQuote" : e == "BackQuote" && (e = "IntlBackslash")), Ro[e]) : null
  8492. }
  8493. function Ho(u) {
  8494. let e = {...u};
  8495. return e.down = !1, [u, e]
  8496. }
  8497. function Jo(u, e) {
  8498. const i = u.code;
  8499. i in b && (b[i] = e)
  8500. }
  8501. function M4(u, e, i) {
  8502. const o = u.getPeerPlatform(), a = u.isSwapControlCommand();
  8503. e == "ControlLeft" || e == "ControlRight" ? a && (e = "MetaLeft") : (e == "MetaLeft" || e == "MetaRight") && a && (e = "ControlLeft");
  8504. const t = Ko(o, e);
  8505. if (t == null) return console.error("Unknown key code " + e + " for platform " + o), [];
  8506. const s = w.fromPartial({chr: t, mode: c4.Map, down: i, press: i});
  8507. return o === Q4 && i && !Oo(e) ? Ho(s) : [s]
  8508. }
  8509. function Go(u, e, i, o) {
  8510. const a = _ === document.activeElement;
  8511. if (_ && _.focus(), V4 && _ && a && e.key === "Process") return [];
  8512. const t = me(i), s = e.key === "Dead";
  8513. if (o && ru && t) return Zu ? ru = s : ru = !1, [];
  8514. if (s) return o && (Zu ? ru = !0 : ru = !ru), ru && _ && !a && Xu && _.dispatchEvent(new KeyboardEvent(e.type, {...e})), [];
  8515. if (ru = !1, !Zu && Ae(i)) return M4(u, i, o);
  8516. if (Zu && e.code === "AltRight") return [];
  8517. if (e.key === "AltGraph") return p4 && !o && (p4 = !1), !p4 && o && b[B4] ? (p4 = !0, b[B4] = !1, delete m4[B4], [w.fromPartial({
  8518. chr: Be.ControlLeft,
  8519. mode: c4.Map,
  8520. down: !1,
  8521. press: !1
  8522. })]) : [];
  8523. const E = u.getPeerPlatform();
  8524. let c = [];
  8525. return Xu && (c = Zo(E, e, o)), (Xu || V4) && c.length === 0 && o && t && (c = Ki(e, o)), Xu && p4 || (Zu && o && t && !b[ce] && c.push(...Ki(e, o)), c.length === 0 && c.push(...M4(u, i, o))), c
  8526. }
  8527. function Zo(u, e, i) {
  8528. if (u !== Z4 || !Mo()) return [];
  8529. let o;
  8530. const a = Be[e.code];
  8531. return a === void 0 ? (console.error("Key code cannot be converted to scan code: " + e.code), []) : (i ? e.key.length === 1 && (o = e.key.charCodeAt(0) & 65535 | a << 16) : o = a << 16, o === void 0 ? [] : [w.fromPartial({
  8532. win2win_hotkey: o,
  8533. mode: c4.Translate,
  8534. down: i,
  8535. press: i
  8536. })])
  8537. }
  8538. function Ki(u, e) {
  8539. return u.key ? [w.fromPartial({seq: u.key, mode: c4.Translate, down: e, press: e})] : []
  8540. }
  8541. class Qo {
  8542. constructor(e, i, o, a) {
  8543. d(this, "_uri");
  8544. d(this, "_feedback");
  8545. d(this, "_key");
  8546. d(this, "_token");
  8547. d(this, "_ws");
  8548. d(this, "_interval");
  8549. d(this, "_keepAlive");
  8550. d(this, "_lastRecvMsg");
  8551. d(this, "_aliveFailed");
  8552. this._uri = e, this._feedback = i, this._key = o, this._token = a, this._keepAlive = io, this._lastRecvMsg = new Date, this._aliveFailed = !1
  8553. }
  8554. close() {
  8555. var e;
  8556. this._interval && (clearInterval(this._interval), this._interval = void 0), (e = this._ws) == null || e.close(), this._ws = void 0
  8557. }
  8558. async start() {
  8559. if (this._feedback == 0 || !this._uri || !this._token || !this._key) return;
  8560. const e = new I4(this._uri, !0, "health check");
  8561. await e.open(), console.log(new Date + ": Connected to relay server"), this._ws = e;
  8562. const i = Ju.fromPartial({token: this._token});
  8563. e.sendRendezvous({hc: i}), this.startInterval(), await this.msgLoop(), this.close()
  8564. }
  8565. startInterval() {
  8566. this._interval = setInterval(() => {
  8567. new Date().getTime() - this._lastRecvMsg.getTime() > this._keepAlive * 3 / 2 && (this._aliveFailed = !0)
  8568. }, eo)
  8569. }
  8570. async msgLoop() {
  8571. var e;
  8572. for (this._lastRecvMsg = new Date; ;) {
  8573. if (!this._ws) {
  8574. console.info("HC connection is closed as controlling connection exits");
  8575. break
  8576. }
  8577. try {
  8578. const i = await ((e = this._ws) == null ? void 0 : e.next(300));
  8579. i && (this._lastRecvMsg = new Date, this.handleMsg(i))
  8580. } catch (i) {
  8581. if (i === "Timeout") {
  8582. if (this._aliveFailed) {
  8583. console.error("HC connection is timeout");
  8584. break
  8585. }
  8586. } else {
  8587. console.error("An error occurred on health check:", i);
  8588. break
  8589. }
  8590. }
  8591. }
  8592. }
  8593. handleMsg(e) {
  8594. var i;
  8595. if (e instanceof Uint8Array) {
  8596. (i = this._ws) == null || i.sendBytes(new Uint8Array);
  8597. return
  8598. } else {
  8599. const o = e.register_pk_response;
  8600. o && o.keep_alive > 0 && (this._keepAlive = o.keep_alive * 1e3, console.log("keep_alive: " + this._keepAlive + "ms"))
  8601. }
  8602. }
  8603. }
  8604. let L4 = [], F4 = "", U4 = [], _4 = [], W4;
  8605. const _e = ["text/plain", "text/html", "image/svg+xml", "image/png"];
  8606. function ve() {
  8607. U4 = [], _4 = [], W4 = void 0
  8608. }
  8609. async function Hi(u, e = !1) {
  8610. var i = [], o = "";
  8611. try {
  8612. i = await navigator.clipboard.read(), i.length === 0 && (o = await navigator.clipboard.readText())
  8613. } catch {
  8614. return
  8615. }
  8616. e || i.length === 0 && o === "" || (await Xo(i) ? (L4 = i, await $o(u)) : o !== F4 && (F4 = o, await un(u)))
  8617. }
  8618. async function Xo(u) {
  8619. if (u.length !== L4.length) return !0;
  8620. for (let e = 0; e < u.length; e++) {
  8621. const i = u[e], o = L4[e];
  8622. if (!await Yo(i, o)) return !0
  8623. }
  8624. return !1
  8625. }
  8626. async function Yo(u, e) {
  8627. if (u.types.length !== e.types.length) return !1;
  8628. for (let i = 0; i < u.types.length; i++) {
  8629. if (u.types[i] !== e.types[i]) return !1;
  8630. if (!_e.includes(u.types[i])) continue;
  8631. const o = await u.getType(u.types[i]), a = await e.getType(e.types[i]);
  8632. if (o.size !== a.size) return !1;
  8633. const t = new Uint8Array(await o.arrayBuffer()), s = new Uint8Array(await a.arrayBuffer());
  8634. for (let l = 0; l < t.length; l++) if (t[l] !== s[l]) return !1
  8635. }
  8636. return !0
  8637. }
  8638. function wt(u) {
  8639. switch (u) {
  8640. case"text/plain":
  8641. return du.Text;
  8642. case"text/html":
  8643. return du.Html;
  8644. case"image/svg+xml":
  8645. return du.ImageSvg;
  8646. case"image/png":
  8647. return du.ImagePng;
  8648. default:
  8649. return du.UNRECOGNIZED
  8650. }
  8651. }
  8652. async function $o(u) {
  8653. const e = [], i = (await Promise.all(L4.map(async o => {
  8654. const a = [];
  8655. for (const t of o.types) {
  8656. if (!_e.includes(t)) continue;
  8657. const s = await o.getType(t);
  8658. e.push(t), a.push(new Uint8Array(await s.arrayBuffer()))
  8659. }
  8660. return a
  8661. }))).flat();
  8662. e.length !== 0 && Kt(i, !0, o => {
  8663. const a = o.map((t, s) => {
  8664. let l = !1;
  8665. t && (l = t.length < F4.length);
  8666. const E = l && t != null ? t : i[s];
  8667. return U.fromPartial({content: E, compress: l, format: wt(e[s])})
  8668. });
  8669. u.sendMessage(eu.fromPartial({multi_clipboards: gu.fromPartial({clipboards: a})}))
  8670. })
  8671. }
  8672. async function un(u) {
  8673. const e = new TextEncoder().encode(F4);
  8674. Kt(e, !1, i => {
  8675. let o = !1;
  8676. i && (o = i.length < F4.length);
  8677. const a = o && i != null ? i : e;
  8678. let t = U.fromPartial({content: a, compress: o, format: du.Text});
  8679. u.sendMessage(eu.fromPartial({clipboard: t}))
  8680. })
  8681. }
  8682. function ke(u, e = void 0) {
  8683. const i = () => {
  8684. try {
  8685. Nn(new TextDecoder().decode(u.content)), ve(), e == null || e()
  8686. } catch (o) {
  8687. console.error("Failed to copy to clipboard, ", o), document.hasFocus() || (W4 = u)
  8688. }
  8689. };
  8690. u.compress ? we(u.content, !1, o => {
  8691. o && (u.content = o, i())
  8692. }) : i()
  8693. }
  8694. const w4 = document.createElement("canvas"), ee = w4.getContext("2d");
  8695. function en(u, e, i) {
  8696. if (w4.width = e, w4.height = i, !ee) return new Uint8Array(0);
  8697. const o = ee.createImageData(e, i);
  8698. return o.data.set(u), ee.putImageData(o, 0, 0), Uint8Array.from(atob(w4.toDataURL("image/png").split(",")[1]), a => a.charCodeAt(0))
  8699. }
  8700. function tn(u, e = void 0) {
  8701. ve();
  8702. const i = u.clipboards, o = i.filter(a => a.compress).map(a => a.content);
  8703. we(o, !0, async a => {
  8704. var c;
  8705. let t = 0;
  8706. for (const C of i) C.compress && (C.content = (c = a[t]) != null ? c : C.content, t++), C.compress = !1;
  8707. const s = {};
  8708. for (const C of i) {
  8709. const D = _e.find(B => C.format === wt(B));
  8710. if (D) {
  8711. const B = new Blob([C.content], {type: D});
  8712. s[D] = B
  8713. }
  8714. }
  8715. if (!(s["image/png"] !== void 0)) {
  8716. for (const C of i) if (C.format === du.ImageRgba) {
  8717. const D = en(C.content, C.width, C.height);
  8718. D.length > 0 && (s["image/png"] = new Blob([D], {type: "image/png"}));
  8719. break
  8720. }
  8721. }
  8722. if (Object.keys(s).length === 0) return;
  8723. const E = new ClipboardItem(s);
  8724. await St(i, E, e)
  8725. })
  8726. }
  8727. async function St(u, e, i = void 0) {
  8728. if (!document.hasFocus()) {
  8729. U4 = u, _4 = [e];
  8730. return
  8731. }
  8732. try {
  8733. await navigator.clipboard.write([e]), ve(), i == null || i()
  8734. } catch (o) {
  8735. if (console.error("Failed to write to clipboard, ", o), !document.hasFocus()) {
  8736. U4 = u, _4 = [e];
  8737. return
  8738. }
  8739. const a = u.find(t => t.format === du.Text);
  8740. a && ke(a, i)
  8741. }
  8742. }
  8743. function Ji() {
  8744. xn("info", "Clipboard is synchronized", 2e3)
  8745. }
  8746. window.addEventListener("focus", function () {
  8747. _4.length > 0 ? St(U4, _4[0], Ji) : W4 && ke(W4, Ji)
  8748. });
  8749. const su = class {
  8750. constructor({
  8751. id: e,
  8752. remote: i,
  8753. path: o,
  8754. show_hidden: a,
  8755. is_remote: t,
  8756. is_last_job: s,
  8757. file_num: l,
  8758. files: E,
  8759. conn_id: c,
  8760. total_size: C,
  8761. finished_size: D,
  8762. transferred: B,
  8763. enable_overwrite_detection: m,
  8764. file_confirmed: f,
  8765. file_skipped: R,
  8766. file_is_waiting: I,
  8767. is_dir: y
  8768. }) {
  8769. d(this, "id");
  8770. d(this, "remote");
  8771. d(this, "path");
  8772. d(this, "show_hidden");
  8773. d(this, "is_remote");
  8774. d(this, "is_last_job");
  8775. d(this, "file_num");
  8776. d(this, "files");
  8777. d(this, "conn_id");
  8778. d(this, "total_size");
  8779. d(this, "finished_size");
  8780. d(this, "transferred");
  8781. d(this, "lastTransferred");
  8782. d(this, "enable_overwrite_detection");
  8783. d(this, "file_confirmed");
  8784. d(this, "file_skipped");
  8785. d(this, "file_is_waiting");
  8786. d(this, "default_overwrite_strategy");
  8787. d(this, "is_dir");
  8788. d(this, "stream");
  8789. d(this, "writer");
  8790. d(this, "zip");
  8791. d(this, "currentData");
  8792. d(this, "fileHandles");
  8793. d(this, "currentReader");
  8794. d(this, "write", async (e, i) => {
  8795. var t;
  8796. if (e.id !== this.id) throw new Error("Wrong id");
  8797. const o = e.file_num;
  8798. if (o >= this.files.length) throw new Error("Wrong file number");
  8799. const a = this.is_dir;
  8800. if (o !== this.file_num || a && !this.zip || !a && !this.writer) if (a) {
  8801. if (this.zip || (this.zip = new Yt), this.currentData) {
  8802. const s = this.files[this.file_num];
  8803. this.zip.file(s.name, this.currentData), this.currentData = void 0
  8804. }
  8805. this.file_num = e.file_num
  8806. } else {
  8807. this.writer && await this.writer.close(), this.stream && (this.stream = void 0), this.file_num = e.file_num;
  8808. const s = this.files[o], l = su.join(this.path, s.name);
  8809. this.stream = streamSaver.createWriteStream(l, {size: s.size}), this.writer = (t = this.stream) == null ? void 0 : t.getWriter()
  8810. }
  8811. if (e.compressed) {
  8812. const s = await Jt(e.data);
  8813. if (!s) throw new Error("Failed to decompress");
  8814. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...s]) : this.currentData = s; else {
  8815. if (!this.writer) throw new Error("file is None");
  8816. try {
  8817. await this.writer.write(s)
  8818. } catch (l) {
  8819. throw le(this.id, "write failed", this.file_num), i(), l
  8820. }
  8821. }
  8822. this.finished_size += s.length
  8823. } else {
  8824. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...e.data]) : this.currentData = e.data; else {
  8825. if (!this.writer) throw new Error("file is None");
  8826. try {
  8827. await this.writer.write(e.data)
  8828. } catch (s) {
  8829. throw le(this.id, "write failed", this.file_num), i(), s
  8830. }
  8831. }
  8832. this.finished_size += e.data.length
  8833. }
  8834. this.transferred += e.data.length
  8835. });
  8836. d(this, "read", async e => {
  8837. var c;
  8838. let i = this.file_num;
  8839. if (i >= this.files.length) {
  8840. (c = this.currentReader) == null || c.cancel(), this.currentReader = void 0;
  8841. return
  8842. }
  8843. let o = this.files[i];
  8844. if (!this.currentReader) {
  8845. if (!this.fileHandles || !this.fileHandles[i]) throw new Error("file is None");
  8846. let D = (await this.fileHandles[i].getFile()).stream();
  8847. this.currentReader = D.getReader({mode: "byob"}), this.file_confirmed = !1, this.file_is_waiting = !1
  8848. }
  8849. if (this.enable_overwrite_detection && !this.file_confirmed) {
  8850. this.file_is_waiting || (this.send_current_digest(e), this.file_is_waiting = !0);
  8851. return
  8852. }
  8853. const a = 128 * 1024;
  8854. let t = new ArrayBuffer(a), s = !1, l = 0;
  8855. for (; l < t.byteLength;) {
  8856. const {value: C, done: D} = await this.currentReader.read(new Uint8Array(t, l, t.byteLength - l));
  8857. if (!C) {
  8858. this.file_num += 1, this.file_confirmed = !1, this.file_is_waiting = !1, this.currentReader = void 0, t = new ArrayBuffer(0);
  8859. break
  8860. }
  8861. if (l += C.byteLength, t = C.buffer, D) break
  8862. }
  8863. let E = new Uint8Array(t, 0, l);
  8864. if (l === 0) this.file_num += 1, this.currentReader = void 0, this.file_confirmed = !1, this.file_is_waiting = !1; else {
  8865. if (this.finished_size += l, !Fn(su.join(this.path, o.name))) {
  8866. const C = await Ht(new Uint8Array(t, 0, l));
  8867. if (C) C.length < l && (E = new Uint8Array(C), s = !0); else throw new Error("Failed to compress")
  8868. }
  8869. this.transferred += l
  8870. }
  8871. return wu.fromPartial({id: this.id, file_num: i, data: E, compressed: s})
  8872. });
  8873. d(this, "send_current_digest", async e => {
  8874. if (!this.fileHandles || !this.fileHandles[this.file_num]) throw new Error("file is None");
  8875. let i = await this.fileHandles[this.file_num].getFile();
  8876. if (!i) throw new Error("file is None");
  8877. let o = Math.floor(i.lastModified / 1e3), a = i.size,
  8878. t = bu.fromPartial({id: this.id, file_num: this.file_num, last_modified: o, file_size: a}),
  8879. s = ou.fromPartial({digest: t}), l = eu.fromPartial({file_response: s});
  8880. e(l)
  8881. });
  8882. d(this, "read_digest", e => {
  8883. let i = this.files[e.file_num], o = su.join(this.path, i.name), a = this.default_overwrite_strategy;
  8884. if (a !== void 0) {
  8885. let t = cu.fromPartial({
  8886. id: e.id,
  8887. file_num: e.file_num,
  8888. offset_blk: a ? 0 : void 0,
  8889. skip: a ? void 0 : !0
  8890. });
  8891. return this.confirm(t), su.new_send_confirm(t)
  8892. } else {
  8893. _n(e.id, e.file_num, o, !0, e.is_identical);
  8894. return
  8895. }
  8896. });
  8897. d(this, "write_digest", e => {
  8898. let i = cu.fromPartial({id: e.id, file_num: e.file_num, offset_blk: 0});
  8899. return this.confirm(i), su.new_send_confirm(i)
  8900. });
  8901. d(this, "write_done", e => {
  8902. if (this.writer && this.writer.close(), this.zip) {
  8903. if (this.currentData) {
  8904. const i = this.files[this.file_num];
  8905. this.zip.file(i.name, this.currentData), this.currentData = void 0
  8906. }
  8907. this.zip.generateAsync({type: "blob"}).then(i => {
  8908. $t.exports.saveAs(i, `${this.path}.zip`)
  8909. })
  8910. }
  8911. });
  8912. d(this, "confirm", e => (this.file_num !== e.file_num ? console.log("file num truncated, ignoring") : e.skip !== void 0 ? e.skip ? this.set_file_skipped() : this.set_file_confirmed(!0) : e.offset_blk !== void 0 && this.set_file_confirmed(!0), !0));
  8913. d(this, "set_file_skipped", () => {
  8914. var e;
  8915. (e = this.writer) == null || e.abort(), this.writer = void 0, this.stream = void 0, this.set_file_confirmed(!1), this.set_file_is_waiting(!1), this.file_num += 1, this.file_skipped = !0
  8916. });
  8917. d(this, "set_file_confirmed", e => {
  8918. this.file_confirmed = e, this.file_skipped = !1
  8919. });
  8920. d(this, "set_file_is_waiting", e => {
  8921. this.file_is_waiting = e
  8922. });
  8923. d(this, "update_job_status", e => {
  8924. if (e <= 0) return;
  8925. let i = Math.floor((this.transferred - this.lastTransferred) / (e * 1 / 1e3));
  8926. this.lastTransferred = this.transferred;
  8927. let o = this.file_num - 1;
  8928. this.job_progress(this.id, o, i, this.finished_size)
  8929. });
  8930. d(this, "job_progress", (e, i, o, a) => {
  8931. F("job_progress", {
  8932. id: e.toString(),
  8933. file_num: i.toString(),
  8934. speed: o.toString(),
  8935. finished_size: a.toString()
  8936. })
  8937. });
  8938. d(this, "job_skipped", () => this.file_skipped && this.files.length === 1);
  8939. d(this, "job_error", () => {
  8940. if (this.job_skipped()) return "skipped"
  8941. });
  8942. d(this, "job_completed", () => !this.enable_overwrite_detection || !this.file_confirmed && !this.file_is_waiting);
  8943. d(this, "remove_download_file", () => {
  8944. if (this.writer) try {
  8945. this.writer.abort()
  8946. } catch {
  8947. }
  8948. this.writer = void 0, this.stream = void 0, this.currentData = void 0, this.zip = void 0
  8949. });
  8950. this.id = e, this.remote = i, this.path = o, this.show_hidden = a, this.is_remote = t, this.is_last_job = s, this.file_num = l, this.files = E, this.conn_id = c, this.total_size = C, this.finished_size = D, this.transferred = B, this.lastTransferred = 0, this.enable_overwrite_detection = m, this.file_confirmed = f, this.file_skipped = R, this.file_is_waiting = I, this.is_dir = y
  8951. }
  8952. };
  8953. let lu = su;
  8954. d(lu, "newWrite", (e, i, o, a, t, s, l, E, c) => {
  8955. let C = l.reduce((B, m) => B + m.size, 0);
  8956. return new su({
  8957. id: e,
  8958. remote: i,
  8959. path: o,
  8960. file_num: a,
  8961. show_hidden: t,
  8962. is_remote: s,
  8963. files: l,
  8964. total_size: C,
  8965. enable_overwrite_detection: E,
  8966. is_dir: c,
  8967. is_last_job: !1,
  8968. conn_id: 0,
  8969. finished_size: 0,
  8970. transferred: 0,
  8971. file_confirmed: !1,
  8972. file_skipped: !1,
  8973. file_is_waiting: !1
  8974. })
  8975. }), d(lu, "newRead", (e, i, o, a, t, s, l, E, c) => {
  8976. let C = l.reduce((B, m) => B + m.size, 0), D = new su({
  8977. id: e,
  8978. remote: i,
  8979. path: o,
  8980. file_num: a,
  8981. show_hidden: t,
  8982. is_remote: s,
  8983. files: l,
  8984. total_size: C,
  8985. enable_overwrite_detection: E,
  8986. is_dir: !1,
  8987. is_last_job: !1,
  8988. conn_id: 0,
  8989. finished_size: 0,
  8990. transferred: 0,
  8991. file_confirmed: !1,
  8992. file_skipped: !1,
  8993. file_is_waiting: !1
  8994. });
  8995. return D.fileHandles = c, D
  8996. }), d(lu, "new_send_confirm", e => eu.fromPartial({file_action: T.fromPartial({send_confirm: e})})), d(lu, "join", (e, i) => i === "" ? e : e.endsWith("/") || e.endsWith("\\") ? e + i : b4() ? e + "\\" + i : e + "/" + i);
  8997. const an = (u, e, i, o) => {
  8998. let a = zu.fromPartial({id: u, path: e, include_hidden: o, file_num: i});
  8999. return T.fromPartial({send: a})
  9000. }, Gi = (u, e, i, o) => {
  9001. if (!o) return;
  9002. let a = Tu.fromPartial({id: u, path: e, file_num: i});
  9003. return T.fromPartial({remove_file: a})
  9004. }, on = (u, e, i) => {
  9005. let o = fu.fromPartial({id: u, path: e, include_hidden: i});
  9006. return T.fromPartial({all_files: o})
  9007. }, nn = (u, e) => {
  9008. let i = ju.fromPartial({id: u, path: e});
  9009. return T.fromPartial({create: i})
  9010. }, rn = u => {
  9011. let e = yu.fromPartial({id: u});
  9012. return T.fromPartial({cancel: e})
  9013. }, sn = (u, e) => {
  9014. let i = Iu.fromPartial({id: u, path: e, recursive: !0});
  9015. return T.fromPartial({remove_dir: i})
  9016. }, ln = (u, e, i) => {
  9017. let o = xu.fromPartial({id: u, path: e, new_name: i});
  9018. return T.fromPartial({rename: o})
  9019. }, En = (u, e, i, o, a) => {
  9020. let t = Ru.fromPartial({id: u, path: e, file_num: i, files: o, total_size: a});
  9021. return T.fromPartial({receive: t})
  9022. }, dn = u => {
  9023. let e = ou.fromPartial({block: u});
  9024. return eu.fromPartial({file_response: e})
  9025. }, Zi = (u, e, i) => {
  9026. let o = ou.fromPartial({error: Su.fromPartial({id: u, error: e, file_num: i})});
  9027. return eu.fromPartial({file_response: o})
  9028. }, cn = (u, e) => {
  9029. let i = ou.fromPartial({done: Pu.fromPartial({id: u, file_num: e})});
  9030. return eu.fromPartial({file_response: i})
  9031. }, Qi = (u, e, i, o, a) => {
  9032. a ? F("update_folder_files", {info: Cn(u, e, a)}) : F("file_dir", {is_local: "false", value: pn(u, i, e)})
  9033. }, Cn = (u, e, i) => {
  9034. let o = {
  9035. id: u,
  9036. entries: e.map(a => ({name: a.name, type: a.entry_type, time: a.modified_time, size: a.size})),
  9037. total_size: e.reduce((a, t) => a + t.size, 0)
  9038. };
  9039. return i && (o.num_entries = e.length, delete o.entries), JSON.stringify(o)
  9040. }, pn = (u, e, i) => {
  9041. let o = {
  9042. id: u,
  9043. path: e,
  9044. entries: i.map(a => ({entry_type: a.entry_type, name: a.name, size: a.size, modified_time: a.modified_time}))
  9045. };
  9046. return JSON.stringify(o)
  9047. }, le = (u, e, i) => {
  9048. F("job_error", {id: u.toString(), err: e, file_num: i.toString()})
  9049. }, Dn = (u, e) => {
  9050. F("job_done", {id: u.toString(), file_num: e.toString()})
  9051. };
  9052. var e0 = 0;
  9053. const Bn = async (u, e) => {
  9054. try {
  9055. if (u) {
  9056. const i = await window.showDirectoryPicker();
  9057. let o = {name: i.name, size: 0, entry_type: 2, modified_time: 0};
  9058. e0++, e(e0, i), F("selected_files", {handleIndex: e0, file: o})
  9059. } else {
  9060. const i = {multiple: !0}, o = await window.showOpenFilePicker(i);
  9061. for (const a of o) {
  9062. const t = await a.getFile();
  9063. let s = {name: t.name, size: t.size, entry_type: 4, modified_time: Math.floor(t.lastModified / 1e3)};
  9064. e0++, e(e0, a), F("selected_files", {handleIndex: e0, file: s})
  9065. }
  9066. }
  9067. } catch (i) {
  9068. console.error("Failed to choose file:", i)
  9069. }
  9070. }, An = async (u, e) => {
  9071. let i = [];
  9072. for (let o of u) if (!o.is_last_job) try {
  9073. let a = await o.read(e);
  9074. if (a) e(dn(a)); else if (o.job_completed()) {
  9075. i.push(o.id);
  9076. let t = o.job_error();
  9077. e(t ? Zi(o.id, t, o.file_num) : cn(o.id, o.file_num))
  9078. }
  9079. } catch (a) {
  9080. e(Zi(o.id, (a != null ? a : "read failed").toString(), o.file_num))
  9081. }
  9082. return i
  9083. }, mn = u => {
  9084. let e = u.lastIndexOf(".");
  9085. return e >= 0 ? u.substring(e + 1) : ""
  9086. }, Fn = u => {
  9087. let e = mn(u);
  9088. return e === "xz" || e === "gz" || e === "zip" || e === "7z" || e === "rar" || e === "bz2" || e === "tgz" || e === "png" || e === "jpg"
  9089. }, _n = (u, e, i, o, a) => {
  9090. F("override_file_confirm", {
  9091. id: u.toString(),
  9092. file_num: e.toString(),
  9093. read_path: i,
  9094. is_upload: o.toString(),
  9095. is_identical: a.toString()
  9096. })
  9097. }, Xi = (u, e) => u === "" ? e : lu.join(u, e), zt = async (u, e) => {
  9098. const i = [];
  9099. let o = [];
  9100. for await(const a of u.values()) if (a.kind === "file") i.push(a.getFile().then(t => {
  9101. o.push({
  9102. entry: W.fromPartial({
  9103. name: Xi(e, t.name),
  9104. size: t.size,
  9105. entry_type: 4,
  9106. modified_time: Math.floor(t.lastModified / 1e3)
  9107. }), handle: a
  9108. })
  9109. })); else if (a.kind === "directory") {
  9110. let t = Xi(e, a.name);
  9111. const s = await zt(a, t);
  9112. o = o.concat(s)
  9113. }
  9114. return await Promise.all(i), o
  9115. }, Pt = 21116, Rt = "rs-ny.rustdesk.com", Yi = 100, f4 = "trust-this-device";
  9116. class It {
  9117. constructor() {
  9118. d(this, "_msgs");
  9119. d(this, "_ws");
  9120. d(this, "_interval");
  9121. d(this, "_updateInterval");
  9122. d(this, "_id");
  9123. d(this, "_otherServer");
  9124. d(this, "_hash");
  9125. d(this, "_msgbox");
  9126. d(this, "_draw");
  9127. d(this, "_peerInfo");
  9128. d(this, "_firstFrame");
  9129. d(this, "_frameCount");
  9130. d(this, "_videoFormat");
  9131. d(this, "_password");
  9132. d(this, "_presetPassword");
  9133. d(this, "_sharedPassword");
  9134. d(this, "_passwordSource");
  9135. d(this, "_options");
  9136. d(this, "_fpsCalc");
  9137. d(this, "_updateTs");
  9138. d(this, "_serverPerms");
  9139. d(this, "_elevationRequested");
  9140. d(this, "_supportedEncoding");
  9141. d(this, "_i444");
  9142. d(this, "_healthCheck");
  9143. d(this, "_sessionId");
  9144. d(this, "_isFileTransfer");
  9145. d(this, "_readJobs");
  9146. d(this, "_writeJobs");
  9147. d(this, "_removeJobs");
  9148. d(this, "_last_update_jobs_ms");
  9149. d(this, "_fileHandles");
  9150. d(this, "_ftTimer");
  9151. d(this, "_restartingRemoteDevice");
  9152. d(this, "_enableTrustedDevices");
  9153. d(this, "_lastChangeDisplay");
  9154. d(this, "_lastSendFps");
  9155. d(this, "_videoQueue");
  9156. d(this, "_decodingVideo");
  9157. d(this, "_selectedWindowsSessionId");
  9158. this._msgbox = Tt, this._draw = de, this._msgs = [], this._id = "", this._frameCount = {}, this._fpsCalc = {
  9159. videoTestSpeed: [0, 0],
  9160. skipBegining: 0,
  9161. fps: void 0
  9162. }, this._updateTs = new Date().getTime(), this._serverPerms = {
  9163. keyboardEnabled: !0,
  9164. fileTransferEnabled: !0,
  9165. clipboardEnabled: !0
  9166. }, this._elevationRequested = !1, this._supportedEncoding = G.fromPartial({}), this._sessionId = 0, this._isFileTransfer = !1, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._last_update_jobs_ms = 0, this._fileHandles = {}, this._restartingRemoteDevice = !1, this._enableTrustedDevices = !1, this._passwordSource = {type: "Undefined"}, this._videoQueue = [], this._decodingVideo = !1
  9167. }
  9168. getPeerPlatform() {
  9169. var e, i;
  9170. return (i = (e = this._peerInfo) == null ? void 0 : e.platform) != null ? i : ""
  9171. }
  9172. isSupportVirtualDisplay() {
  9173. if (!this._peerInfo) return !1;
  9174. try {
  9175. const e = JSON.parse(this._peerInfo.platform_additions), i = e.is_installed, o = e.idd_impl;
  9176. return i && this._peerInfo.platform == "Windows" && (o == "rustdesk_idd" || o == "amyuni_idd")
  9177. } catch (e) {
  9178. return console.error("Failed to check virtual display support, ", e), !1
  9179. }
  9180. }
  9181. sendMessage(e) {
  9182. var i;
  9183. (i = this._ws) == null || i.sendMessage(e)
  9184. }
  9185. handleRelayId(e) {
  9186. return e.endsWith("\\r") || e.endsWith("/r") ? e.substring(0, e.length - 2) : e
  9187. }
  9188. setRemoteId(e) {
  9189. var o, a, t, s, l;
  9190. let i = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
  9191. if (i == 0 && (i = 1), this._sessionId = i, this._restartingRemoteDevice = !1, this._id = e, e.includes("@")) {
  9192. const E = e.split("@"), c = E[0], C = ((o = E[1]) != null ? o : "").split("?"),
  9193. D = (a = C[0]) != null ? a : "", B = (t = C[1]) != null ? t : "",
  9194. m = D == $4 ? qi : (s = B.split("&").reduce((R, I) => {
  9195. const y = I.indexOf("=");
  9196. if (y != -1) {
  9197. const nu = I.substring(0, y).toLowerCase(), k4 = I.substring(y + 1);
  9198. R[nu] = k4
  9199. }
  9200. return R
  9201. }, {}).key) != null ? s : "", f = this.handleRelayId(c);
  9202. this._otherServer = {realId: f, server: D, key: m}, this._id = `${f}@${D}`
  9203. } else this._id = this.handleRelayId(e);
  9204. if (this._options = (l = Cu()[this._id]) != null ? l : this.getUserDefaultToggleOptions(), this._otherServer && !this._otherServer.key) {
  9205. const E = this.getOption("other-server-key");
  9206. E && (this._otherServer.key = E)
  9207. }
  9208. }
  9209. setSessionInfo(e) {
  9210. this._isFileTransfer = e.isFileTransfer, e.is_shared_password ? this._sharedPassword = e.password : this._presetPassword = e.password
  9211. }
  9212. async start() {
  9213. try {
  9214. await this._start()
  9215. } catch (e) {
  9216. this.msgbox("error", "Connection Error", e.type == "close" ? "Reset by the peer" : String(e))
  9217. }
  9218. }
  9219. getId() {
  9220. var e, i;
  9221. return (i = (e = this._otherServer) == null ? void 0 : e.realId) != null ? i : this._id
  9222. }
  9223. async _start() {
  9224. var m, f;
  9225. let e = this.getId(), i = bo(), o = xt(), a = (m = this._otherServer) == null ? void 0 : m.server;
  9226. this._otherServer && (i = this._otherServer.key, o = "");
  9227. let t = "";
  9228. a ? a == $4 ? t = z4(Rt) : t = z4(a) : t = S4(), this._options || (this._options = (f = Cu()[this._id]) != null ? f : this.getUserDefaultToggleOptions()), this._interval = setInterval(() => {
  9229. var R;
  9230. for (; this._msgs.length;) (R = this._ws) == null || R.sendMessage(this._msgs[0]), this._msgs.splice(0, 1)
  9231. }, 1);
  9232. const s = new I4(t, !0, "rendezvous");
  9233. this._ws = s, console.log(new Date + ": Connecting to rendezvous server: " + t + ", for " + e), await s.open(), console.log(new Date + ": Connected to rendezvous server");
  9234. const l = this._isFileTransfer ? ae.FILE_TRANSFER : ae.DEFAULT_CONN, E = st.SYMMETRIC,
  9235. c = qu.fromPartial({id: e, licence_key: i, conn_type: l, nat_type: E, token: o, version: ne});
  9236. s.sendRendezvous({punch_hole_request: c});
  9237. const C = await s.next();
  9238. s.close(), console.log(new Date + ": Got relay response");
  9239. const D = C.punch_hole_response, B = C.relay_response;
  9240. if (D) {
  9241. if (D != null && D.other_failure) {
  9242. this.msgbox("error", "Error", D == null ? void 0 : D.other_failure);
  9243. return
  9244. }
  9245. if (D.failure != G0.UNRECOGNIZED) switch (D == null ? void 0 : D.failure) {
  9246. case G0.ID_NOT_EXIST:
  9247. this.msgbox("error", "Error", "ID does not exist");
  9248. break;
  9249. case G0.OFFLINE:
  9250. this.msgbox("error", "Error", "Remote desktop is offline");
  9251. break;
  9252. case G0.LICENSE_MISMATCH:
  9253. this.msgbox("error", "Error", "Key mismatch");
  9254. break;
  9255. case G0.LICENSE_OVERUSE:
  9256. this.msgbox("error", "Error", "Key overuse");
  9257. break
  9258. }
  9259. } else if (B) {
  9260. if (!B.version) {
  9261. this.msgbox("error", "Error", "Remote version is low, not support web");
  9262. return
  9263. }
  9264. this._healthCheck = new Qo(t, B.feedback, i, o), this._healthCheck.start(), await this.connectRelay(B, i)
  9265. }
  9266. }
  9267. async connectRelay(e, i) {
  9268. var c, C;
  9269. const o = e.pk;
  9270. let a = e.relay_server;
  9271. a ? a = z4(a, !0, 2) : a = S4(!0);
  9272. const t = e.uuid;
  9273. console.log(new Date + ": Connecting to relay server: " + a);
  9274. const s = new I4(a, !1, "relay");
  9275. await s.open(), console.log(new Date + ": Connected to relay server"), this._ws = s;
  9276. const l = Ku.fromPartial({licence_key: i, uuid: t});
  9277. s.sendRendezvous({request_relay: l});
  9278. const E = await this.secure(o, i) || !1;
  9279. F("connection_ready", {secure: E, direct: !1}), this._updateInterval = setInterval(() => {
  9280. this.updateStatus()
  9281. }, 1e3), (c = this._ws) == null || c.on("message", this.msgHandler.bind(this)), (C = this._ws) == null || C.on("status_change", this.onStatusChange.bind(this))
  9282. }
  9283. async secure(e, i) {
  9284. var m, f, R, I, y, nu, k4, Se;
  9285. if (e) {
  9286. try {
  9287. if (e = await it(e, i || qi), e) {
  9288. const j = te.decode(e);
  9289. j.id == this.getId() && (e = j.pk)
  9290. }
  9291. (e == null ? void 0 : e.length) != 32 && (e = void 0)
  9292. } catch (j) {
  9293. console.error("Failed to verify id pk, ", j), e = void 0
  9294. }
  9295. e || console.error("Handshake failed: invalid public key from rendezvous server")
  9296. }
  9297. if (!e) {
  9298. const j = K.fromPartial({});
  9299. (m = this._ws) == null || m.sendMessage({public_key: j});
  9300. return
  9301. }
  9302. const o = await ((f = this._ws) == null ? void 0 : f.next());
  9303. let a = o == null ? void 0 : o.signed_id;
  9304. if (!a) {
  9305. console.error("Handshake failed: invalid message type");
  9306. const j = K.fromPartial({});
  9307. (R = this._ws) == null || R.sendMessage({public_key: j});
  9308. return
  9309. }
  9310. try {
  9311. a = await it(a.id, Uint8Array.from(e))
  9312. } catch (j) {
  9313. console.error("Failed to verify signed id pk, ", j), console.error("pk mismatch, fall back to non-secure");
  9314. const Gt = K.fromPartial({});
  9315. (I = this._ws) == null || I.sendMessage({public_key: Gt});
  9316. return
  9317. }
  9318. const t = te.decode(a), s = t.id, l = t.pk;
  9319. if (s != this.getId()) {
  9320. console.error("Handshake failed: sign failure");
  9321. const j = K.fromPartial({});
  9322. (y = this._ws) == null || y.sendMessage({public_key: j});
  9323. return
  9324. }
  9325. if (l.length != 32) {
  9326. console.error("Handshake failed: invalid public box key length from peer");
  9327. const j = K.fromPartial({});
  9328. (nu = this._ws) == null || nu.sendMessage({public_key: j});
  9329. return
  9330. }
  9331. const [E, c] = bn(), C = wn(), D = Sn(C, l, E), B = K.fromPartial({asymmetric_value: c, symmetric_value: D});
  9332. return (k4 = this._ws) == null || k4.sendMessage({public_key: B}), (Se = this._ws) == null || Se.setSecretKey(C), console.log("secured"), !0
  9333. }
  9334. async msgHandler(e) {
  9335. var i;
  9336. if (this._ws) {
  9337. if (e != null && e.hash) await this.handleHash(e.hash); else if (e != null && e.test_delay) {
  9338. const o = e == null ? void 0 : e.test_delay;
  9339. o.from_client || (F("update_quality_status", {
  9340. delay: `${o.last_delay}`,
  9341. target_bitrate: `${o.target_bitrate}`
  9342. }), (i = this._ws) == null || i.sendMessage({test_delay: o}))
  9343. } else if (e != null && e.login_response) this.handleLoginResponse(e == null ? void 0 : e.login_response); else if (e != null && e.video_frame) this.handleVideoFrame(e == null ? void 0 : e.video_frame); else if (e != null && e.clipboard) ke(e == null ? void 0 : e.clipboard); else if (e != null && e.multi_clipboards) tn(e == null ? void 0 : e.multi_clipboards); else if (e != null && e.cursor_data) {
  9344. const o = e == null ? void 0 : e.cursor_data;
  9345. we(o.colors, !1, a => {
  9346. a && (o.colors = a, F("cursor_data", o))
  9347. })
  9348. } else if (e != null && e.cursor_id) F("cursor_id", {id: e == null ? void 0 : e.cursor_id}); else if (e != null && e.cursor_position) F("cursor_position", e == null ? void 0 : e.cursor_position); else if (e != null && e.misc) this.handleMisc(e == null ? void 0 : e.misc); else if (e != null && e.audio_frame) Tn(e == null ? void 0 : e.audio_frame.data); else if (e != null && e.message_box) this.handleMsgBox(e == null ? void 0 : e.message_box); else if (e != null && e.peer_info) this.handleSyncPeerInfo(e.peer_info); else if (e.file_response) await this.handleFileResponse(e.file_response); else if (e.file_action) {
  9349. const o = e.file_action;
  9350. await this.handleFileAction(o)
  9351. }
  9352. }
  9353. }
  9354. onStatusChange(e) {
  9355. if (e === "" || e === "open") return;
  9356. if (this._restartingRemoteDevice) {
  9357. this.msgbox("restarting", "Restarting remote device", "remote_restarting_tip", "");
  9358. return
  9359. }
  9360. if (e instanceof CloseEvent && e.code == 1e3 || !this._ws) return;
  9361. e && console.error("msgLoop error: ", e);
  9362. const i = "Connection Error";
  9363. let o = "";
  9364. if (e === "Timeout") o = "Connection timeout"; else if (e instanceof CloseEvent) {
  9365. let a = `code: ${e.code}`;
  9366. e.reason && (a += `, reason: ${e.reason}`), o = `Connection closed, ${a}`
  9367. } else e instanceof Error ? o = e.message : typeof e.toString == "function" ? o = e.toString() : o = "";
  9368. this.msgbox("error", i, o, "")
  9369. }
  9370. enterOrLeave(e) {
  9371. e === !1 ? (Wo(), se()) : (Ee(), Hi(this))
  9372. }
  9373. makeDisplaysMsg(e) {
  9374. let i = [];
  9375. return e.forEach(o => {
  9376. let a = {};
  9377. a.x = o.x, a.y = o.y, a.width = o.width, a.height = o.height, a.cursor_embedded = o.cursor_embedded ? 1 : 0, o.original_resolution && (a.original_width = o.original_resolution.width, a.original_height = o.original_resolution.height), a.scale = Math.floor(o.scale * 100), i.push(a)
  9378. }), JSON.stringify(i)
  9379. }
  9380. handleSyncPeerInfo(e) {
  9381. this._peerInfo && (this._peerInfo.displays = e.displays), F("sync_peer_info", {displays: this.makeDisplaysMsg(e.displays)}), F("sync_platform_additions", {platform_additions: e.platform_additions})
  9382. }
  9383. handleMsgBox(e) {
  9384. let i = e.link;
  9385. i in Mi ? i = Mi[i] : (console.warn("Message box ignore link " + i + " for security"), i = ""), this.msgbox(e.msgtype, e.title, e.text, i)
  9386. }
  9387. updateStatus() {
  9388. var s, l;
  9389. const e = new Date().getTime(), i = e - this._updateTs;
  9390. if (i < 1e3) return;
  9391. this._updateTs = e;
  9392. const o = ((s = this._ws) == null ? void 0 : s.getRecvDataCount()) || 0;
  9393. (l = this._ws) == null || l.resetRecvDataCount();
  9394. const a = `${(o / 1024 / i * 1e3).toFixed(2)} kb/s`, t = {};
  9395. for (const E in this._frameCount) if (this._frameCount.hasOwnProperty(E)) {
  9396. const c = this._frameCount[E];
  9397. t[E] = Math.floor(c / (i / 1e3))
  9398. }
  9399. this._frameCount = {}, F("update_quality_status", {speed: a, fps: JSON.stringify(t)})
  9400. }
  9401. handleLoginResponse(e) {
  9402. const i = {
  9403. [Ma]: {
  9404. msgtype: "error",
  9405. title: "Login Error",
  9406. text: "Login screen using Wayland is not supported",
  9407. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9408. try_again: !0
  9409. },
  9410. [ba]: {msgtype: "session-login", title: "", text: "", link: "", try_again: !0},
  9411. [wa]: {msgtype: "session-re-login", title: "", text: "", link: "", try_again: !0},
  9412. [Sa]: {
  9413. msgtype: "info-nocancel",
  9414. title: "another_user_login_title_tip",
  9415. text: "another_user_login_text_tip",
  9416. link: "",
  9417. try_again: !1
  9418. },
  9419. [za]: {
  9420. msgtype: "info-nocancel",
  9421. title: "xorg_not_found_title_tip",
  9422. text: "xorg_not_found_text_tip",
  9423. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9424. try_again: !0
  9425. },
  9426. [Pa]: {
  9427. msgtype: "info-nocancel",
  9428. title: "no_desktop_title_tip",
  9429. text: "no_desktop_text_tip",
  9430. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9431. try_again: !0
  9432. },
  9433. [Ra]: {msgtype: "session-login-password", title: "", text: "", link: "", try_again: !0},
  9434. [Ia]: {msgtype: "session-login-re-password", title: "", text: "", link: "", try_again: !0},
  9435. [Oa]: {
  9436. msgtype: "wait-remote-accept-nook",
  9437. title: "Prompt",
  9438. text: "Please wait for the remote side to accept your session request...",
  9439. link: "",
  9440. try_again: !0
  9441. }
  9442. }, o = e.error;
  9443. if (o) if (o == Oi && (this._enableTrustedDevices = e.enable_trusted_devices), o == Ta && (this._password = void 0, this.msgbox("input-password", "Password Required", "", "")), o == ja) this._password = void 0, this.msgbox("re-input-password", o, "Do you want to enter again?"); else if (o == Na || o == Oi) this.getOption(f4) == "Y" && this.setOption(f4, void 0), this.msgbox("input-2fa", o, ""); else if (o in i) {
  9444. const a = i[o];
  9445. this.msgbox(a.msgtype, a.title, a.text, a.link)
  9446. } else o.includes(La) ? this.msgbox("error", "Login Error", o, Et) : this.msgbox("error", "Login Error", o); else e.peer_info && (this._firstFrame = !1, this.handlePeerInfo(e.peer_info))
  9447. }
  9448. enableTrustedDevices() {
  9449. return this._enableTrustedDevices
  9450. }
  9451. msgbox(e, i, o, a = "") {
  9452. var t;
  9453. (t = this._msgbox) == null || t.call(this, e, i, o, a)
  9454. }
  9455. cancelMsgbox(e) {
  9456. F("cancel_msgbox", {tag: e})
  9457. }
  9458. draw(e, i) {
  9459. de(e, new Uint8Array(i.data))
  9460. }
  9461. close() {
  9462. var e, i;
  9463. this._msgs = [], this._interval && (clearInterval(this._interval), this._interval = void 0), this._updateInterval && (clearInterval(this._updateInterval), this._updateInterval = void 0), this._ftTimer && (clearTimeout(this._ftTimer), this._ftTimer = void 0), (e = this._ws) == null || e.close(), this._ws = void 0, (i = this._healthCheck) == null || i.close(), this._healthCheck = void 0, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._fileHandles = {}, se(), this._lastChangeDisplay = void 0, this._lastSendFps = void 0, this._videoQueue = [], this._decodingVideo = !1
  9464. }
  9465. refresh() {
  9466. var i;
  9467. const e = h.fromPartial({refresh_video: !0});
  9468. (i = this._ws) == null || i.sendMessage({misc: e})
  9469. }
  9470. setMsgbox(e) {
  9471. this._msgbox = e
  9472. }
  9473. setDraw(e) {
  9474. this._draw = e
  9475. }
  9476. async handleHash(e) {
  9477. this._hash = e;
  9478. let i = this._password;
  9479. (!i || i.length === 0) && this._presetPassword && (i = Gu([this._presetPassword, e.salt]), this._passwordSource = {type: "Undefined"});
  9480. let o = this._sharedPassword;
  9481. if (this._sharedPassword = void 0, o && (i = Gu([o, e.salt]), this._passwordSource = {
  9482. type: "SharedAb",
  9483. value: o
  9484. }), !i || i.length === 0) {
  9485. const l = this.getOption("password");
  9486. typeof l == "string" && l.length > 0 && (i = d4(l), this._passwordSource = {type: "Undefined"})
  9487. }
  9488. if (!i || i.length === 0) {
  9489. let l = De("access_token"), E = await _t();
  9490. if (l && l === E.access_token) {
  9491. let c = E.ab_entries.find(C => mo(C));
  9492. if (c) {
  9493. let C = c.peers.find(D => D.id == this._id);
  9494. if (C) {
  9495. let D = d4(C.hash);
  9496. D.length > 0 && (i = D, this._passwordSource = {type: "PersonalAb", value: D})
  9497. }
  9498. }
  9499. }
  9500. }
  9501. this._password = i;
  9502. let a;
  9503. !i || i.length === 0 ? (a = new Uint8Array(0), this.msgbox("input-password", "Password Required", "")) : a = Gu([i, e.challenge]);
  9504. let t = this.getOption("os-username") || "", s = this.getOption("os-password") || "";
  9505. this._sendLoginMessage({os_login: {username: t, password: s}, password: a})
  9506. }
  9507. handle_login_from_ui(e, i, o, a) {
  9508. let t;
  9509. if (o === "") {
  9510. let l = this._password;
  9511. if (!l || l.length === 0) {
  9512. const E = this.getOption("password");
  9513. typeof E == "string" && E.length > 0 && (l = d4(E), this._passwordSource = {type: "Undefined"})
  9514. }
  9515. t = l
  9516. } else this._passwordSource = {type: "Undefined"}, t = Gu([o, this._hash.salt]), this.setRemember(a);
  9517. this._password = t;
  9518. let s = Gu([t != null ? t : Uint8Array.from([]), this._hash.challenge]);
  9519. this._sendLoginMessage({os_login: {username: e, password: i}, password: s})
  9520. }
  9521. changePreferCodec() {
  9522. var a;
  9523. const e = this.getSupportedDecoding(), i = S.fromPartial({supported_decoding: e}),
  9524. o = h.fromPartial({option: i});
  9525. (a = this._ws) == null || a.sendMessage({misc: o})
  9526. }
  9527. async reconnect() {
  9528. this.close(), await this.start()
  9529. }
  9530. _getHwid(e = void 0) {
  9531. return (e != null ? e : this.getOption(f4) == "Y") ? xo() : new Uint8Array
  9532. }
  9533. _sendLoginMessage(e) {
  9534. var E;
  9535. const i = this._otherServer ? `${T4()}@${S4()}` : T4(), o = wo();
  9536. let a = gt();
  9537. if (o) try {
  9538. const c = JSON.parse(o);
  9539. c.name && (a = c.name)
  9540. } catch (c) {
  9541. console.error("Failed to get user info, ", c)
  9542. }
  9543. let t;
  9544. if (this._isFileTransfer) {
  9545. let c = this.getOption("remote_dir"), C = this.getOption("remote_show_hidden") === "Y";
  9546. t = Fu.fromPartial({dir: c, show_hidden: C})
  9547. }
  9548. const s = this._getHwid(), l = H.fromPartial({
  9549. username: this.getId(),
  9550. my_id: i,
  9551. my_name: a,
  9552. session_id: this._sessionId,
  9553. password: e.password,
  9554. option: this.getOptionMessage(),
  9555. video_ack_required: !0,
  9556. os_login: e.os_login,
  9557. version: ne,
  9558. my_platform: Ga,
  9559. file_transfer: t,
  9560. hwid: s
  9561. });
  9562. (E = this._ws) == null || E.sendMessage({login_request: l})
  9563. }
  9564. getOptionMessage() {
  9565. if (this._isFileTransfer) return;
  9566. let e = 0;
  9567. const i = S.fromPartial({}), o = this.getImageQuality(), a = this.getImageQualityEnum(o, !0), t = x.Yes;
  9568. if (a != null) i.image_quality = a, e += 1; else if (o === "custom") {
  9569. let l = 50, E = this.getOption("custom_image_quality");
  9570. if (E) try {
  9571. l = parseInt(E)
  9572. } catch {
  9573. }
  9574. i.custom_image_quality = l << 8, e += 1;
  9575. let c = this.getOption("custom-fps");
  9576. if (c) try {
  9577. i.custom_fps = parseInt(c), this._lastSendFps = i.custom_fps, e += 1
  9578. } catch {
  9579. }
  9580. }
  9581. const s = this.getOption("view-only");
  9582. return s && (i.disable_keyboard = t), (s || this._options["show-remote-cursor"]) && (i.show_remote_cursor = t, e += 1), this._options["follow-remote-cursor"] && (i.follow_remote_cursor = t, e += 1), this._options["follow-remote-window"] && (i.follow_remote_window = t, e += 1), !s && this._options["lock-after-session-end"] && (i.lock_after_session_end = t, e += 1), this._options["disable-audio"] && (i.disable_audio = t, e += 1), (s || this._options["disable-clipboard"]) && (i.disable_clipboard = t, e += 1), i.supported_decoding = this.getSupportedDecoding(), e += 1, e > 0 ? i : void 0
  9583. }
  9584. sendVideoReceived() {
  9585. var i;
  9586. const e = h.fromPartial({video_received: !0});
  9587. (i = this._ws) == null || i.sendMessage({misc: e})
  9588. }
  9589. getCodecFormat(e) {
  9590. return e.vp9s ? "VP9" : e.vp8s ? "VP8" : e.av1s ? "AV1" : e.h264s ? "H264" : e.h265s ? "H265" : "Unknown"
  9591. }
  9592. getSupportedEncoding() {
  9593. return this._supportedEncoding
  9594. }
  9595. getSupportedDecoding() {
  9596. let e = this.getOption("codec-preference");
  9597. e == "vp8" ? e = mu.VP8 : e == "vp9" ? e = mu.VP9 : e == "av1" ? e = mu.AV1 : e == "h264" ? e = mu.H264 : e == "h265" ? e = mu.H265 : e = mu.Auto;
  9598. let i = this.getOption("i444") == "Y" ? ie.I444 : ie.I420;
  9599. return Wu.fromPartial({
  9600. ability_vp8: 1,
  9601. ability_vp9: 1,
  9602. ability_av1: 1,
  9603. ability_h264: 1,
  9604. ability_h265: 1,
  9605. prefer: e,
  9606. prefer_chroma: i,
  9607. i444: J.fromPartial({vp9: !0, av1: !0})
  9608. })
  9609. }
  9610. getAlternativeCodecs() {
  9611. const e = this.getSupportedEncoding(), i = this.getSupportedDecoding();
  9612. return JSON.stringify({
  9613. vp8: e.vp8 && i.ability_vp8 == 1,
  9614. av1: e.av1 && i.ability_av1 == 1,
  9615. h264: e.h264 && i.ability_h264 == 1,
  9616. h265: e.h265 && i.ability_h265 == 1
  9617. })
  9618. }
  9619. fpsCalculate(e, i) {
  9620. if (e) {
  9621. this._fpsCalc.skipBegining = 0, this._fpsCalc.videoTestSpeed = [0, 0];
  9622. return
  9623. }
  9624. if (this._fpsCalc.skipBegining < 3) {
  9625. this._fpsCalc.skipBegining += 1;
  9626. return
  9627. }
  9628. this._fpsCalc.videoTestSpeed[1] += i, this._fpsCalc.videoTestSpeed[0] += 1, this._fpsCalc.videoTestSpeed[0] % 10 == 0 && i > 0 && (this._fpsCalc.fps = Math.floor(this._fpsCalc.videoTestSpeed[0] * 1e3 / this._fpsCalc.videoTestSpeed[1]), console.log("max decode fps: " + this._fpsCalc.fps)), this._fpsCalc.videoTestSpeed[0] >= 30 && (this._fpsCalc.videoTestSpeed = [0, 0])
  9629. }
  9630. handleVideoFrame(e) {
  9631. if (!this._firstFrame) {
  9632. this.msgbox("", "", ""), this._firstFrame = !0, this.sendToggleVirtualDisplayMsg(), this.sendTogglePrivacyModeMsg(), Ee(), Hi(this, !0);
  9633. const i = 0;
  9634. for (let o = 0; o < i; o++) this.sendVideoReceived();
  9635. console.log(`send ${i} video received in advance for high fps`)
  9636. }
  9637. this._videoQueue.push(e), this._decodingVideo || this.processVideoQueue()
  9638. }
  9639. async processVideoQueue() {
  9640. this._decodingVideo = !0;
  9641. try {
  9642. for (; this._videoQueue.length > 0;) await this.handleOneVideoFrame(this._videoQueue.shift())
  9643. } catch (e) {
  9644. console.error("deal video queue failed", e)
  9645. }
  9646. this._decodingVideo = !1
  9647. }
  9648. async handleOneVideoFrame(e) {
  9649. const i = this.getCodecFormat(e), o = this._videoFormat != i;
  9650. o && (this._videoFormat = i, F("update_quality_status", {codec_format: i}));
  9651. var a = new Date().getTime(), t = 0, s = void 0;
  9652. if (e.vp8s) t = 0, s = e.vp8s; else if (e.vp9s) t = 1, s = e.vp9s; else if (e.av1s) t = 2, s = e.av1s; else if (e.h264s) t = 3, s = e.h264s; else if (e.h265s) t = 4, s = e.h265s; else {
  9653. console.log("unknown codec");
  9654. return
  9655. }
  9656. const l = s == null ? void 0 : s.frames.length;
  9657. this._frameCount[e.display] = (this._frameCount[e.display] || 0) + l, this.sendVideoReceived();
  9658. try {
  9659. for (let E = 0; E < l; E++) {
  9660. let c = s.frames[E];
  9661. const C = await xa(t, c.data.slice(0).buffer);
  9662. if (C.data && l - 1 == E) {
  9663. this.draw(e.display, C.data);
  9664. const D = new Date().getTime();
  9665. this.fpsCalculate(o, D - a);
  9666. const B = C.data.yuvFormat == 5;
  9667. this._i444 != B && (this._i444 = B, F("update_quality_status", {chroma: B ? "4:4:4" : "4:2:0"}))
  9668. }
  9669. }
  9670. } catch (E) {
  9671. console.error("decode error: ", E)
  9672. }
  9673. }
  9674. sendToggleVirtualDisplayMsg() {
  9675. if (!this.isSupportVirtualDisplay()) return;
  9676. const e = this.getOption("virtual-display");
  9677. !e || e.split(",").forEach(i => {
  9678. const o = Number(i);
  9679. isNaN(o) || this._sendToggleVirtualDisplayMsg(o, !0)
  9680. })
  9681. }
  9682. sendTogglePrivacyModeMsg() {
  9683. if (!!this._peerInfo && !(Q(this._peerInfo.version) < Q("1.2.4")) && this.getOption("privacy-mode")) {
  9684. const e = this.getOption("privacy-mode-impl-key");
  9685. if (e == "privacy_mode_impl_virtual_display" && this.isSupportVirtualDisplay()) return;
  9686. this._sendTogglePrivacyModeMsg(e, !0)
  9687. }
  9688. }
  9689. handlePeerInfo(e) {
  9690. var a, t, s;
  9691. if (this._peerInfo = e, e.current_display > e.displays.length && (e.current_display = 0), Q(e.version) < Q("1.1.10") && this.setPermission("restart", !1), this._isFileTransfer) {
  9692. if (!e.username.length && !((a = e.windows_sessions) != null && a.sessions.length)) {
  9693. this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.");
  9694. return
  9695. }
  9696. } else if (e.displays.length == 0) {
  9697. this.lcHandlePeerInfo(e), F("update_privacy_mode", {}), this.msgbox("error", "Remote Error", "No Display");
  9698. return
  9699. }
  9700. F("peer_info", {
  9701. ...e,
  9702. displays: this.makeDisplaysMsg(e.displays),
  9703. resolutions: JSON.stringify(e.resolutions)
  9704. }), this._isFileTransfer || (this.msgbox("success", "Successful", "Connected, waiting for image..."), this.tryChangeInitResolution(e.current_display));
  9705. const i = this.shouldAutoLogin();
  9706. i && this.inputOsPassword(i);
  9707. const o = (t = this.getOption("info")) == null ? void 0 : t.username;
  9708. o && !e.username && (e.username = o), F("update_privacy_mode", {}), this.lcHandlePeerInfo(e), (s = e.windows_sessions) != null && s.sessions.length && (this._selectedWindowsSessionId == e.windows_sessions.current_sid ? this.sendSelectedSessionId(e.windows_sessions.current_sid.toString()) : this.setMultipleWindowsSession(e.windows_sessions.sessions))
  9709. }
  9710. lcHandlePeerInfo(e) {
  9711. var l;
  9712. let i = re(this._id) || {};
  9713. i.info = {username: e.username, hostname: e.hostname, platform: e.platform};
  9714. let o = this._password, a = i.password, t = this.getRemember(), s = this._hash;
  9715. t ? o && o.length > 0 && Z(o) !== a && !$i(this._passwordSource, o, s) && (i.password = Z(o), console.log("remember password of " + this._id)) : o && o.length > 0 && ut(this._passwordSource, o) ? (i.password = Z(o), console.log("save ab password of " + this._id + " to recent")) : a && (i.password = void 0, console.log("remove password of " + this._id)), (l = this._otherServer) != null && l.server && this._otherServer.server != $4 && this.setOption("other-server-key", this._otherServer.key), i.password && o && o.length > 0 && !$i(this._passwordSource, o, s) && !ut(this._passwordSource, o) && F("sync_peer_hash_password_to_personal_ab", {
  9716. id: this._id,
  9717. hash: Z(o)
  9718. }), this.saveConfig(i), e.encoding && (this._supportedEncoding = e.encoding)
  9719. }
  9720. setPermission(e, i) {
  9721. F("permission", {[e]: i})
  9722. }
  9723. shouldAutoLogin() {
  9724. const e = this.getOption("lock-after-session-end"), i = !!this.getOption("auto-login"),
  9725. o = this.getOption("os-password");
  9726. return o && e && i ? o : ""
  9727. }
  9728. handleMisc(e) {
  9729. if (e.audio_format) In(e.audio_format.channels, e.audio_format.sample_rate); else if (e.chat_message) F("chat_client_mode", {text: e.chat_message.text}); else if (e.permission_info) {
  9730. const i = e.permission_info;
  9731. console.info("Change permission " + i.permission + " -> " + i.enabled);
  9732. let o;
  9733. switch (i.permission) {
  9734. case i0.Keyboard:
  9735. this._serverPerms.keyboardEnabled = i.enabled, o = "keyboard";
  9736. break;
  9737. case i0.Clipboard:
  9738. this._serverPerms.clipboardEnabled = i.enabled, o = "clipboard";
  9739. break;
  9740. case i0.Audio:
  9741. o = "audio";
  9742. break;
  9743. case i0.Restart:
  9744. o = "restart";
  9745. break;
  9746. case i0.BlockInput:
  9747. o = "block_input";
  9748. break;
  9749. default:
  9750. return !0
  9751. }
  9752. this.setPermission(o, i.enabled)
  9753. } else if (e.switch_display) F("switch_display", e.switch_display), this.setCustomResolution(e.switch_display); else {
  9754. if (e.close_reason) return this.msgbox("error", "Connection Error", e.close_reason), this.close(), !1;
  9755. if (e.back_notification) {
  9756. if (!this.handleBackNotification(e.back_notification)) return this.close(), !1
  9757. } else e.uac !== void 0 ? e.uac && this._serverPerms.keyboardEnabled ? this.msgbox("on-uac", "Prompt", "Please wait for confirmation of UAC...", "") : (this.cancelMsgbox("on-uac"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.foreground_window_elevated !== void 0 ? e.foreground_window_elevated && this._serverPerms.keyboardEnabled ? this.msgbox("on-foreground-elevated", "Prompt", "elevated_foreground_window_tip", "") : (this.cancelMsgbox("on-foreground-elevated"), this.cancelMsgbox("wait-uac"), this.cancelMsgbox("elevation-error")) : e.elevation_response !== void 0 ? e.elevation_response === "" ? this.msgbox("wait-uac", "", "", "") : (this.cancelMsgbox("wait-uac"), this.msgbox("elevation-error", "Elevation Error", e.elevation_response, "")) : e.portable_service_running !== void 0 ? (this.portableServiceRunning(e.portable_service_running), this._elevationRequested && e.portable_service_running && this.msgbox("custom-nocancel-success", "Successful", "Elevate successfully", "")) : e.supported_encoding ? this._supportedEncoding = e.supported_encoding : e.follow_current_display !== void 0 && this.handleFollowCurrentDisplay(e.follow_current_display)
  9758. }
  9759. return !0
  9760. }
  9761. portableServiceRunning(e) {
  9762. F("portable_service_running", {running: e.toString()})
  9763. }
  9764. handleFollowCurrentDisplay(e) {
  9765. F("follow_current_display", {display_idx: e.toString()})
  9766. }
  9767. handleBackNotification(e) {
  9768. if (e.block_input_state) this.handleBackMsgBlockInput(e.block_input_state, e.details); else if (e.privacy_mode_state) return this.handleBackMsgPrivacyMode(e.privacy_mode_state, e.details, e.impl_key);
  9769. return !0
  9770. }
  9771. updateBlockInputState(e) {
  9772. F("update_block_input_state", {input_state: e ? "on" : "off"})
  9773. }
  9774. handleBackMsgBlockInput(e, i) {
  9775. switch (e) {
  9776. case D4.BlkOnSucceeded:
  9777. this.updateBlockInputState(!0);
  9778. break;
  9779. case D4.BlkOnFailed:
  9780. this.msgbox("custom-error", "Block user input", i == "" ? "Failed" : i, ""), this.updateBlockInputState(!1);
  9781. break;
  9782. case D4.BlkOffSucceeded:
  9783. this.updateBlockInputState(!1);
  9784. break;
  9785. case D4.BlkOffFailed:
  9786. this.msgbox("custom-error", "Unblock user input", i == "" ? "Failed" : i, "");
  9787. break
  9788. }
  9789. }
  9790. updatePrivacyMode(e, i) {
  9791. i && (e == "" && (e = "privacy_mode_impl_mag"), this.setOption("privacy-mode-impl-key", e)), this.setOption("privacy-mode", i), F("update_privacy_mode", {})
  9792. }
  9793. handleBackMsgPrivacyMode(e, i, o) {
  9794. switch (e) {
  9795. case au.PrvOnByOther:
  9796. return this.msgbox("error", "Connecting...", "Someone turns on privacy mode, exit", ""), !1;
  9797. case au.PrvNotSupported:
  9798. this.msgbox("custom-error", "Privacy mode", "Unsupported", ""), this.updatePrivacyMode(o, !1);
  9799. break;
  9800. case au.PrvOnSucceeded:
  9801. this.msgbox("custom-nocancel", "Privacy mode", "Enter privacy mode", ""), this.updatePrivacyMode(o, !0);
  9802. break;
  9803. case au.PrvOnFailedDenied:
  9804. this.msgbox("custom-error", "Privacy mode", "Peer denied", ""), this.updatePrivacyMode(o, !1);
  9805. break;
  9806. case au.PrvOnFailedPlugin:
  9807. this.msgbox("custom-error", "Privacy mode", "Please install plugins", ""), this.updatePrivacyMode(o, !1);
  9808. break;
  9809. case au.PrvOnFailed:
  9810. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed" : i, ""), this.updatePrivacyMode(o, !1);
  9811. break;
  9812. case au.PrvOffSucceeded:
  9813. this.msgbox("custom-nocancel", "Privacy mode", "Exit privacy mode", ""), this.updatePrivacyMode(o, !1);
  9814. break;
  9815. case au.PrvOffFailed:
  9816. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed to turn off" : i, "");
  9817. break;
  9818. case au.PrvOffUnknown:
  9819. this.msgbox("custom-error", "Privacy mode", "Turned off", ""), this.updatePrivacyMode(o, !1);
  9820. break
  9821. }
  9822. return !0
  9823. }
  9824. getRemember() {
  9825. return this._options.remember || !1
  9826. }
  9827. setRemember(e) {
  9828. this.setOption("remember", e)
  9829. }
  9830. getOption(e) {
  9831. var i;
  9832. return (i = this._options[e]) != null ? i : $u(e)
  9833. }
  9834. getUserDefaultToggleOptions() {
  9835. const e = {}, i = {
  9836. "show-remote-cursor": "show_remote_cursor",
  9837. "lock-after-session-end": "lock_after_session_end",
  9838. "privacy-mode": "privacy_mode",
  9839. "enable-file-copy-paste": "enable-file-copy-paste",
  9840. "disable-audio": "disable_audio",
  9841. "disable-clipboard": "disable_clipboard",
  9842. "show-quality-monitor": "show_quality_monitor",
  9843. allow_swap_key: "allow_swap_key",
  9844. "view-only": "view_only",
  9845. "follow-remote-cursor": "follow_remote_cursor",
  9846. "follow-remote-window": "follow_remote_window"
  9847. };
  9848. for (const [a, t] of Object.entries(i)) e[a] = $u(t) == "Y";
  9849. const o = ["codec-preference", "custom-fps", "zoom-cursor", "touch-mode", "i444", "swap-left-right-mouse", "collapse_toolbar"];
  9850. for (const a of o) e[a] = $u(a);
  9851. return e
  9852. }
  9853. getToggleOption(e) {
  9854. const i = ["show-remote-cursor", "privacy-mode", "enable-file-copy-paste"], o = this._options[e];
  9855. return typeof o == "string" ? o != "" : o != null ? o : !!i.includes(e)
  9856. }
  9857. getStatus() {
  9858. return JSON.stringify({status_num: 10})
  9859. }
  9860. checkConnStatus() {
  9861. }
  9862. saveConfig(e) {
  9863. this._options = e, this._options.tm = new Date().getTime(), so(this._id, e)
  9864. }
  9865. loadConfig() {
  9866. return re(this._id) || {}
  9867. }
  9868. setOption(e, i) {
  9869. i == null ? delete this._options[e] : this._options[e] = i, this._options.tm = new Date().getTime(), Bt(this._id, e, i)
  9870. }
  9871. setFlutterUiOption(e, i) {
  9872. this.setOption(`flutter_ui:${e}`, i)
  9873. }
  9874. getFlutterUiOption(e) {
  9875. return this.getOption(`flutter_ui:${e}`)
  9876. }
  9877. inputKey(e, i, o, a, t, s, l) {
  9878. var c;
  9879. const E = go(e, fn());
  9880. !E || (a && (e == "VK_MENU" || e == "RAlt") && (a = !1), t && (e == "VK_CONTROL" || e == "RControl") && (t = !1), s && (e == "VK_SHIFT" || e == "RShift") && (s = !1), l && (e == "Meta" || e == "RWin") && (l = !1), E.down = i, E.press = o, E.modifiers = this.getMod(a, t, s, l), (c = this._ws) == null || c.sendMessage({key_event: E}))
  9881. }
  9882. ctrlAltDel() {
  9883. var i, o;
  9884. const e = w.fromPartial({down: !0});
  9885. ((i = this._peerInfo) == null ? void 0 : i.platform) == "Windows" ? e.control_key = N.CtrlAltDel : (e.control_key = N.Delete, e.modifiers = this.getMod(!0, !0, !1, !1)), (o = this._ws) == null || o.sendMessage({key_event: e})
  9886. }
  9887. restart() {
  9888. var i;
  9889. this._restartingRemoteDevice = !0;
  9890. const e = h.fromPartial({});
  9891. e.restart_remote_device = !0, (i = this._ws) == null || i.sendMessage({misc: e})
  9892. }
  9893. inputString(e) {
  9894. var o;
  9895. const i = w.fromPartial({seq: e});
  9896. (o = this._ws) == null || o.sendMessage({key_event: i})
  9897. }
  9898. send2fa(e) {
  9899. var i;
  9900. try {
  9901. const o = JSON.parse(e), a = o.code, t = o.trust_this_device;
  9902. t && this.setOption(f4, "Y");
  9903. const s = this._getHwid(t), l = _u.fromPartial({code: a, hwid: s});
  9904. (i = this._ws) == null || i.sendMessage({auth_2fa: l})
  9905. } catch {
  9906. console.log('Failed to switch display, invalid param "' + e + '"')
  9907. }
  9908. }
  9909. _captureDisplays({add: e, sub: i, set: o}) {
  9910. var s;
  9911. const a = Mu.fromPartial({add: e, sub: i, set: o}), t = h.fromPartial({capture_displays: a});
  9912. (s = this._ws) == null || s.sendMessage({misc: t})
  9913. }
  9914. switchDisplay(e) {
  9915. var i;
  9916. try {
  9917. const o = JSON.parse(e), a = o.value, t = o.isDesktop;
  9918. if (a.length == 1) {
  9919. let s = this.getCustomResolution(a[0]);
  9920. const l = Ou.fromPartial({display: a[0], width: s ? s[0] : void 0, height: s ? s[1] : void 0}),
  9921. E = h.fromPartial({switch_display: l});
  9922. (i = this._ws) == null || i.sendMessage({misc: E}), t || this._captureDisplays({set: a})
  9923. } else this._captureDisplays({set: a})
  9924. } catch {
  9925. console.log('Failed to switch display, invalid param "' + e + '"')
  9926. }
  9927. }
  9928. elevateDirect() {
  9929. var o;
  9930. const e = Du.fromPartial({direct: !0}), i = h.fromPartial({elevation_request: e});
  9931. (o = this._ws) == null || o.sendMessage({misc: i}), this._elevationRequested = !0
  9932. }
  9933. elevateWithLogon(e) {
  9934. var i;
  9935. try {
  9936. const o = JSON.parse(e), a = Vu.fromPartial({username: o.username, password: o.password}),
  9937. t = Du.fromPartial({logon: a}), s = h.fromPartial({elevation_request: t});
  9938. (i = this._ws) == null || i.sendMessage({misc: s}), this._elevationRequested = !0
  9939. } catch {
  9940. console.log('Failed to elevate with logon, invalid param "' + e + '"')
  9941. }
  9942. }
  9943. async inputOsPassword(e) {
  9944. var a, t;
  9945. this.inputMouse(), await ue(50), this.inputMouse(0, 3, 3), await ue(50), this.inputMouse(1 | 1 << 3), this.inputMouse(2 | 1 << 3), await ue(1200);
  9946. const i = w.fromPartial({press: !0, seq: e});
  9947. (a = this._ws) == null || a.sendMessage({key_event: i});
  9948. const o = w.fromPartial({press: !0, control_key: N.Return});
  9949. (t = this._ws) == null || t.sendMessage({key_event: o})
  9950. }
  9951. lockScreen() {
  9952. var i;
  9953. const e = w.fromPartial({down: !0, control_key: N.LockScreen});
  9954. (i = this._ws) == null || i.sendMessage({key_event: e})
  9955. }
  9956. isSwapControlCommand() {
  9957. return this.getToggleOption("allow_swap_key")
  9958. }
  9959. getMod(e, i, o, a) {
  9960. const t = [];
  9961. return e && t.push(N.Alt), i && (this.isSwapControlCommand() ? t.push(N.Meta) : t.push(N.Control)), o && t.push(N.Shift), a && (this.isSwapControlCommand() ? t.push(N.Control) : t.push(N.Meta)), t
  9962. }
  9963. inputMouse(e = 0, i = 0, o = 0, a = !1, t = !1, s = !1, l = !1) {
  9964. var c;
  9965. const E = ku.fromPartial({mask: e, x: i, y: o, modifiers: this.getMod(a, t, s, l)});
  9966. (c = this._ws) == null || c.sendMessage({mouse_event: E})
  9967. }
  9968. toggleOption(e) {
  9969. var s;
  9970. const i = !this._options[e], o = S.fromPartial({}), a = i ? x.Yes : x.No;
  9971. switch (e) {
  9972. case"show-remote-cursor":
  9973. o.show_remote_cursor = a;
  9974. break;
  9975. case"follow-remote-cursor":
  9976. o.follow_remote_cursor = a;
  9977. break;
  9978. case"follow-remote-window":
  9979. o.follow_remote_window = a;
  9980. break;
  9981. case"disable-audio":
  9982. o.disable_audio = a;
  9983. break;
  9984. case"disable-clipboard":
  9985. o.disable_clipboard = a;
  9986. break;
  9987. case"lock-after-session-end":
  9988. o.lock_after_session_end = a;
  9989. break;
  9990. case"privacy-mode":
  9991. o.privacy_mode = a;
  9992. break;
  9993. case"enable-file-copy-paste":
  9994. o.enable_file_transfer = a;
  9995. break;
  9996. case"block-input":
  9997. o.block_input = x.Yes;
  9998. break;
  9999. case"unblock-input":
  10000. o.block_input = x.No;
  10001. break;
  10002. case"show-quality-monitor":
  10003. case"allow_swap_key":
  10004. break;
  10005. case"view-only":
  10006. i ? (o.disable_keyboard = x.Yes, o.disable_clipboard = x.Yes, o.show_remote_cursor = x.Yes, o.enable_file_transfer = x.No, o.lock_after_session_end = x.No) : (o.disable_keyboard = x.No, o.disable_clipboard = this.getToggleOption("disable-clipboard") ? x.Yes : x.No, o.show_remote_cursor = this.getToggleOption("show-remote-cursor") ? x.Yes : x.No, o.enable_file_transfer = this.getToggleOption("enable-file-copy-paste") ? x.Yes : x.No, o.lock_after_session_end = this.getToggleOption("lock-after-session-end") ? x.Yes : x.No);
  10007. break;
  10008. default:
  10009. this.setOption(e, this._options[e] ? void 0 : "Y");
  10010. return
  10011. }
  10012. e.indexOf("block-input") < 0 && this.setOption(e, i);
  10013. const t = h.fromPartial({option: o});
  10014. (s = this._ws) == null || s.sendMessage({misc: t})
  10015. }
  10016. toggleVirtualDisplay(e) {
  10017. try {
  10018. const i = JSON.parse(e);
  10019. this._sendToggleVirtualDisplayMsg(i.index, i.on), this.updateVirtualDisplay(i.index, i.on)
  10020. } catch {
  10021. console.log('Failed to toggle virtual display, invalid param "' + e + '"')
  10022. }
  10023. }
  10024. togglePrivacyMode(e) {
  10025. try {
  10026. const i = JSON.parse(e);
  10027. this._sendTogglePrivacyModeMsg(i.impl_key, i.on)
  10028. } catch {
  10029. console.log('Failed to toggle privacy mode, invalid param "' + e + '"')
  10030. }
  10031. }
  10032. _sendToggleVirtualDisplayMsg(e, i) {
  10033. var t;
  10034. const o = Lu.fromPartial({display: e, on: i}), a = h.fromPartial({toggle_virtual_display: o});
  10035. (t = this._ws) == null || t.sendMessage({misc: a})
  10036. }
  10037. _sendTogglePrivacyModeMsg(e, i) {
  10038. var t;
  10039. const o = Uu.fromPartial({impl_key: e, on: i}), a = h.fromPartial({toggle_privacy_mode: o});
  10040. (t = this._ws) == null || t.sendMessage({misc: a})
  10041. }
  10042. updateVirtualDisplay(e, i) {
  10043. const o = "virtual-display", a = this.getOption(o);
  10044. if (i) {
  10045. const t = a.split(","), s = t.length;
  10046. e == 0 ? t.splice(0, t.length) : t.indexOf(e.toString()) < 0 && t.push(e.toString()), t.length != s && this.setOption(o, t.join(","))
  10047. } else if (e == -1) a != "" && this.setOption(o, ""); else {
  10048. const t = a.split(","), s = t.length;
  10049. if (e == 0) t.pop(); else {
  10050. const l = t.indexOf(e.toString());
  10051. l >= 0 && t.splice(l, 1)
  10052. }
  10053. t.length != s && this.setOption(o, t.join(","))
  10054. }
  10055. }
  10056. getImageQuality() {
  10057. return this.getOption("image_quality")
  10058. }
  10059. getImageQualityEnum(e, i) {
  10060. switch (e) {
  10061. case"low":
  10062. return x4.Low;
  10063. case"best":
  10064. return x4.Best;
  10065. case"balanced":
  10066. return i ? void 0 : x4.Balanced;
  10067. default:
  10068. return
  10069. }
  10070. }
  10071. setImageQuality(e) {
  10072. var t;
  10073. this.setOption("image_quality", e);
  10074. const i = this.getImageQualityEnum(e, !1);
  10075. if (i == null) return;
  10076. const o = S.fromPartial({image_quality: i}), a = h.fromPartial({option: o});
  10077. (t = this._ws) == null || t.sendMessage({misc: a}), this._lastSendFps != 30 && this.setCustomFps(30, !1)
  10078. }
  10079. setCustomImageQuality(e) {
  10080. var t;
  10081. const i = e << 8, o = S.fromPartial({custom_image_quality: i}), a = h.fromPartial({option: o});
  10082. (t = this._ws) == null || t.sendMessage({misc: a}), this.setOption("custom_image_quality", e.toString()), this.setOption("image_quality", "custom")
  10083. }
  10084. setCustomFps(e, i) {
  10085. var s;
  10086. const o = e, a = S.fromPartial({custom_fps: o}), t = h.fromPartial({option: a});
  10087. (s = this._ws) == null || s.sendMessage({misc: t}), this._lastSendFps = o, i && this.setOption("custom-fps", e.toString())
  10088. }
  10089. sendNote(e, i) {
  10090. let o = i;
  10091. fetch(e, {
  10092. method: "POST",
  10093. headers: {"Content-Type": "application/json"},
  10094. body: JSON.stringify({id: this._id, session_id: this._sessionId, note: o})
  10095. }).then(a => {
  10096. if (!a.ok) throw new Error(a.statusText);
  10097. return a.text()
  10098. }).then(a => {
  10099. console.log("Send note response:", a)
  10100. }).catch(a => {
  10101. console.error("Failed to send note:", a)
  10102. })
  10103. }
  10104. getPlatform() {
  10105. var e;
  10106. return ((e = this._peerInfo) == null ? void 0 : e.platform) || ""
  10107. }
  10108. async handleFileResponse(e) {
  10109. var i, o;
  10110. if (e.dir) {
  10111. let a = e.dir, t = a.entries;
  10112. if (!b4() && this.getPeerPlatform() == "Windows") for (let s = 0; s < t.length; s++) t[s].name = t[s].name.replace(/\\/g, "/");
  10113. Qi(a.id, t, a.path, !1, !1), this._writeJobs.forEach(s => {
  10114. s.id == a.id && (s.files = t)
  10115. }), this._removeJobs[a.id] && (this._removeJobs[a.id].files = t)
  10116. } else if (e.block) {
  10117. const a = e.block, t = this._writeJobs.find(s => s.id == a.id);
  10118. if (t) try {
  10119. await t.write(a, () => {
  10120. console.log(`cancel job ${t.id} due to write failed`), this.cancelJob(t.id)
  10121. })
  10122. } catch (s) {
  10123. console.log("write file failed", s)
  10124. }
  10125. this.update_jobs_status()
  10126. } else if (e.digest) {
  10127. const a = e.digest;
  10128. if (a.is_upload) {
  10129. const t = this._readJobs.find(s => s.id == a.id);
  10130. if (t) {
  10131. const s = t.read_digest(a);
  10132. s && ((i = this._ws) == null || i.sendMessage(s))
  10133. }
  10134. } else {
  10135. const t = this._writeJobs.find(s => s.id == a.id);
  10136. if (t) {
  10137. const s = t.write_digest(a);
  10138. s && ((o = this._ws) == null || o.sendMessage(s))
  10139. }
  10140. }
  10141. } else if (e.done) {
  10142. const a = e.done, t = this._writeJobs.find(l => l.id == a.id);
  10143. let s;
  10144. t && (t.write_done(a), s = t.job_error(), this._writeJobs = this._writeJobs.filter(l => l.id != a.id)), this.handle_job_status(a.id, a.file_num, s)
  10145. } else if (e.error) {
  10146. const a = e.error;
  10147. this._writeJobs = this._writeJobs.filter(t => t.id != a.id), this.handle_job_status(a.id, a.file_num, a.error)
  10148. }
  10149. }
  10150. readRemoteDir(e) {
  10151. var i;
  10152. try {
  10153. const o = JSON.parse(e),
  10154. a = T.fromPartial({read_dir: hu.fromPartial({path: o.path, include_hidden: o.include_hidden})});
  10155. (i = this._ws) == null || i.sendMessage({file_action: a})
  10156. } catch (o) {
  10157. console.error("Failed to read remote dir:", o)
  10158. }
  10159. }
  10160. async sendFiles(e) {
  10161. var i, o;
  10162. try {
  10163. const a = JSON.parse(e), {
  10164. id: t,
  10165. path: s,
  10166. to: l,
  10167. file_num: E,
  10168. include_hidden: c,
  10169. is_remote: C,
  10170. is_dir: D
  10171. } = a, B = Q((i = this._peerInfo) == null ? void 0 : i.version) >= Q("1.1.10");
  10172. if (C) {
  10173. this._writeJobs.push(lu.newWrite(t, s, l, E, c, C, [], B, D));
  10174. const m = an(t, s, E, c);
  10175. (o = this._ws) == null || o.sendMessage({file_action: m})
  10176. }
  10177. } catch (a) {
  10178. console.error("Failed to send files:", a)
  10179. }
  10180. }
  10181. async sendLocalFiles(e) {
  10182. var i;
  10183. try {
  10184. const o = JSON.parse(e), {
  10185. handle_index: a,
  10186. id: t,
  10187. path: s,
  10188. to: l,
  10189. file_num: E,
  10190. include_hidden: c,
  10191. is_remote: C
  10192. } = o, D = Q((i = this._peerInfo) == null ? void 0 : i.version) >= Q("1.1.10");
  10193. if (!C) try {
  10194. let B = this._fileHandles[a];
  10195. if (!B) throw new Error("Failed to get file handle");
  10196. let m = [], f = [];
  10197. if (B instanceof FileSystemFileHandle) {
  10198. let y = await B.getFile();
  10199. m = [W.fromPartial({
  10200. size: y.size,
  10201. entry_type: 4,
  10202. modified_time: Math.floor(y.lastModified / 1e3)
  10203. })], f = [B]
  10204. } else {
  10205. let y = await zt(B, "");
  10206. m = y.map(nu => nu.entry), f = y.map(nu => nu.handle)
  10207. }
  10208. let R = lu.newRead(t, s, l, E, c, C, m, D, f);
  10209. Qi(t, m, s, !C, !0), this._readJobs.push(R), this._ftTimer || (this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), Yi));
  10210. let I = [...m];
  10211. if (b4() && this.getPeerPlatform() != "Windows") for (let y = 0; y < I.length; y++) I[y].name = I[y].name.replace(/\\/g, "/");
  10212. this.sendMessage({file_action: En(t, l, E, I, R.total_size)})
  10213. } catch (B) {
  10214. console.error("Failed to send files:", B), this.handle_job_status(t, -1, (B != null ? B : "Failed to send files").toString())
  10215. }
  10216. } catch (o) {
  10217. console.error("Failed to send files:", o)
  10218. }
  10219. }
  10220. async readJobTimerCallback() {
  10221. let e = await An(this._readJobs, this.sendMessage.bind(this));
  10222. this._readJobs = this._readJobs.filter(i => !e.includes(i.id)), this.update_jobs_status(), this._readJobs.length == 0 ? (clearTimeout(this._ftTimer), this._ftTimer = void 0) : this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), Yi)
  10223. }
  10224. update_jobs_status() {
  10225. const e = new Date().getTime() - this._last_update_jobs_ms;
  10226. e >= 1e3 && (this._readJobs.forEach(i => {
  10227. i.update_job_status(e)
  10228. }), this._writeJobs.forEach(i => {
  10229. i.update_job_status(e)
  10230. }), this._last_update_jobs_ms = new Date().getTime())
  10231. }
  10232. handle_job_status(e, i, o) {
  10233. var a;
  10234. if (this._removeJobs[e] && this._removeJobs[e].no_confirm) {
  10235. const t = this._removeJobs[e].files;
  10236. if (i + 1 < t.length) {
  10237. const s = this._removeJobs[e].path + this._removeJobs[e].sep + t[i + 1].name;
  10238. if ((a = this._ws) == null || a.sendMessage({file_action: Gi(e, s, i + 1, this._removeJobs[e].is_remote)}), new Date().getTime() - this._removeJobs[e].last_update_job_status >= 1e3) this._removeJobs[e].last_update_job_status = new Date().getTime(); else return
  10239. } else delete this._removeJobs[e], console.log("remove jobs:", this._removeJobs)
  10240. }
  10241. o ? le(e, o, i) : Dn(e, i)
  10242. }
  10243. cancelJob(e) {
  10244. var o;
  10245. (o = this._ws) == null || o.sendMessage({file_action: rn(e)});
  10246. let i = this._writeJobs.find(a => a.id == e);
  10247. i && i.remove_download_file(), this._writeJobs = this._writeJobs.filter(a => a.id != e), this._readJobs = this._readJobs.filter(a => a.id != e), delete this._removeJobs[e]
  10248. }
  10249. removeAllEmptyDirs(e) {
  10250. var i;
  10251. try {
  10252. const o = JSON.parse(e);
  10253. (i = this._ws) == null || i.sendMessage({file_action: sn(o.id, o.path)})
  10254. } catch (o) {
  10255. console.error("Failed to remove all empty dirs:", o)
  10256. }
  10257. }
  10258. removeFile(e) {
  10259. var i;
  10260. try {
  10261. const o = JSON.parse(e), {id: a, path: t, file_num: s, is_remote: l} = o;
  10262. l && ((i = this._ws) == null || i.sendMessage({file_action: Gi(a, t, s, l)}))
  10263. } catch (o) {
  10264. console.error("Failed to remove files:", o)
  10265. }
  10266. }
  10267. readDirToRemoveRecursive(e) {
  10268. var i;
  10269. try {
  10270. const o = JSON.parse(e), {id: a, path: t, is_remote: s, show_hidden: l} = o;
  10271. if (s) {
  10272. (i = this._ws) == null || i.sendMessage({file_action: on(a, t, l)});
  10273. const E = (c, C) => (c ? C === "Windows" : b4()) ? "\\" : "/";
  10274. this._removeJobs[a] = {
  10275. path: t,
  10276. files: [],
  10277. no_confirm: !1,
  10278. is_remote: s,
  10279. sep: E(s, this.getPeerPlatform()),
  10280. last_update_job_status: new Date().getTime()
  10281. }
  10282. }
  10283. } catch (o) {
  10284. console.error("Failed to read dir to remove recursive:", o)
  10285. }
  10286. }
  10287. createDir(e) {
  10288. var i;
  10289. try {
  10290. const o = JSON.parse(e), {id: a, path: t, is_remote: s} = o;
  10291. s && ((i = this._ws) == null || i.sendMessage({file_action: nn(a, t)}))
  10292. } catch (o) {
  10293. console.error("Failed to create dir:", o)
  10294. }
  10295. }
  10296. renameFile(e) {
  10297. var i;
  10298. try {
  10299. const o = JSON.parse(e), {id: a, path: t, new_name: s, is_remote: l} = o;
  10300. l && ((i = this._ws) == null || i.sendMessage({file_action: ln(a, t, s)}))
  10301. } catch (o) {
  10302. console.error("Failed to rename file:", o)
  10303. }
  10304. }
  10305. async seletFiles(e) {
  10306. await Bn(e, (i, o) => {
  10307. this._fileHandles[i] = o
  10308. })
  10309. }
  10310. async handleFileAction(e) {
  10311. if (e.send_confirm) {
  10312. const i = e.send_confirm, o = this._readJobs.find(a => a.id == i.id);
  10313. o && o.confirm(i)
  10314. }
  10315. }
  10316. async confirmOverrideFile(e) {
  10317. try {
  10318. const i = JSON.parse(e), {id: o, file_num: a, need_override: t, remember: s, is_upload: l} = i;
  10319. if (l) {
  10320. const E = this._readJobs.find(c => c.id == o);
  10321. E && (s && (E.default_overwrite_strategy = t), E.confirm(cu.fromPartial({
  10322. id: o,
  10323. file_num: a,
  10324. offset_blk: t ? 0 : void 0,
  10325. skip: t ? void 0 : !0
  10326. })))
  10327. }
  10328. } catch (i) {
  10329. console.error("Failed to confirm override file:", i)
  10330. }
  10331. }
  10332. sendChat(e) {
  10333. const i = vu.fromPartial({text: e}), o = h.fromPartial({chat_message: i});
  10334. this.sendMessage({misc: o})
  10335. }
  10336. changeResolution(e) {
  10337. var i;
  10338. try {
  10339. const o = JSON.parse(e), a = v.fromPartial({width: o.width, height: o.height});
  10340. let t;
  10341. this._peerInfo && Q(this._peerInfo.version) >= Q("1.2.4") ? t = h.fromPartial({
  10342. change_display_resolution: Nu.fromPartial({
  10343. display: o.display,
  10344. resolution: a
  10345. })
  10346. }) : t = h.fromPartial({change_resolution: a}), (i = this._ws) == null || i.sendMessage({misc: t}), this._lastChangeDisplay = {
  10347. display: o.display,
  10348. width: o.width,
  10349. height: o.height,
  10350. time: new Date().getTime()
  10351. }
  10352. } catch (o) {
  10353. console.error("Failed to change resolution:", o)
  10354. }
  10355. }
  10356. setCustomResolution(e) {
  10357. var a, t;
  10358. const i = (s, l) => {
  10359. const E = s.toString(), c = this.loadConfig();
  10360. c.custom_resolutions || (c.custom_resolutions = {}), l ? c.custom_resolutions[E] = {
  10361. w: l[0],
  10362. h: l[1]
  10363. } : delete c.custom_resolutions[E], this.saveConfig(c)
  10364. }, o = () => {
  10365. var s, l, E;
  10366. return ((s = this._lastChangeDisplay) == null ? void 0 : s.display) == e.display && ((l = this._lastChangeDisplay) == null ? void 0 : l.width) == e.width && ((E = this._lastChangeDisplay) == null ? void 0 : E.height) == e.height && new Date().getTime() - this._lastChangeDisplay.time < 15e3
  10367. };
  10368. if (e.width == ((a = e.original_resolution) == null ? void 0 : a.width) && e.height == ((t = e.original_resolution) == null ? void 0 : t.height)) i(e.display, void 0); else {
  10369. const s = this._lastChangeDisplay;
  10370. if ((s == null ? void 0 : s.display) == e.display) {
  10371. const l = o() ? [e.width, e.height] : void 0;
  10372. i(e.display, l)
  10373. }
  10374. }
  10375. }
  10376. getCustomResolution(e) {
  10377. const o = this.loadConfig().custom_resolutions;
  10378. if (o) {
  10379. const a = o[e.toString()];
  10380. if (a && a.w && a.h) return [a.w, a.h]
  10381. }
  10382. }
  10383. tryChangeInitResolution(e) {
  10384. const i = this.getCustomResolution(e);
  10385. i && this.changeResolution(JSON.stringify({display: e, width: i[0], height: i[1]}))
  10386. }
  10387. setMultipleWindowsSession(e) {
  10388. let i = [];
  10389. e.forEach(o => {
  10390. let a = {};
  10391. a.sid = o.sid.toString(), a.name = o.name, i.push(a)
  10392. }), F("set_multiple_windows_session", {windows_sessions: JSON.stringify(i)})
  10393. }
  10394. sendSelectedSessionId(e) {
  10395. var o, a;
  10396. const i = parseInt(e);
  10397. if (isNaN(i)) console.error("selected invalid sid: ", e); else {
  10398. this._selectedWindowsSessionId = i;
  10399. const t = h.fromPartial({selected_sid: i});
  10400. (o = this._ws) == null || o.sendMessage({misc: t});
  10401. const s = this._peerInfo;
  10402. s && ((a = s.windows_sessions) == null ? void 0 : a.current_sid) == i && (this._isFileTransfer ? s.username || this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.") : this.msgbox("success", "Successful", "Connected, waiting for image..."))
  10403. }
  10404. }
  10405. }
  10406. function S4(u = !1) {
  10407. const e = A.getItem("custom-rendezvous-server");
  10408. return z4(e || Rt, u)
  10409. }
  10410. function z4(u, e = !1, i = 0) {
  10411. const p = vn() ? "wss://" : "ws://"
  10412. const domain = uriDomain(u)
  10413. const uriport = uriPort(u)
  10414. if (vn() && (!uriport)) {
  10415. return p + domain + "/ws/" + (e ? "relay" : "id");
  10416. }
  10417. if (uriport) {
  10418. const a = parseInt(uriport);
  10419. u = domain + ":" + (a + (e ? i || 3 : 2))
  10420. } else u += ":" + (Pt + (e ? 3 : 2));
  10421. return p + u
  10422. }
  10423. function vn() {
  10424. return window.location.protocol === "https:"
  10425. }
  10426. function uriDomain(u) {
  10427. return u.indexOf(":") > 0 ? u.split(":")[0] : u
  10428. }
  10429. function uriPort(u) {
  10430. return u.indexOf(":") > 0 ? u.split(":")[1] : ''
  10431. }
  10432. const $i = (u, e, i) => e && u.type == "SharedAb" ? Z(Gu([u.value, i.salt])) === Z(e) : !1,
  10433. ut = (u, e) => e && u.type == "PersonalAb" ? Z(u.value) === Z(e) : !1;
  10434. function gn() {
  10435. return S4()
  10436. }
  10437. function et(u, e) {
  10438. he("callback_query_onlines", {onlines: u.join(","), offlines: e.join(",")})
  10439. }
  10440. async function hn(u) {
  10441. let e = [];
  10442. try {
  10443. e = JSON.parse(u)
  10444. } catch (a) {
  10445. console.error("Failed to query onlines, ", a);
  10446. return
  10447. }
  10448. if (e.length === 0) return;
  10449. const i = gn(), o = new I4(i, !0, "query onlines");
  10450. try {
  10451. await o.open();
  10452. const a = Hu.fromPartial({id: T4(), peers: e});
  10453. o.sendRendezvous({online_request: a})
  10454. } catch (a) {
  10455. console.error("Failed to query onlines, ", a), et([], e), o.close();
  10456. return
  10457. }
  10458. for (let a = 0; a < 2; a++) {
  10459. const t = await yo(o, 3e3);
  10460. if (!t || (t == null ? void 0 : t.key_exchange) || (t == null ? void 0 : t.online_response) === void 0) continue;
  10461. const s = t.online_response.states;
  10462. let l = [], E = [];
  10463. for (let c = 0; c < e.length; c++) {
  10464. const C = 1 << 7 - c % 8;
  10465. (s[Math.floor(c / 8)] & C) === C ? l.push(e[c]) : E.push(e[c])
  10466. }
  10467. et(l, E), o.close();
  10468. return
  10469. }
  10470. o.close(), console.error("Failed to query online states, no online response")
  10471. }
  10472. window.curConn = void 0;
  10473. window.isMobile = () => /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4));
  10474. const ge = ft(), Xu = ge === Z4, V4 = ge === Q4, Zu = ge === Ce;
  10475. function fn() {
  10476. return !isMobile()
  10477. }
  10478. function Tt(u, e, i, o) {
  10479. if (!(!u || u == "error" && !i)) {
  10480. i.toLowerCase();
  10481. var a = ao(u, e, i) ? "true" : "";
  10482. onGlobalEvent(JSON.stringify({
  10483. name: "msgbox",
  10484. type: u,
  10485. title: e,
  10486. text: i,
  10487. link: o != null ? o : "",
  10488. hasRetry: a
  10489. }))
  10490. }
  10491. }
  10492. function xn(u, e, i) {
  10493. onGlobalEvent(JSON.stringify({name: "toast", type: u, text: e, dur_msec: i}))
  10494. }
  10495. function jt(u) {
  10496. var e = {};
  10497. for (const [i, o] of Object.entries(u)) !i || (o instanceof String || typeof o == "string" ? e[i] = o : o instanceof Uint8Array ? e[i] = "[" + o.toString() + "]" : e[i] = JSON.stringify(o));
  10498. return e
  10499. }
  10500. function F(u, e) {
  10501. e = jt(e), e.name = u, onGlobalEvent(JSON.stringify(e))
  10502. }
  10503. function Ee() {
  10504. var e;
  10505. ((e = De("input-source")) != null ? e : Li) === Li ? Lo() : se()
  10506. }
  10507. function he(u, e) {
  10508. e = jt(e), e.name = u, onRegisteredEvent(JSON.stringify(e))
  10509. }
  10510. function de(u, e) {
  10511. onRgba(u, e)
  10512. }
  10513. function fe(u) {
  10514. window.curConn = u
  10515. }
  10516. function u0() {
  10517. return window.curConn
  10518. }
  10519. async function Nt() {
  10520. await curConn.start()
  10521. }
  10522. function xe() {
  10523. var u;
  10524. (u = u0()) == null || u.close(), fe(void 0)
  10525. }
  10526. function Ot() {
  10527. var e;
  10528. (e = window.curConn) == null || e.close();
  10529. const u = new It;
  10530. return fe(u), u
  10531. }
  10532. let q;
  10533. async function Mt() {
  10534. try {
  10535. q || (await P4.ready, q = P4)
  10536. } catch (u) {
  10537. console.error("Failed to init sodium: " + u.message)
  10538. }
  10539. }
  10540. function Lt() {
  10541. return q
  10542. }
  10543. async function it(u, e) {
  10544. return await Mt(), typeof e == "string" && (e = Ut(e)), q.crypto_sign_open(u, e)
  10545. }
  10546. function Ut(u) {
  10547. return q.from_base64(u, q.base64_variants.ORIGINAL)
  10548. }
  10549. function yn(u) {
  10550. return q.to_base64(u, q.base64_variants.ORIGINAL)
  10551. }
  10552. function bn() {
  10553. const u = q.crypto_box_keypair(), e = u.privateKey, i = u.publicKey;
  10554. return [e, i]
  10555. }
  10556. function wn() {
  10557. return q.crypto_secretbox_keygen()
  10558. }
  10559. function Sn(u, e, i) {
  10560. const o = Uint8Array.from(Array(24).fill(0));
  10561. return q.crypto_box_easy(u, o, e, i)
  10562. }
  10563. function X4(u) {
  10564. for (var e = Array(24).fill(0), i = 0; i < e.length && u > 0; i++) {
  10565. var o = u & 255;
  10566. e[i] = o, u = (u - o) / 256
  10567. }
  10568. return Uint8Array.from(e)
  10569. }
  10570. function tt(u, e, i) {
  10571. return q.crypto_secretbox_easy(u, X4(e), i)
  10572. }
  10573. function zn(u, e, i) {
  10574. return q.crypto_secretbox_open_easy(u, X4(e), i)
  10575. }
  10576. window.setByName = (u, e) => {
  10577. switch (u) {
  10578. case"connect":
  10579. Ot(), Nt();
  10580. break;
  10581. case"login":
  10582. e = JSON.parse(e), curConn.handle_login_from_ui(e.os_username, e.os_password, e.password, e.remember);
  10583. break;
  10584. case"close":
  10585. xe();
  10586. break;
  10587. case"refresh":
  10588. curConn.refresh();
  10589. break;
  10590. case"reconnect":
  10591. curConn == null || curConn.reconnect();
  10592. break;
  10593. case"toggle_virtual_display":
  10594. curConn.toggleVirtualDisplay(e);
  10595. break;
  10596. case"toggle_privacy_mode":
  10597. curConn.togglePrivacyMode(e);
  10598. break;
  10599. case"image_quality":
  10600. curConn.setImageQuality(e);
  10601. break;
  10602. case"custom_image_quality":
  10603. curConn.setCustomImageQuality(e);
  10604. break;
  10605. case"custom-fps":
  10606. curConn.setCustomFps(e, !0);
  10607. break;
  10608. case"lock_screen":
  10609. curConn.lockScreen();
  10610. break;
  10611. case"ctrl_alt_del":
  10612. curConn.ctrlAltDel();
  10613. break;
  10614. case"switch_display":
  10615. curConn.switchDisplay(e);
  10616. break;
  10617. case"remove_peer":
  10618. ro(e);
  10619. break;
  10620. case"input_key":
  10621. e = JSON.parse(e), curConn.inputKey(e.name, e.down == "true", e.press == "true", e.alt == "true", e.ctrl == "true", e.shift == "true", e.command == "true");
  10622. break;
  10623. case"input_string":
  10624. curConn.inputString(e);
  10625. break;
  10626. case"flutter_key_event":
  10627. e = JSON.parse(e), Uo(curConn, e.usb_hid, e.down == "true", e.lock_modes);
  10628. break;
  10629. case"send_mouse":
  10630. Pn(e);
  10631. break;
  10632. case"send_2fa":
  10633. curConn == null || curConn.send2fa(e);
  10634. break;
  10635. case"option":
  10636. e = JSON.parse(e), A.setItem(e.name, e.value);
  10637. break;
  10638. case"options":
  10639. e = JSON.parse(e);
  10640. for (const [o, a] of Object.entries(a)) A.setItem(o, a);
  10641. break;
  10642. case"option:local": {
  10643. let o = JSON.parse(e);
  10644. if (o.name == 'access_token' && o.value) {
  10645. getServerConf(o.value)
  10646. }
  10647. At(o.name, o.value), o.name === "input-source" && Ee(), o.name == "lang" && Fo()
  10648. }
  10649. break;
  10650. case"option:flutter:local":
  10651. e = JSON.parse(e), co(e.name, e.value);
  10652. break;
  10653. case"option:flutter:peer":
  10654. e = JSON.parse(e), curConn.setFlutterUiOption(e.name, e.value);
  10655. break;
  10656. case"option:user:default":
  10657. Ln(e);
  10658. break;
  10659. case"option:session":
  10660. e = JSON.parse(e), curConn.setOption(e.name, e.value);
  10661. break;
  10662. case"option:peer":
  10663. try {
  10664. e = JSON.parse(e), Bt(e.id, e.name, e.value)
  10665. } catch (o) {
  10666. console.error('Failed to set peer option: "' + e + '", ' + o.message)
  10667. }
  10668. break;
  10669. case"option:toggle":
  10670. return curConn.toggleOption(e);
  10671. case"input_os_password":
  10672. curConn.inputOsPassword(e);
  10673. break;
  10674. case"session_add_sync":
  10675. return Vn(e);
  10676. case"session_start":
  10677. qn();
  10678. break;
  10679. case"session_close":
  10680. Kn();
  10681. break;
  10682. case"elevate_direct":
  10683. curConn.elevateDirect();
  10684. break;
  10685. case"elevate_with_logon":
  10686. curConn.elevateWithLogon(e);
  10687. break;
  10688. case"peer_exists":
  10689. return !!Cu()[e];
  10690. case"restart":
  10691. curConn.restart();
  10692. break;
  10693. case"fav":
  10694. return A.setItem("fav", e);
  10695. case"query_onlines":
  10696. hn(e);
  10697. break;
  10698. case"change_prefer_codec":
  10699. curConn.changePreferCodec(e);
  10700. break;
  10701. case"cursor":
  10702. On(e);
  10703. break;
  10704. case"enter_or_leave":
  10705. curConn == null || curConn.enterOrLeave(e);
  10706. break;
  10707. case"fullscreen":
  10708. e == "Y" ? Jn() : Gn();
  10709. break;
  10710. case"send_note":
  10711. const i = qt("conn");
  10712. i && (curConn == null || curConn.sendNote(i, e));
  10713. break;
  10714. case"read_remote_dir":
  10715. curConn == null || curConn.readRemoteDir(e);
  10716. break;
  10717. case"send_files":
  10718. curConn == null || curConn.sendFiles(e);
  10719. break;
  10720. case"send_local_files":
  10721. curConn == null || curConn.sendLocalFiles(e);
  10722. break;
  10723. case"cancel_job":
  10724. curConn == null || curConn.cancelJob(e);
  10725. break;
  10726. case"remove_all_empty_dirs":
  10727. curConn == null || curConn.removeAllEmptyDirs(e);
  10728. break;
  10729. case"remove_file":
  10730. curConn == null || curConn.removeFile(e);
  10731. break;
  10732. case"create_dir":
  10733. curConn == null || curConn.createDir(e);
  10734. break;
  10735. case"rename_file":
  10736. curConn == null || curConn.renameFile(e);
  10737. break;
  10738. case"read_dir_to_remove_recursive":
  10739. curConn == null || curConn.readDirToRemoveRecursive(e);
  10740. break;
  10741. case"select_files":
  10742. curConn == null || curConn.seletFiles(e);
  10743. break;
  10744. case"confirm_override_file":
  10745. curConn == null || curConn.confirmOverrideFile(e);
  10746. break;
  10747. case"send_chat":
  10748. curConn == null || curConn.sendChat(e);
  10749. break;
  10750. case"load_ab":
  10751. Xn();
  10752. break;
  10753. case"save_ab":
  10754. Co(e);
  10755. break;
  10756. case"clear_ab":
  10757. po();
  10758. break;
  10759. case"load_group":
  10760. Yn();
  10761. break;
  10762. case"save_group":
  10763. Do(e);
  10764. break;
  10765. case"clear_group":
  10766. Ao();
  10767. break;
  10768. case"change_resolution":
  10769. curConn == null || curConn.changeResolution(e);
  10770. break;
  10771. case"selected_sid":
  10772. curConn == null || curConn.sendSelectedSessionId(e);
  10773. break
  10774. }
  10775. };
  10776. function Pn(u) {
  10777. if (!curConn) return;
  10778. let e = 0;
  10779. switch (u = JSON.parse(u), u.type) {
  10780. case"down":
  10781. e = Qa;
  10782. break;
  10783. case"up":
  10784. e = Xa;
  10785. break;
  10786. case"wheel":
  10787. e = Wi;
  10788. break;
  10789. case"trackpad":
  10790. e = Vi;
  10791. break
  10792. }
  10793. switch (u.buttons) {
  10794. case"left":
  10795. e |= g4 << 3;
  10796. break;
  10797. case"right":
  10798. e |= h4 << 3;
  10799. break;
  10800. case"wheel":
  10801. e |= Ya << 3;
  10802. break;
  10803. case"back":
  10804. e |= $a << 3;
  10805. break;
  10806. case"forward":
  10807. e |= uo << 3;
  10808. break
  10809. }
  10810. let i = parseInt(u.x || "0"), o = parseInt(u.y || "0");
  10811. (e == Wi || e == Vi) && curConn.getOption("reverse_mouse_wheel") == "Y" && (i = -i, o = -o);
  10812. const a = (e & g4 << 3) > 0 ? 1 : 0, t = (e & h4 << 3) > 0 ? 1 : 0;
  10813. a ^ t && curConn.getToggleOption("swap-left-right-mouse") && (a ? e = e & ~(g4 << 3) | h4 << 3 : e = e & ~(h4 << 3) | g4 << 3), curConn.inputMouse(e, i, o, u.alt == "true", u.ctrl == "true", u.shift == "true", u.command == "true")
  10814. }
  10815. window.getByName = (u, e) => {
  10816. let i = Rn(u, e);
  10817. return typeof i == "string" || i instanceof String ? i : i == null || i == null ? "" : JSON.stringify(i)
  10818. };
  10819. function Rn(u, e) {
  10820. var o, a, t, s;
  10821. switch (u) {
  10822. case"remember":
  10823. return curConn.getRemember();
  10824. case"option":
  10825. return A.getItem(e);
  10826. case"options":
  10827. const l = ["custom-rendezvous-server", "relay-server", "api-server", "key"], E = {};
  10828. return l.forEach(C => {
  10829. const D = A.getItem(C);
  10830. D && (E[C] = D)
  10831. }), JSON.stringify(E);
  10832. case"option:local":
  10833. const res = De(e) || ""
  10834. if (e == 'access_token' && res) {
  10835. getServerConf(res)
  10836. }
  10837. return res;
  10838. case"option:flutter:local":
  10839. return Eo(e) || "";
  10840. case"option:flutter:peer":
  10841. return curConn.getFlutterUiOption(e) || "";
  10842. case"image_quality":
  10843. return curConn.getImageQuality();
  10844. case"translate":
  10845. return e = JSON.parse(e), _o(e.locale, e.text);
  10846. case"option:user:default":
  10847. return $u(e);
  10848. case"option:session":
  10849. return curConn ? curConn.getOption(e) : $u(e);
  10850. case"option:peer":
  10851. try {
  10852. const C = JSON.parse(e);
  10853. return (o = lo(C.id, C.name)) != null ? o : $u(C.name)
  10854. } catch (C) {
  10855. return console.error('Failed to get peer option: "' + e + '", ' + C.message), ""
  10856. }
  10857. case"option:toggle":
  10858. return curConn == null ? void 0 : curConn.getToggleOption(e);
  10859. case"get_conn_status":
  10860. return curConn ? curConn.getStatus() : JSON.stringify({status_num: 0});
  10861. case"test_if_valid_server":
  10862. break;
  10863. case"version":
  10864. return ne;
  10865. case"load_recent_peers":
  10866. Un();
  10867. break;
  10868. case"load_fav_peers":
  10869. Wn();
  10870. break;
  10871. case"fav":
  10872. return (a = A.getItem("fav")) != null ? a : "[]";
  10873. case"load_recent_peers_sync":
  10874. return JSON.stringify({peers: JSON.stringify(be())});
  10875. case"api_server":
  10876. return Vt();
  10877. case"is_using_public_server":
  10878. return !A.getItem("custom-rendezvous-server");
  10879. case"get_version_number":
  10880. return Q(e);
  10881. case"audit_server":
  10882. return qt(e);
  10883. case"alternative_codecs":
  10884. return curConn.getAlternativeCodecs();
  10885. case"screen_info":
  10886. return JSON.stringify({
  10887. frame: {
  10888. l: window.screenX,
  10889. t: window.screenY,
  10890. r: window.screenX + window.innerWidth,
  10891. b: window.screenY + window.innerHeight
  10892. },
  10893. visibleFrame: {
  10894. l: window.screen.availLeft,
  10895. t: window.screen.availTop,
  10896. r: window.screen.availLeft + window.screen.availWidth,
  10897. b: window.screen.availTop + window.screen.availHeight
  10898. },
  10899. scaleFactor: window.devicePixelRatio
  10900. });
  10901. case"main_display":
  10902. return JSON.stringify({
  10903. w: window.screen.availWidth,
  10904. h: window.screen.availHeight,
  10905. scaleFactor: window.devicePixelRatio
  10906. });
  10907. case"langs":
  10908. var i = Object.entries(to).map(([C, D]) => [C, `${D} (${C})`]);
  10909. return i.sort((C, D) => C[0].localeCompare(D[0])), JSON.stringify(i);
  10910. case"build_date":
  10911. return no;
  10912. case"my_id":
  10913. return T4();
  10914. case"my_name":
  10915. return gt();
  10916. case"uuid":
  10917. return ht();
  10918. case"local_os":
  10919. return ft();
  10920. case"peer_has_password":
  10921. return ((t = (Cu()[e] || {}).password) != null ? t : "") !== "";
  10922. case"fullscreen":
  10923. return Zn() ? "Y" : "N";
  10924. case"platform":
  10925. return curConn.getPlatform();
  10926. case"enable_trusted_devices":
  10927. return (s = curConn == null ? void 0 : curConn.enableTrustedDevices()) != null && s ? "Y" : "N"
  10928. }
  10929. return ""
  10930. }
  10931. let ye = new Worker("./libopus.js?v=02816afa"), Wt;
  10932. function In(u, e) {
  10933. Wt = jn(u, e), ye.postMessage({channels: u, sampleRate: e})
  10934. }
  10935. function Tn(u) {
  10936. ye.postMessage(u, [u.buffer])
  10937. }
  10938. window.init = async () => {
  10939. try {
  10940. ye.onmessage = u => {
  10941. Wt.feed(u.data)
  10942. }, await Mt(), await ho(), await fa(), await O.init(), console.log("init done"), onInitFinished()
  10943. } catch (u) {
  10944. console.error("Failed to init: " + u.message), onInitFinished()
  10945. }
  10946. };
  10947. window.onunload = () => {
  10948. console.log("window close"), ya()
  10949. };
  10950. function jn(u, e) {
  10951. return new ua({channels: u, sampleRate: e, flushingTime: 2e3})
  10952. }
  10953. function Nn(u) {
  10954. if (window.clipboardData && window.clipboardData.setData) return window.clipboardData.setData("Text", u);
  10955. if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
  10956. var e = document.createElement("textarea");
  10957. e.textContent = u, e.style.position = "fixed", document.body.appendChild(e), e.select();
  10958. try {
  10959. return document.execCommand("copy")
  10960. } catch (i) {
  10961. console.warn("Copy to clipboard failed.", i)
  10962. } finally {
  10963. document.body.removeChild(e)
  10964. }
  10965. }
  10966. }
  10967. function Q(u) {
  10968. try {
  10969. let e = u.split("-"), i = 0;
  10970. if (e.length > 0) {
  10971. let o = 0;
  10972. for (let a of e[0].split(".")) o = parseInt(a) || 0, i = i * 1e3 + o;
  10973. i -= o, i += o * 10
  10974. }
  10975. return e.length > 1 && (i += parseInt(e[1]) || 0), i
  10976. } catch (e) {
  10977. return console.error('Failed to parse version number: "' + u + '" ' + e.message), 0
  10978. }
  10979. }
  10980. function On(u) {
  10981. let e = "auto";
  10982. if (u != "auto") try {
  10983. const t = JSON.parse(u);
  10984. if (!t.url) return;
  10985. e = `url(${t.url}) ${t.hotx} ${t.hoty}, auto`
  10986. } catch (t) {
  10987. console.error("Failed to set custom cursor: " + t.message);
  10988. return
  10989. }
  10990. for (var i = document.body, o = 0; o < i.children.length; o++) {
  10991. var a = i.children[o];
  10992. a.tagName == "FLUTTER-VIEW" && (a.style.cursor = e)
  10993. }
  10994. }
  10995. async function Mn() {
  10996. await P4.ready;
  10997. const u = P4.crypto_sign_keypair();
  10998. return {publicKey: u.publicKey, privateKey: u.privateKey}
  10999. }
  11000. function Ln(u) {
  11001. try {
  11002. const e = JSON.parse(u), i = JSON.parse(A.getItem("user-default-options")) || {};
  11003. i[e.name] = e.value, A.setItem("user-default-options", JSON.stringify(i))
  11004. } catch (e) {
  11005. console.error("Failed to set user default options: " + e.message)
  11006. }
  11007. }
  11008. function $u(u) {
  11009. var i, o, a;
  11010. const e = {
  11011. view_style: "original",
  11012. scroll_style: "scrollauto",
  11013. image_quality: "balanced",
  11014. "codec-preference": "auto",
  11015. custom_image_quality: "50",
  11016. "custom-fps": "30"
  11017. };
  11018. try {
  11019. return (o = (i = (JSON.parse(A.getItem("user-default-options")) || {})[u]) != null ? i : e[u]) != null ? o : ""
  11020. } catch (t) {
  11021. return console.error("Failed to get user default options: " + t.message), (a = e[u]) != null ? a : ""
  11022. }
  11023. }
  11024. function be() {
  11025. const u = [];
  11026. for (const [e, i] of Object.entries(Cu())) {
  11027. if (!e) continue;
  11028. const o = i.tm, a = i.info, t = {
  11029. id: e,
  11030. username: a.username || "",
  11031. hostname: a.hostname || "",
  11032. platform: a.platform || "",
  11033. alias: i.alias || ""
  11034. };
  11035. !o || !t || u.push([o, e, t])
  11036. }
  11037. return u.sort().reverse().map(e => e[2])
  11038. }
  11039. function Un() {
  11040. const u = be();
  11041. u && he("load_recent_peers", {peers: JSON.stringify(u)})
  11042. }
  11043. function Wn() {
  11044. var u;
  11045. try {
  11046. const e = (u = A.getItem("fav")) != null ? u : "[]", i = JSON.parse(e), o = be().filter(a => i.includes(a.id));
  11047. o && he("load_fav_peers", {peers: JSON.stringify(o)})
  11048. } catch (e) {
  11049. console.error("Failed to load fav peers: " + e.message)
  11050. }
  11051. }
  11052. function Vn(u) {
  11053. var e;
  11054. try {
  11055. const i = JSON.parse(u), o = i.id;
  11056. if (o) {
  11057. (e = window.curConn) == null || e.close();
  11058. const a = new It;
  11059. return a.setRemoteId(o), a.setSessionInfo(i), fe(a), At("last_remote_id", o), ""
  11060. } else return "No id found in session data " + u
  11061. } catch (i) {
  11062. return i.message
  11063. }
  11064. }
  11065. function qn(u) {
  11066. try {
  11067. if (!u0()) return;
  11068. Nt()
  11069. } catch (e) {
  11070. Tt("error", "Error", e.message, "")
  11071. }
  11072. }
  11073. function Kn(u) {
  11074. xe()
  11075. }
  11076. function Hn(u, e) {
  11077. function i(o) {
  11078. return /^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/.test(o)
  11079. }
  11080. if (i(u)) {
  11081. if (u.startsWith("[")) {
  11082. let o = u.split("]:");
  11083. if (o.length === 2) {
  11084. let a = parseInt(o[1]) || 0;
  11085. if (a > 0) return `${o[0]}]:${a + e}`
  11086. }
  11087. }
  11088. } else if (u.includes(":")) {
  11089. let o = u.split(":");
  11090. if (o.length === 2) {
  11091. let a = parseInt(o[1]) || 0;
  11092. if (a > 0) return `${o[0]}:${a + e}`
  11093. }
  11094. }
  11095. return u
  11096. }
  11097. function Vt() {
  11098. const u = A.getItem("api-server");
  11099. if (u) return u;
  11100. const e = A.getItem("custom-rendezvous-server");
  11101. if (e) {
  11102. let i = Hn(e, -2);
  11103. return i == e ? `http://${i}:${Pt - 2}` : `http://${i}`
  11104. }
  11105. return "https://admin.rustdesk.com"
  11106. }
  11107. function qt(u) {
  11108. if (!xt()) return "";
  11109. const e = Vt();
  11110. return !e || e.includes("rustdesk.com") ? "" : e + "/api/audit/" + u
  11111. }
  11112. function Kt(u, e, i) {
  11113. try {
  11114. H4.exports.ZstdCodec.run(a => {
  11115. var t = new a.Simple;
  11116. i(e ? u.map(s => t.compress(s, 3)) : t.compress(u, 3))
  11117. })
  11118. } catch (o) {
  11119. console.error("Compress failed: ", o)
  11120. }
  11121. }
  11122. function we(u, e, i) {
  11123. try {
  11124. H4.exports.ZstdCodec.run(o => {
  11125. var a = new o.Simple;
  11126. i(e ? u.map(t => a.decompress(t)) : a.decompress(u))
  11127. })
  11128. } catch (o) {
  11129. console.error("Decompress failed: ", o)
  11130. }
  11131. }
  11132. async function Ht(u, e) {
  11133. return new Promise((i, o) => {
  11134. try {
  11135. H4.exports.ZstdCodec.run(a => {
  11136. var t = new a.Simple;
  11137. i(t.compress(u, 3))
  11138. })
  11139. } catch (a) {
  11140. o(a)
  11141. }
  11142. })
  11143. }
  11144. async function Jt(u, e) {
  11145. return new Promise((i, o) => {
  11146. try {
  11147. H4.exports.ZstdCodec.run(a => {
  11148. var t = new a.Simple;
  11149. i(t.decompress(u))
  11150. })
  11151. } catch (a) {
  11152. o(a)
  11153. }
  11154. })
  11155. }
  11156. function Jn() {
  11157. const u = document.documentElement;
  11158. u.requestFullscreen ? u.requestFullscreen() : u.mozRequestFullScreen ? u.mozRequestFullScreen() : u.webkitRequestFullscreen ? u.webkitRequestFullscreen() : u.msRequestFullscreen && u.msRequestFullscreen()
  11159. }
  11160. function Gn() {
  11161. document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen()
  11162. }
  11163. function Zn() {
  11164. return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  11165. }
  11166. var at = !1;
  11167. function Qn() {
  11168. at || (console.log("listen fullscreen"), at = !0, document.addEventListener("fullscreenchange", () => onFullscreenChanged(!!document.fullscreenElement)), document.addEventListener("mozfullscreenchange", () => onFullscreenChanged(!!document.mozFullScreen)), document.addEventListener("webkitfullscreenchange", () => onFullscreenChanged(!!document.webkitFullscreenElement)), document.addEventListener("msfullscreenchange", () => onFullscreenChanged(!!document.msFullscreenElement)))
  11169. }
  11170. Qn();
  11171. async function Xn() {
  11172. try {
  11173. let u = await _t();
  11174. onLoadAbFinished(JSON.stringify(u))
  11175. } catch (u) {
  11176. console.error("Failed to load ab: " + u.message), onLoadAbFinished("")
  11177. }
  11178. }
  11179. async function Yn() {
  11180. try {
  11181. let u = await Bo();
  11182. onLoadGroupFinished(JSON.stringify(u))
  11183. } catch (u) {
  11184. console.error("Failed to load group: " + u.message), onLoadGroupFinished("")
  11185. }
  11186. }
  11187. const ot = document.querySelector("#app");
  11188. if (ot) {
  11189. let e = function (i, o, a) {
  11190. !u0() || (i == "input-password" ? (document.querySelector("div#status").style.display = "none", document.querySelector("div#password").style.display = "block") : i ? i == "error" ? (document.querySelector("div#status").style.display = "block", document.querySelector("div#canvas").style.display = "none", document.querySelector("div#text").innerHTML = '<div style="color: red; font-weight: bold;">' + a + "</div>") : (document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "block", document.querySelector("div#text").innerHTML = '<div style="font-weight: bold;">' + a + "</div>") : (document.querySelector("div#canvas").style.display = "block", document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "none"))
  11191. };
  11192. ot.innerHTML = `
  11193. <div id="connect" style="text-align: center"><table style="display: inline-block">
  11194. <tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
  11195. <tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
  11196. <tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
  11197. <tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
  11198. </table></div>
  11199. <div id="password" style="display: none;">
  11200. <input type="password" id="password" />
  11201. <button id="confirm" onclick="confirm()">Confirm</button>
  11202. <button id="cancel" onclick="cancel();">Cancel</button>
  11203. </div>
  11204. <div id="status" style="display: none;">
  11205. <div id="text" style="line-height: 2em"></div>
  11206. <button id="cancel" onclick="cancel();">Cancel</button>
  11207. </div>
  11208. <div id="canvas" style="display: none;">
  11209. <button id="cancel" onclick="cancel();">Cancel</button>
  11210. <canvas id="player"></canvas>
  11211. <canvas id="test-yuv-decoder-canvas"></canvas>
  11212. </div>
  11213. `;
  11214. let u;
  11215. window.init(), document.body.onload = () => {
  11216. const i = document.querySelector("#host");
  11217. i.value = A.getItem("custom-rendezvous-server");
  11218. const o = document.querySelector("#id");
  11219. o.value = A.getItem("id");
  11220. const a = document.querySelector("#key");
  11221. a.value = A.getItem("key"), u = YUVCanvas.attach(document.getElementById("player"))
  11222. }, window.connect = () => {
  11223. const i = document.querySelector("#host");
  11224. A.setItem("custom-rendezvous-server", i.value);
  11225. const o = document.querySelector("#id");
  11226. A.setItem("id", o.value);
  11227. const a = document.querySelector("#key");
  11228. A.setItem("key", a.value), (async () => {
  11229. const s = Ot();
  11230. s.setMsgbox(e), s.setDraw(l => {
  11231. de(l), u.drawFrame(l)
  11232. }), document.querySelector("div#status").style.display = "block", document.querySelector("div#connect").style.display = "none", document.querySelector("div#text").innerHTML = "Connecting ...", s.setPeerId(o.value), await s.start()
  11233. })()
  11234. }, window.cancel = () => {
  11235. xe(), document.querySelector("div#connect").style.display = "block", document.querySelector("div#password").style.display = "none", document.querySelector("div#status").style.display = "none", document.querySelector("div#canvas").style.display = "none"
  11236. }, window.confirm = () => {
  11237. const i = document.querySelector("input#password").value;
  11238. i && (document.querySelector("div#password").style.display = "none", u0().login(i))
  11239. }
  11240. }