index.js 462 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136
  1. import {getServerConf} from "./ljw.js?v=7"
  2. import {F as na, J as Oe, L as Ne, l as T4, m as r, s as oa, z as Z4} from "./vendor.js?v=0b990c6e";
  3. import {ids as langIds, lang} from './lang.js?v=7'
  4. var ta = Object.defineProperty;
  5. var aa = (u, e, i) => e in u ? ta(u, e, {enumerable: !0, configurable: !0, writable: !0, value: i}) : u[e] = i;
  6. var d = (u, e, i) => (aa(u, typeof e != "symbol" ? e + "" : e, i), i), ue = (u, e, i) => {
  7. if (!e.has(u)) throw TypeError("Cannot " + i)
  8. };
  9. var h = (u, e, i) => (ue(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. }, B4 = (u, e, i, o) => (ue(u, e, "write to private field"), o ? o.call(u, i) : e.set(u, i), i), Te = (u, e, i, o) => ({
  13. set _(a) {
  14. B4(u, e, a, i)
  15. }, get _() {
  16. return h(u, e, o)
  17. }
  18. }), je = (u, e, i) => (ue(u, e, "access private method"), i);
  19. const sa = 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. sa();
  38. var ae = (u => (u[u.I420 = 0] = "I420", u[u.I444 = 1] = "I444", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(ae || {});
  39. function la(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 Ea(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 D4 = (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))(D4 || {});
  65. function da(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 ca(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 j = (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))(j || {});
  101. function v4(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 j4(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 Ca(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 pa(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. var dt = (u => (u[u.Dir = 0] = "Dir", u[u.DirLink = 2] = "DirLink", u[u.DirDrive = 3] = "DirDrive", u[u.File = 4] = "File", u[u.FileLink = 5] = "FileLink", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(dt || {});
  578. function Da(u) {
  579. switch (u) {
  580. case 0:
  581. case"Dir":
  582. return 0;
  583. case 2:
  584. case"DirLink":
  585. return 2;
  586. case 3:
  587. case"DirDrive":
  588. return 3;
  589. case 4:
  590. case"File":
  591. return 4;
  592. case 5:
  593. case"FileLink":
  594. return 5;
  595. case-1:
  596. case"UNRECOGNIZED":
  597. default:
  598. return -1
  599. }
  600. }
  601. function Ba(u) {
  602. switch (u) {
  603. case 0:
  604. return "Dir";
  605. case 2:
  606. return "DirLink";
  607. case 3:
  608. return "DirDrive";
  609. case 4:
  610. return "File";
  611. case 5:
  612. return "FileLink";
  613. case-1:
  614. default:
  615. return "UNRECOGNIZED"
  616. }
  617. }
  618. var S4 = (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))(S4 || {});
  619. function ma(u) {
  620. switch (u) {
  621. case 0:
  622. case"NotSet":
  623. return 0;
  624. case 2:
  625. case"Low":
  626. return 2;
  627. case 3:
  628. case"Balanced":
  629. return 3;
  630. case 4:
  631. case"Best":
  632. return 4;
  633. case-1:
  634. case"UNRECOGNIZED":
  635. default:
  636. return -1
  637. }
  638. }
  639. function Aa(u) {
  640. switch (u) {
  641. case 0:
  642. return "NotSet";
  643. case 2:
  644. return "Low";
  645. case 3:
  646. return "Balanced";
  647. case 4:
  648. return "Best";
  649. case-1:
  650. default:
  651. return "UNRECOGNIZED"
  652. }
  653. }
  654. var t0 = (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))(t0 || {});
  655. function Fa(u) {
  656. switch (u) {
  657. case 0:
  658. case"Keyboard":
  659. return 0;
  660. case 2:
  661. case"Clipboard":
  662. return 2;
  663. case 3:
  664. case"Audio":
  665. return 3;
  666. case 4:
  667. case"File":
  668. return 4;
  669. case 5:
  670. case"Restart":
  671. return 5;
  672. case 6:
  673. case"Recording":
  674. return 6;
  675. case 7:
  676. case"BlockInput":
  677. return 7;
  678. case-1:
  679. case"UNRECOGNIZED":
  680. default:
  681. return -1
  682. }
  683. }
  684. function _a(u) {
  685. switch (u) {
  686. case 0:
  687. return "Keyboard";
  688. case 2:
  689. return "Clipboard";
  690. case 3:
  691. return "Audio";
  692. case 4:
  693. return "File";
  694. case 5:
  695. return "Restart";
  696. case 6:
  697. return "Recording";
  698. case 7:
  699. return "BlockInput";
  700. case-1:
  701. default:
  702. return "UNRECOGNIZED"
  703. }
  704. }
  705. var Au = (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))(Au || {});
  706. function va(u) {
  707. switch (u) {
  708. case 0:
  709. case"Auto":
  710. return 0;
  711. case 1:
  712. case"VP9":
  713. return 1;
  714. case 2:
  715. case"H264":
  716. return 2;
  717. case 3:
  718. case"H265":
  719. return 3;
  720. case 4:
  721. case"VP8":
  722. return 4;
  723. case 5:
  724. case"AV1":
  725. return 5;
  726. case-1:
  727. case"UNRECOGNIZED":
  728. default:
  729. return -1
  730. }
  731. }
  732. function ka(u) {
  733. switch (u) {
  734. case 0:
  735. return "Auto";
  736. case 1:
  737. return "VP9";
  738. case 2:
  739. return "H264";
  740. case 3:
  741. return "H265";
  742. case 4:
  743. return "VP8";
  744. case 5:
  745. return "AV1";
  746. case-1:
  747. default:
  748. return "UNRECOGNIZED"
  749. }
  750. }
  751. 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 || {});
  752. function tu(u) {
  753. switch (u) {
  754. case 0:
  755. case"NotSet":
  756. return 0;
  757. case 1:
  758. case"No":
  759. return 1;
  760. case 2:
  761. case"Yes":
  762. return 2;
  763. case-1:
  764. case"UNRECOGNIZED":
  765. default:
  766. return -1
  767. }
  768. }
  769. function au(u) {
  770. switch (u) {
  771. case 0:
  772. return "NotSet";
  773. case 1:
  774. return "No";
  775. case 2:
  776. return "Yes";
  777. case-1:
  778. default:
  779. return "UNRECOGNIZED"
  780. }
  781. }
  782. var A4 = (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))(A4 || {});
  783. function ga(u) {
  784. switch (u) {
  785. case 0:
  786. case"BlkStateUnknown":
  787. return 0;
  788. case 2:
  789. case"BlkOnSucceeded":
  790. return 2;
  791. case 3:
  792. case"BlkOnFailed":
  793. return 3;
  794. case 4:
  795. case"BlkOffSucceeded":
  796. return 4;
  797. case 5:
  798. case"BlkOffFailed":
  799. return 5;
  800. case-1:
  801. case"UNRECOGNIZED":
  802. default:
  803. return -1
  804. }
  805. }
  806. function ha(u) {
  807. switch (u) {
  808. case 0:
  809. return "BlkStateUnknown";
  810. case 2:
  811. return "BlkOnSucceeded";
  812. case 3:
  813. return "BlkOnFailed";
  814. case 4:
  815. return "BlkOffSucceeded";
  816. case 5:
  817. return "BlkOffFailed";
  818. case-1:
  819. default:
  820. return "UNRECOGNIZED"
  821. }
  822. }
  823. var ou = (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))(ou || {});
  824. function fa(u) {
  825. switch (u) {
  826. case 0:
  827. case"PrvStateUnknown":
  828. return 0;
  829. case 2:
  830. case"PrvOnByOther":
  831. return 2;
  832. case 3:
  833. case"PrvNotSupported":
  834. return 3;
  835. case 4:
  836. case"PrvOnSucceeded":
  837. return 4;
  838. case 5:
  839. case"PrvOnFailedDenied":
  840. return 5;
  841. case 6:
  842. case"PrvOnFailedPlugin":
  843. return 6;
  844. case 7:
  845. case"PrvOnFailed":
  846. return 7;
  847. case 8:
  848. case"PrvOffSucceeded":
  849. return 8;
  850. case 9:
  851. case"PrvOffByPeer":
  852. return 9;
  853. case 10:
  854. case"PrvOffFailed":
  855. return 10;
  856. case 11:
  857. case"PrvOffUnknown":
  858. return 11;
  859. case-1:
  860. case"UNRECOGNIZED":
  861. default:
  862. return -1
  863. }
  864. }
  865. function xa(u) {
  866. switch (u) {
  867. case 0:
  868. return "PrvStateUnknown";
  869. case 2:
  870. return "PrvOnByOther";
  871. case 3:
  872. return "PrvNotSupported";
  873. case 4:
  874. return "PrvOnSucceeded";
  875. case 5:
  876. return "PrvOnFailedDenied";
  877. case 6:
  878. return "PrvOnFailedPlugin";
  879. case 7:
  880. return "PrvOnFailed";
  881. case 8:
  882. return "PrvOffSucceeded";
  883. case 9:
  884. return "PrvOffByPeer";
  885. case 10:
  886. return "PrvOffFailed";
  887. case 11:
  888. return "PrvOffUnknown";
  889. case-1:
  890. default:
  891. return "UNRECOGNIZED"
  892. }
  893. }
  894. function Me() {
  895. return {data: new Uint8Array(0), key: !1, pts: 0}
  896. }
  897. const a0 = {
  898. encode(u, e = r.Writer.create()) {
  899. 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
  900. }, decode(u, e) {
  901. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  902. let o = e === void 0 ? i.len : i.pos + e;
  903. const a = Me();
  904. for (; i.pos < o;) {
  905. const t = i.uint32();
  906. switch (t >>> 3) {
  907. case 1:
  908. if (t !== 10) break;
  909. a.data = i.bytes();
  910. continue;
  911. case 2:
  912. if (t !== 16) break;
  913. a.key = i.bool();
  914. continue;
  915. case 3:
  916. if (t !== 24) break;
  917. a.pts = V(i.int64());
  918. continue
  919. }
  920. if ((t & 7) === 4 || t === 0) break;
  921. i.skipType(t & 7)
  922. }
  923. return a
  924. }, fromJSON(u) {
  925. return {
  926. data: n(u.data) ? R(u.data) : new Uint8Array(0),
  927. key: n(u.key) ? globalThis.Boolean(u.key) : !1,
  928. pts: n(u.pts) ? globalThis.Number(u.pts) : 0
  929. }
  930. }, toJSON(u) {
  931. const e = {};
  932. return u.data.length !== 0 && (e.data = I(u.data)), u.key !== !1 && (e.key = u.key), u.pts !== 0 && (e.pts = Math.round(u.pts)), e
  933. }, create(u) {
  934. return a0.fromPartial(u != null ? u : {})
  935. }, fromPartial(u) {
  936. var i, o, a;
  937. const e = Me();
  938. 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
  939. }
  940. };
  941. function Ue() {
  942. return {frames: []}
  943. }
  944. const k = {
  945. encode(u, e = r.Writer.create()) {
  946. for (const i of u.frames) a0.encode(i, e.uint32(10).fork()).ldelim();
  947. return e
  948. }, decode(u, e) {
  949. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  950. let o = e === void 0 ? i.len : i.pos + e;
  951. const a = Ue();
  952. for (; i.pos < o;) {
  953. const t = i.uint32();
  954. switch (t >>> 3) {
  955. case 1:
  956. if (t !== 10) break;
  957. a.frames.push(a0.decode(i, i.uint32()));
  958. continue
  959. }
  960. if ((t & 7) === 4 || t === 0) break;
  961. i.skipType(t & 7)
  962. }
  963. return a
  964. }, fromJSON(u) {
  965. return {frames: globalThis.Array.isArray(u == null ? void 0 : u.frames) ? u.frames.map(e => a0.fromJSON(e)) : []}
  966. }, toJSON(u) {
  967. var i;
  968. const e = {};
  969. return (i = u.frames) != null && i.length && (e.frames = u.frames.map(o => a0.toJSON(o))), e
  970. }, create(u) {
  971. return k.fromPartial(u != null ? u : {})
  972. }, fromPartial(u) {
  973. var i;
  974. const e = Ue();
  975. return e.frames = ((i = u.frames) == null ? void 0 : i.map(o => a0.fromPartial(o))) || [], e
  976. }
  977. };
  978. function Le() {
  979. return {compress: !1}
  980. }
  981. const o0 = {
  982. encode(u, e = r.Writer.create()) {
  983. return u.compress !== !1 && e.uint32(8).bool(u.compress), e
  984. }, decode(u, e) {
  985. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  986. let o = e === void 0 ? i.len : i.pos + e;
  987. const a = Le();
  988. for (; i.pos < o;) {
  989. const t = i.uint32();
  990. switch (t >>> 3) {
  991. case 1:
  992. if (t !== 8) break;
  993. a.compress = i.bool();
  994. continue
  995. }
  996. if ((t & 7) === 4 || t === 0) break;
  997. i.skipType(t & 7)
  998. }
  999. return a
  1000. }, fromJSON(u) {
  1001. return {compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1}
  1002. }, toJSON(u) {
  1003. const e = {};
  1004. return u.compress !== !1 && (e.compress = u.compress), e
  1005. }, create(u) {
  1006. return o0.fromPartial(u != null ? u : {})
  1007. }, fromPartial(u) {
  1008. var i;
  1009. const e = Le();
  1010. return e.compress = (i = u.compress) != null ? i : !1, e
  1011. }
  1012. };
  1013. function We() {
  1014. return {compress: !1, stride: 0}
  1015. }
  1016. const n0 = {
  1017. encode(u, e = r.Writer.create()) {
  1018. return u.compress !== !1 && e.uint32(8).bool(u.compress), u.stride !== 0 && e.uint32(16).int32(u.stride), e
  1019. }, decode(u, e) {
  1020. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1021. let o = e === void 0 ? i.len : i.pos + e;
  1022. const a = We();
  1023. for (; i.pos < o;) {
  1024. const t = i.uint32();
  1025. switch (t >>> 3) {
  1026. case 1:
  1027. if (t !== 8) break;
  1028. a.compress = i.bool();
  1029. continue;
  1030. case 2:
  1031. if (t !== 16) break;
  1032. a.stride = i.int32();
  1033. continue
  1034. }
  1035. if ((t & 7) === 4 || t === 0) break;
  1036. i.skipType(t & 7)
  1037. }
  1038. return a
  1039. }, fromJSON(u) {
  1040. return {
  1041. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  1042. stride: n(u.stride) ? globalThis.Number(u.stride) : 0
  1043. }
  1044. }, toJSON(u) {
  1045. const e = {};
  1046. return u.compress !== !1 && (e.compress = u.compress), u.stride !== 0 && (e.stride = Math.round(u.stride)), e
  1047. }, create(u) {
  1048. return n0.fromPartial(u != null ? u : {})
  1049. }, fromPartial(u) {
  1050. var i, o;
  1051. const e = We();
  1052. return e.compress = (i = u.compress) != null ? i : !1, e.stride = (o = u.stride) != null ? o : 0, e
  1053. }
  1054. };
  1055. function Ve() {
  1056. return {
  1057. vp9s: void 0,
  1058. rgb: void 0,
  1059. yuv: void 0,
  1060. h264s: void 0,
  1061. h265s: void 0,
  1062. vp8s: void 0,
  1063. av1s: void 0,
  1064. display: 0
  1065. }
  1066. }
  1067. const r0 = {
  1068. encode(u, e = r.Writer.create()) {
  1069. return u.vp9s !== void 0 && k.encode(u.vp9s, e.uint32(50).fork()).ldelim(), u.rgb !== void 0 && o0.encode(u.rgb, e.uint32(58).fork()).ldelim(), u.yuv !== void 0 && n0.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
  1070. }, decode(u, e) {
  1071. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1072. let o = e === void 0 ? i.len : i.pos + e;
  1073. const a = Ve();
  1074. for (; i.pos < o;) {
  1075. const t = i.uint32();
  1076. switch (t >>> 3) {
  1077. case 6:
  1078. if (t !== 50) break;
  1079. a.vp9s = k.decode(i, i.uint32());
  1080. continue;
  1081. case 7:
  1082. if (t !== 58) break;
  1083. a.rgb = o0.decode(i, i.uint32());
  1084. continue;
  1085. case 8:
  1086. if (t !== 66) break;
  1087. a.yuv = n0.decode(i, i.uint32());
  1088. continue;
  1089. case 10:
  1090. if (t !== 82) break;
  1091. a.h264s = k.decode(i, i.uint32());
  1092. continue;
  1093. case 11:
  1094. if (t !== 90) break;
  1095. a.h265s = k.decode(i, i.uint32());
  1096. continue;
  1097. case 12:
  1098. if (t !== 98) break;
  1099. a.vp8s = k.decode(i, i.uint32());
  1100. continue;
  1101. case 13:
  1102. if (t !== 106) break;
  1103. a.av1s = k.decode(i, i.uint32());
  1104. continue;
  1105. case 14:
  1106. if (t !== 112) break;
  1107. a.display = i.int32();
  1108. continue
  1109. }
  1110. if ((t & 7) === 4 || t === 0) break;
  1111. i.skipType(t & 7)
  1112. }
  1113. return a
  1114. }, fromJSON(u) {
  1115. return {
  1116. vp9s: n(u.vp9s) ? k.fromJSON(u.vp9s) : void 0,
  1117. rgb: n(u.rgb) ? o0.fromJSON(u.rgb) : void 0,
  1118. yuv: n(u.yuv) ? n0.fromJSON(u.yuv) : void 0,
  1119. h264s: n(u.h264s) ? k.fromJSON(u.h264s) : void 0,
  1120. h265s: n(u.h265s) ? k.fromJSON(u.h265s) : void 0,
  1121. vp8s: n(u.vp8s) ? k.fromJSON(u.vp8s) : void 0,
  1122. av1s: n(u.av1s) ? k.fromJSON(u.av1s) : void 0,
  1123. display: n(u.display) ? globalThis.Number(u.display) : 0
  1124. }
  1125. }, toJSON(u) {
  1126. const e = {};
  1127. return u.vp9s !== void 0 && (e.vp9s = k.toJSON(u.vp9s)), u.rgb !== void 0 && (e.rgb = o0.toJSON(u.rgb)), u.yuv !== void 0 && (e.yuv = n0.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
  1128. }, create(u) {
  1129. return r0.fromPartial(u != null ? u : {})
  1130. }, fromPartial(u) {
  1131. var i;
  1132. const e = Ve();
  1133. 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 ? o0.fromPartial(u.rgb) : void 0, e.yuv = u.yuv !== void 0 && u.yuv !== null ? n0.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
  1134. }
  1135. };
  1136. function qe() {
  1137. return {id: "", pk: new Uint8Array(0)}
  1138. }
  1139. const oe = {
  1140. encode(u, e = r.Writer.create()) {
  1141. return u.id !== "" && e.uint32(10).string(u.id), u.pk.length !== 0 && e.uint32(18).bytes(u.pk), e
  1142. }, decode(u, e) {
  1143. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1144. let o = e === void 0 ? i.len : i.pos + e;
  1145. const a = qe();
  1146. for (; i.pos < o;) {
  1147. const t = i.uint32();
  1148. switch (t >>> 3) {
  1149. case 1:
  1150. if (t !== 10) break;
  1151. a.id = i.string();
  1152. continue;
  1153. case 2:
  1154. if (t !== 18) break;
  1155. a.pk = i.bytes();
  1156. continue
  1157. }
  1158. if ((t & 7) === 4 || t === 0) break;
  1159. i.skipType(t & 7)
  1160. }
  1161. return a
  1162. }, fromJSON(u) {
  1163. return {id: n(u.id) ? globalThis.String(u.id) : "", pk: n(u.pk) ? R(u.pk) : new Uint8Array(0)}
  1164. }, toJSON(u) {
  1165. const e = {};
  1166. return u.id !== "" && (e.id = u.id), u.pk.length !== 0 && (e.pk = I(u.pk)), e
  1167. }, create(u) {
  1168. return oe.fromPartial(u != null ? u : {})
  1169. }, fromPartial(u) {
  1170. var i, o;
  1171. const e = qe();
  1172. return e.id = (i = u.id) != null ? i : "", e.pk = (o = u.pk) != null ? o : new Uint8Array(0), e
  1173. }
  1174. };
  1175. function Ke() {
  1176. return {
  1177. x: 0,
  1178. y: 0,
  1179. width: 0,
  1180. height: 0,
  1181. name: "",
  1182. online: !1,
  1183. cursor_embedded: !1,
  1184. original_resolution: void 0,
  1185. scale: 0
  1186. }
  1187. }
  1188. const s0 = {
  1189. encode(u, e = r.Writer.create()) {
  1190. 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
  1191. }, decode(u, e) {
  1192. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1193. let o = e === void 0 ? i.len : i.pos + e;
  1194. const a = Ke();
  1195. for (; i.pos < o;) {
  1196. const t = i.uint32();
  1197. switch (t >>> 3) {
  1198. case 1:
  1199. if (t !== 8) break;
  1200. a.x = i.sint32();
  1201. continue;
  1202. case 2:
  1203. if (t !== 16) break;
  1204. a.y = i.sint32();
  1205. continue;
  1206. case 3:
  1207. if (t !== 24) break;
  1208. a.width = i.int32();
  1209. continue;
  1210. case 4:
  1211. if (t !== 32) break;
  1212. a.height = i.int32();
  1213. continue;
  1214. case 5:
  1215. if (t !== 42) break;
  1216. a.name = i.string();
  1217. continue;
  1218. case 6:
  1219. if (t !== 48) break;
  1220. a.online = i.bool();
  1221. continue;
  1222. case 7:
  1223. if (t !== 56) break;
  1224. a.cursor_embedded = i.bool();
  1225. continue;
  1226. case 8:
  1227. if (t !== 66) break;
  1228. a.original_resolution = v.decode(i, i.uint32());
  1229. continue;
  1230. case 9:
  1231. if (t !== 73) break;
  1232. a.scale = i.double();
  1233. continue
  1234. }
  1235. if ((t & 7) === 4 || t === 0) break;
  1236. i.skipType(t & 7)
  1237. }
  1238. return a
  1239. }, fromJSON(u) {
  1240. return {
  1241. x: n(u.x) ? globalThis.Number(u.x) : 0,
  1242. y: n(u.y) ? globalThis.Number(u.y) : 0,
  1243. width: n(u.width) ? globalThis.Number(u.width) : 0,
  1244. height: n(u.height) ? globalThis.Number(u.height) : 0,
  1245. name: n(u.name) ? globalThis.String(u.name) : "",
  1246. online: n(u.online) ? globalThis.Boolean(u.online) : !1,
  1247. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  1248. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0,
  1249. scale: n(u.scale) ? globalThis.Number(u.scale) : 0
  1250. }
  1251. }, toJSON(u) {
  1252. const e = {};
  1253. 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
  1254. }, create(u) {
  1255. return s0.fromPartial(u != null ? u : {})
  1256. }, fromPartial(u) {
  1257. var i, o, a, t, s, l, E, c;
  1258. const e = Ke();
  1259. 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
  1260. }
  1261. };
  1262. function He() {
  1263. return {host: "", port: 0}
  1264. }
  1265. const l0 = {
  1266. encode(u, e = r.Writer.create()) {
  1267. return u.host !== "" && e.uint32(10).string(u.host), u.port !== 0 && e.uint32(16).int32(u.port), e
  1268. }, decode(u, e) {
  1269. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1270. let o = e === void 0 ? i.len : i.pos + e;
  1271. const a = He();
  1272. for (; i.pos < o;) {
  1273. const t = i.uint32();
  1274. switch (t >>> 3) {
  1275. case 1:
  1276. if (t !== 10) break;
  1277. a.host = i.string();
  1278. continue;
  1279. case 2:
  1280. if (t !== 16) break;
  1281. a.port = i.int32();
  1282. continue
  1283. }
  1284. if ((t & 7) === 4 || t === 0) break;
  1285. i.skipType(t & 7)
  1286. }
  1287. return a
  1288. }, fromJSON(u) {
  1289. return {host: n(u.host) ? globalThis.String(u.host) : "", port: n(u.port) ? globalThis.Number(u.port) : 0}
  1290. }, toJSON(u) {
  1291. const e = {};
  1292. return u.host !== "" && (e.host = u.host), u.port !== 0 && (e.port = Math.round(u.port)), e
  1293. }, create(u) {
  1294. return l0.fromPartial(u != null ? u : {})
  1295. }, fromPartial(u) {
  1296. var i, o;
  1297. const e = He();
  1298. return e.host = (i = u.host) != null ? i : "", e.port = (o = u.port) != null ? o : 0, e
  1299. }
  1300. };
  1301. function Je() {
  1302. return {dir: "", show_hidden: !1}
  1303. }
  1304. const Fu = {
  1305. encode(u, e = r.Writer.create()) {
  1306. return u.dir !== "" && e.uint32(10).string(u.dir), u.show_hidden !== !1 && e.uint32(16).bool(u.show_hidden), e
  1307. }, decode(u, e) {
  1308. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1309. let o = e === void 0 ? i.len : i.pos + e;
  1310. const a = Je();
  1311. for (; i.pos < o;) {
  1312. const t = i.uint32();
  1313. switch (t >>> 3) {
  1314. case 1:
  1315. if (t !== 10) break;
  1316. a.dir = i.string();
  1317. continue;
  1318. case 2:
  1319. if (t !== 16) break;
  1320. a.show_hidden = i.bool();
  1321. continue
  1322. }
  1323. if ((t & 7) === 4 || t === 0) break;
  1324. i.skipType(t & 7)
  1325. }
  1326. return a
  1327. }, fromJSON(u) {
  1328. return {
  1329. dir: n(u.dir) ? globalThis.String(u.dir) : "",
  1330. show_hidden: n(u.show_hidden) ? globalThis.Boolean(u.show_hidden) : !1
  1331. }
  1332. }, toJSON(u) {
  1333. const e = {};
  1334. return u.dir !== "" && (e.dir = u.dir), u.show_hidden !== !1 && (e.show_hidden = u.show_hidden), e
  1335. }, create(u) {
  1336. return Fu.fromPartial(u != null ? u : {})
  1337. }, fromPartial(u) {
  1338. var i, o;
  1339. const e = Je();
  1340. return e.dir = (i = u.dir) != null ? i : "", e.show_hidden = (o = u.show_hidden) != null ? o : !1, e
  1341. }
  1342. };
  1343. function Ge() {
  1344. return {username: "", password: ""}
  1345. }
  1346. const E0 = {
  1347. encode(u, e = r.Writer.create()) {
  1348. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  1349. }, decode(u, e) {
  1350. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1351. let o = e === void 0 ? i.len : i.pos + e;
  1352. const a = Ge();
  1353. for (; i.pos < o;) {
  1354. const t = i.uint32();
  1355. switch (t >>> 3) {
  1356. case 1:
  1357. if (t !== 10) break;
  1358. a.username = i.string();
  1359. continue;
  1360. case 2:
  1361. if (t !== 18) break;
  1362. a.password = i.string();
  1363. continue
  1364. }
  1365. if ((t & 7) === 4 || t === 0) break;
  1366. i.skipType(t & 7)
  1367. }
  1368. return a
  1369. }, fromJSON(u) {
  1370. return {
  1371. username: n(u.username) ? globalThis.String(u.username) : "",
  1372. password: n(u.password) ? globalThis.String(u.password) : ""
  1373. }
  1374. }, toJSON(u) {
  1375. const e = {};
  1376. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  1377. }, create(u) {
  1378. return E0.fromPartial(u != null ? u : {})
  1379. }, fromPartial(u) {
  1380. var i, o;
  1381. const e = Ge();
  1382. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  1383. }
  1384. };
  1385. function Ze() {
  1386. return {
  1387. username: "",
  1388. password: new Uint8Array(0),
  1389. my_id: "",
  1390. my_name: "",
  1391. option: void 0,
  1392. file_transfer: void 0,
  1393. port_forward: void 0,
  1394. video_ack_required: !1,
  1395. session_id: 0,
  1396. version: "",
  1397. os_login: void 0,
  1398. my_platform: "",
  1399. hwid: new Uint8Array(0)
  1400. }
  1401. }
  1402. const H = {
  1403. encode(u, e = r.Writer.create()) {
  1404. 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 && z.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 && l0.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 && E0.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
  1405. }, decode(u, e) {
  1406. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1407. let o = e === void 0 ? i.len : i.pos + e;
  1408. const a = Ze();
  1409. for (; i.pos < o;) {
  1410. const t = i.uint32();
  1411. switch (t >>> 3) {
  1412. case 1:
  1413. if (t !== 10) break;
  1414. a.username = i.string();
  1415. continue;
  1416. case 2:
  1417. if (t !== 18) break;
  1418. a.password = i.bytes();
  1419. continue;
  1420. case 4:
  1421. if (t !== 34) break;
  1422. a.my_id = i.string();
  1423. continue;
  1424. case 5:
  1425. if (t !== 42) break;
  1426. a.my_name = i.string();
  1427. continue;
  1428. case 6:
  1429. if (t !== 50) break;
  1430. a.option = z.decode(i, i.uint32());
  1431. continue;
  1432. case 7:
  1433. if (t !== 58) break;
  1434. a.file_transfer = Fu.decode(i, i.uint32());
  1435. continue;
  1436. case 8:
  1437. if (t !== 66) break;
  1438. a.port_forward = l0.decode(i, i.uint32());
  1439. continue;
  1440. case 9:
  1441. if (t !== 72) break;
  1442. a.video_ack_required = i.bool();
  1443. continue;
  1444. case 10:
  1445. if (t !== 80) break;
  1446. a.session_id = V(i.uint64());
  1447. continue;
  1448. case 11:
  1449. if (t !== 90) break;
  1450. a.version = i.string();
  1451. continue;
  1452. case 12:
  1453. if (t !== 98) break;
  1454. a.os_login = E0.decode(i, i.uint32());
  1455. continue;
  1456. case 13:
  1457. if (t !== 106) break;
  1458. a.my_platform = i.string();
  1459. continue;
  1460. case 14:
  1461. if (t !== 114) break;
  1462. a.hwid = i.bytes();
  1463. continue
  1464. }
  1465. if ((t & 7) === 4 || t === 0) break;
  1466. i.skipType(t & 7)
  1467. }
  1468. return a
  1469. }, fromJSON(u) {
  1470. return {
  1471. username: n(u.username) ? globalThis.String(u.username) : "",
  1472. password: n(u.password) ? R(u.password) : new Uint8Array(0),
  1473. my_id: n(u.my_id) ? globalThis.String(u.my_id) : "",
  1474. my_name: n(u.my_name) ? globalThis.String(u.my_name) : "",
  1475. option: n(u.option) ? z.fromJSON(u.option) : void 0,
  1476. file_transfer: n(u.file_transfer) ? Fu.fromJSON(u.file_transfer) : void 0,
  1477. port_forward: n(u.port_forward) ? l0.fromJSON(u.port_forward) : void 0,
  1478. video_ack_required: n(u.video_ack_required) ? globalThis.Boolean(u.video_ack_required) : !1,
  1479. session_id: n(u.session_id) ? globalThis.Number(u.session_id) : 0,
  1480. version: n(u.version) ? globalThis.String(u.version) : "",
  1481. os_login: n(u.os_login) ? E0.fromJSON(u.os_login) : void 0,
  1482. my_platform: n(u.my_platform) ? globalThis.String(u.my_platform) : "",
  1483. hwid: n(u.hwid) ? R(u.hwid) : new Uint8Array(0)
  1484. }
  1485. }, toJSON(u) {
  1486. const e = {};
  1487. return u.username !== "" && (e.username = u.username), u.password.length !== 0 && (e.password = I(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 = z.toJSON(u.option)), u.file_transfer !== void 0 && (e.file_transfer = Fu.toJSON(u.file_transfer)), u.port_forward !== void 0 && (e.port_forward = l0.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 = E0.toJSON(u.os_login)), u.my_platform !== "" && (e.my_platform = u.my_platform), u.hwid.length !== 0 && (e.hwid = I(u.hwid)), e
  1488. }, create(u) {
  1489. return H.fromPartial(u != null ? u : {})
  1490. }, fromPartial(u) {
  1491. var i, o, a, t, s, l, E, c, C;
  1492. const e = Ze();
  1493. 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 ? z.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 ? l0.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 ? E0.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
  1494. }
  1495. };
  1496. function Qe() {
  1497. return {code: "", hwid: new Uint8Array(0)}
  1498. }
  1499. const _u = {
  1500. encode(u, e = r.Writer.create()) {
  1501. return u.code !== "" && e.uint32(10).string(u.code), u.hwid.length !== 0 && e.uint32(18).bytes(u.hwid), e
  1502. }, decode(u, e) {
  1503. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1504. let o = e === void 0 ? i.len : i.pos + e;
  1505. const a = Qe();
  1506. for (; i.pos < o;) {
  1507. const t = i.uint32();
  1508. switch (t >>> 3) {
  1509. case 1:
  1510. if (t !== 10) break;
  1511. a.code = i.string();
  1512. continue;
  1513. case 2:
  1514. if (t !== 18) break;
  1515. a.hwid = i.bytes();
  1516. continue
  1517. }
  1518. if ((t & 7) === 4 || t === 0) break;
  1519. i.skipType(t & 7)
  1520. }
  1521. return a
  1522. }, fromJSON(u) {
  1523. return {code: n(u.code) ? globalThis.String(u.code) : "", hwid: n(u.hwid) ? R(u.hwid) : new Uint8Array(0)}
  1524. }, toJSON(u) {
  1525. const e = {};
  1526. return u.code !== "" && (e.code = u.code), u.hwid.length !== 0 && (e.hwid = I(u.hwid)), e
  1527. }, create(u) {
  1528. return _u.fromPartial(u != null ? u : {})
  1529. }, fromPartial(u) {
  1530. var i, o;
  1531. const e = Qe();
  1532. return e.code = (i = u.code) != null ? i : "", e.hwid = (o = u.hwid) != null ? o : new Uint8Array(0), e
  1533. }
  1534. };
  1535. function Xe() {
  1536. return {text: ""}
  1537. }
  1538. const vu = {
  1539. encode(u, e = r.Writer.create()) {
  1540. return u.text !== "" && e.uint32(10).string(u.text), e
  1541. }, decode(u, e) {
  1542. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1543. let o = e === void 0 ? i.len : i.pos + e;
  1544. const a = Xe();
  1545. for (; i.pos < o;) {
  1546. const t = i.uint32();
  1547. switch (t >>> 3) {
  1548. case 1:
  1549. if (t !== 10) break;
  1550. a.text = i.string();
  1551. continue
  1552. }
  1553. if ((t & 7) === 4 || t === 0) break;
  1554. i.skipType(t & 7)
  1555. }
  1556. return a
  1557. }, fromJSON(u) {
  1558. return {text: n(u.text) ? globalThis.String(u.text) : ""}
  1559. }, toJSON(u) {
  1560. const e = {};
  1561. return u.text !== "" && (e.text = u.text), e
  1562. }, create(u) {
  1563. return vu.fromPartial(u != null ? u : {})
  1564. }, fromPartial(u) {
  1565. var i;
  1566. const e = Xe();
  1567. return e.text = (i = u.text) != null ? i : "", e
  1568. }
  1569. };
  1570. function Ye() {
  1571. return {privacy_mode: !1}
  1572. }
  1573. const d0 = {
  1574. encode(u, e = r.Writer.create()) {
  1575. return u.privacy_mode !== !1 && e.uint32(8).bool(u.privacy_mode), e
  1576. }, decode(u, e) {
  1577. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1578. let o = e === void 0 ? i.len : i.pos + e;
  1579. const a = Ye();
  1580. for (; i.pos < o;) {
  1581. const t = i.uint32();
  1582. switch (t >>> 3) {
  1583. case 1:
  1584. if (t !== 8) break;
  1585. a.privacy_mode = i.bool();
  1586. continue
  1587. }
  1588. if ((t & 7) === 4 || t === 0) break;
  1589. i.skipType(t & 7)
  1590. }
  1591. return a
  1592. }, fromJSON(u) {
  1593. return {privacy_mode: n(u.privacy_mode) ? globalThis.Boolean(u.privacy_mode) : !1}
  1594. }, toJSON(u) {
  1595. const e = {};
  1596. return u.privacy_mode !== !1 && (e.privacy_mode = u.privacy_mode), e
  1597. }, create(u) {
  1598. return d0.fromPartial(u != null ? u : {})
  1599. }, fromPartial(u) {
  1600. var i;
  1601. const e = Ye();
  1602. return e.privacy_mode = (i = u.privacy_mode) != null ? i : !1, e
  1603. }
  1604. };
  1605. function $e() {
  1606. return {vp8: !1, vp9: !1, av1: !1, h264: !1, h265: !1}
  1607. }
  1608. const J = {
  1609. encode(u, e = r.Writer.create()) {
  1610. 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
  1611. }, decode(u, e) {
  1612. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1613. let o = e === void 0 ? i.len : i.pos + e;
  1614. const a = $e();
  1615. for (; i.pos < o;) {
  1616. const t = i.uint32();
  1617. switch (t >>> 3) {
  1618. case 1:
  1619. if (t !== 8) break;
  1620. a.vp8 = i.bool();
  1621. continue;
  1622. case 2:
  1623. if (t !== 16) break;
  1624. a.vp9 = i.bool();
  1625. continue;
  1626. case 3:
  1627. if (t !== 24) break;
  1628. a.av1 = i.bool();
  1629. continue;
  1630. case 4:
  1631. if (t !== 32) break;
  1632. a.h264 = i.bool();
  1633. continue;
  1634. case 5:
  1635. if (t !== 40) break;
  1636. a.h265 = i.bool();
  1637. continue
  1638. }
  1639. if ((t & 7) === 4 || t === 0) break;
  1640. i.skipType(t & 7)
  1641. }
  1642. return a
  1643. }, fromJSON(u) {
  1644. return {
  1645. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1646. vp9: n(u.vp9) ? globalThis.Boolean(u.vp9) : !1,
  1647. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1648. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1649. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1
  1650. }
  1651. }, toJSON(u) {
  1652. const e = {};
  1653. 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
  1654. }, create(u) {
  1655. return J.fromPartial(u != null ? u : {})
  1656. }, fromPartial(u) {
  1657. var i, o, a, t, s;
  1658. const e = $e();
  1659. 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
  1660. }
  1661. };
  1662. function u3() {
  1663. return {h264: !1, h265: !1, vp8: !1, av1: !1, i444: void 0}
  1664. }
  1665. const G = {
  1666. encode(u, e = r.Writer.create()) {
  1667. 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
  1668. }, decode(u, e) {
  1669. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1670. let o = e === void 0 ? i.len : i.pos + e;
  1671. const a = u3();
  1672. for (; i.pos < o;) {
  1673. const t = i.uint32();
  1674. switch (t >>> 3) {
  1675. case 1:
  1676. if (t !== 8) break;
  1677. a.h264 = i.bool();
  1678. continue;
  1679. case 2:
  1680. if (t !== 16) break;
  1681. a.h265 = i.bool();
  1682. continue;
  1683. case 3:
  1684. if (t !== 24) break;
  1685. a.vp8 = i.bool();
  1686. continue;
  1687. case 4:
  1688. if (t !== 32) break;
  1689. a.av1 = i.bool();
  1690. continue;
  1691. case 5:
  1692. if (t !== 42) break;
  1693. a.i444 = J.decode(i, i.uint32());
  1694. continue
  1695. }
  1696. if ((t & 7) === 4 || t === 0) break;
  1697. i.skipType(t & 7)
  1698. }
  1699. return a
  1700. }, fromJSON(u) {
  1701. return {
  1702. h264: n(u.h264) ? globalThis.Boolean(u.h264) : !1,
  1703. h265: n(u.h265) ? globalThis.Boolean(u.h265) : !1,
  1704. vp8: n(u.vp8) ? globalThis.Boolean(u.vp8) : !1,
  1705. av1: n(u.av1) ? globalThis.Boolean(u.av1) : !1,
  1706. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0
  1707. }
  1708. }, toJSON(u) {
  1709. const e = {};
  1710. 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
  1711. }, create(u) {
  1712. return G.fromPartial(u != null ? u : {})
  1713. }, fromPartial(u) {
  1714. var i, o, a, t;
  1715. const e = u3();
  1716. 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
  1717. }
  1718. };
  1719. function e3() {
  1720. return {
  1721. username: "",
  1722. hostname: "",
  1723. platform: "",
  1724. displays: [],
  1725. current_display: 0,
  1726. sas_enabled: !1,
  1727. version: "",
  1728. features: void 0,
  1729. encoding: void 0,
  1730. resolutions: void 0,
  1731. platform_additions: "",
  1732. windows_sessions: void 0
  1733. }
  1734. }
  1735. const Y = {
  1736. encode(u, e = r.Writer.create()) {
  1737. u.username !== "" && e.uint32(10).string(u.username), u.hostname !== "" && e.uint32(18).string(u.hostname), u.platform !== "" && e.uint32(26).string(u.platform);
  1738. for (const i of u.displays) s0.encode(i, e.uint32(34).fork()).ldelim();
  1739. 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 && d0.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 && uu.encode(u.resolutions, e.uint32(90).fork()).ldelim(), u.platform_additions !== "" && e.uint32(98).string(u.platform_additions), u.windows_sessions !== void 0 && K0.encode(u.windows_sessions, e.uint32(106).fork()).ldelim(), e
  1740. }, decode(u, e) {
  1741. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1742. let o = e === void 0 ? i.len : i.pos + e;
  1743. const a = e3();
  1744. for (; i.pos < o;) {
  1745. const t = i.uint32();
  1746. switch (t >>> 3) {
  1747. case 1:
  1748. if (t !== 10) break;
  1749. a.username = i.string();
  1750. continue;
  1751. case 2:
  1752. if (t !== 18) break;
  1753. a.hostname = i.string();
  1754. continue;
  1755. case 3:
  1756. if (t !== 26) break;
  1757. a.platform = i.string();
  1758. continue;
  1759. case 4:
  1760. if (t !== 34) break;
  1761. a.displays.push(s0.decode(i, i.uint32()));
  1762. continue;
  1763. case 5:
  1764. if (t !== 40) break;
  1765. a.current_display = i.int32();
  1766. continue;
  1767. case 6:
  1768. if (t !== 48) break;
  1769. a.sas_enabled = i.bool();
  1770. continue;
  1771. case 7:
  1772. if (t !== 58) break;
  1773. a.version = i.string();
  1774. continue;
  1775. case 9:
  1776. if (t !== 74) break;
  1777. a.features = d0.decode(i, i.uint32());
  1778. continue;
  1779. case 10:
  1780. if (t !== 82) break;
  1781. a.encoding = G.decode(i, i.uint32());
  1782. continue;
  1783. case 11:
  1784. if (t !== 90) break;
  1785. a.resolutions = uu.decode(i, i.uint32());
  1786. continue;
  1787. case 12:
  1788. if (t !== 98) break;
  1789. a.platform_additions = i.string();
  1790. continue;
  1791. case 13:
  1792. if (t !== 106) break;
  1793. a.windows_sessions = K0.decode(i, i.uint32());
  1794. continue
  1795. }
  1796. if ((t & 7) === 4 || t === 0) break;
  1797. i.skipType(t & 7)
  1798. }
  1799. return a
  1800. }, fromJSON(u) {
  1801. return {
  1802. username: n(u.username) ? globalThis.String(u.username) : "",
  1803. hostname: n(u.hostname) ? globalThis.String(u.hostname) : "",
  1804. platform: n(u.platform) ? globalThis.String(u.platform) : "",
  1805. displays: globalThis.Array.isArray(u == null ? void 0 : u.displays) ? u.displays.map(e => s0.fromJSON(e)) : [],
  1806. current_display: n(u.current_display) ? globalThis.Number(u.current_display) : 0,
  1807. sas_enabled: n(u.sas_enabled) ? globalThis.Boolean(u.sas_enabled) : !1,
  1808. version: n(u.version) ? globalThis.String(u.version) : "",
  1809. features: n(u.features) ? d0.fromJSON(u.features) : void 0,
  1810. encoding: n(u.encoding) ? G.fromJSON(u.encoding) : void 0,
  1811. resolutions: n(u.resolutions) ? uu.fromJSON(u.resolutions) : void 0,
  1812. platform_additions: n(u.platform_additions) ? globalThis.String(u.platform_additions) : "",
  1813. windows_sessions: n(u.windows_sessions) ? K0.fromJSON(u.windows_sessions) : void 0
  1814. }
  1815. }, toJSON(u) {
  1816. var i;
  1817. const e = {};
  1818. 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 => s0.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 = d0.toJSON(u.features)), u.encoding !== void 0 && (e.encoding = G.toJSON(u.encoding)), u.resolutions !== void 0 && (e.resolutions = uu.toJSON(u.resolutions)), u.platform_additions !== "" && (e.platform_additions = u.platform_additions), u.windows_sessions !== void 0 && (e.windows_sessions = K0.toJSON(u.windows_sessions)), e
  1819. }, create(u) {
  1820. return Y.fromPartial(u != null ? u : {})
  1821. }, fromPartial(u) {
  1822. var i, o, a, t, s, l, E, c;
  1823. const e = e3();
  1824. 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 => s0.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 ? d0.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 ? uu.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 ? K0.fromPartial(u.windows_sessions) : void 0, e
  1825. }
  1826. };
  1827. function i3() {
  1828. return {sid: 0, name: ""}
  1829. }
  1830. const c0 = {
  1831. encode(u, e = r.Writer.create()) {
  1832. return u.sid !== 0 && e.uint32(8).uint32(u.sid), u.name !== "" && e.uint32(18).string(u.name), e
  1833. }, decode(u, e) {
  1834. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1835. let o = e === void 0 ? i.len : i.pos + e;
  1836. const a = i3();
  1837. for (; i.pos < o;) {
  1838. const t = i.uint32();
  1839. switch (t >>> 3) {
  1840. case 1:
  1841. if (t !== 8) break;
  1842. a.sid = i.uint32();
  1843. continue;
  1844. case 2:
  1845. if (t !== 18) break;
  1846. a.name = i.string();
  1847. continue
  1848. }
  1849. if ((t & 7) === 4 || t === 0) break;
  1850. i.skipType(t & 7)
  1851. }
  1852. return a
  1853. }, fromJSON(u) {
  1854. return {sid: n(u.sid) ? globalThis.Number(u.sid) : 0, name: n(u.name) ? globalThis.String(u.name) : ""}
  1855. }, toJSON(u) {
  1856. const e = {};
  1857. return u.sid !== 0 && (e.sid = Math.round(u.sid)), u.name !== "" && (e.name = u.name), e
  1858. }, create(u) {
  1859. return c0.fromPartial(u != null ? u : {})
  1860. }, fromPartial(u) {
  1861. var i, o;
  1862. const e = i3();
  1863. return e.sid = (i = u.sid) != null ? i : 0, e.name = (o = u.name) != null ? o : "", e
  1864. }
  1865. };
  1866. function t3() {
  1867. return {error: void 0, peer_info: void 0, enable_trusted_devices: !1}
  1868. }
  1869. const C0 = {
  1870. encode(u, e = r.Writer.create()) {
  1871. 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
  1872. }, decode(u, e) {
  1873. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1874. let o = e === void 0 ? i.len : i.pos + e;
  1875. const a = t3();
  1876. for (; i.pos < o;) {
  1877. const t = i.uint32();
  1878. switch (t >>> 3) {
  1879. case 1:
  1880. if (t !== 10) break;
  1881. a.error = i.string();
  1882. continue;
  1883. case 2:
  1884. if (t !== 18) break;
  1885. a.peer_info = Y.decode(i, i.uint32());
  1886. continue;
  1887. case 3:
  1888. if (t !== 24) break;
  1889. a.enable_trusted_devices = i.bool();
  1890. continue
  1891. }
  1892. if ((t & 7) === 4 || t === 0) break;
  1893. i.skipType(t & 7)
  1894. }
  1895. return a
  1896. }, fromJSON(u) {
  1897. return {
  1898. error: n(u.error) ? globalThis.String(u.error) : void 0,
  1899. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  1900. enable_trusted_devices: n(u.enable_trusted_devices) ? globalThis.Boolean(u.enable_trusted_devices) : !1
  1901. }
  1902. }, toJSON(u) {
  1903. const e = {};
  1904. 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
  1905. }, create(u) {
  1906. return C0.fromPartial(u != null ? u : {})
  1907. }, fromPartial(u) {
  1908. var i, o;
  1909. const e = t3();
  1910. 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
  1911. }
  1912. };
  1913. function a3() {
  1914. return {scale: 0}
  1915. }
  1916. const p0 = {
  1917. encode(u, e = r.Writer.create()) {
  1918. return u.scale !== 0 && e.uint32(8).int32(u.scale), e
  1919. }, decode(u, e) {
  1920. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1921. let o = e === void 0 ? i.len : i.pos + e;
  1922. const a = a3();
  1923. for (; i.pos < o;) {
  1924. const t = i.uint32();
  1925. switch (t >>> 3) {
  1926. case 1:
  1927. if (t !== 8) break;
  1928. a.scale = i.int32();
  1929. continue
  1930. }
  1931. if ((t & 7) === 4 || t === 0) break;
  1932. i.skipType(t & 7)
  1933. }
  1934. return a
  1935. }, fromJSON(u) {
  1936. return {scale: n(u.scale) ? globalThis.Number(u.scale) : 0}
  1937. }, toJSON(u) {
  1938. const e = {};
  1939. return u.scale !== 0 && (e.scale = Math.round(u.scale)), e
  1940. }, create(u) {
  1941. return p0.fromPartial(u != null ? u : {})
  1942. }, fromPartial(u) {
  1943. var i;
  1944. const e = a3();
  1945. return e.scale = (i = u.scale) != null ? i : 0, e
  1946. }
  1947. };
  1948. function o3() {
  1949. return {x: 0, y: 0}
  1950. }
  1951. const D0 = {
  1952. encode(u, e = r.Writer.create()) {
  1953. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1954. }, decode(u, e) {
  1955. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1956. let o = e === void 0 ? i.len : i.pos + e;
  1957. const a = o3();
  1958. for (; i.pos < o;) {
  1959. const t = i.uint32();
  1960. switch (t >>> 3) {
  1961. case 1:
  1962. if (t !== 8) break;
  1963. a.x = i.int32();
  1964. continue;
  1965. case 2:
  1966. if (t !== 16) break;
  1967. a.y = i.int32();
  1968. continue
  1969. }
  1970. if ((t & 7) === 4 || t === 0) break;
  1971. i.skipType(t & 7)
  1972. }
  1973. return a
  1974. }, fromJSON(u) {
  1975. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  1976. }, toJSON(u) {
  1977. const e = {};
  1978. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  1979. }, create(u) {
  1980. return D0.fromPartial(u != null ? u : {})
  1981. }, fromPartial(u) {
  1982. var i, o;
  1983. const e = o3();
  1984. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  1985. }
  1986. };
  1987. function n3() {
  1988. return {x: 0, y: 0}
  1989. }
  1990. const B0 = {
  1991. encode(u, e = r.Writer.create()) {
  1992. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  1993. }, decode(u, e) {
  1994. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  1995. let o = e === void 0 ? i.len : i.pos + e;
  1996. const a = n3();
  1997. for (; i.pos < o;) {
  1998. const t = i.uint32();
  1999. switch (t >>> 3) {
  2000. case 1:
  2001. if (t !== 8) break;
  2002. a.x = i.int32();
  2003. continue;
  2004. case 2:
  2005. if (t !== 16) break;
  2006. a.y = i.int32();
  2007. continue
  2008. }
  2009. if ((t & 7) === 4 || t === 0) break;
  2010. i.skipType(t & 7)
  2011. }
  2012. return a
  2013. }, fromJSON(u) {
  2014. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2015. }, toJSON(u) {
  2016. const e = {};
  2017. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2018. }, create(u) {
  2019. return B0.fromPartial(u != null ? u : {})
  2020. }, fromPartial(u) {
  2021. var i, o;
  2022. const e = n3();
  2023. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2024. }
  2025. };
  2026. function r3() {
  2027. return {x: 0, y: 0}
  2028. }
  2029. const m0 = {
  2030. encode(u, e = r.Writer.create()) {
  2031. return u.x !== 0 && e.uint32(8).int32(u.x), u.y !== 0 && e.uint32(16).int32(u.y), e
  2032. }, decode(u, e) {
  2033. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2034. let o = e === void 0 ? i.len : i.pos + e;
  2035. const a = r3();
  2036. for (; i.pos < o;) {
  2037. const t = i.uint32();
  2038. switch (t >>> 3) {
  2039. case 1:
  2040. if (t !== 8) break;
  2041. a.x = i.int32();
  2042. continue;
  2043. case 2:
  2044. if (t !== 16) break;
  2045. a.y = i.int32();
  2046. continue
  2047. }
  2048. if ((t & 7) === 4 || t === 0) break;
  2049. i.skipType(t & 7)
  2050. }
  2051. return a
  2052. }, fromJSON(u) {
  2053. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2054. }, toJSON(u) {
  2055. const e = {};
  2056. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2057. }, create(u) {
  2058. return m0.fromPartial(u != null ? u : {})
  2059. }, fromPartial(u) {
  2060. var i, o;
  2061. const e = r3();
  2062. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2063. }
  2064. };
  2065. function s3() {
  2066. return {scale_update: void 0, pan_start: void 0, pan_update: void 0, pan_end: void 0}
  2067. }
  2068. const A0 = {
  2069. encode(u, e = r.Writer.create()) {
  2070. return u.scale_update !== void 0 && p0.encode(u.scale_update, e.uint32(10).fork()).ldelim(), u.pan_start !== void 0 && D0.encode(u.pan_start, e.uint32(18).fork()).ldelim(), u.pan_update !== void 0 && B0.encode(u.pan_update, e.uint32(26).fork()).ldelim(), u.pan_end !== void 0 && m0.encode(u.pan_end, e.uint32(34).fork()).ldelim(), e
  2071. }, decode(u, e) {
  2072. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2073. let o = e === void 0 ? i.len : i.pos + e;
  2074. const a = s3();
  2075. for (; i.pos < o;) {
  2076. const t = i.uint32();
  2077. switch (t >>> 3) {
  2078. case 1:
  2079. if (t !== 10) break;
  2080. a.scale_update = p0.decode(i, i.uint32());
  2081. continue;
  2082. case 2:
  2083. if (t !== 18) break;
  2084. a.pan_start = D0.decode(i, i.uint32());
  2085. continue;
  2086. case 3:
  2087. if (t !== 26) break;
  2088. a.pan_update = B0.decode(i, i.uint32());
  2089. continue;
  2090. case 4:
  2091. if (t !== 34) break;
  2092. a.pan_end = m0.decode(i, i.uint32());
  2093. continue
  2094. }
  2095. if ((t & 7) === 4 || t === 0) break;
  2096. i.skipType(t & 7)
  2097. }
  2098. return a
  2099. }, fromJSON(u) {
  2100. return {
  2101. scale_update: n(u.scale_update) ? p0.fromJSON(u.scale_update) : void 0,
  2102. pan_start: n(u.pan_start) ? D0.fromJSON(u.pan_start) : void 0,
  2103. pan_update: n(u.pan_update) ? B0.fromJSON(u.pan_update) : void 0,
  2104. pan_end: n(u.pan_end) ? m0.fromJSON(u.pan_end) : void 0
  2105. }
  2106. }, toJSON(u) {
  2107. const e = {};
  2108. return u.scale_update !== void 0 && (e.scale_update = p0.toJSON(u.scale_update)), u.pan_start !== void 0 && (e.pan_start = D0.toJSON(u.pan_start)), u.pan_update !== void 0 && (e.pan_update = B0.toJSON(u.pan_update)), u.pan_end !== void 0 && (e.pan_end = m0.toJSON(u.pan_end)), e
  2109. }, create(u) {
  2110. return A0.fromPartial(u != null ? u : {})
  2111. }, fromPartial(u) {
  2112. const e = s3();
  2113. return e.scale_update = u.scale_update !== void 0 && u.scale_update !== null ? p0.fromPartial(u.scale_update) : void 0, e.pan_start = u.pan_start !== void 0 && u.pan_start !== null ? D0.fromPartial(u.pan_start) : void 0, e.pan_update = u.pan_update !== void 0 && u.pan_update !== null ? B0.fromPartial(u.pan_update) : void 0, e.pan_end = u.pan_end !== void 0 && u.pan_end !== null ? m0.fromPartial(u.pan_end) : void 0, e
  2114. }
  2115. };
  2116. function l3() {
  2117. return {touch_event: void 0, modifiers: []}
  2118. }
  2119. const F0 = {
  2120. encode(u, e = r.Writer.create()) {
  2121. u.touch_event !== void 0 && A0.encode(u.touch_event, e.uint32(10).fork()).ldelim(), e.uint32(18).fork();
  2122. for (const i of u.modifiers) e.int32(i);
  2123. return e.ldelim(), e
  2124. }, decode(u, e) {
  2125. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2126. let o = e === void 0 ? i.len : i.pos + e;
  2127. const a = l3();
  2128. for (; i.pos < o;) {
  2129. const t = i.uint32();
  2130. switch (t >>> 3) {
  2131. case 1:
  2132. if (t !== 10) break;
  2133. a.touch_event = A0.decode(i, i.uint32());
  2134. continue;
  2135. case 2:
  2136. if (t === 16) {
  2137. a.modifiers.push(i.int32());
  2138. continue
  2139. }
  2140. if (t === 18) {
  2141. const s = i.uint32() + i.pos;
  2142. for (; i.pos < s;) a.modifiers.push(i.int32());
  2143. continue
  2144. }
  2145. break
  2146. }
  2147. if ((t & 7) === 4 || t === 0) break;
  2148. i.skipType(t & 7)
  2149. }
  2150. return a
  2151. }, fromJSON(u) {
  2152. return {
  2153. touch_event: n(u.touch_event) ? A0.fromJSON(u.touch_event) : void 0,
  2154. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => v4(e)) : []
  2155. }
  2156. }, toJSON(u) {
  2157. var i;
  2158. const e = {};
  2159. 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 => j4(o))), e
  2160. }, create(u) {
  2161. return F0.fromPartial(u != null ? u : {})
  2162. }, fromPartial(u) {
  2163. var i;
  2164. const e = l3();
  2165. 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
  2166. }
  2167. };
  2168. function E3() {
  2169. return {mask: 0, x: 0, y: 0, modifiers: []}
  2170. }
  2171. const ku = {
  2172. encode(u, e = r.Writer.create()) {
  2173. 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();
  2174. for (const i of u.modifiers) e.int32(i);
  2175. return e.ldelim(), e
  2176. }, decode(u, e) {
  2177. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2178. let o = e === void 0 ? i.len : i.pos + e;
  2179. const a = E3();
  2180. for (; i.pos < o;) {
  2181. const t = i.uint32();
  2182. switch (t >>> 3) {
  2183. case 1:
  2184. if (t !== 8) break;
  2185. a.mask = i.int32();
  2186. continue;
  2187. case 2:
  2188. if (t !== 16) break;
  2189. a.x = i.sint32();
  2190. continue;
  2191. case 3:
  2192. if (t !== 24) break;
  2193. a.y = i.sint32();
  2194. continue;
  2195. case 4:
  2196. if (t === 32) {
  2197. a.modifiers.push(i.int32());
  2198. continue
  2199. }
  2200. if (t === 34) {
  2201. const s = i.uint32() + i.pos;
  2202. for (; i.pos < s;) a.modifiers.push(i.int32());
  2203. continue
  2204. }
  2205. break
  2206. }
  2207. if ((t & 7) === 4 || t === 0) break;
  2208. i.skipType(t & 7)
  2209. }
  2210. return a
  2211. }, fromJSON(u) {
  2212. return {
  2213. mask: n(u.mask) ? globalThis.Number(u.mask) : 0,
  2214. x: n(u.x) ? globalThis.Number(u.x) : 0,
  2215. y: n(u.y) ? globalThis.Number(u.y) : 0,
  2216. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => v4(e)) : []
  2217. }
  2218. }, toJSON(u) {
  2219. var i;
  2220. const e = {};
  2221. 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 => j4(o))), e
  2222. }, create(u) {
  2223. return ku.fromPartial(u != null ? u : {})
  2224. }, fromPartial(u) {
  2225. var i, o, a, t;
  2226. const e = E3();
  2227. 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
  2228. }
  2229. };
  2230. function d3() {
  2231. return {
  2232. down: !1,
  2233. press: !1,
  2234. control_key: void 0,
  2235. chr: void 0,
  2236. unicode: void 0,
  2237. seq: void 0,
  2238. win2win_hotkey: void 0,
  2239. modifiers: [],
  2240. mode: 0
  2241. }
  2242. }
  2243. const w = {
  2244. encode(u, e = r.Writer.create()) {
  2245. 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();
  2246. for (const i of u.modifiers) e.int32(i);
  2247. return e.ldelim(), u.mode !== 0 && e.uint32(72).int32(u.mode), e
  2248. }, decode(u, e) {
  2249. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2250. let o = e === void 0 ? i.len : i.pos + e;
  2251. const a = d3();
  2252. for (; i.pos < o;) {
  2253. const t = i.uint32();
  2254. switch (t >>> 3) {
  2255. case 1:
  2256. if (t !== 8) break;
  2257. a.down = i.bool();
  2258. continue;
  2259. case 2:
  2260. if (t !== 16) break;
  2261. a.press = i.bool();
  2262. continue;
  2263. case 3:
  2264. if (t !== 24) break;
  2265. a.control_key = i.int32();
  2266. continue;
  2267. case 4:
  2268. if (t !== 32) break;
  2269. a.chr = i.uint32();
  2270. continue;
  2271. case 5:
  2272. if (t !== 40) break;
  2273. a.unicode = i.uint32();
  2274. continue;
  2275. case 6:
  2276. if (t !== 50) break;
  2277. a.seq = i.string();
  2278. continue;
  2279. case 7:
  2280. if (t !== 56) break;
  2281. a.win2win_hotkey = i.uint32();
  2282. continue;
  2283. case 8:
  2284. if (t === 64) {
  2285. a.modifiers.push(i.int32());
  2286. continue
  2287. }
  2288. if (t === 66) {
  2289. const s = i.uint32() + i.pos;
  2290. for (; i.pos < s;) a.modifiers.push(i.int32());
  2291. continue
  2292. }
  2293. break;
  2294. case 9:
  2295. if (t !== 72) break;
  2296. a.mode = i.int32();
  2297. continue
  2298. }
  2299. if ((t & 7) === 4 || t === 0) break;
  2300. i.skipType(t & 7)
  2301. }
  2302. return a
  2303. }, fromJSON(u) {
  2304. return {
  2305. down: n(u.down) ? globalThis.Boolean(u.down) : !1,
  2306. press: n(u.press) ? globalThis.Boolean(u.press) : !1,
  2307. control_key: n(u.control_key) ? v4(u.control_key) : void 0,
  2308. chr: n(u.chr) ? globalThis.Number(u.chr) : void 0,
  2309. unicode: n(u.unicode) ? globalThis.Number(u.unicode) : void 0,
  2310. seq: n(u.seq) ? globalThis.String(u.seq) : void 0,
  2311. win2win_hotkey: n(u.win2win_hotkey) ? globalThis.Number(u.win2win_hotkey) : void 0,
  2312. modifiers: globalThis.Array.isArray(u == null ? void 0 : u.modifiers) ? u.modifiers.map(e => v4(e)) : [],
  2313. mode: n(u.mode) ? da(u.mode) : 0
  2314. }
  2315. }, toJSON(u) {
  2316. var i;
  2317. const e = {};
  2318. return u.down !== !1 && (e.down = u.down), u.press !== !1 && (e.press = u.press), u.control_key !== void 0 && (e.control_key = j4(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 => j4(o))), u.mode !== 0 && (e.mode = ca(u.mode)), e
  2319. }, create(u) {
  2320. return w.fromPartial(u != null ? u : {})
  2321. }, fromPartial(u) {
  2322. var i, o, a, t, s, l, E, c, C;
  2323. const e = d3();
  2324. 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
  2325. }
  2326. };
  2327. function c3() {
  2328. return {id: 0, hotx: 0, hoty: 0, width: 0, height: 0, colors: new Uint8Array(0)}
  2329. }
  2330. const _0 = {
  2331. encode(u, e = r.Writer.create()) {
  2332. 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
  2333. }, decode(u, e) {
  2334. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2335. let o = e === void 0 ? i.len : i.pos + e;
  2336. const a = c3();
  2337. for (; i.pos < o;) {
  2338. const t = i.uint32();
  2339. switch (t >>> 3) {
  2340. case 1:
  2341. if (t !== 8) break;
  2342. a.id = V(i.uint64());
  2343. continue;
  2344. case 2:
  2345. if (t !== 16) break;
  2346. a.hotx = i.sint32();
  2347. continue;
  2348. case 3:
  2349. if (t !== 24) break;
  2350. a.hoty = i.sint32();
  2351. continue;
  2352. case 4:
  2353. if (t !== 32) break;
  2354. a.width = i.int32();
  2355. continue;
  2356. case 5:
  2357. if (t !== 40) break;
  2358. a.height = i.int32();
  2359. continue;
  2360. case 6:
  2361. if (t !== 50) break;
  2362. a.colors = i.bytes();
  2363. continue
  2364. }
  2365. if ((t & 7) === 4 || t === 0) break;
  2366. i.skipType(t & 7)
  2367. }
  2368. return a
  2369. }, fromJSON(u) {
  2370. return {
  2371. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2372. hotx: n(u.hotx) ? globalThis.Number(u.hotx) : 0,
  2373. hoty: n(u.hoty) ? globalThis.Number(u.hoty) : 0,
  2374. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2375. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2376. colors: n(u.colors) ? R(u.colors) : new Uint8Array(0)
  2377. }
  2378. }, toJSON(u) {
  2379. const e = {};
  2380. 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 = I(u.colors)), e
  2381. }, create(u) {
  2382. return _0.fromPartial(u != null ? u : {})
  2383. }, fromPartial(u) {
  2384. var i, o, a, t, s, l;
  2385. const e = c3();
  2386. 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
  2387. }
  2388. };
  2389. function C3() {
  2390. return {x: 0, y: 0}
  2391. }
  2392. const v0 = {
  2393. encode(u, e = r.Writer.create()) {
  2394. return u.x !== 0 && e.uint32(8).sint32(u.x), u.y !== 0 && e.uint32(16).sint32(u.y), e
  2395. }, decode(u, e) {
  2396. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2397. let o = e === void 0 ? i.len : i.pos + e;
  2398. const a = C3();
  2399. for (; i.pos < o;) {
  2400. const t = i.uint32();
  2401. switch (t >>> 3) {
  2402. case 1:
  2403. if (t !== 8) break;
  2404. a.x = i.sint32();
  2405. continue;
  2406. case 2:
  2407. if (t !== 16) break;
  2408. a.y = i.sint32();
  2409. continue
  2410. }
  2411. if ((t & 7) === 4 || t === 0) break;
  2412. i.skipType(t & 7)
  2413. }
  2414. return a
  2415. }, fromJSON(u) {
  2416. return {x: n(u.x) ? globalThis.Number(u.x) : 0, y: n(u.y) ? globalThis.Number(u.y) : 0}
  2417. }, toJSON(u) {
  2418. const e = {};
  2419. return u.x !== 0 && (e.x = Math.round(u.x)), u.y !== 0 && (e.y = Math.round(u.y)), e
  2420. }, create(u) {
  2421. return v0.fromPartial(u != null ? u : {})
  2422. }, fromPartial(u) {
  2423. var i, o;
  2424. const e = C3();
  2425. return e.x = (i = u.x) != null ? i : 0, e.y = (o = u.y) != null ? o : 0, e
  2426. }
  2427. };
  2428. function p3() {
  2429. return {salt: "", challenge: ""}
  2430. }
  2431. const k0 = {
  2432. encode(u, e = r.Writer.create()) {
  2433. return u.salt !== "" && e.uint32(10).string(u.salt), u.challenge !== "" && e.uint32(18).string(u.challenge), e
  2434. }, decode(u, e) {
  2435. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2436. let o = e === void 0 ? i.len : i.pos + e;
  2437. const a = p3();
  2438. for (; i.pos < o;) {
  2439. const t = i.uint32();
  2440. switch (t >>> 3) {
  2441. case 1:
  2442. if (t !== 10) break;
  2443. a.salt = i.string();
  2444. continue;
  2445. case 2:
  2446. if (t !== 18) break;
  2447. a.challenge = i.string();
  2448. continue
  2449. }
  2450. if ((t & 7) === 4 || t === 0) break;
  2451. i.skipType(t & 7)
  2452. }
  2453. return a
  2454. }, fromJSON(u) {
  2455. return {
  2456. salt: n(u.salt) ? globalThis.String(u.salt) : "",
  2457. challenge: n(u.challenge) ? globalThis.String(u.challenge) : ""
  2458. }
  2459. }, toJSON(u) {
  2460. const e = {};
  2461. return u.salt !== "" && (e.salt = u.salt), u.challenge !== "" && (e.challenge = u.challenge), e
  2462. }, create(u) {
  2463. return k0.fromPartial(u != null ? u : {})
  2464. }, fromPartial(u) {
  2465. var i, o;
  2466. const e = p3();
  2467. return e.salt = (i = u.salt) != null ? i : "", e.challenge = (o = u.challenge) != null ? o : "", e
  2468. }
  2469. };
  2470. function D3() {
  2471. return {compress: !1, content: new Uint8Array(0), width: 0, height: 0, format: 0, special_name: ""}
  2472. }
  2473. const L = {
  2474. encode(u, e = r.Writer.create()) {
  2475. 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
  2476. }, decode(u, e) {
  2477. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2478. let o = e === void 0 ? i.len : i.pos + e;
  2479. const a = D3();
  2480. for (; i.pos < o;) {
  2481. const t = i.uint32();
  2482. switch (t >>> 3) {
  2483. case 1:
  2484. if (t !== 8) break;
  2485. a.compress = i.bool();
  2486. continue;
  2487. case 2:
  2488. if (t !== 18) break;
  2489. a.content = i.bytes();
  2490. continue;
  2491. case 3:
  2492. if (t !== 24) break;
  2493. a.width = i.int32();
  2494. continue;
  2495. case 4:
  2496. if (t !== 32) break;
  2497. a.height = i.int32();
  2498. continue;
  2499. case 5:
  2500. if (t !== 40) break;
  2501. a.format = i.int32();
  2502. continue;
  2503. case 6:
  2504. if (t !== 50) break;
  2505. a.special_name = i.string();
  2506. continue
  2507. }
  2508. if ((t & 7) === 4 || t === 0) break;
  2509. i.skipType(t & 7)
  2510. }
  2511. return a
  2512. }, fromJSON(u) {
  2513. return {
  2514. compress: n(u.compress) ? globalThis.Boolean(u.compress) : !1,
  2515. content: n(u.content) ? R(u.content) : new Uint8Array(0),
  2516. width: n(u.width) ? globalThis.Number(u.width) : 0,
  2517. height: n(u.height) ? globalThis.Number(u.height) : 0,
  2518. format: n(u.format) ? Ca(u.format) : 0,
  2519. special_name: n(u.special_name) ? globalThis.String(u.special_name) : ""
  2520. }
  2521. }, toJSON(u) {
  2522. const e = {};
  2523. return u.compress !== !1 && (e.compress = u.compress), u.content.length !== 0 && (e.content = I(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 = pa(u.format)), u.special_name !== "" && (e.special_name = u.special_name), e
  2524. }, create(u) {
  2525. return L.fromPartial(u != null ? u : {})
  2526. }, fromPartial(u) {
  2527. var i, o, a, t, s, l;
  2528. const e = D3();
  2529. 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
  2530. }
  2531. };
  2532. function B3() {
  2533. return {clipboards: []}
  2534. }
  2535. const gu = {
  2536. encode(u, e = r.Writer.create()) {
  2537. for (const i of u.clipboards) L.encode(i, e.uint32(10).fork()).ldelim();
  2538. return e
  2539. }, decode(u, e) {
  2540. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2541. let o = e === void 0 ? i.len : i.pos + e;
  2542. const a = B3();
  2543. for (; i.pos < o;) {
  2544. const t = i.uint32();
  2545. switch (t >>> 3) {
  2546. case 1:
  2547. if (t !== 10) break;
  2548. a.clipboards.push(L.decode(i, i.uint32()));
  2549. continue
  2550. }
  2551. if ((t & 7) === 4 || t === 0) break;
  2552. i.skipType(t & 7)
  2553. }
  2554. return a
  2555. }, fromJSON(u) {
  2556. return {clipboards: globalThis.Array.isArray(u == null ? void 0 : u.clipboards) ? u.clipboards.map(e => L.fromJSON(e)) : []}
  2557. }, toJSON(u) {
  2558. var i;
  2559. const e = {};
  2560. return (i = u.clipboards) != null && i.length && (e.clipboards = u.clipboards.map(o => L.toJSON(o))), e
  2561. }, create(u) {
  2562. return gu.fromPartial(u != null ? u : {})
  2563. }, fromPartial(u) {
  2564. var i;
  2565. const e = B3();
  2566. return e.clipboards = ((i = u.clipboards) == null ? void 0 : i.map(o => L.fromPartial(o))) || [], e
  2567. }
  2568. };
  2569. function m3() {
  2570. return {entry_type: 0, name: "", is_hidden: !1, size: 0, modified_time: 0}
  2571. }
  2572. const W = {
  2573. encode(u, e = r.Writer.create()) {
  2574. 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
  2575. }, decode(u, e) {
  2576. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2577. let o = e === void 0 ? i.len : i.pos + e;
  2578. const a = m3();
  2579. for (; i.pos < o;) {
  2580. const t = i.uint32();
  2581. switch (t >>> 3) {
  2582. case 1:
  2583. if (t !== 8) break;
  2584. a.entry_type = i.int32();
  2585. continue;
  2586. case 2:
  2587. if (t !== 18) break;
  2588. a.name = i.string();
  2589. continue;
  2590. case 3:
  2591. if (t !== 24) break;
  2592. a.is_hidden = i.bool();
  2593. continue;
  2594. case 4:
  2595. if (t !== 32) break;
  2596. a.size = V(i.uint64());
  2597. continue;
  2598. case 5:
  2599. if (t !== 40) break;
  2600. a.modified_time = V(i.uint64());
  2601. continue
  2602. }
  2603. if ((t & 7) === 4 || t === 0) break;
  2604. i.skipType(t & 7)
  2605. }
  2606. return a
  2607. }, fromJSON(u) {
  2608. return {
  2609. entry_type: n(u.entry_type) ? Da(u.entry_type) : 0,
  2610. name: n(u.name) ? globalThis.String(u.name) : "",
  2611. is_hidden: n(u.is_hidden) ? globalThis.Boolean(u.is_hidden) : !1,
  2612. size: n(u.size) ? globalThis.Number(u.size) : 0,
  2613. modified_time: n(u.modified_time) ? globalThis.Number(u.modified_time) : 0
  2614. }
  2615. }, toJSON(u) {
  2616. const e = {};
  2617. return u.entry_type !== 0 && (e.entry_type = Ba(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
  2618. }, create(u) {
  2619. return W.fromPartial(u != null ? u : {})
  2620. }, fromPartial(u) {
  2621. var i, o, a, t, s;
  2622. const e = m3();
  2623. 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
  2624. }
  2625. };
  2626. function A3() {
  2627. return {id: 0, path: "", entries: []}
  2628. }
  2629. const $ = {
  2630. encode(u, e = r.Writer.create()) {
  2631. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  2632. for (const i of u.entries) W.encode(i, e.uint32(26).fork()).ldelim();
  2633. return e
  2634. }, decode(u, e) {
  2635. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2636. let o = e === void 0 ? i.len : i.pos + e;
  2637. const a = A3();
  2638. for (; i.pos < o;) {
  2639. const t = i.uint32();
  2640. switch (t >>> 3) {
  2641. case 1:
  2642. if (t !== 8) break;
  2643. a.id = i.int32();
  2644. continue;
  2645. case 2:
  2646. if (t !== 18) break;
  2647. a.path = i.string();
  2648. continue;
  2649. case 3:
  2650. if (t !== 26) break;
  2651. a.entries.push(W.decode(i, i.uint32()));
  2652. continue
  2653. }
  2654. if ((t & 7) === 4 || t === 0) break;
  2655. i.skipType(t & 7)
  2656. }
  2657. return a
  2658. }, fromJSON(u) {
  2659. return {
  2660. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2661. path: n(u.path) ? globalThis.String(u.path) : "",
  2662. entries: globalThis.Array.isArray(u == null ? void 0 : u.entries) ? u.entries.map(e => W.fromJSON(e)) : []
  2663. }
  2664. }, toJSON(u) {
  2665. var i;
  2666. const e = {};
  2667. 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
  2668. }, create(u) {
  2669. return $.fromPartial(u != null ? u : {})
  2670. }, fromPartial(u) {
  2671. var i, o, a;
  2672. const e = A3();
  2673. 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
  2674. }
  2675. };
  2676. function F3() {
  2677. return {path: "", include_hidden: !1}
  2678. }
  2679. const hu = {
  2680. encode(u, e = r.Writer.create()) {
  2681. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2682. }, decode(u, e) {
  2683. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2684. let o = e === void 0 ? i.len : i.pos + e;
  2685. const a = F3();
  2686. for (; i.pos < o;) {
  2687. const t = i.uint32();
  2688. switch (t >>> 3) {
  2689. case 1:
  2690. if (t !== 10) break;
  2691. a.path = i.string();
  2692. continue;
  2693. case 2:
  2694. if (t !== 16) break;
  2695. a.include_hidden = i.bool();
  2696. continue
  2697. }
  2698. if ((t & 7) === 4 || t === 0) break;
  2699. i.skipType(t & 7)
  2700. }
  2701. return a
  2702. }, fromJSON(u) {
  2703. return {
  2704. path: n(u.path) ? globalThis.String(u.path) : "",
  2705. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2706. }
  2707. }, toJSON(u) {
  2708. const e = {};
  2709. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2710. }, create(u) {
  2711. return hu.fromPartial(u != null ? u : {})
  2712. }, fromPartial(u) {
  2713. var i, o;
  2714. const e = F3();
  2715. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (o = u.include_hidden) != null ? o : !1, e
  2716. }
  2717. };
  2718. function _3() {
  2719. return {path: "", include_hidden: !1}
  2720. }
  2721. const fu = {
  2722. encode(u, e = r.Writer.create()) {
  2723. return u.path !== "" && e.uint32(10).string(u.path), u.include_hidden !== !1 && e.uint32(16).bool(u.include_hidden), e
  2724. }, decode(u, e) {
  2725. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2726. let o = e === void 0 ? i.len : i.pos + e;
  2727. const a = _3();
  2728. for (; i.pos < o;) {
  2729. const t = i.uint32();
  2730. switch (t >>> 3) {
  2731. case 1:
  2732. if (t !== 10) break;
  2733. a.path = i.string();
  2734. continue;
  2735. case 2:
  2736. if (t !== 16) break;
  2737. a.include_hidden = i.bool();
  2738. continue
  2739. }
  2740. if ((t & 7) === 4 || t === 0) break;
  2741. i.skipType(t & 7)
  2742. }
  2743. return a
  2744. }, fromJSON(u) {
  2745. return {
  2746. path: n(u.path) ? globalThis.String(u.path) : "",
  2747. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2748. }
  2749. }, toJSON(u) {
  2750. const e = {};
  2751. return u.path !== "" && (e.path = u.path), u.include_hidden !== !1 && (e.include_hidden = u.include_hidden), e
  2752. }, create(u) {
  2753. return fu.fromPartial(u != null ? u : {})
  2754. }, fromPartial(u) {
  2755. var i, o;
  2756. const e = _3();
  2757. return e.path = (i = u.path) != null ? i : "", e.include_hidden = (o = u.include_hidden) != null ? o : !1, e
  2758. }
  2759. };
  2760. function v3() {
  2761. return {path: "", empty_dirs: []}
  2762. }
  2763. const g0 = {
  2764. encode(u, e = r.Writer.create()) {
  2765. u.path !== "" && e.uint32(10).string(u.path);
  2766. for (const i of u.empty_dirs) $.encode(i, e.uint32(18).fork()).ldelim();
  2767. return e
  2768. }, decode(u, e) {
  2769. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2770. let o = e === void 0 ? i.len : i.pos + e;
  2771. const a = v3();
  2772. for (; i.pos < o;) {
  2773. const t = i.uint32();
  2774. switch (t >>> 3) {
  2775. case 1:
  2776. if (t !== 10) break;
  2777. a.path = i.string();
  2778. continue;
  2779. case 2:
  2780. if (t !== 18) break;
  2781. a.empty_dirs.push($.decode(i, i.uint32()));
  2782. continue
  2783. }
  2784. if ((t & 7) === 4 || t === 0) break;
  2785. i.skipType(t & 7)
  2786. }
  2787. return a
  2788. }, fromJSON(u) {
  2789. return {
  2790. path: n(u.path) ? globalThis.String(u.path) : "",
  2791. empty_dirs: globalThis.Array.isArray(u == null ? void 0 : u.empty_dirs) ? u.empty_dirs.map(e => $.fromJSON(e)) : []
  2792. }
  2793. }, toJSON(u) {
  2794. var i;
  2795. const e = {};
  2796. return u.path !== "" && (e.path = u.path), (i = u.empty_dirs) != null && i.length && (e.empty_dirs = u.empty_dirs.map(o => $.toJSON(o))), e
  2797. }, create(u) {
  2798. return g0.fromPartial(u != null ? u : {})
  2799. }, fromPartial(u) {
  2800. var i, o;
  2801. const e = v3();
  2802. return e.path = (i = u.path) != null ? i : "", e.empty_dirs = ((o = u.empty_dirs) == null ? void 0 : o.map(a => $.fromPartial(a))) || [], e
  2803. }
  2804. };
  2805. function k3() {
  2806. return {id: 0, path: "", include_hidden: !1}
  2807. }
  2808. const xu = {
  2809. encode(u, e = r.Writer.create()) {
  2810. 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
  2811. }, decode(u, e) {
  2812. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2813. let o = e === void 0 ? i.len : i.pos + e;
  2814. const a = k3();
  2815. for (; i.pos < o;) {
  2816. const t = i.uint32();
  2817. switch (t >>> 3) {
  2818. case 1:
  2819. if (t !== 8) break;
  2820. a.id = i.int32();
  2821. continue;
  2822. case 2:
  2823. if (t !== 18) break;
  2824. a.path = i.string();
  2825. continue;
  2826. case 3:
  2827. if (t !== 24) break;
  2828. a.include_hidden = i.bool();
  2829. continue
  2830. }
  2831. if ((t & 7) === 4 || t === 0) break;
  2832. i.skipType(t & 7)
  2833. }
  2834. return a
  2835. }, fromJSON(u) {
  2836. return {
  2837. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2838. path: n(u.path) ? globalThis.String(u.path) : "",
  2839. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1
  2840. }
  2841. }, toJSON(u) {
  2842. const e = {};
  2843. 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
  2844. }, create(u) {
  2845. return xu.fromPartial(u != null ? u : {})
  2846. }, fromPartial(u) {
  2847. var i, o, a;
  2848. const e = k3();
  2849. 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
  2850. }
  2851. };
  2852. function g3() {
  2853. return {id: 0, path: "", new_name: ""}
  2854. }
  2855. const yu = {
  2856. encode(u, e = r.Writer.create()) {
  2857. 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
  2858. }, decode(u, e) {
  2859. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2860. let o = e === void 0 ? i.len : i.pos + e;
  2861. const a = g3();
  2862. for (; i.pos < o;) {
  2863. const t = i.uint32();
  2864. switch (t >>> 3) {
  2865. case 1:
  2866. if (t !== 8) break;
  2867. a.id = i.int32();
  2868. continue;
  2869. case 2:
  2870. if (t !== 18) break;
  2871. a.path = i.string();
  2872. continue;
  2873. case 3:
  2874. if (t !== 26) break;
  2875. a.new_name = i.string();
  2876. continue
  2877. }
  2878. if ((t & 7) === 4 || t === 0) break;
  2879. i.skipType(t & 7)
  2880. }
  2881. return a
  2882. }, fromJSON(u) {
  2883. return {
  2884. id: n(u.id) ? globalThis.Number(u.id) : 0,
  2885. path: n(u.path) ? globalThis.String(u.path) : "",
  2886. new_name: n(u.new_name) ? globalThis.String(u.new_name) : ""
  2887. }
  2888. }, toJSON(u) {
  2889. const e = {};
  2890. 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
  2891. }, create(u) {
  2892. return yu.fromPartial(u != null ? u : {})
  2893. }, fromPartial(u) {
  2894. var i, o, a;
  2895. const e = g3();
  2896. 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
  2897. }
  2898. };
  2899. function h3() {
  2900. return {
  2901. read_dir: void 0,
  2902. send: void 0,
  2903. receive: void 0,
  2904. create: void 0,
  2905. remove_dir: void 0,
  2906. remove_file: void 0,
  2907. all_files: void 0,
  2908. cancel: void 0,
  2909. send_confirm: void 0,
  2910. rename: void 0,
  2911. read_empty_dirs: void 0
  2912. }
  2913. }
  2914. const P = {
  2915. encode(u, e = r.Writer.create()) {
  2916. return u.read_dir !== void 0 && hu.encode(u.read_dir, e.uint32(10).fork()).ldelim(), u.send !== void 0 && Pu.encode(u.send, e.uint32(18).fork()).ldelim(), u.receive !== void 0 && Iu.encode(u.receive, e.uint32(26).fork()).ldelim(), u.create !== void 0 && Nu.encode(u.create, e.uint32(34).fork()).ldelim(), u.remove_dir !== void 0 && Tu.encode(u.remove_dir, e.uint32(42).fork()).ldelim(), u.remove_file !== void 0 && ju.encode(u.remove_file, e.uint32(50).fork()).ldelim(), u.all_files !== void 0 && xu.encode(u.all_files, e.uint32(58).fork()).ldelim(), u.cancel !== void 0 && bu.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 && yu.encode(u.rename, e.uint32(82).fork()).ldelim(), u.read_empty_dirs !== void 0 && fu.encode(u.read_empty_dirs, e.uint32(90).fork()).ldelim(), e
  2917. }, decode(u, e) {
  2918. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  2919. let o = e === void 0 ? i.len : i.pos + e;
  2920. const a = h3();
  2921. for (; i.pos < o;) {
  2922. const t = i.uint32();
  2923. switch (t >>> 3) {
  2924. case 1:
  2925. if (t !== 10) break;
  2926. a.read_dir = hu.decode(i, i.uint32());
  2927. continue;
  2928. case 2:
  2929. if (t !== 18) break;
  2930. a.send = Pu.decode(i, i.uint32());
  2931. continue;
  2932. case 3:
  2933. if (t !== 26) break;
  2934. a.receive = Iu.decode(i, i.uint32());
  2935. continue;
  2936. case 4:
  2937. if (t !== 34) break;
  2938. a.create = Nu.decode(i, i.uint32());
  2939. continue;
  2940. case 5:
  2941. if (t !== 42) break;
  2942. a.remove_dir = Tu.decode(i, i.uint32());
  2943. continue;
  2944. case 6:
  2945. if (t !== 50) break;
  2946. a.remove_file = ju.decode(i, i.uint32());
  2947. continue;
  2948. case 7:
  2949. if (t !== 58) break;
  2950. a.all_files = xu.decode(i, i.uint32());
  2951. continue;
  2952. case 8:
  2953. if (t !== 66) break;
  2954. a.cancel = bu.decode(i, i.uint32());
  2955. continue;
  2956. case 9:
  2957. if (t !== 74) break;
  2958. a.send_confirm = cu.decode(i, i.uint32());
  2959. continue;
  2960. case 10:
  2961. if (t !== 82) break;
  2962. a.rename = yu.decode(i, i.uint32());
  2963. continue;
  2964. case 11:
  2965. if (t !== 90) break;
  2966. a.read_empty_dirs = fu.decode(i, i.uint32());
  2967. continue
  2968. }
  2969. if ((t & 7) === 4 || t === 0) break;
  2970. i.skipType(t & 7)
  2971. }
  2972. return a
  2973. }, fromJSON(u) {
  2974. return {
  2975. read_dir: n(u.read_dir) ? hu.fromJSON(u.read_dir) : void 0,
  2976. send: n(u.send) ? Pu.fromJSON(u.send) : void 0,
  2977. receive: n(u.receive) ? Iu.fromJSON(u.receive) : void 0,
  2978. create: n(u.create) ? Nu.fromJSON(u.create) : void 0,
  2979. remove_dir: n(u.remove_dir) ? Tu.fromJSON(u.remove_dir) : void 0,
  2980. remove_file: n(u.remove_file) ? ju.fromJSON(u.remove_file) : void 0,
  2981. all_files: n(u.all_files) ? xu.fromJSON(u.all_files) : void 0,
  2982. cancel: n(u.cancel) ? bu.fromJSON(u.cancel) : void 0,
  2983. send_confirm: n(u.send_confirm) ? cu.fromJSON(u.send_confirm) : void 0,
  2984. rename: n(u.rename) ? yu.fromJSON(u.rename) : void 0,
  2985. read_empty_dirs: n(u.read_empty_dirs) ? fu.fromJSON(u.read_empty_dirs) : void 0
  2986. }
  2987. }, toJSON(u) {
  2988. const e = {};
  2989. return u.read_dir !== void 0 && (e.read_dir = hu.toJSON(u.read_dir)), u.send !== void 0 && (e.send = Pu.toJSON(u.send)), u.receive !== void 0 && (e.receive = Iu.toJSON(u.receive)), u.create !== void 0 && (e.create = Nu.toJSON(u.create)), u.remove_dir !== void 0 && (e.remove_dir = Tu.toJSON(u.remove_dir)), u.remove_file !== void 0 && (e.remove_file = ju.toJSON(u.remove_file)), u.all_files !== void 0 && (e.all_files = xu.toJSON(u.all_files)), u.cancel !== void 0 && (e.cancel = bu.toJSON(u.cancel)), u.send_confirm !== void 0 && (e.send_confirm = cu.toJSON(u.send_confirm)), u.rename !== void 0 && (e.rename = yu.toJSON(u.rename)), u.read_empty_dirs !== void 0 && (e.read_empty_dirs = fu.toJSON(u.read_empty_dirs)), e
  2990. }, create(u) {
  2991. return P.fromPartial(u != null ? u : {})
  2992. }, fromPartial(u) {
  2993. const e = h3();
  2994. 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 ? Pu.fromPartial(u.send) : void 0, e.receive = u.receive !== void 0 && u.receive !== null ? Iu.fromPartial(u.receive) : void 0, e.create = u.create !== void 0 && u.create !== null ? Nu.fromPartial(u.create) : void 0, e.remove_dir = u.remove_dir !== void 0 && u.remove_dir !== null ? Tu.fromPartial(u.remove_dir) : void 0, e.remove_file = u.remove_file !== void 0 && u.remove_file !== null ? ju.fromPartial(u.remove_file) : void 0, e.all_files = u.all_files !== void 0 && u.all_files !== null ? xu.fromPartial(u.all_files) : void 0, e.cancel = u.cancel !== void 0 && u.cancel !== null ? bu.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 ? yu.fromPartial(u.rename) : void 0, e.read_empty_dirs = u.read_empty_dirs !== void 0 && u.read_empty_dirs !== null ? fu.fromPartial(u.read_empty_dirs) : void 0, e
  2995. }
  2996. };
  2997. function f3() {
  2998. return {id: 0}
  2999. }
  3000. const bu = {
  3001. encode(u, e = r.Writer.create()) {
  3002. return u.id !== 0 && e.uint32(8).int32(u.id), e
  3003. }, decode(u, e) {
  3004. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3005. let o = e === void 0 ? i.len : i.pos + e;
  3006. const a = f3();
  3007. for (; i.pos < o;) {
  3008. const t = i.uint32();
  3009. switch (t >>> 3) {
  3010. case 1:
  3011. if (t !== 8) break;
  3012. a.id = i.int32();
  3013. continue
  3014. }
  3015. if ((t & 7) === 4 || t === 0) break;
  3016. i.skipType(t & 7)
  3017. }
  3018. return a
  3019. }, fromJSON(u) {
  3020. return {id: n(u.id) ? globalThis.Number(u.id) : 0}
  3021. }, toJSON(u) {
  3022. const e = {};
  3023. return u.id !== 0 && (e.id = Math.round(u.id)), e
  3024. }, create(u) {
  3025. return bu.fromPartial(u != null ? u : {})
  3026. }, fromPartial(u) {
  3027. var i;
  3028. const e = f3();
  3029. return e.id = (i = u.id) != null ? i : 0, e
  3030. }
  3031. };
  3032. function x3() {
  3033. return {dir: void 0, block: void 0, error: void 0, done: void 0, digest: void 0, empty_dirs: void 0}
  3034. }
  3035. const nu = {
  3036. encode(u, e = r.Writer.create()) {
  3037. return u.dir !== void 0 && $.encode(u.dir, e.uint32(10).fork()).ldelim(), u.block !== void 0 && Su.encode(u.block, e.uint32(18).fork()).ldelim(), u.error !== void 0 && zu.encode(u.error, e.uint32(26).fork()).ldelim(), u.done !== void 0 && Ru.encode(u.done, e.uint32(34).fork()).ldelim(), u.digest !== void 0 && wu.encode(u.digest, e.uint32(42).fork()).ldelim(), u.empty_dirs !== void 0 && g0.encode(u.empty_dirs, e.uint32(50).fork()).ldelim(), e
  3038. }, decode(u, e) {
  3039. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3040. let o = e === void 0 ? i.len : i.pos + e;
  3041. const a = x3();
  3042. for (; i.pos < o;) {
  3043. const t = i.uint32();
  3044. switch (t >>> 3) {
  3045. case 1:
  3046. if (t !== 10) break;
  3047. a.dir = $.decode(i, i.uint32());
  3048. continue;
  3049. case 2:
  3050. if (t !== 18) break;
  3051. a.block = Su.decode(i, i.uint32());
  3052. continue;
  3053. case 3:
  3054. if (t !== 26) break;
  3055. a.error = zu.decode(i, i.uint32());
  3056. continue;
  3057. case 4:
  3058. if (t !== 34) break;
  3059. a.done = Ru.decode(i, i.uint32());
  3060. continue;
  3061. case 5:
  3062. if (t !== 42) break;
  3063. a.digest = wu.decode(i, i.uint32());
  3064. continue;
  3065. case 6:
  3066. if (t !== 50) break;
  3067. a.empty_dirs = g0.decode(i, i.uint32());
  3068. continue
  3069. }
  3070. if ((t & 7) === 4 || t === 0) break;
  3071. i.skipType(t & 7)
  3072. }
  3073. return a
  3074. }, fromJSON(u) {
  3075. return {
  3076. dir: n(u.dir) ? $.fromJSON(u.dir) : void 0,
  3077. block: n(u.block) ? Su.fromJSON(u.block) : void 0,
  3078. error: n(u.error) ? zu.fromJSON(u.error) : void 0,
  3079. done: n(u.done) ? Ru.fromJSON(u.done) : void 0,
  3080. digest: n(u.digest) ? wu.fromJSON(u.digest) : void 0,
  3081. empty_dirs: n(u.empty_dirs) ? g0.fromJSON(u.empty_dirs) : void 0
  3082. }
  3083. }, toJSON(u) {
  3084. const e = {};
  3085. return u.dir !== void 0 && (e.dir = $.toJSON(u.dir)), u.block !== void 0 && (e.block = Su.toJSON(u.block)), u.error !== void 0 && (e.error = zu.toJSON(u.error)), u.done !== void 0 && (e.done = Ru.toJSON(u.done)), u.digest !== void 0 && (e.digest = wu.toJSON(u.digest)), u.empty_dirs !== void 0 && (e.empty_dirs = g0.toJSON(u.empty_dirs)), e
  3086. }, create(u) {
  3087. return nu.fromPartial(u != null ? u : {})
  3088. }, fromPartial(u) {
  3089. const e = x3();
  3090. return e.dir = u.dir !== void 0 && u.dir !== null ? $.fromPartial(u.dir) : void 0, e.block = u.block !== void 0 && u.block !== null ? Su.fromPartial(u.block) : void 0, e.error = u.error !== void 0 && u.error !== null ? zu.fromPartial(u.error) : void 0, e.done = u.done !== void 0 && u.done !== null ? Ru.fromPartial(u.done) : void 0, e.digest = u.digest !== void 0 && u.digest !== null ? wu.fromPartial(u.digest) : void 0, e.empty_dirs = u.empty_dirs !== void 0 && u.empty_dirs !== null ? g0.fromPartial(u.empty_dirs) : void 0, e
  3091. }
  3092. };
  3093. function y3() {
  3094. return {id: 0, file_num: 0, last_modified: 0, file_size: 0, is_upload: !1, is_identical: !1}
  3095. }
  3096. const wu = {
  3097. encode(u, e = r.Writer.create()) {
  3098. 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
  3099. }, decode(u, e) {
  3100. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3101. let o = e === void 0 ? i.len : i.pos + e;
  3102. const a = y3();
  3103. for (; i.pos < o;) {
  3104. const t = i.uint32();
  3105. switch (t >>> 3) {
  3106. case 1:
  3107. if (t !== 8) break;
  3108. a.id = i.int32();
  3109. continue;
  3110. case 2:
  3111. if (t !== 16) break;
  3112. a.file_num = i.sint32();
  3113. continue;
  3114. case 3:
  3115. if (t !== 24) break;
  3116. a.last_modified = V(i.uint64());
  3117. continue;
  3118. case 4:
  3119. if (t !== 32) break;
  3120. a.file_size = V(i.uint64());
  3121. continue;
  3122. case 5:
  3123. if (t !== 40) break;
  3124. a.is_upload = i.bool();
  3125. continue;
  3126. case 6:
  3127. if (t !== 48) break;
  3128. a.is_identical = i.bool();
  3129. continue
  3130. }
  3131. if ((t & 7) === 4 || t === 0) break;
  3132. i.skipType(t & 7)
  3133. }
  3134. return a
  3135. }, fromJSON(u) {
  3136. return {
  3137. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3138. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3139. last_modified: n(u.last_modified) ? globalThis.Number(u.last_modified) : 0,
  3140. file_size: n(u.file_size) ? globalThis.Number(u.file_size) : 0,
  3141. is_upload: n(u.is_upload) ? globalThis.Boolean(u.is_upload) : !1,
  3142. is_identical: n(u.is_identical) ? globalThis.Boolean(u.is_identical) : !1
  3143. }
  3144. }, toJSON(u) {
  3145. const e = {};
  3146. 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
  3147. }, create(u) {
  3148. return wu.fromPartial(u != null ? u : {})
  3149. }, fromPartial(u) {
  3150. var i, o, a, t, s, l;
  3151. const e = y3();
  3152. 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
  3153. }
  3154. };
  3155. function b3() {
  3156. return {id: 0, file_num: 0, data: new Uint8Array(0), compressed: !1, blk_id: 0}
  3157. }
  3158. const Su = {
  3159. encode(u, e = r.Writer.create()) {
  3160. 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
  3161. }, decode(u, e) {
  3162. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3163. let o = e === void 0 ? i.len : i.pos + e;
  3164. const a = b3();
  3165. for (; i.pos < o;) {
  3166. const t = i.uint32();
  3167. switch (t >>> 3) {
  3168. case 1:
  3169. if (t !== 8) break;
  3170. a.id = i.int32();
  3171. continue;
  3172. case 2:
  3173. if (t !== 16) break;
  3174. a.file_num = i.sint32();
  3175. continue;
  3176. case 3:
  3177. if (t !== 26) break;
  3178. a.data = i.bytes();
  3179. continue;
  3180. case 4:
  3181. if (t !== 32) break;
  3182. a.compressed = i.bool();
  3183. continue;
  3184. case 5:
  3185. if (t !== 40) break;
  3186. a.blk_id = i.uint32();
  3187. continue
  3188. }
  3189. if ((t & 7) === 4 || t === 0) break;
  3190. i.skipType(t & 7)
  3191. }
  3192. return a
  3193. }, fromJSON(u) {
  3194. return {
  3195. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3196. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3197. data: n(u.data) ? R(u.data) : new Uint8Array(0),
  3198. compressed: n(u.compressed) ? globalThis.Boolean(u.compressed) : !1,
  3199. blk_id: n(u.blk_id) ? globalThis.Number(u.blk_id) : 0
  3200. }
  3201. }, toJSON(u) {
  3202. const e = {};
  3203. 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 = I(u.data)), u.compressed !== !1 && (e.compressed = u.compressed), u.blk_id !== 0 && (e.blk_id = Math.round(u.blk_id)), e
  3204. }, create(u) {
  3205. return Su.fromPartial(u != null ? u : {})
  3206. }, fromPartial(u) {
  3207. var i, o, a, t, s;
  3208. const e = b3();
  3209. 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
  3210. }
  3211. };
  3212. function w3() {
  3213. return {id: 0, error: "", file_num: 0}
  3214. }
  3215. const zu = {
  3216. encode(u, e = r.Writer.create()) {
  3217. 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
  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 = w3();
  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 !== 18) break;
  3231. a.error = i.string();
  3232. continue;
  3233. case 3:
  3234. if (t !== 24) break;
  3235. a.file_num = i.sint32();
  3236. continue
  3237. }
  3238. if ((t & 7) === 4 || t === 0) break;
  3239. i.skipType(t & 7)
  3240. }
  3241. return a
  3242. }, fromJSON(u) {
  3243. return {
  3244. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3245. error: n(u.error) ? globalThis.String(u.error) : "",
  3246. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3247. }
  3248. }, toJSON(u) {
  3249. const e = {};
  3250. 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
  3251. }, create(u) {
  3252. return zu.fromPartial(u != null ? u : {})
  3253. }, fromPartial(u) {
  3254. var i, o, a;
  3255. const e = w3();
  3256. 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
  3257. }
  3258. };
  3259. function S3() {
  3260. return {id: 0, path: "", include_hidden: !1, file_num: 0}
  3261. }
  3262. const Pu = {
  3263. encode(u, e = r.Writer.create()) {
  3264. 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
  3265. }, decode(u, e) {
  3266. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3267. let o = e === void 0 ? i.len : i.pos + e;
  3268. const a = S3();
  3269. for (; i.pos < o;) {
  3270. const t = i.uint32();
  3271. switch (t >>> 3) {
  3272. case 1:
  3273. if (t !== 8) break;
  3274. a.id = i.int32();
  3275. continue;
  3276. case 2:
  3277. if (t !== 18) break;
  3278. a.path = i.string();
  3279. continue;
  3280. case 3:
  3281. if (t !== 24) break;
  3282. a.include_hidden = i.bool();
  3283. continue;
  3284. case 4:
  3285. if (t !== 32) break;
  3286. a.file_num = i.int32();
  3287. continue
  3288. }
  3289. if ((t & 7) === 4 || t === 0) break;
  3290. i.skipType(t & 7)
  3291. }
  3292. return a
  3293. }, fromJSON(u) {
  3294. return {
  3295. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3296. path: n(u.path) ? globalThis.String(u.path) : "",
  3297. include_hidden: n(u.include_hidden) ? globalThis.Boolean(u.include_hidden) : !1,
  3298. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3299. }
  3300. }, toJSON(u) {
  3301. const e = {};
  3302. 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
  3303. }, create(u) {
  3304. return Pu.fromPartial(u != null ? u : {})
  3305. }, fromPartial(u) {
  3306. var i, o, a, t;
  3307. const e = S3();
  3308. 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
  3309. }
  3310. };
  3311. function z3() {
  3312. return {id: 0, file_num: 0, skip: void 0, offset_blk: void 0}
  3313. }
  3314. const cu = {
  3315. encode(u, e = r.Writer.create()) {
  3316. 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
  3317. }, decode(u, e) {
  3318. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3319. let o = e === void 0 ? i.len : i.pos + e;
  3320. const a = z3();
  3321. for (; i.pos < o;) {
  3322. const t = i.uint32();
  3323. switch (t >>> 3) {
  3324. case 1:
  3325. if (t !== 8) break;
  3326. a.id = i.int32();
  3327. continue;
  3328. case 2:
  3329. if (t !== 16) break;
  3330. a.file_num = i.sint32();
  3331. continue;
  3332. case 3:
  3333. if (t !== 24) break;
  3334. a.skip = i.bool();
  3335. continue;
  3336. case 4:
  3337. if (t !== 32) break;
  3338. a.offset_blk = i.uint32();
  3339. continue
  3340. }
  3341. if ((t & 7) === 4 || t === 0) break;
  3342. i.skipType(t & 7)
  3343. }
  3344. return a
  3345. }, fromJSON(u) {
  3346. return {
  3347. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3348. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3349. skip: n(u.skip) ? globalThis.Boolean(u.skip) : void 0,
  3350. offset_blk: n(u.offset_blk) ? globalThis.Number(u.offset_blk) : void 0
  3351. }
  3352. }, toJSON(u) {
  3353. const e = {};
  3354. 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
  3355. }, create(u) {
  3356. return cu.fromPartial(u != null ? u : {})
  3357. }, fromPartial(u) {
  3358. var i, o, a, t;
  3359. const e = z3();
  3360. 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
  3361. }
  3362. };
  3363. function P3() {
  3364. return {id: 0, file_num: 0}
  3365. }
  3366. const Ru = {
  3367. encode(u, e = r.Writer.create()) {
  3368. return u.id !== 0 && e.uint32(8).int32(u.id), u.file_num !== 0 && e.uint32(16).sint32(u.file_num), 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 = P3();
  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 !== 16) break;
  3382. a.file_num = i.sint32();
  3383. continue
  3384. }
  3385. if ((t & 7) === 4 || t === 0) break;
  3386. i.skipType(t & 7)
  3387. }
  3388. return a
  3389. }, fromJSON(u) {
  3390. return {id: n(u.id) ? globalThis.Number(u.id) : 0, file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0}
  3391. }, toJSON(u) {
  3392. const e = {};
  3393. return u.id !== 0 && (e.id = Math.round(u.id)), u.file_num !== 0 && (e.file_num = Math.round(u.file_num)), e
  3394. }, create(u) {
  3395. return Ru.fromPartial(u != null ? u : {})
  3396. }, fromPartial(u) {
  3397. var i, o;
  3398. const e = P3();
  3399. return e.id = (i = u.id) != null ? i : 0, e.file_num = (o = u.file_num) != null ? o : 0, e
  3400. }
  3401. };
  3402. function R3() {
  3403. return {id: 0, path: "", files: [], file_num: 0, total_size: 0}
  3404. }
  3405. const Iu = {
  3406. encode(u, e = r.Writer.create()) {
  3407. u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path);
  3408. for (const i of u.files) W.encode(i, e.uint32(26).fork()).ldelim();
  3409. return u.file_num !== 0 && e.uint32(32).int32(u.file_num), u.total_size !== 0 && e.uint32(40).uint64(u.total_size), e
  3410. }, decode(u, e) {
  3411. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3412. let o = e === void 0 ? i.len : i.pos + e;
  3413. const a = R3();
  3414. for (; i.pos < o;) {
  3415. const t = i.uint32();
  3416. switch (t >>> 3) {
  3417. case 1:
  3418. if (t !== 8) break;
  3419. a.id = i.int32();
  3420. continue;
  3421. case 2:
  3422. if (t !== 18) break;
  3423. a.path = i.string();
  3424. continue;
  3425. case 3:
  3426. if (t !== 26) break;
  3427. a.files.push(W.decode(i, i.uint32()));
  3428. continue;
  3429. case 4:
  3430. if (t !== 32) break;
  3431. a.file_num = i.int32();
  3432. continue;
  3433. case 5:
  3434. if (t !== 40) break;
  3435. a.total_size = V(i.uint64());
  3436. continue
  3437. }
  3438. if ((t & 7) === 4 || t === 0) break;
  3439. i.skipType(t & 7)
  3440. }
  3441. return a
  3442. }, fromJSON(u) {
  3443. return {
  3444. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3445. path: n(u.path) ? globalThis.String(u.path) : "",
  3446. files: globalThis.Array.isArray(u == null ? void 0 : u.files) ? u.files.map(e => W.fromJSON(e)) : [],
  3447. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0,
  3448. total_size: n(u.total_size) ? globalThis.Number(u.total_size) : 0
  3449. }
  3450. }, toJSON(u) {
  3451. var i;
  3452. const e = {};
  3453. 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
  3454. }, create(u) {
  3455. return Iu.fromPartial(u != null ? u : {})
  3456. }, fromPartial(u) {
  3457. var i, o, a, t, s;
  3458. const e = R3();
  3459. 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
  3460. }
  3461. };
  3462. function I3() {
  3463. return {id: 0, path: "", recursive: !1}
  3464. }
  3465. const Tu = {
  3466. encode(u, e = r.Writer.create()) {
  3467. 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
  3468. }, decode(u, e) {
  3469. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3470. let o = e === void 0 ? i.len : i.pos + e;
  3471. const a = I3();
  3472. for (; i.pos < o;) {
  3473. const t = i.uint32();
  3474. switch (t >>> 3) {
  3475. case 1:
  3476. if (t !== 8) break;
  3477. a.id = i.int32();
  3478. continue;
  3479. case 2:
  3480. if (t !== 18) break;
  3481. a.path = i.string();
  3482. continue;
  3483. case 3:
  3484. if (t !== 24) break;
  3485. a.recursive = i.bool();
  3486. continue
  3487. }
  3488. if ((t & 7) === 4 || t === 0) break;
  3489. i.skipType(t & 7)
  3490. }
  3491. return a
  3492. }, fromJSON(u) {
  3493. return {
  3494. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3495. path: n(u.path) ? globalThis.String(u.path) : "",
  3496. recursive: n(u.recursive) ? globalThis.Boolean(u.recursive) : !1
  3497. }
  3498. }, toJSON(u) {
  3499. const e = {};
  3500. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), u.recursive !== !1 && (e.recursive = u.recursive), e
  3501. }, create(u) {
  3502. return Tu.fromPartial(u != null ? u : {})
  3503. }, fromPartial(u) {
  3504. var i, o, a;
  3505. const e = I3();
  3506. 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
  3507. }
  3508. };
  3509. function T3() {
  3510. return {id: 0, path: "", file_num: 0}
  3511. }
  3512. const ju = {
  3513. encode(u, e = r.Writer.create()) {
  3514. 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
  3515. }, decode(u, e) {
  3516. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3517. let o = e === void 0 ? i.len : i.pos + e;
  3518. const a = T3();
  3519. for (; i.pos < o;) {
  3520. const t = i.uint32();
  3521. switch (t >>> 3) {
  3522. case 1:
  3523. if (t !== 8) break;
  3524. a.id = i.int32();
  3525. continue;
  3526. case 2:
  3527. if (t !== 18) break;
  3528. a.path = i.string();
  3529. continue;
  3530. case 3:
  3531. if (t !== 24) break;
  3532. a.file_num = i.sint32();
  3533. continue
  3534. }
  3535. if ((t & 7) === 4 || t === 0) break;
  3536. i.skipType(t & 7)
  3537. }
  3538. return a
  3539. }, fromJSON(u) {
  3540. return {
  3541. id: n(u.id) ? globalThis.Number(u.id) : 0,
  3542. path: n(u.path) ? globalThis.String(u.path) : "",
  3543. file_num: n(u.file_num) ? globalThis.Number(u.file_num) : 0
  3544. }
  3545. }, toJSON(u) {
  3546. const e = {};
  3547. 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
  3548. }, create(u) {
  3549. return ju.fromPartial(u != null ? u : {})
  3550. }, fromPartial(u) {
  3551. var i, o, a;
  3552. const e = T3();
  3553. 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
  3554. }
  3555. };
  3556. function j3() {
  3557. return {id: 0, path: ""}
  3558. }
  3559. const Nu = {
  3560. encode(u, e = r.Writer.create()) {
  3561. return u.id !== 0 && e.uint32(8).int32(u.id), u.path !== "" && e.uint32(18).string(u.path), e
  3562. }, decode(u, e) {
  3563. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3564. let o = e === void 0 ? i.len : i.pos + e;
  3565. const a = j3();
  3566. for (; i.pos < o;) {
  3567. const t = i.uint32();
  3568. switch (t >>> 3) {
  3569. case 1:
  3570. if (t !== 8) break;
  3571. a.id = i.int32();
  3572. continue;
  3573. case 2:
  3574. if (t !== 18) break;
  3575. a.path = i.string();
  3576. continue
  3577. }
  3578. if ((t & 7) === 4 || t === 0) break;
  3579. i.skipType(t & 7)
  3580. }
  3581. return a
  3582. }, fromJSON(u) {
  3583. return {id: n(u.id) ? globalThis.Number(u.id) : 0, path: n(u.path) ? globalThis.String(u.path) : ""}
  3584. }, toJSON(u) {
  3585. const e = {};
  3586. return u.id !== 0 && (e.id = Math.round(u.id)), u.path !== "" && (e.path = u.path), e
  3587. }, create(u) {
  3588. return Nu.fromPartial(u != null ? u : {})
  3589. }, fromPartial(u) {
  3590. var i, o;
  3591. const e = j3();
  3592. return e.id = (i = u.id) != null ? i : 0, e.path = (o = u.path) != null ? o : "", e
  3593. }
  3594. };
  3595. function N3() {
  3596. return {}
  3597. }
  3598. const h0 = {
  3599. encode(u, e = r.Writer.create()) {
  3600. return e
  3601. }, decode(u, e) {
  3602. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3603. let o = e === void 0 ? i.len : i.pos + e;
  3604. const a = N3();
  3605. for (; i.pos < o;) {
  3606. const t = i.uint32();
  3607. if ((t & 7) === 4 || t === 0) break;
  3608. i.skipType(t & 7)
  3609. }
  3610. return a
  3611. }, fromJSON(u) {
  3612. return {}
  3613. }, toJSON(u) {
  3614. return {}
  3615. }, create(u) {
  3616. return h0.fromPartial(u != null ? u : {})
  3617. }, fromPartial(u) {
  3618. return N3()
  3619. }
  3620. };
  3621. function O3() {
  3622. return {id: 0, format: ""}
  3623. }
  3624. const f0 = {
  3625. encode(u, e = r.Writer.create()) {
  3626. return u.id !== 0 && e.uint32(16).int32(u.id), u.format !== "" && e.uint32(26).string(u.format), e
  3627. }, decode(u, e) {
  3628. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3629. let o = e === void 0 ? i.len : i.pos + e;
  3630. const a = O3();
  3631. for (; i.pos < o;) {
  3632. const t = i.uint32();
  3633. switch (t >>> 3) {
  3634. case 2:
  3635. if (t !== 16) break;
  3636. a.id = i.int32();
  3637. continue;
  3638. case 3:
  3639. if (t !== 26) break;
  3640. a.format = i.string();
  3641. continue
  3642. }
  3643. if ((t & 7) === 4 || t === 0) break;
  3644. i.skipType(t & 7)
  3645. }
  3646. return a
  3647. }, fromJSON(u) {
  3648. return {id: n(u.id) ? globalThis.Number(u.id) : 0, format: n(u.format) ? globalThis.String(u.format) : ""}
  3649. }, toJSON(u) {
  3650. const e = {};
  3651. return u.id !== 0 && (e.id = Math.round(u.id)), u.format !== "" && (e.format = u.format), e
  3652. }, create(u) {
  3653. return f0.fromPartial(u != null ? u : {})
  3654. }, fromPartial(u) {
  3655. var i, o;
  3656. const e = O3();
  3657. return e.id = (i = u.id) != null ? i : 0, e.format = (o = u.format) != null ? o : "", e
  3658. }
  3659. };
  3660. function M3() {
  3661. return {formats: []}
  3662. }
  3663. const x0 = {
  3664. encode(u, e = r.Writer.create()) {
  3665. for (const i of u.formats) f0.encode(i, e.uint32(18).fork()).ldelim();
  3666. return e
  3667. }, decode(u, e) {
  3668. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3669. let o = e === void 0 ? i.len : i.pos + e;
  3670. const a = M3();
  3671. for (; i.pos < o;) {
  3672. const t = i.uint32();
  3673. switch (t >>> 3) {
  3674. case 2:
  3675. if (t !== 18) break;
  3676. a.formats.push(f0.decode(i, i.uint32()));
  3677. continue
  3678. }
  3679. if ((t & 7) === 4 || t === 0) break;
  3680. i.skipType(t & 7)
  3681. }
  3682. return a
  3683. }, fromJSON(u) {
  3684. return {formats: globalThis.Array.isArray(u == null ? void 0 : u.formats) ? u.formats.map(e => f0.fromJSON(e)) : []}
  3685. }, toJSON(u) {
  3686. var i;
  3687. const e = {};
  3688. return (i = u.formats) != null && i.length && (e.formats = u.formats.map(o => f0.toJSON(o))), e
  3689. }, create(u) {
  3690. return x0.fromPartial(u != null ? u : {})
  3691. }, fromPartial(u) {
  3692. var i;
  3693. const e = M3();
  3694. return e.formats = ((i = u.formats) == null ? void 0 : i.map(o => f0.fromPartial(o))) || [], e
  3695. }
  3696. };
  3697. function U3() {
  3698. return {msg_flags: 0}
  3699. }
  3700. const y0 = {
  3701. encode(u, e = r.Writer.create()) {
  3702. return u.msg_flags !== 0 && e.uint32(16).int32(u.msg_flags), e
  3703. }, decode(u, e) {
  3704. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3705. let o = e === void 0 ? i.len : i.pos + e;
  3706. const a = U3();
  3707. for (; i.pos < o;) {
  3708. const t = i.uint32();
  3709. switch (t >>> 3) {
  3710. case 2:
  3711. if (t !== 16) break;
  3712. a.msg_flags = i.int32();
  3713. continue
  3714. }
  3715. if ((t & 7) === 4 || t === 0) break;
  3716. i.skipType(t & 7)
  3717. }
  3718. return a
  3719. }, fromJSON(u) {
  3720. return {msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0}
  3721. }, toJSON(u) {
  3722. const e = {};
  3723. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), e
  3724. }, create(u) {
  3725. return y0.fromPartial(u != null ? u : {})
  3726. }, fromPartial(u) {
  3727. var i;
  3728. const e = U3();
  3729. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e
  3730. }
  3731. };
  3732. function L3() {
  3733. return {requested_format_id: 0}
  3734. }
  3735. const b0 = {
  3736. encode(u, e = r.Writer.create()) {
  3737. return u.requested_format_id !== 0 && e.uint32(16).int32(u.requested_format_id), e
  3738. }, decode(u, e) {
  3739. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3740. let o = e === void 0 ? i.len : i.pos + e;
  3741. const a = L3();
  3742. for (; i.pos < o;) {
  3743. const t = i.uint32();
  3744. switch (t >>> 3) {
  3745. case 2:
  3746. if (t !== 16) break;
  3747. a.requested_format_id = i.int32();
  3748. continue
  3749. }
  3750. if ((t & 7) === 4 || t === 0) break;
  3751. i.skipType(t & 7)
  3752. }
  3753. return a
  3754. }, fromJSON(u) {
  3755. return {requested_format_id: n(u.requested_format_id) ? globalThis.Number(u.requested_format_id) : 0}
  3756. }, toJSON(u) {
  3757. const e = {};
  3758. return u.requested_format_id !== 0 && (e.requested_format_id = Math.round(u.requested_format_id)), e
  3759. }, create(u) {
  3760. return b0.fromPartial(u != null ? u : {})
  3761. }, fromPartial(u) {
  3762. var i;
  3763. const e = L3();
  3764. return e.requested_format_id = (i = u.requested_format_id) != null ? i : 0, e
  3765. }
  3766. };
  3767. function W3() {
  3768. return {msg_flags: 0, format_data: new Uint8Array(0)}
  3769. }
  3770. const w0 = {
  3771. encode(u, e = r.Writer.create()) {
  3772. 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
  3773. }, decode(u, e) {
  3774. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3775. let o = e === void 0 ? i.len : i.pos + e;
  3776. const a = W3();
  3777. for (; i.pos < o;) {
  3778. const t = i.uint32();
  3779. switch (t >>> 3) {
  3780. case 2:
  3781. if (t !== 16) break;
  3782. a.msg_flags = i.int32();
  3783. continue;
  3784. case 3:
  3785. if (t !== 26) break;
  3786. a.format_data = i.bytes();
  3787. continue
  3788. }
  3789. if ((t & 7) === 4 || t === 0) break;
  3790. i.skipType(t & 7)
  3791. }
  3792. return a
  3793. }, fromJSON(u) {
  3794. return {
  3795. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3796. format_data: n(u.format_data) ? R(u.format_data) : new Uint8Array(0)
  3797. }
  3798. }, toJSON(u) {
  3799. const e = {};
  3800. return u.msg_flags !== 0 && (e.msg_flags = Math.round(u.msg_flags)), u.format_data.length !== 0 && (e.format_data = I(u.format_data)), e
  3801. }, create(u) {
  3802. return w0.fromPartial(u != null ? u : {})
  3803. }, fromPartial(u) {
  3804. var i, o;
  3805. const e = W3();
  3806. return e.msg_flags = (i = u.msg_flags) != null ? i : 0, e.format_data = (o = u.format_data) != null ? o : new Uint8Array(0), e
  3807. }
  3808. };
  3809. function V3() {
  3810. return {
  3811. stream_id: 0,
  3812. list_index: 0,
  3813. dw_flags: 0,
  3814. n_position_low: 0,
  3815. n_position_high: 0,
  3816. cb_requested: 0,
  3817. have_clip_data_id: !1,
  3818. clip_data_id: 0
  3819. }
  3820. }
  3821. const S0 = {
  3822. encode(u, e = r.Writer.create()) {
  3823. 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
  3824. }, decode(u, e) {
  3825. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3826. let o = e === void 0 ? i.len : i.pos + e;
  3827. const a = V3();
  3828. for (; i.pos < o;) {
  3829. const t = i.uint32();
  3830. switch (t >>> 3) {
  3831. case 2:
  3832. if (t !== 16) break;
  3833. a.stream_id = i.int32();
  3834. continue;
  3835. case 3:
  3836. if (t !== 24) break;
  3837. a.list_index = i.int32();
  3838. continue;
  3839. case 4:
  3840. if (t !== 32) break;
  3841. a.dw_flags = i.int32();
  3842. continue;
  3843. case 5:
  3844. if (t !== 40) break;
  3845. a.n_position_low = i.int32();
  3846. continue;
  3847. case 6:
  3848. if (t !== 48) break;
  3849. a.n_position_high = i.int32();
  3850. continue;
  3851. case 7:
  3852. if (t !== 56) break;
  3853. a.cb_requested = i.int32();
  3854. continue;
  3855. case 8:
  3856. if (t !== 64) break;
  3857. a.have_clip_data_id = i.bool();
  3858. continue;
  3859. case 9:
  3860. if (t !== 72) break;
  3861. a.clip_data_id = i.int32();
  3862. continue
  3863. }
  3864. if ((t & 7) === 4 || t === 0) break;
  3865. i.skipType(t & 7)
  3866. }
  3867. return a
  3868. }, fromJSON(u) {
  3869. return {
  3870. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3871. list_index: n(u.list_index) ? globalThis.Number(u.list_index) : 0,
  3872. dw_flags: n(u.dw_flags) ? globalThis.Number(u.dw_flags) : 0,
  3873. n_position_low: n(u.n_position_low) ? globalThis.Number(u.n_position_low) : 0,
  3874. n_position_high: n(u.n_position_high) ? globalThis.Number(u.n_position_high) : 0,
  3875. cb_requested: n(u.cb_requested) ? globalThis.Number(u.cb_requested) : 0,
  3876. have_clip_data_id: n(u.have_clip_data_id) ? globalThis.Boolean(u.have_clip_data_id) : !1,
  3877. clip_data_id: n(u.clip_data_id) ? globalThis.Number(u.clip_data_id) : 0
  3878. }
  3879. }, toJSON(u) {
  3880. const e = {};
  3881. 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
  3882. }, create(u) {
  3883. return S0.fromPartial(u != null ? u : {})
  3884. }, fromPartial(u) {
  3885. var i, o, a, t, s, l, E, c;
  3886. const e = V3();
  3887. 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
  3888. }
  3889. };
  3890. function q3() {
  3891. return {msg_flags: 0, stream_id: 0, requested_data: new Uint8Array(0)}
  3892. }
  3893. const z0 = {
  3894. encode(u, e = r.Writer.create()) {
  3895. 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
  3896. }, decode(u, e) {
  3897. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3898. let o = e === void 0 ? i.len : i.pos + e;
  3899. const a = q3();
  3900. for (; i.pos < o;) {
  3901. const t = i.uint32();
  3902. switch (t >>> 3) {
  3903. case 3:
  3904. if (t !== 24) break;
  3905. a.msg_flags = i.int32();
  3906. continue;
  3907. case 4:
  3908. if (t !== 32) break;
  3909. a.stream_id = i.int32();
  3910. continue;
  3911. case 5:
  3912. if (t !== 42) break;
  3913. a.requested_data = i.bytes();
  3914. continue
  3915. }
  3916. if ((t & 7) === 4 || t === 0) break;
  3917. i.skipType(t & 7)
  3918. }
  3919. return a
  3920. }, fromJSON(u) {
  3921. return {
  3922. msg_flags: n(u.msg_flags) ? globalThis.Number(u.msg_flags) : 0,
  3923. stream_id: n(u.stream_id) ? globalThis.Number(u.stream_id) : 0,
  3924. requested_data: n(u.requested_data) ? R(u.requested_data) : new Uint8Array(0)
  3925. }
  3926. }, toJSON(u) {
  3927. const e = {};
  3928. 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 = I(u.requested_data)), e
  3929. }, create(u) {
  3930. return z0.fromPartial(u != null ? u : {})
  3931. }, fromPartial(u) {
  3932. var i, o, a;
  3933. const e = q3();
  3934. 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
  3935. }
  3936. };
  3937. function K3() {
  3938. return {
  3939. ready: void 0,
  3940. format_list: void 0,
  3941. format_list_response: void 0,
  3942. format_data_request: void 0,
  3943. format_data_response: void 0,
  3944. file_contents_request: void 0,
  3945. file_contents_response: void 0
  3946. }
  3947. }
  3948. const P0 = {
  3949. encode(u, e = r.Writer.create()) {
  3950. return u.ready !== void 0 && h0.encode(u.ready, e.uint32(10).fork()).ldelim(), u.format_list !== void 0 && x0.encode(u.format_list, e.uint32(18).fork()).ldelim(), u.format_list_response !== void 0 && y0.encode(u.format_list_response, e.uint32(26).fork()).ldelim(), u.format_data_request !== void 0 && b0.encode(u.format_data_request, e.uint32(34).fork()).ldelim(), u.format_data_response !== void 0 && w0.encode(u.format_data_response, e.uint32(42).fork()).ldelim(), u.file_contents_request !== void 0 && S0.encode(u.file_contents_request, e.uint32(50).fork()).ldelim(), u.file_contents_response !== void 0 && z0.encode(u.file_contents_response, e.uint32(58).fork()).ldelim(), e
  3951. }, decode(u, e) {
  3952. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  3953. let o = e === void 0 ? i.len : i.pos + e;
  3954. const a = K3();
  3955. for (; i.pos < o;) {
  3956. const t = i.uint32();
  3957. switch (t >>> 3) {
  3958. case 1:
  3959. if (t !== 10) break;
  3960. a.ready = h0.decode(i, i.uint32());
  3961. continue;
  3962. case 2:
  3963. if (t !== 18) break;
  3964. a.format_list = x0.decode(i, i.uint32());
  3965. continue;
  3966. case 3:
  3967. if (t !== 26) break;
  3968. a.format_list_response = y0.decode(i, i.uint32());
  3969. continue;
  3970. case 4:
  3971. if (t !== 34) break;
  3972. a.format_data_request = b0.decode(i, i.uint32());
  3973. continue;
  3974. case 5:
  3975. if (t !== 42) break;
  3976. a.format_data_response = w0.decode(i, i.uint32());
  3977. continue;
  3978. case 6:
  3979. if (t !== 50) break;
  3980. a.file_contents_request = S0.decode(i, i.uint32());
  3981. continue;
  3982. case 7:
  3983. if (t !== 58) break;
  3984. a.file_contents_response = z0.decode(i, i.uint32());
  3985. continue
  3986. }
  3987. if ((t & 7) === 4 || t === 0) break;
  3988. i.skipType(t & 7)
  3989. }
  3990. return a
  3991. }, fromJSON(u) {
  3992. return {
  3993. ready: n(u.ready) ? h0.fromJSON(u.ready) : void 0,
  3994. format_list: n(u.format_list) ? x0.fromJSON(u.format_list) : void 0,
  3995. format_list_response: n(u.format_list_response) ? y0.fromJSON(u.format_list_response) : void 0,
  3996. format_data_request: n(u.format_data_request) ? b0.fromJSON(u.format_data_request) : void 0,
  3997. format_data_response: n(u.format_data_response) ? w0.fromJSON(u.format_data_response) : void 0,
  3998. file_contents_request: n(u.file_contents_request) ? S0.fromJSON(u.file_contents_request) : void 0,
  3999. file_contents_response: n(u.file_contents_response) ? z0.fromJSON(u.file_contents_response) : void 0
  4000. }
  4001. }, toJSON(u) {
  4002. const e = {};
  4003. return u.ready !== void 0 && (e.ready = h0.toJSON(u.ready)), u.format_list !== void 0 && (e.format_list = x0.toJSON(u.format_list)), u.format_list_response !== void 0 && (e.format_list_response = y0.toJSON(u.format_list_response)), u.format_data_request !== void 0 && (e.format_data_request = b0.toJSON(u.format_data_request)), u.format_data_response !== void 0 && (e.format_data_response = w0.toJSON(u.format_data_response)), u.file_contents_request !== void 0 && (e.file_contents_request = S0.toJSON(u.file_contents_request)), u.file_contents_response !== void 0 && (e.file_contents_response = z0.toJSON(u.file_contents_response)), e
  4004. }, create(u) {
  4005. return P0.fromPartial(u != null ? u : {})
  4006. }, fromPartial(u) {
  4007. const e = K3();
  4008. return e.ready = u.ready !== void 0 && u.ready !== null ? h0.fromPartial(u.ready) : void 0, e.format_list = u.format_list !== void 0 && u.format_list !== null ? x0.fromPartial(u.format_list) : void 0, e.format_list_response = u.format_list_response !== void 0 && u.format_list_response !== null ? y0.fromPartial(u.format_list_response) : void 0, e.format_data_request = u.format_data_request !== void 0 && u.format_data_request !== null ? b0.fromPartial(u.format_data_request) : void 0, e.format_data_response = u.format_data_response !== void 0 && u.format_data_response !== null ? w0.fromPartial(u.format_data_response) : void 0, e.file_contents_request = u.file_contents_request !== void 0 && u.file_contents_request !== null ? S0.fromPartial(u.file_contents_request) : void 0, e.file_contents_response = u.file_contents_response !== void 0 && u.file_contents_response !== null ? z0.fromPartial(u.file_contents_response) : void 0, e
  4009. }
  4010. };
  4011. function H3() {
  4012. return {width: 0, height: 0}
  4013. }
  4014. const v = {
  4015. encode(u, e = r.Writer.create()) {
  4016. return u.width !== 0 && e.uint32(8).int32(u.width), u.height !== 0 && e.uint32(16).int32(u.height), e
  4017. }, decode(u, e) {
  4018. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4019. let o = e === void 0 ? i.len : i.pos + e;
  4020. const a = H3();
  4021. for (; i.pos < o;) {
  4022. const t = i.uint32();
  4023. switch (t >>> 3) {
  4024. case 1:
  4025. if (t !== 8) break;
  4026. a.width = i.int32();
  4027. continue;
  4028. case 2:
  4029. if (t !== 16) break;
  4030. a.height = i.int32();
  4031. continue
  4032. }
  4033. if ((t & 7) === 4 || t === 0) break;
  4034. i.skipType(t & 7)
  4035. }
  4036. return a
  4037. }, fromJSON(u) {
  4038. return {
  4039. width: n(u.width) ? globalThis.Number(u.width) : 0,
  4040. height: n(u.height) ? globalThis.Number(u.height) : 0
  4041. }
  4042. }, toJSON(u) {
  4043. const e = {};
  4044. return u.width !== 0 && (e.width = Math.round(u.width)), u.height !== 0 && (e.height = Math.round(u.height)), e
  4045. }, create(u) {
  4046. return v.fromPartial(u != null ? u : {})
  4047. }, fromPartial(u) {
  4048. var i, o;
  4049. const e = H3();
  4050. return e.width = (i = u.width) != null ? i : 0, e.height = (o = u.height) != null ? o : 0, e
  4051. }
  4052. };
  4053. function J3() {
  4054. return {display: 0, resolution: void 0}
  4055. }
  4056. const Ou = {
  4057. encode(u, e = r.Writer.create()) {
  4058. return u.display !== 0 && e.uint32(8).int32(u.display), u.resolution !== void 0 && v.encode(u.resolution, e.uint32(18).fork()).ldelim(), e
  4059. }, decode(u, e) {
  4060. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4061. let o = e === void 0 ? i.len : i.pos + e;
  4062. const a = J3();
  4063. for (; i.pos < o;) {
  4064. const t = i.uint32();
  4065. switch (t >>> 3) {
  4066. case 1:
  4067. if (t !== 8) break;
  4068. a.display = i.int32();
  4069. continue;
  4070. case 2:
  4071. if (t !== 18) break;
  4072. a.resolution = v.decode(i, i.uint32());
  4073. continue
  4074. }
  4075. if ((t & 7) === 4 || t === 0) break;
  4076. i.skipType(t & 7)
  4077. }
  4078. return a
  4079. }, fromJSON(u) {
  4080. return {
  4081. display: n(u.display) ? globalThis.Number(u.display) : 0,
  4082. resolution: n(u.resolution) ? v.fromJSON(u.resolution) : void 0
  4083. }
  4084. }, toJSON(u) {
  4085. const e = {};
  4086. return u.display !== 0 && (e.display = Math.round(u.display)), u.resolution !== void 0 && (e.resolution = v.toJSON(u.resolution)), e
  4087. }, create(u) {
  4088. return Ou.fromPartial(u != null ? u : {})
  4089. }, fromPartial(u) {
  4090. var i;
  4091. const e = J3();
  4092. 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
  4093. }
  4094. };
  4095. function G3() {
  4096. return {resolutions: []}
  4097. }
  4098. const uu = {
  4099. encode(u, e = r.Writer.create()) {
  4100. for (const i of u.resolutions) v.encode(i, e.uint32(10).fork()).ldelim();
  4101. return e
  4102. }, decode(u, e) {
  4103. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4104. let o = e === void 0 ? i.len : i.pos + e;
  4105. const a = G3();
  4106. for (; i.pos < o;) {
  4107. const t = i.uint32();
  4108. switch (t >>> 3) {
  4109. case 1:
  4110. if (t !== 10) break;
  4111. a.resolutions.push(v.decode(i, i.uint32()));
  4112. continue
  4113. }
  4114. if ((t & 7) === 4 || t === 0) break;
  4115. i.skipType(t & 7)
  4116. }
  4117. return a
  4118. }, fromJSON(u) {
  4119. return {resolutions: globalThis.Array.isArray(u == null ? void 0 : u.resolutions) ? u.resolutions.map(e => v.fromJSON(e)) : []}
  4120. }, toJSON(u) {
  4121. var i;
  4122. const e = {};
  4123. return (i = u.resolutions) != null && i.length && (e.resolutions = u.resolutions.map(o => v.toJSON(o))), e
  4124. }, create(u) {
  4125. return uu.fromPartial(u != null ? u : {})
  4126. }, fromPartial(u) {
  4127. var i;
  4128. const e = G3();
  4129. return e.resolutions = ((i = u.resolutions) == null ? void 0 : i.map(o => v.fromPartial(o))) || [], e
  4130. }
  4131. };
  4132. function Z3() {
  4133. return {
  4134. display: 0,
  4135. x: 0,
  4136. y: 0,
  4137. width: 0,
  4138. height: 0,
  4139. cursor_embedded: !1,
  4140. resolutions: void 0,
  4141. original_resolution: void 0
  4142. }
  4143. }
  4144. const Mu = {
  4145. encode(u, e = r.Writer.create()) {
  4146. 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 && uu.encode(u.resolutions, e.uint32(58).fork()).ldelim(), u.original_resolution !== void 0 && v.encode(u.original_resolution, e.uint32(66).fork()).ldelim(), e
  4147. }, decode(u, e) {
  4148. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4149. let o = e === void 0 ? i.len : i.pos + e;
  4150. const a = Z3();
  4151. for (; i.pos < o;) {
  4152. const t = i.uint32();
  4153. switch (t >>> 3) {
  4154. case 1:
  4155. if (t !== 8) break;
  4156. a.display = i.int32();
  4157. continue;
  4158. case 2:
  4159. if (t !== 16) break;
  4160. a.x = i.sint32();
  4161. continue;
  4162. case 3:
  4163. if (t !== 24) break;
  4164. a.y = i.sint32();
  4165. continue;
  4166. case 4:
  4167. if (t !== 32) break;
  4168. a.width = i.int32();
  4169. continue;
  4170. case 5:
  4171. if (t !== 40) break;
  4172. a.height = i.int32();
  4173. continue;
  4174. case 6:
  4175. if (t !== 48) break;
  4176. a.cursor_embedded = i.bool();
  4177. continue;
  4178. case 7:
  4179. if (t !== 58) break;
  4180. a.resolutions = uu.decode(i, i.uint32());
  4181. continue;
  4182. case 8:
  4183. if (t !== 66) break;
  4184. a.original_resolution = v.decode(i, i.uint32());
  4185. continue
  4186. }
  4187. if ((t & 7) === 4 || t === 0) break;
  4188. i.skipType(t & 7)
  4189. }
  4190. return a
  4191. }, fromJSON(u) {
  4192. return {
  4193. display: n(u.display) ? globalThis.Number(u.display) : 0,
  4194. x: n(u.x) ? globalThis.Number(u.x) : 0,
  4195. y: n(u.y) ? globalThis.Number(u.y) : 0,
  4196. width: n(u.width) ? globalThis.Number(u.width) : 0,
  4197. height: n(u.height) ? globalThis.Number(u.height) : 0,
  4198. cursor_embedded: n(u.cursor_embedded) ? globalThis.Boolean(u.cursor_embedded) : !1,
  4199. resolutions: n(u.resolutions) ? uu.fromJSON(u.resolutions) : void 0,
  4200. original_resolution: n(u.original_resolution) ? v.fromJSON(u.original_resolution) : void 0
  4201. }
  4202. }, toJSON(u) {
  4203. const e = {};
  4204. 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 = uu.toJSON(u.resolutions)), u.original_resolution !== void 0 && (e.original_resolution = v.toJSON(u.original_resolution)), e
  4205. }, create(u) {
  4206. return Mu.fromPartial(u != null ? u : {})
  4207. }, fromPartial(u) {
  4208. var i, o, a, t, s, l;
  4209. const e = Z3();
  4210. 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 ? uu.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
  4211. }
  4212. };
  4213. function Q3() {
  4214. return {add: [], sub: [], set: []}
  4215. }
  4216. const Uu = {
  4217. encode(u, e = r.Writer.create()) {
  4218. e.uint32(10).fork();
  4219. for (const i of u.add) e.int32(i);
  4220. e.ldelim(), e.uint32(18).fork();
  4221. for (const i of u.sub) e.int32(i);
  4222. e.ldelim(), e.uint32(26).fork();
  4223. for (const i of u.set) e.int32(i);
  4224. return e.ldelim(), e
  4225. }, decode(u, e) {
  4226. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4227. let o = e === void 0 ? i.len : i.pos + e;
  4228. const a = Q3();
  4229. for (; i.pos < o;) {
  4230. const t = i.uint32();
  4231. switch (t >>> 3) {
  4232. case 1:
  4233. if (t === 8) {
  4234. a.add.push(i.int32());
  4235. continue
  4236. }
  4237. if (t === 10) {
  4238. const s = i.uint32() + i.pos;
  4239. for (; i.pos < s;) a.add.push(i.int32());
  4240. continue
  4241. }
  4242. break;
  4243. case 2:
  4244. if (t === 16) {
  4245. a.sub.push(i.int32());
  4246. continue
  4247. }
  4248. if (t === 18) {
  4249. const s = i.uint32() + i.pos;
  4250. for (; i.pos < s;) a.sub.push(i.int32());
  4251. continue
  4252. }
  4253. break;
  4254. case 3:
  4255. if (t === 24) {
  4256. a.set.push(i.int32());
  4257. continue
  4258. }
  4259. if (t === 26) {
  4260. const s = i.uint32() + i.pos;
  4261. for (; i.pos < s;) a.set.push(i.int32());
  4262. continue
  4263. }
  4264. break
  4265. }
  4266. if ((t & 7) === 4 || t === 0) break;
  4267. i.skipType(t & 7)
  4268. }
  4269. return a
  4270. }, fromJSON(u) {
  4271. return {
  4272. add: globalThis.Array.isArray(u == null ? void 0 : u.add) ? u.add.map(e => globalThis.Number(e)) : [],
  4273. sub: globalThis.Array.isArray(u == null ? void 0 : u.sub) ? u.sub.map(e => globalThis.Number(e)) : [],
  4274. set: globalThis.Array.isArray(u == null ? void 0 : u.set) ? u.set.map(e => globalThis.Number(e)) : []
  4275. }
  4276. }, toJSON(u) {
  4277. var i, o, a;
  4278. const e = {};
  4279. 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
  4280. }, create(u) {
  4281. return Uu.fromPartial(u != null ? u : {})
  4282. }, fromPartial(u) {
  4283. var i, o, a;
  4284. const e = Q3();
  4285. 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
  4286. }
  4287. };
  4288. function X3() {
  4289. return {display: 0, on: !1}
  4290. }
  4291. const Lu = {
  4292. encode(u, e = r.Writer.create()) {
  4293. return u.display !== 0 && e.uint32(8).int32(u.display), u.on !== !1 && e.uint32(16).bool(u.on), e
  4294. }, decode(u, e) {
  4295. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4296. let o = e === void 0 ? i.len : i.pos + e;
  4297. const a = X3();
  4298. for (; i.pos < o;) {
  4299. const t = i.uint32();
  4300. switch (t >>> 3) {
  4301. case 1:
  4302. if (t !== 8) break;
  4303. a.display = i.int32();
  4304. continue;
  4305. case 2:
  4306. if (t !== 16) break;
  4307. a.on = i.bool();
  4308. continue
  4309. }
  4310. if ((t & 7) === 4 || t === 0) break;
  4311. i.skipType(t & 7)
  4312. }
  4313. return a
  4314. }, fromJSON(u) {
  4315. return {display: n(u.display) ? globalThis.Number(u.display) : 0, on: n(u.on) ? globalThis.Boolean(u.on) : !1}
  4316. }, toJSON(u) {
  4317. const e = {};
  4318. return u.display !== 0 && (e.display = Math.round(u.display)), u.on !== !1 && (e.on = u.on), e
  4319. }, create(u) {
  4320. return Lu.fromPartial(u != null ? u : {})
  4321. }, fromPartial(u) {
  4322. var i, o;
  4323. const e = X3();
  4324. return e.display = (i = u.display) != null ? i : 0, e.on = (o = u.on) != null ? o : !1, e
  4325. }
  4326. };
  4327. function Y3() {
  4328. return {impl_key: "", on: !1}
  4329. }
  4330. const Wu = {
  4331. encode(u, e = r.Writer.create()) {
  4332. return u.impl_key !== "" && e.uint32(10).string(u.impl_key), u.on !== !1 && e.uint32(16).bool(u.on), e
  4333. }, decode(u, e) {
  4334. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4335. let o = e === void 0 ? i.len : i.pos + e;
  4336. const a = Y3();
  4337. for (; i.pos < o;) {
  4338. const t = i.uint32();
  4339. switch (t >>> 3) {
  4340. case 1:
  4341. if (t !== 10) break;
  4342. a.impl_key = i.string();
  4343. continue;
  4344. case 2:
  4345. if (t !== 16) break;
  4346. a.on = i.bool();
  4347. continue
  4348. }
  4349. if ((t & 7) === 4 || t === 0) break;
  4350. i.skipType(t & 7)
  4351. }
  4352. return a
  4353. }, fromJSON(u) {
  4354. return {
  4355. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : "",
  4356. on: n(u.on) ? globalThis.Boolean(u.on) : !1
  4357. }
  4358. }, toJSON(u) {
  4359. const e = {};
  4360. return u.impl_key !== "" && (e.impl_key = u.impl_key), u.on !== !1 && (e.on = u.on), e
  4361. }, create(u) {
  4362. return Wu.fromPartial(u != null ? u : {})
  4363. }, fromPartial(u) {
  4364. var i, o;
  4365. const e = Y3();
  4366. return e.impl_key = (i = u.impl_key) != null ? i : "", e.on = (o = u.on) != null ? o : !1, e
  4367. }
  4368. };
  4369. function $3() {
  4370. return {permission: 0, enabled: !1}
  4371. }
  4372. const R0 = {
  4373. encode(u, e = r.Writer.create()) {
  4374. return u.permission !== 0 && e.uint32(8).int32(u.permission), u.enabled !== !1 && e.uint32(16).bool(u.enabled), e
  4375. }, decode(u, e) {
  4376. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4377. let o = e === void 0 ? i.len : i.pos + e;
  4378. const a = $3();
  4379. for (; i.pos < o;) {
  4380. const t = i.uint32();
  4381. switch (t >>> 3) {
  4382. case 1:
  4383. if (t !== 8) break;
  4384. a.permission = i.int32();
  4385. continue;
  4386. case 2:
  4387. if (t !== 16) break;
  4388. a.enabled = i.bool();
  4389. continue
  4390. }
  4391. if ((t & 7) === 4 || t === 0) break;
  4392. i.skipType(t & 7)
  4393. }
  4394. return a
  4395. }, fromJSON(u) {
  4396. return {
  4397. permission: n(u.permission) ? Fa(u.permission) : 0,
  4398. enabled: n(u.enabled) ? globalThis.Boolean(u.enabled) : !1
  4399. }
  4400. }, toJSON(u) {
  4401. const e = {};
  4402. return u.permission !== 0 && (e.permission = _a(u.permission)), u.enabled !== !1 && (e.enabled = u.enabled), e
  4403. }, create(u) {
  4404. return R0.fromPartial(u != null ? u : {})
  4405. }, fromPartial(u) {
  4406. var i, o;
  4407. const e = $3();
  4408. return e.permission = (i = u.permission) != null ? i : 0, e.enabled = (o = u.enabled) != null ? o : !1, e
  4409. }
  4410. };
  4411. function ui() {
  4412. return {
  4413. ability_vp9: 0,
  4414. ability_h264: 0,
  4415. ability_h265: 0,
  4416. prefer: 0,
  4417. ability_vp8: 0,
  4418. ability_av1: 0,
  4419. i444: void 0,
  4420. prefer_chroma: 0
  4421. }
  4422. }
  4423. const Vu = {
  4424. encode(u, e = r.Writer.create()) {
  4425. 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
  4426. }, decode(u, e) {
  4427. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4428. let o = e === void 0 ? i.len : i.pos + e;
  4429. const a = ui();
  4430. for (; i.pos < o;) {
  4431. const t = i.uint32();
  4432. switch (t >>> 3) {
  4433. case 1:
  4434. if (t !== 8) break;
  4435. a.ability_vp9 = i.int32();
  4436. continue;
  4437. case 2:
  4438. if (t !== 16) break;
  4439. a.ability_h264 = i.int32();
  4440. continue;
  4441. case 3:
  4442. if (t !== 24) break;
  4443. a.ability_h265 = i.int32();
  4444. continue;
  4445. case 4:
  4446. if (t !== 32) break;
  4447. a.prefer = i.int32();
  4448. continue;
  4449. case 5:
  4450. if (t !== 40) break;
  4451. a.ability_vp8 = i.int32();
  4452. continue;
  4453. case 6:
  4454. if (t !== 48) break;
  4455. a.ability_av1 = i.int32();
  4456. continue;
  4457. case 7:
  4458. if (t !== 58) break;
  4459. a.i444 = J.decode(i, i.uint32());
  4460. continue;
  4461. case 8:
  4462. if (t !== 64) break;
  4463. a.prefer_chroma = i.int32();
  4464. continue
  4465. }
  4466. if ((t & 7) === 4 || t === 0) break;
  4467. i.skipType(t & 7)
  4468. }
  4469. return a
  4470. }, fromJSON(u) {
  4471. return {
  4472. ability_vp9: n(u.ability_vp9) ? globalThis.Number(u.ability_vp9) : 0,
  4473. ability_h264: n(u.ability_h264) ? globalThis.Number(u.ability_h264) : 0,
  4474. ability_h265: n(u.ability_h265) ? globalThis.Number(u.ability_h265) : 0,
  4475. prefer: n(u.prefer) ? va(u.prefer) : 0,
  4476. ability_vp8: n(u.ability_vp8) ? globalThis.Number(u.ability_vp8) : 0,
  4477. ability_av1: n(u.ability_av1) ? globalThis.Number(u.ability_av1) : 0,
  4478. i444: n(u.i444) ? J.fromJSON(u.i444) : void 0,
  4479. prefer_chroma: n(u.prefer_chroma) ? la(u.prefer_chroma) : 0
  4480. }
  4481. }, toJSON(u) {
  4482. const e = {};
  4483. 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 = ka(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 = Ea(u.prefer_chroma)), e
  4484. }, create(u) {
  4485. return Vu.fromPartial(u != null ? u : {})
  4486. }, fromPartial(u) {
  4487. var i, o, a, t, s, l, E;
  4488. const e = ui();
  4489. 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
  4490. }
  4491. };
  4492. function ei() {
  4493. return {
  4494. image_quality: 0,
  4495. lock_after_session_end: 0,
  4496. show_remote_cursor: 0,
  4497. privacy_mode: 0,
  4498. block_input: 0,
  4499. custom_image_quality: 0,
  4500. disable_audio: 0,
  4501. disable_clipboard: 0,
  4502. enable_file_transfer: 0,
  4503. supported_decoding: void 0,
  4504. custom_fps: 0,
  4505. disable_keyboard: 0,
  4506. follow_remote_cursor: 0,
  4507. follow_remote_window: 0
  4508. }
  4509. }
  4510. const z = {
  4511. encode(u, e = r.Writer.create()) {
  4512. 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 && Vu.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
  4513. }, decode(u, e) {
  4514. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4515. let o = e === void 0 ? i.len : i.pos + e;
  4516. const a = ei();
  4517. for (; i.pos < o;) {
  4518. const t = i.uint32();
  4519. switch (t >>> 3) {
  4520. case 1:
  4521. if (t !== 8) break;
  4522. a.image_quality = i.int32();
  4523. continue;
  4524. case 2:
  4525. if (t !== 16) break;
  4526. a.lock_after_session_end = i.int32();
  4527. continue;
  4528. case 3:
  4529. if (t !== 24) break;
  4530. a.show_remote_cursor = i.int32();
  4531. continue;
  4532. case 4:
  4533. if (t !== 32) break;
  4534. a.privacy_mode = i.int32();
  4535. continue;
  4536. case 5:
  4537. if (t !== 40) break;
  4538. a.block_input = i.int32();
  4539. continue;
  4540. case 6:
  4541. if (t !== 48) break;
  4542. a.custom_image_quality = i.int32();
  4543. continue;
  4544. case 7:
  4545. if (t !== 56) break;
  4546. a.disable_audio = i.int32();
  4547. continue;
  4548. case 8:
  4549. if (t !== 64) break;
  4550. a.disable_clipboard = i.int32();
  4551. continue;
  4552. case 9:
  4553. if (t !== 72) break;
  4554. a.enable_file_transfer = i.int32();
  4555. continue;
  4556. case 10:
  4557. if (t !== 82) break;
  4558. a.supported_decoding = Vu.decode(i, i.uint32());
  4559. continue;
  4560. case 11:
  4561. if (t !== 88) break;
  4562. a.custom_fps = i.int32();
  4563. continue;
  4564. case 12:
  4565. if (t !== 96) break;
  4566. a.disable_keyboard = i.int32();
  4567. continue;
  4568. case 15:
  4569. if (t !== 120) break;
  4570. a.follow_remote_cursor = i.int32();
  4571. continue;
  4572. case 16:
  4573. if (t !== 128) break;
  4574. a.follow_remote_window = i.int32();
  4575. continue
  4576. }
  4577. if ((t & 7) === 4 || t === 0) break;
  4578. i.skipType(t & 7)
  4579. }
  4580. return a
  4581. }, fromJSON(u) {
  4582. return {
  4583. image_quality: n(u.image_quality) ? ma(u.image_quality) : 0,
  4584. lock_after_session_end: n(u.lock_after_session_end) ? tu(u.lock_after_session_end) : 0,
  4585. show_remote_cursor: n(u.show_remote_cursor) ? tu(u.show_remote_cursor) : 0,
  4586. privacy_mode: n(u.privacy_mode) ? tu(u.privacy_mode) : 0,
  4587. block_input: n(u.block_input) ? tu(u.block_input) : 0,
  4588. custom_image_quality: n(u.custom_image_quality) ? globalThis.Number(u.custom_image_quality) : 0,
  4589. disable_audio: n(u.disable_audio) ? tu(u.disable_audio) : 0,
  4590. disable_clipboard: n(u.disable_clipboard) ? tu(u.disable_clipboard) : 0,
  4591. enable_file_transfer: n(u.enable_file_transfer) ? tu(u.enable_file_transfer) : 0,
  4592. supported_decoding: n(u.supported_decoding) ? Vu.fromJSON(u.supported_decoding) : void 0,
  4593. custom_fps: n(u.custom_fps) ? globalThis.Number(u.custom_fps) : 0,
  4594. disable_keyboard: n(u.disable_keyboard) ? tu(u.disable_keyboard) : 0,
  4595. follow_remote_cursor: n(u.follow_remote_cursor) ? tu(u.follow_remote_cursor) : 0,
  4596. follow_remote_window: n(u.follow_remote_window) ? tu(u.follow_remote_window) : 0
  4597. }
  4598. }, toJSON(u) {
  4599. const e = {};
  4600. return u.image_quality !== 0 && (e.image_quality = Aa(u.image_quality)), u.lock_after_session_end !== 0 && (e.lock_after_session_end = au(u.lock_after_session_end)), u.show_remote_cursor !== 0 && (e.show_remote_cursor = au(u.show_remote_cursor)), u.privacy_mode !== 0 && (e.privacy_mode = au(u.privacy_mode)), u.block_input !== 0 && (e.block_input = au(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 = au(u.disable_audio)), u.disable_clipboard !== 0 && (e.disable_clipboard = au(u.disable_clipboard)), u.enable_file_transfer !== 0 && (e.enable_file_transfer = au(u.enable_file_transfer)), u.supported_decoding !== void 0 && (e.supported_decoding = Vu.toJSON(u.supported_decoding)), u.custom_fps !== 0 && (e.custom_fps = Math.round(u.custom_fps)), u.disable_keyboard !== 0 && (e.disable_keyboard = au(u.disable_keyboard)), u.follow_remote_cursor !== 0 && (e.follow_remote_cursor = au(u.follow_remote_cursor)), u.follow_remote_window !== 0 && (e.follow_remote_window = au(u.follow_remote_window)), e
  4601. }, create(u) {
  4602. return z.fromPartial(u != null ? u : {})
  4603. }, fromPartial(u) {
  4604. var i, o, a, t, s, l, E, c, C, D, B, F, y;
  4605. const e = ei();
  4606. 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 ? Vu.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 = (F = u.follow_remote_cursor) != null ? F : 0, e.follow_remote_window = (y = u.follow_remote_window) != null ? y : 0, e
  4607. }
  4608. };
  4609. function ii() {
  4610. return {time: 0, from_client: !1, last_delay: 0, target_bitrate: 0}
  4611. }
  4612. const I0 = {
  4613. encode(u, e = r.Writer.create()) {
  4614. 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
  4615. }, decode(u, e) {
  4616. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4617. let o = e === void 0 ? i.len : i.pos + e;
  4618. const a = ii();
  4619. for (; i.pos < o;) {
  4620. const t = i.uint32();
  4621. switch (t >>> 3) {
  4622. case 1:
  4623. if (t !== 8) break;
  4624. a.time = V(i.int64());
  4625. continue;
  4626. case 2:
  4627. if (t !== 16) break;
  4628. a.from_client = i.bool();
  4629. continue;
  4630. case 3:
  4631. if (t !== 24) break;
  4632. a.last_delay = i.uint32();
  4633. continue;
  4634. case 4:
  4635. if (t !== 32) break;
  4636. a.target_bitrate = i.uint32();
  4637. continue
  4638. }
  4639. if ((t & 7) === 4 || t === 0) break;
  4640. i.skipType(t & 7)
  4641. }
  4642. return a
  4643. }, fromJSON(u) {
  4644. return {
  4645. time: n(u.time) ? globalThis.Number(u.time) : 0,
  4646. from_client: n(u.from_client) ? globalThis.Boolean(u.from_client) : !1,
  4647. last_delay: n(u.last_delay) ? globalThis.Number(u.last_delay) : 0,
  4648. target_bitrate: n(u.target_bitrate) ? globalThis.Number(u.target_bitrate) : 0
  4649. }
  4650. }, toJSON(u) {
  4651. const e = {};
  4652. 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
  4653. }, create(u) {
  4654. return I0.fromPartial(u != null ? u : {})
  4655. }, fromPartial(u) {
  4656. var i, o, a, t;
  4657. const e = ii();
  4658. 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
  4659. }
  4660. };
  4661. function ti() {
  4662. return {asymmetric_value: new Uint8Array(0), symmetric_value: new Uint8Array(0)}
  4663. }
  4664. const K = {
  4665. encode(u, e = r.Writer.create()) {
  4666. 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
  4667. }, decode(u, e) {
  4668. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4669. let o = e === void 0 ? i.len : i.pos + e;
  4670. const a = ti();
  4671. for (; i.pos < o;) {
  4672. const t = i.uint32();
  4673. switch (t >>> 3) {
  4674. case 1:
  4675. if (t !== 10) break;
  4676. a.asymmetric_value = i.bytes();
  4677. continue;
  4678. case 2:
  4679. if (t !== 18) break;
  4680. a.symmetric_value = i.bytes();
  4681. continue
  4682. }
  4683. if ((t & 7) === 4 || t === 0) break;
  4684. i.skipType(t & 7)
  4685. }
  4686. return a
  4687. }, fromJSON(u) {
  4688. return {
  4689. asymmetric_value: n(u.asymmetric_value) ? R(u.asymmetric_value) : new Uint8Array(0),
  4690. symmetric_value: n(u.symmetric_value) ? R(u.symmetric_value) : new Uint8Array(0)
  4691. }
  4692. }, toJSON(u) {
  4693. const e = {};
  4694. return u.asymmetric_value.length !== 0 && (e.asymmetric_value = I(u.asymmetric_value)), u.symmetric_value.length !== 0 && (e.symmetric_value = I(u.symmetric_value)), e
  4695. }, create(u) {
  4696. return K.fromPartial(u != null ? u : {})
  4697. }, fromPartial(u) {
  4698. var i, o;
  4699. const e = ti();
  4700. 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
  4701. }
  4702. };
  4703. function ai() {
  4704. return {id: new Uint8Array(0)}
  4705. }
  4706. const T0 = {
  4707. encode(u, e = r.Writer.create()) {
  4708. return u.id.length !== 0 && e.uint32(10).bytes(u.id), e
  4709. }, decode(u, e) {
  4710. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4711. let o = e === void 0 ? i.len : i.pos + e;
  4712. const a = ai();
  4713. for (; i.pos < o;) {
  4714. const t = i.uint32();
  4715. switch (t >>> 3) {
  4716. case 1:
  4717. if (t !== 10) break;
  4718. a.id = i.bytes();
  4719. continue
  4720. }
  4721. if ((t & 7) === 4 || t === 0) break;
  4722. i.skipType(t & 7)
  4723. }
  4724. return a
  4725. }, fromJSON(u) {
  4726. return {id: n(u.id) ? R(u.id) : new Uint8Array(0)}
  4727. }, toJSON(u) {
  4728. const e = {};
  4729. return u.id.length !== 0 && (e.id = I(u.id)), e
  4730. }, create(u) {
  4731. return T0.fromPartial(u != null ? u : {})
  4732. }, fromPartial(u) {
  4733. var i;
  4734. const e = ai();
  4735. return e.id = (i = u.id) != null ? i : new Uint8Array(0), e
  4736. }
  4737. };
  4738. function oi() {
  4739. return {sample_rate: 0, channels: 0}
  4740. }
  4741. const j0 = {
  4742. encode(u, e = r.Writer.create()) {
  4743. return u.sample_rate !== 0 && e.uint32(8).uint32(u.sample_rate), u.channels !== 0 && e.uint32(16).uint32(u.channels), e
  4744. }, decode(u, e) {
  4745. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4746. let o = e === void 0 ? i.len : i.pos + e;
  4747. const a = oi();
  4748. for (; i.pos < o;) {
  4749. const t = i.uint32();
  4750. switch (t >>> 3) {
  4751. case 1:
  4752. if (t !== 8) break;
  4753. a.sample_rate = i.uint32();
  4754. continue;
  4755. case 2:
  4756. if (t !== 16) break;
  4757. a.channels = i.uint32();
  4758. continue
  4759. }
  4760. if ((t & 7) === 4 || t === 0) break;
  4761. i.skipType(t & 7)
  4762. }
  4763. return a
  4764. }, fromJSON(u) {
  4765. return {
  4766. sample_rate: n(u.sample_rate) ? globalThis.Number(u.sample_rate) : 0,
  4767. channels: n(u.channels) ? globalThis.Number(u.channels) : 0
  4768. }
  4769. }, toJSON(u) {
  4770. const e = {};
  4771. return u.sample_rate !== 0 && (e.sample_rate = Math.round(u.sample_rate)), u.channels !== 0 && (e.channels = Math.round(u.channels)), e
  4772. }, create(u) {
  4773. return j0.fromPartial(u != null ? u : {})
  4774. }, fromPartial(u) {
  4775. var i, o;
  4776. const e = oi();
  4777. return e.sample_rate = (i = u.sample_rate) != null ? i : 0, e.channels = (o = u.channels) != null ? o : 0, e
  4778. }
  4779. };
  4780. function ni() {
  4781. return {data: new Uint8Array(0)}
  4782. }
  4783. const N0 = {
  4784. encode(u, e = r.Writer.create()) {
  4785. return u.data.length !== 0 && e.uint32(10).bytes(u.data), e
  4786. }, decode(u, e) {
  4787. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4788. let o = e === void 0 ? i.len : i.pos + e;
  4789. const a = ni();
  4790. for (; i.pos < o;) {
  4791. const t = i.uint32();
  4792. switch (t >>> 3) {
  4793. case 1:
  4794. if (t !== 10) break;
  4795. a.data = i.bytes();
  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 {data: n(u.data) ? R(u.data) : new Uint8Array(0)}
  4804. }, toJSON(u) {
  4805. const e = {};
  4806. return u.data.length !== 0 && (e.data = I(u.data)), e
  4807. }, create(u) {
  4808. return N0.fromPartial(u != null ? u : {})
  4809. }, fromPartial(u) {
  4810. var i;
  4811. const e = ni();
  4812. return e.data = (i = u.data) != null ? i : new Uint8Array(0), e
  4813. }
  4814. };
  4815. function ri() {
  4816. return {msgtype: "", title: "", text: "", link: ""}
  4817. }
  4818. const O0 = {
  4819. encode(u, e = r.Writer.create()) {
  4820. 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
  4821. }, decode(u, e) {
  4822. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4823. let o = e === void 0 ? i.len : i.pos + e;
  4824. const a = ri();
  4825. for (; i.pos < o;) {
  4826. const t = i.uint32();
  4827. switch (t >>> 3) {
  4828. case 1:
  4829. if (t !== 10) break;
  4830. a.msgtype = i.string();
  4831. continue;
  4832. case 2:
  4833. if (t !== 18) break;
  4834. a.title = i.string();
  4835. continue;
  4836. case 3:
  4837. if (t !== 26) break;
  4838. a.text = i.string();
  4839. continue;
  4840. case 4:
  4841. if (t !== 34) break;
  4842. a.link = i.string();
  4843. continue
  4844. }
  4845. if ((t & 7) === 4 || t === 0) break;
  4846. i.skipType(t & 7)
  4847. }
  4848. return a
  4849. }, fromJSON(u) {
  4850. return {
  4851. msgtype: n(u.msgtype) ? globalThis.String(u.msgtype) : "",
  4852. title: n(u.title) ? globalThis.String(u.title) : "",
  4853. text: n(u.text) ? globalThis.String(u.text) : "",
  4854. link: n(u.link) ? globalThis.String(u.link) : ""
  4855. }
  4856. }, toJSON(u) {
  4857. const e = {};
  4858. 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
  4859. }, create(u) {
  4860. return O0.fromPartial(u != null ? u : {})
  4861. }, fromPartial(u) {
  4862. var i, o, a, t;
  4863. const e = ri();
  4864. 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
  4865. }
  4866. };
  4867. function si() {
  4868. return {privacy_mode_state: void 0, block_input_state: void 0, details: "", impl_key: ""}
  4869. }
  4870. const M0 = {
  4871. encode(u, e = r.Writer.create()) {
  4872. 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
  4873. }, decode(u, e) {
  4874. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4875. let o = e === void 0 ? i.len : i.pos + e;
  4876. const a = si();
  4877. for (; i.pos < o;) {
  4878. const t = i.uint32();
  4879. switch (t >>> 3) {
  4880. case 1:
  4881. if (t !== 8) break;
  4882. a.privacy_mode_state = i.int32();
  4883. continue;
  4884. case 2:
  4885. if (t !== 16) break;
  4886. a.block_input_state = i.int32();
  4887. continue;
  4888. case 3:
  4889. if (t !== 26) break;
  4890. a.details = i.string();
  4891. continue;
  4892. case 4:
  4893. if (t !== 34) break;
  4894. a.impl_key = i.string();
  4895. continue
  4896. }
  4897. if ((t & 7) === 4 || t === 0) break;
  4898. i.skipType(t & 7)
  4899. }
  4900. return a
  4901. }, fromJSON(u) {
  4902. return {
  4903. privacy_mode_state: n(u.privacy_mode_state) ? fa(u.privacy_mode_state) : void 0,
  4904. block_input_state: n(u.block_input_state) ? ga(u.block_input_state) : void 0,
  4905. details: n(u.details) ? globalThis.String(u.details) : "",
  4906. impl_key: n(u.impl_key) ? globalThis.String(u.impl_key) : ""
  4907. }
  4908. }, toJSON(u) {
  4909. const e = {};
  4910. return u.privacy_mode_state !== void 0 && (e.privacy_mode_state = xa(u.privacy_mode_state)), u.block_input_state !== void 0 && (e.block_input_state = ha(u.block_input_state)), u.details !== "" && (e.details = u.details), u.impl_key !== "" && (e.impl_key = u.impl_key), e
  4911. }, create(u) {
  4912. return M0.fromPartial(u != null ? u : {})
  4913. }, fromPartial(u) {
  4914. var i, o, a, t;
  4915. const e = si();
  4916. 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
  4917. }
  4918. };
  4919. function li() {
  4920. return {username: "", password: ""}
  4921. }
  4922. const qu = {
  4923. encode(u, e = r.Writer.create()) {
  4924. return u.username !== "" && e.uint32(10).string(u.username), u.password !== "" && e.uint32(18).string(u.password), e
  4925. }, decode(u, e) {
  4926. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4927. let o = e === void 0 ? i.len : i.pos + e;
  4928. const a = li();
  4929. for (; i.pos < o;) {
  4930. const t = i.uint32();
  4931. switch (t >>> 3) {
  4932. case 1:
  4933. if (t !== 10) break;
  4934. a.username = i.string();
  4935. continue;
  4936. case 2:
  4937. if (t !== 18) break;
  4938. a.password = i.string();
  4939. continue
  4940. }
  4941. if ((t & 7) === 4 || t === 0) break;
  4942. i.skipType(t & 7)
  4943. }
  4944. return a
  4945. }, fromJSON(u) {
  4946. return {
  4947. username: n(u.username) ? globalThis.String(u.username) : "",
  4948. password: n(u.password) ? globalThis.String(u.password) : ""
  4949. }
  4950. }, toJSON(u) {
  4951. const e = {};
  4952. return u.username !== "" && (e.username = u.username), u.password !== "" && (e.password = u.password), e
  4953. }, create(u) {
  4954. return qu.fromPartial(u != null ? u : {})
  4955. }, fromPartial(u) {
  4956. var i, o;
  4957. const e = li();
  4958. return e.username = (i = u.username) != null ? i : "", e.password = (o = u.password) != null ? o : "", e
  4959. }
  4960. };
  4961. function Ei() {
  4962. return {direct: void 0, logon: void 0}
  4963. }
  4964. const Du = {
  4965. encode(u, e = r.Writer.create()) {
  4966. return u.direct !== void 0 && e.uint32(8).bool(u.direct), u.logon !== void 0 && qu.encode(u.logon, e.uint32(18).fork()).ldelim(), e
  4967. }, decode(u, e) {
  4968. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  4969. let o = e === void 0 ? i.len : i.pos + e;
  4970. const a = Ei();
  4971. for (; i.pos < o;) {
  4972. const t = i.uint32();
  4973. switch (t >>> 3) {
  4974. case 1:
  4975. if (t !== 8) break;
  4976. a.direct = i.bool();
  4977. continue;
  4978. case 2:
  4979. if (t !== 18) break;
  4980. a.logon = qu.decode(i, i.uint32());
  4981. continue
  4982. }
  4983. if ((t & 7) === 4 || t === 0) break;
  4984. i.skipType(t & 7)
  4985. }
  4986. return a
  4987. }, fromJSON(u) {
  4988. return {
  4989. direct: n(u.direct) ? globalThis.Boolean(u.direct) : void 0,
  4990. logon: n(u.logon) ? qu.fromJSON(u.logon) : void 0
  4991. }
  4992. }, toJSON(u) {
  4993. const e = {};
  4994. return u.direct !== void 0 && (e.direct = u.direct), u.logon !== void 0 && (e.logon = qu.toJSON(u.logon)), e
  4995. }, create(u) {
  4996. return Du.fromPartial(u != null ? u : {})
  4997. }, fromPartial(u) {
  4998. var i;
  4999. const e = Ei();
  5000. return e.direct = (i = u.direct) != null ? i : void 0, e.logon = u.logon !== void 0 && u.logon !== null ? qu.fromPartial(u.logon) : void 0, e
  5001. }
  5002. };
  5003. function di() {
  5004. return {uuid: new Uint8Array(0)}
  5005. }
  5006. const U0 = {
  5007. encode(u, e = r.Writer.create()) {
  5008. return u.uuid.length !== 0 && e.uint32(10).bytes(u.uuid), e
  5009. }, decode(u, e) {
  5010. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5011. let o = e === void 0 ? i.len : i.pos + e;
  5012. const a = di();
  5013. for (; i.pos < o;) {
  5014. const t = i.uint32();
  5015. switch (t >>> 3) {
  5016. case 1:
  5017. if (t !== 10) break;
  5018. a.uuid = i.bytes();
  5019. continue
  5020. }
  5021. if ((t & 7) === 4 || t === 0) break;
  5022. i.skipType(t & 7)
  5023. }
  5024. return a
  5025. }, fromJSON(u) {
  5026. return {uuid: n(u.uuid) ? R(u.uuid) : new Uint8Array(0)}
  5027. }, toJSON(u) {
  5028. const e = {};
  5029. return u.uuid.length !== 0 && (e.uuid = I(u.uuid)), e
  5030. }, create(u) {
  5031. return U0.fromPartial(u != null ? u : {})
  5032. }, fromPartial(u) {
  5033. var i;
  5034. const e = di();
  5035. return e.uuid = (i = u.uuid) != null ? i : new Uint8Array(0), e
  5036. }
  5037. };
  5038. function ci() {
  5039. return {uuid: new Uint8Array(0), lr: void 0}
  5040. }
  5041. const L0 = {
  5042. encode(u, e = r.Writer.create()) {
  5043. 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
  5044. }, decode(u, e) {
  5045. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5046. let o = e === void 0 ? i.len : i.pos + e;
  5047. const a = ci();
  5048. for (; i.pos < o;) {
  5049. const t = i.uint32();
  5050. switch (t >>> 3) {
  5051. case 1:
  5052. if (t !== 10) break;
  5053. a.uuid = i.bytes();
  5054. continue;
  5055. case 2:
  5056. if (t !== 18) break;
  5057. a.lr = H.decode(i, i.uint32());
  5058. continue
  5059. }
  5060. if ((t & 7) === 4 || t === 0) break;
  5061. i.skipType(t & 7)
  5062. }
  5063. return a
  5064. }, fromJSON(u) {
  5065. return {uuid: n(u.uuid) ? R(u.uuid) : new Uint8Array(0), lr: n(u.lr) ? H.fromJSON(u.lr) : void 0}
  5066. }, toJSON(u) {
  5067. const e = {};
  5068. return u.uuid.length !== 0 && (e.uuid = I(u.uuid)), u.lr !== void 0 && (e.lr = H.toJSON(u.lr)), e
  5069. }, create(u) {
  5070. return L0.fromPartial(u != null ? u : {})
  5071. }, fromPartial(u) {
  5072. var i;
  5073. const e = ci();
  5074. 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
  5075. }
  5076. };
  5077. function Ci() {
  5078. return {}
  5079. }
  5080. const W0 = {
  5081. encode(u, e = r.Writer.create()) {
  5082. return e
  5083. }, decode(u, e) {
  5084. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5085. let o = e === void 0 ? i.len : i.pos + e;
  5086. const a = Ci();
  5087. for (; i.pos < o;) {
  5088. const t = i.uint32();
  5089. if ((t & 7) === 4 || t === 0) break;
  5090. i.skipType(t & 7)
  5091. }
  5092. return a
  5093. }, fromJSON(u) {
  5094. return {}
  5095. }, toJSON(u) {
  5096. return {}
  5097. }, create(u) {
  5098. return W0.fromPartial(u != null ? u : {})
  5099. }, fromPartial(u) {
  5100. return Ci()
  5101. }
  5102. };
  5103. function pi() {
  5104. return {id: "", content: new Uint8Array(0)}
  5105. }
  5106. const V0 = {
  5107. encode(u, e = r.Writer.create()) {
  5108. return u.id !== "" && e.uint32(10).string(u.id), u.content.length !== 0 && e.uint32(18).bytes(u.content), e
  5109. }, decode(u, e) {
  5110. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5111. let o = e === void 0 ? i.len : i.pos + e;
  5112. const a = pi();
  5113. for (; i.pos < o;) {
  5114. const t = i.uint32();
  5115. switch (t >>> 3) {
  5116. case 1:
  5117. if (t !== 10) break;
  5118. a.id = i.string();
  5119. continue;
  5120. case 2:
  5121. if (t !== 18) break;
  5122. a.content = i.bytes();
  5123. continue
  5124. }
  5125. if ((t & 7) === 4 || t === 0) break;
  5126. i.skipType(t & 7)
  5127. }
  5128. return a
  5129. }, fromJSON(u) {
  5130. return {id: n(u.id) ? globalThis.String(u.id) : "", content: n(u.content) ? R(u.content) : new Uint8Array(0)}
  5131. }, toJSON(u) {
  5132. const e = {};
  5133. return u.id !== "" && (e.id = u.id), u.content.length !== 0 && (e.content = I(u.content)), e
  5134. }, create(u) {
  5135. return V0.fromPartial(u != null ? u : {})
  5136. }, fromPartial(u) {
  5137. var i, o;
  5138. const e = pi();
  5139. return e.id = (i = u.id) != null ? i : "", e.content = (o = u.content) != null ? o : new Uint8Array(0), e
  5140. }
  5141. };
  5142. function Di() {
  5143. return {id: "", name: "", msg: ""}
  5144. }
  5145. const q0 = {
  5146. encode(u, e = r.Writer.create()) {
  5147. 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
  5148. }, decode(u, e) {
  5149. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5150. let o = e === void 0 ? i.len : i.pos + e;
  5151. const a = Di();
  5152. for (; i.pos < o;) {
  5153. const t = i.uint32();
  5154. switch (t >>> 3) {
  5155. case 1:
  5156. if (t !== 10) break;
  5157. a.id = i.string();
  5158. continue;
  5159. case 2:
  5160. if (t !== 18) break;
  5161. a.name = i.string();
  5162. continue;
  5163. case 3:
  5164. if (t !== 26) break;
  5165. a.msg = i.string();
  5166. continue
  5167. }
  5168. if ((t & 7) === 4 || t === 0) break;
  5169. i.skipType(t & 7)
  5170. }
  5171. return a
  5172. }, fromJSON(u) {
  5173. return {
  5174. id: n(u.id) ? globalThis.String(u.id) : "",
  5175. name: n(u.name) ? globalThis.String(u.name) : "",
  5176. msg: n(u.msg) ? globalThis.String(u.msg) : ""
  5177. }
  5178. }, toJSON(u) {
  5179. const e = {};
  5180. return u.id !== "" && (e.id = u.id), u.name !== "" && (e.name = u.name), u.msg !== "" && (e.msg = u.msg), e
  5181. }, create(u) {
  5182. return q0.fromPartial(u != null ? u : {})
  5183. }, fromPartial(u) {
  5184. var i, o, a;
  5185. const e = Di();
  5186. return e.id = (i = u.id) != null ? i : "", e.name = (o = u.name) != null ? o : "", e.msg = (a = u.msg) != null ? a : "", e
  5187. }
  5188. };
  5189. function Bi() {
  5190. return {sessions: [], current_sid: 0}
  5191. }
  5192. const K0 = {
  5193. encode(u, e = r.Writer.create()) {
  5194. for (const i of u.sessions) c0.encode(i, e.uint32(10).fork()).ldelim();
  5195. return u.current_sid !== 0 && e.uint32(16).uint32(u.current_sid), e
  5196. }, decode(u, e) {
  5197. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5198. let o = e === void 0 ? i.len : i.pos + e;
  5199. const a = Bi();
  5200. for (; i.pos < o;) {
  5201. const t = i.uint32();
  5202. switch (t >>> 3) {
  5203. case 1:
  5204. if (t !== 10) break;
  5205. a.sessions.push(c0.decode(i, i.uint32()));
  5206. continue;
  5207. case 2:
  5208. if (t !== 16) break;
  5209. a.current_sid = i.uint32();
  5210. continue
  5211. }
  5212. if ((t & 7) === 4 || t === 0) break;
  5213. i.skipType(t & 7)
  5214. }
  5215. return a
  5216. }, fromJSON(u) {
  5217. return {
  5218. sessions: globalThis.Array.isArray(u == null ? void 0 : u.sessions) ? u.sessions.map(e => c0.fromJSON(e)) : [],
  5219. current_sid: n(u.current_sid) ? globalThis.Number(u.current_sid) : 0
  5220. }
  5221. }, toJSON(u) {
  5222. var i;
  5223. const e = {};
  5224. return (i = u.sessions) != null && i.length && (e.sessions = u.sessions.map(o => c0.toJSON(o))), u.current_sid !== 0 && (e.current_sid = Math.round(u.current_sid)), e
  5225. }, create(u) {
  5226. return K0.fromPartial(u != null ? u : {})
  5227. }, fromPartial(u) {
  5228. var i, o;
  5229. const e = Bi();
  5230. return e.sessions = ((i = u.sessions) == null ? void 0 : i.map(a => c0.fromPartial(a))) || [], e.current_sid = (o = u.current_sid) != null ? o : 0, e
  5231. }
  5232. };
  5233. function mi() {
  5234. return {switch_display: 0}
  5235. }
  5236. const H0 = {
  5237. encode(u, e = r.Writer.create()) {
  5238. return u.switch_display !== 0 && e.uint32(8).int32(u.switch_display), e
  5239. }, decode(u, e) {
  5240. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5241. let o = e === void 0 ? i.len : i.pos + e;
  5242. const a = mi();
  5243. for (; i.pos < o;) {
  5244. const t = i.uint32();
  5245. switch (t >>> 3) {
  5246. case 1:
  5247. if (t !== 8) break;
  5248. a.switch_display = i.int32();
  5249. continue
  5250. }
  5251. if ((t & 7) === 4 || t === 0) break;
  5252. i.skipType(t & 7)
  5253. }
  5254. return a
  5255. }, fromJSON(u) {
  5256. return {switch_display: n(u.switch_display) ? globalThis.Number(u.switch_display) : 0}
  5257. }, toJSON(u) {
  5258. const e = {};
  5259. return u.switch_display !== 0 && (e.switch_display = Math.round(u.switch_display)), e
  5260. }, create(u) {
  5261. return H0.fromPartial(u != null ? u : {})
  5262. }, fromPartial(u) {
  5263. var i;
  5264. const e = mi();
  5265. return e.switch_display = (i = u.switch_display) != null ? i : 0, e
  5266. }
  5267. };
  5268. function Ai() {
  5269. return {
  5270. chat_message: void 0,
  5271. switch_display: void 0,
  5272. permission_info: void 0,
  5273. option: void 0,
  5274. audio_format: void 0,
  5275. close_reason: void 0,
  5276. refresh_video: void 0,
  5277. video_received: void 0,
  5278. back_notification: void 0,
  5279. restart_remote_device: void 0,
  5280. uac: void 0,
  5281. foreground_window_elevated: void 0,
  5282. stop_service: void 0,
  5283. elevation_request: void 0,
  5284. elevation_response: void 0,
  5285. portable_service_running: void 0,
  5286. switch_sides_request: void 0,
  5287. switch_back: void 0,
  5288. change_resolution: void 0,
  5289. plugin_request: void 0,
  5290. plugin_failure: void 0,
  5291. full_speed_fps: void 0,
  5292. auto_adjust_fps: void 0,
  5293. client_record_status: void 0,
  5294. capture_displays: void 0,
  5295. refresh_video_display: void 0,
  5296. toggle_virtual_display: void 0,
  5297. toggle_privacy_mode: void 0,
  5298. supported_encoding: void 0,
  5299. selected_sid: void 0,
  5300. change_display_resolution: void 0,
  5301. message_query: void 0,
  5302. follow_current_display: void 0
  5303. }
  5304. }
  5305. const f = {
  5306. encode(u, e = r.Writer.create()) {
  5307. return u.chat_message !== void 0 && vu.encode(u.chat_message, e.uint32(34).fork()).ldelim(), u.switch_display !== void 0 && Mu.encode(u.switch_display, e.uint32(42).fork()).ldelim(), u.permission_info !== void 0 && R0.encode(u.permission_info, e.uint32(50).fork()).ldelim(), u.option !== void 0 && z.encode(u.option, e.uint32(58).fork()).ldelim(), u.audio_format !== void 0 && j0.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 && M0.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 && U0.encode(u.switch_sides_request, e.uint32(170).fork()).ldelim(), u.switch_back !== void 0 && W0.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 && V0.encode(u.plugin_request, e.uint32(202).fork()).ldelim(), u.plugin_failure !== void 0 && q0.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 && Uu.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 && Wu.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 && Ou.encode(u.change_display_resolution, e.uint32(290).fork()).ldelim(), u.message_query !== void 0 && H0.encode(u.message_query, e.uint32(298).fork()).ldelim(), u.follow_current_display !== void 0 && e.uint32(304).int32(u.follow_current_display), e
  5308. }, decode(u, e) {
  5309. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5310. let o = e === void 0 ? i.len : i.pos + e;
  5311. const a = Ai();
  5312. for (; i.pos < o;) {
  5313. const t = i.uint32();
  5314. switch (t >>> 3) {
  5315. case 4:
  5316. if (t !== 34) break;
  5317. a.chat_message = vu.decode(i, i.uint32());
  5318. continue;
  5319. case 5:
  5320. if (t !== 42) break;
  5321. a.switch_display = Mu.decode(i, i.uint32());
  5322. continue;
  5323. case 6:
  5324. if (t !== 50) break;
  5325. a.permission_info = R0.decode(i, i.uint32());
  5326. continue;
  5327. case 7:
  5328. if (t !== 58) break;
  5329. a.option = z.decode(i, i.uint32());
  5330. continue;
  5331. case 8:
  5332. if (t !== 66) break;
  5333. a.audio_format = j0.decode(i, i.uint32());
  5334. continue;
  5335. case 9:
  5336. if (t !== 74) break;
  5337. a.close_reason = i.string();
  5338. continue;
  5339. case 10:
  5340. if (t !== 80) break;
  5341. a.refresh_video = i.bool();
  5342. continue;
  5343. case 12:
  5344. if (t !== 96) break;
  5345. a.video_received = i.bool();
  5346. continue;
  5347. case 13:
  5348. if (t !== 106) break;
  5349. a.back_notification = M0.decode(i, i.uint32());
  5350. continue;
  5351. case 14:
  5352. if (t !== 112) break;
  5353. a.restart_remote_device = i.bool();
  5354. continue;
  5355. case 15:
  5356. if (t !== 120) break;
  5357. a.uac = i.bool();
  5358. continue;
  5359. case 16:
  5360. if (t !== 128) break;
  5361. a.foreground_window_elevated = i.bool();
  5362. continue;
  5363. case 17:
  5364. if (t !== 136) break;
  5365. a.stop_service = i.bool();
  5366. continue;
  5367. case 18:
  5368. if (t !== 146) break;
  5369. a.elevation_request = Du.decode(i, i.uint32());
  5370. continue;
  5371. case 19:
  5372. if (t !== 154) break;
  5373. a.elevation_response = i.string();
  5374. continue;
  5375. case 20:
  5376. if (t !== 160) break;
  5377. a.portable_service_running = i.bool();
  5378. continue;
  5379. case 21:
  5380. if (t !== 170) break;
  5381. a.switch_sides_request = U0.decode(i, i.uint32());
  5382. continue;
  5383. case 22:
  5384. if (t !== 178) break;
  5385. a.switch_back = W0.decode(i, i.uint32());
  5386. continue;
  5387. case 24:
  5388. if (t !== 194) break;
  5389. a.change_resolution = v.decode(i, i.uint32());
  5390. continue;
  5391. case 25:
  5392. if (t !== 202) break;
  5393. a.plugin_request = V0.decode(i, i.uint32());
  5394. continue;
  5395. case 26:
  5396. if (t !== 210) break;
  5397. a.plugin_failure = q0.decode(i, i.uint32());
  5398. continue;
  5399. case 27:
  5400. if (t !== 216) break;
  5401. a.full_speed_fps = i.uint32();
  5402. continue;
  5403. case 28:
  5404. if (t !== 224) break;
  5405. a.auto_adjust_fps = i.uint32();
  5406. continue;
  5407. case 29:
  5408. if (t !== 232) break;
  5409. a.client_record_status = i.bool();
  5410. continue;
  5411. case 30:
  5412. if (t !== 242) break;
  5413. a.capture_displays = Uu.decode(i, i.uint32());
  5414. continue;
  5415. case 31:
  5416. if (t !== 248) break;
  5417. a.refresh_video_display = i.int32();
  5418. continue;
  5419. case 32:
  5420. if (t !== 258) break;
  5421. a.toggle_virtual_display = Lu.decode(i, i.uint32());
  5422. continue;
  5423. case 33:
  5424. if (t !== 266) break;
  5425. a.toggle_privacy_mode = Wu.decode(i, i.uint32());
  5426. continue;
  5427. case 34:
  5428. if (t !== 274) break;
  5429. a.supported_encoding = G.decode(i, i.uint32());
  5430. continue;
  5431. case 35:
  5432. if (t !== 280) break;
  5433. a.selected_sid = i.uint32();
  5434. continue;
  5435. case 36:
  5436. if (t !== 290) break;
  5437. a.change_display_resolution = Ou.decode(i, i.uint32());
  5438. continue;
  5439. case 37:
  5440. if (t !== 298) break;
  5441. a.message_query = H0.decode(i, i.uint32());
  5442. continue;
  5443. case 38:
  5444. if (t !== 304) break;
  5445. a.follow_current_display = i.int32();
  5446. continue
  5447. }
  5448. if ((t & 7) === 4 || t === 0) break;
  5449. i.skipType(t & 7)
  5450. }
  5451. return a
  5452. }, fromJSON(u) {
  5453. return {
  5454. chat_message: n(u.chat_message) ? vu.fromJSON(u.chat_message) : void 0,
  5455. switch_display: n(u.switch_display) ? Mu.fromJSON(u.switch_display) : void 0,
  5456. permission_info: n(u.permission_info) ? R0.fromJSON(u.permission_info) : void 0,
  5457. option: n(u.option) ? z.fromJSON(u.option) : void 0,
  5458. audio_format: n(u.audio_format) ? j0.fromJSON(u.audio_format) : void 0,
  5459. close_reason: n(u.close_reason) ? globalThis.String(u.close_reason) : void 0,
  5460. refresh_video: n(u.refresh_video) ? globalThis.Boolean(u.refresh_video) : void 0,
  5461. video_received: n(u.video_received) ? globalThis.Boolean(u.video_received) : void 0,
  5462. back_notification: n(u.back_notification) ? M0.fromJSON(u.back_notification) : void 0,
  5463. restart_remote_device: n(u.restart_remote_device) ? globalThis.Boolean(u.restart_remote_device) : void 0,
  5464. uac: n(u.uac) ? globalThis.Boolean(u.uac) : void 0,
  5465. foreground_window_elevated: n(u.foreground_window_elevated) ? globalThis.Boolean(u.foreground_window_elevated) : void 0,
  5466. stop_service: n(u.stop_service) ? globalThis.Boolean(u.stop_service) : void 0,
  5467. elevation_request: n(u.elevation_request) ? Du.fromJSON(u.elevation_request) : void 0,
  5468. elevation_response: n(u.elevation_response) ? globalThis.String(u.elevation_response) : void 0,
  5469. portable_service_running: n(u.portable_service_running) ? globalThis.Boolean(u.portable_service_running) : void 0,
  5470. switch_sides_request: n(u.switch_sides_request) ? U0.fromJSON(u.switch_sides_request) : void 0,
  5471. switch_back: n(u.switch_back) ? W0.fromJSON(u.switch_back) : void 0,
  5472. change_resolution: n(u.change_resolution) ? v.fromJSON(u.change_resolution) : void 0,
  5473. plugin_request: n(u.plugin_request) ? V0.fromJSON(u.plugin_request) : void 0,
  5474. plugin_failure: n(u.plugin_failure) ? q0.fromJSON(u.plugin_failure) : void 0,
  5475. full_speed_fps: n(u.full_speed_fps) ? globalThis.Number(u.full_speed_fps) : void 0,
  5476. auto_adjust_fps: n(u.auto_adjust_fps) ? globalThis.Number(u.auto_adjust_fps) : void 0,
  5477. client_record_status: n(u.client_record_status) ? globalThis.Boolean(u.client_record_status) : void 0,
  5478. capture_displays: n(u.capture_displays) ? Uu.fromJSON(u.capture_displays) : void 0,
  5479. refresh_video_display: n(u.refresh_video_display) ? globalThis.Number(u.refresh_video_display) : void 0,
  5480. toggle_virtual_display: n(u.toggle_virtual_display) ? Lu.fromJSON(u.toggle_virtual_display) : void 0,
  5481. toggle_privacy_mode: n(u.toggle_privacy_mode) ? Wu.fromJSON(u.toggle_privacy_mode) : void 0,
  5482. supported_encoding: n(u.supported_encoding) ? G.fromJSON(u.supported_encoding) : void 0,
  5483. selected_sid: n(u.selected_sid) ? globalThis.Number(u.selected_sid) : void 0,
  5484. change_display_resolution: n(u.change_display_resolution) ? Ou.fromJSON(u.change_display_resolution) : void 0,
  5485. message_query: n(u.message_query) ? H0.fromJSON(u.message_query) : void 0,
  5486. follow_current_display: n(u.follow_current_display) ? globalThis.Number(u.follow_current_display) : void 0
  5487. }
  5488. }, toJSON(u) {
  5489. const e = {};
  5490. return u.chat_message !== void 0 && (e.chat_message = vu.toJSON(u.chat_message)), u.switch_display !== void 0 && (e.switch_display = Mu.toJSON(u.switch_display)), u.permission_info !== void 0 && (e.permission_info = R0.toJSON(u.permission_info)), u.option !== void 0 && (e.option = z.toJSON(u.option)), u.audio_format !== void 0 && (e.audio_format = j0.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 = M0.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 = U0.toJSON(u.switch_sides_request)), u.switch_back !== void 0 && (e.switch_back = W0.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 = V0.toJSON(u.plugin_request)), u.plugin_failure !== void 0 && (e.plugin_failure = q0.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 = Uu.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 = Wu.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 = Ou.toJSON(u.change_display_resolution)), u.message_query !== void 0 && (e.message_query = H0.toJSON(u.message_query)), u.follow_current_display !== void 0 && (e.follow_current_display = Math.round(u.follow_current_display)), e
  5491. }, create(u) {
  5492. return f.fromPartial(u != null ? u : {})
  5493. }, fromPartial(u) {
  5494. var i, o, a, t, s, l, E, c, C, D, B, F, y, S, g;
  5495. const e = Ai();
  5496. 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 ? Mu.fromPartial(u.switch_display) : void 0, e.permission_info = u.permission_info !== void 0 && u.permission_info !== null ? R0.fromPartial(u.permission_info) : void 0, e.option = u.option !== void 0 && u.option !== null ? z.fromPartial(u.option) : void 0, e.audio_format = u.audio_format !== void 0 && u.audio_format !== null ? j0.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 ? M0.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 ? U0.fromPartial(u.switch_sides_request) : void 0, e.switch_back = u.switch_back !== void 0 && u.switch_back !== null ? W0.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 ? V0.fromPartial(u.plugin_request) : void 0, e.plugin_failure = u.plugin_failure !== void 0 && u.plugin_failure !== null ? q0.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 = (F = u.client_record_status) != null ? F : void 0, e.capture_displays = u.capture_displays !== void 0 && u.capture_displays !== null ? Uu.fromPartial(u.capture_displays) : void 0, e.refresh_video_display = (y = u.refresh_video_display) != null ? y : 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 ? Wu.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 = (S = u.selected_sid) != null ? S : void 0, e.change_display_resolution = u.change_display_resolution !== void 0 && u.change_display_resolution !== null ? Ou.fromPartial(u.change_display_resolution) : void 0, e.message_query = u.message_query !== void 0 && u.message_query !== null ? H0.fromPartial(u.message_query) : void 0, e.follow_current_display = (g = u.follow_current_display) != null ? g : void 0, e
  5497. }
  5498. };
  5499. function Fi() {
  5500. return {req_timestamp: 0, is_connect: !1}
  5501. }
  5502. const J0 = {
  5503. encode(u, e = r.Writer.create()) {
  5504. return u.req_timestamp !== 0 && e.uint32(8).int64(u.req_timestamp), u.is_connect !== !1 && e.uint32(16).bool(u.is_connect), e
  5505. }, decode(u, e) {
  5506. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5507. let o = e === void 0 ? i.len : i.pos + e;
  5508. const a = Fi();
  5509. for (; i.pos < o;) {
  5510. const t = i.uint32();
  5511. switch (t >>> 3) {
  5512. case 1:
  5513. if (t !== 8) break;
  5514. a.req_timestamp = V(i.int64());
  5515. continue;
  5516. case 2:
  5517. if (t !== 16) break;
  5518. a.is_connect = i.bool();
  5519. continue
  5520. }
  5521. if ((t & 7) === 4 || t === 0) break;
  5522. i.skipType(t & 7)
  5523. }
  5524. return a
  5525. }, fromJSON(u) {
  5526. return {
  5527. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5528. is_connect: n(u.is_connect) ? globalThis.Boolean(u.is_connect) : !1
  5529. }
  5530. }, toJSON(u) {
  5531. const e = {};
  5532. return u.req_timestamp !== 0 && (e.req_timestamp = Math.round(u.req_timestamp)), u.is_connect !== !1 && (e.is_connect = u.is_connect), e
  5533. }, create(u) {
  5534. return J0.fromPartial(u != null ? u : {})
  5535. }, fromPartial(u) {
  5536. var i, o;
  5537. const e = Fi();
  5538. return e.req_timestamp = (i = u.req_timestamp) != null ? i : 0, e.is_connect = (o = u.is_connect) != null ? o : !1, e
  5539. }
  5540. };
  5541. function _i() {
  5542. return {accepted: !1, req_timestamp: 0, ack_timestamp: 0}
  5543. }
  5544. const G0 = {
  5545. encode(u, e = r.Writer.create()) {
  5546. 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
  5547. }, decode(u, e) {
  5548. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5549. let o = e === void 0 ? i.len : i.pos + e;
  5550. const a = _i();
  5551. for (; i.pos < o;) {
  5552. const t = i.uint32();
  5553. switch (t >>> 3) {
  5554. case 1:
  5555. if (t !== 8) break;
  5556. a.accepted = i.bool();
  5557. continue;
  5558. case 2:
  5559. if (t !== 16) break;
  5560. a.req_timestamp = V(i.int64());
  5561. continue;
  5562. case 3:
  5563. if (t !== 24) break;
  5564. a.ack_timestamp = V(i.int64());
  5565. continue
  5566. }
  5567. if ((t & 7) === 4 || t === 0) break;
  5568. i.skipType(t & 7)
  5569. }
  5570. return a
  5571. }, fromJSON(u) {
  5572. return {
  5573. accepted: n(u.accepted) ? globalThis.Boolean(u.accepted) : !1,
  5574. req_timestamp: n(u.req_timestamp) ? globalThis.Number(u.req_timestamp) : 0,
  5575. ack_timestamp: n(u.ack_timestamp) ? globalThis.Number(u.ack_timestamp) : 0
  5576. }
  5577. }, toJSON(u) {
  5578. const e = {};
  5579. 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
  5580. }, create(u) {
  5581. return G0.fromPartial(u != null ? u : {})
  5582. }, fromPartial(u) {
  5583. var i, o, a;
  5584. const e = _i();
  5585. 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
  5586. }
  5587. };
  5588. function vi() {
  5589. return {
  5590. signed_id: void 0,
  5591. public_key: void 0,
  5592. test_delay: void 0,
  5593. video_frame: void 0,
  5594. login_request: void 0,
  5595. login_response: void 0,
  5596. hash: void 0,
  5597. mouse_event: void 0,
  5598. audio_frame: void 0,
  5599. cursor_data: void 0,
  5600. cursor_position: void 0,
  5601. cursor_id: void 0,
  5602. key_event: void 0,
  5603. clipboard: void 0,
  5604. file_action: void 0,
  5605. file_response: void 0,
  5606. misc: void 0,
  5607. cliprdr: void 0,
  5608. message_box: void 0,
  5609. switch_sides_response: void 0,
  5610. voice_call_request: void 0,
  5611. voice_call_response: void 0,
  5612. peer_info: void 0,
  5613. pointer_device_event: void 0,
  5614. auth_2fa: void 0,
  5615. multi_clipboards: void 0
  5616. }
  5617. }
  5618. const iu = {
  5619. encode(u, e = r.Writer.create()) {
  5620. return u.signed_id !== void 0 && T0.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 && I0.encode(u.test_delay, e.uint32(42).fork()).ldelim(), u.video_frame !== void 0 && r0.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 && k0.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 && N0.encode(u.audio_frame, e.uint32(90).fork()).ldelim(), u.cursor_data !== void 0 && _0.encode(u.cursor_data, e.uint32(98).fork()).ldelim(), u.cursor_position !== void 0 && v0.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 && L.encode(u.clipboard, e.uint32(130).fork()).ldelim(), u.file_action !== void 0 && P.encode(u.file_action, e.uint32(138).fork()).ldelim(), u.file_response !== void 0 && nu.encode(u.file_response, e.uint32(146).fork()).ldelim(), u.misc !== void 0 && f.encode(u.misc, e.uint32(154).fork()).ldelim(), u.cliprdr !== void 0 && P0.encode(u.cliprdr, e.uint32(162).fork()).ldelim(), u.message_box !== void 0 && O0.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 && J0.encode(u.voice_call_request, e.uint32(186).fork()).ldelim(), u.voice_call_response !== void 0 && G0.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 && F0.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
  5621. }, decode(u, e) {
  5622. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5623. let o = e === void 0 ? i.len : i.pos + e;
  5624. const a = vi();
  5625. for (; i.pos < o;) {
  5626. const t = i.uint32();
  5627. switch (t >>> 3) {
  5628. case 3:
  5629. if (t !== 26) break;
  5630. a.signed_id = T0.decode(i, i.uint32());
  5631. continue;
  5632. case 4:
  5633. if (t !== 34) break;
  5634. a.public_key = K.decode(i, i.uint32());
  5635. continue;
  5636. case 5:
  5637. if (t !== 42) break;
  5638. a.test_delay = I0.decode(i, i.uint32());
  5639. continue;
  5640. case 6:
  5641. if (t !== 50) break;
  5642. a.video_frame = r0.decode(i, i.uint32());
  5643. continue;
  5644. case 7:
  5645. if (t !== 58) break;
  5646. a.login_request = H.decode(i, i.uint32());
  5647. continue;
  5648. case 8:
  5649. if (t !== 66) break;
  5650. a.login_response = C0.decode(i, i.uint32());
  5651. continue;
  5652. case 9:
  5653. if (t !== 74) break;
  5654. a.hash = k0.decode(i, i.uint32());
  5655. continue;
  5656. case 10:
  5657. if (t !== 82) break;
  5658. a.mouse_event = ku.decode(i, i.uint32());
  5659. continue;
  5660. case 11:
  5661. if (t !== 90) break;
  5662. a.audio_frame = N0.decode(i, i.uint32());
  5663. continue;
  5664. case 12:
  5665. if (t !== 98) break;
  5666. a.cursor_data = _0.decode(i, i.uint32());
  5667. continue;
  5668. case 13:
  5669. if (t !== 106) break;
  5670. a.cursor_position = v0.decode(i, i.uint32());
  5671. continue;
  5672. case 14:
  5673. if (t !== 112) break;
  5674. a.cursor_id = V(i.uint64());
  5675. continue;
  5676. case 15:
  5677. if (t !== 122) break;
  5678. a.key_event = w.decode(i, i.uint32());
  5679. continue;
  5680. case 16:
  5681. if (t !== 130) break;
  5682. a.clipboard = L.decode(i, i.uint32());
  5683. continue;
  5684. case 17:
  5685. if (t !== 138) break;
  5686. a.file_action = P.decode(i, i.uint32());
  5687. continue;
  5688. case 18:
  5689. if (t !== 146) break;
  5690. a.file_response = nu.decode(i, i.uint32());
  5691. continue;
  5692. case 19:
  5693. if (t !== 154) break;
  5694. a.misc = f.decode(i, i.uint32());
  5695. continue;
  5696. case 20:
  5697. if (t !== 162) break;
  5698. a.cliprdr = P0.decode(i, i.uint32());
  5699. continue;
  5700. case 21:
  5701. if (t !== 170) break;
  5702. a.message_box = O0.decode(i, i.uint32());
  5703. continue;
  5704. case 22:
  5705. if (t !== 178) break;
  5706. a.switch_sides_response = L0.decode(i, i.uint32());
  5707. continue;
  5708. case 23:
  5709. if (t !== 186) break;
  5710. a.voice_call_request = J0.decode(i, i.uint32());
  5711. continue;
  5712. case 24:
  5713. if (t !== 194) break;
  5714. a.voice_call_response = G0.decode(i, i.uint32());
  5715. continue;
  5716. case 25:
  5717. if (t !== 202) break;
  5718. a.peer_info = Y.decode(i, i.uint32());
  5719. continue;
  5720. case 26:
  5721. if (t !== 210) break;
  5722. a.pointer_device_event = F0.decode(i, i.uint32());
  5723. continue;
  5724. case 27:
  5725. if (t !== 218) break;
  5726. a.auth_2fa = _u.decode(i, i.uint32());
  5727. continue;
  5728. case 28:
  5729. if (t !== 226) break;
  5730. a.multi_clipboards = gu.decode(i, i.uint32());
  5731. continue
  5732. }
  5733. if ((t & 7) === 4 || t === 0) break;
  5734. i.skipType(t & 7)
  5735. }
  5736. return a
  5737. }, fromJSON(u) {
  5738. return {
  5739. signed_id: n(u.signed_id) ? T0.fromJSON(u.signed_id) : void 0,
  5740. public_key: n(u.public_key) ? K.fromJSON(u.public_key) : void 0,
  5741. test_delay: n(u.test_delay) ? I0.fromJSON(u.test_delay) : void 0,
  5742. video_frame: n(u.video_frame) ? r0.fromJSON(u.video_frame) : void 0,
  5743. login_request: n(u.login_request) ? H.fromJSON(u.login_request) : void 0,
  5744. login_response: n(u.login_response) ? C0.fromJSON(u.login_response) : void 0,
  5745. hash: n(u.hash) ? k0.fromJSON(u.hash) : void 0,
  5746. mouse_event: n(u.mouse_event) ? ku.fromJSON(u.mouse_event) : void 0,
  5747. audio_frame: n(u.audio_frame) ? N0.fromJSON(u.audio_frame) : void 0,
  5748. cursor_data: n(u.cursor_data) ? _0.fromJSON(u.cursor_data) : void 0,
  5749. cursor_position: n(u.cursor_position) ? v0.fromJSON(u.cursor_position) : void 0,
  5750. cursor_id: n(u.cursor_id) ? globalThis.Number(u.cursor_id) : void 0,
  5751. key_event: n(u.key_event) ? w.fromJSON(u.key_event) : void 0,
  5752. clipboard: n(u.clipboard) ? L.fromJSON(u.clipboard) : void 0,
  5753. file_action: n(u.file_action) ? P.fromJSON(u.file_action) : void 0,
  5754. file_response: n(u.file_response) ? nu.fromJSON(u.file_response) : void 0,
  5755. misc: n(u.misc) ? f.fromJSON(u.misc) : void 0,
  5756. cliprdr: n(u.cliprdr) ? P0.fromJSON(u.cliprdr) : void 0,
  5757. message_box: n(u.message_box) ? O0.fromJSON(u.message_box) : void 0,
  5758. switch_sides_response: n(u.switch_sides_response) ? L0.fromJSON(u.switch_sides_response) : void 0,
  5759. voice_call_request: n(u.voice_call_request) ? J0.fromJSON(u.voice_call_request) : void 0,
  5760. voice_call_response: n(u.voice_call_response) ? G0.fromJSON(u.voice_call_response) : void 0,
  5761. peer_info: n(u.peer_info) ? Y.fromJSON(u.peer_info) : void 0,
  5762. pointer_device_event: n(u.pointer_device_event) ? F0.fromJSON(u.pointer_device_event) : void 0,
  5763. auth_2fa: n(u.auth_2fa) ? _u.fromJSON(u.auth_2fa) : void 0,
  5764. multi_clipboards: n(u.multi_clipboards) ? gu.fromJSON(u.multi_clipboards) : void 0
  5765. }
  5766. }, toJSON(u) {
  5767. const e = {};
  5768. return u.signed_id !== void 0 && (e.signed_id = T0.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 = I0.toJSON(u.test_delay)), u.video_frame !== void 0 && (e.video_frame = r0.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 = k0.toJSON(u.hash)), u.mouse_event !== void 0 && (e.mouse_event = ku.toJSON(u.mouse_event)), u.audio_frame !== void 0 && (e.audio_frame = N0.toJSON(u.audio_frame)), u.cursor_data !== void 0 && (e.cursor_data = _0.toJSON(u.cursor_data)), u.cursor_position !== void 0 && (e.cursor_position = v0.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 = L.toJSON(u.clipboard)), u.file_action !== void 0 && (e.file_action = P.toJSON(u.file_action)), u.file_response !== void 0 && (e.file_response = nu.toJSON(u.file_response)), u.misc !== void 0 && (e.misc = f.toJSON(u.misc)), u.cliprdr !== void 0 && (e.cliprdr = P0.toJSON(u.cliprdr)), u.message_box !== void 0 && (e.message_box = O0.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 = J0.toJSON(u.voice_call_request)), u.voice_call_response !== void 0 && (e.voice_call_response = G0.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 = F0.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
  5769. }, create(u) {
  5770. return iu.fromPartial(u != null ? u : {})
  5771. }, fromPartial(u) {
  5772. var i;
  5773. const e = vi();
  5774. return e.signed_id = u.signed_id !== void 0 && u.signed_id !== null ? T0.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 ? I0.fromPartial(u.test_delay) : void 0, e.video_frame = u.video_frame !== void 0 && u.video_frame !== null ? r0.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 ? k0.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 ? N0.fromPartial(u.audio_frame) : void 0, e.cursor_data = u.cursor_data !== void 0 && u.cursor_data !== null ? _0.fromPartial(u.cursor_data) : void 0, e.cursor_position = u.cursor_position !== void 0 && u.cursor_position !== null ? v0.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 ? L.fromPartial(u.clipboard) : void 0, e.file_action = u.file_action !== void 0 && u.file_action !== null ? P.fromPartial(u.file_action) : void 0, e.file_response = u.file_response !== void 0 && u.file_response !== null ? nu.fromPartial(u.file_response) : void 0, e.misc = u.misc !== void 0 && u.misc !== null ? f.fromPartial(u.misc) : void 0, e.cliprdr = u.cliprdr !== void 0 && u.cliprdr !== null ? P0.fromPartial(u.cliprdr) : void 0, e.message_box = u.message_box !== void 0 && u.message_box !== null ? O0.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 ? J0.fromPartial(u.voice_call_request) : void 0, e.voice_call_response = u.voice_call_response !== void 0 && u.voice_call_response !== null ? G0.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 ? F0.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
  5775. }
  5776. };
  5777. function R(u) {
  5778. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  5779. {
  5780. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  5781. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  5782. return i
  5783. }
  5784. }
  5785. function I(u) {
  5786. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  5787. {
  5788. const e = [];
  5789. return u.forEach(i => {
  5790. e.push(globalThis.String.fromCharCode(i))
  5791. }), globalThis.btoa(e.join(""))
  5792. }
  5793. }
  5794. function V(u) {
  5795. if (u.gt(globalThis.Number.MAX_SAFE_INTEGER)) throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
  5796. if (u.lt(globalThis.Number.MIN_SAFE_INTEGER)) throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
  5797. return u.toNumber()
  5798. }
  5799. r.util.Long !== Ne && (r.util.Long = Ne, r.configure());
  5800. function n(u) {
  5801. return u != null
  5802. }
  5803. var ne = (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))(ne || {});
  5804. function ct(u) {
  5805. switch (u) {
  5806. case 0:
  5807. case"DEFAULT_CONN":
  5808. return 0;
  5809. case 1:
  5810. case"FILE_TRANSFER":
  5811. return 1;
  5812. case 2:
  5813. case"PORT_FORWARD":
  5814. return 2;
  5815. case 3:
  5816. case"RDP":
  5817. return 3;
  5818. case-1:
  5819. case"UNRECOGNIZED":
  5820. default:
  5821. return -1
  5822. }
  5823. }
  5824. function Ct(u) {
  5825. switch (u) {
  5826. case 0:
  5827. return "DEFAULT_CONN";
  5828. case 1:
  5829. return "FILE_TRANSFER";
  5830. case 2:
  5831. return "PORT_FORWARD";
  5832. case 3:
  5833. return "RDP";
  5834. case-1:
  5835. default:
  5836. return "UNRECOGNIZED"
  5837. }
  5838. }
  5839. var pt = (u => (u[u.UNKNOWN_NAT = 0] = "UNKNOWN_NAT", u[u.ASYMMETRIC = 1] = "ASYMMETRIC", u[u.SYMMETRIC = 2] = "SYMMETRIC", u[u.UNRECOGNIZED = -1] = "UNRECOGNIZED", u))(pt || {});
  5840. function Q4(u) {
  5841. switch (u) {
  5842. case 0:
  5843. case"UNKNOWN_NAT":
  5844. return 0;
  5845. case 1:
  5846. case"ASYMMETRIC":
  5847. return 1;
  5848. case 2:
  5849. case"SYMMETRIC":
  5850. return 2;
  5851. case-1:
  5852. case"UNRECOGNIZED":
  5853. default:
  5854. return -1
  5855. }
  5856. }
  5857. function X4(u) {
  5858. switch (u) {
  5859. case 0:
  5860. return "UNKNOWN_NAT";
  5861. case 1:
  5862. return "ASYMMETRIC";
  5863. case 2:
  5864. return "SYMMETRIC";
  5865. case-1:
  5866. default:
  5867. return "UNRECOGNIZED"
  5868. }
  5869. }
  5870. function ya(u) {
  5871. switch (u) {
  5872. case 0:
  5873. case"OK":
  5874. return 0;
  5875. case 2:
  5876. case"UUID_MISMATCH":
  5877. return 2;
  5878. case 3:
  5879. case"ID_EXISTS":
  5880. return 3;
  5881. case 4:
  5882. case"TOO_FREQUENT":
  5883. return 4;
  5884. case 5:
  5885. case"INVALID_ID_FORMAT":
  5886. return 5;
  5887. case 6:
  5888. case"NOT_SUPPORT":
  5889. return 6;
  5890. case 7:
  5891. case"SERVER_ERROR":
  5892. return 7;
  5893. case-1:
  5894. case"UNRECOGNIZED":
  5895. default:
  5896. return -1
  5897. }
  5898. }
  5899. function ba(u) {
  5900. switch (u) {
  5901. case 0:
  5902. return "OK";
  5903. case 2:
  5904. return "UUID_MISMATCH";
  5905. case 3:
  5906. return "ID_EXISTS";
  5907. case 4:
  5908. return "TOO_FREQUENT";
  5909. case 5:
  5910. return "INVALID_ID_FORMAT";
  5911. case 6:
  5912. return "NOT_SUPPORT";
  5913. case 7:
  5914. return "SERVER_ERROR";
  5915. case-1:
  5916. default:
  5917. return "UNRECOGNIZED"
  5918. }
  5919. }
  5920. var Z0 = (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))(Z0 || {});
  5921. function wa(u) {
  5922. switch (u) {
  5923. case 0:
  5924. case"ID_NOT_EXIST":
  5925. return 0;
  5926. case 2:
  5927. case"OFFLINE":
  5928. return 2;
  5929. case 3:
  5930. case"LICENSE_MISMATCH":
  5931. return 3;
  5932. case 4:
  5933. case"LICENSE_OVERUSE":
  5934. return 4;
  5935. case-1:
  5936. case"UNRECOGNIZED":
  5937. default:
  5938. return -1
  5939. }
  5940. }
  5941. function Sa(u) {
  5942. switch (u) {
  5943. case 0:
  5944. return "ID_NOT_EXIST";
  5945. case 2:
  5946. return "OFFLINE";
  5947. case 3:
  5948. return "LICENSE_MISMATCH";
  5949. case 4:
  5950. return "LICENSE_OVERUSE";
  5951. case-1:
  5952. default:
  5953. return "UNRECOGNIZED"
  5954. }
  5955. }
  5956. function ki() {
  5957. return {id: "", serial: 0}
  5958. }
  5959. const Q0 = {
  5960. encode(u, e = r.Writer.create()) {
  5961. return u.id !== "" && e.uint32(10).string(u.id), u.serial !== 0 && e.uint32(16).int32(u.serial), e
  5962. }, decode(u, e) {
  5963. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  5964. let o = e === void 0 ? i.len : i.pos + e;
  5965. const a = ki();
  5966. for (; i.pos < o;) {
  5967. const t = i.uint32();
  5968. switch (t >>> 3) {
  5969. case 1:
  5970. if (t !== 10) break;
  5971. a.id = i.string();
  5972. continue;
  5973. case 2:
  5974. if (t !== 16) break;
  5975. a.serial = i.int32();
  5976. continue
  5977. }
  5978. if ((t & 7) === 4 || t === 0) break;
  5979. i.skipType(t & 7)
  5980. }
  5981. return a
  5982. }, fromJSON(u) {
  5983. return {id: p(u.id) ? globalThis.String(u.id) : "", serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  5984. }, toJSON(u) {
  5985. const e = {};
  5986. return u.id !== "" && (e.id = u.id), u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  5987. }, create(u) {
  5988. return Q0.fromPartial(u != null ? u : {})
  5989. }, fromPartial(u) {
  5990. var i, o;
  5991. const e = ki();
  5992. return e.id = (i = u.id) != null ? i : "", e.serial = (o = u.serial) != null ? o : 0, e
  5993. }
  5994. };
  5995. function gi() {
  5996. return {request_pk: !1}
  5997. }
  5998. const X0 = {
  5999. encode(u, e = r.Writer.create()) {
  6000. return u.request_pk !== !1 && e.uint32(16).bool(u.request_pk), e
  6001. }, decode(u, e) {
  6002. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6003. let o = e === void 0 ? i.len : i.pos + e;
  6004. const a = gi();
  6005. for (; i.pos < o;) {
  6006. const t = i.uint32();
  6007. switch (t >>> 3) {
  6008. case 2:
  6009. if (t !== 16) break;
  6010. a.request_pk = i.bool();
  6011. continue
  6012. }
  6013. if ((t & 7) === 4 || t === 0) break;
  6014. i.skipType(t & 7)
  6015. }
  6016. return a
  6017. }, fromJSON(u) {
  6018. return {request_pk: p(u.request_pk) ? globalThis.Boolean(u.request_pk) : !1}
  6019. }, toJSON(u) {
  6020. const e = {};
  6021. return u.request_pk !== !1 && (e.request_pk = u.request_pk), e
  6022. }, create(u) {
  6023. return X0.fromPartial(u != null ? u : {})
  6024. }, fromPartial(u) {
  6025. var i;
  6026. const e = gi();
  6027. return e.request_pk = (i = u.request_pk) != null ? i : !1, e
  6028. }
  6029. };
  6030. function hi() {
  6031. return {id: "", nat_type: 0, licence_key: "", conn_type: 0, token: "", version: ""}
  6032. }
  6033. const Ku = {
  6034. encode(u, e = r.Writer.create()) {
  6035. 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
  6036. }, decode(u, e) {
  6037. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6038. let o = e === void 0 ? i.len : i.pos + e;
  6039. const a = hi();
  6040. for (; i.pos < o;) {
  6041. const t = i.uint32();
  6042. switch (t >>> 3) {
  6043. case 1:
  6044. if (t !== 10) break;
  6045. a.id = i.string();
  6046. continue;
  6047. case 2:
  6048. if (t !== 16) break;
  6049. a.nat_type = i.int32();
  6050. continue;
  6051. case 3:
  6052. if (t !== 26) break;
  6053. a.licence_key = i.string();
  6054. continue;
  6055. case 4:
  6056. if (t !== 32) break;
  6057. a.conn_type = i.int32();
  6058. continue;
  6059. case 5:
  6060. if (t !== 42) break;
  6061. a.token = i.string();
  6062. continue;
  6063. case 6:
  6064. if (t !== 50) break;
  6065. a.version = i.string();
  6066. continue
  6067. }
  6068. if ((t & 7) === 4 || t === 0) break;
  6069. i.skipType(t & 7)
  6070. }
  6071. return a
  6072. }, fromJSON(u) {
  6073. return {
  6074. id: p(u.id) ? globalThis.String(u.id) : "",
  6075. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0,
  6076. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6077. conn_type: p(u.conn_type) ? ct(u.conn_type) : 0,
  6078. token: p(u.token) ? globalThis.String(u.token) : "",
  6079. version: p(u.version) ? globalThis.String(u.version) : ""
  6080. }
  6081. }, toJSON(u) {
  6082. const e = {};
  6083. return u.id !== "" && (e.id = u.id), u.nat_type !== 0 && (e.nat_type = X4(u.nat_type)), u.licence_key !== "" && (e.licence_key = u.licence_key), u.conn_type !== 0 && (e.conn_type = Ct(u.conn_type)), u.token !== "" && (e.token = u.token), u.version !== "" && (e.version = u.version), e
  6084. }, create(u) {
  6085. return Ku.fromPartial(u != null ? u : {})
  6086. }, fromPartial(u) {
  6087. var i, o, a, t, s, l;
  6088. const e = hi();
  6089. 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
  6090. }
  6091. };
  6092. function fi() {
  6093. return {socket_addr: new Uint8Array(0), relay_server: "", nat_type: 0}
  6094. }
  6095. const Y0 = {
  6096. encode(u, e = r.Writer.create()) {
  6097. 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
  6098. }, decode(u, e) {
  6099. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6100. let o = e === void 0 ? i.len : i.pos + e;
  6101. const a = fi();
  6102. for (; i.pos < o;) {
  6103. const t = i.uint32();
  6104. switch (t >>> 3) {
  6105. case 1:
  6106. if (t !== 10) break;
  6107. a.socket_addr = i.bytes();
  6108. continue;
  6109. case 2:
  6110. if (t !== 18) break;
  6111. a.relay_server = i.string();
  6112. continue;
  6113. case 3:
  6114. if (t !== 24) break;
  6115. a.nat_type = i.int32();
  6116. continue
  6117. }
  6118. if ((t & 7) === 4 || t === 0) break;
  6119. i.skipType(t & 7)
  6120. }
  6121. return a
  6122. }, fromJSON(u) {
  6123. return {
  6124. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6125. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6126. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0
  6127. }
  6128. }, toJSON(u) {
  6129. const e = {};
  6130. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== 0 && (e.nat_type = X4(u.nat_type)), e
  6131. }, create(u) {
  6132. return Y0.fromPartial(u != null ? u : {})
  6133. }, fromPartial(u) {
  6134. var i, o, a;
  6135. const e = fi();
  6136. 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
  6137. }
  6138. };
  6139. function xi() {
  6140. return {serial: 0}
  6141. }
  6142. const $0 = {
  6143. encode(u, e = r.Writer.create()) {
  6144. return u.serial !== 0 && e.uint32(8).int32(u.serial), e
  6145. }, decode(u, e) {
  6146. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6147. let o = e === void 0 ? i.len : i.pos + e;
  6148. const a = xi();
  6149. for (; i.pos < o;) {
  6150. const t = i.uint32();
  6151. switch (t >>> 3) {
  6152. case 1:
  6153. if (t !== 8) break;
  6154. a.serial = i.int32();
  6155. continue
  6156. }
  6157. if ((t & 7) === 4 || t === 0) break;
  6158. i.skipType(t & 7)
  6159. }
  6160. return a
  6161. }, fromJSON(u) {
  6162. return {serial: p(u.serial) ? globalThis.Number(u.serial) : 0}
  6163. }, toJSON(u) {
  6164. const e = {};
  6165. return u.serial !== 0 && (e.serial = Math.round(u.serial)), e
  6166. }, create(u) {
  6167. return $0.fromPartial(u != null ? u : {})
  6168. }, fromPartial(u) {
  6169. var i;
  6170. const e = xi();
  6171. return e.serial = (i = u.serial) != null ? i : 0, e
  6172. }
  6173. };
  6174. function yi() {
  6175. return {port: 0, cu: void 0}
  6176. }
  6177. const u4 = {
  6178. encode(u, e = r.Writer.create()) {
  6179. return u.port !== 0 && e.uint32(8).int32(u.port), u.cu !== void 0 && eu.encode(u.cu, e.uint32(18).fork()).ldelim(), e
  6180. }, decode(u, e) {
  6181. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6182. let o = e === void 0 ? i.len : i.pos + e;
  6183. const a = yi();
  6184. for (; i.pos < o;) {
  6185. const t = i.uint32();
  6186. switch (t >>> 3) {
  6187. case 1:
  6188. if (t !== 8) break;
  6189. a.port = i.int32();
  6190. continue;
  6191. case 2:
  6192. if (t !== 18) break;
  6193. a.cu = eu.decode(i, i.uint32());
  6194. continue
  6195. }
  6196. if ((t & 7) === 4 || t === 0) break;
  6197. i.skipType(t & 7)
  6198. }
  6199. return a
  6200. }, fromJSON(u) {
  6201. return {port: p(u.port) ? globalThis.Number(u.port) : 0, cu: p(u.cu) ? eu.fromJSON(u.cu) : void 0}
  6202. }, toJSON(u) {
  6203. const e = {};
  6204. return u.port !== 0 && (e.port = Math.round(u.port)), u.cu !== void 0 && (e.cu = eu.toJSON(u.cu)), e
  6205. }, create(u) {
  6206. return u4.fromPartial(u != null ? u : {})
  6207. }, fromPartial(u) {
  6208. var i;
  6209. const e = yi();
  6210. return e.port = (i = u.port) != null ? i : 0, e.cu = u.cu !== void 0 && u.cu !== null ? eu.fromPartial(u.cu) : void 0, e
  6211. }
  6212. };
  6213. function bi() {
  6214. return {socket_addr: new Uint8Array(0), id: "", relay_server: "", nat_type: 0, version: ""}
  6215. }
  6216. const e4 = {
  6217. encode(u, e = r.Writer.create()) {
  6218. 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
  6219. }, decode(u, e) {
  6220. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6221. let o = e === void 0 ? i.len : i.pos + e;
  6222. const a = bi();
  6223. for (; i.pos < o;) {
  6224. const t = i.uint32();
  6225. switch (t >>> 3) {
  6226. case 1:
  6227. if (t !== 10) break;
  6228. a.socket_addr = i.bytes();
  6229. continue;
  6230. case 2:
  6231. if (t !== 18) break;
  6232. a.id = i.string();
  6233. continue;
  6234. case 3:
  6235. if (t !== 26) break;
  6236. a.relay_server = i.string();
  6237. continue;
  6238. case 4:
  6239. if (t !== 32) break;
  6240. a.nat_type = i.int32();
  6241. continue;
  6242. case 5:
  6243. if (t !== 42) break;
  6244. a.version = i.string();
  6245. continue
  6246. }
  6247. if ((t & 7) === 4 || t === 0) break;
  6248. i.skipType(t & 7)
  6249. }
  6250. return a
  6251. }, fromJSON(u) {
  6252. return {
  6253. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6254. id: p(u.id) ? globalThis.String(u.id) : "",
  6255. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6256. nat_type: p(u.nat_type) ? Q4(u.nat_type) : 0,
  6257. version: p(u.version) ? globalThis.String(u.version) : ""
  6258. }
  6259. }, toJSON(u) {
  6260. const e = {};
  6261. return u.socket_addr.length !== 0 && (e.socket_addr = M(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 = X4(u.nat_type)), u.version !== "" && (e.version = u.version), e
  6262. }, create(u) {
  6263. return e4.fromPartial(u != null ? u : {})
  6264. }, fromPartial(u) {
  6265. var i, o, a, t, s;
  6266. const e = bi();
  6267. 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
  6268. }
  6269. };
  6270. function wi() {
  6271. return {id: "", uuid: new Uint8Array(0), pk: new Uint8Array(0), old_id: ""}
  6272. }
  6273. const i4 = {
  6274. encode(u, e = r.Writer.create()) {
  6275. 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
  6276. }, decode(u, e) {
  6277. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6278. let o = e === void 0 ? i.len : i.pos + e;
  6279. const a = wi();
  6280. for (; i.pos < o;) {
  6281. const t = i.uint32();
  6282. switch (t >>> 3) {
  6283. case 1:
  6284. if (t !== 10) break;
  6285. a.id = i.string();
  6286. continue;
  6287. case 2:
  6288. if (t !== 18) break;
  6289. a.uuid = i.bytes();
  6290. continue;
  6291. case 3:
  6292. if (t !== 26) break;
  6293. a.pk = i.bytes();
  6294. continue;
  6295. case 4:
  6296. if (t !== 34) break;
  6297. a.old_id = i.string();
  6298. continue
  6299. }
  6300. if ((t & 7) === 4 || t === 0) break;
  6301. i.skipType(t & 7)
  6302. }
  6303. return a
  6304. }, fromJSON(u) {
  6305. return {
  6306. id: p(u.id) ? globalThis.String(u.id) : "",
  6307. uuid: p(u.uuid) ? O(u.uuid) : new Uint8Array(0),
  6308. pk: p(u.pk) ? O(u.pk) : new Uint8Array(0),
  6309. old_id: p(u.old_id) ? globalThis.String(u.old_id) : ""
  6310. }
  6311. }, toJSON(u) {
  6312. const e = {};
  6313. return u.id !== "" && (e.id = u.id), u.uuid.length !== 0 && (e.uuid = M(u.uuid)), u.pk.length !== 0 && (e.pk = M(u.pk)), u.old_id !== "" && (e.old_id = u.old_id), e
  6314. }, create(u) {
  6315. return i4.fromPartial(u != null ? u : {})
  6316. }, fromPartial(u) {
  6317. var i, o, a, t;
  6318. const e = wi();
  6319. 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
  6320. }
  6321. };
  6322. function Si() {
  6323. return {result: 0, keep_alive: 0}
  6324. }
  6325. const t4 = {
  6326. encode(u, e = r.Writer.create()) {
  6327. return u.result !== 0 && e.uint32(8).int32(u.result), u.keep_alive !== 0 && e.uint32(16).int32(u.keep_alive), e
  6328. }, decode(u, e) {
  6329. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6330. let o = e === void 0 ? i.len : i.pos + e;
  6331. const a = Si();
  6332. for (; i.pos < o;) {
  6333. const t = i.uint32();
  6334. switch (t >>> 3) {
  6335. case 1:
  6336. if (t !== 8) break;
  6337. a.result = i.int32();
  6338. continue;
  6339. case 2:
  6340. if (t !== 16) break;
  6341. a.keep_alive = i.int32();
  6342. continue
  6343. }
  6344. if ((t & 7) === 4 || t === 0) break;
  6345. i.skipType(t & 7)
  6346. }
  6347. return a
  6348. }, fromJSON(u) {
  6349. return {
  6350. result: p(u.result) ? ya(u.result) : 0,
  6351. keep_alive: p(u.keep_alive) ? globalThis.Number(u.keep_alive) : 0
  6352. }
  6353. }, toJSON(u) {
  6354. const e = {};
  6355. return u.result !== 0 && (e.result = ba(u.result)), u.keep_alive !== 0 && (e.keep_alive = Math.round(u.keep_alive)), e
  6356. }, create(u) {
  6357. return t4.fromPartial(u != null ? u : {})
  6358. }, fromPartial(u) {
  6359. var i, o;
  6360. const e = Si();
  6361. return e.result = (i = u.result) != null ? i : 0, e.keep_alive = (o = u.keep_alive) != null ? o : 0, e
  6362. }
  6363. };
  6364. function zi() {
  6365. return {
  6366. socket_addr: new Uint8Array(0),
  6367. pk: new Uint8Array(0),
  6368. failure: 0,
  6369. relay_server: "",
  6370. nat_type: void 0,
  6371. is_local: void 0,
  6372. other_failure: "",
  6373. feedback: 0
  6374. }
  6375. }
  6376. const a4 = {
  6377. encode(u, e = r.Writer.create()) {
  6378. 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
  6379. }, decode(u, e) {
  6380. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6381. let o = e === void 0 ? i.len : i.pos + e;
  6382. const a = zi();
  6383. for (; i.pos < o;) {
  6384. const t = i.uint32();
  6385. switch (t >>> 3) {
  6386. case 1:
  6387. if (t !== 10) break;
  6388. a.socket_addr = i.bytes();
  6389. continue;
  6390. case 2:
  6391. if (t !== 18) break;
  6392. a.pk = i.bytes();
  6393. continue;
  6394. case 3:
  6395. if (t !== 24) break;
  6396. a.failure = i.int32();
  6397. continue;
  6398. case 4:
  6399. if (t !== 34) break;
  6400. a.relay_server = i.string();
  6401. continue;
  6402. case 5:
  6403. if (t !== 40) break;
  6404. a.nat_type = i.int32();
  6405. continue;
  6406. case 6:
  6407. if (t !== 48) break;
  6408. a.is_local = i.bool();
  6409. continue;
  6410. case 7:
  6411. if (t !== 58) break;
  6412. a.other_failure = i.string();
  6413. continue;
  6414. case 8:
  6415. if (t !== 64) break;
  6416. a.feedback = i.int32();
  6417. continue
  6418. }
  6419. if ((t & 7) === 4 || t === 0) break;
  6420. i.skipType(t & 7)
  6421. }
  6422. return a
  6423. }, fromJSON(u) {
  6424. return {
  6425. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6426. pk: p(u.pk) ? O(u.pk) : new Uint8Array(0),
  6427. failure: p(u.failure) ? wa(u.failure) : 0,
  6428. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6429. nat_type: p(u.nat_type) ? Q4(u.nat_type) : void 0,
  6430. is_local: p(u.is_local) ? globalThis.Boolean(u.is_local) : void 0,
  6431. other_failure: p(u.other_failure) ? globalThis.String(u.other_failure) : "",
  6432. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6433. }
  6434. }, toJSON(u) {
  6435. const e = {};
  6436. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.pk.length !== 0 && (e.pk = M(u.pk)), u.failure !== 0 && (e.failure = Sa(u.failure)), u.relay_server !== "" && (e.relay_server = u.relay_server), u.nat_type !== void 0 && (e.nat_type = X4(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
  6437. }, create(u) {
  6438. return a4.fromPartial(u != null ? u : {})
  6439. }, fromPartial(u) {
  6440. var i, o, a, t, s, l, E, c;
  6441. const e = zi();
  6442. 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
  6443. }
  6444. };
  6445. function Pi() {
  6446. return {serial: 0, rendezvous_servers: []}
  6447. }
  6448. const eu = {
  6449. encode(u, e = r.Writer.create()) {
  6450. u.serial !== 0 && e.uint32(8).int32(u.serial);
  6451. for (const i of u.rendezvous_servers) e.uint32(18).string(i);
  6452. return e
  6453. }, decode(u, e) {
  6454. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6455. let o = e === void 0 ? i.len : i.pos + e;
  6456. const a = Pi();
  6457. for (; i.pos < o;) {
  6458. const t = i.uint32();
  6459. switch (t >>> 3) {
  6460. case 1:
  6461. if (t !== 8) break;
  6462. a.serial = i.int32();
  6463. continue;
  6464. case 2:
  6465. if (t !== 18) break;
  6466. a.rendezvous_servers.push(i.string());
  6467. continue
  6468. }
  6469. if ((t & 7) === 4 || t === 0) break;
  6470. i.skipType(t & 7)
  6471. }
  6472. return a
  6473. }, fromJSON(u) {
  6474. return {
  6475. serial: p(u.serial) ? globalThis.Number(u.serial) : 0,
  6476. rendezvous_servers: globalThis.Array.isArray(u == null ? void 0 : u.rendezvous_servers) ? u.rendezvous_servers.map(e => globalThis.String(e)) : []
  6477. }
  6478. }, toJSON(u) {
  6479. var i;
  6480. const e = {};
  6481. return u.serial !== 0 && (e.serial = Math.round(u.serial)), (i = u.rendezvous_servers) != null && i.length && (e.rendezvous_servers = u.rendezvous_servers), e
  6482. }, create(u) {
  6483. return eu.fromPartial(u != null ? u : {})
  6484. }, fromPartial(u) {
  6485. var i, o;
  6486. const e = Pi();
  6487. return e.serial = (i = u.serial) != null ? i : 0, e.rendezvous_servers = ((o = u.rendezvous_servers) == null ? void 0 : o.map(a => a)) || [], e
  6488. }
  6489. };
  6490. function Ri() {
  6491. return {
  6492. id: "",
  6493. uuid: "",
  6494. socket_addr: new Uint8Array(0),
  6495. relay_server: "",
  6496. secure: !1,
  6497. licence_key: "",
  6498. conn_type: 0,
  6499. token: ""
  6500. }
  6501. }
  6502. const Hu = {
  6503. encode(u, e = r.Writer.create()) {
  6504. 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
  6505. }, decode(u, e) {
  6506. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6507. let o = e === void 0 ? i.len : i.pos + e;
  6508. const a = Ri();
  6509. for (; i.pos < o;) {
  6510. const t = i.uint32();
  6511. switch (t >>> 3) {
  6512. case 1:
  6513. if (t !== 10) break;
  6514. a.id = i.string();
  6515. continue;
  6516. case 2:
  6517. if (t !== 18) break;
  6518. a.uuid = i.string();
  6519. continue;
  6520. case 3:
  6521. if (t !== 26) break;
  6522. a.socket_addr = i.bytes();
  6523. continue;
  6524. case 4:
  6525. if (t !== 34) break;
  6526. a.relay_server = i.string();
  6527. continue;
  6528. case 5:
  6529. if (t !== 40) break;
  6530. a.secure = i.bool();
  6531. continue;
  6532. case 6:
  6533. if (t !== 50) break;
  6534. a.licence_key = i.string();
  6535. continue;
  6536. case 7:
  6537. if (t !== 56) break;
  6538. a.conn_type = i.int32();
  6539. continue;
  6540. case 8:
  6541. if (t !== 66) break;
  6542. a.token = i.string();
  6543. continue
  6544. }
  6545. if ((t & 7) === 4 || t === 0) break;
  6546. i.skipType(t & 7)
  6547. }
  6548. return a
  6549. }, fromJSON(u) {
  6550. return {
  6551. id: p(u.id) ? globalThis.String(u.id) : "",
  6552. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6553. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6554. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6555. secure: p(u.secure) ? globalThis.Boolean(u.secure) : !1,
  6556. licence_key: p(u.licence_key) ? globalThis.String(u.licence_key) : "",
  6557. conn_type: p(u.conn_type) ? ct(u.conn_type) : 0,
  6558. token: p(u.token) ? globalThis.String(u.token) : ""
  6559. }
  6560. }, toJSON(u) {
  6561. const e = {};
  6562. return u.id !== "" && (e.id = u.id), u.uuid !== "" && (e.uuid = u.uuid), u.socket_addr.length !== 0 && (e.socket_addr = M(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 = Ct(u.conn_type)), u.token !== "" && (e.token = u.token), e
  6563. }, create(u) {
  6564. return Hu.fromPartial(u != null ? u : {})
  6565. }, fromPartial(u) {
  6566. var i, o, a, t, s, l, E, c;
  6567. const e = Ri();
  6568. 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
  6569. }
  6570. };
  6571. function Ii() {
  6572. return {
  6573. socket_addr: new Uint8Array(0),
  6574. uuid: "",
  6575. relay_server: "",
  6576. id: void 0,
  6577. pk: void 0,
  6578. refuse_reason: "",
  6579. version: "",
  6580. feedback: 0
  6581. }
  6582. }
  6583. const o4 = {
  6584. encode(u, e = r.Writer.create()) {
  6585. 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
  6586. }, decode(u, e) {
  6587. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6588. let o = e === void 0 ? i.len : i.pos + e;
  6589. const a = Ii();
  6590. for (; i.pos < o;) {
  6591. const t = i.uint32();
  6592. switch (t >>> 3) {
  6593. case 1:
  6594. if (t !== 10) break;
  6595. a.socket_addr = i.bytes();
  6596. continue;
  6597. case 2:
  6598. if (t !== 18) break;
  6599. a.uuid = i.string();
  6600. continue;
  6601. case 3:
  6602. if (t !== 26) break;
  6603. a.relay_server = i.string();
  6604. continue;
  6605. case 4:
  6606. if (t !== 34) break;
  6607. a.id = i.string();
  6608. continue;
  6609. case 5:
  6610. if (t !== 42) break;
  6611. a.pk = i.bytes();
  6612. continue;
  6613. case 6:
  6614. if (t !== 50) break;
  6615. a.refuse_reason = i.string();
  6616. continue;
  6617. case 7:
  6618. if (t !== 58) break;
  6619. a.version = i.string();
  6620. continue;
  6621. case 9:
  6622. if (t !== 72) break;
  6623. a.feedback = i.int32();
  6624. continue
  6625. }
  6626. if ((t & 7) === 4 || t === 0) break;
  6627. i.skipType(t & 7)
  6628. }
  6629. return a
  6630. }, fromJSON(u) {
  6631. return {
  6632. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6633. uuid: p(u.uuid) ? globalThis.String(u.uuid) : "",
  6634. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6635. id: p(u.id) ? globalThis.String(u.id) : void 0,
  6636. pk: p(u.pk) ? O(u.pk) : void 0,
  6637. refuse_reason: p(u.refuse_reason) ? globalThis.String(u.refuse_reason) : "",
  6638. version: p(u.version) ? globalThis.String(u.version) : "",
  6639. feedback: p(u.feedback) ? globalThis.Number(u.feedback) : 0
  6640. }
  6641. }, toJSON(u) {
  6642. const e = {};
  6643. return u.socket_addr.length !== 0 && (e.socket_addr = M(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 = M(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
  6644. }, create(u) {
  6645. return o4.fromPartial(u != null ? u : {})
  6646. }, fromPartial(u) {
  6647. var i, o, a, t, s, l, E, c;
  6648. const e = Ii();
  6649. 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
  6650. }
  6651. };
  6652. function Ti() {
  6653. return {url: ""}
  6654. }
  6655. const n4 = {
  6656. encode(u, e = r.Writer.create()) {
  6657. return u.url !== "" && e.uint32(10).string(u.url), e
  6658. }, decode(u, e) {
  6659. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6660. let o = e === void 0 ? i.len : i.pos + e;
  6661. const a = Ti();
  6662. for (; i.pos < o;) {
  6663. const t = i.uint32();
  6664. switch (t >>> 3) {
  6665. case 1:
  6666. if (t !== 10) break;
  6667. a.url = i.string();
  6668. continue
  6669. }
  6670. if ((t & 7) === 4 || t === 0) break;
  6671. i.skipType(t & 7)
  6672. }
  6673. return a
  6674. }, fromJSON(u) {
  6675. return {url: p(u.url) ? globalThis.String(u.url) : ""}
  6676. }, toJSON(u) {
  6677. const e = {};
  6678. return u.url !== "" && (e.url = u.url), e
  6679. }, create(u) {
  6680. return n4.fromPartial(u != null ? u : {})
  6681. }, fromPartial(u) {
  6682. var i;
  6683. const e = Ti();
  6684. return e.url = (i = u.url) != null ? i : "", e
  6685. }
  6686. };
  6687. function ji() {
  6688. return {socket_addr: new Uint8Array(0), relay_server: ""}
  6689. }
  6690. const r4 = {
  6691. encode(u, e = r.Writer.create()) {
  6692. return u.socket_addr.length !== 0 && e.uint32(10).bytes(u.socket_addr), u.relay_server !== "" && e.uint32(18).string(u.relay_server), 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 = ji();
  6697. for (; i.pos < o;) {
  6698. const t = i.uint32();
  6699. switch (t >>> 3) {
  6700. case 1:
  6701. if (t !== 10) break;
  6702. a.socket_addr = i.bytes();
  6703. continue;
  6704. case 2:
  6705. if (t !== 18) break;
  6706. a.relay_server = i.string();
  6707. continue
  6708. }
  6709. if ((t & 7) === 4 || t === 0) break;
  6710. i.skipType(t & 7)
  6711. }
  6712. return a
  6713. }, fromJSON(u) {
  6714. return {
  6715. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6716. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : ""
  6717. }
  6718. }, toJSON(u) {
  6719. const e = {};
  6720. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.relay_server !== "" && (e.relay_server = u.relay_server), e
  6721. }, create(u) {
  6722. return r4.fromPartial(u != null ? u : {})
  6723. }, fromPartial(u) {
  6724. var i, o;
  6725. const e = ji();
  6726. return e.socket_addr = (i = u.socket_addr) != null ? i : new Uint8Array(0), e.relay_server = (o = u.relay_server) != null ? o : "", e
  6727. }
  6728. };
  6729. function Ni() {
  6730. return {socket_addr: new Uint8Array(0), local_addr: new Uint8Array(0), relay_server: "", id: "", version: ""}
  6731. }
  6732. const s4 = {
  6733. encode(u, e = r.Writer.create()) {
  6734. 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
  6735. }, decode(u, e) {
  6736. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6737. let o = e === void 0 ? i.len : i.pos + e;
  6738. const a = Ni();
  6739. for (; i.pos < o;) {
  6740. const t = i.uint32();
  6741. switch (t >>> 3) {
  6742. case 1:
  6743. if (t !== 10) break;
  6744. a.socket_addr = i.bytes();
  6745. continue;
  6746. case 2:
  6747. if (t !== 18) break;
  6748. a.local_addr = i.bytes();
  6749. continue;
  6750. case 3:
  6751. if (t !== 26) break;
  6752. a.relay_server = i.string();
  6753. continue;
  6754. case 4:
  6755. if (t !== 34) break;
  6756. a.id = i.string();
  6757. continue;
  6758. case 5:
  6759. if (t !== 42) break;
  6760. a.version = i.string();
  6761. continue
  6762. }
  6763. if ((t & 7) === 4 || t === 0) break;
  6764. i.skipType(t & 7)
  6765. }
  6766. return a
  6767. }, fromJSON(u) {
  6768. return {
  6769. socket_addr: p(u.socket_addr) ? O(u.socket_addr) : new Uint8Array(0),
  6770. local_addr: p(u.local_addr) ? O(u.local_addr) : new Uint8Array(0),
  6771. relay_server: p(u.relay_server) ? globalThis.String(u.relay_server) : "",
  6772. id: p(u.id) ? globalThis.String(u.id) : "",
  6773. version: p(u.version) ? globalThis.String(u.version) : ""
  6774. }
  6775. }, toJSON(u) {
  6776. const e = {};
  6777. return u.socket_addr.length !== 0 && (e.socket_addr = M(u.socket_addr)), u.local_addr.length !== 0 && (e.local_addr = M(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
  6778. }, create(u) {
  6779. return s4.fromPartial(u != null ? u : {})
  6780. }, fromPartial(u) {
  6781. var i, o, a, t, s;
  6782. const e = Ni();
  6783. 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
  6784. }
  6785. };
  6786. function Oi() {
  6787. return {cmd: "", mac: "", id: "", username: "", hostname: "", platform: "", misc: ""}
  6788. }
  6789. const l4 = {
  6790. encode(u, e = r.Writer.create()) {
  6791. 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
  6792. }, decode(u, e) {
  6793. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6794. let o = e === void 0 ? i.len : i.pos + e;
  6795. const a = Oi();
  6796. for (; i.pos < o;) {
  6797. const t = i.uint32();
  6798. switch (t >>> 3) {
  6799. case 1:
  6800. if (t !== 10) break;
  6801. a.cmd = i.string();
  6802. continue;
  6803. case 2:
  6804. if (t !== 18) break;
  6805. a.mac = i.string();
  6806. continue;
  6807. case 3:
  6808. if (t !== 26) break;
  6809. a.id = i.string();
  6810. continue;
  6811. case 4:
  6812. if (t !== 34) break;
  6813. a.username = i.string();
  6814. continue;
  6815. case 5:
  6816. if (t !== 42) break;
  6817. a.hostname = i.string();
  6818. continue;
  6819. case 6:
  6820. if (t !== 50) break;
  6821. a.platform = i.string();
  6822. continue;
  6823. case 7:
  6824. if (t !== 58) break;
  6825. a.misc = i.string();
  6826. continue
  6827. }
  6828. if ((t & 7) === 4 || t === 0) break;
  6829. i.skipType(t & 7)
  6830. }
  6831. return a
  6832. }, fromJSON(u) {
  6833. return {
  6834. cmd: p(u.cmd) ? globalThis.String(u.cmd) : "",
  6835. mac: p(u.mac) ? globalThis.String(u.mac) : "",
  6836. id: p(u.id) ? globalThis.String(u.id) : "",
  6837. username: p(u.username) ? globalThis.String(u.username) : "",
  6838. hostname: p(u.hostname) ? globalThis.String(u.hostname) : "",
  6839. platform: p(u.platform) ? globalThis.String(u.platform) : "",
  6840. misc: p(u.misc) ? globalThis.String(u.misc) : ""
  6841. }
  6842. }, toJSON(u) {
  6843. const e = {};
  6844. 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
  6845. }, create(u) {
  6846. return l4.fromPartial(u != null ? u : {})
  6847. }, fromPartial(u) {
  6848. var i, o, a, t, s, l, E;
  6849. const e = Oi();
  6850. 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
  6851. }
  6852. };
  6853. function Mi() {
  6854. return {id: "", peers: []}
  6855. }
  6856. const Ju = {
  6857. encode(u, e = r.Writer.create()) {
  6858. u.id !== "" && e.uint32(10).string(u.id);
  6859. for (const i of u.peers) e.uint32(18).string(i);
  6860. return e
  6861. }, decode(u, e) {
  6862. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6863. let o = e === void 0 ? i.len : i.pos + e;
  6864. const a = Mi();
  6865. for (; i.pos < o;) {
  6866. const t = i.uint32();
  6867. switch (t >>> 3) {
  6868. case 1:
  6869. if (t !== 10) break;
  6870. a.id = i.string();
  6871. continue;
  6872. case 2:
  6873. if (t !== 18) break;
  6874. a.peers.push(i.string());
  6875. continue
  6876. }
  6877. if ((t & 7) === 4 || t === 0) break;
  6878. i.skipType(t & 7)
  6879. }
  6880. return a
  6881. }, fromJSON(u) {
  6882. return {
  6883. id: p(u.id) ? globalThis.String(u.id) : "",
  6884. peers: globalThis.Array.isArray(u == null ? void 0 : u.peers) ? u.peers.map(e => globalThis.String(e)) : []
  6885. }
  6886. }, toJSON(u) {
  6887. var i;
  6888. const e = {};
  6889. return u.id !== "" && (e.id = u.id), (i = u.peers) != null && i.length && (e.peers = u.peers), e
  6890. }, create(u) {
  6891. return Ju.fromPartial(u != null ? u : {})
  6892. }, fromPartial(u) {
  6893. var i, o;
  6894. const e = Mi();
  6895. return e.id = (i = u.id) != null ? i : "", e.peers = ((o = u.peers) == null ? void 0 : o.map(a => a)) || [], e
  6896. }
  6897. };
  6898. function Ui() {
  6899. return {states: new Uint8Array(0)}
  6900. }
  6901. const E4 = {
  6902. encode(u, e = r.Writer.create()) {
  6903. return u.states.length !== 0 && e.uint32(10).bytes(u.states), e
  6904. }, decode(u, e) {
  6905. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6906. let o = e === void 0 ? i.len : i.pos + e;
  6907. const a = Ui();
  6908. for (; i.pos < o;) {
  6909. const t = i.uint32();
  6910. switch (t >>> 3) {
  6911. case 1:
  6912. if (t !== 10) break;
  6913. a.states = i.bytes();
  6914. continue
  6915. }
  6916. if ((t & 7) === 4 || t === 0) break;
  6917. i.skipType(t & 7)
  6918. }
  6919. return a
  6920. }, fromJSON(u) {
  6921. return {states: p(u.states) ? O(u.states) : new Uint8Array(0)}
  6922. }, toJSON(u) {
  6923. const e = {};
  6924. return u.states.length !== 0 && (e.states = M(u.states)), e
  6925. }, create(u) {
  6926. return E4.fromPartial(u != null ? u : {})
  6927. }, fromPartial(u) {
  6928. var i;
  6929. const e = Ui();
  6930. return e.states = (i = u.states) != null ? i : new Uint8Array(0), e
  6931. }
  6932. };
  6933. function Li() {
  6934. return {keys: []}
  6935. }
  6936. const d4 = {
  6937. encode(u, e = r.Writer.create()) {
  6938. for (const i of u.keys) e.uint32(10).bytes(i);
  6939. return e
  6940. }, decode(u, e) {
  6941. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6942. let o = e === void 0 ? i.len : i.pos + e;
  6943. const a = Li();
  6944. for (; i.pos < o;) {
  6945. const t = i.uint32();
  6946. switch (t >>> 3) {
  6947. case 1:
  6948. if (t !== 10) break;
  6949. a.keys.push(i.bytes());
  6950. continue
  6951. }
  6952. if ((t & 7) === 4 || t === 0) break;
  6953. i.skipType(t & 7)
  6954. }
  6955. return a
  6956. }, fromJSON(u) {
  6957. return {keys: globalThis.Array.isArray(u == null ? void 0 : u.keys) ? u.keys.map(e => O(e)) : []}
  6958. }, toJSON(u) {
  6959. var i;
  6960. const e = {};
  6961. return (i = u.keys) != null && i.length && (e.keys = u.keys.map(o => M(o))), e
  6962. }, create(u) {
  6963. return d4.fromPartial(u != null ? u : {})
  6964. }, fromPartial(u) {
  6965. var i;
  6966. const e = Li();
  6967. return e.keys = ((i = u.keys) == null ? void 0 : i.map(o => o)) || [], e
  6968. }
  6969. };
  6970. function Wi() {
  6971. return {token: ""}
  6972. }
  6973. const Gu = {
  6974. encode(u, e = r.Writer.create()) {
  6975. return u.token !== "" && e.uint32(10).string(u.token), e
  6976. }, decode(u, e) {
  6977. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  6978. let o = e === void 0 ? i.len : i.pos + e;
  6979. const a = Wi();
  6980. for (; i.pos < o;) {
  6981. const t = i.uint32();
  6982. switch (t >>> 3) {
  6983. case 1:
  6984. if (t !== 10) break;
  6985. a.token = i.string();
  6986. continue
  6987. }
  6988. if ((t & 7) === 4 || t === 0) break;
  6989. i.skipType(t & 7)
  6990. }
  6991. return a
  6992. }, fromJSON(u) {
  6993. return {token: p(u.token) ? globalThis.String(u.token) : ""}
  6994. }, toJSON(u) {
  6995. const e = {};
  6996. return u.token !== "" && (e.token = u.token), e
  6997. }, create(u) {
  6998. return Gu.fromPartial(u != null ? u : {})
  6999. }, fromPartial(u) {
  7000. var i;
  7001. const e = Wi();
  7002. return e.token = (i = u.token) != null ? i : "", e
  7003. }
  7004. };
  7005. function Vi() {
  7006. return {
  7007. register_peer: void 0,
  7008. register_peer_response: void 0,
  7009. punch_hole_request: void 0,
  7010. punch_hole: void 0,
  7011. punch_hole_sent: void 0,
  7012. punch_hole_response: void 0,
  7013. fetch_local_addr: void 0,
  7014. local_addr: void 0,
  7015. configure_update: void 0,
  7016. register_pk: void 0,
  7017. register_pk_response: void 0,
  7018. software_update: void 0,
  7019. request_relay: void 0,
  7020. relay_response: void 0,
  7021. test_nat_request: void 0,
  7022. test_nat_response: void 0,
  7023. peer_discovery: void 0,
  7024. online_request: void 0,
  7025. online_response: void 0,
  7026. key_exchange: void 0,
  7027. hc: void 0
  7028. }
  7029. }
  7030. const z4 = {
  7031. encode(u, e = r.Writer.create()) {
  7032. return u.register_peer !== void 0 && Q0.encode(u.register_peer, e.uint32(50).fork()).ldelim(), u.register_peer_response !== void 0 && X0.encode(u.register_peer_response, e.uint32(58).fork()).ldelim(), u.punch_hole_request !== void 0 && Ku.encode(u.punch_hole_request, e.uint32(66).fork()).ldelim(), u.punch_hole !== void 0 && Y0.encode(u.punch_hole, e.uint32(74).fork()).ldelim(), u.punch_hole_sent !== void 0 && e4.encode(u.punch_hole_sent, e.uint32(82).fork()).ldelim(), u.punch_hole_response !== void 0 && a4.encode(u.punch_hole_response, e.uint32(90).fork()).ldelim(), u.fetch_local_addr !== void 0 && r4.encode(u.fetch_local_addr, e.uint32(98).fork()).ldelim(), u.local_addr !== void 0 && s4.encode(u.local_addr, e.uint32(106).fork()).ldelim(), u.configure_update !== void 0 && eu.encode(u.configure_update, e.uint32(114).fork()).ldelim(), u.register_pk !== void 0 && i4.encode(u.register_pk, e.uint32(122).fork()).ldelim(), u.register_pk_response !== void 0 && t4.encode(u.register_pk_response, e.uint32(130).fork()).ldelim(), u.software_update !== void 0 && n4.encode(u.software_update, e.uint32(138).fork()).ldelim(), u.request_relay !== void 0 && Hu.encode(u.request_relay, e.uint32(146).fork()).ldelim(), u.relay_response !== void 0 && o4.encode(u.relay_response, e.uint32(154).fork()).ldelim(), u.test_nat_request !== void 0 && $0.encode(u.test_nat_request, e.uint32(162).fork()).ldelim(), u.test_nat_response !== void 0 && u4.encode(u.test_nat_response, e.uint32(170).fork()).ldelim(), u.peer_discovery !== void 0 && l4.encode(u.peer_discovery, e.uint32(178).fork()).ldelim(), u.online_request !== void 0 && Ju.encode(u.online_request, e.uint32(186).fork()).ldelim(), u.online_response !== void 0 && E4.encode(u.online_response, e.uint32(194).fork()).ldelim(), u.key_exchange !== void 0 && d4.encode(u.key_exchange, e.uint32(202).fork()).ldelim(), u.hc !== void 0 && Gu.encode(u.hc, e.uint32(210).fork()).ldelim(), e
  7033. }, decode(u, e) {
  7034. const i = u instanceof r.Reader ? u : r.Reader.create(u);
  7035. let o = e === void 0 ? i.len : i.pos + e;
  7036. const a = Vi();
  7037. for (; i.pos < o;) {
  7038. const t = i.uint32();
  7039. switch (t >>> 3) {
  7040. case 6:
  7041. if (t !== 50) break;
  7042. a.register_peer = Q0.decode(i, i.uint32());
  7043. continue;
  7044. case 7:
  7045. if (t !== 58) break;
  7046. a.register_peer_response = X0.decode(i, i.uint32());
  7047. continue;
  7048. case 8:
  7049. if (t !== 66) break;
  7050. a.punch_hole_request = Ku.decode(i, i.uint32());
  7051. continue;
  7052. case 9:
  7053. if (t !== 74) break;
  7054. a.punch_hole = Y0.decode(i, i.uint32());
  7055. continue;
  7056. case 10:
  7057. if (t !== 82) break;
  7058. a.punch_hole_sent = e4.decode(i, i.uint32());
  7059. continue;
  7060. case 11:
  7061. if (t !== 90) break;
  7062. a.punch_hole_response = a4.decode(i, i.uint32());
  7063. continue;
  7064. case 12:
  7065. if (t !== 98) break;
  7066. a.fetch_local_addr = r4.decode(i, i.uint32());
  7067. continue;
  7068. case 13:
  7069. if (t !== 106) break;
  7070. a.local_addr = s4.decode(i, i.uint32());
  7071. continue;
  7072. case 14:
  7073. if (t !== 114) break;
  7074. a.configure_update = eu.decode(i, i.uint32());
  7075. continue;
  7076. case 15:
  7077. if (t !== 122) break;
  7078. a.register_pk = i4.decode(i, i.uint32());
  7079. continue;
  7080. case 16:
  7081. if (t !== 130) break;
  7082. a.register_pk_response = t4.decode(i, i.uint32());
  7083. continue;
  7084. case 17:
  7085. if (t !== 138) break;
  7086. a.software_update = n4.decode(i, i.uint32());
  7087. continue;
  7088. case 18:
  7089. if (t !== 146) break;
  7090. a.request_relay = Hu.decode(i, i.uint32());
  7091. continue;
  7092. case 19:
  7093. if (t !== 154) break;
  7094. a.relay_response = o4.decode(i, i.uint32());
  7095. continue;
  7096. case 20:
  7097. if (t !== 162) break;
  7098. a.test_nat_request = $0.decode(i, i.uint32());
  7099. continue;
  7100. case 21:
  7101. if (t !== 170) break;
  7102. a.test_nat_response = u4.decode(i, i.uint32());
  7103. continue;
  7104. case 22:
  7105. if (t !== 178) break;
  7106. a.peer_discovery = l4.decode(i, i.uint32());
  7107. continue;
  7108. case 23:
  7109. if (t !== 186) break;
  7110. a.online_request = Ju.decode(i, i.uint32());
  7111. continue;
  7112. case 24:
  7113. if (t !== 194) break;
  7114. a.online_response = E4.decode(i, i.uint32());
  7115. continue;
  7116. case 25:
  7117. if (t !== 202) break;
  7118. a.key_exchange = d4.decode(i, i.uint32());
  7119. continue;
  7120. case 26:
  7121. if (t !== 210) break;
  7122. a.hc = Gu.decode(i, i.uint32());
  7123. continue
  7124. }
  7125. if ((t & 7) === 4 || t === 0) break;
  7126. i.skipType(t & 7)
  7127. }
  7128. return a
  7129. }, fromJSON(u) {
  7130. return {
  7131. register_peer: p(u.register_peer) ? Q0.fromJSON(u.register_peer) : void 0,
  7132. register_peer_response: p(u.register_peer_response) ? X0.fromJSON(u.register_peer_response) : void 0,
  7133. punch_hole_request: p(u.punch_hole_request) ? Ku.fromJSON(u.punch_hole_request) : void 0,
  7134. punch_hole: p(u.punch_hole) ? Y0.fromJSON(u.punch_hole) : void 0,
  7135. punch_hole_sent: p(u.punch_hole_sent) ? e4.fromJSON(u.punch_hole_sent) : void 0,
  7136. punch_hole_response: p(u.punch_hole_response) ? a4.fromJSON(u.punch_hole_response) : void 0,
  7137. fetch_local_addr: p(u.fetch_local_addr) ? r4.fromJSON(u.fetch_local_addr) : void 0,
  7138. local_addr: p(u.local_addr) ? s4.fromJSON(u.local_addr) : void 0,
  7139. configure_update: p(u.configure_update) ? eu.fromJSON(u.configure_update) : void 0,
  7140. register_pk: p(u.register_pk) ? i4.fromJSON(u.register_pk) : void 0,
  7141. register_pk_response: p(u.register_pk_response) ? t4.fromJSON(u.register_pk_response) : void 0,
  7142. software_update: p(u.software_update) ? n4.fromJSON(u.software_update) : void 0,
  7143. request_relay: p(u.request_relay) ? Hu.fromJSON(u.request_relay) : void 0,
  7144. relay_response: p(u.relay_response) ? o4.fromJSON(u.relay_response) : void 0,
  7145. test_nat_request: p(u.test_nat_request) ? $0.fromJSON(u.test_nat_request) : void 0,
  7146. test_nat_response: p(u.test_nat_response) ? u4.fromJSON(u.test_nat_response) : void 0,
  7147. peer_discovery: p(u.peer_discovery) ? l4.fromJSON(u.peer_discovery) : void 0,
  7148. online_request: p(u.online_request) ? Ju.fromJSON(u.online_request) : void 0,
  7149. online_response: p(u.online_response) ? E4.fromJSON(u.online_response) : void 0,
  7150. key_exchange: p(u.key_exchange) ? d4.fromJSON(u.key_exchange) : void 0,
  7151. hc: p(u.hc) ? Gu.fromJSON(u.hc) : void 0
  7152. }
  7153. }, toJSON(u) {
  7154. const e = {};
  7155. return u.register_peer !== void 0 && (e.register_peer = Q0.toJSON(u.register_peer)), u.register_peer_response !== void 0 && (e.register_peer_response = X0.toJSON(u.register_peer_response)), u.punch_hole_request !== void 0 && (e.punch_hole_request = Ku.toJSON(u.punch_hole_request)), u.punch_hole !== void 0 && (e.punch_hole = Y0.toJSON(u.punch_hole)), u.punch_hole_sent !== void 0 && (e.punch_hole_sent = e4.toJSON(u.punch_hole_sent)), u.punch_hole_response !== void 0 && (e.punch_hole_response = a4.toJSON(u.punch_hole_response)), u.fetch_local_addr !== void 0 && (e.fetch_local_addr = r4.toJSON(u.fetch_local_addr)), u.local_addr !== void 0 && (e.local_addr = s4.toJSON(u.local_addr)), u.configure_update !== void 0 && (e.configure_update = eu.toJSON(u.configure_update)), u.register_pk !== void 0 && (e.register_pk = i4.toJSON(u.register_pk)), u.register_pk_response !== void 0 && (e.register_pk_response = t4.toJSON(u.register_pk_response)), u.software_update !== void 0 && (e.software_update = n4.toJSON(u.software_update)), u.request_relay !== void 0 && (e.request_relay = Hu.toJSON(u.request_relay)), u.relay_response !== void 0 && (e.relay_response = o4.toJSON(u.relay_response)), u.test_nat_request !== void 0 && (e.test_nat_request = $0.toJSON(u.test_nat_request)), u.test_nat_response !== void 0 && (e.test_nat_response = u4.toJSON(u.test_nat_response)), u.peer_discovery !== void 0 && (e.peer_discovery = l4.toJSON(u.peer_discovery)), u.online_request !== void 0 && (e.online_request = Ju.toJSON(u.online_request)), u.online_response !== void 0 && (e.online_response = E4.toJSON(u.online_response)), u.key_exchange !== void 0 && (e.key_exchange = d4.toJSON(u.key_exchange)), u.hc !== void 0 && (e.hc = Gu.toJSON(u.hc)), e
  7156. }, create(u) {
  7157. return z4.fromPartial(u != null ? u : {})
  7158. }, fromPartial(u) {
  7159. const e = Vi();
  7160. return e.register_peer = u.register_peer !== void 0 && u.register_peer !== null ? Q0.fromPartial(u.register_peer) : void 0, e.register_peer_response = u.register_peer_response !== void 0 && u.register_peer_response !== null ? X0.fromPartial(u.register_peer_response) : void 0, e.punch_hole_request = u.punch_hole_request !== void 0 && u.punch_hole_request !== null ? Ku.fromPartial(u.punch_hole_request) : void 0, e.punch_hole = u.punch_hole !== void 0 && u.punch_hole !== null ? Y0.fromPartial(u.punch_hole) : void 0, e.punch_hole_sent = u.punch_hole_sent !== void 0 && u.punch_hole_sent !== null ? e4.fromPartial(u.punch_hole_sent) : void 0, e.punch_hole_response = u.punch_hole_response !== void 0 && u.punch_hole_response !== null ? a4.fromPartial(u.punch_hole_response) : void 0, e.fetch_local_addr = u.fetch_local_addr !== void 0 && u.fetch_local_addr !== null ? r4.fromPartial(u.fetch_local_addr) : void 0, e.local_addr = u.local_addr !== void 0 && u.local_addr !== null ? s4.fromPartial(u.local_addr) : void 0, e.configure_update = u.configure_update !== void 0 && u.configure_update !== null ? eu.fromPartial(u.configure_update) : void 0, e.register_pk = u.register_pk !== void 0 && u.register_pk !== null ? i4.fromPartial(u.register_pk) : void 0, e.register_pk_response = u.register_pk_response !== void 0 && u.register_pk_response !== null ? t4.fromPartial(u.register_pk_response) : void 0, e.software_update = u.software_update !== void 0 && u.software_update !== null ? n4.fromPartial(u.software_update) : void 0, e.request_relay = u.request_relay !== void 0 && u.request_relay !== null ? Hu.fromPartial(u.request_relay) : void 0, e.relay_response = u.relay_response !== void 0 && u.relay_response !== null ? o4.fromPartial(u.relay_response) : void 0, e.test_nat_request = u.test_nat_request !== void 0 && u.test_nat_request !== null ? $0.fromPartial(u.test_nat_request) : void 0, e.test_nat_response = u.test_nat_response !== void 0 && u.test_nat_response !== null ? u4.fromPartial(u.test_nat_response) : void 0, e.peer_discovery = u.peer_discovery !== void 0 && u.peer_discovery !== null ? l4.fromPartial(u.peer_discovery) : void 0, e.online_request = u.online_request !== void 0 && u.online_request !== null ? Ju.fromPartial(u.online_request) : void 0, e.online_response = u.online_response !== void 0 && u.online_response !== null ? E4.fromPartial(u.online_response) : void 0, e.key_exchange = u.key_exchange !== void 0 && u.key_exchange !== null ? d4.fromPartial(u.key_exchange) : void 0, e.hc = u.hc !== void 0 && u.hc !== null ? Gu.fromPartial(u.hc) : void 0, e
  7161. }
  7162. };
  7163. function O(u) {
  7164. if (globalThis.Buffer) return Uint8Array.from(globalThis.Buffer.from(u, "base64"));
  7165. {
  7166. const e = globalThis.atob(u), i = new Uint8Array(e.length);
  7167. for (let o = 0; o < e.length; ++o) i[o] = e.charCodeAt(o);
  7168. return i
  7169. }
  7170. }
  7171. function M(u) {
  7172. if (globalThis.Buffer) return globalThis.Buffer.from(u).toString("base64");
  7173. {
  7174. const e = [];
  7175. return u.forEach(i => {
  7176. e.push(globalThis.String.fromCharCode(i))
  7177. }), globalThis.btoa(e.join(""))
  7178. }
  7179. }
  7180. function p(u) {
  7181. return u != null
  7182. }
  7183. class N4 {
  7184. constructor(e, i = !0, o = "") {
  7185. d(this, "_websocket");
  7186. d(this, "_eventHandlers");
  7187. d(this, "_buf");
  7188. d(this, "_status");
  7189. d(this, "_latency");
  7190. d(this, "_secretKey");
  7191. d(this, "_uri");
  7192. d(this, "_isRendezvous");
  7193. d(this, "_recvDataCount");
  7194. d(this, "_tag");
  7195. d(this, "_isProcessing");
  7196. this._eventHandlers = {
  7197. message: void 0,
  7198. open: void 0,
  7199. close: void 0,
  7200. error: void 0,
  7201. status_change: void 0
  7202. }, 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
  7203. }
  7204. resetRecvDataCount() {
  7205. this._recvDataCount = 0
  7206. }
  7207. getRecvDataCount() {
  7208. return this._recvDataCount
  7209. }
  7210. latency() {
  7211. return this._latency
  7212. }
  7213. setSecretKey(e) {
  7214. this._secretKey = [e, 0, 0]
  7215. }
  7216. sendMessage(e) {
  7217. let i = iu.encode(iu.fromPartial(e)).finish(), o = this._secretKey;
  7218. o && (o[1] += 1, i = st(i, o[1], o[0])), this._websocket.send(i)
  7219. }
  7220. sendRendezvous(e) {
  7221. this._websocket.send(z4.encode(z4.fromPartial(e)).finish())
  7222. }
  7223. sendBytes(e) {
  7224. let i = this._secretKey;
  7225. i && (i[1] += 1, e = st(e, i[1], i[0])), this._websocket.send(e)
  7226. }
  7227. parseMessage(e) {
  7228. return iu.decode(e)
  7229. }
  7230. parseRendezvous(e) {
  7231. return z4.decode(e)
  7232. }
  7233. off(e) {
  7234. this._eventHandlers[e] = void 0
  7235. }
  7236. on(e, i) {
  7237. this._eventHandlers[e] = i
  7238. }
  7239. setStatus(e) {
  7240. this._status = e, this._eventHandlers.status_change && this._eventHandlers.status_change(e)
  7241. }
  7242. async open(e = 12e3) {
  7243. return new Promise((i, o) => {
  7244. setTimeout(() => {
  7245. this._status != "open" && o(this._status || "Timeout")
  7246. }, e), this._websocket.onopen = () => {
  7247. var a;
  7248. 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)
  7249. }, this._websocket.onclose = a => {
  7250. 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")
  7251. }, this._websocket.onerror = a => {
  7252. if (!this._status) {
  7253. o("Failed to connect to " + (this._isRendezvous ? "rendezvous" : "relay") + " server, " + this._uri);
  7254. return
  7255. }
  7256. this.setStatus(a), console.error("WebSock.onerror: " + this._tag), console.error(a), this._eventHandlers.error && this._eventHandlers.error(a)
  7257. }
  7258. })
  7259. }
  7260. async next(e = 12e3) {
  7261. let i = this._eventHandlers.message;
  7262. this.off("message");
  7263. try {
  7264. let o = await this._next(e);
  7265. return this.on("message", i), o
  7266. } catch (o) {
  7267. throw this.on("message", i), o
  7268. }
  7269. }
  7270. async _next(e = 12e3) {
  7271. const i = (o, a, t) => {
  7272. if (this._buf.length) o(this._buf[0]), this._buf.splice(0, 1); else {
  7273. if (this._status != "open") {
  7274. a(this._status);
  7275. return
  7276. }
  7277. new Date().getTime() > t + e ? a("Timeout") : setTimeout(() => i(o, a, t), 1)
  7278. }
  7279. };
  7280. return new Promise((o, a) => {
  7281. i(o, a, new Date().getTime())
  7282. })
  7283. }
  7284. close() {
  7285. 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 = () => {
  7286. })
  7287. }
  7288. _recv_message(e) {
  7289. if (e.data instanceof window.ArrayBuffer) {
  7290. let i = new Uint8Array(e.data);
  7291. this._recvDataCount += i.length;
  7292. const o = this._secretKey;
  7293. o && (o[2] += 1, i = Kn(i, o[2], o[0]));
  7294. let a;
  7295. 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())
  7296. }
  7297. }
  7298. async processQueue() {
  7299. this._isProcessing = !0;
  7300. try {
  7301. for (; this._buf.length > 0 && this._eventHandlers.message;) {
  7302. const e = this._buf.shift();
  7303. await this._eventHandlers.message(e)
  7304. }
  7305. } catch (e) {
  7306. console.log("Error in processQueue: " + e)
  7307. }
  7308. this._isProcessing = !1
  7309. }
  7310. }
  7311. let mu = null;
  7312. const qi = ".";
  7313. var X, Bu, $u, J4, Eu, G4, Dt, h4;
  7314. class za {
  7315. constructor() {
  7316. pu(this, G4);
  7317. pu(this, X, null);
  7318. pu(this, Bu, {});
  7319. pu(this, $u, {});
  7320. pu(this, J4, 0);
  7321. pu(this, Eu, []);
  7322. pu(this, h4, async (e, i) => {
  7323. const o = await (await fetch(e)).arrayBuffer(), a = new Blob([o], {type: i});
  7324. return URL.createObjectURL(a)
  7325. })
  7326. }
  7327. async load() {
  7328. if (!h(this, X)) {
  7329. B4(this, X, new Worker("./ffmpeg.js?v=dddac33a", {type: "module"})), je(this, G4, Dt).call(this);
  7330. const e = await h(this, h4).call(this, `${qi}/ffmpeg-core.js?v=16fa4bb1`, "text/javascript"),
  7331. i = await h(this, h4).call(this, `${qi}/ffmpeg-core.wasm?v=241ebe18`, "application/wasm");
  7332. return this.send({type: "LOAD", data: {coreURL: e, wasmURL: i}})
  7333. }
  7334. }
  7335. async decode(e, i) {
  7336. let o = [i];
  7337. var a = null;
  7338. return h(this, Eu).length > 0 && (a = h(this, Eu).pop(), o.push(a)), this.send({
  7339. type: "DECODE",
  7340. data: {codec: e, data: i, arrayBuffer: a}
  7341. }, o)
  7342. }
  7343. async send({type: e, data: i}, o) {
  7344. return h(this, X) ? new Promise((a, t) => {
  7345. const s = Te(this, J4)._++;
  7346. h(this, Bu)[s] = a, h(this, $u)[s] = t, h(this, X).postMessage({id: s, type: e, data: i}, o)
  7347. }) : Promise.reject("FFmpeg not loaded")
  7348. }
  7349. close() {
  7350. h(this, X) && (this.send({type: "CLOSE", data: {}}), h(this, X).terminate(), B4(this, X, null))
  7351. }
  7352. }
  7353. X = new WeakMap, Bu = new WeakMap, $u = new WeakMap, J4 = new WeakMap, Eu = new WeakMap, G4 = new WeakSet, Dt = function () {
  7354. h(this, X).onmessage = ({data: {id: e, type: i, data: o}}) => {
  7355. i == "LOAD" ? (console.log("FFmpeg loaded"), h(this, Bu)[e](o)) : i == "DECODE" ? (h(this, Eu).push(o.data.data), h(this, Eu).length > 8 && h(this, Eu).shift(), h(this, Bu)[e](o)) : i == "CLOSE" ? (B4(this, Eu, []), h(this, Bu)[e](o)) : i == "ERROR" ? h(this, $u)[e](o) : h(this, $u)[e](o), delete h(this, Bu)[e], delete h(this, $u)[e]
  7356. }
  7357. }, h4 = new WeakMap;
  7358. async function Pa() {
  7359. try {
  7360. return mu = new za, mu ? mu.load() : Promise.reject("Failed to create FFmpeg instance")
  7361. } catch (u) {
  7362. return console.log("Failed to load FFmpeg", u), Promise.reject("Failed to load FFmpeg")
  7363. }
  7364. }
  7365. async function Ra(u, e) {
  7366. return mu ? mu.decode(u, e) : Promise.reject("FFmpeg is uninitialized")
  7367. }
  7368. async function Ia() {
  7369. mu && (mu.close(), mu = null)
  7370. }
  7371. const Ta = "Desktop session not ready", ja = "Desktop xsession failed", Na = "Desktop session another user login",
  7372. Oa = "Desktop xorg not found", Ma = "Desktop none", Ua = "Desktop session not ready, password empty",
  7373. La = "Desktop session not ready, password wrong", Wa = "Empty Password", Va = "Wrong Password",
  7374. qa = "Wrong 2FA Code", Ki = "2FA Required", Ka = "No Password Access", Ha = "Wayland login screen is not supported",
  7375. Ja = "x11 expected", Bt = "https://rustdesk.com/docs/en/manual/linux/#x11-required",
  7376. Ga = "https://rustdesk.com/docs/en/", Za = Bt,
  7377. Qa = "https://github.com/rustdesk/rustdesk/wiki/Headless-Linux-Support",
  7378. Hi = {"rustdesk docs home": Ga, "rustdesk docs x11-required": Za, "rustdesk x11 headless": Qa},
  7379. Ji = "Input source 1", Xa = "map", Gi = "translate", Ya = "ShiftLeft", $a = "ShiftRight", F4 = "ControlLeft",
  7380. mt = "ControlRight", De = "AltLeft", At = "AltRight", Ft = "MetaLeft", _t = "MetaRight", Y4 = "Windows",
  7381. Be = "Linux", me = "Mac OS", vt = "Android", uo = "iOS", eo = "web", io = "ISO", to = 1, ao = 2, Zi = 3, Qi = 4,
  7382. y4 = 1, b4 = 2, oo = 4, no = 8, ro = 16, ee = "public", Xi = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=",
  7383. so = 1e3, lo = 6e4, re = lang, Eo = langIds;
  7384. function co(u, e, i, o) {
  7385. 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)
  7386. }
  7387. const Co = {
  7388. VK_A: "a",
  7389. VK_B: "b",
  7390. VK_C: "c",
  7391. VK_D: "d",
  7392. VK_E: "e",
  7393. VK_F: "f",
  7394. VK_G: "g",
  7395. VK_H: "h",
  7396. VK_I: "i",
  7397. VK_J: "j",
  7398. VK_K: "k",
  7399. VK_L: "l",
  7400. VK_M: "m",
  7401. VK_N: "n",
  7402. VK_O: "o",
  7403. VK_P: "p",
  7404. VK_Q: "q",
  7405. VK_R: "r",
  7406. VK_S: "s",
  7407. VK_T: "t",
  7408. VK_U: "u",
  7409. VK_V: "v",
  7410. VK_W: "w",
  7411. VK_X: "x",
  7412. VK_Y: "y",
  7413. VK_Z: "z",
  7414. VK_0: "0",
  7415. VK_1: "1",
  7416. VK_2: "2",
  7417. VK_3: "3",
  7418. VK_4: "4",
  7419. VK_5: "5",
  7420. VK_6: "6",
  7421. VK_7: "7",
  7422. VK_8: "8",
  7423. VK_9: "9",
  7424. VK_COMMA: ",",
  7425. VK_SLASH: "/",
  7426. VK_SEMICOLON: ";",
  7427. VK_QUOTE: "'",
  7428. VK_LBRACKET: "[",
  7429. VK_RBRACKET: "]",
  7430. VK_BACKSLASH: "\\",
  7431. VK_MINUS: "-",
  7432. VK_PLUS: "=",
  7433. VK_DIVIDE: "Divide",
  7434. VK_MULTIPLY: "Multiply",
  7435. VK_SUBTRACT: "Subtract",
  7436. VK_ADD: "Add",
  7437. VK_DECIMAL: "Decimal",
  7438. VK_F1: "F1",
  7439. VK_F2: "F2",
  7440. VK_F3: "F3",
  7441. VK_F4: "F4",
  7442. VK_F5: "F5",
  7443. VK_F6: "F6",
  7444. VK_F7: "F7",
  7445. VK_F8: "F8",
  7446. VK_F9: "F9",
  7447. VK_F10: "F10",
  7448. VK_F11: "F11",
  7449. VK_F12: "F12",
  7450. VK_ENTER: "Return",
  7451. VK_CANCEL: "Cancel",
  7452. VK_BACK: "Backspace",
  7453. VK_TAB: "Tab",
  7454. VK_CLEAR: "Clear",
  7455. VK_RETURN: "Return",
  7456. VK_SHIFT: "Shift",
  7457. VK_CONTROL: "Control",
  7458. VK_MENU: "Alt",
  7459. VK_PAUSE: "Pause",
  7460. VK_CAPITAL: "CapsLock",
  7461. VK_KANA: "Kana",
  7462. VK_HANGUL: "Hangul",
  7463. VK_JUNJA: "Junja",
  7464. VK_FINAL: "Final",
  7465. VK_HANJA: "Hanja",
  7466. VK_KANJI: "Kanji",
  7467. VK_ESCAPE: "Escape",
  7468. VK_CONVERT: "Convert",
  7469. VK_SPACE: "Space",
  7470. VK_PRIOR: "PageUp",
  7471. VK_NEXT: "PageDown",
  7472. VK_END: "End",
  7473. VK_HOME: "Home",
  7474. VK_LEFT: "LeftArrow",
  7475. VK_UP: "UpArrow",
  7476. VK_RIGHT: "RightArrow",
  7477. VK_DOWN: "DownArrow",
  7478. VK_SELECT: "Select",
  7479. VK_PRINT: "Print",
  7480. VK_EXECUTE: "Execute",
  7481. VK_SNAPSHOT: "Snapshot",
  7482. VK_SCROLL: "Scroll",
  7483. VK_INSERT: "Insert",
  7484. VK_DELETE: "Delete",
  7485. VK_HELP: "Help",
  7486. VK_SLEEP: "Sleep",
  7487. VK_SEPARATOR: "Separator",
  7488. VK_NUMPAD0: "Numpad0",
  7489. VK_NUMPAD1: "Numpad1",
  7490. VK_NUMPAD2: "Numpad2",
  7491. VK_NUMPAD3: "Numpad3",
  7492. VK_NUMPAD4: "Numpad4",
  7493. VK_NUMPAD5: "Numpad5",
  7494. VK_NUMPAD6: "Numpad6",
  7495. VK_NUMPAD7: "Numpad7",
  7496. VK_NUMPAD8: "Numpad8",
  7497. VK_NUMPAD9: "Numpad9",
  7498. Apps: "Apps",
  7499. Meta: "Meta",
  7500. RAlt: "RAlt",
  7501. RWin: "RWin",
  7502. RControl: "RControl",
  7503. RShift: "RShift",
  7504. CTRL_ALT_DEL: "CtrlAltDel",
  7505. LOCK_SCREEN: "LockScreen"
  7506. }, se = "1.3.7", po = "2025-01-21 01:12";
  7507. class A {
  7508. static setItem(e, i) {
  7509. localStorage.setItem(this.prefix + e, i)
  7510. }
  7511. static getItem(e) {
  7512. return localStorage.getItem(this.prefix + e)
  7513. }
  7514. static removeItem(e) {
  7515. localStorage.removeItem(this.prefix + e)
  7516. }
  7517. static clear() {
  7518. for (let e = localStorage.length - 1; e >= 0; e--) {
  7519. const i = localStorage.key(e);
  7520. i && i.startsWith(this.prefix) && localStorage.removeItem(i)
  7521. }
  7522. }
  7523. }
  7524. d(A, "prefix", "wc-");
  7525. class N {
  7526. static async init() {
  7527. if (!this.db) return new Promise((e, i) => {
  7528. const o = indexedDB.open(this.dbName, 1);
  7529. o.onupgradeneeded = a => {
  7530. const t = a.target.result;
  7531. t.objectStoreNames.contains(this.storeName) || t.createObjectStore(this.storeName)
  7532. }, o.onsuccess = async a => {
  7533. this.db = a.target.result;
  7534. try {
  7535. await this.loadCache(), e()
  7536. } catch (t) {
  7537. i(t)
  7538. }
  7539. }, o.onerror = a => {
  7540. i(a.target.error)
  7541. }
  7542. })
  7543. }
  7544. static async loadCache() {
  7545. return new Promise((e, i) => {
  7546. const a = this.db.transaction([this.storeName], "readonly").objectStore(this.storeName), t = a.getAllKeys();
  7547. t.onsuccess = s => {
  7548. const E = s.target.result.map(c => new Promise((C, D) => {
  7549. const B = a.get(c);
  7550. B.onsuccess = F => {
  7551. this.cache[c] = F.target.result, C()
  7552. }, B.onerror = F => {
  7553. D(F.target.error)
  7554. }
  7555. }));
  7556. Promise.all(E).then(() => e()).catch(i)
  7557. }, t.onerror = s => {
  7558. i(s.target.error)
  7559. }
  7560. })
  7561. }
  7562. static setItem(e, i) {
  7563. this.cache[this.prefix + e] = i;
  7564. const t = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).put(i, this.prefix + e);
  7565. t.onerror = s => {
  7566. console.error("IndexedDB setItem error:", s.target.error)
  7567. }
  7568. }
  7569. static getItem(e) {
  7570. var i;
  7571. return (i = this.cache[this.prefix + e]) != null ? i : null
  7572. }
  7573. static removeItem(e) {
  7574. delete this.cache[this.prefix + e];
  7575. const a = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).delete(this.prefix + e);
  7576. a.onerror = t => {
  7577. console.error("IndexedDB removeItem error:", t.target.error)
  7578. }
  7579. }
  7580. static clear() {
  7581. this.cache = {};
  7582. const o = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).clear();
  7583. o.onerror = a => {
  7584. console.error("IndexedDB clear error:", a.target.error)
  7585. }
  7586. }
  7587. }
  7588. d(N, "dbName", "wc-database"), d(N, "storeName", "wc-store"), d(N, "prefix", "wc-"), d(N, "db", null), d(N, "cache", {});
  7589. const Cu = () => {
  7590. try {
  7591. return JSON.parse(N.getItem("peers")) || {}
  7592. } catch {
  7593. return {}
  7594. }
  7595. }, Ae = u => {
  7596. N.setItem("peers", JSON.stringify(u))
  7597. }, Do = u => {
  7598. const e = Cu();
  7599. delete e[u], Ae(e)
  7600. }, le = u => Cu()[u], Bo = (u, e) => {
  7601. const i = Cu();
  7602. i[u] = e, Ae(i)
  7603. }, mo = (u, e) => {
  7604. var o;
  7605. return (o = le(u)[e]) != null ? o : u0(e)
  7606. }, kt = (u, e, i) => {
  7607. const o = Cu(), a = o[u] || {};
  7608. i == null ? delete a[e] : a[e] = i, a.tm = new Date().getTime(), o[u] = a, Ae(o)
  7609. }, Fe = u => A.getItem(`option:local:${u}`), gt = (u, e) => {
  7610. A.setItem(`option:local:${u}`, e)
  7611. }, Ao = u => A.getItem(`option:flutter:local:${u}`), Fo = (u, e) => {
  7612. A.setItem(`option:flutter:local:${u}`, e)
  7613. }, ht = async u => {
  7614. const e = Gt(), i = Xu.publicKey, o = $4(0), a = e.from_string(u), t = await ua(a),
  7615. s = e.crypto_secretbox_easy(t, o, i);
  7616. return Z(s)
  7617. }, ft = async u => {
  7618. const e = Gt(), i = Xu.publicKey, o = c4(u), a = e.crypto_secretbox_open_easy(o, $4(0), i), t = await ea(a);
  7619. return e.to_string(t)
  7620. }, _o = async u => {
  7621. let e = await ht(u);
  7622. N.setItem("ab", e)
  7623. }, xt = async () => {
  7624. try {
  7625. let u = N.getItem("ab");
  7626. if (u) return JSON.parse(await ft(u))
  7627. } catch (u) {
  7628. console.error("loadAb error", u)
  7629. }
  7630. return {access_token: "", ab_entries: []}
  7631. }, vo = () => {
  7632. N.removeItem("ab")
  7633. }, ko = async u => {
  7634. let e = await ht(u);
  7635. N.setItem("group", e)
  7636. }, go = async () => {
  7637. try {
  7638. let u = N.getItem("group");
  7639. if (u) return JSON.parse(await ft(u))
  7640. } catch (u) {
  7641. console.error("loadGroup error", u)
  7642. }
  7643. return {access_token: "", users: [], peers: []}
  7644. }, ho = () => {
  7645. N.removeItem("group")
  7646. }, fo = u => u.name == "My address book" || u.name == "Legacy address book";
  7647. var yt = bt();
  7648. function xo() {
  7649. yt = bt()
  7650. }
  7651. function yo(u, e) {
  7652. const i = yt || u.substring(u.length - 2).toLowerCase();
  7653. let o = re.en, a = re[i];
  7654. a || (a = o);
  7655. let t = a[e];
  7656. return !t && i != "en" && (t = o[e]), t || e
  7657. }
  7658. const bo = "z".charCodeAt(0), wo = "a".charCodeAt(0);
  7659. function So(u, e) {
  7660. const i = Co[u] || u;
  7661. if (i.length == 1) {
  7662. const a = i.charCodeAt(0);
  7663. return !e && (a > bo || a < wo) ? w.fromPartial({unicode: a}) : w.fromPartial({chr: a})
  7664. }
  7665. const o = v4(i);
  7666. return o == j.UNRECOGNIZED && console.error("Unknown control key " + i), w.fromPartial({control_key: o})
  7667. }
  7668. async function ie(u) {
  7669. await new Promise(e => setTimeout(e, u))
  7670. }
  7671. function bt() {
  7672. let u = A.getItem("option:local:lang");
  7673. if (u && (u.includes("-") && (u = u.split("-")[1]), u.includes("_") && (u = u.split("_")[1]), re.hasOwnProperty(u))) return u;
  7674. try {
  7675. const e = window.location.search;
  7676. return new URLSearchParams(e).get("lang") || ""
  7677. } catch {
  7678. return ""
  7679. }
  7680. }
  7681. var Xu = {privateKey: new Uint8Array([]), publicKey: new Uint8Array([])};
  7682. async function zo() {
  7683. try {
  7684. const u = "app-data";
  7685. try {
  7686. const i = A.getItem(u);
  7687. if (i) {
  7688. const o = JSON.parse(i);
  7689. if (Xu = {
  7690. privateKey: new Uint8Array(c4(o.a)),
  7691. publicKey: new Uint8Array(c4(o.b))
  7692. }, Xu.publicKey.length === 32 && Xu.privateKey.length === 64) return
  7693. }
  7694. } catch (i) {
  7695. console.error(i)
  7696. }
  7697. const e = await Po();
  7698. A.setItem(u, JSON.stringify({a: Z(e.privateKey), b: Z(e.publicKey)})), Xu = e
  7699. } catch (u) {
  7700. console.error("failed to init key pair", u)
  7701. }
  7702. }
  7703. function Z(u) {
  7704. return Ln(u)
  7705. }
  7706. function c4(u) {
  7707. return Zt(u)
  7708. }
  7709. async function Po() {
  7710. return await $n()
  7711. }
  7712. function O4() {
  7713. return "web"
  7714. }
  7715. function wt() {
  7716. return "web"
  7717. }
  7718. function St() {
  7719. return Z(Xu.publicKey)
  7720. }
  7721. function Ro() {
  7722. return Zu([St()])
  7723. }
  7724. function Zu(u) {
  7725. const e = new oa.exports.Hash;
  7726. return u.forEach(i => (typeof i == "string" && (i = new TextEncoder().encode(i)), e.update(i))), e.digest()
  7727. }
  7728. function zt() {
  7729. const u = navigator.userAgent.toLowerCase();
  7730. return u.includes("win") ? Y4 : u.includes("mac") ? me : u.includes("linux") ? Be : u.includes("android") ? vt : u.includes("iphone") || u.includes("ipad") ? uo : "Unknown OS"
  7731. }
  7732. async function Io(u, e) {
  7733. for (let i = 0; i < 2; i++) {
  7734. const a = e === void 0 ? await u.next() : await u.next(e);
  7735. if (!(!a || (a == null ? void 0 : a.key_exchange))) return a
  7736. }
  7737. }
  7738. function To() {
  7739. return A.getItem("key") || void 0
  7740. }
  7741. function Pt() {
  7742. return A.getItem("option:local:access_token") || void 0
  7743. }
  7744. function jo() {
  7745. return A.getItem("option:local:user_info") || void 0
  7746. }
  7747. function _4() {
  7748. return Yu
  7749. }
  7750. const _e = {
  7751. Alt: 56,
  7752. AltGr: 57400,
  7753. Backspace: 14,
  7754. CapsLock: 58,
  7755. ControlLeft: 29,
  7756. ControlRight: 57373,
  7757. Delete: 57427,
  7758. UpArrow: 57416,
  7759. DownArrow: 57424,
  7760. LeftArrow: 57419,
  7761. RightArrow: 57421,
  7762. End: 57423,
  7763. Escape: 1,
  7764. F1: 59,
  7765. F2: 60,
  7766. F3: 61,
  7767. F4: 62,
  7768. F5: 63,
  7769. F6: 64,
  7770. F7: 65,
  7771. F8: 66,
  7772. F9: 67,
  7773. F10: 68,
  7774. F11: 87,
  7775. F12: 88,
  7776. F13: 100,
  7777. F14: 101,
  7778. F15: 102,
  7779. F16: 103,
  7780. F17: 104,
  7781. F18: 105,
  7782. F19: 106,
  7783. F20: 107,
  7784. F21: 108,
  7785. F22: 109,
  7786. F23: 110,
  7787. F24: 118,
  7788. Home: 57415,
  7789. MetaLeft: 57435,
  7790. PageDown: 57425,
  7791. PageUp: 57417,
  7792. Return: 28,
  7793. ShiftLeft: 42,
  7794. ShiftRight: 54,
  7795. Space: 57,
  7796. Tab: 15,
  7797. PrintScreen: 57399,
  7798. ScrollLock: 70,
  7799. NumLock: 69,
  7800. BackQuote: 41,
  7801. Num1: 2,
  7802. Num2: 3,
  7803. Num3: 4,
  7804. Num4: 5,
  7805. Num5: 6,
  7806. Num6: 7,
  7807. Num7: 8,
  7808. Num8: 9,
  7809. Num9: 10,
  7810. Num0: 11,
  7811. Minus: 12,
  7812. Equal: 13,
  7813. KeyQ: 16,
  7814. KeyW: 17,
  7815. KeyE: 18,
  7816. KeyR: 19,
  7817. KeyT: 20,
  7818. KeyY: 21,
  7819. KeyU: 22,
  7820. KeyI: 23,
  7821. KeyO: 24,
  7822. KeyP: 25,
  7823. LeftBracket: 26,
  7824. RightBracket: 27,
  7825. BackSlash: 43,
  7826. KeyA: 30,
  7827. KeyS: 31,
  7828. KeyD: 32,
  7829. KeyF: 33,
  7830. KeyG: 34,
  7831. KeyH: 35,
  7832. KeyJ: 36,
  7833. KeyK: 37,
  7834. KeyL: 38,
  7835. SemiColon: 39,
  7836. Quote: 40,
  7837. IntlBackslash: 86,
  7838. IntlRo: 115,
  7839. IntlYen: 125,
  7840. KanaMode: 112,
  7841. KeyZ: 44,
  7842. KeyX: 45,
  7843. KeyC: 46,
  7844. KeyV: 47,
  7845. KeyB: 48,
  7846. KeyN: 49,
  7847. KeyM: 50,
  7848. Comma: 51,
  7849. Dot: 52,
  7850. Slash: 53,
  7851. Insert: 57426,
  7852. KpMinus: 74,
  7853. KpPlus: 78,
  7854. KpMultiply: 55,
  7855. KpDivide: 57397,
  7856. KpDecimal: 83,
  7857. KpReturn: 57372,
  7858. KpEqual: 89,
  7859. KpComma: 126,
  7860. Kp0: 82,
  7861. Kp1: 79,
  7862. Kp2: 80,
  7863. Kp3: 81,
  7864. Kp4: 75,
  7865. Kp5: 76,
  7866. Kp6: 77,
  7867. Kp7: 71,
  7868. Kp8: 72,
  7869. Kp9: 73,
  7870. MetaRight: 57436,
  7871. Apps: 57437,
  7872. VolumeUp: 57392,
  7873. VolumeDown: 57390,
  7874. VolumeMute: 57376,
  7875. Lang1: 123,
  7876. Lang2: 121,
  7877. Lang3: 120,
  7878. Lang4: 119,
  7879. Lang5: 118,
  7880. Kana: 128,
  7881. Hanja: 241
  7882. }, No = {
  7883. Alt: 64,
  7884. AltGr: 108,
  7885. Backspace: 22,
  7886. CapsLock: 66,
  7887. ControlLeft: 37,
  7888. ControlRight: 105,
  7889. Delete: 119,
  7890. DownArrow: 116,
  7891. End: 115,
  7892. Escape: 9,
  7893. F1: 67,
  7894. F10: 76,
  7895. F11: 95,
  7896. F12: 96,
  7897. F13: 191,
  7898. F14: 192,
  7899. F15: 193,
  7900. F16: 194,
  7901. F17: 195,
  7902. F18: 196,
  7903. F19: 197,
  7904. F20: 198,
  7905. F21: 199,
  7906. F22: 200,
  7907. F23: 201,
  7908. F24: 202,
  7909. F2: 68,
  7910. F3: 69,
  7911. F4: 70,
  7912. F5: 71,
  7913. F6: 72,
  7914. F7: 73,
  7915. F8: 74,
  7916. F9: 75,
  7917. Home: 110,
  7918. LeftArrow: 113,
  7919. MetaLeft: 133,
  7920. PageDown: 117,
  7921. PageUp: 112,
  7922. Return: 36,
  7923. RightArrow: 114,
  7924. ShiftLeft: 50,
  7925. ShiftRight: 62,
  7926. Space: 65,
  7927. Tab: 23,
  7928. UpArrow: 111,
  7929. PrintScreen: 107,
  7930. ScrollLock: 78,
  7931. Pause: 127,
  7932. NumLock: 77,
  7933. BackQuote: 49,
  7934. Num1: 10,
  7935. Num2: 11,
  7936. Num3: 12,
  7937. Num4: 13,
  7938. Num5: 14,
  7939. Num6: 15,
  7940. Num7: 16,
  7941. Num8: 17,
  7942. Num9: 18,
  7943. Num0: 19,
  7944. Minus: 20,
  7945. Equal: 21,
  7946. KeyQ: 24,
  7947. KeyW: 25,
  7948. KeyE: 26,
  7949. KeyR: 27,
  7950. KeyT: 28,
  7951. KeyY: 29,
  7952. KeyU: 30,
  7953. KeyI: 31,
  7954. KeyO: 32,
  7955. KeyP: 33,
  7956. LeftBracket: 34,
  7957. RightBracket: 35,
  7958. KeyA: 38,
  7959. KeyS: 39,
  7960. KeyD: 40,
  7961. KeyF: 41,
  7962. KeyG: 42,
  7963. KeyH: 43,
  7964. KeyJ: 44,
  7965. KeyK: 45,
  7966. KeyL: 46,
  7967. SemiColon: 47,
  7968. Quote: 48,
  7969. BackSlash: 51,
  7970. IntlBackslash: 94,
  7971. IntlRo: 97,
  7972. IntlYen: 132,
  7973. KanaMode: 101,
  7974. KeyZ: 52,
  7975. KeyX: 53,
  7976. KeyC: 54,
  7977. KeyV: 55,
  7978. KeyB: 56,
  7979. KeyN: 57,
  7980. KeyM: 58,
  7981. Comma: 59,
  7982. Dot: 60,
  7983. Slash: 61,
  7984. Insert: 118,
  7985. KpDecimal: 91,
  7986. KpReturn: 104,
  7987. KpMinus: 82,
  7988. KpPlus: 86,
  7989. KpMultiply: 63,
  7990. KpDivide: 106,
  7991. KpEqual: 125,
  7992. KpComma: 129,
  7993. Kp0: 90,
  7994. Kp1: 87,
  7995. Kp2: 88,
  7996. Kp3: 89,
  7997. Kp4: 83,
  7998. Kp5: 84,
  7999. Kp6: 85,
  8000. Kp7: 79,
  8001. Kp8: 80,
  8002. Kp9: 81,
  8003. MetaRight: 134,
  8004. Apps: 135,
  8005. VolumeUp: 123,
  8006. VolumeDown: 122,
  8007. VolumeMute: 121,
  8008. Lang1: 102,
  8009. Lang2: 100,
  8010. Lang3: 98,
  8011. Lang4: 99,
  8012. Lang5: 93
  8013. }, Oo = {
  8014. Alt: 57,
  8015. AltGr: 58,
  8016. Backspace: 67,
  8017. CapsLock: 115,
  8018. ControlLeft: 113,
  8019. ControlRight: 114,
  8020. Delete: 112,
  8021. DownArrow: 20,
  8022. End: 123,
  8023. Escape: 111,
  8024. F1: 131,
  8025. F10: 140,
  8026. F11: 141,
  8027. F12: 142,
  8028. F2: 132,
  8029. F3: 133,
  8030. F4: 134,
  8031. F5: 135,
  8032. F6: 136,
  8033. F7: 137,
  8034. F8: 138,
  8035. F9: 139,
  8036. Home: 3,
  8037. LeftArrow: 21,
  8038. MetaLeft: 117,
  8039. PageDown: 93,
  8040. PageUp: 92,
  8041. Return: 66,
  8042. RightArrow: 22,
  8043. ShiftLeft: 59,
  8044. ShiftRight: 60,
  8045. Space: 62,
  8046. Tab: 61,
  8047. UpArrow: 19,
  8048. PrintScreen: 120,
  8049. ScrollLock: 116,
  8050. NumLock: 143,
  8051. Pause: 121,
  8052. BackQuote: 75,
  8053. Num1: 8,
  8054. Num2: 9,
  8055. Num3: 10,
  8056. Num4: 11,
  8057. Num5: 12,
  8058. Num6: 13,
  8059. Num7: 14,
  8060. Num8: 15,
  8061. Num9: 16,
  8062. Num0: 7,
  8063. Minus: 69,
  8064. Equal: 70,
  8065. KeyA: 29,
  8066. KeyB: 30,
  8067. KeyC: 31,
  8068. KeyD: 32,
  8069. KeyE: 33,
  8070. KeyF: 34,
  8071. KeyG: 35,
  8072. KeyH: 36,
  8073. KeyI: 37,
  8074. KeyJ: 38,
  8075. KeyK: 39,
  8076. KeyL: 40,
  8077. KeyM: 41,
  8078. KeyN: 42,
  8079. KeyO: 43,
  8080. KeyP: 44,
  8081. KeyQ: 45,
  8082. KeyR: 46,
  8083. KeyS: 47,
  8084. KeyT: 48,
  8085. KeyU: 49,
  8086. KeyV: 50,
  8087. KeyW: 51,
  8088. KeyX: 52,
  8089. KeyY: 53,
  8090. KeyZ: 54,
  8091. LeftBracket: 71,
  8092. RightBracket: 72,
  8093. SemiColon: 74,
  8094. Quote: 75,
  8095. BackSlash: 73,
  8096. KanaMode: 218,
  8097. Comma: 55,
  8098. Dot: 56,
  8099. Slash: 76,
  8100. Insert: 124
  8101. }, Mo = {
  8102. 226: "Alt",
  8103. 230: "AltGr",
  8104. 42: "Backspace",
  8105. 57: "CapsLock",
  8106. 224: "ControlLeft",
  8107. 228: "ControlRight",
  8108. 76: "Delete",
  8109. 82: "UpArrow",
  8110. 81: "DownArrow",
  8111. 80: "LeftArrow",
  8112. 79: "RightArrow",
  8113. 77: "End",
  8114. 41: "Escape",
  8115. 58: "F1",
  8116. 59: "F2",
  8117. 60: "F3",
  8118. 61: "F4",
  8119. 62: "F5",
  8120. 63: "F6",
  8121. 64: "F7",
  8122. 65: "F8",
  8123. 66: "F9",
  8124. 67: "F10",
  8125. 68: "F11",
  8126. 69: "F12",
  8127. 104: "F13",
  8128. 105: "F14",
  8129. 106: "F15",
  8130. 107: "F16",
  8131. 108: "F17",
  8132. 109: "F18",
  8133. 110: "F19",
  8134. 111: "F20",
  8135. 112: "F21",
  8136. 113: "F22",
  8137. 114: "F23",
  8138. 115: "F24",
  8139. 74: "Home",
  8140. 227: "MetaLeft",
  8141. 78: "PageDown",
  8142. 75: "PageUp",
  8143. 40: "Return",
  8144. 225: "ShiftLeft",
  8145. 229: "ShiftRight",
  8146. 44: "Space",
  8147. 43: "Tab",
  8148. 70: "PrintScreen",
  8149. 71: "ScrollLock",
  8150. 83: "NumLock",
  8151. 53: "BackQuote",
  8152. 30: "Num1",
  8153. 31: "Num2",
  8154. 32: "Num3",
  8155. 33: "Num4",
  8156. 34: "Num5",
  8157. 35: "Num6",
  8158. 36: "Num7",
  8159. 37: "Num8",
  8160. 38: "Num9",
  8161. 39: "Num0",
  8162. 45: "Minus",
  8163. 46: "Equal",
  8164. 20: "KeyQ",
  8165. 26: "KeyW",
  8166. 8: "KeyE",
  8167. 21: "KeyR",
  8168. 23: "KeyT",
  8169. 28: "KeyY",
  8170. 24: "KeyU",
  8171. 12: "KeyI",
  8172. 18: "KeyO",
  8173. 19: "KeyP",
  8174. 47: "LeftBracket",
  8175. 48: "RightBracket",
  8176. 49: "BackSlash",
  8177. 4: "KeyA",
  8178. 22: "KeyS",
  8179. 7: "KeyD",
  8180. 9: "KeyF",
  8181. 10: "KeyG",
  8182. 11: "KeyH",
  8183. 13: "KeyJ",
  8184. 14: "KeyK",
  8185. 15: "KeyL",
  8186. 51: "SemiColon",
  8187. 52: "Quote",
  8188. 100: "IntlBackslash",
  8189. 135: "IntlRo",
  8190. 137: "IntlYen",
  8191. 29: "KeyZ",
  8192. 27: "KeyX",
  8193. 6: "KeyC",
  8194. 25: "KeyV",
  8195. 5: "KeyB",
  8196. 17: "KeyN",
  8197. 16: "KeyM",
  8198. 54: "Comma",
  8199. 55: "Dot",
  8200. 56: "Slash",
  8201. 73: "Insert",
  8202. 86: "KpMinus",
  8203. 87: "KpPlus",
  8204. 85: "KpMultiply",
  8205. 84: "KpDivide",
  8206. 99: "KpDecimal",
  8207. 88: "KpReturn",
  8208. 103: "KpEqual",
  8209. 133: "KpComma",
  8210. 98: "Kp0",
  8211. 89: "Kp1",
  8212. 90: "Kp2",
  8213. 91: "Kp3",
  8214. 92: "Kp4",
  8215. 93: "Kp5",
  8216. 94: "Kp6",
  8217. 95: "Kp7",
  8218. 96: "Kp8",
  8219. 97: "Kp9",
  8220. 231: "MetaRight",
  8221. 128: "VolumeUp",
  8222. 129: "VolumeDown",
  8223. 127: "VolumeMute",
  8224. 139: "Lang1",
  8225. 138: "Lang2",
  8226. 146: "Lang3",
  8227. 147: "Lang4",
  8228. 148: "Lang5",
  8229. 155: "Cancel",
  8230. 156: "Clear",
  8231. 136: "Kana",
  8232. 145: "Hanja",
  8233. 119: "Select",
  8234. 116: "Execute",
  8235. 117: "Help",
  8236. 159: "Separator"
  8237. }, Uo = {
  8238. KeyA: 0,
  8239. KeyS: 1,
  8240. KeyD: 2,
  8241. KeyF: 3,
  8242. KeyH: 4,
  8243. KeyG: 5,
  8244. KeyZ: 6,
  8245. KeyX: 7,
  8246. KeyC: 8,
  8247. KeyV: 9,
  8248. IntlBackslash: 10,
  8249. KeyB: 11,
  8250. KeyQ: 12,
  8251. KeyW: 13,
  8252. KeyE: 14,
  8253. KeyR: 15,
  8254. KeyY: 16,
  8255. KeyT: 17,
  8256. Num1: 18,
  8257. Num2: 19,
  8258. Num3: 20,
  8259. Num4: 21,
  8260. Num6: 22,
  8261. Num5: 23,
  8262. Equal: 24,
  8263. Num9: 25,
  8264. Num7: 26,
  8265. Minus: 27,
  8266. Num8: 28,
  8267. Num0: 29,
  8268. RightBracket: 30,
  8269. KeyO: 31,
  8270. KeyU: 32,
  8271. LeftBracket: 33,
  8272. KeyI: 34,
  8273. KeyP: 35,
  8274. Return: 36,
  8275. KeyL: 37,
  8276. KeyJ: 38,
  8277. Quote: 39,
  8278. KeyK: 40,
  8279. SemiColon: 41,
  8280. BackSlash: 42,
  8281. Comma: 43,
  8282. Slash: 44,
  8283. KeyN: 45,
  8284. KeyM: 46,
  8285. Dot: 47,
  8286. Tab: 48,
  8287. Space: 49,
  8288. BackQuote: 50,
  8289. Backspace: 51,
  8290. Escape: 53,
  8291. MetaRight: 54,
  8292. MetaLeft: 55,
  8293. ShiftLeft: 56,
  8294. CapsLock: 57,
  8295. Alt: 58,
  8296. ControlLeft: 59,
  8297. ShiftRight: 60,
  8298. AltGr: 61,
  8299. ControlRight: 62,
  8300. Function: 63,
  8301. F17: 64,
  8302. KpDecimal: 65,
  8303. KpMultiply: 67,
  8304. KpPlus: 69,
  8305. NumLock: 71,
  8306. VolumeUp: 72,
  8307. VolumeDown: 73,
  8308. VolumeMute: 74,
  8309. KpDivide: 75,
  8310. KpReturn: 76,
  8311. KpMinus: 78,
  8312. F18: 79,
  8313. F19: 80,
  8314. KpEqual: 81,
  8315. Kp0: 82,
  8316. Kp1: 83,
  8317. Kp2: 84,
  8318. Kp3: 85,
  8319. Kp4: 86,
  8320. Kp5: 87,
  8321. Kp6: 88,
  8322. Kp7: 89,
  8323. F20: 90,
  8324. Kp8: 91,
  8325. Kp9: 92,
  8326. IntlYen: 93,
  8327. IntlRo: 94,
  8328. KpComma: 95,
  8329. F5: 96,
  8330. F6: 97,
  8331. F7: 98,
  8332. F3: 99,
  8333. F8: 100,
  8334. F9: 101,
  8335. Lang2: 102,
  8336. F11: 103,
  8337. Lang1: 104,
  8338. F13: 105,
  8339. F16: 106,
  8340. F14: 107,
  8341. F10: 109,
  8342. F12: 111,
  8343. F15: 113,
  8344. Insert: 114,
  8345. Home: 115,
  8346. PageUp: 116,
  8347. Delete: 117,
  8348. F4: 118,
  8349. End: 119,
  8350. F2: 120,
  8351. PageDown: 121,
  8352. F1: 122,
  8353. LeftArrow: 123,
  8354. RightArrow: 124,
  8355. DownArrow: 125,
  8356. UpArrow: 126,
  8357. Apps: 110
  8358. }, Lo = {
  8359. AltLeft: "Alt",
  8360. AltRight: "AltGr",
  8361. Backspace: "Backspace",
  8362. CapsLock: "CapsLock",
  8363. ControlLeft: "ControlLeft",
  8364. ControlRight: "ControlRight",
  8365. Delete: "Delete",
  8366. ArrowUp: "UpArrow",
  8367. ArrowDown: "DownArrow",
  8368. ArrowLeft: "LeftArrow",
  8369. ArrowRight: "RightArrow",
  8370. End: "End",
  8371. Escape: "Escape",
  8372. F1: "F1",
  8373. F2: "F2",
  8374. F3: "F3",
  8375. F4: "F4",
  8376. F5: "F5",
  8377. F6: "F6",
  8378. F7: "F7",
  8379. F8: "F8",
  8380. F9: "F9",
  8381. F10: "F10",
  8382. F11: "F11",
  8383. F12: "F12",
  8384. F13: "F13",
  8385. F14: "F14",
  8386. F15: "F15",
  8387. F16: "F16",
  8388. F17: "F17",
  8389. F18: "F18",
  8390. F19: "F19",
  8391. F20: "F20",
  8392. F21: "F21",
  8393. F22: "F22",
  8394. F23: "F23",
  8395. F24: "F24",
  8396. Home: "Home",
  8397. MetaLeft: "MetaLeft",
  8398. PageDown: "PageDown",
  8399. PageUp: "PageUp",
  8400. Enter: "Return",
  8401. ShiftLeft: "ShiftLeft",
  8402. ShiftRight: "ShiftRight",
  8403. Space: "Space",
  8404. Tab: "Tab",
  8405. PrintScreen: "PrintScreen",
  8406. ScrollLock: "ScrollLock",
  8407. NumLock: "NumLock",
  8408. Backquote: "BackQuote",
  8409. Digit1: "Num1",
  8410. Digit2: "Num2",
  8411. Digit3: "Num3",
  8412. Digit4: "Num4",
  8413. Digit5: "Num5",
  8414. Digit6: "Num6",
  8415. Digit7: "Num7",
  8416. Digit8: "Num8",
  8417. Digit9: "Num9",
  8418. Digit0: "Num0",
  8419. Minus: "Minus",
  8420. Equal: "Equal",
  8421. KeyQ: "KeyQ",
  8422. KeyW: "KeyW",
  8423. KeyE: "KeyE",
  8424. KeyR: "KeyR",
  8425. KeyT: "KeyT",
  8426. KeyY: "KeyY",
  8427. KeyU: "KeyU",
  8428. KeyI: "KeyI",
  8429. KeyO: "KeyO",
  8430. KeyP: "KeyP",
  8431. BracketLeft: "LeftBracket",
  8432. BracketRight: "RightBracket",
  8433. Backslash: "BackSlash",
  8434. KeyA: "KeyA",
  8435. KeyS: "KeyS",
  8436. KeyD: "KeyD",
  8437. KeyF: "KeyF",
  8438. KeyG: "KeyG",
  8439. KeyH: "KeyH",
  8440. KeyJ: "KeyJ",
  8441. KeyK: "KeyK",
  8442. KeyL: "KeyL",
  8443. Semicolon: "SemiColon",
  8444. Quote: "Quote",
  8445. IntlBackslash: "IntlBackslash",
  8446. IntlRo: "IntlRo",
  8447. IntlYen: "IntlYen",
  8448. KanaMode: "KanaMode",
  8449. KeyZ: "KeyZ",
  8450. KeyX: "KeyX",
  8451. KeyC: "KeyC",
  8452. KeyV: "KeyV",
  8453. KeyB: "KeyB",
  8454. KeyN: "KeyN",
  8455. KeyM: "KeyM",
  8456. Comma: "Comma",
  8457. Period: "Dot",
  8458. Slash: "Slash",
  8459. Insert: "Insert",
  8460. NumpadSubtract: "KpMinus",
  8461. NumpadAdd: "KpPlus",
  8462. NumpadMultiply: "KpMultiply",
  8463. NumpadDivide: "KpDivide",
  8464. NumpadDecimal: "KpDecimal",
  8465. NumpadEnter: "KpReturn",
  8466. NumpadEqual: "KpEqual",
  8467. NumpadComma: "KpComma",
  8468. Numpad0: "Kp0",
  8469. Numpad1: "Kp1",
  8470. Numpad2: "Kp2",
  8471. Numpad3: "Kp3",
  8472. Numpad4: "Kp4",
  8473. Numpad5: "Kp5",
  8474. Numpad6: "Kp6",
  8475. Numpad7: "Kp7",
  8476. Numpad8: "Kp8",
  8477. Numpad9: "Kp9",
  8478. MetaRight: "MetaRight",
  8479. ContextMenu: "Apps",
  8480. AudioVolumeUp: "VolumeUp",
  8481. AudioVolumeDown: "VolumeDown",
  8482. AudioVolumeMute: "VolumeMute",
  8483. NonConvert: "Lang1",
  8484. Convert: "Lang2",
  8485. Lang3: "Lang3",
  8486. Lang4: "Lang4",
  8487. Lang5: "Lang5"
  8488. },
  8489. Wo = 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"]),
  8490. Vo = new Set(["Kp0", "Kp1", "Kp2", "Kp3", "Kp4", "Kp5", "Kp6", "Kp7", "Kp8", "Kp9", "KpMinus", "KpMultiply", "KpDivide", "KpPlus", "KpDecimal"]);
  8491. let m4 = !1, ru = !1;
  8492. const b = {};
  8493. b[Ya] = !1;
  8494. b[$a] = !1;
  8495. b[F4] = !1;
  8496. b[mt] = !1;
  8497. b[De] = !1;
  8498. b[At] = !1;
  8499. b[Ft] = !1;
  8500. b[_t] = !1;
  8501. const k4 = {}, ve = u => Vo.has(u), ke = u => Wo.has(u), qo = () => b[F4] || b[mt] || b[De] || b[At] || b[Ft] || b[_t];
  8502. let _, M4 = !1;
  8503. function Ko() {
  8504. if (M4) {
  8505. console.info("Keyboard event listener is already started");
  8506. return
  8507. }
  8508. document.addEventListener("keydown", U4), document.addEventListener("keyup", U4), _ || (_ = document.createElement("div"), _.setAttribute("contenteditable", "true"), _.id = "hiddenInput", _.style.position = "absolute", _.style.left = "-9999px", _.style.height = "1px", _.style.width = "1px", document.body.appendChild(_), Yu ? _.addEventListener("input", L4) : (H4 || Qu) && _.addEventListener("compositionend", L4), _.focus()), M4 = !0, console.info("Keyboard event listener started")
  8509. }
  8510. function Ee() {
  8511. if (!M4) {
  8512. console.info("Keyboard event listener is not started");
  8513. return
  8514. }
  8515. document.removeEventListener("keydown", U4), document.removeEventListener("keyup", U4), _ && (Yu || H4 ? _.removeEventListener("input", L4) : Qu && _.removeEventListener("compositionend", L4), _.remove(), _ = void 0), M4 = !1, console.info("Keyboard event listener stopped")
  8516. }
  8517. function ge(u, e) {
  8518. u.sendMessage({key_event: e})
  8519. }
  8520. function U4(u) {
  8521. const e = e0();
  8522. if (!e) return;
  8523. const i = u.type === "keydown";
  8524. i && !ru && u.preventDefault(), Rt(e, u, i)
  8525. }
  8526. function L4(u) {
  8527. var a, t;
  8528. const e = e0();
  8529. if (!e) return;
  8530. u.preventDefault();
  8531. let i = null;
  8532. if ((u instanceof InputEvent || u instanceof CompositionEvent) && (i = u.data), !i) return;
  8533. const o = w.fromPartial({seq: i, mode: D4.Translate, down: !0, press: !1});
  8534. ge(e, o), ((t = (a = _ == null ? void 0 : _.textContent) == null ? void 0 : a.length) != null ? t : 0) > 10 && (_.textContent = "")
  8535. }
  8536. function Rt(u, e, i) {
  8537. const o = Go(u, e, i);
  8538. for (const a of o) ge(u, a)
  8539. }
  8540. function Ho(u, e, i, o) {
  8541. const a = Mo[e];
  8542. if (!a) {
  8543. console.error("Unknown USB HID code " + e);
  8544. return
  8545. }
  8546. const t = W4(u, a, i);
  8547. if (!t) return;
  8548. const s = ve(a), l = ke(a);
  8549. (l || s) && It(t, o, s, l);
  8550. for (const E of t) ge(u, E)
  8551. }
  8552. function Jo() {
  8553. const u = e0();
  8554. if (!!u) for (const e in k4) {
  8555. const i = k4[e];
  8556. i && Rt(u, i, !1)
  8557. }
  8558. }
  8559. function Go(u, e, i) {
  8560. var c;
  8561. const o = e.code, a = Lo[o];
  8562. if (!a) return console.error("Key code is not supported " + o), [];
  8563. const t = u.getOption("keyboard_mode"), s = Zo(e);
  8564. Xo(e, i), i ? k4[o] = e : delete k4[o];
  8565. let l = [];
  8566. switch (t) {
  8567. case Xa:
  8568. l = (c = W4(u, a, i)) != null ? c : [];
  8569. break;
  8570. case Gi:
  8571. l = Yo(u, e, a, i);
  8572. break
  8573. }
  8574. if (!l) return [];
  8575. const E = ve(a);
  8576. if (t !== Gi || E) {
  8577. const C = ke(a);
  8578. It(l, s, E, C)
  8579. }
  8580. return l
  8581. }
  8582. function It(u, e, i, o) {
  8583. for (const s of u) o && (e & 1 << 1) != 0 && s.modifiers.push(j.CapsLock), i && (e & 1 << 2) != 0 && s.modifiers.push(j.NumLock)
  8584. }
  8585. function Zo(u) {
  8586. let a = 0;
  8587. return u.getModifierState("CapsLock") && (a |= 1 << 1), u.getModifierState("NumLock") && (a |= 1 << 2), u.getModifierState("ScrollLock") && (a |= 1 << 3), a
  8588. }
  8589. function Qo(u, e) {
  8590. return u == Y4 ? _e[e] : u == Be ? No[e] : u == vt ? Oo[e] : u == me ? (A.getItem("option:local:kb_layout") == io && (e == "IntlBackslash" ? e = "BackQuote" : e == "BackQuote" && (e = "IntlBackslash")), Uo[e]) : null
  8591. }
  8592. function Xo(u, e) {
  8593. const i = u.code;
  8594. i in b && (b[i] = e)
  8595. }
  8596. function W4(u, e, i) {
  8597. const o = u.getPeerPlatform(), a = u.isSwapControlCommand();
  8598. e == "ControlLeft" || e == "ControlRight" ? a && (e = "MetaLeft") : (e == "MetaLeft" || e == "MetaRight") && a && (e = "ControlLeft");
  8599. const t = Qo(o, e);
  8600. return t == null ? (console.error("Unknown key code " + e + " for platform " + o), []) : [w.fromPartial({
  8601. chr: t,
  8602. mode: D4.Map,
  8603. down: i,
  8604. press: !1
  8605. })]
  8606. }
  8607. function Yo(u, e, i, o) {
  8608. const a = _ === document.activeElement;
  8609. if (_ && _.focus(), H4 && _ && a && e.key === "Process") return [];
  8610. const t = ke(i), s = e.key === "Dead";
  8611. if (o && ru && t) return Qu ? ru = s : ru = !1, [];
  8612. if (s) return o && (Qu ? ru = !0 : ru = !ru), ru && _ && !a && Yu && _.dispatchEvent(new KeyboardEvent(e.type, {...e})), [];
  8613. if (ru = !1, !Qu && ve(i)) return W4(u, i, o);
  8614. if (Qu && e.code === "AltRight") return [];
  8615. if (e.key === "AltGraph") return m4 && !o && (m4 = !1), !m4 && o && b[F4] ? (m4 = !0, b[F4] = !1, delete k4[F4], [w.fromPartial({
  8616. chr: _e.ControlLeft,
  8617. mode: D4.Map,
  8618. down: !1,
  8619. press: !1
  8620. })]) : [];
  8621. const E = u.getPeerPlatform();
  8622. let c = [];
  8623. return Yu && (c = $o(E, e, o)), (Yu || H4) && c.length === 0 && o && t && (c = Yi(e, o)), Yu && m4 || (Qu && o && t && !b[De] && c.push(...Yi(e, o)), c.length === 0 && c.push(...W4(u, i, o))), c
  8624. }
  8625. function $o(u, e, i) {
  8626. if (u !== Y4 || !qo()) return [];
  8627. let o;
  8628. const a = _e[e.code];
  8629. 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({
  8630. win2win_hotkey: o,
  8631. mode: D4.Translate,
  8632. down: i,
  8633. press: !1
  8634. })])
  8635. }
  8636. function Yi(u, e) {
  8637. return u.key ? [w.fromPartial({seq: u.key, mode: D4.Translate, down: e, press: !1})] : []
  8638. }
  8639. class un {
  8640. constructor(e, i, o, a) {
  8641. d(this, "_uri");
  8642. d(this, "_feedback");
  8643. d(this, "_key");
  8644. d(this, "_token");
  8645. d(this, "_ws");
  8646. d(this, "_interval");
  8647. d(this, "_keepAlive");
  8648. d(this, "_lastRecvMsg");
  8649. d(this, "_aliveFailed");
  8650. this._uri = e, this._feedback = i, this._key = o, this._token = a, this._keepAlive = lo, this._lastRecvMsg = new Date, this._aliveFailed = !1
  8651. }
  8652. close() {
  8653. var e;
  8654. this._interval && (clearInterval(this._interval), this._interval = void 0), (e = this._ws) == null || e.close(), this._ws = void 0
  8655. }
  8656. async start() {
  8657. if (this._feedback == 0 || !this._uri || !this._token || !this._key) return;
  8658. const e = new N4(this._uri, !0, "health check");
  8659. await e.open(), console.log(new Date + ": Connected to relay server"), this._ws = e;
  8660. const i = Gu.fromPartial({token: this._token});
  8661. e.sendRendezvous({hc: i}), this.startInterval(), await this.msgLoop(), this.close()
  8662. }
  8663. startInterval() {
  8664. this._interval = setInterval(() => {
  8665. new Date().getTime() - this._lastRecvMsg.getTime() > this._keepAlive * 3 / 2 && (this._aliveFailed = !0)
  8666. }, so)
  8667. }
  8668. async msgLoop() {
  8669. var e;
  8670. for (this._lastRecvMsg = new Date; ;) {
  8671. if (!this._ws) {
  8672. console.info("HC connection is closed as controlling connection exits");
  8673. break
  8674. }
  8675. try {
  8676. const i = await ((e = this._ws) == null ? void 0 : e.next(300));
  8677. i && (this._lastRecvMsg = new Date, this.handleMsg(i))
  8678. } catch (i) {
  8679. if (i === "Timeout") {
  8680. if (this._aliveFailed) {
  8681. console.error("HC connection is timeout");
  8682. break
  8683. }
  8684. } else {
  8685. console.error("An error occurred on health check:", i);
  8686. break
  8687. }
  8688. }
  8689. }
  8690. }
  8691. handleMsg(e) {
  8692. var i;
  8693. if (e instanceof Uint8Array) {
  8694. (i = this._ws) == null || i.sendBytes(new Uint8Array);
  8695. return
  8696. } else {
  8697. const o = e.register_pk_response;
  8698. o && o.keep_alive > 0 && (this._keepAlive = o.keep_alive * 1e3, console.log("keep_alive: " + this._keepAlive + "ms"))
  8699. }
  8700. }
  8701. }
  8702. let C4 = [], p4 = "", V4 = [], g4 = [], q4, de = !1;
  8703. const he = ["text/plain", "text/html", "image/svg+xml", "image/png"];
  8704. function fe() {
  8705. V4 = [], g4 = [], q4 = void 0
  8706. }
  8707. function en(u) {
  8708. de = u
  8709. }
  8710. async function tn() {
  8711. try {
  8712. C4 = await navigator.clipboard.read(), C4.length === 0 && (p4 = await navigator.clipboard.readText())
  8713. } catch (u) {
  8714. console.error("Failed to read clipboard items before connection, ", u)
  8715. }
  8716. }
  8717. async function Tt(u) {
  8718. if (!de) {
  8719. var e = [], i = "";
  8720. for (let o = 0; o < 3; o++) try {
  8721. e = await navigator.clipboard.read(), e.length === 0 && (i = await navigator.clipboard.readText());
  8722. break
  8723. } catch (a) {
  8724. if (a.name === "NotAllowedError" && a.message.includes("Document is not focused")) await new Promise(t => setTimeout(t, 300)); else return
  8725. }
  8726. e.length === 0 && i === "" || (de = !0, await an(e) ? (C4 = e, await nn(u)) : i !== p4 && (p4 = i, await rn(u)))
  8727. }
  8728. }
  8729. async function an(u) {
  8730. if (u.length !== C4.length) return !0;
  8731. for (let e = 0; e < u.length; e++) {
  8732. const i = u[e], o = C4[e];
  8733. if (!await on(i, o)) return !0
  8734. }
  8735. return !1
  8736. }
  8737. async function on(u, e) {
  8738. if (u.types.length !== e.types.length) return !1;
  8739. for (let i = 0; i < u.types.length; i++) {
  8740. if (u.types[i] !== e.types[i]) return !1;
  8741. if (!he.includes(u.types[i])) continue;
  8742. const o = await u.getType(u.types[i]), a = await e.getType(e.types[i]);
  8743. if (o.size !== a.size) return !1;
  8744. const t = new Uint8Array(await o.arrayBuffer()), s = new Uint8Array(await a.arrayBuffer());
  8745. for (let l = 0; l < t.length; l++) if (t[l] !== s[l]) return !1
  8746. }
  8747. return !0
  8748. }
  8749. function jt(u) {
  8750. switch (u) {
  8751. case"text/plain":
  8752. return du.Text;
  8753. case"text/html":
  8754. return du.Html;
  8755. case"image/svg+xml":
  8756. return du.ImageSvg;
  8757. case"image/png":
  8758. return du.ImagePng;
  8759. default:
  8760. return du.UNRECOGNIZED
  8761. }
  8762. }
  8763. async function nn(u) {
  8764. const e = [], i = (await Promise.all(C4.map(async o => {
  8765. const a = [];
  8766. for (const t of o.types) {
  8767. if (!he.includes(t)) continue;
  8768. const s = await o.getType(t);
  8769. e.push(t), a.push(new Uint8Array(await s.arrayBuffer()))
  8770. }
  8771. return a
  8772. }))).flat();
  8773. e.length !== 0 && $t(i, !0, o => {
  8774. const a = o.map((t, s) => {
  8775. let l = !1;
  8776. t && (l = t.length < p4.length);
  8777. const E = l && t != null ? t : i[s];
  8778. return L.fromPartial({content: E, compress: l, format: jt(e[s])})
  8779. });
  8780. u.sendMessage(iu.fromPartial({multi_clipboards: gu.fromPartial({clipboards: a})}))
  8781. })
  8782. }
  8783. async function rn(u) {
  8784. const e = new TextEncoder().encode(p4);
  8785. $t(e, !1, i => {
  8786. let o = !1;
  8787. i && (o = i.length < p4.length);
  8788. const a = o && i != null ? i : e;
  8789. let t = L.fromPartial({content: a, compress: o, format: du.Text});
  8790. u.sendMessage(iu.fromPartial({clipboard: t}))
  8791. })
  8792. }
  8793. function xe(u, e = void 0) {
  8794. const i = () => {
  8795. try {
  8796. Xn(new TextDecoder().decode(u.content)), fe(), e == null || e()
  8797. } catch (o) {
  8798. console.error("Failed to copy to clipboard, ", o), document.hasFocus() || (q4 = u)
  8799. }
  8800. };
  8801. u.compress ? Re(u.content, !1, o => {
  8802. o && (u.content = o, i())
  8803. }) : i()
  8804. }
  8805. const P4 = document.createElement("canvas"), te = P4.getContext("2d");
  8806. function sn(u, e, i) {
  8807. if (P4.width = e, P4.height = i, !te) return new Uint8Array(0);
  8808. const o = te.createImageData(e, i);
  8809. return o.data.set(u), te.putImageData(o, 0, 0), Uint8Array.from(atob(P4.toDataURL("image/png").split(",")[1]), a => a.charCodeAt(0))
  8810. }
  8811. function ln(u, e = void 0) {
  8812. fe();
  8813. const i = u.clipboards, o = i.filter(a => a.compress).map(a => a.content);
  8814. Re(o, !0, async a => {
  8815. var c;
  8816. let t = 0;
  8817. for (const C of i) C.compress && (C.content = (c = a[t]) != null ? c : C.content, t++), C.compress = !1;
  8818. const s = {};
  8819. for (const C of i) {
  8820. const D = he.find(B => C.format === jt(B));
  8821. if (D) {
  8822. const B = new Blob([C.content], {type: D});
  8823. s[D] = B
  8824. }
  8825. }
  8826. if (!(s["image/png"] !== void 0)) {
  8827. for (const C of i) if (C.format === du.ImageRgba) {
  8828. const D = sn(C.content, C.width, C.height);
  8829. D.length > 0 && (s["image/png"] = new Blob([D], {type: "image/png"}));
  8830. break
  8831. }
  8832. }
  8833. if (Object.keys(s).length === 0) return;
  8834. const E = new ClipboardItem(s);
  8835. await Nt(i, E, e)
  8836. })
  8837. }
  8838. async function Nt(u, e, i = void 0) {
  8839. if (!document.hasFocus()) {
  8840. V4 = u, g4 = [e];
  8841. return
  8842. }
  8843. try {
  8844. await navigator.clipboard.write([e]), fe(), i == null || i()
  8845. } catch (o) {
  8846. if (console.error("Failed to write to clipboard, ", o), !document.hasFocus()) {
  8847. V4 = u, g4 = [e];
  8848. return
  8849. }
  8850. const a = u.find(t => t.format === du.Text);
  8851. a && xe(a, i)
  8852. }
  8853. }
  8854. function $i() {
  8855. Un("info", "Clipboard is synchronized", 2e3)
  8856. }
  8857. window.addEventListener("focus", function () {
  8858. g4.length > 0 ? Nt(V4, g4[0], $i) : q4 && xe(q4, $i)
  8859. });
  8860. class En {
  8861. constructor({id: e, path: i}) {
  8862. d(this, "id");
  8863. d(this, "path");
  8864. d(this, "empty_dirs");
  8865. this.id = e, this.path = i, this.empty_dirs = void 0
  8866. }
  8867. }
  8868. const su = class {
  8869. constructor({
  8870. id: e,
  8871. remote: i,
  8872. path: o,
  8873. show_hidden: a,
  8874. is_remote: t,
  8875. is_last_job: s,
  8876. file_num: l,
  8877. files: E,
  8878. conn_id: c,
  8879. total_size: C,
  8880. finished_size: D,
  8881. transferred: B,
  8882. enable_overwrite_detection: F,
  8883. file_confirmed: y,
  8884. file_skipped: S,
  8885. file_is_waiting: g,
  8886. is_dir: U
  8887. }) {
  8888. d(this, "id");
  8889. d(this, "remote");
  8890. d(this, "path");
  8891. d(this, "show_hidden");
  8892. d(this, "is_remote");
  8893. d(this, "is_last_job");
  8894. d(this, "file_num");
  8895. d(this, "files");
  8896. d(this, "conn_id");
  8897. d(this, "total_size");
  8898. d(this, "finished_size");
  8899. d(this, "transferred");
  8900. d(this, "lastTransferred");
  8901. d(this, "enable_overwrite_detection");
  8902. d(this, "file_confirmed");
  8903. d(this, "file_skipped");
  8904. d(this, "file_is_waiting");
  8905. d(this, "default_overwrite_strategy");
  8906. d(this, "is_dir");
  8907. d(this, "stream");
  8908. d(this, "writer");
  8909. d(this, "zip");
  8910. d(this, "currentData");
  8911. d(this, "fileHandles");
  8912. d(this, "currentReader");
  8913. d(this, "write", async (e, i) => {
  8914. var t;
  8915. if (e.id !== this.id) throw new Error("Wrong id");
  8916. const o = e.file_num;
  8917. if (o >= this.files.length) throw new Error("Wrong file number");
  8918. const a = this.is_dir;
  8919. if (o !== this.file_num || a && !this.zip || !a && !this.writer) if (a) {
  8920. if (this.zip || (this.zip = new Oe), this.currentData) {
  8921. const s = this.files[this.file_num];
  8922. this.zip.file(s.name, this.currentData), this.currentData = void 0
  8923. }
  8924. this.file_num = e.file_num
  8925. } else {
  8926. this.writer && await this.writer.close(), this.stream && (this.stream = void 0), this.file_num = e.file_num;
  8927. const s = this.files[o], l = su.join(this.path, s.name);
  8928. this.stream = streamSaver.createWriteStream(l, {size: s.size}), this.writer = (t = this.stream) == null ? void 0 : t.getWriter()
  8929. }
  8930. if (e.compressed) {
  8931. const s = await ea(e.data);
  8932. if (!s) throw new Error("Failed to decompress");
  8933. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...s]) : this.currentData = s; else {
  8934. if (!this.writer) throw new Error("file is None");
  8935. try {
  8936. await this.writer.write(s)
  8937. } catch (l) {
  8938. throw ce(this.id, "write failed", this.file_num), i(), l
  8939. }
  8940. }
  8941. this.finished_size += s.length
  8942. } else {
  8943. if (a) this.currentData ? this.currentData = new Uint8Array([...this.currentData, ...e.data]) : this.currentData = e.data; else {
  8944. if (!this.writer) throw new Error("file is None");
  8945. try {
  8946. await this.writer.write(e.data)
  8947. } catch (s) {
  8948. throw ce(this.id, "write failed", this.file_num), i(), s
  8949. }
  8950. }
  8951. this.finished_size += e.data.length
  8952. }
  8953. this.transferred += e.data.length
  8954. });
  8955. d(this, "read", async e => {
  8956. var c;
  8957. let i = this.file_num;
  8958. if (i >= this.files.length) {
  8959. (c = this.currentReader) == null || c.cancel(), this.currentReader = void 0;
  8960. return
  8961. }
  8962. let o = this.files[i];
  8963. if (!this.currentReader) {
  8964. if (!this.fileHandles || !this.fileHandles[i]) throw new Error("file is None");
  8965. let D = (await this.fileHandles[i].getFile()).stream();
  8966. this.currentReader = D.getReader({mode: "byob"}), this.file_confirmed = !1, this.file_is_waiting = !1
  8967. }
  8968. if (this.enable_overwrite_detection && !this.file_confirmed) {
  8969. this.file_is_waiting || (this.send_current_digest(e), this.file_is_waiting = !0);
  8970. return
  8971. }
  8972. const a = 128 * 1024;
  8973. let t = new ArrayBuffer(a), s = !1, l = 0;
  8974. for (; l < t.byteLength;) {
  8975. const {value: C, done: D} = await this.currentReader.read(new Uint8Array(t, l, t.byteLength - l));
  8976. if (!C) {
  8977. this.file_num += 1, this.file_confirmed = !1, this.file_is_waiting = !1, this.currentReader = void 0, t = new ArrayBuffer(0);
  8978. break
  8979. }
  8980. if (l += C.byteLength, t = C.buffer, D) break
  8981. }
  8982. let E = new Uint8Array(t, 0, l);
  8983. if (l === 0) this.file_num += 1, this.currentReader = void 0, this.file_confirmed = !1, this.file_is_waiting = !1; else {
  8984. if (this.finished_size += l, !yn(su.join(this.path, o.name))) {
  8985. const C = await ua(new Uint8Array(t, 0, l));
  8986. if (C) C.length < l && (E = new Uint8Array(C), s = !0); else throw new Error("Failed to compress")
  8987. }
  8988. this.transferred += l
  8989. }
  8990. return Su.fromPartial({id: this.id, file_num: i, data: E, compressed: s})
  8991. });
  8992. d(this, "send_current_digest", async e => {
  8993. if (!this.fileHandles || !this.fileHandles[this.file_num]) throw new Error("file is None");
  8994. let i = await this.fileHandles[this.file_num].getFile();
  8995. if (!i) throw new Error("file is None");
  8996. let o = Math.floor(i.lastModified / 1e3), a = i.size,
  8997. t = wu.fromPartial({id: this.id, file_num: this.file_num, last_modified: o, file_size: a}),
  8998. s = nu.fromPartial({digest: t}), l = iu.fromPartial({file_response: s});
  8999. e(l)
  9000. });
  9001. d(this, "read_digest", e => {
  9002. let i = this.files[e.file_num], o = su.join(this.path, i.name), a = this.default_overwrite_strategy;
  9003. if (a !== void 0) {
  9004. let t = cu.fromPartial({
  9005. id: e.id,
  9006. file_num: e.file_num,
  9007. offset_blk: a ? 0 : void 0,
  9008. skip: a ? void 0 : !0
  9009. });
  9010. return this.confirm(t), su.new_send_confirm(t)
  9011. } else {
  9012. bn(e.id, e.file_num, o, !0, e.is_identical);
  9013. return
  9014. }
  9015. });
  9016. d(this, "write_digest", e => {
  9017. let i = cu.fromPartial({id: e.id, file_num: e.file_num, offset_blk: 0});
  9018. return this.confirm(i), su.new_send_confirm(i)
  9019. });
  9020. d(this, "write_done", (e, i, o) => {
  9021. if (this.writer) {
  9022. this.writer.close();
  9023. return
  9024. }
  9025. if (this.zip || (this.zip = new Oe), this.currentData) {
  9026. const t = this.files[this.file_num];
  9027. this.zip.file(t.name, this.currentData), this.currentData = void 0
  9028. }
  9029. if (i != null) {
  9030. const t = i();
  9031. if (t != null) if (t.empty_dirs != null) for (let s of t.empty_dirs) {
  9032. var a = s.substring(t.path.length + 1);
  9033. _4() ? a = a.replace(/\//g, "\\") : a = a.replace(/\\/g, "/"), this.zip.folder(a)
  9034. } else {
  9035. setTimeout(() => {
  9036. this.write_done(e, i, o)
  9037. }, 1e3);
  9038. return
  9039. }
  9040. }
  9041. this.zip.generateAsync({type: "blob"}).then(t => {
  9042. na.exports.saveAs(t, `${this.path}.zip`)
  9043. }), o()
  9044. });
  9045. 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));
  9046. d(this, "set_file_skipped", () => {
  9047. var e;
  9048. (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
  9049. });
  9050. d(this, "set_file_confirmed", e => {
  9051. this.file_confirmed = e, this.file_skipped = !1
  9052. });
  9053. d(this, "set_file_is_waiting", e => {
  9054. this.file_is_waiting = e
  9055. });
  9056. d(this, "update_job_status", e => {
  9057. if (e <= 0) return;
  9058. let i = Math.floor((this.transferred - this.lastTransferred) / (e * 1 / 1e3));
  9059. this.lastTransferred = this.transferred;
  9060. let o = this.file_num - 1;
  9061. this.job_progress(this.id, o, i, this.finished_size)
  9062. });
  9063. d(this, "job_progress", (e, i, o, a) => {
  9064. m("job_progress", {
  9065. id: e.toString(),
  9066. file_num: i.toString(),
  9067. speed: o.toString(),
  9068. finished_size: a.toString()
  9069. })
  9070. });
  9071. d(this, "job_skipped", () => this.file_skipped && this.files.length === 1);
  9072. d(this, "job_error", () => {
  9073. if (this.job_skipped()) return "skipped"
  9074. });
  9075. d(this, "job_completed", () => !this.enable_overwrite_detection || !this.file_confirmed && !this.file_is_waiting);
  9076. d(this, "remove_download_file", () => {
  9077. if (this.writer) try {
  9078. this.writer.abort()
  9079. } catch {
  9080. }
  9081. this.writer = void 0, this.stream = void 0, this.currentData = void 0, this.zip = void 0
  9082. });
  9083. 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 = F, this.file_confirmed = y, this.file_skipped = S, this.file_is_waiting = g, this.is_dir = U
  9084. }
  9085. };
  9086. let lu = su;
  9087. d(lu, "newWrite", (e, i, o, a, t, s, l, E, c) => {
  9088. let C = l.reduce((B, F) => B + F.size, 0);
  9089. return new su({
  9090. id: e,
  9091. remote: i,
  9092. path: o,
  9093. file_num: a,
  9094. show_hidden: t,
  9095. is_remote: s,
  9096. files: l,
  9097. total_size: C,
  9098. enable_overwrite_detection: E,
  9099. is_dir: c,
  9100. is_last_job: !1,
  9101. conn_id: 0,
  9102. finished_size: 0,
  9103. transferred: 0,
  9104. file_confirmed: !1,
  9105. file_skipped: !1,
  9106. file_is_waiting: !1
  9107. })
  9108. }), d(lu, "newRead", (e, i, o, a, t, s, l, E, c) => {
  9109. let C = l.reduce((B, F) => B + F.size, 0), D = new su({
  9110. id: e,
  9111. remote: i,
  9112. path: o,
  9113. file_num: a,
  9114. show_hidden: t,
  9115. is_remote: s,
  9116. files: l,
  9117. total_size: C,
  9118. enable_overwrite_detection: E,
  9119. is_dir: !1,
  9120. is_last_job: !1,
  9121. conn_id: 0,
  9122. finished_size: 0,
  9123. transferred: 0,
  9124. file_confirmed: !1,
  9125. file_skipped: !1,
  9126. file_is_waiting: !1
  9127. });
  9128. return D.fileHandles = c, D
  9129. }), d(lu, "new_send_confirm", e => iu.fromPartial({file_action: P.fromPartial({send_confirm: e})})), d(lu, "join", (e, i) => i === "" ? e : e.endsWith("/") || e.endsWith("\\") ? e + i : _4() ? e + "\\" + i : e + "/" + i);
  9130. const dn = (u, e, i, o) => {
  9131. let a = Pu.fromPartial({id: u, path: e, include_hidden: o, file_num: i});
  9132. return P.fromPartial({send: a})
  9133. }, ut = (u, e, i, o) => {
  9134. if (!o) return;
  9135. let a = ju.fromPartial({id: u, path: e, file_num: i});
  9136. return P.fromPartial({remove_file: a})
  9137. }, cn = (u, e, i) => {
  9138. let o = xu.fromPartial({id: u, path: e, include_hidden: i});
  9139. return P.fromPartial({all_files: o})
  9140. }, Cn = (u, e) => {
  9141. let i = Nu.fromPartial({id: u, path: e});
  9142. return P.fromPartial({create: i})
  9143. }, pn = u => {
  9144. let e = bu.fromPartial({id: u});
  9145. return P.fromPartial({cancel: e})
  9146. }, Dn = (u, e) => {
  9147. let i = Tu.fromPartial({id: u, path: e, recursive: !0});
  9148. return P.fromPartial({remove_dir: i})
  9149. }, Bn = (u, e, i) => {
  9150. let o = yu.fromPartial({id: u, path: e, new_name: i});
  9151. return P.fromPartial({rename: o})
  9152. }, mn = (u, e, i, o, a) => {
  9153. let t = Iu.fromPartial({id: u, path: e, file_num: i, files: o, total_size: a});
  9154. return P.fromPartial({receive: t})
  9155. }, An = u => {
  9156. let e = nu.fromPartial({block: u});
  9157. return iu.fromPartial({file_response: e})
  9158. }, et = (u, e, i) => {
  9159. let o = nu.fromPartial({error: zu.fromPartial({id: u, error: e, file_num: i})});
  9160. return iu.fromPartial({file_response: o})
  9161. }, Fn = (u, e) => {
  9162. let i = nu.fromPartial({done: Ru.fromPartial({id: u, file_num: e})});
  9163. return iu.fromPartial({file_response: i})
  9164. }, _n = (u, e) => {
  9165. let i = fu.fromPartial({path: u, include_hidden: e});
  9166. return P.fromPartial({read_empty_dirs: i})
  9167. }, it = (u, e, i, o, a) => {
  9168. a ? m("update_folder_files", {info: vn(u, e, a)}) : m("file_dir", {is_local: "false", value: kn(u, i, e)})
  9169. }, vn = (u, e, i) => {
  9170. let o = {
  9171. id: u,
  9172. entries: e.map(a => ({name: a.name, type: a.entry_type, time: a.modified_time, size: a.size})),
  9173. total_size: e.reduce((a, t) => a + t.size, 0)
  9174. };
  9175. return i && (o.num_entries = e.length, delete o.entries), JSON.stringify(o)
  9176. }, kn = (u, e, i) => {
  9177. let o = {
  9178. id: u,
  9179. path: e,
  9180. entries: i.map(a => ({entry_type: a.entry_type, name: a.name, size: a.size, modified_time: a.modified_time}))
  9181. };
  9182. return JSON.stringify(o)
  9183. }, ce = (u, e, i) => {
  9184. m("job_error", {id: u.toString(), err: e, file_num: i.toString()})
  9185. }, gn = (u, e) => {
  9186. m("job_done", {id: u.toString(), file_num: e.toString()})
  9187. };
  9188. var i0 = 0;
  9189. const hn = async (u, e) => {
  9190. try {
  9191. if (u) {
  9192. const i = await window.showDirectoryPicker();
  9193. let o = {name: i.name, size: 0, entry_type: 2, modified_time: 0};
  9194. i0++, e(i0, i), m("selected_files", {handleIndex: i0, file: o})
  9195. } else {
  9196. const i = {multiple: !0}, o = await window.showOpenFilePicker(i);
  9197. for (const a of o) {
  9198. const t = await a.getFile();
  9199. let s = {name: t.name, size: t.size, entry_type: 4, modified_time: Math.floor(t.lastModified / 1e3)};
  9200. i0++, e(i0, a), m("selected_files", {handleIndex: i0, file: s})
  9201. }
  9202. }
  9203. } catch (i) {
  9204. console.error("Failed to choose file:", i)
  9205. }
  9206. }, fn = async (u, e) => {
  9207. let i = [];
  9208. for (let o of u) if (!o.is_last_job) try {
  9209. let a = await o.read(e);
  9210. if (a) e(An(a)); else if (o.job_completed()) {
  9211. i.push(o.id);
  9212. let t = o.job_error();
  9213. e(t ? et(o.id, t, o.file_num) : Fn(o.id, o.file_num))
  9214. }
  9215. } catch (a) {
  9216. e(et(o.id, (a != null ? a : "read failed").toString(), o.file_num))
  9217. }
  9218. return i
  9219. }, xn = u => {
  9220. let e = u.lastIndexOf(".");
  9221. return e >= 0 ? u.substring(e + 1) : ""
  9222. }, yn = u => {
  9223. let e = xn(u);
  9224. return e === "xz" || e === "gz" || e === "zip" || e === "7z" || e === "rar" || e === "bz2" || e === "tgz" || e === "png" || e === "jpg"
  9225. }, bn = (u, e, i, o, a) => {
  9226. m("override_file_confirm", {
  9227. id: u.toString(),
  9228. file_num: e.toString(),
  9229. read_path: i,
  9230. is_upload: o.toString(),
  9231. is_identical: a.toString()
  9232. })
  9233. }, K4 = (u, e) => u === "" ? e : lu.join(u, e), Ot = async (u, e) => {
  9234. const i = [];
  9235. let o = [];
  9236. for await(const a of u.values()) if (a.kind === "file") i.push(a.getFile().then(t => {
  9237. o.push({
  9238. entry: W.fromPartial({
  9239. name: K4(e, t.name),
  9240. size: t.size,
  9241. entry_type: dt.File,
  9242. modified_time: Math.floor(t.lastModified / 1e3)
  9243. }), handle: a
  9244. })
  9245. })); else if (a.kind === "directory") {
  9246. let t = K4(e, a.name);
  9247. const s = await Ot(a, t);
  9248. o = o.concat(s)
  9249. }
  9250. return await Promise.all(i), o
  9251. }, Mt = async (u, e) => {
  9252. let i = [], o = !0;
  9253. for await(const a of u.values()) {
  9254. if (a.kind === "directory") {
  9255. let t = K4(e, a.name);
  9256. const s = await Mt(a, t);
  9257. i = i.concat(s)
  9258. }
  9259. o = !1
  9260. }
  9261. return o && i.push(K4(e, "")), i
  9262. }, Ut = 21116, defaultIdServerPort = 21116, Lt = "rs-ny.rustdesk.com", tt = 100, w4 = "trust-this-device";
  9263. class Wt {
  9264. constructor() {
  9265. d(this, "_msgs");
  9266. d(this, "_ws");
  9267. d(this, "_interval");
  9268. d(this, "_updateInterval");
  9269. d(this, "_id");
  9270. d(this, "_otherServer");
  9271. d(this, "_hash");
  9272. d(this, "_msgbox");
  9273. d(this, "_draw");
  9274. d(this, "_peerInfo");
  9275. d(this, "_firstFrame");
  9276. d(this, "_frameCount");
  9277. d(this, "_videoFormat");
  9278. d(this, "_password");
  9279. d(this, "_presetPassword");
  9280. d(this, "_sharedPassword");
  9281. d(this, "_passwordSource");
  9282. d(this, "_options");
  9283. d(this, "_fpsCalc");
  9284. d(this, "_updateTs");
  9285. d(this, "_serverPerms");
  9286. d(this, "_elevationRequested");
  9287. d(this, "_supportedEncoding");
  9288. d(this, "_i444");
  9289. d(this, "_healthCheck");
  9290. d(this, "_sessionId");
  9291. d(this, "_isFileTransfer");
  9292. d(this, "_readJobs");
  9293. d(this, "_writeJobs");
  9294. d(this, "_removeJobs");
  9295. d(this, "_readRemoteEmptyDirsJobs");
  9296. d(this, "_last_update_jobs_ms");
  9297. d(this, "_fileHandles");
  9298. d(this, "_ftTimer");
  9299. d(this, "_restartingRemoteDevice");
  9300. d(this, "_enableTrustedDevices");
  9301. d(this, "_lastChangeDisplay");
  9302. d(this, "_lastSendFps");
  9303. d(this, "_videoQueue");
  9304. d(this, "_decodingVideo");
  9305. d(this, "_selectedWindowsSessionId");
  9306. d(this, "enableEmptyDirs", () => {
  9307. var e;
  9308. return Q((e = this._peerInfo) == null ? void 0 : e.version) >= Q("1.3.3")
  9309. });
  9310. d(this, "enableOverwriteDetection", () => {
  9311. var e;
  9312. return Q((e = this._peerInfo) == null ? void 0 : e.version) >= Q("1.1.10")
  9313. });
  9314. this._msgbox = Vt, this._draw = pe, this._msgs = [], this._id = "", this._frameCount = {}, this._fpsCalc = {
  9315. videoTestSpeed: [0, 0],
  9316. skipBegining: 0,
  9317. fps: void 0
  9318. }, this._updateTs = new Date().getTime(), this._serverPerms = {
  9319. keyboardEnabled: !0,
  9320. fileTransferEnabled: !0,
  9321. clipboardEnabled: !0
  9322. }, this._elevationRequested = !1, this._supportedEncoding = G.fromPartial({}), this._sessionId = 0, this._isFileTransfer = !1, this._readJobs = [], this._writeJobs = [], this._removeJobs = {}, this._readRemoteEmptyDirsJobs = [], this._last_update_jobs_ms = 0, this._fileHandles = {}, this._restartingRemoteDevice = !1, this._enableTrustedDevices = !1, this._passwordSource = {type: "Undefined"}, this._videoQueue = [], this._decodingVideo = !1
  9323. }
  9324. getPeerPlatform() {
  9325. var e, i;
  9326. return (i = (e = this._peerInfo) == null ? void 0 : e.platform) != null ? i : ""
  9327. }
  9328. isSupportVirtualDisplay() {
  9329. if (!this._peerInfo || !this._peerInfo.platform_additions) return !1;
  9330. try {
  9331. const e = JSON.parse(this._peerInfo.platform_additions), i = e.is_installed, o = e.idd_impl;
  9332. return i && this._peerInfo.platform == "Windows" && (o == "rustdesk_idd" || o == "amyuni_idd")
  9333. } catch (e) {
  9334. return console.error("Failed to check virtual display support, ", e), !1
  9335. }
  9336. }
  9337. sendMessage(e) {
  9338. var i;
  9339. (i = this._ws) == null || i.sendMessage(e)
  9340. }
  9341. handleRelayId(e) {
  9342. return e.endsWith("\\r") || e.endsWith("/r") ? e.substring(0, e.length - 2) : e
  9343. }
  9344. setRemoteId(e) {
  9345. var o, a, t, s, l;
  9346. let i = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);
  9347. if (i == 0 && (i = 1), this._sessionId = i, this._restartingRemoteDevice = !1, this._id = e, e.includes("@")) {
  9348. const E = e.split("@"), c = E[0], C = ((o = E[1]) != null ? o : "").split("?"),
  9349. D = (a = C[0]) != null ? a : "", B = (t = C[1]) != null ? t : "",
  9350. F = D == ee ? Xi : (s = B.split("&").reduce((S, g) => {
  9351. const U = g.indexOf("=");
  9352. if (U != -1) {
  9353. const f4 = g.substring(0, U).toLowerCase(), x4 = g.substring(U + 1);
  9354. S[f4] = x4
  9355. }
  9356. return S
  9357. }, {}).key) != null ? s : "", y = this.handleRelayId(c);
  9358. this._otherServer = {realId: y, server: D, key: F}, this._id = `${y}@${D}`
  9359. } else this._id = this.handleRelayId(e);
  9360. if (this._options = (l = Cu()[this._id]) != null ? l : this.getUserDefaultToggleOptions(), this._otherServer && !this._otherServer.key) {
  9361. const E = this.getOption("other-server-key");
  9362. E && (this._otherServer.key = E)
  9363. }
  9364. }
  9365. setSessionInfo(e) {
  9366. this._isFileTransfer = e.isFileTransfer, e.is_shared_password ? this._sharedPassword = e.password : this._presetPassword = e.password
  9367. }
  9368. async start() {
  9369. try {
  9370. tn(), await this._start()
  9371. } catch (e) {
  9372. this.msgbox("error", "Connection Error", e.type == "close" ? "Reset by the peer" : String(e))
  9373. }
  9374. }
  9375. getId() {
  9376. var e, i;
  9377. return (i = (e = this._otherServer) == null ? void 0 : e.realId) != null ? i : this._id
  9378. }
  9379. async _start() {
  9380. var F, y;
  9381. let e = this.getId(), i = To(), o = Pt(), a = (F = this._otherServer) == null ? void 0 : F.server;
  9382. this._otherServer && (i = this._otherServer.key, o = "");
  9383. let t = "";
  9384. a ? a == ee ? t = I4(Lt) : t = I4(a) : t = R4(), this._options || (this._options = (y = Cu()[this._id]) != null ? y : this.getUserDefaultToggleOptions()), this._interval = setInterval(() => {
  9385. var S;
  9386. for (; this._msgs.length;) (S = this._ws) == null || S.sendMessage(this._msgs[0]), this._msgs.splice(0, 1)
  9387. }, 1);
  9388. const s = new N4(t, !0, "rendezvous");
  9389. 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");
  9390. const l = this._isFileTransfer ? ne.FILE_TRANSFER : ne.DEFAULT_CONN, E = pt.SYMMETRIC,
  9391. c = Ku.fromPartial({id: e, licence_key: i, conn_type: l, nat_type: E, token: o, version: se});
  9392. s.sendRendezvous({punch_hole_request: c});
  9393. const C = await s.next();
  9394. s.close(), console.log(new Date + ": Got relay response");
  9395. const D = C.punch_hole_response, B = C.relay_response;
  9396. if (D) {
  9397. if (D != null && D.other_failure) {
  9398. this.msgbox("error", "Error", D == null ? void 0 : D.other_failure);
  9399. return
  9400. }
  9401. if (D.failure != Z0.UNRECOGNIZED) switch (D == null ? void 0 : D.failure) {
  9402. case Z0.ID_NOT_EXIST:
  9403. this.msgbox("error", "Error", "ID does not exist");
  9404. break;
  9405. case Z0.OFFLINE:
  9406. this.msgbox("error", "Error", "Remote desktop is offline");
  9407. break;
  9408. case Z0.LICENSE_MISMATCH:
  9409. this.msgbox("error", "Error", "Key mismatch");
  9410. break;
  9411. case Z0.LICENSE_OVERUSE:
  9412. this.msgbox("error", "Error", "Key overuse");
  9413. break
  9414. }
  9415. } else if (B) {
  9416. if (!B.version) {
  9417. this.msgbox("error", "Error", "Remote version is low, not support web");
  9418. return
  9419. }
  9420. this._healthCheck = new un(t, B.feedback, i, o), this._healthCheck.start(), await this.connectRelay(B, i)
  9421. }
  9422. }
  9423. async connectRelay(e, i) {
  9424. var c, C;
  9425. const o = e.pk;
  9426. let a = e.relay_server;
  9427. a ? a = I4(a, !0, 2) : a = R4(!0);
  9428. const t = e.uuid;
  9429. console.log(new Date + ": Connecting to relay server: " + a);
  9430. const s = new N4(a, !1, "relay");
  9431. await s.open(), console.log(new Date + ": Connected to relay server"), this._ws = s;
  9432. const l = Hu.fromPartial({licence_key: i, uuid: t});
  9433. s.sendRendezvous({request_relay: l});
  9434. const E = await this.secure(o, i) || !1;
  9435. m("connection_ready", {secure: E, direct: !1}), this._updateInterval = setInterval(() => {
  9436. this.updateStatus()
  9437. }, 1e3), (c = this._ws) == null || c.on("message", this.msgHandler.bind(this)), (C = this._ws) == null || C.on("status_change", this.onStatusChange.bind(this))
  9438. }
  9439. async secure(e, i) {
  9440. var F, y, S, g, U, f4, x4, Ie;
  9441. if (e) {
  9442. try {
  9443. if (e = await rt(e, i || Xi), e) {
  9444. const T = oe.decode(e);
  9445. T.id == this.getId() && (e = T.pk)
  9446. }
  9447. (e == null ? void 0 : e.length) != 32 && (e = void 0)
  9448. } catch (T) {
  9449. console.error("Failed to verify id pk, ", T), e = void 0
  9450. }
  9451. e || console.error("Handshake failed: invalid public key from rendezvous server")
  9452. }
  9453. if (!e) {
  9454. const T = K.fromPartial({});
  9455. (F = this._ws) == null || F.sendMessage({public_key: T});
  9456. return
  9457. }
  9458. const o = await ((y = this._ws) == null ? void 0 : y.next());
  9459. let a = o == null ? void 0 : o.signed_id;
  9460. if (!a) {
  9461. console.error("Handshake failed: invalid message type");
  9462. const T = K.fromPartial({});
  9463. (S = this._ws) == null || S.sendMessage({public_key: T});
  9464. return
  9465. }
  9466. try {
  9467. a = await rt(a.id, Uint8Array.from(e))
  9468. } catch (T) {
  9469. console.error("Failed to verify signed id pk, ", T), console.error("pk mismatch, fall back to non-secure");
  9470. const ia = K.fromPartial({});
  9471. (g = this._ws) == null || g.sendMessage({public_key: ia});
  9472. return
  9473. }
  9474. const t = oe.decode(a), s = t.id, l = t.pk;
  9475. if (s != this.getId()) {
  9476. console.error("Handshake failed: sign failure");
  9477. const T = K.fromPartial({});
  9478. (U = this._ws) == null || U.sendMessage({public_key: T});
  9479. return
  9480. }
  9481. if (l.length != 32) {
  9482. console.error("Handshake failed: invalid public box key length from peer");
  9483. const T = K.fromPartial({});
  9484. (f4 = this._ws) == null || f4.sendMessage({public_key: T});
  9485. return
  9486. }
  9487. const [E, c] = Wn(), C = Vn(), D = qn(C, l, E), B = K.fromPartial({asymmetric_value: c, symmetric_value: D});
  9488. return (x4 = this._ws) == null || x4.sendMessage({public_key: B}), (Ie = this._ws) == null || Ie.setSecretKey(C), console.log("secured"), !0
  9489. }
  9490. async msgHandler(e) {
  9491. var i;
  9492. if (this._ws) {
  9493. if (e != null && e.hash) await this.handleHash(e.hash); else if (e != null && e.test_delay) {
  9494. const o = e == null ? void 0 : e.test_delay;
  9495. o.from_client || (m("update_quality_status", {
  9496. delay: `${o.last_delay}`,
  9497. target_bitrate: `${o.target_bitrate}`
  9498. }), (i = this._ws) == null || i.sendMessage({test_delay: o}))
  9499. } 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) xe(e == null ? void 0 : e.clipboard); else if (e != null && e.multi_clipboards) ln(e == null ? void 0 : e.multi_clipboards); else if (e != null && e.cursor_data) {
  9500. const o = e == null ? void 0 : e.cursor_data;
  9501. Re(o.colors, !1, a => {
  9502. a && (o.colors = a, m("cursor_data", o))
  9503. })
  9504. } else if (e != null && e.cursor_id) m("cursor_id", {id: e == null ? void 0 : e.cursor_id}); else if (e != null && e.cursor_position) m("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) Zn(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) {
  9505. const o = e.file_action;
  9506. await this.handleFileAction(o)
  9507. }
  9508. }
  9509. }
  9510. onStatusChange(e) {
  9511. if (e === "" || e === "open") return;
  9512. if (this._restartingRemoteDevice) {
  9513. this.msgbox("restarting", "Restarting remote device", "remote_restarting_tip", "");
  9514. return
  9515. }
  9516. if (e instanceof CloseEvent && e.code == 1e3 || !this._ws) return;
  9517. e && console.error("msgLoop error: ", e);
  9518. const i = "Connection Error";
  9519. let o = "";
  9520. if (e === "Timeout") o = "Connection timeout"; else if (e instanceof CloseEvent) {
  9521. let a = `code: ${e.code}`;
  9522. e.reason && (a += `, reason: ${e.reason}`), o = `Connection closed, ${a}`
  9523. } else e instanceof Error ? o = e.message : typeof e.toString == "function" ? o = e.toString() : o = "";
  9524. this.msgbox("error", i, o, "")
  9525. }
  9526. enterOrLeave(e) {
  9527. e === !1 ? (Jo(), Ee(), en(!1)) : (Ce(), Tt(this))
  9528. }
  9529. makeDisplaysMsg(e) {
  9530. let i = [];
  9531. return e.forEach(o => {
  9532. let a = {};
  9533. 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)
  9534. }), JSON.stringify(i)
  9535. }
  9536. handleSyncPeerInfo(e) {
  9537. this._peerInfo && (this._peerInfo.displays = e.displays), m("sync_peer_info", {displays: this.makeDisplaysMsg(e.displays)}), m("sync_platform_additions", {platform_additions: e.platform_additions})
  9538. }
  9539. handleMsgBox(e) {
  9540. let i = e.link;
  9541. i in Hi ? i = Hi[i] : (console.warn("Message box ignore link " + i + " for security"), i = ""), this.msgbox(e.msgtype, e.title, e.text, i)
  9542. }
  9543. updateStatus() {
  9544. var s, l;
  9545. const e = new Date().getTime(), i = e - this._updateTs;
  9546. if (i < 1e3) return;
  9547. this._updateTs = e;
  9548. const o = ((s = this._ws) == null ? void 0 : s.getRecvDataCount()) || 0;
  9549. (l = this._ws) == null || l.resetRecvDataCount();
  9550. const a = `${(o / 1024 / i * 1e3).toFixed(2)} kb/s`, t = {};
  9551. for (const E in this._frameCount) if (this._frameCount.hasOwnProperty(E)) {
  9552. const c = this._frameCount[E];
  9553. t[E] = Math.floor(c / (i / 1e3))
  9554. }
  9555. this._frameCount = {}, m("update_quality_status", {speed: a, fps: JSON.stringify(t)})
  9556. }
  9557. handleLoginResponse(e) {
  9558. const i = {
  9559. [Ha]: {
  9560. msgtype: "error",
  9561. title: "Login Error",
  9562. text: "Login screen using Wayland is not supported",
  9563. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9564. try_again: !0
  9565. },
  9566. [Ta]: {msgtype: "session-login", title: "", text: "", link: "", try_again: !0},
  9567. [ja]: {msgtype: "session-re-login", title: "", text: "", link: "", try_again: !0},
  9568. [Na]: {
  9569. msgtype: "info-nocancel",
  9570. title: "another_user_login_title_tip",
  9571. text: "another_user_login_text_tip",
  9572. link: "",
  9573. try_again: !1
  9574. },
  9575. [Oa]: {
  9576. msgtype: "info-nocancel",
  9577. title: "xorg_not_found_title_tip",
  9578. text: "xorg_not_found_text_tip",
  9579. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9580. try_again: !0
  9581. },
  9582. [Ma]: {
  9583. msgtype: "info-nocancel",
  9584. title: "no_desktop_title_tip",
  9585. text: "no_desktop_text_tip",
  9586. link: "https://rustdesk.com/docs/en/manual/linux/#login-screen",
  9587. try_again: !0
  9588. },
  9589. [Ua]: {msgtype: "session-login-password", title: "", text: "", link: "", try_again: !0},
  9590. [La]: {msgtype: "session-login-re-password", title: "", text: "", link: "", try_again: !0},
  9591. [Ka]: {
  9592. msgtype: "wait-remote-accept-nook",
  9593. title: "Prompt",
  9594. text: "Please wait for the remote side to accept your session request...",
  9595. link: "",
  9596. try_again: !0
  9597. }
  9598. }, o = e.error;
  9599. if (o) if (o == Ki && (this._enableTrustedDevices = e.enable_trusted_devices), o == Wa && (this._password = void 0, this.msgbox("input-password", "Password Required", "", "")), o == Va) this._password = void 0, this.msgbox("re-input-password", o, "Do you want to enter again?"); else if (o == qa || o == Ki) this.getOption(w4) == "Y" && this.setOption(w4, void 0), this.msgbox("input-2fa", o, ""); else if (o in i) {
  9600. const a = i[o];
  9601. this.msgbox(a.msgtype, a.title, a.text, a.link)
  9602. } else o.includes(Ja) ? this.msgbox("error", "Login Error", o, Bt) : this.msgbox("error", "Login Error", o); else e.peer_info && (this._firstFrame = !1, this.handlePeerInfo(e.peer_info))
  9603. }
  9604. enableTrustedDevices() {
  9605. return this._enableTrustedDevices
  9606. }
  9607. msgbox(e, i, o, a = "") {
  9608. var t;
  9609. (t = this._msgbox) == null || t.call(this, e, i, o, a)
  9610. }
  9611. cancelMsgbox(e) {
  9612. m("cancel_msgbox", {tag: e})
  9613. }
  9614. draw(e, i) {
  9615. pe(e, new Uint8Array(i.data))
  9616. }
  9617. close() {
  9618. var e, i;
  9619. 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 = {}, this._readRemoteEmptyDirsJobs = [], Ee(), this._lastChangeDisplay = void 0, this._lastSendFps = void 0, this._videoQueue = [], this._decodingVideo = !1
  9620. }
  9621. refresh() {
  9622. var i;
  9623. const e = f.fromPartial({refresh_video: !0});
  9624. (i = this._ws) == null || i.sendMessage({misc: e})
  9625. }
  9626. setMsgbox(e) {
  9627. this._msgbox = e
  9628. }
  9629. setDraw(e) {
  9630. this._draw = e
  9631. }
  9632. async handleHash(e) {
  9633. this._hash = e;
  9634. let i = this._password;
  9635. (!i || i.length === 0) && this._presetPassword && (i = Zu([this._presetPassword, e.salt]), this._passwordSource = {type: "Undefined"});
  9636. let o = this._sharedPassword;
  9637. if (this._sharedPassword = void 0, o && (i = Zu([o, e.salt]), this._passwordSource = {
  9638. type: "SharedAb",
  9639. value: o
  9640. }), !i || i.length === 0) {
  9641. const l = this.getOption("password");
  9642. typeof l == "string" && l.length > 0 && (i = c4(l), this._passwordSource = {type: "Undefined"})
  9643. }
  9644. if (!i || i.length === 0) {
  9645. let l = Fe("access_token"), E = await xt();
  9646. if (l && l === E.access_token) {
  9647. let c = E.ab_entries.find(C => fo(C));
  9648. if (c) {
  9649. let C = c.peers.find(D => D.id == this._id);
  9650. if (C) {
  9651. let D = c4(C.hash);
  9652. D.length > 0 && (i = D, this._passwordSource = {type: "PersonalAb", value: D})
  9653. }
  9654. }
  9655. }
  9656. }
  9657. this._password = i;
  9658. let a;
  9659. !i || i.length === 0 ? (a = new Uint8Array(0), this.msgbox("input-password", "Password Required", "")) : a = Zu([i, e.challenge]);
  9660. let t = this.getOption("os-username") || "", s = this.getOption("os-password") || "";
  9661. this._sendLoginMessage({os_login: {username: t, password: s}, password: a})
  9662. }
  9663. handle_login_from_ui(e, i, o, a) {
  9664. let t;
  9665. if (o === "") {
  9666. let l = this._password;
  9667. if (!l || l.length === 0) {
  9668. const E = this.getOption("password");
  9669. typeof E == "string" && E.length > 0 && (l = c4(E), this._passwordSource = {type: "Undefined"})
  9670. }
  9671. t = l
  9672. } else this._passwordSource = {type: "Undefined"}, t = Zu([o, this._hash.salt]), this.setRemember(a);
  9673. this._password = t;
  9674. let s = Zu([t != null ? t : Uint8Array.from([]), this._hash.challenge]);
  9675. this._sendLoginMessage({os_login: {username: e, password: i}, password: s})
  9676. }
  9677. changePreferCodec() {
  9678. var a;
  9679. const e = this.getSupportedDecoding(), i = z.fromPartial({supported_decoding: e}),
  9680. o = f.fromPartial({option: i});
  9681. (a = this._ws) == null || a.sendMessage({misc: o})
  9682. }
  9683. async reconnect() {
  9684. this.close(), await this.start()
  9685. }
  9686. _getHwid(e = void 0) {
  9687. return (e != null ? e : this.getOption(w4) == "Y") ? Ro() : new Uint8Array
  9688. }
  9689. _sendLoginMessage(e) {
  9690. var E;
  9691. const i = this._otherServer ? `${O4()}@${R4()}` : O4(), o = jo();
  9692. let a = wt();
  9693. if (o) try {
  9694. const c = JSON.parse(o);
  9695. c.name && (a = c.name)
  9696. } catch (c) {
  9697. console.error("Failed to get user info, ", c)
  9698. }
  9699. let t;
  9700. if (this._isFileTransfer) {
  9701. let c = this.getOption("remote_dir"), C = this.getOption("remote_show_hidden") === "Y";
  9702. t = Fu.fromPartial({dir: c, show_hidden: C})
  9703. }
  9704. const s = this._getHwid(), l = H.fromPartial({
  9705. username: this.getId(),
  9706. my_id: i,
  9707. my_name: a,
  9708. session_id: this._sessionId,
  9709. password: e.password,
  9710. option: this.getOptionMessage(),
  9711. video_ack_required: !0,
  9712. os_login: e.os_login,
  9713. version: se,
  9714. my_platform: eo,
  9715. file_transfer: t,
  9716. hwid: s
  9717. });
  9718. (E = this._ws) == null || E.sendMessage({login_request: l})
  9719. }
  9720. getOptionMessage() {
  9721. if (this._isFileTransfer) return;
  9722. let e = 0;
  9723. const i = z.fromPartial({}), o = this.getImageQuality(), a = this.getImageQualityEnum(o, !0), t = x.Yes;
  9724. if (a != null) i.image_quality = a, e += 1; else if (o === "custom") {
  9725. let l = 50, E = this.getOption("custom_image_quality");
  9726. if (E) try {
  9727. l = parseInt(E)
  9728. } catch {
  9729. }
  9730. i.custom_image_quality = l << 8, e += 1;
  9731. let c = this.getOption("custom-fps");
  9732. if (c) try {
  9733. i.custom_fps = parseInt(c), this._lastSendFps = i.custom_fps, e += 1
  9734. } catch {
  9735. }
  9736. }
  9737. const s = this.getOption("view-only");
  9738. 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
  9739. }
  9740. sendVideoReceived() {
  9741. var i;
  9742. const e = f.fromPartial({video_received: !0});
  9743. (i = this._ws) == null || i.sendMessage({misc: e})
  9744. }
  9745. getCodecFormat(e) {
  9746. return e.vp9s ? "VP9" : e.vp8s ? "VP8" : e.av1s ? "AV1" : e.h264s ? "H264" : e.h265s ? "H265" : "Unknown"
  9747. }
  9748. getSupportedEncoding() {
  9749. return this._supportedEncoding
  9750. }
  9751. getSupportedDecoding() {
  9752. let e = this.getOption("codec-preference");
  9753. e == "vp8" ? e = Au.VP8 : e == "vp9" ? e = Au.VP9 : e == "av1" ? e = Au.AV1 : e == "h264" ? e = Au.H264 : e == "h265" ? e = Au.H265 : e = Au.Auto;
  9754. let i = this.getOption("i444") == "Y" ? ae.I444 : ae.I420;
  9755. return Vu.fromPartial({
  9756. ability_vp8: 1,
  9757. ability_vp9: 1,
  9758. ability_av1: 1,
  9759. ability_h264: 1,
  9760. ability_h265: 1,
  9761. prefer: e,
  9762. prefer_chroma: i,
  9763. i444: J.fromPartial({vp9: !0, av1: !0})
  9764. })
  9765. }
  9766. getAlternativeCodecs() {
  9767. const e = this.getSupportedEncoding(), i = this.getSupportedDecoding();
  9768. return JSON.stringify({
  9769. vp8: e.vp8 && i.ability_vp8 == 1,
  9770. av1: e.av1 && i.ability_av1 == 1,
  9771. h264: e.h264 && i.ability_h264 == 1,
  9772. h265: e.h265 && i.ability_h265 == 1
  9773. })
  9774. }
  9775. fpsCalculate(e, i) {
  9776. if (e) {
  9777. this._fpsCalc.skipBegining = 0, this._fpsCalc.videoTestSpeed = [0, 0];
  9778. return
  9779. }
  9780. if (this._fpsCalc.skipBegining < 3) {
  9781. this._fpsCalc.skipBegining += 1;
  9782. return
  9783. }
  9784. 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])
  9785. }
  9786. handleVideoFrame(e) {
  9787. if (!this._firstFrame) {
  9788. this.msgbox("", "", ""), this._firstFrame = !0, this.sendToggleVirtualDisplayMsg(), this.sendTogglePrivacyModeMsg(), Ce();
  9789. const i = 0;
  9790. for (let o = 0; o < i; o++) this.sendVideoReceived();
  9791. console.log(`send ${i} video received in advance for high fps`)
  9792. }
  9793. this._videoQueue.push(e), this._decodingVideo || this.processVideoQueue()
  9794. }
  9795. async processVideoQueue() {
  9796. this._decodingVideo = !0;
  9797. try {
  9798. for (; this._videoQueue.length > 0;) await this.handleOneVideoFrame(this._videoQueue.shift())
  9799. } catch (e) {
  9800. console.error("deal video queue failed", e)
  9801. }
  9802. this._decodingVideo = !1
  9803. }
  9804. async handleOneVideoFrame(e) {
  9805. const i = this.getCodecFormat(e), o = this._videoFormat != i;
  9806. o && (this._videoFormat = i, m("update_quality_status", {codec_format: i}));
  9807. var a = new Date().getTime(), t = 0, s = void 0;
  9808. 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 {
  9809. console.log("unknown codec");
  9810. return
  9811. }
  9812. const l = s == null ? void 0 : s.frames.length;
  9813. this._frameCount[e.display] = (this._frameCount[e.display] || 0) + l, this.sendVideoReceived();
  9814. try {
  9815. for (let E = 0; E < l; E++) {
  9816. let c = s.frames[E];
  9817. const C = await Ra(t, c.data.slice(0).buffer);
  9818. if (C.data && l - 1 == E) {
  9819. this.draw(e.display, C.data);
  9820. const D = new Date().getTime();
  9821. this.fpsCalculate(o, D - a);
  9822. const B = C.data.yuvFormat == 5;
  9823. this._i444 != B && (this._i444 = B, m("update_quality_status", {chroma: B ? "4:4:4" : "4:2:0"}))
  9824. }
  9825. }
  9826. } catch (E) {
  9827. console.error("decode error: ", E)
  9828. }
  9829. }
  9830. sendToggleVirtualDisplayMsg() {
  9831. if (!this.isSupportVirtualDisplay()) return;
  9832. const e = this.getOption("virtual-display");
  9833. !e || e.split(",").forEach(i => {
  9834. const o = Number(i);
  9835. isNaN(o) || this._sendToggleVirtualDisplayMsg(o, !0)
  9836. })
  9837. }
  9838. sendTogglePrivacyModeMsg() {
  9839. if (!!this._peerInfo && !(Q(this._peerInfo.version) < Q("1.2.4")) && this.getOption("privacy-mode")) {
  9840. const e = this.getOption("privacy-mode-impl-key");
  9841. if (e == "privacy_mode_impl_virtual_display" && this.isSupportVirtualDisplay()) return;
  9842. this._sendTogglePrivacyModeMsg(e, !0)
  9843. }
  9844. }
  9845. handlePeerInfo(e) {
  9846. var a, t, s;
  9847. 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) {
  9848. if (!e.username.length && !((a = e.windows_sessions) != null && a.sessions.length)) {
  9849. this.msgbox("error", "Error", "No active console user logged on, please connect and logon first.");
  9850. return
  9851. }
  9852. } else if (e.displays.length == 0) {
  9853. this.lcHandlePeerInfo(e), m("update_privacy_mode", {}), this.msgbox("error", "Remote Error", "No Display");
  9854. return
  9855. }
  9856. m("peer_info", {
  9857. ...e,
  9858. displays: this.makeDisplaysMsg(e.displays),
  9859. resolutions: JSON.stringify(e.resolutions)
  9860. }), this._isFileTransfer || (this.msgbox("success", "Successful", "Connected, waiting for image..."), this.tryChangeInitResolution(e.current_display));
  9861. const i = this.shouldAutoLogin();
  9862. i && this.inputOsPassword(i);
  9863. const o = (t = this.getOption("info")) == null ? void 0 : t.username;
  9864. o && !e.username && (e.username = o), m("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))
  9865. }
  9866. lcHandlePeerInfo(e) {
  9867. var l;
  9868. let i = le(this._id) || {};
  9869. i.info = {username: e.username, hostname: e.hostname, platform: e.platform};
  9870. let o = this._password, a = i.password, t = this.getRemember(), s = this._hash;
  9871. t ? o && o.length > 0 && Z(o) !== a && !at(this._passwordSource, o, s) && (i.password = Z(o), console.log("remember password of " + this._id)) : o && o.length > 0 && ot(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 != ee && this.setOption("other-server-key", this._otherServer.key), i.password && o && o.length > 0 && !at(this._passwordSource, o, s) && !ot(this._passwordSource, o) && m("sync_peer_hash_password_to_personal_ab", {
  9872. id: this._id,
  9873. hash: Z(o)
  9874. }), this.saveConfig(i), e.encoding && (this._supportedEncoding = e.encoding)
  9875. }
  9876. setPermission(e, i) {
  9877. m("permission", {[e]: i})
  9878. }
  9879. shouldAutoLogin() {
  9880. const e = this.getOption("lock-after-session-end"), i = !!this.getOption("auto-login"),
  9881. o = this.getOption("os-password");
  9882. return o && e && i ? o : ""
  9883. }
  9884. handleMisc(e) {
  9885. if (e.audio_format) Gn(e.audio_format.channels, e.audio_format.sample_rate); else if (e.chat_message) m("chat_client_mode", {text: e.chat_message.text}); else if (e.permission_info) {
  9886. const i = e.permission_info;
  9887. console.info("Change permission " + i.permission + " -> " + i.enabled);
  9888. let o;
  9889. switch (i.permission) {
  9890. case t0.Keyboard:
  9891. this._serverPerms.keyboardEnabled = i.enabled, o = "keyboard";
  9892. break;
  9893. case t0.Clipboard:
  9894. this._serverPerms.clipboardEnabled = i.enabled, o = "clipboard";
  9895. break;
  9896. case t0.Audio:
  9897. o = "audio";
  9898. break;
  9899. case t0.Restart:
  9900. o = "restart";
  9901. break;
  9902. case t0.BlockInput:
  9903. o = "block_input";
  9904. break;
  9905. default:
  9906. return !0
  9907. }
  9908. this.setPermission(o, i.enabled)
  9909. } else if (e.switch_display) m("switch_display", e.switch_display), this.setCustomResolution(e.switch_display); else {
  9910. if (e.close_reason) return this.msgbox("error", "Connection Error", e.close_reason), this.close(), !1;
  9911. if (e.back_notification) {
  9912. if (!this.handleBackNotification(e.back_notification)) return this.close(), !1
  9913. } 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)
  9914. }
  9915. return !0
  9916. }
  9917. portableServiceRunning(e) {
  9918. m("portable_service_running", {running: e.toString()})
  9919. }
  9920. handleFollowCurrentDisplay(e) {
  9921. m("follow_current_display", {display_idx: e.toString()})
  9922. }
  9923. handleBackNotification(e) {
  9924. 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);
  9925. return !0
  9926. }
  9927. updateBlockInputState(e) {
  9928. m("update_block_input_state", {input_state: e ? "on" : "off"})
  9929. }
  9930. handleBackMsgBlockInput(e, i) {
  9931. switch (e) {
  9932. case A4.BlkOnSucceeded:
  9933. this.updateBlockInputState(!0);
  9934. break;
  9935. case A4.BlkOnFailed:
  9936. this.msgbox("custom-error", "Block user input", i == "" ? "Failed" : i, ""), this.updateBlockInputState(!1);
  9937. break;
  9938. case A4.BlkOffSucceeded:
  9939. this.updateBlockInputState(!1);
  9940. break;
  9941. case A4.BlkOffFailed:
  9942. this.msgbox("custom-error", "Unblock user input", i == "" ? "Failed" : i, "");
  9943. break
  9944. }
  9945. }
  9946. updatePrivacyMode(e, i) {
  9947. i && (e == "" && (e = "privacy_mode_impl_mag"), this.setOption("privacy-mode-impl-key", e)), this.setOption("privacy-mode", i), m("update_privacy_mode", {})
  9948. }
  9949. handleBackMsgPrivacyMode(e, i, o) {
  9950. switch (e) {
  9951. case ou.PrvOnByOther:
  9952. return this.msgbox("error", "Connecting...", "Someone turns on privacy mode, exit", ""), !1;
  9953. case ou.PrvNotSupported:
  9954. this.msgbox("custom-error", "Privacy mode", "Unsupported", ""), this.updatePrivacyMode(o, !1);
  9955. break;
  9956. case ou.PrvOnSucceeded:
  9957. this.msgbox("custom-nocancel", "Privacy mode", "Enter privacy mode", ""), this.updatePrivacyMode(o, !0);
  9958. break;
  9959. case ou.PrvOnFailedDenied:
  9960. this.msgbox("custom-error", "Privacy mode", "Peer denied", ""), this.updatePrivacyMode(o, !1);
  9961. break;
  9962. case ou.PrvOnFailedPlugin:
  9963. this.msgbox("custom-error", "Privacy mode", "Please install plugins", ""), this.updatePrivacyMode(o, !1);
  9964. break;
  9965. case ou.PrvOnFailed:
  9966. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed" : i, ""), this.updatePrivacyMode(o, !1);
  9967. break;
  9968. case ou.PrvOffSucceeded:
  9969. this.msgbox("custom-nocancel", "Privacy mode", "Exit privacy mode", ""), this.updatePrivacyMode(o, !1);
  9970. break;
  9971. case ou.PrvOffFailed:
  9972. this.msgbox("custom-error", "Privacy mode", i == "" ? "Failed to turn off" : i, "");
  9973. break;
  9974. case ou.PrvOffUnknown:
  9975. this.msgbox("custom-error", "Privacy mode", "Turned off", ""), this.updatePrivacyMode(o, !1);
  9976. break
  9977. }
  9978. return !0
  9979. }
  9980. getRemember() {
  9981. return this._options.remember || !1
  9982. }
  9983. setRemember(e) {
  9984. this.setOption("remember", e)
  9985. }
  9986. getOption(e) {
  9987. var i;
  9988. return (i = this._options[e]) != null ? i : u0(e)
  9989. }
  9990. getUserDefaultToggleOptions() {
  9991. const e = {}, i = {
  9992. "show-remote-cursor": "show_remote_cursor",
  9993. "lock-after-session-end": "lock_after_session_end",
  9994. "privacy-mode": "privacy_mode",
  9995. "enable-file-copy-paste": "enable-file-copy-paste",
  9996. "disable-audio": "disable_audio",
  9997. "disable-clipboard": "disable_clipboard",
  9998. "show-quality-monitor": "show_quality_monitor",
  9999. allow_swap_key: "allow_swap_key",
  10000. "view-only": "view_only",
  10001. "follow-remote-cursor": "follow_remote_cursor",
  10002. "follow-remote-window": "follow_remote_window"
  10003. };
  10004. for (const [a, t] of Object.entries(i)) e[a] = u0(t) == "Y";
  10005. const o = ["codec-preference", "custom-fps", "zoom-cursor", "touch-mode", "i444", "swap-left-right-mouse", "collapse_toolbar"];
  10006. for (const a of o) e[a] = u0(a);
  10007. return e
  10008. }
  10009. getToggleOption(e) {
  10010. const i = ["show-remote-cursor", "privacy-mode", "enable-file-copy-paste"], o = this._options[e];
  10011. return typeof o == "string" ? o != "" : o != null ? o : !!i.includes(e)
  10012. }
  10013. getStatus() {
  10014. return JSON.stringify({status_num: 10})
  10015. }
  10016. checkConnStatus() {
  10017. }
  10018. saveConfig(e) {
  10019. this._options = e, this._options.tm = new Date().getTime(), Bo(this._id, e)
  10020. }
  10021. loadConfig() {
  10022. return le(this._id) || {}
  10023. }
  10024. setOption(e, i) {
  10025. i == null ? delete this._options[e] : this._options[e] = i, this._options.tm = new Date().getTime(), kt(this._id, e, i)
  10026. }
  10027. setFlutterUiOption(e, i) {
  10028. this.setOption(`flutter_ui:${e}`, i)
  10029. }
  10030. getFlutterUiOption(e) {
  10031. return this.getOption(`flutter_ui:${e}`)
  10032. }
  10033. inputKey(e, i, o, a, t, s, l) {
  10034. var c;
  10035. const E = So(e, Mn());
  10036. !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}))
  10037. }
  10038. ctrlAltDel() {
  10039. var i, o;
  10040. const e = w.fromPartial({down: !0});
  10041. ((i = this._peerInfo) == null ? void 0 : i.platform) == "Windows" ? e.control_key = j.CtrlAltDel : (e.control_key = j.Delete, e.modifiers = this.getMod(!0, !0, !1, !1)), (o = this._ws) == null || o.sendMessage({key_event: e})
  10042. }
  10043. restart() {
  10044. var i;
  10045. this._restartingRemoteDevice = !0;
  10046. const e = f.fromPartial({});
  10047. e.restart_remote_device = !0, (i = this._ws) == null || i.sendMessage({misc: e})
  10048. }
  10049. inputString(e) {
  10050. var o;
  10051. const i = w.fromPartial({seq: e});
  10052. (o = this._ws) == null || o.sendMessage({key_event: i})
  10053. }
  10054. send2fa(e) {
  10055. var i;
  10056. try {
  10057. const o = JSON.parse(e), a = o.code, t = o.trust_this_device;
  10058. t && this.setOption(w4, "Y");
  10059. const s = this._getHwid(t), l = _u.fromPartial({code: a, hwid: s});
  10060. (i = this._ws) == null || i.sendMessage({auth_2fa: l})
  10061. } catch {
  10062. console.log('Failed to switch display, invalid param "' + e + '"')
  10063. }
  10064. }
  10065. _captureDisplays({add: e, sub: i, set: o}) {
  10066. var s;
  10067. const a = Uu.fromPartial({add: e, sub: i, set: o}), t = f.fromPartial({capture_displays: a});
  10068. (s = this._ws) == null || s.sendMessage({misc: t})
  10069. }
  10070. switchDisplay(e) {
  10071. var i;
  10072. try {
  10073. const o = JSON.parse(e), a = o.value, t = o.isDesktop;
  10074. if (a.length == 1) {
  10075. let s = this.getCustomResolution(a[0]);
  10076. const l = Mu.fromPartial({display: a[0], width: s ? s[0] : void 0, height: s ? s[1] : void 0}),
  10077. E = f.fromPartial({switch_display: l});
  10078. (i = this._ws) == null || i.sendMessage({misc: E}), t || this._captureDisplays({set: a})
  10079. } else this._captureDisplays({set: a})
  10080. } catch {
  10081. console.log('Failed to switch display, invalid param "' + e + '"')
  10082. }
  10083. }
  10084. elevateDirect() {
  10085. var o;
  10086. const e = Du.fromPartial({direct: !0}), i = f.fromPartial({elevation_request: e});
  10087. (o = this._ws) == null || o.sendMessage({misc: i}), this._elevationRequested = !0
  10088. }
  10089. elevateWithLogon(e) {
  10090. var i;
  10091. try {
  10092. const o = JSON.parse(e), a = qu.fromPartial({username: o.username, password: o.password}),
  10093. t = Du.fromPartial({logon: a}), s = f.fromPartial({elevation_request: t});
  10094. (i = this._ws) == null || i.sendMessage({misc: s}), this._elevationRequested = !0
  10095. } catch {
  10096. console.log('Failed to elevate with logon, invalid param "' + e + '"')
  10097. }
  10098. }
  10099. async inputOsPassword(e) {
  10100. var a, t;
  10101. this.inputMouse(), await ie(50), this.inputMouse(0, 3, 3), await ie(50), this.inputMouse(1 | 1 << 3), this.inputMouse(2 | 1 << 3), await ie(1200);
  10102. const i = w.fromPartial({press: !0, seq: e});
  10103. (a = this._ws) == null || a.sendMessage({key_event: i});
  10104. const o = w.fromPartial({press: !0, control_key: j.Return});
  10105. (t = this._ws) == null || t.sendMessage({key_event: o})
  10106. }
  10107. lockScreen() {
  10108. var i;
  10109. const e = w.fromPartial({down: !0, control_key: j.LockScreen});
  10110. (i = this._ws) == null || i.sendMessage({key_event: e})
  10111. }
  10112. isSwapControlCommand() {
  10113. return this.getToggleOption("allow_swap_key")
  10114. }
  10115. getMod(e, i, o, a) {
  10116. const t = [];
  10117. return e && t.push(j.Alt), i && (this.isSwapControlCommand() ? t.push(j.Meta) : t.push(j.Control)), o && t.push(j.Shift), a && (this.isSwapControlCommand() ? t.push(j.Control) : t.push(j.Meta)), t
  10118. }
  10119. inputMouse(e = 0, i = 0, o = 0, a = !1, t = !1, s = !1, l = !1) {
  10120. var c;
  10121. const E = ku.fromPartial({mask: e, x: i, y: o, modifiers: this.getMod(a, t, s, l)});
  10122. (c = this._ws) == null || c.sendMessage({mouse_event: E})
  10123. }
  10124. toggleOption(e) {
  10125. var s;
  10126. const i = !this._options[e], o = z.fromPartial({}), a = i ? x.Yes : x.No;
  10127. switch (e) {
  10128. case"show-remote-cursor":
  10129. o.show_remote_cursor = a;
  10130. break;
  10131. case"follow-remote-cursor":
  10132. o.follow_remote_cursor = a;
  10133. break;
  10134. case"follow-remote-window":
  10135. o.follow_remote_window = a;
  10136. break;
  10137. case"disable-audio":
  10138. o.disable_audio = a;
  10139. break;
  10140. case"disable-clipboard":
  10141. o.disable_clipboard = a;
  10142. break;
  10143. case"lock-after-session-end":
  10144. o.lock_after_session_end = a;
  10145. break;
  10146. case"privacy-mode":
  10147. o.privacy_mode = a;
  10148. break;
  10149. case"enable-file-copy-paste":
  10150. o.enable_file_transfer = a;
  10151. break;
  10152. case"block-input":
  10153. o.block_input = x.Yes;
  10154. break;
  10155. case"unblock-input":
  10156. o.block_input = x.No;
  10157. break;
  10158. case"show-quality-monitor":
  10159. case"allow_swap_key":
  10160. break;
  10161. case"view-only":
  10162. 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);
  10163. break;
  10164. default:
  10165. this.setOption(e, this._options[e] ? void 0 : "Y");
  10166. return
  10167. }
  10168. e.indexOf("block-input") < 0 && this.setOption(e, i);
  10169. const t = f.fromPartial({option: o});
  10170. (s = this._ws) == null || s.sendMessage({misc: t})
  10171. }
  10172. toggleVirtualDisplay(e) {
  10173. try {
  10174. const i = JSON.parse(e);
  10175. this._sendToggleVirtualDisplayMsg(i.index, i.on), this.updateVirtualDisplay(i.index, i.on)
  10176. } catch {
  10177. console.log('Failed to toggle virtual display, invalid param "' + e + '"')
  10178. }
  10179. }
  10180. togglePrivacyMode(e) {
  10181. try {
  10182. const i = JSON.parse(e);
  10183. this._sendTogglePrivacyModeMsg(i.impl_key, i.on)
  10184. } catch {
  10185. console.log('Failed to toggle privacy mode, invalid param "' + e + '"')
  10186. }
  10187. }
  10188. _sendToggleVirtualDisplayMsg(e, i) {
  10189. var t;
  10190. const o = Lu.fromPartial({display: e, on: i}), a = f.fromPartial({toggle_virtual_display: o});
  10191. (t = this._ws) == null || t.sendMessage({misc: a})
  10192. }
  10193. _sendTogglePrivacyModeMsg(e, i) {
  10194. var t;
  10195. const o = Wu.fromPartial({impl_key: e, on: i}), a = f.fromPartial({toggle_privacy_mode: o});
  10196. (t = this._ws) == null || t.sendMessage({misc: a})
  10197. }
  10198. updateVirtualDisplay(e, i) {
  10199. const o = "virtual-display", a = this.getOption(o);
  10200. if (i) {
  10201. const t = a.split(","), s = t.length;
  10202. e == 0 ? t.splice(0, t.length) : t.indexOf(e.toString()) < 0 && t.push(e.toString()), t.length != s && this.setOption(o, t.join(","))
  10203. } else if (e == -1) a != "" && this.setOption(o, ""); else {
  10204. const t = a.split(","), s = t.length;
  10205. if (e == 0) t.pop(); else {
  10206. const l = t.indexOf(e.toString());
  10207. l >= 0 && t.splice(l, 1)
  10208. }
  10209. t.length != s && this.setOption(o, t.join(","))
  10210. }
  10211. }
  10212. getImageQuality() {
  10213. return this.getOption("image_quality")
  10214. }
  10215. getImageQualityEnum(e, i) {
  10216. switch (e) {
  10217. case"low":
  10218. return S4.Low;
  10219. case"best":
  10220. return S4.Best;
  10221. case"balanced":
  10222. return i ? void 0 : S4.Balanced;
  10223. default:
  10224. return
  10225. }
  10226. }
  10227. setImageQuality(e) {
  10228. var t;
  10229. this.setOption("image_quality", e);
  10230. const i = this.getImageQualityEnum(e, !1);
  10231. if (i == null) return;
  10232. const o = z.fromPartial({image_quality: i}), a = f.fromPartial({option: o});
  10233. (t = this._ws) == null || t.sendMessage({misc: a}), this._lastSendFps != 30 && this.setCustomFps(30, !1)
  10234. }
  10235. setCustomImageQuality(e) {
  10236. var t;
  10237. const i = e << 8, o = z.fromPartial({custom_image_quality: i}), a = f.fromPartial({option: o});
  10238. (t = this._ws) == null || t.sendMessage({misc: a}), this.setOption("custom_image_quality", e.toString()), this.setOption("image_quality", "custom")
  10239. }
  10240. setCustomFps(e, i) {
  10241. var s;
  10242. const o = e, a = z.fromPartial({custom_fps: o}), t = f.fromPartial({option: a});
  10243. (s = this._ws) == null || s.sendMessage({misc: t}), this._lastSendFps = o, i && this.setOption("custom-fps", e.toString())
  10244. }
  10245. sendNote(e, i) {
  10246. let o = i;
  10247. fetch(e, {
  10248. method: "POST",
  10249. headers: {"Content-Type": "application/json"},
  10250. body: JSON.stringify({id: this._id, session_id: this._sessionId, note: o})
  10251. }).then(a => {
  10252. if (!a.ok) throw new Error(a.statusText);
  10253. return a.text()
  10254. }).then(a => {
  10255. console.log("Send note response:", a)
  10256. }).catch(a => {
  10257. console.error("Failed to send note:", a)
  10258. })
  10259. }
  10260. getPlatform() {
  10261. var e;
  10262. return ((e = this._peerInfo) == null ? void 0 : e.platform) || ""
  10263. }
  10264. async handleFileResponse(e) {
  10265. var i, o;
  10266. if (e.dir) {
  10267. let a = e.dir, t = a.entries;
  10268. if (!_4() && this.getPeerPlatform() == "Windows") for (let s = 0; s < t.length; s++) t[s].name = t[s].name.replace(/\\/g, "/");
  10269. it(a.id, t, a.path, !1, !1), this._writeJobs.forEach(s => {
  10270. s.id == a.id && (s.files = t)
  10271. }), this._removeJobs[a.id] && (this._removeJobs[a.id].files = t)
  10272. } else if (e.empty_dirs != null) {
  10273. const a = e.empty_dirs;
  10274. for (let t = 0; t < this._readRemoteEmptyDirsJobs.length; t++) this._readRemoteEmptyDirsJobs[t].path == a.path && (this._readRemoteEmptyDirsJobs[t].empty_dirs = a.empty_dirs.map(s => s.path))
  10275. } else if (e.block) {
  10276. const a = e.block, t = this._writeJobs.find(s => s.id == a.id);
  10277. if (t) try {
  10278. await t.write(a, () => {
  10279. console.log(`cancel job ${t.id} due to write failed`), this.cancelJob(t.id)
  10280. })
  10281. } catch (s) {
  10282. console.log("write file failed", s)
  10283. }
  10284. this.update_jobs_status()
  10285. } else if (e.digest) {
  10286. const a = e.digest;
  10287. if (a.is_upload) {
  10288. const t = this._readJobs.find(s => s.id == a.id);
  10289. if (t) {
  10290. const s = t.read_digest(a);
  10291. s && ((i = this._ws) == null || i.sendMessage(s))
  10292. }
  10293. } else {
  10294. const t = this._writeJobs.find(s => s.id == a.id);
  10295. if (t) {
  10296. const s = t.write_digest(a);
  10297. s && ((o = this._ws) == null || o.sendMessage(s))
  10298. }
  10299. }
  10300. } else if (e.done) {
  10301. const a = e.done, t = this._writeJobs.find(l => l.id == a.id);
  10302. let s;
  10303. t && (t.write_done(a, () => this._readRemoteEmptyDirsJobs.find(l => l.id == a.id), () => this.removeReadRemoteEmptryDirJob(a.id)), s = t.job_error(), this._writeJobs = this._writeJobs.filter(l => l.id != a.id)), this.handle_job_status(a.id, a.file_num, s)
  10304. } else if (e.error) {
  10305. const a = e.error;
  10306. this._writeJobs = this._writeJobs.filter(t => t.id != a.id), this.removeReadRemoteEmptryDirJob(a.id), this.handle_job_status(a.id, a.file_num, a.error)
  10307. }
  10308. }
  10309. removeReadRemoteEmptryDirJob(e) {
  10310. this._readRemoteEmptyDirsJobs = this._readRemoteEmptyDirsJobs.filter(i => i.id != e)
  10311. }
  10312. readRemoteDir(e) {
  10313. var i;
  10314. try {
  10315. const o = JSON.parse(e),
  10316. a = P.fromPartial({read_dir: hu.fromPartial({path: o.path, include_hidden: o.include_hidden})});
  10317. (i = this._ws) == null || i.sendMessage({file_action: a})
  10318. } catch (o) {
  10319. console.error("Failed to read remote dir:", o)
  10320. }
  10321. }
  10322. async sendFiles(e) {
  10323. var i;
  10324. try {
  10325. const o = JSON.parse(e), {
  10326. id: a,
  10327. path: t,
  10328. to: s,
  10329. file_num: l,
  10330. include_hidden: E,
  10331. is_remote: c,
  10332. is_dir: C
  10333. } = o, D = this.enableOverwriteDetection();
  10334. if (c) {
  10335. this._writeJobs.push(lu.newWrite(a, t, s, l, E, c, [], D, C));
  10336. const B = dn(a, t, l, E);
  10337. (i = this._ws) == null || i.sendMessage({file_action: B}), C && this.enableEmptyDirs() && (this._readRemoteEmptyDirsJobs.find(F => F.id == a) == null && this._readRemoteEmptyDirsJobs.push(new En({
  10338. id: a,
  10339. path: t
  10340. })), this.sendMessage({file_action: _n(t, E)}))
  10341. }
  10342. } catch (o) {
  10343. console.error("Failed to send files:", o)
  10344. }
  10345. }
  10346. async sendLocalFiles(e) {
  10347. try {
  10348. const i = JSON.parse(e), {
  10349. handle_index: o,
  10350. id: a,
  10351. path: t,
  10352. to: s,
  10353. file_num: l,
  10354. include_hidden: E,
  10355. is_remote: c
  10356. } = i, C = this.enableOverwriteDetection();
  10357. if (!c) try {
  10358. let D = this._fileHandles[o];
  10359. if (!D) throw new Error("Failed to get file handle");
  10360. let B = [], F = [];
  10361. if (D instanceof FileSystemFileHandle) {
  10362. let g = await D.getFile();
  10363. B = [W.fromPartial({
  10364. size: g.size,
  10365. entry_type: 4,
  10366. modified_time: Math.floor(g.lastModified / 1e3)
  10367. })], F = [D]
  10368. } else {
  10369. let g = await Ot(D, "");
  10370. B = g.map(U => U.entry), F = g.map(U => U.handle)
  10371. }
  10372. let y = lu.newRead(a, t, s, l, E, c, B, C, F);
  10373. it(a, B, t, !c, !0), this._readJobs.push(y), this._ftTimer || (this._ftTimer = setTimeout(this.readJobTimerCallback.bind(this), tt));
  10374. let S = [...B];
  10375. if (_4() && this.getPeerPlatform() != "Windows") for (let g = 0; g < S.length; g++) S[g].name = S[g].name.replace(/\\/g, "/");
  10376. if (this.sendMessage({file_action: mn(a, s, l, S, y.total_size)}), this.enableEmptyDirs()) {
  10377. const g = await Mt(D, D.name);
  10378. g.length > 0 && m("send_emptry_dirs", {dirs: g})
  10379. }
  10380. } catch (D) {
  10381. console.error("Failed to send files:", D), this.handle_job_status(a, -1, (D != null ? D : "Failed to send files").toString())
  10382. }
  10383. } catch (i) {
  10384. console.error("Failed to send files:", i)
  10385. }
  10386. }
  10387. async readJobTimerCallback() {
  10388. let e = await fn(this._readJobs, this.sendMessage.bind(this));
  10389. 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), tt)
  10390. }
  10391. update_jobs_status() {
  10392. const e = new Date().getTime() - this._last_update_jobs_ms;
  10393. e >= 1e3 && (this._readJobs.forEach(i => {
  10394. i.update_job_status(e)
  10395. }), this._writeJobs.forEach(i => {
  10396. i.update_job_status(e)
  10397. }), this._last_update_jobs_ms = new Date().getTime())
  10398. }
  10399. handle_job_status(e, i, o) {
  10400. var a;
  10401. if (this._removeJobs[e] && this._removeJobs[e].no_confirm) {
  10402. const t = this._removeJobs[e].files;
  10403. if (i + 1 < t.length) {
  10404. const s = this._removeJobs[e].path + this._removeJobs[e].sep + t[i + 1].name;
  10405. if ((a = this._ws) == null || a.sendMessage({file_action: ut(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
  10406. } else delete this._removeJobs[e], console.log("remove jobs:", this._removeJobs)
  10407. }
  10408. o ? ce(e, o, i) : gn(e, i)
  10409. }
  10410. cancelJob(e) {
  10411. var o;
  10412. (o = this._ws) == null || o.sendMessage({file_action: pn(e)});
  10413. let i = this._writeJobs.find(a => a.id == e);
  10414. 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]
  10415. }
  10416. removeAllEmptyDirs(e) {
  10417. var i;
  10418. try {
  10419. const o = JSON.parse(e);
  10420. (i = this._ws) == null || i.sendMessage({file_action: Dn(o.id, o.path)})
  10421. } catch (o) {
  10422. console.error("Failed to remove all empty dirs:", o)
  10423. }
  10424. }
  10425. removeFile(e) {
  10426. var i;
  10427. try {
  10428. const o = JSON.parse(e), {id: a, path: t, file_num: s, is_remote: l} = o;
  10429. l && ((i = this._ws) == null || i.sendMessage({file_action: ut(a, t, s, l)}))
  10430. } catch (o) {
  10431. console.error("Failed to remove files:", o)
  10432. }
  10433. }
  10434. readDirToRemoveRecursive(e) {
  10435. var i;
  10436. try {
  10437. const o = JSON.parse(e), {id: a, path: t, is_remote: s, show_hidden: l} = o;
  10438. if (s) {
  10439. (i = this._ws) == null || i.sendMessage({file_action: cn(a, t, l)});
  10440. const E = (c, C) => (c ? C === "Windows" : _4()) ? "\\" : "/";
  10441. this._removeJobs[a] = {
  10442. path: t,
  10443. files: [],
  10444. no_confirm: !1,
  10445. is_remote: s,
  10446. sep: E(s, this.getPeerPlatform()),
  10447. last_update_job_status: new Date().getTime()
  10448. }
  10449. }
  10450. } catch (o) {
  10451. console.error("Failed to read dir to remove recursive:", o)
  10452. }
  10453. }
  10454. createDir(e) {
  10455. var i;
  10456. try {
  10457. const o = JSON.parse(e), {id: a, path: t, is_remote: s} = o;
  10458. s && ((i = this._ws) == null || i.sendMessage({file_action: Cn(a, t)}))
  10459. } catch (o) {
  10460. console.error("Failed to create dir:", o)
  10461. }
  10462. }
  10463. renameFile(e) {
  10464. var i;
  10465. try {
  10466. const o = JSON.parse(e), {id: a, path: t, new_name: s, is_remote: l} = o;
  10467. l && ((i = this._ws) == null || i.sendMessage({file_action: Bn(a, t, s)}))
  10468. } catch (o) {
  10469. console.error("Failed to rename file:", o)
  10470. }
  10471. }
  10472. async seletFiles(e) {
  10473. await hn(e, (i, o) => {
  10474. this._fileHandles[i] = o
  10475. })
  10476. }
  10477. async handleFileAction(e) {
  10478. if (e.send_confirm) {
  10479. const i = e.send_confirm, o = this._readJobs.find(a => a.id == i.id);
  10480. o && o.confirm(i)
  10481. }
  10482. }
  10483. async confirmOverrideFile(e) {
  10484. try {
  10485. const i = JSON.parse(e), {id: o, file_num: a, need_override: t, remember: s, is_upload: l} = i;
  10486. if (l) {
  10487. const E = this._readJobs.find(c => c.id == o);
  10488. E && (s && (E.default_overwrite_strategy = t), E.confirm(cu.fromPartial({
  10489. id: o,
  10490. file_num: a,
  10491. offset_blk: t ? 0 : void 0,
  10492. skip: t ? void 0 : !0
  10493. })))
  10494. }
  10495. } catch (i) {
  10496. console.error("Failed to confirm override file:", i)
  10497. }
  10498. }
  10499. sendChat(e) {
  10500. const i = vu.fromPartial({text: e}), o = f.fromPartial({chat_message: i});
  10501. this.sendMessage({misc: o})
  10502. }
  10503. changeResolution(e) {
  10504. var i;
  10505. try {
  10506. const o = JSON.parse(e), a = v.fromPartial({width: o.width, height: o.height});
  10507. let t;
  10508. this._peerInfo && Q(this._peerInfo.version) >= Q("1.2.4") ? t = f.fromPartial({
  10509. change_display_resolution: Ou.fromPartial({
  10510. display: o.display,
  10511. resolution: a
  10512. })
  10513. }) : t = f.fromPartial({change_resolution: a}), (i = this._ws) == null || i.sendMessage({misc: t}), this._lastChangeDisplay = {
  10514. display: o.display,
  10515. width: o.width,
  10516. height: o.height,
  10517. time: new Date().getTime()
  10518. }
  10519. } catch (o) {
  10520. console.error("Failed to change resolution:", o)
  10521. }
  10522. }
  10523. setCustomResolution(e) {
  10524. var a, t;
  10525. const i = (s, l) => {
  10526. const E = s.toString(), c = this.loadConfig();
  10527. c.custom_resolutions || (c.custom_resolutions = {}), l ? c.custom_resolutions[E] = {
  10528. w: l[0],
  10529. h: l[1]
  10530. } : delete c.custom_resolutions[E], this.saveConfig(c)
  10531. }, o = () => {
  10532. var s, l, E;
  10533. 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
  10534. };
  10535. 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 {
  10536. const s = this._lastChangeDisplay;
  10537. if ((s == null ? void 0 : s.display) == e.display) {
  10538. const l = o() ? [e.width, e.height] : void 0;
  10539. i(e.display, l)
  10540. }
  10541. }
  10542. }
  10543. getCustomResolution(e) {
  10544. const o = this.loadConfig().custom_resolutions;
  10545. if (o) {
  10546. const a = o[e.toString()];
  10547. if (a && a.w && a.h) return [a.w, a.h]
  10548. }
  10549. }
  10550. tryChangeInitResolution(e) {
  10551. const i = this.getCustomResolution(e);
  10552. i && this.changeResolution(JSON.stringify({display: e, width: i[0], height: i[1]}))
  10553. }
  10554. setMultipleWindowsSession(e) {
  10555. let i = [];
  10556. e.forEach(o => {
  10557. let a = {};
  10558. a.sid = o.sid.toString(), a.name = o.name, i.push(a)
  10559. }), m("set_multiple_windows_session", {windows_sessions: JSON.stringify(i)})
  10560. }
  10561. sendSelectedSessionId(e) {
  10562. var o, a;
  10563. const i = parseInt(e);
  10564. if (isNaN(i)) console.error("selected invalid sid: ", e); else {
  10565. this._selectedWindowsSessionId = i;
  10566. const t = f.fromPartial({selected_sid: i});
  10567. (o = this._ws) == null || o.sendMessage({misc: t});
  10568. const s = this._peerInfo;
  10569. 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..."))
  10570. }
  10571. }
  10572. }
  10573. function R4(u = !1) {
  10574. const e = A.getItem("custom-rendezvous-server");
  10575. return I4(e || Lt, u)
  10576. }
  10577. function getUriFromRs(uri, isRelay = false, roffset = 0) {
  10578. const p = isHttps() ? "wss://" : "ws://"
  10579. const [domain, uriport] = uri.split(":")
  10580. if (!isHttps()) {
  10581. // http 直接走端口
  10582. const port = uriport ? parseInt(uriport) : defaultIdServerPort;
  10583. return p + domain + ":" + (port + (isRelay ? 3 : 2))
  10584. }
  10585. // https 分情况
  10586. if (!window.location.port) {
  10587. // 443
  10588. return p + domain + "/ws/" + (isRelay ? "relay" : "id")
  10589. }
  10590. // 非443
  10591. return p + domain + ":" + window.location.port + "/ws/" + (isRelay ? "relay" : "id")
  10592. }
  10593. function isHttps() {
  10594. return window.location.protocol === "https:"
  10595. }
  10596. function I4(u, e = !1, i = 0) {
  10597. return getUriFromRs(u, e, i)
  10598. }
  10599. function wn() {
  10600. return window.location.protocol === "https:"
  10601. }
  10602. function Sn(u) {
  10603. return u.indexOf(":") > 0 ? u.split(":")[0] : u
  10604. }
  10605. const at = (u, e, i) => e && u.type == "SharedAb" ? Z(Zu([u.value, i.salt])) === Z(e) : !1,
  10606. ot = (u, e) => e && u.type == "PersonalAb" ? Z(u.value) === Z(e) : !1;
  10607. function zn() {
  10608. return R4()
  10609. }
  10610. function nt(u, e) {
  10611. be("callback_query_onlines", {onlines: u.join(","), offlines: e.join(",")})
  10612. }
  10613. const onlineCache = {}
  10614. // Query onlines
  10615. async function myQueryOnline(id) {
  10616. const last_online = onlineCache[id]
  10617. if (last_online && new Date().getTime() - last_online < 20 * 1000) {
  10618. return true
  10619. }
  10620. // 映射 方便后期更新
  10621. const maps = {
  10622. uri: R4(),
  10623. ws: N4,
  10624. conn_type: ne.DEFAULT_CONN,
  10625. nat_type: pt.SYMMETRIC,
  10626. token: Pt(),
  10627. version: se,
  10628. licence_key: To(),
  10629. rendezvousPunchHoleRequest: Ku,
  10630. rendezvousPunchHoleResponse_Failure: Z0
  10631. }
  10632. const s = new maps.ws(maps.uri, !0, "rendezvous");
  10633. await s.open();
  10634. const punch_hole_request = maps.rendezvousPunchHoleRequest.fromPartial({
  10635. id: id,
  10636. licence_key: maps.licence_key,
  10637. conn_type: maps.conn_type,
  10638. nat_type: maps.nat_type,
  10639. token: maps.token,
  10640. version: maps.version
  10641. });
  10642. s.sendRendezvous({punch_hole_request: punch_hole_request});
  10643. const msg = await s.next();
  10644. s.close();
  10645. let online = false
  10646. const phr = msg.punch_hole_response, rr = msg.relay_response;
  10647. if (phr) {
  10648. online = true
  10649. if (phr != null && phr.other_failure) {
  10650. online = false
  10651. return online
  10652. }
  10653. if (phr.failure != maps.rendezvousPunchHoleResponse_Failure.UNRECOGNIZED) switch (phr == null ? void 0 : phr.failure) {
  10654. case maps.rendezvousPunchHoleResponse_Failure.ID_NOT_EXIST:
  10655. case maps.rendezvousPunchHoleResponse_Failure.OFFLINE:
  10656. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_MISMATCH:
  10657. case maps.rendezvousPunchHoleResponse_Failure.LICENSE_OVERUSE:
  10658. online = false
  10659. break
  10660. }
  10661. } else if (rr) {
  10662. online = true
  10663. if (!rr.version) {
  10664. online = false
  10665. return online
  10666. }
  10667. }
  10668. if (online) {
  10669. onlineCache[id] = new Date().getTime()
  10670. } else if (onlineCache[id]) {
  10671. delete onlineCache[id]
  10672. }
  10673. return online
  10674. }
  10675. async function Pn(u) {
  10676. let e = [];
  10677. try {
  10678. e = JSON.parse(u)
  10679. } catch (a) {
  10680. console.error("Failed to query onlines, ", a);
  10681. return
  10682. }
  10683. if (e.length === 0) return;
  10684. if (window.webclient_magic_queryonline) {
  10685. const onlines = []
  10686. const offlines = []
  10687. for (let i = 0; i < e.length; i++) {
  10688. let online = await myQueryOnline(e[i])
  10689. if (online) {
  10690. onlines.push(e[i])
  10691. } else {
  10692. offlines.push(e[i])
  10693. }
  10694. }
  10695. nt(onlines, offlines)
  10696. } else {
  10697. const i = zn(), o = new N4(i, !0, "query onlines");
  10698. try {
  10699. await o.open();
  10700. const a = Ju.fromPartial({id: O4(), peers: e});
  10701. o.sendRendezvous({online_request: a})
  10702. } catch (a) {
  10703. console.error("Failed to query onlines, ", a), nt([], e), o.close();
  10704. return
  10705. }
  10706. for (let a = 0; a < 2; a++) {
  10707. const t = await Io(o, 3e3);
  10708. if (!t || (t == null ? void 0 : t.key_exchange) || (t == null ? void 0 : t.online_response) === void 0) continue;
  10709. const s = t.online_response.states;
  10710. let l = [], E = [];
  10711. for (let c = 0; c < e.length; c++) {
  10712. const C = 1 << 7 - c % 8;
  10713. (s[Math.floor(c / 8)] & C) === C ? l.push(e[c]) : E.push(e[c])
  10714. }
  10715. nt(l, E), o.close();
  10716. return
  10717. }
  10718. o.close(), console.error("Failed to query online states, no online response")
  10719. }
  10720. }
  10721. const Rn = "rustdesk-client";
  10722. function In() {
  10723. if (typeof navigator != "undefined") {
  10724. const u = navigator.platform.toLowerCase();
  10725. return u.includes("win") ? "windows" : u.includes("mac") ? "macos" : u.includes("linux") ? "linux" : u
  10726. }
  10727. return "unknown"
  10728. }
  10729. function Tn() {
  10730. const u = In();
  10731. return u === "windows" ? navigator.userAgent.includes("Win64") ? "x86_64" : "x86" : u === "macos" ? navigator.userAgent.includes("Intel") ? "x86_64" : "arm64" : navigator.userAgent.includes("x64") ? "x86_64" : "x86"
  10732. }
  10733. function jn() {
  10734. const u = navigator.userAgent;
  10735. let e = "", i = "";
  10736. if (u.includes("Windows")) {
  10737. e = "windows";
  10738. const o = u.match(/Windows NT (\d+\.\d+)/);
  10739. o && (i = o[1])
  10740. } else if (u.includes("Mac OS X")) {
  10741. e = "macos";
  10742. const o = u.match(/Mac OS X (\d+[._]\d+[._]\d+)/);
  10743. o && (i = o[1].replace(/_/g, "."))
  10744. } else if (u.includes("Linux")) {
  10745. e = "linux";
  10746. const o = u.match(/Linux\s*([\d.]+)?/);
  10747. o && o[1] && (i = o[1])
  10748. } else e = "unknown", i = "";
  10749. return e += "-" + navigator.userAgent, {os: e, os_version: i}
  10750. }
  10751. async function Nn(u) {
  10752. const e = "https://api.rustdesk.com/version/latest", {os: i, os_version: o} = jn(), a = Tn();
  10753. return [{os: i, os_version: o, arch: a, device_id: [], typ: u}, e]
  10754. }
  10755. async function On() {
  10756. try {
  10757. const [u, e] = await Nn(Rn);
  10758. return await (await fetch(e, {
  10759. method: "POST",
  10760. headers: {"Content-Type": "application/json"},
  10761. body: JSON.stringify(u)
  10762. })).json()
  10763. } catch {
  10764. return null
  10765. }
  10766. }
  10767. window.curConn = void 0;
  10768. 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));
  10769. const ye = zt(), Yu = ye === Y4, H4 = ye === Be, Qu = ye === me;
  10770. function Mn() {
  10771. return !isMobile()
  10772. }
  10773. function Vt(u, e, i, o) {
  10774. if (!(!u || u == "error" && !i)) {
  10775. i.toLowerCase();
  10776. var a = co(u, e, i) ? "true" : "";
  10777. onGlobalEvent(JSON.stringify({
  10778. name: "msgbox",
  10779. type: u,
  10780. title: e,
  10781. text: i,
  10782. link: o != null ? o : "",
  10783. hasRetry: a
  10784. }))
  10785. }
  10786. }
  10787. function Un(u, e, i) {
  10788. onGlobalEvent(JSON.stringify({name: "toast", type: u, text: e, dur_msec: i}))
  10789. }
  10790. function qt(u) {
  10791. var e = {};
  10792. 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));
  10793. return e
  10794. }
  10795. function m(u, e) {
  10796. e = qt(e), e.name = u, onGlobalEvent(JSON.stringify(e))
  10797. }
  10798. function Ce() {
  10799. var e;
  10800. ((e = Fe("input-source")) != null ? e : Ji) === Ji ? Ko() : Ee()
  10801. }
  10802. function be(u, e) {
  10803. e = qt(e), e.name = u, onRegisteredEvent(JSON.stringify(e))
  10804. }
  10805. function pe(u, e) {
  10806. onRgba(u, e)
  10807. }
  10808. function we(u) {
  10809. window.curConn = u
  10810. }
  10811. function e0() {
  10812. return window.curConn
  10813. }
  10814. async function Kt() {
  10815. await curConn.start()
  10816. }
  10817. function Se() {
  10818. var u;
  10819. (u = e0()) == null || u.close(), we(void 0)
  10820. }
  10821. function Ht() {
  10822. var e;
  10823. (e = window.curConn) == null || e.close();
  10824. const u = new Wt;
  10825. return we(u), u
  10826. }
  10827. let q;
  10828. async function Jt() {
  10829. try {
  10830. q || (await T4.ready, q = T4)
  10831. } catch (u) {
  10832. console.error("Failed to init sodium: " + u.message)
  10833. }
  10834. }
  10835. function Gt() {
  10836. return q
  10837. }
  10838. async function rt(u, e) {
  10839. return await Jt(), typeof e == "string" && (e = Zt(e)), q.crypto_sign_open(u, e)
  10840. }
  10841. function Zt(u) {
  10842. return q.from_base64(u, q.base64_variants.ORIGINAL)
  10843. }
  10844. function Ln(u) {
  10845. return q.to_base64(u, q.base64_variants.ORIGINAL)
  10846. }
  10847. function Wn() {
  10848. const u = q.crypto_box_keypair(), e = u.privateKey, i = u.publicKey;
  10849. return [e, i]
  10850. }
  10851. function Vn() {
  10852. return q.crypto_secretbox_keygen()
  10853. }
  10854. function qn(u, e, i) {
  10855. const o = Uint8Array.from(Array(24).fill(0));
  10856. return q.crypto_box_easy(u, o, e, i)
  10857. }
  10858. function $4(u) {
  10859. for (var e = Array(24).fill(0), i = 0; i < e.length && u > 0; i++) {
  10860. var o = u & 255;
  10861. e[i] = o, u = (u - o) / 256
  10862. }
  10863. return Uint8Array.from(e)
  10864. }
  10865. function st(u, e, i) {
  10866. return q.crypto_secretbox_easy(u, $4(e), i)
  10867. }
  10868. function Kn(u, e, i) {
  10869. return q.crypto_secretbox_open_easy(u, $4(e), i)
  10870. }
  10871. window.setByName = (u, e) => {
  10872. switch (u) {
  10873. case"connect":
  10874. Ht(), Kt();
  10875. break;
  10876. case"login":
  10877. e = JSON.parse(e), curConn.handle_login_from_ui(e.os_username, e.os_password, e.password, e.remember);
  10878. break;
  10879. case"close":
  10880. Se();
  10881. break;
  10882. case"refresh":
  10883. curConn.refresh();
  10884. break;
  10885. case"reconnect":
  10886. curConn == null || curConn.reconnect();
  10887. break;
  10888. case"toggle_virtual_display":
  10889. curConn.toggleVirtualDisplay(e);
  10890. break;
  10891. case"toggle_privacy_mode":
  10892. curConn.togglePrivacyMode(e);
  10893. break;
  10894. case"image_quality":
  10895. curConn.setImageQuality(e);
  10896. break;
  10897. case"custom_image_quality":
  10898. curConn.setCustomImageQuality(e);
  10899. break;
  10900. case"custom-fps":
  10901. curConn.setCustomFps(e, !0);
  10902. break;
  10903. case"lock_screen":
  10904. curConn.lockScreen();
  10905. break;
  10906. case"ctrl_alt_del":
  10907. curConn.ctrlAltDel();
  10908. break;
  10909. case"switch_display":
  10910. curConn.switchDisplay(e);
  10911. break;
  10912. case"remove_peer":
  10913. Do(e);
  10914. break;
  10915. case"input_key":
  10916. 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");
  10917. break;
  10918. case"input_string":
  10919. curConn.inputString(e);
  10920. break;
  10921. case"flutter_key_event":
  10922. e = JSON.parse(e), Ho(curConn, e.usb_hid, e.down == "true", e.lock_modes);
  10923. break;
  10924. case"send_mouse":
  10925. Hn(e);
  10926. break;
  10927. case"send_2fa":
  10928. curConn == null || curConn.send2fa(e);
  10929. break;
  10930. case"option":
  10931. e = JSON.parse(e), A.setItem(e.name, e.value);
  10932. break;
  10933. case"options":
  10934. e = JSON.parse(e);
  10935. for (const [o, a] of Object.entries(a)) A.setItem(o, a);
  10936. break;
  10937. case"option:local": {
  10938. let o = JSON.parse(e);
  10939. if (o.name == 'access_token' && o.value) {
  10940. getServerConf(o.value)
  10941. }
  10942. gt(o.name, o.value), o.name === "input-source" && Ce(), o.name == "lang" && xo()
  10943. }
  10944. break;
  10945. case"option:flutter:local":
  10946. e = JSON.parse(e), Fo(e.name, e.value);
  10947. break;
  10948. case"option:flutter:peer":
  10949. e = JSON.parse(e), curConn.setFlutterUiOption(e.name, e.value);
  10950. break;
  10951. case"option:user:default":
  10952. ur(e);
  10953. break;
  10954. case"option:session":
  10955. e = JSON.parse(e), curConn.setOption(e.name, e.value);
  10956. break;
  10957. case"option:peer":
  10958. try {
  10959. e = JSON.parse(e), kt(e.id, e.name, e.value)
  10960. } catch (o) {
  10961. console.error('Failed to set peer option: "' + e + '", ' + o.message)
  10962. }
  10963. break;
  10964. case"option:toggle":
  10965. return curConn.toggleOption(e);
  10966. case"input_os_password":
  10967. curConn.inputOsPassword(e);
  10968. break;
  10969. case"session_add_sync":
  10970. return tr(e);
  10971. case"session_start":
  10972. ar();
  10973. break;
  10974. case"session_close":
  10975. or();
  10976. break;
  10977. case"elevate_direct":
  10978. curConn.elevateDirect();
  10979. break;
  10980. case"elevate_with_logon":
  10981. curConn.elevateWithLogon(e);
  10982. break;
  10983. case"peer_exists":
  10984. return !!Cu()[e];
  10985. case"restart":
  10986. curConn.restart();
  10987. break;
  10988. case"fav":
  10989. return A.setItem("fav", e);
  10990. case"query_onlines":
  10991. Pn(e);
  10992. break;
  10993. case"change_prefer_codec":
  10994. curConn.changePreferCodec(e);
  10995. break;
  10996. case"cursor":
  10997. Yn(e);
  10998. break;
  10999. case"enter_or_leave":
  11000. curConn == null || curConn.enterOrLeave(e);
  11001. break;
  11002. case"fullscreen":
  11003. e == "Y" ? rr() : sr();
  11004. break;
  11005. case"send_note":
  11006. const i = Yt("conn");
  11007. i && (curConn == null || curConn.sendNote(i, e));
  11008. break;
  11009. case"read_remote_dir":
  11010. curConn == null || curConn.readRemoteDir(e);
  11011. break;
  11012. case"send_files":
  11013. curConn == null || curConn.sendFiles(e);
  11014. break;
  11015. case"send_local_files":
  11016. curConn == null || curConn.sendLocalFiles(e);
  11017. break;
  11018. case"cancel_job":
  11019. curConn == null || curConn.cancelJob(e);
  11020. break;
  11021. case"remove_all_empty_dirs":
  11022. curConn == null || curConn.removeAllEmptyDirs(e);
  11023. break;
  11024. case"remove_file":
  11025. curConn == null || curConn.removeFile(e);
  11026. break;
  11027. case"create_dir":
  11028. curConn == null || curConn.createDir(e);
  11029. break;
  11030. case"rename_file":
  11031. curConn == null || curConn.renameFile(e);
  11032. break;
  11033. case"read_dir_to_remove_recursive":
  11034. curConn == null || curConn.readDirToRemoveRecursive(e);
  11035. break;
  11036. case"select_files":
  11037. curConn == null || curConn.seletFiles(e);
  11038. break;
  11039. case"confirm_override_file":
  11040. curConn == null || curConn.confirmOverrideFile(e);
  11041. break;
  11042. case"send_chat":
  11043. curConn == null || curConn.sendChat(e);
  11044. break;
  11045. case"load_ab":
  11046. dr();
  11047. break;
  11048. case"save_ab":
  11049. _o(e);
  11050. break;
  11051. case"clear_ab":
  11052. vo();
  11053. break;
  11054. case"load_group":
  11055. cr();
  11056. break;
  11057. case"save_group":
  11058. ko(e);
  11059. break;
  11060. case"clear_group":
  11061. ho();
  11062. break;
  11063. case"change_resolution":
  11064. curConn == null || curConn.changeResolution(e);
  11065. break;
  11066. case"selected_sid":
  11067. curConn == null || curConn.sendSelectedSessionId(e);
  11068. break
  11069. }
  11070. };
  11071. function Hn(u) {
  11072. if (!curConn) return;
  11073. let e = 0;
  11074. switch (u = JSON.parse(u), u.type) {
  11075. case"down":
  11076. e = to, setTimeout(() => {
  11077. Tt(curConn)
  11078. }, 100);
  11079. break;
  11080. case"up":
  11081. e = ao;
  11082. break;
  11083. case"wheel":
  11084. e = Zi;
  11085. break;
  11086. case"trackpad":
  11087. e = Qi;
  11088. break
  11089. }
  11090. switch (u.buttons) {
  11091. case"left":
  11092. e |= y4 << 3;
  11093. break;
  11094. case"right":
  11095. e |= b4 << 3;
  11096. break;
  11097. case"wheel":
  11098. e |= oo << 3;
  11099. break;
  11100. case"back":
  11101. e |= no << 3;
  11102. break;
  11103. case"forward":
  11104. e |= ro << 3;
  11105. break
  11106. }
  11107. let i = parseInt(u.x || "0"), o = parseInt(u.y || "0");
  11108. (e == Zi || e == Qi) && curConn.getOption("reverse_mouse_wheel") == "Y" && (i = -i, o = -o);
  11109. const a = (e & y4 << 3) > 0 ? 1 : 0, t = (e & b4 << 3) > 0 ? 1 : 0;
  11110. a ^ t && curConn.getToggleOption("swap-left-right-mouse") && (a ? e = e & ~(y4 << 3) | b4 << 3 : e = e & ~(b4 << 3) | y4 << 3), curConn.inputMouse(e, i, o, u.alt == "true", u.ctrl == "true", u.shift == "true", u.command == "true")
  11111. }
  11112. window.getByName = (u, e) => {
  11113. let i = Jn(u, e);
  11114. return typeof i == "string" || i instanceof String ? i : i == null || i == null ? "" : JSON.stringify(i)
  11115. };
  11116. function Jn(u, e) {
  11117. var o, a, t, s;
  11118. switch (u) {
  11119. case"remember":
  11120. return curConn.getRemember();
  11121. case"option":
  11122. return A.getItem(e);
  11123. case"options":
  11124. const l = ["custom-rendezvous-server", "relay-server", "api-server", "key"], E = {};
  11125. return l.forEach(C => {
  11126. const D = A.getItem(C);
  11127. D && (E[C] = D)
  11128. }), JSON.stringify(E);
  11129. case"option:local":
  11130. const res = Fe(e) || ""
  11131. if (e == 'access_token' && res) {
  11132. getServerConf(res)
  11133. }
  11134. return res;
  11135. case"option:flutter:local":
  11136. return Ao(e) || "";
  11137. case"option:flutter:peer":
  11138. return curConn.getFlutterUiOption(e) || "";
  11139. case"image_quality":
  11140. return curConn.getImageQuality();
  11141. case"translate":
  11142. return e = JSON.parse(e), yo(e.locale, e.text);
  11143. case"option:user:default":
  11144. return u0(e);
  11145. case"option:session":
  11146. return curConn ? curConn.getOption(e) : u0(e);
  11147. case"option:peer":
  11148. try {
  11149. const C = JSON.parse(e);
  11150. return (o = mo(C.id, C.name)) != null ? o : u0(C.name)
  11151. } catch (C) {
  11152. return console.error('Failed to get peer option: "' + e + '", ' + C.message), ""
  11153. }
  11154. case"option:toggle":
  11155. return curConn == null ? void 0 : curConn.getToggleOption(e);
  11156. case"get_conn_status":
  11157. return curConn ? curConn.getStatus() : JSON.stringify({status_num: 0});
  11158. case"test_if_valid_server":
  11159. break;
  11160. case"version":
  11161. return se;
  11162. case"load_recent_peers":
  11163. er();
  11164. break;
  11165. case"load_fav_peers":
  11166. ir();
  11167. break;
  11168. case"fav":
  11169. return (a = A.getItem("fav")) != null ? a : "[]";
  11170. case"load_recent_peers_sync":
  11171. return JSON.stringify({peers: JSON.stringify(Pe())});
  11172. case"api_server":
  11173. return Xt();
  11174. case"is_using_public_server":
  11175. return !A.getItem("custom-rendezvous-server");
  11176. case"get_version_number":
  11177. return Q(e);
  11178. case"audit_server":
  11179. return Yt(e);
  11180. case"alternative_codecs":
  11181. return curConn.getAlternativeCodecs();
  11182. case"screen_info":
  11183. return JSON.stringify({
  11184. frame: {
  11185. l: window.screenX,
  11186. t: window.screenY,
  11187. r: window.screenX + window.innerWidth,
  11188. b: window.screenY + window.innerHeight
  11189. },
  11190. visibleFrame: {
  11191. l: window.screen.availLeft,
  11192. t: window.screen.availTop,
  11193. r: window.screen.availLeft + window.screen.availWidth,
  11194. b: window.screen.availTop + window.screen.availHeight
  11195. },
  11196. scaleFactor: window.devicePixelRatio
  11197. });
  11198. case"main_display":
  11199. return JSON.stringify({
  11200. w: window.screen.availWidth,
  11201. h: window.screen.availHeight,
  11202. scaleFactor: window.devicePixelRatio
  11203. });
  11204. case"langs":
  11205. var i = Object.entries(Eo).map(([C, D]) => [C, `${D} (${C})`]);
  11206. return i.sort((C, D) => C[0].localeCompare(D[0])), JSON.stringify(i);
  11207. case"build_date":
  11208. return po;
  11209. case"my_id":
  11210. return O4();
  11211. case"my_name":
  11212. return wt();
  11213. case"uuid":
  11214. return St();
  11215. case"local_os":
  11216. return zt();
  11217. case"peer_has_password":
  11218. return ((t = (Cu()[e] || {}).password) != null ? t : "") !== "";
  11219. case"fullscreen":
  11220. return lr() ? "Y" : "N";
  11221. case"platform":
  11222. return curConn.getPlatform();
  11223. case"enable_trusted_devices":
  11224. return (s = curConn == null ? void 0 : curConn.enableTrustedDevices()) != null && s ? "Y" : "N"
  11225. }
  11226. return ""
  11227. }
  11228. let ze = new Worker("./libopus.js?v=02816afa"), Qt;
  11229. function Gn(u, e) {
  11230. Qt = Qn(u, e), ze.postMessage({channels: u, sampleRate: e})
  11231. }
  11232. function Zn(u) {
  11233. ze.postMessage(u, [u.buffer])
  11234. }
  11235. window.init = async () => {
  11236. try {
  11237. ze.onmessage = u => {
  11238. Qt.feed(u.data)
  11239. }, await Jt(), await zo(), await Pa(), await N.init(), console.log("init done"), onInitFinished(), await On()
  11240. } catch (u) {
  11241. console.error("Failed to init: " + u.message), onInitFinished()
  11242. }
  11243. };
  11244. window.onunload = () => {
  11245. console.log("window close"), Ia()
  11246. };
  11247. function Qn(u, e) {
  11248. return new ra({channels: u, sampleRate: e, flushingTime: 2e3})
  11249. }
  11250. function Xn(u) {
  11251. if (window.clipboardData && window.clipboardData.setData) return window.clipboardData.setData("Text", u);
  11252. if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
  11253. var e = document.createElement("textarea");
  11254. e.textContent = u, e.style.position = "fixed", document.body.appendChild(e), e.select();
  11255. try {
  11256. return document.execCommand("copy")
  11257. } catch (i) {
  11258. console.warn("Copy to clipboard failed.", i)
  11259. } finally {
  11260. document.body.removeChild(e)
  11261. }
  11262. }
  11263. }
  11264. function Q(u) {
  11265. try {
  11266. let e = u.split("-"), i = 0;
  11267. if (e.length > 0) {
  11268. let o = 0;
  11269. for (let a of e[0].split(".")) o = parseInt(a) || 0, i = i * 1e3 + o;
  11270. i -= o, i += o * 10
  11271. }
  11272. return e.length > 1 && (i += parseInt(e[1]) || 0), i
  11273. } catch (e) {
  11274. return console.error('Failed to parse version number: "' + u + '" ' + e.message), 0
  11275. }
  11276. }
  11277. function Yn(u) {
  11278. let e = "auto";
  11279. if (u != "auto") try {
  11280. const t = JSON.parse(u);
  11281. if (!t.url) return;
  11282. e = `url(${t.url}) ${t.hotx} ${t.hoty}, auto`
  11283. } catch (t) {
  11284. console.error("Failed to set custom cursor: " + t.message);
  11285. return
  11286. }
  11287. for (var i = document.body, o = 0; o < i.children.length; o++) {
  11288. var a = i.children[o];
  11289. a.tagName == "FLUTTER-VIEW" && (a.style.cursor = e)
  11290. }
  11291. }
  11292. async function $n() {
  11293. await T4.ready;
  11294. const u = T4.crypto_sign_keypair();
  11295. return {publicKey: u.publicKey, privateKey: u.privateKey}
  11296. }
  11297. function ur(u) {
  11298. try {
  11299. const e = JSON.parse(u), i = JSON.parse(A.getItem("user-default-options")) || {};
  11300. i[e.name] = e.value, A.setItem("user-default-options", JSON.stringify(i))
  11301. } catch (e) {
  11302. console.error("Failed to set user default options: " + e.message)
  11303. }
  11304. }
  11305. function u0(u) {
  11306. var i, o, a;
  11307. const e = {
  11308. view_style: "original",
  11309. scroll_style: "scrollauto",
  11310. image_quality: "balanced",
  11311. "codec-preference": "auto",
  11312. custom_image_quality: "50",
  11313. "custom-fps": "30"
  11314. };
  11315. try {
  11316. return (o = (i = (JSON.parse(A.getItem("user-default-options")) || {})[u]) != null ? i : e[u]) != null ? o : ""
  11317. } catch (t) {
  11318. return console.error("Failed to get user default options: " + t.message), (a = e[u]) != null ? a : ""
  11319. }
  11320. }
  11321. function Pe() {
  11322. const u = [];
  11323. for (const [e, i] of Object.entries(Cu())) {
  11324. if (!e) continue;
  11325. const o = i.tm, a = i.info, t = {
  11326. id: e,
  11327. username: a.username || "",
  11328. hostname: a.hostname || "",
  11329. platform: a.platform || "",
  11330. alias: i.alias || ""
  11331. };
  11332. !o || !t || u.push([o, e, t])
  11333. }
  11334. return u.sort().reverse().map(e => e[2])
  11335. }
  11336. function er() {
  11337. const u = Pe();
  11338. u && be("load_recent_peers", {peers: JSON.stringify(u)})
  11339. }
  11340. function ir() {
  11341. var u;
  11342. try {
  11343. const e = (u = A.getItem("fav")) != null ? u : "[]", i = JSON.parse(e),
  11344. o = Pe().filter(a => i.includes(a.id));
  11345. o && be("load_fav_peers", {peers: JSON.stringify(o)})
  11346. } catch (e) {
  11347. console.error("Failed to load fav peers: " + e.message)
  11348. }
  11349. }
  11350. function tr(u) {
  11351. var e;
  11352. try {
  11353. const i = JSON.parse(u), o = i.id;
  11354. if (o) {
  11355. (e = window.curConn) == null || e.close();
  11356. const a = new Wt;
  11357. return a.setRemoteId(o), a.setSessionInfo(i), we(a), gt("last_remote_id", o), ""
  11358. } else return "No id found in session data " + u
  11359. } catch (i) {
  11360. return i.message
  11361. }
  11362. }
  11363. function ar(u) {
  11364. try {
  11365. if (!e0()) return;
  11366. Kt()
  11367. } catch (e) {
  11368. Vt("error", "Error", e.message, "")
  11369. }
  11370. }
  11371. function or(u) {
  11372. Se()
  11373. }
  11374. function nr(u, e) {
  11375. function i(o) {
  11376. return /^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$/.test(o)
  11377. }
  11378. if (i(u)) {
  11379. if (u.startsWith("[")) {
  11380. let o = u.split("]:");
  11381. if (o.length === 2) {
  11382. let a = parseInt(o[1]) || 0;
  11383. if (a > 0) return `${o[0]}]:${a + e}`
  11384. }
  11385. }
  11386. } else if (u.includes(":")) {
  11387. let o = u.split(":");
  11388. if (o.length === 2) {
  11389. let a = parseInt(o[1]) || 0;
  11390. if (a > 0) return `${o[0]}:${a + e}`
  11391. }
  11392. }
  11393. return u
  11394. }
  11395. function Xt() {
  11396. const u = A.getItem("api-server");
  11397. if (u) return u;
  11398. const e = A.getItem("custom-rendezvous-server");
  11399. if (e) {
  11400. let i = nr(e, -2);
  11401. return i == e ? `http://${i}:${Ut - 2}` : `http://${i}`
  11402. }
  11403. return "https://admin.rustdesk.com"
  11404. }
  11405. function Yt(u) {
  11406. if (!Pt()) return "";
  11407. const e = Xt();
  11408. return !e || e.includes("rustdesk.com") ? "" : e + "/api/audit/" + u
  11409. }
  11410. function $t(u, e, i) {
  11411. try {
  11412. Z4.exports.ZstdCodec.run(a => {
  11413. var t = new a.Simple;
  11414. i(e ? u.map(s => t.compress(s, 3)) : t.compress(u, 3))
  11415. })
  11416. } catch (o) {
  11417. console.error("Compress failed: ", o)
  11418. }
  11419. }
  11420. function Re(u, e, i) {
  11421. try {
  11422. Z4.exports.ZstdCodec.run(o => {
  11423. var a = new o.Simple;
  11424. i(e ? u.map(t => a.decompress(t)) : a.decompress(u))
  11425. })
  11426. } catch (o) {
  11427. console.error("Decompress failed: ", o)
  11428. }
  11429. }
  11430. async function ua(u, e) {
  11431. return new Promise((i, o) => {
  11432. try {
  11433. Z4.exports.ZstdCodec.run(a => {
  11434. var t = new a.Simple;
  11435. i(t.compress(u, 3))
  11436. })
  11437. } catch (a) {
  11438. o(a)
  11439. }
  11440. })
  11441. }
  11442. async function ea(u, e) {
  11443. return new Promise((i, o) => {
  11444. try {
  11445. Z4.exports.ZstdCodec.run(a => {
  11446. var t = new a.Simple;
  11447. i(t.decompress(u))
  11448. })
  11449. } catch (a) {
  11450. o(a)
  11451. }
  11452. })
  11453. }
  11454. function rr() {
  11455. const u = document.documentElement;
  11456. u.requestFullscreen ? u.requestFullscreen() : u.mozRequestFullScreen ? u.mozRequestFullScreen() : u.webkitRequestFullscreen ? u.webkitRequestFullscreen() : u.msRequestFullscreen && u.msRequestFullscreen()
  11457. }
  11458. function sr() {
  11459. document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen()
  11460. }
  11461. function lr() {
  11462. return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  11463. }
  11464. var lt = !1;
  11465. function Er() {
  11466. lt || (console.log("listen fullscreen"), lt = !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)))
  11467. }
  11468. Er();
  11469. async function dr() {
  11470. try {
  11471. let u = await xt();
  11472. onLoadAbFinished(JSON.stringify(u))
  11473. } catch (u) {
  11474. console.error("Failed to load ab: " + u.message), onLoadAbFinished("")
  11475. }
  11476. }
  11477. async function cr() {
  11478. try {
  11479. let u = await go();
  11480. onLoadGroupFinished(JSON.stringify(u))
  11481. } catch (u) {
  11482. console.error("Failed to load group: " + u.message), onLoadGroupFinished("")
  11483. }
  11484. }
  11485. const Et = document.querySelector("#app");
  11486. if (Et) {
  11487. let e = function (i, o, a) {
  11488. !e0() || (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"))
  11489. };
  11490. Et.innerHTML = `
  11491. <div id="connect" style="text-align: center"><table style="display: inline-block">
  11492. <tr><td><span>Host: </span></td><td><input id="host" /></td></tr>
  11493. <tr><td><span>Key: </span></td><td><input id="key" /></td></tr>
  11494. <tr><td><span>Id: </span></td><td><input id="id" /></td></tr>
  11495. <tr><td></td><td><button onclick="connect();">Connect</button></td></tr>
  11496. </table></div>
  11497. <div id="password" style="display: none;">
  11498. <input type="password" id="password" />
  11499. <button id="confirm" onclick="confirm()">Confirm</button>
  11500. <button id="cancel" onclick="cancel();">Cancel</button>
  11501. </div>
  11502. <div id="status" style="display: none;">
  11503. <div id="text" style="line-height: 2em"></div>
  11504. <button id="cancel" onclick="cancel();">Cancel</button>
  11505. </div>
  11506. <div id="canvas" style="display: none;">
  11507. <button id="cancel" onclick="cancel();">Cancel</button>
  11508. <canvas id="player"></canvas>
  11509. <canvas id="test-yuv-decoder-canvas"></canvas>
  11510. </div>
  11511. `;
  11512. let u;
  11513. window.init(), document.body.onload = () => {
  11514. const i = document.querySelector("#host");
  11515. i.value = A.getItem("custom-rendezvous-server");
  11516. const o = document.querySelector("#id");
  11517. o.value = A.getItem("id");
  11518. const a = document.querySelector("#key");
  11519. a.value = A.getItem("key"), u = YUVCanvas.attach(document.getElementById("player"))
  11520. }, window.connect = () => {
  11521. const i = document.querySelector("#host");
  11522. A.setItem("custom-rendezvous-server", i.value);
  11523. const o = document.querySelector("#id");
  11524. A.setItem("id", o.value);
  11525. const a = document.querySelector("#key");
  11526. A.setItem("key", a.value), (async () => {
  11527. const s = Ht();
  11528. s.setMsgbox(e), s.setDraw(l => {
  11529. pe(l), u.drawFrame(l)
  11530. }), 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()
  11531. })()
  11532. }, window.cancel = () => {
  11533. Se(), 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"
  11534. }, window.confirm = () => {
  11535. const i = document.querySelector("input#password").value;
  11536. i && (document.querySelector("div#password").style.display = "none", e0().login(i))
  11537. }
  11538. }