azot 5.0.0-alpha.32 → 5.0.0-alpha.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/azot.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const iA=b;(function(hI,hJ){const iy=b,hK=hI();while(!![]){try{const hL=parseInt(iy(0x98))/0x1*(-parseInt(iy(0x13f))/0x2)+-parseInt(iy(0x14a))/0x3*(parseInt(iy(0x12e))/0x4)+parseInt(iy(0x88))/0x5*(parseInt(iy(0x9e))/0x6)+-parseInt(iy(0x153))/0x7*(parseInt(iy(0x15f))/0x8)+-parseInt(iy(0x117))/0x9*(parseInt(iy(0x182))/0xa)+parseInt(iy(0x1e6))/0xb*(parseInt(iy(0xe5))/0xc)+-parseInt(iy(0x11e))/0xd*(-parseInt(iy(0x1db))/0xe);if(hL===hJ)break;else hK['push'](hK['shift']());}catch(hM){hK['push'](hK['shift']());}}}(a,0xd7a4c));import{A as c,C as d,D as f,E as g,F as h,I as i,L as j,M as k,N as l,O as m,P as n,S as o,T as p,_ as q,a as r,b as s,c as t,d as u,f as v,g as w,h as x,i as y,j as A,k as B,l as C,m as D,n as E,o as F,p as G,r as H,s as I,t as J,u as K,v as L,w as M,x as N,y as O}from'./context-CGHvgOH1.mjs';import{createRequire}from'node:module';import P,{constants,existsSync,readFileSync,readdirSync,rmSync,statSync,writeFileSync}from'node:fs';import*as Q from'node:path';import R,{basename,dirname,extname,isAbsolute,join,parse,relative,resolve}from'node:path';import S from'yargs';import'urlpattern-polyfill';import T from'picocolors';import*as U from'node:fs/promises';import V,{open,readFile,readdir,rm,stat}from'node:fs/promises';import W,{platform,stdout}from'node:process';import{hideBin}from'yargs/helpers';import{EventEmitter as X}from'node:events';import{z}from'zod';import{ALL_FORMATS,DASH,HLS,Input,UrlSource,desc,prefer}from'dasha';import{ALL_FORMATS as Y,EncodedAudioPacketSource,EncodedPacketSink,EncodedVideoPacketSource,Input as Z,MkvOutputFormat,Mp3OutputFormat,Mp4OutputFormat,Output,StreamSource,StreamTarget,TextSubtitleSource}from'mediabunny';import a0 from'ky';import{Agent,ProxyAgent}from'undici';import{checkbox,confirm}from'@inquirer/prompts';import{execFileSync}from'node:child_process';import{createAuthClient}from'better-auth/client';import{deviceAuthorizationClient}from'better-auth/client/plugins';import{tributeClient}from'@tribute-tg/better-auth';import{QueryCache,QueryClient}from'@tanstack/query-core';import{createHash}from'node:crypto';import{inspect}from'node:util';import{RemoteCdm,requestMediaKeySystemAccess}from'okova';import{Decryption,FilePathSource,FilePathTarget,Input as a1,Output as a2}from'shifro';import{convert}from'@transcrobes/subs-convert';import{isatty}from'node:tty';import{createSpinner}from'nanospinner';import{finished,pipeline}from'node:stream/promises';function a(){const nF=['ECONNRESET','DASH','entry-resolved','12VKFBiY','codec','key','utf8','loadExtension','default','maxRetries','https://m.weibo.cn/statuses/show?id=','Video\x20color\x20range\x20-\x20sdr\x20|\x20hlg\x20|\x20hdr10\x20|\x20hdr10+\x20|\x20dv,\x20defaults\x20to\x20sdr','14xTMdRq','Could\x20not\x20resolve\x20Bilibili\x20TV\x20streams','truncate','dark','access_token','pop','path','kind','{title}\x20({quality},\x20{codec})','manager','CH\x20|\x20','match','416312NvuAOw','transcodings','http','https://virtualroom.ru/','bin','downloaded','object','content','m3u8','from','X\x20/\x20Twitter','Logout\x20from\x20extension\x20(or\x20if\x20no\x20extension\x20is\x20specified,\x20logout\x20from\x20Azot\x20account)','extensions','prompt','permissions','getEntries','https://on.soundcloud.com','url','error','input','application/json','subscribe','blue','has','pkg','paused','running','endsWith','getNumberOfChannels','http2','fetch','dash','full_text','request','map','102110vKOxsk','mkdir','customMuxFormat','Select\x20subtitles','Azot','trunc','bilibili.tv','MP4','Download\x20workflow\x20failure','requestInit','/:id{/}?','episode-template','percent','prepareDownloadResource','exec','matches','regions','audio-channels','bind','secrets','header','command','getDisplayHeight','.ts','import','logout','join','clear','assign','follow','uncaughtException','sha256','current','clone','processing','assets','DRM_FREE_TIER_RATE_LIMIT','javascript-obfuscator','then','catch','server','getRecord','trustExplicitKey','href','getObfuscatedCode','warn','cookie','vtt','stat','startsWith','canBePairedWith','location','array','media','source','close','confirm','context','keyId','addSubtitleTrack','state.json','EXTENSION_INSTALL_IMPORT_INVALID','progress','skipMux','tasks','*/*','mp4Streams','P-256','killAndDrain','document','No\x20media\x20entry\x20found','createTask','slice','The\x20operation\x20was\x20aborted','saveInfo','isArray','0.0.2','text','seasonNumber','dim','Extension\x20main\x20script\x20not\x20found:\x20','2160','Could\x20not\x20resolve\x20NTV\x20media\x20URL.','pathname','stopLog','episodeNumber','test','retry','Incompatible\x20extension\x20interface','28PwvuPp','getItem','utils','createState','format','version','queued','hd_video','filter','connections','buffer','1903gzetUZ','\x20Segments','features','base64','push','info','resolveKeys','keys','(()\x20=>\x20{','trimEnd','padEnd','size','delete','find','https://api.bilibili.tv/intl/gateway/web/v2/ogv/play/episodes','Missing\x20audio\x20track\x20in\x20','probe','480','DASH_FORMATS','username','completed','\x20|\x20','getSegments','enabled','ALL_FORMATS','analyze','invalidateQueries','https://twitter.com/*','streams','&page=1&page_size=15','log','floor','beta','split','kid','stringify','cancellationReason','lastIndex','title','cwd','emit','video_website','exclude','HLS_FORMATS','Could\x20not\x20resolve\x20Twitter/X\x20media','totalBytesEstimated','customIcon','name','retrying','Invalid\x20settings\x20update:','execute','green','vk.ts','https://*.weibo.cn/*','threeDevices','UrlSource','bilibili.ts',',\x20stage=','Invalid\x20trim\x20timestamp:\x20','fetchQuery','boolean','pathPrefixes','\x20KiB/s','total','failed','callback','HLS','saturated','ave','https://mv1.virtualroom.ru/vr/player/records/','videoQuality','parse','&lt;','sig','signal','und','option','remove-with-file','status','state','defineExtension','/embed/captioned/','https://azot.mov/','hooks','start','videoContainerFormat','write','parts','productTitle','host','update','target','7866025gjOnLI','binariesDir','set','getExtension','release','https://*.ok.ru/*','node','alias','https://bilibili.com/*','toLowerCase','forced','cookieStore','artifactMetadata','list-remote','loadCoreExtensions','pause','65RvRgHX','CustomPathedSource','settings','analyzing','Extension\x20source\x20not\x20found:\x20','https://*.bilibili.com/*','6ajpusW','headers','otp','red','config','dir','videos','getQueryState','playready','Request\x20timeout','Input','azot-desktop','subtitles','video-hostings','speed','entries','cors','template','tag','auth','type','estimatedTotalBytes','length','json','36b89d2507fce29e5ca551df756d27c1cfe079e2609642b4390aa4c35796eb11','trim','data','URL:\x20','Legacy\x20extension\x20did\x20not\x20provide\x20a\x20DRM\x20license\x20server','output','Resume\x20queued\x20until\x20stop\x20completes:\x20','findLast','remove','EXTENSION_INSTALL_UNSUPPORTED_PACKAGE_TYPE','TweetWithVisibilityResults','averageTotal','240','interactive','record','skipSubtitles','is_active_live','artifacts','matchAnyHost','unshift','init','infoList','payload','records','wap','values','replaceAll','finalName','Logged\x20out\x20from\x20extension\x20','\x20video\x20tracks','pssh','inherit','onDidAnyChange','value',':volatile','oneVideoStreams','alert','hex','searchParams','Unsupported\x20extension\x20interface:\x20','widevine','fastqueue\x20concurrency\x20must\x20be\x20equal\x20to\x20or\x20greater\x20than\x201','manifest:','No\x20audio\x20packets\x20found\x20in\x20','/releases','origin','minify','38268JXtuGn','SIGNATURE_VERIFICATION_FAILED','audio','stack','reset','system','drm','resource','get','mbps','pairableWithPrimaryVideo','indexPath','icon','live_streams','sleep','options','allow_audio_only','toFixed','session.json','Invalid\x20extensions\x20index\x20path\x20repaired:\x20','code','tempFileDir','progressMetadata','PSSH:\x20','package.json','auxWriter','debug','localStorage','slow_down','Password','resolvedUrl','bps','message','ask','AbortError','createdAt','__typename','resolveEntry','accessToken','browser_download_url','https://gitlab.com/api/v4/projects/','login','mp3','instagram.ts','platform','CLI\x20error','resumeState','strategy','video','round','1233lrVgKg','user','resume','window','splash','resolve','IMPORT_INVALID','12777011NUHqzP','vitalygashkov@vk.com','track','call','toString','Login\x20cancelled','min','indexOf','clip','exports','Decrypting\x20via\x20shifro:\x20','function','https://github.com/vitalygashkov','filePath','Free\x20DRM\x20usage\x20is\x20limited\x20to\x20one\x20successful\x20key\x20retrieval\x20every\x2024\x20hours.','includes','21420lAwnfA','language','reason','Extension\x20','string','replace','success','alac','outputPath','entry','MP3','initSegment','Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36','The\x20device\x20code\x20has\x20expired.\x20Please\x20try\x20again.','promise','sha1','fromCache','51782uTwFav','notify','columns','legacy','writeFile','symbols','Failed\x20to\x20save\x20data\x20to\x20file:\x20','add'];a=function(){return nF;};return a();}import{Readable,Transform}from'node:stream';import a3 from'open';var a4=Object['create'],a5=Object['defineProperty'],a6=Object['getOwnPropertyDescriptor'],a7=Object['getOwnPropertyNames'],a8=Object['getPrototypeOf'],a9=Object['prototype']['hasOwnProperty'],aa=(hI,hJ)=>()=>(hJ||(hI((hJ={'exports':{}})['exports'],hJ),hI=null),hJ['exports']),ab=(hI,hJ,hK,hL)=>{const iz=b;if(hJ&&typeof hJ=='object'||typeof hJ=='function'){for(var hM=a7(hJ),hN=0x0,hO=hM[iz(0xb4)],hP;hN<hO;hN++)hP=hM[hN],!a9[iz(0x121)](hI,hP)&&hP!==hK&&a5(hI,hP,{'get':(hQ=>hJ[hQ])[iz(0x194)](null,hP),'enumerable':!(hL=a6(hJ,hP))||hL['enumerable']});}return hI;},ac=(hI,hJ,hK)=>(hK=hI==null?{}:a4(a8(hI)),ab(hJ||!hI||!hI['__esModule']?a5(hK,iA(0x14f),{'value':hI,'enumerable':!0x0}):hK,hI)),ad=createRequire(import.meta.url);const ae=()=>{let hI=[];process['resourcesPath']&&hI['push'](join(process['resourcesPath'],'bin','winconsole.node'));let hJ=join(__dirname,'..','..','..');return hI['push'](join(hJ,'assets','bin','win32','winconsole.node')),hI['push'](join(hJ,'native','winconsole','build','Release','winconsole.node')),hI['find'](hK=>existsSync(hK))||null;},af=()=>{const iB=iA;if(process[iB(0x111)]!=='win32')return null;let hI=ae();if(!hI)return null;try{return ad(hI);}catch{return null;}};if(process['platform']==='win32'&&process.env.ELECTRON_RUN_AS_NODE==='1'){let hR=af();hR&&(hR['attachParentConsole']?.(),hR['enableUtf8']?.());}const ag='2',ah=join(x,'.paths-migrated'),ai=join(M,iA(0x16b)),aj=(hI,hJ)=>hI===hJ,ak=async hI=>{try{return await V['access'](hI),!0x0;}catch(hJ){if(hJ['code']==='ENOENT')return!0x1;throw hJ;}},al=hI=>{const iC=iA;let hJ=JSON['parse'](hI),hK=join(d,'bin'),hL=join(d,'drm');return hJ['binariesDir']===hK&&(hJ['binariesDir']=join(G,iC(0x163))),hJ['drmDir']===hL&&(hJ['drmDir']=join(G,'drm')),JSON[iC(0x209)](hJ,null,0x2);},am=hI=>{if(hI===ai)return s;let hJ=relative(ai,hI);return!hJ||hJ['startsWith']('..')||isAbsolute(hJ)?hI:join(s,hJ);},an=hI=>{const iD=iA;let hJ=JSON['parse'](hI),hK=!0x1;for(let hL of hJ){if(!hL||typeof hL!='object'||Array['isArray'](hL))continue;let hM=hL;for(let hN of['source','dir','path']){if(typeof hM[hN]!='string')continue;let hO=am(hM[hN]);hO!==hM[hN]&&(hM[hN]=hO,hK=!0x0);}if(hM['package']&&typeof hM['package']=='object'&&!Array['isArray'](hM['package'])){let hP=hM['package'];if(typeof hP[iD(0xa3)]=='string'){let hQ=am(hP['dir']);hQ!==hP['dir']&&(hP['dir']=hQ,hK=!0x0);}}}return{'data':hK?JSON['stringify'](hJ,null,0x2):hI,'hasChanges':hK};},ao=async()=>{if(!await ak(N))return;let hI=an(await V['readFile'](N,'utf8'));hI['hasChanges']&&await V['writeFile'](N,hI['data'],'utf8');},ap=async({from:hI,to:hJ,transform:hK})=>{if(aj(hI,hJ)||!await ak(hI)||await ak(hJ))return;await V['mkdir'](dirname(hJ),{'recursive':!0x0});let hL=await V['readFile'](hI,'utf8'),hM=hL;if(hK)try{hM=hK(hL);}catch{hM=hL;}await V['writeFile'](hJ,hM,'utf8');},aq=async(hI,hJ)=>{if(aj(hI,hJ)||!await ak(hI))return;await V['mkdir'](hJ,{'recursive':!0x0});let hK=await V['readdir'](hI,{'withFileTypes':!0x0});for(let hL of hK){let hM=join(hI,hL['name']),hN=join(hJ,hL['name']);if(hL['isDirectory']()&&await ak(hN)){await aq(hM,hN);continue;}await ak(hN)||await V['cp'](hM,hN,{'recursive':!0x0});}},ar=[{'from':join(d,basename(f)),'to':f,'transform':al},{'from':join(d,iA(0x1be)),'to':join(G,'state.json')},{'from':join(d,'downloads.json'),'to':join(G,'downloads.json')},{'from':join(M,iA(0xf7)),'to':join(x,'session.json')},{'from':join(ai,'index.json'),'to':N,'transform':hI=>an(hI)['data']}],as=[{'from':ai,'to':s},{'from':join(d,'bin'),'to':join(G,'bin')},{'from':join(d,'drm'),'to':join(G,'drm')},{'from':p,'to':w},{'from':g,'to':q}],at=async()=>{const iE=iA;if(await V['readFile'](ah,'utf8')['catch'](()=>null)===ag)return;let hI=!0x1;for(let hJ of ar)try{await ap(hJ);}catch{hI=!0x0;}for(let hK of as)try{await aq(hK['from'],hK['to']);}catch{hI=!0x0;}try{await ao();}catch{hI=!0x0;}hI||await V['writeFile'](ah,ag,iE(0x14d));},au=(hI=process['argv'],hJ=process.env)=>hJ['ELECTRON_RUN_AS_NODE']==='1'?hI[iA(0x1ca)](0x2):hideBin(hI),av=new Set();let aw;const ax=hI=>(av['add'](hI),()=>{const iF=iA;av[iF(0x1f2)](hI);}),ay=async()=>{if(aw){await aw;return;}aw=Promise['all']([...av]['map'](hI=>Promise['resolve'](hI())['catch'](()=>void 0x0)))['then'](()=>void 0x0)['finally'](()=>{aw=void 0x0;}),await aw;},az={'target':'node','compact':!0x0,'identifierNamesGenerator':'mangled','renameGlobals':!0x0,'simplify':!0x0,'controlFlowFlattening':!0x1,'deadCodeInjection':!0x1,'debugProtection':!0x1,'numbersToExpressions':!0x1,'selfDefending':!0x1,'splitStrings':!0x1,'stringArray':!0x0,'stringArrayCallsTransform':!0x1,'stringArrayEncoding':[],'stringArrayIndexShift':!0x0,'stringArrayRotate':!0x0,'stringArrayShuffle':!0x0,'stringArrayWrappersCount':0x1,'stringArrayWrappersChainedCalls':!0x0,'stringArrayWrappersType':'variable','stringArrayThreshold':0.1,'transformObjectKeys':!0x1,'unicodeEscapeSequence':!0x1},aA=hI=>{let hJ=['B','KB','MB','GB'],hK=hI,hL=0x0;for(;hK>=0x400&&hL<hJ['length']-0x1;)hK/=0x400,hL+=0x1;return hK['toFixed'](hL===0x0?0x0:0x2)+'\x20'+hJ[hL];},aB=async(hI,hJ)=>{const iG=iA;let hK=readFileSync(hI,'utf8'),{default:hL}=await import(iG(0x1a7));console['log']('Obfuscating\x20'+hI+'...'),console['time']('Obfuscation\x20finished');let hM=hL['obfuscate'](hK,az);console['timeEnd']('Obfuscation\x20finished');let hN=hM[iG(0x1ae)](),hO=Buffer['byteLength'](hK,'utf8'),hP=Buffer['byteLength'](hN,'utf8'),hQ=hO===0x0?0x0:hP/hO;return console['log']('Size\x20changed\x20from\x20'+aA(hO)+'\x20to\x20'+aA(hP)+',\x20'+hQ['toFixed'](0x2)+'x\x20increase'),writeFileSync(hJ||hI,hN),hN;},aC=new Set([iA(0x199),'.js','.cjs','.mjs']),aD=new Set(['index','main']),aE=hI=>{const iH=iA;if(existsSync(hI))try{if(!statSync(hI)['isDirectory']())return;let hJ=readdirSync(hI)[iH(0x1e3)](hM=>!hM['endsWith']('.d.ts'))['filter'](hM=>aC['has'](R['extname'](hM))),hK=hM=>R['basename'](hM,R['extname'](hM)),hL=hJ['find'](hM=>aD['has'](hK(hM)))||hJ[0x0];return hL?R['join'](hI,hL):void 0x0;}catch{return;}},aF=()=>{const iI=iA;let hI=[process['cwd'](),R['join'](process['cwd'](),'src'),R['join'](process[iI(0x20d)](),'lib')];for(let hJ of hI){let hK=aE(hJ);if(hK)return hK;}},aG=hI=>hI==='esm'?'mjs':'cjs',aH=(hI,hJ)=>R[iA(0x19c)](process['cwd'](),'dist',R['parse'](hI)['name']+'.'+aG(hJ)),aI=hI=>{const iJ=iA;let hJ=R['relative'](process[iJ(0x20d)](),hI);if(!hJ||hJ['startsWith']('..'))throw Error('Entry\x20file\x20must\x20be\x20inside\x20the\x20current\x20working\x20directory:\x20'+hI);return'./'+hJ['split'](R['sep'])['join']('/');},aJ=hI=>{let hJ=hI['input']||hI['entry']||aF();if(!hJ)throw Error('No\x20entry\x20file\x20found');return R['resolve'](hJ);},aK=()=>{if(n)throw Error('The\x20`build`\x20and\x20`dev`\x20commands\x20are\x20unavailable\x20in\x20the\x20desktop-distributed\x20CLI.\x20Use\x20the\x20npm-installed\x20`azot`\x20package\x20in\x20a\x20Node.js\x20environment\x20instead.');},aL=hI=>hI['positional']('entry',{'describe':'Path\x20to\x20the\x20input\x20file','type':'string'})['option']('input',{'alias':'i','describe':'Path\x20to\x20the\x20input\x20file','type':'string'})['option']('format',{'alias':'f','describe':'Output\x20format','choices':['cjs','esm'],'default':'cjs'})['option']('minify',{'describe':'Minify\x20output','type':'boolean'}),aM=hI=>{let hJ=R['resolve'](hI);for(;;){let hK=R['join'](hJ,'package.json');if(existsSync(hK))return hK;let hL=R['dirname'](hJ);if(hL===hJ)return;hJ=hL;}},aN=hI=>{const iK=iA;let hJ=aM(hI);if(!hJ){let hK='Could\x20not\x20find\x20package.json\x20starting\x20from\x20'+hI;throw v[iK(0x171)](hK),Error(hK);}try{let hL=JSON['parse'](readFileSync(hJ,'utf8'));if(!hL||typeof hL!='object'||Array['isArray'](hL))throw Error('package.json\x20must\x20contain\x20a\x20JSON\x20object');let hM=hL;if(hM['private']!==void 0x0&&typeof hM['private']!='boolean')throw Error('package.json\x20field\x20\x22private\x22\x20must\x20be\x20a\x20boolean\x20when\x20present');return{'private':hM['private']};}catch(hN){let hO='Failed\x20to\x20load\x20package.json\x20for\x20build\x20command\x20from\x20'+hJ;throw v['error'](hO),v['debug'](hN),Error(hO);}},aO={'command':'build\x20[entry]','describe':'Bundle\x20a\x20Node.js\x20entry\x20file\x20for\x20distribution','builder':hI=>aL(hI)['option']('watch',{'describe':'Watch\x20file\x20changes','type':'boolean'})['option']('obfuscate',{'describe':'Obfuscate\x20output','type':'boolean'}),'handler':async hI=>{aK();let hJ=aJ(hI),hK=typeof hI['minify']=='boolean'?hI['minify']:!0x0,hL=hI['watch']===!0x0,hM=hI['format']??'cjs',{build:hN}=await import('tsdown');await hN({'entry':aI(hJ),'format':hM,'platform':'node','target':'node24','watch':hL,'minify':hK,'inlineOnly':!0x1});let hO=aH(hJ,hM),hP=aN(process['cwd']());(typeof hI['obfuscate']=='boolean'?hI['obfuscate']:hP['private'])&&await aB(hO,hO);}},aP={'command':'dev\x20[entry]','describe':'Watch\x20and\x20rebuild\x20a\x20Node.js\x20entry\x20file\x20during\x20development','builder':hI=>aL(hI),'handler':async hI=>{const iL=iA;aK();let hJ=aJ(hI),hK=typeof hI['minify']=='boolean'?hI[iL(0xe4)]:!0x1,{build:hL}=await import('tsdown');await hL({'entry':aI(hJ),'format':hI['format']??'cjs','platform':'node','target':'node24','watch':!0x0,'minify':hK});}},aQ=()=>Intl['DateTimeFormat']()['resolvedOptions']()['locale']['startsWith']('ru')?'ru':'en',aR={'dark':iA(0x156),'light':'light','system':iA(0xea)},aS={'mp4':'mp4','mkv':'mkv'},aT={'stable':'stable','beta':iA(0x206),'alpha':'alpha'},aU=z['object']({'downloadDir':z['string']()['default'](L),'binariesDir':z['string']()['default'](m(join(G,'bin'))),'drmDir':z['string']()['default'](m(join(G,'drm'))),'language':z['string']()['default'](aQ()),'theme':z['enum']([aR['dark'],aR['light'],aR['system']])['default'](aR['system']),'preferHardsub':z['coerce']['boolean']()['default'](!0x1),'retry':z['coerce']['number']()['int']()['min'](0x1)['max'](0xa)[iA(0x14f)](0x3),'connections':z['coerce']['number']()['int']()['min'](0x1)['max'](0x40)['default'](0x4),'maxActiveDownloads':z['coerce']['number']()['int']()[iA(0x124)](0x1)['default'](0x1),'proxy':z['string']()['optional'](),'proxyMeta':z['string']()['optional'](),'proxyMedia':z['string']()['optional'](),'movieFilenameTemplate':z['string']()['default'](iA(0x15b)),'seriesFilenameTemplate':z[iA(0x132)]()['default']('{title}\x20S{s}E{e}\x20({quality},\x20{codec})'),'developerMode':z['coerce']['boolean']()['default'](!0x1),'allowUnknownSources':z['coerce']['boolean']()['default'](!0x1),'videoContainerFormat':z['enum']([aS['mp4'],aS['mkv']])['default'](aS['mp4']),'useAlternativeServer':z['coerce']['boolean']()['default'](!0x1),'automaticUpdates':z['coerce']['boolean']()['default'](!0x0),'updateChannel':z['enum']([aT['stable'],aT['beta'],aT['alpha']])['default'](aT['alpha'])}),aV=aU['parse']({});var aW=class{#e;constructor(hI){this.#e=t({'defaults':aV,'cwd':dirname(hI),'configName':basename(hI,'.json')}),this.#t();}#t(){let hI=this.#e['store'],hJ=aU['safeParse'](hI),hK='{title}.{audioType}.{quality}.{tag}.{format}.{codec}',hL='{title}.S{s}E{e}.{episodeTitle}.{audioType}.{quality}.{tag}.{format}.{codec}';if(hI['movieFilenameTemplate']==='{title}.{audioType}.{quality}.{tag}.{format}.{codec}'&&this.#e['set']('movieFilenameTemplate',hI['seriesFilenameTemplate']),hI['seriesFilenameTemplate']==='{title}.S{s}E{e}.{episodeTitle}.{audioType}.{quality}.{tag}.{format}.{codec}'&&this.#e['set']('seriesFilenameTemplate',hI['seriesFilenameTemplate']),!hJ['success']){console['warn']('Settings\x20validation\x20failed!\x20Resetting\x20to\x20defaults.',hJ['error']['flatten']()),this.#e['set'](aV);return;}Object['hasOwn'](hI,'askForOptions')&&this.#e['set'](hJ['data']);}['getAll'](){return this.#e['store'];}['get'](hI){return this.#e['get'](hI);}['set'](hI){const iM=iA;let hJ={...this.#e['store'],...hI},hK=aU['safeParse'](hJ);if(!hK['success'])throw console['error'](iM(0x217),hK['error']['flatten']()),Error('Settings\x20update\x20failed\x20validation.');this.#e['set'](hK['data']);}['onDidChange'](hI){const iN=iA;this.#e[iN(0xd6)](hI);}};const aX=async hI=>{try{return await V['access'](hI),!0x0;}catch(hJ){if(hJ['code']==='ENOENT')return!0x1;throw hJ;}},aY=async(hI,{recursive:hJ=!0x1}={})=>await V['readdir'](hI,{'withFileTypes':!0x0,'recursive':hJ}),aZ=async(hI,{recursive:hJ=!0x0,force:hK=!0x0}={})=>{await V['rm'](hI,{'recursive':hJ,'force':hK});},b0=async(hI,{recursive:hJ=!0x0}={})=>{const iO=iA;await V[iO(0x183)](hI,{'recursive':hJ});},b1=async hI=>{try{await V['access'](hI,constants['W_OK']);}catch(hJ){let hK=hJ['code'];throw hK==='EPERM'||hK==='EACCES'||hK==='ENOENT'?Object['assign'](Error('Download\x20directory\x20is\x20not\x20writable'),{'code':'DOWNLOAD_DIR_NOT_WRITABLE'}):hJ;}},b2=async hI=>{try{let hJ=await V['readFile'](hI,{'encoding':'utf8'});return JSON['parse'](hJ);}catch(hK){throw Error('Failed\x20to\x20read\x20JSON\x20file:\x20'+hI,{'cause':hK});}},b3=async(hI,hJ)=>{const iP=iA;let hK=parse(hI)['dir'];try{let hL=await aX(hK);hK&&!hL&&await V['mkdir'](hK),await V['writeFile'](hI,JSON['stringify'](hJ,null,0x2),'utf8');}catch(hM){throw Error(iP(0x145)+hI,{'cause':hM});}},b4={'extract':(hI,hJ)=>execFileSync('tar',['-xf',hI,...hJ?['-C',hJ]:[]],{'stdio':iA(0xd5)})},b5={'CHANNEL_NOT_FOUND':'EXTENSION_INSTALL_CHANNEL_NOT_FOUND','VERSION_NOT_FOUND':'EXTENSION_INSTALL_VERSION_NOT_FOUND','RELEASE_NOT_FOUND':'EXTENSION_INSTALL_RELEASE_NOT_FOUND','ASSET_NOT_FOUND':'EXTENSION_INSTALL_ASSET_NOT_FOUND','UNSUPPORTED_SOURCE':'EXTENSION_INSTALL_UNSUPPORTED_SOURCE','UNSUPPORTED_PACKAGE_TYPE':iA(0xbf),'IMPORT_INVALID':iA(0x1bf),'SOURCE_NOT_FOUND':'EXTENSION_INSTALL_SOURCE_NOT_FOUND','UNKNOWN':'EXTENSION_INSTALL_UNKNOWN'},b6=new Set(Object['values'](b5));var b7=class extends Error{[iA(0xf9)];['details'];['hint'];constructor(hI){const iQ=iA;super(hI['message']),this['name']='InstallExtensionError',this[iQ(0xf9)]=hI['code'],this['details']=hI['details'],this['hint']=hI['hint'];}['toPayload'](){return{'code':this['code'],'message':this['message'],'details':this['details'],'hint':this['hint']};}};const b8=(hI,hJ,hK,hL)=>new b7({'code':hI,'message':hJ,'details':hK,'hint':hL}),b9=hI=>{let hJ=(hI?.['startsWith']('v')?hI[0x1]:hI?.[0x0])??'';return Number['isNaN'](parseInt(hJ))?hI?.['split']('.')['at'](0x0)||'latest':hI?.['split']('-')['at'](0x1)?.['split']('.')['at'](0x0)||'latest';},ba=hI=>(hI['version']||hI['tag_name']||'')[iA(0x133)](/^v/,''),bb=hI=>[...new Set(hI['filter'](Boolean))],bc=hI=>({'availableVersions':bb((hI||[])['map'](hJ=>ba(hJ))),'availableChannels':bb((hI||[])['map'](hJ=>b9(ba(hJ))))}),bd=(hI,hJ,hK)=>{let hL={'source':hK,'preferredVersion':hI['preferredVersion'],'preferredChannel':hI['preferredChannel'],'appChannel':hI['appChannel'],...bc(hJ)};return hI['preferredVersion']?b8(b5['VERSION_NOT_FOUND'],'Release\x20not\x20found\x20for\x20requested\x20version:\x20'+hI['preferredVersion'],hL):b8(b5['CHANNEL_NOT_FOUND'],'Release\x20not\x20found\x20for\x20requested\x20channel:\x20'+hI['preferredChannel'],hL);},be=(hI,hJ,hK)=>{if(!hI?.['length'])return null;if(hJ['preferredVersion'])return hI['find'](hL=>ba(hL)===hJ['preferredVersion'])||null;if(!hJ['isExplicitSelection']){let hL=hI['find'](hM=>b9(ba(hM))==='latest');if(hL)return hL;}return hI['find'](hM=>b9(ba(hM))===hJ['preferredChannel'])||(hJ['allowFallback']&&hJ['preferredChannel']!=='latest'?(v['debug']('Release\x20'+hJ['preferredChannel']+'\x20not\x20found\x20for\x20'+hK+',\x20falling\x20back\x20to\x20latest\x20stable'),hI['find'](hM=>b9(ba(hM))==='latest')||(v['debug']('Latest\x20stable\x20release\x20not\x20found\x20for\x20'+hK+',\x20falling\x20back\x20to\x20latest\x20with\x20any\x20channel'),hI['at'](0x0)||null)):null);},bf=hI=>{let [,hJ='']=hI['split']('@'),hK=hI['replace'](hJ?'@'+hJ:'',''),hL=b9(j['version']),hM=!!hJ;return{'name':hK,'preferredVersion':Number['isNaN'](parseInt(hJ[0x0]??''))?'':hJ,'preferredChannel':hM?b9(hJ):hL,'appChannel':hL,'isExplicitSelection':hM,'allowFallback':!hM&&hL!=='latest'};},bg=async(hI,hJ)=>{const iR=iA;v['info']('Fetching\x20bundle...'),v['debug'](hI);let hK=await fetch(hI);if(!hK['ok'])throw b8(b5['ASSET_NOT_FOUND'],'Failed\x20to\x20download\x20extension\x20bundle:\x20'+hK['status']+'\x20'+hK['statusText'],{'url':hI,'status':hK['status'],'statusText':hK['statusText']});let hL=hK['headers']['get']('content-disposition')?.['split']('filename=')[0x1]?.['split'](';')[0x0]?.['replaceAll']('\x22',''),hM=R['basename'](hI),hN=hJ||hL||hM,hO=await hK['arrayBuffer'](),hP=R['join'](o,hN);return await V['writeFile'](hP,Buffer[iR(0x168)](hO)),await V['stat'](hP)['then'](hQ=>{const iS=iR;v['debug']('Bundle\x20downloaded\x20('+hQ[iS(0x1f1)]/0x3e8+'\x20KB):\x20'+hP);})['catch'](()=>{v['error']('Bundle\x20download\x20failed:\x20can\x27t\x20find\x20output\x20file');}),hP;},bh=async(hI,hJ)=>{const iT=iA;if(hI['startsWith']('npm:')||hI['startsWith']('@streamyx/'))throw b8(b5['UNSUPPORTED_SOURCE'],'NPM\x20extension\x20sources\x20are\x20no\x20longer\x20supported',{'source':hI});let hK=hI,hL=hI,hM=R['dirname'](hI),hN=hM!=='.'&&await V['stat'](hM)['then'](()=>!0x0,()=>!0x1),hO=hI[iT(0x1b3)]('./')||hI[iT(0x1b3)]('../')||hI['startsWith']('/')||hI['startsWith']('~')||hN,hP=await V['stat'](hI)['then'](()=>!0x0,()=>!0x1),hQ=hI['startsWith']('https://'),hS=hI['startsWith']('gl:')||hI['startsWith']('gitlab:'),hT=hI['startsWith']('github:')||hI[iT(0x1b3)]('gh:');if(hO&&!hP&&!hQ&&!hT&&!hS)throw v['warn']('Installed\x20extension\x20not\x20found:\x20'+hI),v['warn']('Run\x20\x27azot\x20list\x27\x20and\x20remove\x20the\x20extension\x20from\x20the\x20list.'),b8(b5['SOURCE_NOT_FOUND'],'Installed\x20extension\x20source\x20not\x20found:\x20'+hI,{'source':hI});hI=hI['replace'](/^gl:/,'')['replace'](/^gitlab:/,'')['replace'](/^gh:/,'')['replace'](/^github:/,'');let hU=bf(hI),{name:hV}=hU;if(hQ)hK=await bg(hI);else{if(hT){let [i1,i2]=hV['split']('/'),i3='https://api.github.com/repos/'+i1+'/'+i2+'/releases',i4=await fetch(i3)['then'](i9=>i9['json']());if(i4?.['message']&&!Array['isArray'](i4))throw b8(b5['RELEASE_NOT_FOUND'],'GitHub\x20releases\x20request\x20failed:\x20'+i4['message'],{'source':hV,'provider':'github','apiMessage':i4['message']});let i5=Array['isArray'](i4)?i4:[],i6=be(i5,hU,hV);if(!i6)throw hU['isExplicitSelection']?bd(hU,i5,hV):b8(b5['RELEASE_NOT_FOUND'],'GitHub\x20release\x20not\x20found',{'source':hV,'provider':'github',...bc(i5)});let i7=i6['assets']?.['find'](i9=>i9['name'][iT(0x17a)]('.tgz')||i9['name']['endsWith']('.zip'));if(!i7)throw v['debug'](i6),b8(b5['ASSET_NOT_FOUND'],'GitHub\x20release\x20asset\x20not\x20found',{'source':hV,'provider':'github','releaseTag':ba(i6)});let i8=i7[iT(0x10c)];hK=await bg(i8);}else{if(!hP){let i9=hJ?.['find'](id=>id['name']===hV),ia=i9?.['releases']||[],ib=be(ia,hU,hV),ic=ib?.['assets']['find'](id=>id['name']['endsWith']('.tgz'));if(i9&&!ib&&hU['isExplicitSelection'])throw bd(hU,ia,hV);if(ic)hK=await bg(ic['url'],ic['name']);else{let [id,ie='streamyx-extensions']=hV['split']('/')['reverse'](),ig=iT(0x10d)+ie+'%2F'+id+iT(0xe2),ih=await fetch(ig)['then'](il=>il[iT(0xb5)]());if(ih?.['message']&&!Array[iT(0x1cd)](ih))throw b8(b5['RELEASE_NOT_FOUND'],'GitLab\x20releases\x20request\x20failed:\x20'+ih['message'],{'source':hV,'provider':'gitlab','apiMessage':ih['message']});let ii=Array['isArray'](ih)?ih:[],ij=be(ii,hU,hV);if(!ij)throw hU['isExplicitSelection']?bd(hU,ii,hV):b8(b5['RELEASE_NOT_FOUND'],'GitLab\x20release\x20not\x20found',{'source':hV,'provider':'gitlab',...bc(ii)});let ik=ij[iT(0x1a5)]?.['links']?.[iT(0x1f3)](il=>il['name']['endsWith']('.tgz'));if(!ik)throw b8(b5['ASSET_NOT_FOUND'],'GitLab\x20release\x20asset\x20not\x20found',{'source':hV,'provider':'gitlab','releaseTag':ba(ij)});hK=await bg(ik['direct_asset_url']||ik['url'],ik['name']);}}}}let hW=R['extname'](hK),hX=hW==='.zip',hY=hW==='.tgz',hZ=new Set(['.js','.mjs','.cjs'])['has'](hW),i0=await V['stat'](hK)['then'](il=>il['isDirectory']())['catch'](()=>!0x1);if(hZ?hL=R['dirname'](hK):i0?hL=hK:(hL=hK['replace']('.tgz','')[iT(0x133)]('.zip',''),await aX(hL)||await b0(hL)),hX||hY)b4['extract'](hK,hL),await aZ(hK);else{if(!(hZ||i0))throw b8(b5['UNSUPPORTED_PACKAGE_TYPE'],'Unsupported\x20package\x20type',{'source':hI,'extensionSource':hK,'packageType':hW||'unknown'});}return hL;},bi='__matchRules',bj=hI=>typeof hI=='object'&&!!hI&&!Array['isArray'](hI),bk=hI=>{const iU=iA;if(Array['isArray'](hI)){let hL=hI['filter'](hN=>typeof hN=='string'&&hN['length']>0x0&&!hN['startsWith']('-')),hM=hI['filter'](hN=>typeof hN=='string'&&hN['startsWith']('-'))['map'](hN=>hN['slice'](0x1))['filter'](Boolean);return!hL['length']&&!hM['length']?void 0x0:{'include':hL['length']?hL:void 0x0,'exclude':hM['length']?hM:void 0x0};}if(!bj(hI))return;let hJ=Array['isArray'](hI['include'])?hI['include']['filter'](hN=>typeof hN=='string'&&!!hN):void 0x0,hK=Array['isArray'](hI[iU(0x210)])?hI['exclude']['filter'](hN=>typeof hN=='string'&&!!hN):void 0x0;if(!(!hJ?.['length']&&!hK?.['length']))return{'include':hJ?.['length']?hJ:void 0x0,'exclude':hK?.['length']?hK:void 0x0};},bl=hI=>{const iV=iA;let hJ=hI['trim']()[iV(0x15e)](/^(\*|https?):\/\/([^/]+)(\/.*)$/i);if(!hJ)return null;let [,hK,hL,hM]=hJ,hN=hK['toLowerCase'](),hO=hN==='*'?[iV(0x161),'https']:hN==='http'||hN==='https'?[hN]:null;if(!hO)return null;let hP=hL['trim']()['toLowerCase'](),hQ=!0x1,hS=[],hT=[];if(hP==='*')hQ=!0x0;else{if(hP['startsWith']('*.')){let hW=hP['slice'](0x1);if(!hW['startsWith']('.')||hW['length']<=0x1)return null;hT=[hW];}else{if(!hP['includes']('*'))hS=[hP];else return null;}}if(!hM['startsWith']('/'))return null;let hU=hM['indexOf']('*');if(hU!==-0x1&&hU!==hM['length']-0x1)return null;let hV=hU===-0x1?hM:hM['slice'](0x0,-0x1);return{'schemes':hO,'matchAnyHost':hQ,'exactHosts':hS,'wildcardHostSuffixes':hT,'exactPaths':hU===-0x1?[hV]:void 0x0,'pathPrefixes':hU===-0x1?void 0x0:[hV]};},bm=hI=>{const iW=iA;if(!Array[iW(0x1cd)](hI))return;let hJ=hI['filter'](hK=>typeof hK==iW(0x132)&&!!hK['trim']())['map'](bl)['filter'](hK=>!!hK);return hJ[iW(0xb4)]?hJ:void 0x0;},bn=(hI,hJ)=>hJ[iA(0xc8)]||hJ['exactHosts']['includes'](hI)||hJ['wildcardHostSuffixes']['some'](hK=>hI['endsWith'](hK)),bo=(hI,hJ)=>hJ['exactPaths']?.['includes'](hI)||!!hJ['pathPrefixes']?.['some'](hK=>hI['startsWith'](hK))||!hJ['exactPaths']?.['length']&&!hJ[iA(0x223)]?.['length'],bp=({manifest:hI,packageJson:hJ,fallbackName:hK})=>{const iX=iA;let hL=bj(hJ?.['config'])?hJ['config']:null,hM=(bj(hI)?hI:null)??hL??{},hN=typeof hM['displayName']==iX(0x132)&&hM['displayName']||typeof hM['name']=='string'&&hM['name']||typeof hM['title']=='string'&&hM['title']||hK,hO=typeof hM['shortName']=='string'&&hM['shortName']||typeof hM[iX(0xb0)]=='string'&&hM['tag']||void 0x0,hP={...hM,'displayName':hN,'shortName':hO,'name':hN,'title':typeof hM['title']==iX(0x132)&&hM['title']?hM['title']:hN,'tag':hO};(typeof hP['icon']!='string'||!hP['icon'])&&delete hP[iX(0xf1)],(typeof hP['displayName']!='string'||!hP['displayName'])&&(hP['displayName']=hK),(typeof hP['shortName']!='string'||!hP['shortName'])&&delete hP['shortName'],(typeof hP['tag']!='string'||!hP['tag'])&&delete hP['tag'],Array['isArray'](hP[iX(0x16d)])||delete hP['permissions'],hP[iX(0x192)]=bk(hM['regions']),typeof hP['manifestVersion']!='number'&&(hP['manifestVersion']=0x1),bj(hP['capabilities'])||delete hP['capabilities'],bj(hP['settings'])||delete hP['settings'],bj(hP['secrets'])||delete hP[iX(0x195)];let hQ=bm(hM['matches']);return hQ?(hP['matches']=Array['isArray'](hM['matches'])?hM[iX(0x191)]['filter'](hS=>typeof hS=='string'):void 0x0,Object['defineProperty'](hP,bi,{'value':hQ,'enumerable':!0x1,'configurable':!0x1,'writable':!0x1})):delete hP['matches'],hP;},bq=async({dir:hI,packageJson:hJ,fallbackName:hK})=>{let hL=join(hI,'manifest.json');return bp({'manifest':await aX(hL)?await b2(hL):null,'packageJson':hJ,'fallbackName':hK});},br=hI=>hI['manifest']?.['displayName']||hI['manifest']?.['name']||hI['manifest']?.[iA(0x20c)]||hI['package']?.['config']?.[iA(0x20c)]||hI['package']?.['name']||hI['name']||'(unknown\x20extension)',bs=hI=>hI['manifest']?.['shortName']||hI['manifest']?.['tag']||hI['package']?.['config']?.['tag']||void 0x0,bt=(hI,hJ)=>{const iY=iA;let hK=hI['manifest']?.[bi];if(!Array['isArray'](hK)||!hK['length'])return!0x1;let hL=hJ['protocol'][iY(0x1ca)](0x0,-0x1)[iY(0x91)](),hM=hJ['hostname']['toLowerCase'](),hN=hJ[iY(0x1d5)];return hK['some'](hO=>!(hO['schemes']?.['length']&&!hO['schemes']['includes'](hL)||!bn(hM,hO)||!bo(hN,hO)));},bu=hI=>{let hJ=hI['manifest']?.[bi];return Array['isArray'](hJ)&&hJ['length']>0x0;},bv=hI=>hI['exports'],bw=hI=>{if(!hI)return;let hJ=Object['fromEntries'](new Headers(hI)['entries']());return Object['keys'](hJ)['length']?hJ:void 0x0;},bx=(...hI)=>{let hJ=Object['assign']({},...hI['map'](hK=>bw(hK)));return Object['keys'](hJ)['length']?hJ:void 0x0;},by=async(hI,hJ)=>{if(!hJ)return hI;let hK=await hI['clone']()['arrayBuffer'](),hL=Buffer['from'](hK)['toString']('base64'),hM=hJ['replace']('{{challenge}}',hL);return new Request(hI['url'],{'method':hI['method'],'headers':hI['headers'],'body':hM});},bz=async hI=>{const iZ=iA;let hJ=await hI[iZ(0x1a3)]()['arrayBuffer']();if(hJ[0x0]===0x7b){let hK=null;try{hK=JSON['parse'](Buffer[iZ(0x168)](hJ)['toString']('utf8'));}catch(hL){v['error']('Can\x27t\x20parse\x20license\x20response\x20as\x20JSON'),v['debug'](hL['message']),v['debug']('Base64\x20response\x20data:\x20'+Buffer['from'](hJ)['toString'](iZ(0x1e9)));}if(!hK)return hI;try{let hM='CAIS',hN=hM+Buffer['from'](hJ)['toString']('utf8')['split']('\x22'+hM)[0x1]['split']('\x22')[0x0],hO=Buffer['from'](hN,'base64');return new Response(hO,{'status':hI['status'],'headers':hI['headers']});}catch{v['error']('Can\x27t\x20recognize\x20license\x20response'),v['error']('Response:\x20'+JSON['stringify'](hK));}}return hI;},bA=hI=>({'url':hI['url'],'headers':hI[iA(0x9f)],'http2':hI[iA(0x17c)],'audioLanguage':hI['audioLanguage'],'audioType':hI['audioType'],'subtitles':Array[iA(0x1cd)](hI['subtitles'])?hI['subtitles']['filter'](hJ=>!!hJ&&typeof hJ=='object'&&typeof hJ[iA(0x170)]=='string')[iA(0x181)](hJ=>({...hJ})):void 0x0}),bB=hI=>({'url':hI['url'],'headers':hI['headers']}),bC=hI=>{const j0=iA;if(hI)return'server'in hI?{'kind':j0(0x1aa),'server':hI['server'],'headers':hI['headers'],'template':hI[j0(0xaf)],'http2':hI['http2']}:'payload'in hI?{'kind':'payload','payload':hI[j0(0xcc)]}:{'kind':'keys','keys':hI['keys']['map'](hJ=>({...hJ}))};},bD=hI=>{const j1=iA;let hJ=hI['source']?bA(hI[j1(0x1b8)]):void 0x0,hK=hI['source']?.['drm']?bC(hI['source']['drm']):void 0x0;return{'id':hI['id'],'type':j1(0x1d7)in hI?'episode':'movie','title':hI['title'],'seasonNumber':hI['seasonNumber'],'episodeNumber':hI['episodeNumber'],'episodeTitle':hI['episodeTitle'],'source':hJ?bB(hJ):void 0x0,'context':hI['id']||hJ||hK?{'legacy':{'contentId':hI['id'],'source':hJ,'drm':hK}}:void 0x0};},bE=(hI,hJ)=>{const j2=iA;let hK=new Input({'source':new UrlSource(hI['url'],{'requestInit':{'headers':hI['headers']},'fetchFn':hJ['context']['http']['fetch']['bind'](hJ['context'][j2(0x161)])}),'formats':ALL_FORMATS});for(let hL of hI['subtitles']??[])hK['addSubtitleTrack'](new UrlSource(hL['url']),{'name':hL['label']||hL['title'],'languageCode':hL['language'],'codec':hL['format'],'disposition':{'default':hL['default'],'forced':hL['forced']}});return hK;},bF=async(hI,hJ)=>{if(!hJ?.['trim']())return;let hK=await hI['getAudioTracks']({'filter':async hL=>{let hM=await hL['getLanguageCode']();return!hM||hM==='und';}});for(let hL of hK)hL['setLanguageCode'](hJ);},bG=async({entry:hI,extension:hJ,options:hK})=>{const j3=iA;let hL=hI[j3(0x1bb)]?.['legacy'];if(hL?.['source']?.[j3(0x170)])return{'source':hL['source'],'drm':hL['drm']};let hM=hL?.['contentId']??hI['id'];if(!hM)return hI['source']?{'source':{'url':hI['source']['url'],'headers':hI['source']['headers']},'drm':hL?.['drm']}:null;let hN=await bv(hJ)['fetchContentSource']?.(String(hM),hK);return hN?{'source':bA(hN),'drm':bC(hN['drm'])}:null;},bH=async({entry:hI,extension:hJ,options:hK})=>{const j4=iA;let hL=bv(hJ),hM=hI['context']?.['legacy']?.['drm'];if(hM)return hM[j4(0x15a)]==='payload'?bC(await hL['fetchContentDrm']?.(hM['payload'],hK)):hM;},bI=hI=>({async 'requestLicense'({data:hJ,options:hK,resource:hL}){const j5=iA;let hM=await bH({'entry':hL['entry'],'extension':hI,'options':hK});if(!hM||hM['kind']!=='server')throw Error(j5(0xba));let hN=new Request(hM['server'],{'method':'POST','headers':bx(hM['headers'],hI['context']['http']['headers']),'body':Buffer['from'](hJ)}),hO=await by(hN,hM['template'])||hN,hP=await hI['context']['http']['fetch'](hO['url'],{'body':await hO['arrayBuffer'](),'headers':hO['headers'],'method':hO['method']}),hQ=await bz(hP)||hP;return new Uint8Array(await hQ['arrayBuffer']());},async 'resolveKeys'({options:hJ,resource:hK}){const j6=iA;let hL=await bH({'entry':hK[j6(0x137)],'extension':hI,'options':hJ});return hL?.['kind']==='keys'?hL['keys']:[];}}),bJ=hI=>({async 'initialize'(){await bv(hI)['init']?.();},async 'getEntries'({url:hJ,options:hK}){const j7=iA;return(await bv(hI)['fetchContentMetadata']?.(hJ,hK)??[])[j7(0x181)](bD);},async 'resolveEntry'({entry:hJ,options:hK}){const j8=iA;let hL=await bG({'entry':hJ,'extension':hI,'options':hK});if(!hL?.['source']?.['url'])throw Error('Legacy\x20extension\x20did\x20not\x20provide\x20a\x20media\x20source');let hM=hL[j8(0x1b8)],hN=hL['drm']??hJ['context']?.['legacy']?.['drm'],hO={...hJ,'source':bB(hM),'context':{...hJ['context'],'legacy':{...hJ['context']?.['legacy'],'source':hM,'drm':hN}}},hP=bE(hM,hI);return await bF(hP,hM['audioLanguage']),{'entry':hO,'input':hP};},'drm':bI(hI)}),bK=hI=>hI&&'exports'in hI?hI['exports']:hI,bL=hI=>hI?.['package']?.['name']||'(unknown\x20extension)',bM=hI=>{const j9=iA;let hJ=bK(hI);return!hJ||typeof hJ!='object'?null:j9(0x16e)in hJ&&typeof hJ['getEntries']=='function'?'v2':'fetchContentMetadata'in hJ&&typeof hJ['fetchContentMetadata']=='function'?'legacy-content':null;},bN=hI=>bM(hI)!==null,bO=hI=>{let hJ=bK(hI);if(!hJ||typeof hJ!='object')throw Error('Invalid\x20extension\x20exports');return hJ;},bP=hI=>{const ja=iA;let hJ=bO(hI),hK=bM(hJ);if(hK==='v2')return hJ;if(hK==='legacy-content')return bJ(hI);throw Error(ja(0xdd)+hI['package']['name']);},bQ=async hI=>{const jb=iA;let hJ=bO(hI),hK=bL(hI),hL=bM(hJ);try{if(hL==='v2'&&typeof hJ['initialize']==jb(0x129)){await hJ['initialize']?.();return;}hL==='legacy-content'&&typeof hJ['init']=='function'&&await hJ[jb(0xca)]?.();}catch(hM){let hN=hL==='v2'?'initialize':'init',hO=hM instanceof Error?hM:Error(String(hM));throw v['error']('Extension\x20'+hK+'\x20'+hN+'\x20failed:\x20'+hO['message']),hO['stack']&&v['debug'](hO['stack']),hO;}},bR=hI=>hI[iA(0x1f9)]||hI['password']||hI[iA(0xa0)]?{'method':'password','username':hI[iA(0x1f9)]??'','password':hI['password']??'','otp':hI['otp']}:{'method':iA(0xc3)},bS=async(hI,hJ)=>{const jc=iA;let hK=bO(hI),hL=bL(hI);try{if(typeof hK[jc(0xb1)]?.['login']=='function'){await hK['auth']?.['login']?.(bR(hJ));return;}typeof hK['login']=='function'&&await hK['login']?.(hJ);}catch(hM){let hN=typeof hK['auth']?.['login']=='function'?'auth.login':'login',hO=hM instanceof Error?hM:Error(String(hM));throw v['error'](jc(0x131)+hL+'\x20'+hN+'\x20failed:\x20'+hO['message']),hO['stack']&&v['debug'](hO['stack']),hO;}},bT=async hI=>{const jd=iA;let hJ=bO(hI),hK=bL(hI);try{if(typeof hJ['auth']?.[jd(0x19b)]=='function'){await hJ[jd(0xb1)]?.['logout']?.();return;}typeof hJ['logout']=='function'&&await hJ['logout']?.();}catch(hL){let hM=typeof hJ[jd(0xb1)]?.['logout']=='function'?'auth.logout':'logout',hN=hL instanceof Error?hL:Error(String(hL));throw v['error']('Extension\x20'+hK+'\x20'+hM+'\x20failed:\x20'+hN['message']),hN['stack']&&v['debug'](hN['stack']),hN;}},bU=({url:hI,options:hJ,resource:hK,signal:hL})=>({'url':hI,'options':hJ,'resource':hK,'signal':hL}),bV=async(hI,hJ)=>{const je=iA;let hK=bO(hI);if(bM(hK)!=='v2')return;let hL=hK;typeof hL[je(0x239)]?.['beforeDownload']=='function'&&await hL[je(0x239)]['beforeDownload'](bU(hJ));},bW=async(hI,hJ)=>{const jf=iA;let hK=bO(hI),hL=bL(hI),hM=bM(hK);if(!hJ['skipMux']&&hM==='v2'&&typeof hK['hooks']?.['afterMux']=='function')try{await hK['hooks']?.['afterMux']?.(bU(hJ));}catch(hN){let hO=hN instanceof Error?hN:Error(String(hN));v['error']('Extension\x20'+hL+'\x20hooks.afterMux\x20failed:\x20'+hO[jf(0x105)]),hO['stack']&&v['debug'](hO['stack']);}if(hM==='legacy-content'&&typeof hK['onDownloadFinished']=='function')try{await hK['onDownloadFinished']?.();}catch(hP){let hQ=hP instanceof Error?hP:Error(String(hP));v['error']('Extension\x20'+hL+'\x20onDownloadFinished\x20failed:\x20'+hQ['message']),hQ[jf(0xe8)]&&v['debug'](hQ['stack']);}},bX=async(hI,{context:hJ,dirname:hK,skipValidation:hL})=>{const jg=iA;let hM=await E(hI,{'dirname':hK,'context':hJ})['finally'](()=>{});if(!hM)return null;let hN='default'in hM['exports']?hM['exports']['default']:hM['exports'];if(!hL&&!bN(hN))throw v[jg(0x171)](jg(0x1da)),b8(b5['IMPORT_INVALID'],'Incompatible\x20extension\x20interface',{'extensionPath':hI});return hM['exports']=hN,hM;},bY=hI=>hI['split']('/')['reverse']()[0x0]['replaceAll']('@','')['replace']('extension-','')['replace']('-extension',''),bZ=async hI=>{const jh=iA;let hJ=[join(hI,'package.json'),join(hI,'package',jh(0xfd))],hK;for(let hT of hJ)if(await aX(hT)){hK=hT;break;}let hL={},hM='',hN='',hO='',hP=hI;if(hK){hP=dirname(hK),hL=await b2(hK)||{};let hU=hL['main']||'index.js';hM=join(hP,hU),hN=hL['name'],hO=hP;}else{let hV=await aY(hI),hW=hV[jh(0x1f3)](hX=>hX['name']==='index.js')||hV['find'](hX=>hX[jh(0x215)]==='main.js')||hV[jh(0x1f3)](hX=>hX[jh(0x215)]==='service.js')||hV['find'](hX=>hX['name']==='extension.js')||hV['find'](hX=>hX[jh(0x215)]['endsWith']('.js'));hW&&(hM=join(hI,hW['name']),hN=parse(hM)['name']);}if(!hM)throw b8(b5['IMPORT_INVALID'],jh(0x1d2)+hI,{'dir':hI});hO||=dirname(hM);let hQ=bY(hN),hS=await bq({'dir':hP,'packageJson':hL,'fallbackName':hQ});return{'name':hQ,'path':hM,'dir':hO,'package':hL,'manifest':hS};},c0=async(hI,hJ)=>{const ji=iA;try{let hK=await bZ(hI),hL=br(hK),hM=J({'name':hK['name'],'title':hL,'dir':O});await hM['cookieStore']['import'](join(O,hK['name'],'cookies.txt'));let hN=await bX(hK['path'],{'context':hM,'dirname':hK[ji(0xa3)]});if(!hN)throw b8(b5[ji(0x11d)],'Failed\x20to\x20load\x20extension\x20script:\x20'+hK['path'],{'source':hJ,'dir':hI,'path':hK['path']});return{'source':hJ,'exports':hN['exports'],'context':hM,...hK};}catch(hO){throw v['error']('Error\x20importing\x20module:\x20'+hO['message']),v[ji(0xff)](hO instanceof Error?hO['stack']||hO[ji(0x105)]:String(hO)),hO;}},c1=A;let c2=c1;const c3=hI=>hI['replace'](/\/+$/,''),c4=()=>c3(c2),c5=(hI,hJ)=>{let hK=c3(hI);return hJ?hK+'/'+(hJ['startsWith']('/')?hJ['slice'](0x1):hJ):hK;},c6=hI=>c5(c4(),hI);let c7=null;async function c8(hI){const jj=iA;if(!c7){v['debug']('Public\x20key\x20not\x20found');let hP=await ca();if(hP)v['debug']('Public\x20key\x20found:\x20'+hP['slice'](0x0,0x32)+'...');else return v['error']('Public\x20key\x20not\x20found\x20in\x20response'),!0x1;if(c7=await cb(hP)[jj(0x1a9)](()=>null),!c7)return v['error']('Public\x20key\x20import\x20failed'),!0x1;}let hJ=hI['headers']['get']('X-Signature-Timestamp'),hK=hI['headers']['get']('X-Signature');if(!hJ||!hK)return v['error']('Signature\x20headers\x20not\x20found'),!0x1;if(Date['now']()-parseInt(hJ)>0x493e0)return!0x1;let hL=hJ+':'+await hI['clone']()['text'](),hM=cc(hK),hN=new TextEncoder(),hO=crypto['subtle']['verify']({'name':'ECDSA','hash':'SHA-256'},c7,hM,hN['encode'](hL));return hO||(c7=null),hO;}const c9=()=>atob(k);async function ca(hI='/auth/.well-known/public-key'){try{let hJ=await fetch(''+c4()+hI);return hJ['ok']?await hJ['text']():c9();}catch(hK){return v['error'](hK['message']),c9();}}async function cb(hI){const jk=iA;let hJ=cc(hI[jk(0x133)]('-----BEGIN\x20PUBLIC\x20KEY-----','')['replace']('-----END\x20PUBLIC\x20KEY-----','')['trim']());return crypto['subtle']['importKey']('spki',hJ,{'name':'ECDSA','namedCurve':jk(0x1c5)},!0x0,['verify']);}function cc(hI){const jl=iA;let hJ=atob(hI),hK=new Uint8Array(hJ['length']);for(let hL=0x0;hL<hJ['length'];hL++)hK[hL]=hJ['charCodeAt'](hL);return hK[jl(0x1e5)];}const cd=hI=>createAuthClient({'baseURL':hI+'/auth','plugins':[deviceAuthorizationClient(),tributeClient()],'fetchOptions':{'retry':0x0,'onSuccess':hJ=>{let hK=hJ['response']['headers']['get']('set-auth-token');hK&&(cq['accessToken']=hK,cr(cq));},'auth':{'type':'Bearer','token':()=>cq[iA(0x10b)]||cs()['then'](hJ=>hJ?.['accessToken'])},'onResponse':async hJ=>await c8(hJ['response'])['catch'](()=>!0x1)?(v['debug']('Response\x20verified:\x20'+hJ['response']['url']),hJ):(v['error']('Response\x20verification\x20failed:\x20'+hJ['response']['status']+'\x20'+hJ['response']['statusText']+'\x20'+hJ['response']['url']),C['emit']('error',{'code':'SIGNATURE_VERIFICATION_FAILED'}),new Response(JSON['stringify']({'error':iA(0xe6),'message':'Signature\x20verification\x20failed'}),{'status':0x191,'statusText':'Unauthorized'}))}});let ce='',cf=cd(c4());const cg=()=>{let hI=c4();return(!cf||ce!==hI)&&(ce=hI,cf=cd(hI)),cf;},ch=async(hI,hJ,hK={})=>{const jm=iA;let {signal:hL,timeoutMs:hM=0x2710}=hK,hN=new AbortController(),hO=()=>hN['abort'](hL?.[jm(0x130)]);hL?.['addEventListener']('abort',hO,{'once':!0x0});let hP=!0x1,hQ=setTimeout(()=>{const jn=jm;hP=!0x0,hN['abort'](Error(jn(0xa7)));},hM);try{let hS=await fetch(hI,{...hJ,'signal':hN['signal']});if(!hS['ok'])throw Error('Request\x20failed:\x20'+hS['status']);return hS['json']();}catch(hT){throw hP&&hT instanceof DOMException&&hT['name']==='AbortError'?Error('Request\x20timed\x20out\x20after\x20'+hM+'ms',{'cause':hT}):hT;}finally{clearTimeout(hQ),hL?.['removeEventListener']('abort',hO);}},ci={'getExtensions':(hI,hJ)=>ch(c6('extensions'),{'headers':hI?{'Authorization':'Bearer\x20'+hI}:void 0x0},{'signal':hJ}),'getSubscriptions':(hI,hJ)=>ch(c6('subscriptions'),{'headers':{'Authorization':'Bearer\x20'+hI}},{'signal':hJ})},cj=0x12c*0x3e8,ck=0x12c*0x3e8,cl=new QueryClient({'queryCache':new QueryCache(),'defaultOptions':{'queries':{'staleTime':cj,'gcTime':ck}}}),cm={'get':hI=>cl['getQueryData'](hI),'set':(hI,hJ)=>cl['setQueryData'](hI,hJ),'reset':hI=>{hI?cl['removeQueries']({'queryKey':hI}):cl['clear']();},'invalidate':hI=>cl[iA(0x200)]({'queryKey':hI}),'refresh':async(hI,hJ)=>(cl['invalidateQueries']({'queryKey':hI}),cn({'queryKey':hI,'queryFn':hJ}))},cn=async({queryKey:hI,queryFn:hJ,staleTime:hK,enabled:hL=!0x0})=>{const jo=iA;try{let hM=cl[jo(0xa5)](hI),hN=hM?hM?.['isInvalidated']||!hM?.['dataUpdatedAt']&&!hM?.['errorUpdatedAt']||Date['now']()-hM['dataUpdatedAt']>(hK??cj):!0x0,hO=()=>cm[jo(0xe9)](hI),hP=()=>cm['invalidate'](hI),hQ=()=>cm['refresh'](hI,hJ);return hL?hM&&!hN?{'data':hM['data'],'reset':hO,'invalidate':hP,'refresh':hQ}:{'data':await cl[jo(0x221)]({'queryKey':hI,'queryFn':hJ,'staleTime':hK}),'reset':hO,'invalidate':hP,'refresh':hQ}:{'data':null,'reset':hO,'invalidate':hP,'refresh':hQ};}catch(hS){throw cl['removeQueries']({'queryKey':hI}),hS;}};let co;const cp=()=>(co??=new I(join(D,'session.json')),co),cq={'accessToken':'','tokenType':'','scope':'','createdAt':''},cr=async hI=>{let hJ=cp();hJ['setItem']('access_token',hI['access_token']),hJ['setItem']('token_type',hI['token_type']||'Bearer'),hJ['setItem']('scope',hI['scope']),hJ['setItem']('created_at',new Date()['toISOString']()),cq['accessToken']=hI['access_token'],cq['tokenType']=hI['token_type']||'Bearer',cq['scope']=hI['scope'],cq['createdAt']=new Date()['toISOString']();},cs=async()=>{const jp=iA;let hI=cp(),hJ=hI[jp(0x1dc)]('access_token'),hK=hI['getItem']('token_type'),hL=hI['getItem']('scope'),hM=hI['getItem']('created_at');return!hJ||!hK||!hL||!hM?null:{'accessToken':hJ,'tokenType':hK,'scope':hL,'createdAt':new Date(hM)};},ct=async()=>{const jq=iA;let hI=await cn({'queryKey':['session',c4()],'queryFn':()=>cg()['getSession']()});return{'session':hI['data']?.['data']?.['session'],'user':hI['data']?.['data']?.['user'],'error':hI['data']?.[jq(0x171)]};},cu=async()=>{let {user:hI,error:hJ}=await ct(),hK=await cn({'queryKey':['subscriptions',c4()],'queryFn':async()=>cg()['subscription']['list'](),'enabled':!!hI?.['id']});return{'data':hK['data']?.['data'],'error':hK['data']?.['error']??hJ};},cv=['lowConnectionsCount','oneDevice'],cw=['mediumConnectionsCount','twoDevices','proxy','decryption',iA(0x214),'tags','parallelDownloads','userExtensions','portableBuild'],cx=['highConnectionsCount',iA(0x21c),iA(0x184),'customDecrypter','customDrmClient','premiumExtensions'],cy={'basic':cv,'plus':cw,'pro':[...cv,...cw,...cx]},cz=()=>cn({'queryKey':['lava-subscriptions',c4()],'queryFn':async()=>{let hI=cq['accessToken']||(await cs())?.['accessToken'];return hI?ci['getSubscriptions'](hI):[];}}),cA=async()=>{const jr=iA;let hI=await cu();return{'plan':(await cz())['data']?.[0x0]?.[jr(0x84)]||hI[jr(0xb8)]?.['find'](hJ=>new Date(hJ['expiresAt'])>new Date())?.['tributeSubscriptionName'],'error':hI['error']};},cB=async()=>{let {user:hI,session:hJ}=await ct(),{plan:hK,error:hL}=await cA();return{'user':hI,'session':hJ,'error':hL,'plan':hK,'grantedBenefits':hK?cy[hK['toLowerCase']()]??[]:[]};};var cC=aa((hI,hJ)=>{const jB=iA;hJ['exports']={'bilibili':{'create':hK=>{const jA=b;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const js=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=ig=>ig);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'];let hZ=hX['Input'],i0=hX[js(0x21d)];hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX[js(0x138)];let i1={'Referer':'https://www.bilibili.com/','User-Agent':'facebookexternalhit/1.1\x20(+http://www.facebook.com/externalhit_uatext.php)'},i2={'Referer':'https://www.bilibili.tv/'},i3=ig=>ig?.['baseUrl']||ig?.['base_url']||ig?.[js(0x170)]||ig?.['backup_url']?.[0x0],i4=ig=>{let ih=ig?.['filter'](ij=>i3(ij))??[],ii;for(let ij of ih)(!ii||(ij['bandwidth']??0x0)>(ii['bandwidth']??0x0))&&(ii=ij);return ii;},i5=ig=>{let ih=i4(ig?.['video']),ii=i4(ig?.['audio']);return!ih||!ii?null:{'video':ih,'audio':ii};},i6=ig=>{let ih=ig['split']('<script>window.__playinfo__=')[0x1]?.['split']('</script>')[0x0];if(!ih)return null;try{return JSON['parse'](ih);}catch(ii){return hQ['error']('Failed\x20to\x20parse\x20Bilibili\x20play\x20info',ii),null;}},i7=async ig=>(await hN(ig,{'redirect':'follow'})[js(0x1a9)](()=>null))?.['url']||ig,i8=async ig=>{const jt=js;let ih=new URL(new URL(ig)['hostname']['endsWith']('b23.tv')?await i7(ig):ig);return{'id':new URLPattern({'pathname':'/video/:id{/*}?','baseURL':ih['origin']})['exec'](ih['href'])?.['pathname']['groups']['id'],'partId':ih['searchParams'][jt(0xed)]('p')??void 0x0,'url':ih[jt(0x1ad)]};},i9=ig=>{const ju=js;let ih=new URL(ig);for(let ii of['/:locale/:kind(video|play)/:id{/*}?','/:kind(video|play)/:id{/*}?']){let ij=new URLPattern({'pathname':ii,'baseURL':ih['origin']})[ju(0x190)](ig),ik=ij?.['pathname']['groups']['id'];if(ik)return{'kind':ij['pathname']['groups']['kind'],'id':ik['split']('-')['pop']()??ik};}},ia=ig=>[ig['short_title_display']||ig['title_display'],ig['long_title_display']][js(0x1e3)](Boolean)['join']('\x20-\x20'),ib=async(ig,ih)=>{const jv=js;let ii=new URL(ih),ij=ii['searchParams']['get']('ep_id')??ii['searchParams']['get']('episode_id')??ii['pathname']['split']('/')['filter'](Boolean)[jv(0xbd)](io=>/^\d+$/['test'](io)&&io!==ig),ik=new URL(jv(0x1f4));ik['search']=new URLSearchParams({'season_id':ig,'platform':'web','s_locale':'en_US'})['toString']();let il=(await hN(ik)['then'](io=>io[jv(0xb5)]())['catch'](()=>null))?.['data']?.['sections']?.['flatMap'](io=>io['episodes']??[])??[],im=il['find'](io=>io['episode_id']===ij)??il['find'](io=>io['limit']!==0x1&&io['episode_id'])??il['find'](io=>io['episode_id']);return im?.['episode_id']?{'param':'ep_id','id':im['episode_id'],'title':ia(im)||im['episode_id']}:null;},ic=async ig=>{let ih=i9(ig);return ih?.['id']?ih['kind']==='play'?await ib(ih['id'],ig):{'param':'aid','id':ih['id'],'title':ih['id']}:null;},id=async ig=>{const jw=js;let {id:ih,partId:ii}=await i8(ig);if(!ih)return[];let ij=new URL('https://www.bilibili.com/video/'+ih);ii&&ij['searchParams']['set']('p',ii);let ik=await hN(ij,{'headers':i1})['then'](is=>is['text']())[jw(0x1a9)](()=>'');if(!ik)return hQ['error']('Failed\x20to\x20fetch\x20Bilibili\x20page'),[];let il=i5(i6(ik)?.['data']?.[jw(0x17e)]),im=i3(il?.[jw(0x115)]),io=i3(il?.['audio']);if(!im||!io)return hQ['error']('Could\x20not\x20resolve\x20Bilibili\x20DASH\x20streams'),[];let ip=ii?'_'+ii:'',iq=il['video']['width'],ir=il['video']['height'];return[{'type':'video','title':'bilibili_'+ih+ip+(iq&&ir?'_'+iq+'x'+ir:''),'source':{'url':im,'headers':i1},'context':{'audioUrl':io,'headers':i1}}];},ie=async ig=>{const jx=js;let ih=await ic(ig);if(!ih)return[];let ii=new URL('https://api.bilibili.tv/intl/gateway/web/playurl'),ij=new URLSearchParams({'s_locale':'en_US','platform':'web','qn':'64','type':'0','device':jx(0xce),'tf':'0','spm_id':'bstar-web.ugc-video-detail.0.0','from_spm_id':''});ij['set'](ih['param'],ih['id']),ii['search']=ij['toString']();let ik=await hN(ii)['then'](iq=>iq['json']())['catch'](()=>null),il=ik?.['data']?.['playurl']?.['video']?.[jx(0x181)](iq=>iq['video_resource'])['filter'](iq=>!!iq?.['codecs']?.[jx(0x12d)]('avc1')),im=i5({'video':il,'audio':ik?.['data']?.['playurl']?.['audio_resource']}),io=i3(im?.['video']),ip=i3(im?.['audio']);return!io||!ip?(hQ['error'](jx(0x154)),[]):[{'type':'video','title':'bilibili_tv_'+ih['title'],'source':{'url':io,'headers':i2},'context':{'audioUrl':ip,'headers':i2}}];};hL['exports']=hY({async 'getEntries'({url:ig}){const jy=js;return new URL(ig)['hostname']['endsWith'](jy(0x188))?await ie(ig):await id(ig);},async 'resolveEntry'({entry:ig}){const jz=js;if(!ig['source']?.['url'])throw Error('Bilibili\x20entry\x20is\x20missing\x20source\x20URL');if(!ig['context']?.['audioUrl'])throw Error('Bilibili\x20entry\x20is\x20missing\x20audio\x20URL');let ih=ig['context']['headers'],ii=new hZ({'source':new i0(ig['source']['url'],{'requestInit':{'headers':ih}})});return await ii['addAudioTracks'](new i0(ig[jz(0x1bb)]['audioUrl'],{'requestInit':{'headers':ih}})),{'entry':ig,'input':ii};}});})(hK[jA(0x186)],hK['fetch'],hK[jA(0x100)],hK['cookieStore'],hK['console'],hK[jA(0x16c)],hK['alert'],hK[jA(0x1c7)],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Bilibili','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/16/1f/18/161f189b-5f7f-b305-7314-0f49f50d9ef5/Placeholder.mill/400x400bb-75.webp','matches':[jB(0x90),jB(0x9d),'https://b23.tv/*','https://*.b23.tv/*','https://bilibili.tv/*','https://*.bilibili.tv/*']},'pkg':{'name':'bilibili','version':'0.0.1','private':!0x0,'keywords':[jB(0xab)],'homepage':'https://www.bilibili.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':jB(0x21e)}},'dzen':{'create':hK=>{const jI=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const jC=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=ih=>ih);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'];let hZ=hX['Input'],i0=hX['UrlSource'],i1=hX['CustomPathedSource'];hX['ALL_FORMATS'],hX['DASH'],hX[jC(0x1f8)],hX['HLS'],hX[jC(0x211)],hX['MP4'],hX['MP3'];let i2={'Cookie':'zen_sso_checked=1;\x20zen_vk_sso_checked=1','Referer':'https://dzen.ru/','User-Agent':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36'},i3={...i2},i4=ih=>new URLPattern({'pathname':'/video/watch/:id{/}?','baseURL':'https://dzen.ru'})['exec'](ih)?.['pathname']['groups']['id'],i5=ih=>ih['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),i6=ih=>{let ii=ih['indexOf']('var\x20_params=({\x22ssrData\x22:');if(ii===-0x1)return;let ij=ii+0xd,ik=0x0,il=!0x1,im=!0x1;for(let io=ij;io<ih['length'];io+=0x1){let ip=ih[io];if(il){im?im=!0x1:ip==='\x5c'?im=!0x0:ip==='\x22'&&(il=!0x1);continue;}if(ip==='\x22'){il=!0x0;continue;}if(ip==='{'){ik+=0x1;continue;}if(ip==='}'&&(--ik,ik===0x0))return ih['slice'](ij,io+0x1);}},i7=ih=>{const jD=jC;let ii=i6(ih);if(!ii)return null;try{return JSON['parse'](ii);}catch(ij){return hQ[jD(0x171)]('Failed\x20to\x20parse\x20Dzen\x20page\x20params',ij),null;}},i8=ih=>ih?.['SingleStream']?.[0x0]?.['StreamInfo']?.['find'](ii=>ii['StreamType']==='ST_DASH')?.['OutputStream'],i9=ih=>ih?.['video']?.[jC(0xd9)]?.['find'](ii=>ii['type']==='dash')?.['url'],ia=ih=>ih?.['video']?.[jC(0x1c4)]?.[0x0],ib=ih=>{let ii=ih['match'](/<meta property="og:video" content="([^"]+)"/)?.[0x1];return ii?i5(ii):void 0x0;},ic=ih=>{const jE=jC;let ii=new URL(ih);return ii[jE(0xdc)]['has'](jE(0x13e))||ii['searchParams']['set']('fromCache','1'),ii;},id=(ih,ii)=>{let ij=new URL(ih);return ii?ic(ij)['href']:ij['href'];},ie=(ih,ii)=>i8(ih?.['ssrData']?.['streamsResponse'])??i9(ii),ig=(ih,ii)=>{let ij=new URL(ih);return new i1(ij['href'],({path:ik})=>{const jF=b;let il=new URL(ik,ij);return ij['searchParams']['has'](jF(0x13e))&&!il['searchParams'][jF(0x176)]('fromCache')&&il['searchParams']['set']('fromCache',ij['searchParams']['get']('fromCache')??'1'),new i0(il['href'],{'requestInit':{'headers':ii}});});};hL['exports']=hY({async 'getEntries'({url:ih}){const jG=jC;let ii=i4(ih);if(!ii)return hQ['error']('Could\x20not\x20extract\x20Dzen\x20video\x20id'),[];let ij=await hN(ih,{'headers':i2})['then'](iq=>iq['text']())[jG(0x1a9)](iq=>(iq instanceof Error&&hQ['debug'](iq['message']),''));if(!ij)return hQ['error']('Failed\x20to\x20fetch\x20Dzen\x20page'),[];let ik=i7(ij),il=ik?.['ssrData']?.['videoMetaResponse'],im=ib(ij)??ia(il),io=ie(ik,il),ip=io?id(io,!0x0):im?id(im,!0x1):null;return ip?[{'id':String(il?.['id']??ii),'type':'video','title':il?.['title']?.['trim']()||'dzen_'+ii,'description':il?.['description'],'posterUrl':il?.['image'],'source':{'url':ip,'headers':i3},'context':{'sourceType':io?'dash':'mp4','headers':i3,'shouldAddFromCache':!!io}}]:(hQ['error']('Could\x20not\x20resolve\x20Dzen\x20media\x20URL'),[]);},async 'resolveEntry'({entry:ih}){const jH=jC;if(!ih['source']?.['url'])throw Error('Dzen\x20entry\x20is\x20missing\x20source\x20URL');let ii=ih['context']?.['headers']??i3;return{'entry':ih,'input':new hZ({'source':ih[jH(0x1bb)]?.['sourceType']==='dash'?ig(ih['source']['url'],ii):new i0(ih['source']['url'],{'requestInit':{'headers':ii}})})};}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK[jI(0x11a)]),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Дзен','icon':'https://static.rustore.ru/imgproxy/-tEl5Rb3XmWErz5nEfwBxfqJ_yBBH5l5je89nrHHF7c/preset:web_app_icon_160/plain/https://static.rustore.ru/apk/3054783/content/ICON/87406947-012d-4808-b7b8-97c1398539c1.png@webp','matches':['https://dzen.ru/*','https://*.dzen.ru/*']},'pkg':{'name':'dzen','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://dzen.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'dzen.ts'}},'instagram':{'create':hK=>{const jM=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i4=>i4);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ={'Referer':'https://www.instagram.com/'},i0={'X-IG-App-ID':'936619743392459','User-Agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/107.0.0.0\x20Safari/537.36'},i1=async i4=>{const jJ=b;let i5=new URLSearchParams({'doc_id':'8845758582119845','variables':JSON[jJ(0x209)]({'shortcode':i4,'child_comment_count':0x3,'fetch_comment_count':0x28,'parent_comment_count':0x18,'has_threaded_comments':!0x0})});try{let i6=await hN('https://www.instagram.com/graphql/query/?'+i5['toString'](),{'headers':i0});return i6['ok']?(await i6['json']())[jJ(0xb8)]?.['xdt_shortcode_media']??null:(hQ['error']('GraphQL\x20request\x20failed\x20with\x20status:\x20'+i6['status']),null);}catch(i7){return hQ['error']('Error\x20during\x20GraphQL\x20fetch:',i7),null;}},i2=async i4=>{const jK=b;try{let i5=await hN('https://www.instagram.com/p/'+i4+jK(0x237),{'headers':{'User-Agent':i0['User-Agent']}});if(!i5['ok'])return null;let i6=(await i5['text']())[jK(0x15e)](/window\.__additionalDataLoaded\('extra',\s*({.+?})\s*\);/);return i6?.[0x1]?JSON['parse'](i6[0x1])['shortcode_media']??null:null;}catch(i7){return hQ['error']('Error\x20during\x20embed\x20page\x20fetch:',i7),null;}},i3=i4=>{const jL=b;let i5=i4['edge_media_to_caption']?.['edges']?.[0x0]?.[jL(0x8e)]?.['text']||'Instagram\x20Post',i6=[],i7=i9=>{if(!i9)return;let ia=i9['is_video']&&i9['video_url']?i9['video_url']:i9['display_url'];ia&&i6['push']({'title':i5,'source':{'url':ia,'headers':hZ}});},i8=i4['edge_sidecar_to_children']?.['edges'];if(i8?.['length']){for(let i9 of i8)i7(i9['node']);}else i7(i4);return i6;};hL['exports']=hY({async 'getEntries'({url:i4}){let i5=new URLPattern({'pathname':'/:type(p|reel|tv|reels|videos)/:shortcode{/*}?','baseURL':new URL(i4)['origin']})['exec'](i4)?.['pathname']['groups']['shortcode'];if(!i5)return hQ['error']('Could\x20not\x20extract\x20a\x20valid\x20Instagram\x20shortcode\x20from\x20the\x20URL'),hQ['debug'](i4),[];try{let i6=await i1(i5);return i6||=(hQ['warn']('GraphQL\x20method\x20failed.\x20Falling\x20back\x20to\x20embed\x20page\x20scraping.'),await i2(i5)),i6?i3(i6):(hQ['error']('All\x20extraction\x20methods\x20failed.\x20The\x20post\x20may\x20be\x20private,\x20deleted,\x20or\x20require\x20a\x20login.'),[]);}catch(i7){return hQ['error']('A\x20critical\x20error\x20occurred\x20while\x20fetching\x20Instagram\x20metadata:',i7),[];}}});})(hK['Azot'],hK[jM(0x17d)],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Instagram','icon':'https://is1-ssl.mzstatic.com/image/thumb/Purple221/v4/41/91/13/419113d2-6246-c557-669e-0f0a5c62bcc5/Prod-0-0-1x_U007epad-0-1-0-sRGB-85-220.png/460x0w.webp','matches':['https://instagram.com/*','https://*.instagram.com/*']},'pkg':{'name':'instagram','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://instagram.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':jB(0x12a)}],'type':'module','main':jB(0x110)}},'ntv':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const jN=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i6=>i6);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX[jN(0x140)],hX['confirm'],hX['ask'],hX['utils'];let hZ=hX['Input'],i0=hX['UrlSource'];hX[jN(0x99)],hX['ALL_FORMATS'],hX[jN(0x148)],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let i1=(i6,i7,i8)=>i6['split'](i7)[0x1]?.['split'](i8)[0x0],i2=(i6,i7)=>{const jO=jN;let i8=i1(i6,'<'+i7+'>','</'+i7+'>')?.[jO(0xb7)]();if(!i8)return;let i9=i8['match'](/<!\[CDATA\[(.*?)\]\]>/s);return i9?.[0x1]?i9[0x1]['trim']():i8['split']('DATA[')[0x1]?.['split'](']')[0x0]?.['trim']()||i8;},i3=async(i6,i7)=>{let i8=await hN(i6);return i8['ok']?await i8['text']():(hQ['error']('Failed\x20to\x20fetch\x20'+i7+'.\x20Status:\x20'+i8['status']+'\x20'+i8['statusText']),null);},i4=async(i6,i7,i8)=>{const jP=jN;let i9=new URL(i6)['pathname'],ia=new Set();for(let ic of i7[jP(0x207)]('href=\x22/serial')){if(!ic['startsWith']('/'))continue;let id=ic['split']('\x22')[0x0];!id||id['length']<=0x1||id['includes']('/issues/')||id['includes']('/about/')||id['split']('/')['length']<=0x2||ia['add'](i6['replace'](i9,'/serial'+id));}let ib=[];for(let ie of ia)ib['push'](...await i5(ie,i8));return ib;},i5=async(i6,i7=new Set())=>{const jQ=jN;if(i7['has'](i6))return[];i7['add'](i6);let i8=await i3(i6,'NTV\x20page');if(!i8)return[];let i9=i1(i8,'<meta\x20property=\x22ya:ovs:feed_url\x22\x20content=\x22','\x22>')??i1(i8,'<meta\x20property=\x22ya:ovs:feed_url\x22\x20content=\x22','\x22\x20/>');if(!i9)return new URL(i6)['pathname']['includes']('/serial')?i4(i6,i8,i7):(hQ['error']('Could\x20not\x20find\x20video\x20link\x20in\x20the\x20page.'),[]);let ia=i9['split']('video/')[0x1]?.['split']('/')[0x0];if(!ia)return hQ['error']('Could\x20not\x20parse\x20NTV\x20video\x20id.'),[];let ib=await i3('https://www.ntv.ru/vi'+ia+'/','NTV\x20XML\x20metadata');if(!ib)return[];let ic=i2(ib,'dash')||i2(ib,'hls'),id=i2(ib,'file')||i2(ib,'video'),ie=i2(ib,'hifile')||i2(ib,jQ(0x1e2))||ic||id;if(!ie)return hQ['error'](jQ(0x1d4)),[];let ig=i1(ib,'<embed_tag>','</embed_tag>')||'NTV',ih=i1(i8,'\x22name\x22:\x22','\x22'),ii=ih?.['includes']('серия')?ih['split']('-')[0x0]:void 0x0,ij=ii?parseInt(ii,0xa):void 0x0,ik=i1(ib,'<subtitles>','</subtitles>'),il=ik?'https://www.ntv.ru'+ik:void 0x0;return il&&hQ['debug']('Subtitles:\x20'+il),[{'type':ij?'episode':'video','title':ig,'seasonNumber':ij?0x1:void 0x0,'episodeNumber':ij,'source':{'url':ie},'context':il?{'subtitles':[{'url':il,'language':'ru','label':'Russian'}]}:void 0x0}];};hL['exports']=hY({'getEntries'({url:i6}){return i5(i6,new Set());},'resolveEntry'({entry:i6}){const jR=jN;if(!i6['source']?.['url'])throw Error('NTV\x20entry\x20is\x20missing\x20source\x20URL');let i7=new hZ({'source':new i0(i6['source']['url'])}),i8=i6['context']?.['subtitles']??[];for(let i9 of i8)i7['addSubtitleTrack'](new i0(i9[jR(0x170)]),{'languageCode':i9[jR(0x12f)],'name':i9['label']});return{'entry':i6,'input':i7};}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'НТВ','icon':'https://static.ntv.ru/static/images/logo.png','matches':['https://ntv.ru/*','https://*.ntv.ru/*']},'pkg':{'name':'ntv','version':'0.0.9','private':!0x0,'keywords':['tv-channels'],'homepage':'https://www.ntv.ru/','author':{'name':jB(0x186),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':jB(0x11f),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'ntv.ts'}},'ok':{'create':hK=>{const jX=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const jS=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i7=>i7);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX[jS(0x172)],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ={'ultra':jS(0x1d3),'quad':'1440','full':'1080','hd':'720','sd':'480','low':'360','lowest':'240','mobile':'144'},i0=['/video/:id{/}?','/videoembed/:id{/}?'],i1={'Referer':'https://ok.ru/','User-Agent':'Azot'},i2=i7=>i7['replaceAll']('&quot;','\x22')['replaceAll']('&#34;','\x22')['replaceAll'](jS(0x22e),'<')['replaceAll']('&gt;','>')['replaceAll']('&#38;','&')[jS(0xd0)]('&amp;','&'),i3=i7=>{const jT=jS;let i8=new URL(i7);for(let i9 of i0){let ia=new URLPattern({'pathname':i9,'baseURL':i8[jT(0xe3)]})['exec'](i7)?.[jT(0x1d5)]['groups']['id'];if(ia)return ia;}},i4=i7=>{const jU=jS;let i8=(i7['match'](/<div\b[^>]*\bdata-module=(["'])OKVideo\1[^>]*>/)?.[0x0])?.['match'](/\bdata-options=(["'])(.*?)\1/)?.[0x2];if(!i8)return null;try{let i9=JSON['parse'](i2(i8))['flashvars']?.['metadata'];return i9?JSON[jU(0x22d)](i9):null;}catch(ia){return hQ['error']('Failed\x20to\x20parse\x20OK\x20video\x20metadata',ia),null;}},i5=i7=>{const jV=jS;let i8=i7?.['replace']('p','')[jV(0xb7)]();return i8==='max'?void 0x0:i8;},i6=(i7,i8)=>{let i9=i5(i8),ia=i7['filter'](ib=>ib['url']&&!ib['disallowed']);if(!ia['length'])return null;if(i9){let ib=ia['find'](ic=>hZ[ic['name']]===i9);if(ib)return ib;}return ia[ia['length']-0x1]??null;};hL['exports']=hY({async 'getEntries'({url:i7,options:i8}){const jW=jS;let i9=i3(i7);if(!i9)return hQ['error']('Could\x20not\x20extract\x20OK\x20video\x20id'),[];let ia=await hN('https://ok.ru/video/'+i9,{'headers':i1})['then'](id=>id['text']())['catch'](()=>'');if(!ia)return hQ['error']('Failed\x20to\x20fetch\x20OK\x20page'),[];let ib=i4(ia);if(!ib)return hQ[jW(0x171)]('Could\x20not\x20find\x20OK\x20video\x20metadata'),[];if(ib['provider']!=='UPLOADED_ODKL')return hQ['error']('Only\x20uploaded\x20OK\x20videos\x20are\x20supported'),[];if(ib['movie']?.['is_live']||ib['movie']?.['isLive'])return hQ['error']('Live\x20videos\x20are\x20not\x20supported'),[];let ic=i6(ib['videos']??[],i8['videoQuality']);return ic?.['url']?[{'type':'video','title':ib['movie']?.['title']?.['trim']()||'ok_'+i9,'author':(ib['author']?.['name']||ib['compilationTitle'])?.['trim'](),'source':{'url':ic[jW(0x170)],'headers':i1}}]:(hQ['error']('Could\x20not\x20resolve\x20OK\x20video\x20URL'),[]);}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK[jX(0x1c7)],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Одноклассники','icon':'https://static.rustore.ru/imgproxy/3K8k512mmBApngIYFxLq_LcqLT_xX45QffI5-IOnvxE/preset:web_app_icon_160/plain/https://static.rustore.ru/apk/330175/content/ICON/0b2a5609-500b-4396-a389-f6f884163563.jpg@webp','matches':['https://ok.ru/*',jB(0x8d)]},'pkg':{'name':'ok','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://ok.ru/','author':{'name':jB(0x186),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'ok.ts'}},'rbc':{'create':hK=>{const k0=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const jY=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=hZ=>hZ);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX[jY(0x106)],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'],hL['exports']=hY({async 'getEntries'({url:hZ}){const jZ=jY;let i0=await hN(hZ);if(!i0['ok'])throw Error('Failed\x20to\x20fetch\x20RBC\x20page:\x20'+i0['status']+'\x20'+i0['statusText']);let i1=(await i0['text']())[jZ(0x15e)](/(?:https?:)?\/\/[^\s"'<>]+\.m3u8(?:\?[^\s"'<>]*)?/i)?.[0x0];if(!i1)throw Error('Could\x20not\x20find\x20RBC\x20playlist\x20URL.');return[{'type':'video','source':{'url':i1['startsWith']('//')?'https:'+i1:i1}}];}});})(hK['Azot'],hK['fetch'],hK[k0(0x100)],hK['cookieStore'],hK['console'],hK['prompt'],hK[k0(0xda)],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'РБК','icon':'https://static.rustore.ru/imgproxy/A-G-s2Q1x2iqq3qHCAo66-nllrtlqEr7XNU_JKXt4mQ/preset:web_app_icon_160/aHR0cHM6Ly9zdGF0aWMucnVzdG9yZS5ydS80MGViMWY3MS1kMDkzLTQ2NDMtOTkyNi0xZWM0ZjkwNzViMTQ=.webp','matches':['https://rbc.ru/*','https://*.rbc.ru/*']},'pkg':{'name':'rbc','version':'0.0.2','private':!0x0,'keywords':['news'],'homepage':'https://rbc.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'rbc.ts'}},'rutube':{'create':hK=>{const k5=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const k1=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i2=>i2);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX[k1(0x106)],hX[k1(0x1dd)],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ=['/video/:id{/}?','/play/embed/:id{/}?','/shorts/:id{/}?','/yappy/:yappyId{/}?','/video/private/:id{/}?'],i0=i2=>{const k2=k1;let i3={'yappyId':'','id':'','key':''};i3['key']=new URL(i2)['searchParams'][k2(0xed)]('p')??'';for(let i4 of hZ){let i5=new URLPattern(i4,'https://rutube.ru')['exec'](i2);i5&&(Object['assign'](i3,i5['pathname']['groups']),Object['assign'](i3,i5['search']['groups']));}return i3;},i1=async i2=>{const k3=k1;let i3=(await hN('https://rutube.ru/pangolin/api/web/yappy/yappypage/?client=wdp&videoId='+i2+k3(0x203))['then'](i4=>i4['json']())['catch'](()=>null))?.['results']?.['find'](i4=>String(i4['id'])===i2)?.['link'];return i3?[{'type':'video','title':'rutube_yappy_'+i2,'source':{'url':i3}}]:(hQ['error']('ErrorEmptyDownload'),[]);};hL['exports']=hY({async 'getEntries'({url:i2}){const k4=k1;let i3=i0(i2);if(i3['yappyId'])return i1(i3['yappyId']);if(!i3['id'])return hQ[k4(0x171)]('Could\x20not\x20extract\x20Rutube\x20video\x20id'),[];let i4=new URL('https://rutube.ru/api/play/options/'+i3['id']+'/?no_404=true&referer&pver=v2');i3['key']&&i4['searchParams']['set']('p',i3['key']);let i5=await hN(i4)['then'](i6=>i6[k4(0xb5)]())['catch'](i6=>(i6 instanceof Error&&hQ['debug'](i6['message']),null));return i5?i5['detail']||!i5['video_balancer']?.['m3u8']?(hQ['error']('Play\x20info\x20is\x20empty'),[]):i5[k4(0xf2)]?.['hls']?(hQ[k4(0x171)]('Live\x20videos\x20are\x20not\x20supported'),[]):[{'type':'video','title':i5['title']?.['trim']()||'rutube_'+i3['id'],'source':{'url':i5['video_balancer'][k4(0x167)]}}]:(hQ['error']('Cannot\x20fetch\x20play\x20info'),[]);}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL[k5(0x127)];},'manifest':{'manifestVersion':0x1,'displayName':'RUTUBE','icon':'https://static.rustore.ru/imgproxy/vcyBc0LG-3ybXcGs_-_OJXH9ULjoegHlLs-DacemG08/preset:app_card_icon/aHR0cHM6Ly9zdGF0aWMucnVzdG9yZS5ydS9hcGsvMjQ2MjA3L2NvbnRlbnQvSUNPTi9hNTZhZWJlMy01NjVhLTRiZjYtOTQyZC0xZjE0OTk0YjlhNmUucG5n.webp','matches':['https://rutube.ru/*','https://*.rutube.ru/*']},'pkg':{'name':'rutube','version':'0.0.13','private':!0x0,'keywords':['video-hostings'],'homepage':'https://rutube.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'rutube.ts'}},'smotrim':{'create':hK=>{const ka=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const k6=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i7=>i7);let hY=hX[k6(0x236)];hX['version'],hX[k6(0xf3)],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'];let hZ=hX['Input'],i0=hX['UrlSource'];hX[k6(0x99)],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX[k6(0x228)],hX['HLS_FORMATS'],hX[k6(0x189)],hX[k6(0x138)];let i1='https://player-api.smotrim.ru/api/v1',i2=(i7,i8)=>{const k7=k6;let i9=new URL(i7);return new URLPattern({'pathname':'/'+i8+k7(0x18c),'baseURL':i9['origin']})['exec'](i7)?.['pathname']['groups']['id'];},i3=(i7,i8)=>{let i9=i8==='video'?[/playing[_-]video=(\d+)/i,/playing[_-]full_video=(\d+)/i]:[/playing[_-]audio=(\d+)/i],ia=i7['search']+'&'+i7['hash']['replace'](/^#/,'');for(let ib of i9){let ic=ia['match'](ib)?.[0x1];if(ic)return ic;}},i4=i7=>{let i8=new URL(i7);for(let i9 of['video','audio']){let ia=i2(i7,i9)??i3(i8,i9);if(ia)return{'id':ia,'kind':i9};}return null;},i5=i7=>i7?.['large']||i7?.['medium']||i7?.['small'],i6=(i7,i8)=>i8==='audio'?i7['streams']?.['mp3']||i7[k6(0x202)]?.['m3u8']||i7['streams']?.['http']:i7['streams']?.['m3u8']||i7['streams']?.['http'];hL['exports']=hY({async 'getEntries'({url:i7}){const k8=k6;let i8=i4(i7);if(!i8)return hQ['error']('Could\x20not\x20extract\x20Smotrim\x20media\x20id'),[];let i9=await hN('https://player-api.smotrim.ru/api/v1/'+i8['kind']+'/'+i8['id'])['then'](ij=>ij['json']())['catch'](ij=>(ij instanceof Error&&hQ['debug'](ij['message']),null));if(!i9)return hQ['error']('Cannot\x20fetch\x20Smotrim\x20media\x20info'),[];if(i9['status']!=='OK'||!i9['data'])return hQ['error'](i9['notice']||'Smotrim\x20media\x20info\x20is\x20empty'),[];let ia=i9['data'],ib=i6(ia,i8['kind']);if(!ib)return hQ[k8(0x171)]('Could\x20not\x20resolve\x20Smotrim\x20media\x20URL'),[];let ic=ia['brand']?.['title']?.['trim'](),id=ia['title']?.['trim'](),ie=ia['episode']?.['title']?.['trim'](),ig=ic||id||'smotrim_'+i8['id'],ih=i8[k8(0x15a)]===k8(0xe7)?'audio':ia['episode']?'episode':'video',ii=ia[k8(0xaa)]?.[k8(0x1e3)](ij=>ij['vtt'])['map'](ij=>({'url':ij[k8(0x1b1)],'language':ij['code'],'label':ij['title']}))??[];return[{'id':String(ia['publicId']??i8['id']),'type':ih,'title':ig,'episodeTitle':ie||(ic?id:void 0x0),'seasonNumber':ia['episode']?.['season']?.['number'],'episodeNumber':ia['episode']?.['number'],'posterUrl':i5(ia['episode']?.[k8(0x11b)])||i5(ia['brand']?.['poster']),'year':ia['brand']?.['yearReleasedFrom'],'url':ia['shareLink']||'https://smotrim.ru/'+i8['kind']+'/'+i8['id'],'source':{'url':ib},'context':ii['length']?{'subtitles':ii}:void 0x0}];},'resolveEntry'({entry:i7}){const k9=k6;if(!i7['source']?.['url'])throw Error('Smotrim\x20entry\x20is\x20missing\x20source\x20URL');let i8=new hZ({'source':new i0(i7['source']['url'])}),i9=i7['context']?.['subtitles']??[];for(let ia of i9)i8[k9(0x1bd)](new i0(ia['url']),{'languageCode':ia['language'],'name':ia['label']});return{'entry':i7,'input':i8};}});})(hK[ka(0x186)],hK['fetch'],hK['localStorage'],hK[ka(0x93)],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK[ka(0x11a)]),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Смотрим','icon':'https://static.rustore.ru/imgproxy/uH0PgALto0YjcSkOPkEgY_wre6dd04edOXPijHVnQEE/preset:web_app_icon_160/plain/https://static.rustore.ru/2026/3/23/b0/apk/1085375/content/ICON/e9aaac4f-63fa-4a97-a81c-8f27f7ab37e4.png@webp','matches':['https://smotrim.ru/*','https://*.smotrim.ru/*']},'pkg':{'name':'smotrim','version':'0.0.1','private':!0x0,'keywords':['tv-channels','video-hostings'],'homepage':'https://smotrim.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'smotrim.ts'}},'soundcloud':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kb=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i4=>i4);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'];let hZ=hX['utils'];hX[kb(0xa8)],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let i0={'version':'','id':''},i1=async()=>{const kd=kb;try{let i4=await hN('https://soundcloud.com/')['then'](i7=>i7['text']())['catch'](i7=>{const kc=b;let i8=i7 instanceof Error&&i7['cause']!=null?String(i7['cause']):'';return i7 instanceof Error&&i8['includes'](kc(0x147))&&hQ['warn']('Soundcloud\x20may\x20be\x20blocked\x20in\x20your\x20region.\x20Use\x20proxy\x20or\x20VPN\x20to\x20bypass\x20restrictions.'),'';}),i5=i4['match'](/window\.__sc_version="([0-9]{10})"/)?.[0x1];if(i5&&i0['version']===i5)return i0['id'];let i6=i4['match'](/"hydratable"\s*:\s*"apiClient"\s*,\s*"data"\s*:\s*\{\s*"id"\s*:\s*"([^"]+)"/)?.[0x1]??'';for(let i7 of i4['matchAll'](/<script.+src="(.+)">/g)){if(i6)break;let i8=i7[0x1];if(!i8?.[kd(0x1b3)]('https://a-v2.sndcdn.com/'))continue;let i9=await hN(i8)['then'](ib=>ib['text']())['catch'](()=>''),ia=i9['match'](/\("client_id=([A-Za-z0-9]{32})"\)/)?.[0x1]??i9['match'](/,client_id:"([A-Za-z0-9]{32})",/)?.[0x1]??i9['match'](/client_id=([A-Za-z0-9]{32})/)?.[0x1];if(ia){i6=ia;break;}}return i5&&(i0['version']=i5,i0['id']=i6),i6;}catch{return'';}},i2=i4=>i4['audioCodecs']?.['some'](i5=>i5==='aac'||i5==='mp3')??!0x1,i3=(i4,i5)=>{let i6;for(let i7 of i4){let i8=i7['format']?.['protocol'];if(!(i7['snipped']||i8?.['includes']('encrypted'))&&i7['preset']?.['startsWith'](i5+'_')){if(i8==='progressive')return i7;i6=i7;}}return i6;};hL['exports']=hY({async 'getEntries'({url:i4,options:i5}){const ke=kb;let {author:i6,song:i7,accessKey:i8,shortLink:i9}=hZ['execUrlPatterns'](i4,[':author/:song/s-:accessKey',':author/:song',':shortLink'],['https://soundcloud.com',ke(0x16f)])['pathname'],ia=await i1();if(!ia)throw Error('No\x20client\x20ID');let ib;if(new URL(i4)['hostname']==='on.soundcloud.com'&&i9&&(ib=await hN('https://on.soundcloud.com/'+i9+'/',{'redirect':'manual'})['then'](ij=>{let ik=ij['headers']['get']('location');if(ij['status']===0x12e&&ik?.['startsWith']('https://soundcloud.com/'))return ik['split']('?',0x1)[0x0];})['catch'](()=>void 0x0)),!ib&&i6&&i7&&(ib='https://soundcloud.com/'+i6+'/'+i7+(i8?'/s-'+i8:'')),!ib)throw Error('Could\x20not\x20fetch');let ic=await hN('https://api-v2.soundcloud.com/resolve?url='+ib+'&client_id='+ia)['then'](ij=>ij['status']===0xc8?ij['json']():null)['catch'](()=>null);if(!ic)throw Error('Could\x20not\x20fetch');let id=ic['media']?.[ke(0x160)];if(!id?.['length'])throw Error('Empty\x20download');let ie=i3(id,'opus'),ig=i3(id,ke(0x10f));if(ig&&(i2(i5)||!ie)&&(ie=ig),!ie)throw Error('Empty\x20download');let ih=''+ie[ke(0x170)]+(ie['url']['includes']('?')?'&':'?')+'client_id='+ia+'&track_authorization='+ic['track_authorization'];if(!ih['startsWith']('https://api-v2.soundcloud.com/media/soundcloud:tracks:'))throw Error('Empty\x20download');let ii=await hN(ih)['then'](async ij=>(await ij['json']())['url']??'')['catch'](()=>'');if(!ii)throw Error('Could\x20not\x20fetch');return[{'type':'audio','title':ic['title']['trim'](),'author':ic['user']['username']['trim'](),'source':{'url':ii}}];}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'SoundCloud','icon':'https://play-lh.googleusercontent.com/JSSeB3XQtb9sHD5FWTqVM4AksY_Kg2q20eExenxGqPJZdn2uVQxi8eoHkP5MA-IR4w=w480-h960-rw','matches':['https://soundcloud.com/*','https://*.soundcloud.com/*']},'pkg':{'name':'soundcloud','version':'0.0.6','private':!0x0,'keywords':['music'],'homepage':'https://soundcloud.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'soundcloud.ts'}},'tiktok':{'create':hK=>{const kk=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kf=b;let hX=hM??Streamyx??{};hX&&(hX[kf(0x236)]||=id=>id);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX[kf(0x16c)],hX['notify'],hX[kf(0x1ba)],hX['ask'],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX[kf(0x138)];let hZ='https://www.tiktok.com/',i0='__UNIVERSAL_DATA_FOR_REHYDRATION__',i1=(id,ie)=>id['match'](RegExp('<script[^>]+id=[\x22\x27]'+ie+'[\x22\x27][^>]*>(.*?)</script>','s'))?.[0x1]?.['trim'](),i2=(id,ie)=>{const kg=kf;try{return JSON['parse'](id);}catch(ig){return hQ[kg(0x171)]('Failed\x20to\x20parse\x20TikTok\x20page\x20JSON',ig,{'url':ie}),null;}},i3=id=>{try{return JSON['parse']('\x22'+id['replace'](/"/g,'\x5c\x22')+'\x22');}catch{return id['replaceAll']('\x5cu002F','/')['replaceAll']('\x5c/','/');}},i4=id=>{try{return new URL(id)['pathname']['match'](/\/(?:video|photo)\/(\d+)/)?.[0x1]??null;}catch{return null;}},i5=id=>{const kh=kf;let ie=id[kh(0x15e)](/<a\s+href="([^"]*tiktok\.com[^"]*)"/)?.[0x1];if(ie)return ie['replaceAll']('&amp;','&');let ig=id['match'](/<meta[^>]+property=["']og:url["'][^>]+content=["']([^"']+)["']/)?.[0x1];return ig?ig['replaceAll']('&amp;','&'):null;},i6=id=>'https://www.tiktok.com/@i/video/'+id,i7=async id=>{let ie=await hN(id);return ie['ok']?await ie['text']():(hQ['error']('Failed\x20to\x20fetch\x20TikTok\x20page.\x20Status:\x20'+ie['status']),null);},i8=(id,ie)=>{let ig=[id],ih=i5(ie);ih&&ig['push'](ih);let ii=i4(ih??id);return ii&&ig['push'](i6(ii)),[...new Set(ig)];},i9=(id,ie)=>{let ig=i1(id,'__UNIVERSAL_DATA_FOR_REHYDRATION__');if(!ig)return null;let ih=i2(ig,ie)?.['__DEFAULT_SCOPE__']?.['webapp.video-detail'],ii=ih?.['itemInfo']?.['itemStruct']??null;return!ii&&ih?.['statusMsg']&&hQ['error']('Error\x20'+ih['statusCode']+':\x20'+ih['statusMsg']),ii;},ia=id=>{let ie=id['match'](/"downloadAddr"\s*:\s*"([^"]+)"/)??id['match'](/"playAddr"\s*:\s*"([^"]+)"/);return ie?.[0x1]?i3(ie[0x1]):null;},ib=id=>{let ie=id['match'](/"desc"\s*:\s*"([^"]*)"/)?.[0x1];if(ie)return i3(ie);let ig=id['match'](/<title[^>]*>([^<]+)<\/title>/)?.[0x1]?.['trim']();return!ig||ig==='TikTok\x20-\x20Make\x20Your\x20Day'?null:ig['split']('|')['slice'](0x0,-0x1)['join']('|')['trim']()||ig;},ic=()=>{const ki=kf;let id={'Referer':'https://www.tiktok.com/'};return hU[ki(0x1b0)]&&(id['Cookie']=hU['cookie']),id;};hL['exports']=hY({async 'getEntries'({url:id}){const kj=kf;let ie=await i7(id);if(!ie)return[];for(let ig of i8(id,ie)){let ih=ig===id?ie:await i7(ig);if(!ih)continue;let ii=i9(ih,ig),ij=ii?.[kj(0x115)]?.['downloadAddr']??ii?.['video']?.['playAddr']??ia(ih);if(ij)return[{'type':'video','title':ii?.['desc']||ib(ih)||'TikTok\x20Video','source':{'url':ij,'headers':ic()}}];}return hQ['error']('Could\x20not\x20find\x20TikTok\x20media\x20data.\x20The\x20content\x20might\x20be\x20unavailable\x20or\x20the\x20structure\x20has\x20changed.'),[];}});})(hK['Azot'],hK[kk(0x17d)],hK['localStorage'],hK[kk(0x93)],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'TikTok','shortName':'TT','icon':'https://play-lh.googleusercontent.com/LdBITldj-tJxqLm-CsWSbnt4BMo2gk53cgM7mWIL-zn44m1ywLyQgxRsHKqp8r0qceXs=w480-h960-rw','permissions':[],'matches':['https://tiktok.com/*','https://*.tiktok.com/*']},'pkg':{'name':'tiktok','version':jB(0x1ce),'private':!0x0,'keywords':['social-networks'],'homepage':'https://www.tiktok.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'tiktok.ts'}},'twitch':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kl=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=ib=>ib);let hY=hX[kl(0x236)];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX[kl(0x1dd)],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX[kl(0x1f8)],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ='https://gql.twitch.tv/gql',i0={'Client-ID':'kimne78kx3ncx6brgo4mv6wki5h1ko','Content-Type':kl(0x173)},i1='query\x20PlaybackAccessToken_Template($login:\x20String!,\x20$isLive:\x20Boolean!,\x20$vodID:\x20ID!,\x20$isVod:\x20Boolean!,\x20$playerType:\x20String!)\x20{\x20streamPlaybackAccessToken(channelName:\x20$login,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isLive)\x20{\x20value\x20signature\x20authorization\x20{\x20isForbidden\x20forbiddenReasonCode\x20}\x20__typename\x20}\x20videoPlaybackAccessToken(id:\x20$vodID,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isVod)\x20{\x20value\x20signature\x20__typename\x20}}',i2=async ib=>{let ic=await hN('https://gql.twitch.tv/gql',{'method':'POST','headers':i0,'body':JSON['stringify'](ib)})['catch'](id=>(id instanceof Error&&hQ['debug'](id['message']),null));return ic?ic['ok']?await ic['json']()['catch'](()=>null):(hQ['error']('Twitch\x20GraphQL\x20request\x20failed:\x20'+ic['status']+'\x20'+ic['statusText']),null):(hQ['error']('Failed\x20to\x20fetch\x20Twitch\x20GraphQL\x20endpoint'),null);},i3=ib=>{const km=kl;let ic=new URL(ib),id=ic['hostname'][km(0x91)](),ie=ic['pathname']['split']('/')['filter'](Boolean);return id['endsWith']('clips.twitch.tv')?ie[0x0]?{'type':'clip','id':ie[0x0]}:null:ie[0x0]==='videos'&&ie[0x1]?{'type':'vod','id':ie[0x1]}:ie[0x1]===km(0x126)&&ie[0x2]?{'type':'clip','id':ie[0x2]}:ie[0x0]==='clip'&&ie[0x1]?{'type':'clip','id':ie[0x1]}:null;},i4=(ib,ic)=>{const kn=kl;if(!ic?.['signature']||!ic['value'])return null;let id=new URL(ib);return id['searchParams']['set'](kn(0x22f),ic['signature']),id['searchParams']['set']('token',ic['value']),id['href'];},i5=ib=>{let ic=ib?.['filter'](ie=>ie['sourceURL'])??[],id;for(let ie of ic){let ig=Number['parseInt'](ie['quality']??'0',0xa),ih=Number['parseInt'](id?.['quality']??'0',0xa);(!id||ig>ih)&&(id=ie);}return id;},i6=ib=>ib?.['displayName']||ib?.['login'],i7=async ib=>(await i2([{'operationName':'VideoAccessToken_Clip','variables':{'slug':ib},'extensions':{'persistedQuery':{'version':0x1,'sha256Hash':kl(0xb6)}}}]))?.[0x0]?.['data']?.[kl(0x126)]?.['playbackAccessToken']??null,i8=async ib=>(await i2({'operationName':'PlaybackAccessToken_Template','query':'query\x20PlaybackAccessToken_Template($login:\x20String!,\x20$isLive:\x20Boolean!,\x20$vodID:\x20ID!,\x20$isVod:\x20Boolean!,\x20$playerType:\x20String!)\x20{\x20streamPlaybackAccessToken(channelName:\x20$login,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isLive)\x20{\x20value\x20signature\x20authorization\x20{\x20isForbidden\x20forbiddenReasonCode\x20}\x20__typename\x20}\x20videoPlaybackAccessToken(id:\x20$vodID,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isVod)\x20{\x20value\x20signature\x20__typename\x20}}','variables':{'isLive':!0x1,'login':'','isVod':!0x0,'vodID':ib,'playerType':'site'}}))?.['data']?.['videoPlaybackAccessToken']??null,i9=async ib=>{let ic=(await i2({'query':'query\x20{\x20clip(slug:\x20'+JSON['stringify'](ib)+')\x20{\x20id\x20slug\x20title\x20durationSeconds\x20thumbnailURL(width:\x20640,\x20height:\x20360)\x20broadcaster\x20{\x20login\x20displayName\x20}\x20curator\x20{\x20login\x20displayName\x20}\x20videoQualities\x20{\x20quality\x20sourceURL\x20frameRate\x20}\x20}\x20}'}))?.['data']?.['clip'];if(!ic)return hQ['error']('Could\x20not\x20resolve\x20Twitch\x20clip\x20metadata'),[];let id=i5(ic['videoQualities']),ie=await i7(ib),ig=id?.['sourceURL']?i4(id['sourceURL'],ie):null;return ig?[{'id':ic['id']??ic['slug']??ib,'type':'video','title':ic['title']?.['trim']()||'twitch_clip_'+ib,'posterUrl':ic['thumbnailURL'],'author':i6(ic['broadcaster']),'source':{'url':ig}}]:(hQ['error']('Could\x20not\x20resolve\x20Twitch\x20clip\x20media\x20URL'),[]);},ia=async ib=>{const ko=kl;let [ic,id]=await Promise['all']([i2({'query':'query\x20{\x20video(id:\x20'+JSON['stringify'](ib)+')\x20{\x20id\x20title\x20description\x20createdAt\x20lengthSeconds\x20previewThumbnailURL(width:\x20640,\x20height:\x20360)\x20owner\x20{\x20login\x20displayName\x20}\x20}\x20}'}),i8(ib)]),ie=ic?.['data']?.['video'];if(!ie)return hQ['error']('Could\x20not\x20resolve\x20Twitch\x20VOD\x20metadata'),[];let ig=i4('https://usher.ttvnw.net/vod/'+ib+'.m3u8',id);if(!ig)return hQ[ko(0x171)]('Could\x20not\x20resolve\x20Twitch\x20VOD\x20playlist\x20URL'),[];let ih=new URL(ig);return ih['searchParams']['set']('allow_source','true'),ih['searchParams']['set'](ko(0xf5),'true'),[{'id':ie['id']??ib,'type':'video','title':ie['title']?.['trim']()||'twitch_vod_'+ib,'description':ie['description'],'posterUrl':ie['previewThumbnailURL'],'author':i6(ie['owner']),'source':{'url':ih['href']}}];};hL['exports']=hY({async 'getEntries'({url:ib}){const kp=kl;let ic=i3(ib);return ic?ic['type']===kp(0x126)?await i9(ic['id']):await ia(ic['id']):(hQ['error']('Could\x20not\x20extract\x20Twitch\x20video\x20or\x20clip\x20id'),[]);}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Twitch','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/83/19/c0/8319c058-a099-c1ed-8b10-eb4a3f2fe98e/Placeholder.mill/400x400bb-75.webp','matches':['https://twitch.tv/*','https://*.twitch.tv/*','https://clips.twitch.tv/*','https://*.clips.twitch.tv/*']},'pkg':{'name':'twitch','version':'0.0.1','private':!0x0,'keywords':['video-hostings','streaming'],'homepage':'https://www.twitch.tv/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':jB(0x12a)}],'type':'module','main':'twitch.ts'}},'twitter':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kq=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=im=>im);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX[kq(0x172)],hX[kq(0x16c)],hX['notify'],hX['confirm'],hX['ask'],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX[kq(0x228)],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ='https://api.x.com/graphql/4Siu98E55GquhG52zHdY5w/TweetDetail',i0='https://api.x.com/1.1/guest/activate.json',i1='AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',i2='Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36',i3={'rweb_video_screen_enabled':!0x1,'payments_enabled':!0x1,'rweb_xchat_enabled':!0x1,'profile_label_improvements_pcf_label_in_post_enabled':!0x0,'rweb_tipjar_consumption_enabled':!0x0,'verified_phone_label_enabled':!0x1,'creator_subscriptions_tweet_preview_api_enabled':!0x0,'responsive_web_graphql_timeline_navigation_enabled':!0x0,'responsive_web_graphql_skip_user_profile_image_extensions_enabled':!0x1,'premium_content_api_read_enabled':!0x1,'communities_web_enable_tweet_community_results_fetch':!0x0,'c9s_tweet_anatomy_moderator_badge_enabled':!0x0,'responsive_web_grok_analyze_button_fetch_trends_enabled':!0x1,'responsive_web_grok_analyze_post_followups_enabled':!0x0,'responsive_web_jetfuel_frame':!0x0,'responsive_web_grok_share_attachment_enabled':!0x0,'articles_preview_enabled':!0x0,'responsive_web_edit_tweet_api_enabled':!0x0,'graphql_is_translatable_rweb_tweet_is_translatable_enabled':!0x0,'view_counts_everywhere_api_enabled':!0x0,'longform_notetweets_consumption_enabled':!0x0,'responsive_web_twitter_article_tweet_consumption_enabled':!0x0,'tweet_awards_web_tipping_enabled':!0x1,'responsive_web_grok_show_grok_translated_post':!0x1,'responsive_web_grok_analysis_button_from_backend':!0x0,'creator_subscriptions_quote_tweet_preview_enabled':!0x1,'freedom_of_speech_not_reach_fetch_enabled':!0x0,'standardized_nudges_misinfo':!0x0,'tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled':!0x0,'longform_notetweets_rich_text_read_enabled':!0x0,'longform_notetweets_inline_media_enabled':!0x0,'responsive_web_grok_image_annotation_enabled':!0x0,'responsive_web_grok_imagine_annotation_enabled':!0x0,'responsive_web_grok_community_note_auto_translation_is_enabled':!0x1,'responsive_web_enhance_cards_enabled':!0x1},i4={'withArticleRichContentState':!0x0,'withArticlePlainText':!0x1,'withGrokAnalyze':!0x1,'withDisallowedReplyControls':!0x1},i5={'User-Agent':kq(0x13a),'Referer':'https://x.com/'},i6={...i5,'Authorization':'Bearer\x20AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA','x-twitter-client-language':'en','x-twitter-active-user':'yes','accept-language':'en'},i7=null,i8=im=>new URL(im)['pathname']['match'](/\/(?:i\/)?(?:status|statuses)\/(\d+)/)?.[0x1]??null,i9=im=>{const kr=kq;let io=new URL(im);return io['searchParams']['delete']('tag'),io[kr(0x1ad)];},ia=im=>{let io=im?.['filter'](iq=>iq['content_type']==='video/mp4'&&iq['url']);if(!io?.['length'])return null;let ip=io[0x0];for(let iq of io)Number(iq['bitrate']??0x0)>Number(ip['bitrate']??0x0)&&(ip=iq);return ip['url']?i9(ip['url']):null;},ib=async(im=!0x1)=>(i7&&!im||(i7=(await hN('https://api.x.com/1.1/guest/activate.json',{'method':'POST','headers':i6})['then'](io=>io['ok']?io['json']():null)['catch'](()=>null))?.['guest_token']??null),i7),ic=im=>(Number(im)/0x38d7ea4c68000*Math['PI'])['toString'](0x24)[kq(0x133)](/(0+|\.)/g,''),id=async im=>{const ks=kq;let io=new URL('https://cdn.syndication.twimg.com/tweet-result');io['searchParams']['set']('id',im),io[ks(0xdc)]['set']('token',ic(im));let ip=await hN(io,{'headers':i5})['catch'](iq=>(iq instanceof Error&&hQ['debug'](iq['message']),null));return ip?ip['ok']?await ip['json']():(hQ['debug']('Twitter\x20syndication\x20request\x20failed:\x20'+ip['status']),null):null;},ie=async(im,io)=>{const kt=kq;let ip=new URL('https://api.x.com/graphql/4Siu98E55GquhG52zHdY5w/TweetDetail');ip['searchParams']['set']('variables',JSON['stringify']({'focalTweetId':im,'with_rux_injections':!0x1,'rankingMode':'Relevance','includePromotedContent':!0x0,'withCommunity':!0x0,'withQuickPromoteEligibilityTweetFields':!0x0,'withBirdwatchNotes':!0x0,'withVoice':!0x0})),ip['searchParams']['set'](kt(0x1e8),JSON[kt(0x209)](i3)),ip['searchParams']['set']('fieldToggles',JSON['stringify'](i4));let iq={...i6,'content-type':'application/json','x-guest-token':io,'Cookie':'guest_id='+encodeURIComponent('v1:'+io)},ir=await hN(ip,{'headers':iq})['catch'](is=>(is instanceof Error&&hQ['debug'](is['message']),null));if(!ir)return null;if(ir['status']===0x193||ir['status']===0x1ad){let is=await ib(!0x0);if(!is||(ir=await hN(ip,{'headers':{...iq,'x-guest-token':is,'Cookie':'guest_id='+encodeURIComponent('v1:'+is)}})['catch'](it=>(it instanceof Error&&hQ['debug'](it['message']),null)),!ir))return null;}return ir['ok']?await ir['json']():(hQ['debug']('Twitter\x20GraphQL\x20request\x20failed:\x20'+ir['status']),null);},ig=im=>{const ku=kq;let io=im?.['legacy']?.['binding_values']?.[0x0]?.['value']?.['string_value']??im?.['binding_values']?.['unified_card']?.['string_value'];if(!io)return null;try{let ip=JSON['parse'](io);if(![ku(0x20f),'image_website']['includes'](ip['type']??'')||!ip['media_entities']||ip['component_objects']?.['media_1']?.['type']!==ku(0x1b7))return null;let iq=ip['component_objects']['media_1']['data']?.['id'],ir=iq?ip['media_entities'][iq]:void 0x0;return ir?[ir]:null;}catch(is){return hQ[ku(0xff)]('Failed\x20to\x20parse\x20Twitter\x20card',is),null;}},ih=(im,io)=>((im?.['data']?.['threaded_conversation_with_injections_v2']?.['instructions']??[])['find'](ip=>ip['type']==='TimelineAddEntries')?.['entries']??[])['find'](ip=>ip['entryId']==='tweet-'+io)?.[kq(0x166)]?.['itemContent']?.['tweet_results']?.['result']??null,ii=im=>im['__typename']===kq(0xc0)?im['tweet']:im,ij=(im,io)=>{const kv=kq;let ip=ih(im,io),iq=ip?.[kv(0x109)];if(!ip||!iq)return null;if(iq==='TweetUnavailable'||iq==='TweetTombstone'){let iu=ip['result']?.['reason'],iv=ip['tombstone']?.['text']?.['text']??'';return iu==='Protected'?hQ['error']('Twitter\x20post\x20is\x20private'):iu==='NsfwLoggedOut'||iv['startsWith']('Age-restricted')?hQ['error']('Twitter\x20post\x20is\x20age-restricted\x20and\x20requires\x20login'):hQ['error']('Twitter\x20post\x20is\x20unavailable'),null;}if(!['Tweet','TweetWithVisibilityResults']['includes'](iq))return null;let ir=ii(ip),is=ir?.['legacy'],it=is?.['retweeted_status_result']?.['result']?.[kv(0x142)]??is?.['retweeted_status_result']?.['result']?.['tweet']?.['legacy'];return ig(ir?.['card'])??it?.['extended_entities']?.[kv(0x1b7)]??is?.['extended_entities']?.['media']??null;},ik=async im=>{const kw=kq;let io=await id(im),ip=ig(io?.['card'])??io?.['mediaDetails'];if(ip?.['length'])return{'media':ip,'text':io?.[kw(0x1cf)]};let iq=await ib();if(iq){let ir=await ie(im,iq),is=ir?ih(ir,im):null,it=is?ii(is):null,iu=ir?ij(ir,im):null;if(iu?.['length'])return{'media':iu,'text':it?.['legacy']?.[kw(0x17f)]};}return{'media':[],'text':void 0x0};},il=(im,io,ip)=>ip>0x1?'twitter_'+im+'_'+(io+0x1):'twitter_'+im;hL['exports']=hY({async 'getEntries'({url:im}){const kx=kq;let io=i8(im);if(!io)return hQ['error']('Could\x20not\x20extract\x20Twitter/X\x20tweet\x20id'),[];let ip=await ik(io);if(!ip['media']['length'])return hQ[kx(0x171)](kx(0x212)),[];let iq=[];for(let is of ip['media']){if(is['type']==='photo')continue;let it=ia(is['video_info']?.['variants']);it&&iq['push']({'mediaUrl':it});}let ir=[];for(let iu=0x0;iu<iq['length'];iu+=0x1){let iv=iq[iu];ir['push']({'id':io+'_'+(iu+0x1),'title':il(io,iu,iq['length']),'description':ip['text']?.['trim'](),'source':{'url':iv['mediaUrl'],'headers':i5},'url':im});}return ir['length']||hQ['error']('Twitter/X\x20post\x20does\x20not\x20contain\x20downloadable\x20video\x20or\x20photo\x20media'),ir;}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':jB(0x169),'shortName':'X','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/a8/46/4c/a8464cd5-48d9-aa90-a689-e74c85303c67/Placeholder.mill/400x400bb-75.webp','matches':['https://x.com/*','https://*.x.com/*',jB(0x201),'https://*.twitter.com/*']},'pkg':{'name':'twitter','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://x.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'twitter.ts'}},'virtualroom':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kz=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i1=>i1);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'];let hZ=hX['Input'],i0=hX[kz(0x21d)];hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX[kz(0x211)],hX['MP4'],hX['MP3'],hL['exports']=hY({async 'getEntries'({url:i1}){const kA=kz;let i2=new URL(i1)['searchParams']['get']('recordId');if(!i2)return hQ['error']('Could\x20not\x20extract\x20VirtualRoom\x20recordId.'),[];let i3=await hN('https://mv1.virtualroom.ru/vr/player/records/'+i2+'/info')['then'](i7=>i7['ok']?i7['json']():null)['catch'](()=>null),i4=await hN(kA(0x22b)+i2+'/events')['then'](i7=>i7['ok']?i7['json']():null)['catch'](()=>null),i5=i3?.['data']?.['roomParameters']?.['name']??'VirtualRoom',i6=new Map();for(let i7 of i4?.['data']?.['translations']??[]){if(!i7['url'])continue;let i8=i7['source']??i7['type']??'default',i9=i6['get'](i8);i9?i9['push'](i7):i6['set'](i8,[i7]);}return[...i6['values']()]['map'](ia=>{let ib=ia[0x0];return{'title':[i5,ib?.['source'],ib?.['start']]['filter'](Boolean)['join']('\x20'),'context':{'tracks':ia}};});},async 'resolveEntry'({entry:i1}){const kB=kz;let i2=i1['context']['tracks'],i3=i2['find'](i6=>i6[kB(0xb2)]==='video'&&i6['url'])??i2[0x0];if(!i3?.['url'])throw Error('VirtualRoom\x20entry\x20is\x20missing\x20playable\x20media\x20URL');let i4=new hZ({'source':new i0(i3['url'])}),i5=i2['filter'](i6=>i6!==i3&&i6['type']==='audio');for(let i6 of i5)i6['url']&&await i4['addAudioTracks'](new i0(i6['url']));return{'input':i4,'entry':i1};}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'VirtualRoom','icon':'https://sun9-50.userapi.com/impg/rY5N7sdA93TFdjkeYqPTnPIjvCJ0rALo_V7V8g/zLAaAv0PpvY.jpg?size=400x400&quality=95&sign=5ddcd6358131b204b8619cb8eeff943f&type=album','matches':['https://virtualroom.ru/*','https://*.virtualroom.ru/*']},'pkg':{'name':'virtualroom','version':'0.0.7','private':!0x0,'keywords':['videotelephony'],'homepage':jB(0x162),'author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'virtualroom.ts'}},'vk':{'create':hK=>{const kE=jB;let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kC=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i3=>i3);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX['input'],hX['prompt'],hX['notify'],hX['confirm'],hX['ask'],hX['utils'],hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX[kC(0x1fe)],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX['MP3'];let hZ=['2160','1440','1080','720',kC(0x1f7),'360',kC(0xc2),'144'],i0=i3=>{let i4=i3['match'](/video-(\d+)_(\d+)/);return i4?{'ownerId':i4[0x1],'videoId':i4[0x2]}:null;},i1=i3=>{if(!i3)return null;for(let i4 of i3)if(Array['isArray'](i4)){for(let i5 of i4)if(i5&&typeof i5=='object'&&'player'in i5)return i5;}return null;},i2=(i3,i4)=>{let i5=i4['videoQuality']?.['replace']('p','')['trim'](),i6=hZ['filter'](i7=>!!i3['url'+i7]);return i6['length']?i5&&i6['includes'](i5)?i5:i6[0x0]:null;};hL['exports']=hY({async 'getEntries'({url:i3,options:i4}){const kD=kC;let i5=i0(i3);if(!i5)return hQ['error']('Could\x20not\x20extract\x20VK\x20video\x20identifiers'),[];let i6=await hN('https://vkvideo.ru/al_video.php?act=show',{'method':'POST','headers':{'content-type':'application/x-www-form-urlencoded;\x20charset=utf-8','accept':kD(0x1c3),'accept-language':'ru-RU,ru;q=0.9','sec-ch-ua':'\x22Chromium\x22;v=\x22130\x22,\x20\x22Google\x20Chrome\x22;v=\x22130\x22,\x20\x22Not?A_Brand\x22;v=\x2299\x22','sec-ch-ua-mobile':'?0','sec-ch-ua-platform':'\x22macOS\x22','sec-fetch-dest':'empty','sec-fetch-mode':'cors','sec-fetch-site':'same-origin','x-requested-with':'XMLHttpRequest','Referer':i3,'Referrer-Policy':'strict-origin-when-cross-origin'},'body':new URLSearchParams({'al':'1','autoplay':'1','claim':'','force_no_repeat':'true','is_video_page':'true','list':'','module':'direct','t':'','video':'-'+i5['ownerId']+'_'+i5['videoId']})['toString']()});if(!i6['ok'])throw Error('VK\x20request\x20failed:\x20'+i6['status']+'\x20'+i6['statusText']);let i7=i1((await i6['json']())['payload']),i8=i7?.['player']?.['params'],i9=i8&&i8['length']>0x0?i8[0x0]:void 0x0;if(!i7||!i9)return hQ[kD(0x171)]('Could\x20not\x20find\x20VK\x20player\x20payload'),[];if(i7['mvData']?.['is_active_live']===0x1||i7['mvData']?.[kD(0xc6)]==='1')return hQ['error']('Live\x20videos\x20are\x20not\x20supported'),[];let ia=i2(i9,i4),ib=ia?i9['url'+ia]:void 0x0,ic=i9['dash_sep']||ib;return ic?[{'type':'video','title':[i9['md_title']?.['trim'](),i9['md_author']?.['trim']()]['filter'](Boolean)['join']('\x20'),'source':{'url':ic,'headers':{'Referer':i3,'Cookie':hU['cookie']}}}]:(hQ['error']('Could\x20not\x20find\x20video\x20URL'),[]);}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK[kE(0x11a)]),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'VK','icon':'https://static.rustore.ru/imgproxy/kSjDiz_MKxD_jzwgEqqaIjQZTE-NEP1Xt8HtJT7EU4s/preset:app_card_icon/aHR0cHM6Ly9zdGF0aWMucnVzdG9yZS5ydS9hcGsvMjAyNzgyMzI5NS9jb250ZW50L0lDT04vOTc0ODYwMTgtNTc4NS00MjRkLTljYWItNGZlNDk2ZDI3Yzc2LnBuZw==.webp','matches':['https://vk.com/*','https://*.vk.com/*','https://vkvideo.ru/*','https://*.vkvideo.ru/*']},'pkg':{'name':'vk','version':'0.0.8','private':!0x0,'keywords':['video-hostings'],'homepage':'https://vkvideo.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':jB(0x21a)}},'weibo':{'create':hK=>{let hL={'exports':{}};return((hM,hN,hO,hP,hQ,hS,hT,hU,hV,hW)=>{const kF=b;let hX=hM??Streamyx??{};hX&&(hX['defineExtension']||=i0=>i0);let hY=hX['defineExtension'];hX['version'],hX['sleep'],hX[kF(0x172)],hX['prompt'],hX[kF(0x140)],hX['confirm'],hX['ask'];let hZ=hX['utils'];hX['Input'],hX['UrlSource'],hX['CustomPathedSource'],hX['ALL_FORMATS'],hX['DASH'],hX['DASH_FORMATS'],hX['HLS'],hX['HLS_FORMATS'],hX['MP4'],hX[kF(0x138)],hL[kF(0x127)]=hY({async 'getEntries'({url:i0}){const kG=kF;let i1=hZ['execUrlPatterns'](i0,['/:userId(\x5cd+)/:bid','/detail/:mid'],['https://weibo.com/','https://m.weibo.cn']),i2=i1['pathname']['bid']||i1['pathname']['mid'];if(!i2)return[];let i3=await hN(kG(0x151)+i2,{'credentials':'include','referrer':'https://m.weibo.cn/status/'+(i1['pathname']['bid']??i2)+'?jumpfrom=weibocom','method':'GET','mode':kG(0xae)})['then'](i7=>i7['json']())['catch'](()=>null);if(!i3?.['data'])return hQ['error']('Could\x20not\x20resolve\x20Weibo\x20post\x20metadata'),[];let i4=[],i5=i3['data']['pics'],i6=i3['data']['page_info'];if(i5?.['length']){for(let i7 of i5['filter'](i8=>i8['type']==='video'||i8[kG(0xb2)]==='livephoto'))i7['videoSrc']&&i4['push']({'type':'video','title':i7['pid'],'source':{'url':i7['videoSrc']}});}else{if(i6?.['type']==='video'){let i8=Object['values'](i6['urls']??{})[0x0],i9=i6['media_info']?.['stream_url_hd']||i6['media_info']?.['stream_url'],ia=i8||i9;ia&&i4['push']({'type':'video','title':i6['title']||i6['page_title'],'source':{'url':ia}});}}return i4;}});})(hK['Azot'],hK['fetch'],hK['localStorage'],hK['cookieStore'],hK['console'],hK['prompt'],hK['alert'],hK['document'],hK['navigator'],hK['window']),hL['exports']['default']||hL['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Weibo','icon':'https://play-lh.googleusercontent.com/TTKq2trnzgtoyM0jc1pyrrmXtA_Yd3A2hxubZtDahdZStYf4GPANZa-wjDb1ELHrGqh_=w480-h960-rw','matches':['https://weibo.com/*','https://*.weibo.com/*','https://weibo.cn/*',jB(0x21b)]},'pkg':{'name':'weibo','version':'0.0.6','private':!0x0,'keywords':['social-networks'],'homepage':'https://weibo.com/','author':{'name':'Azot','url':jB(0x238)},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'weibo.ts'}}};}),cD=ac(cC(),0x1);const cE=hI=>({'name':hI['name'],'source':hI['source'],'dir':hI['dir'],'path':hI['path'],'package':hI['package'],'manifest':hI['manifest'],'installedAt':hI['installedAt']||new Date()['toISOString']()});var cF=class iw extends X{['extensions']=new Map();['extensionDirs'];['indexPath'];[iA(0xcb)]=[];constructor({dirs:hI,indexPath:hJ}={}){const kH=iA;super(),this['extensionDirs']=hI??[process['cwd']()],this['indexPath']=hJ??Q['join'](process[kH(0x20d)](),'index.json');}async['init'](){return await this['ensureValidIndexPath'](),await this['loadInfo'](),this;}async['loadInfo'](){return this['infoList']=await b2(this['indexPath'])['catch'](()=>[]),this['infoList'];}async['saveInfo'](){const kI=iA;return await this['ensureValidIndexPath'](),await b3(this[kI(0xf0)],this['infoList']);}async['ensureValidIndexPath'](){const kJ=iA;(await U['stat'](this['indexPath'])['catch'](()=>null))?.['isDirectory']()&&(v['warn'](kJ(0xf8)+this['indexPath']),await aZ(this['indexPath']),await U['writeFile'](this['indexPath'],'[]','utf8'));}static async['getAvailableExtensions'](){const kK=iA;try{return(await ci['getExtensions'](cq['accessToken'],AbortSignal['timeout'](0x1f40)))['data'];}catch(hI){let hJ=hI&&typeof hI=='object'&&'code'in hI?hI['code']:hI&&typeof hI=='object'&&'cause'in hI?hI['cause']?.[kK(0xf9)]:void 0x0;return v['warn']('Failed\x20to\x20fetch\x20extensions\x20catalog:\x20'+(hI instanceof Error?hI['message']:String(hI))+'\x20('+hJ+')'),[];}}async['discover'](){for(let hI of this['extensionDirs']){v['debug']('Loading\x20extensions\x20from\x20'+hI);let hJ=await U['readdir'](hI,{'withFileTypes':!0x0})['catch'](()=>[]);for(let hK of hJ)if(hK['isDirectory']()){let hL=Q['join'](hI,hK['name']);if(await U['readdir'](hL)['then'](hM=>hM['filter'](hN=>!hN['startsWith']('.')))['then'](hM=>!hM['length']))continue;await this['loadExtension'](hL);}}for(let hM of this['infoList'])this['extensionDirs']['some'](hN=>hM['dir']?.['includes'](hN))||!hM['dir']||(v['debug']('Loading\x20dev\x20extension\x20from\x20'+hM['dir']),await this['loadExtension'](hM['dir']));}async #e(hI,hJ){const kL=iA,hK=await U['readFile'](hI,kL(0x14d)),{Azot:hL,fetch:hM,console:hN,localStorage:hO,cookieStore:hP,window:hQ,document:hS,navigator:hT}=hJ,hU={'exports':{}};eval(kL(0x1ee)+hK+'})();');const hV=hU['exports'];return{'exports':hV,'context':hJ};}async['prepareContext'](hI,hJ){const kM=iA;let hK=J({'name':hI,'dir':O,'title':hJ});return await hK['cookieStore'][kM(0x19a)](Q['join'](O,hI,'cookies.txt')),hK;}async['loadScript'](hI,hJ){const kN=iA;let hK=hJ['name'],hL=br(hJ),hM=await this['prepareContext'](hK,hL),hN=await E(hI,{'dirname':hJ['dir'],'context':hM});if(hN)return hN['exports']='default'in hN[kN(0x127)]?hN['exports']['default']:hN[kN(0x127)],hN;}async[iA(0x96)](){const kO=iA;let hI=Object['keys'](cD['default']);v['debug']('Loading\x20'+hI[kO(0xb4)]+'\x20built-in\x20extensions:\x20'+hI['join'](',\x20'));for(let hJ of Object['values'](cD['default'])){let hK=hJ[kO(0x177)]['name'],hL=bp({'manifest':hJ['manifest'],'packageJson':hJ['pkg'],'fallbackName':hK}),hM=hL['displayName'];try{let hN=await this['prepareContext'](hK,hM),hO={'exports':hJ['create'](hN),'package':hJ['pkg'],'manifest':hL,'context':hN};this['validate'](hO),this['extensions']['set'](hK,hO),this[kO(0x20e)]('loaded',hK);}catch(hP){v['debug'](hP instanceof Error?hP['message']:String(hP)),this['emit']('error',hP,hK);}}}async[iA(0x14e)](hI){const kP=iA;try{v[kP(0xff)]('Loading\x20extension\x20from\x20'+hI);let hJ=await bZ(hI)['catch'](hM=>v['error'](hM));if(!hJ)return;hJ['package']['dir']=hJ['dir'];let hK=await this['loadScript'](hJ['path'],hJ);if(!hK)return;let hL={'package':hJ['package'],'manifest':hJ['manifest'],'exports':hK['exports'],'context':hK[kP(0x1bb)]};this['validate'](hL),this['extensions']['set'](hJ['package']['name'],hL),this['emit']('loaded',hJ['package']['name']);}catch(hM){this['emit']('error',hM,hI);}}['validate'](hI){if(typeof hI!='object'||!hI||!bN(hI['exports']))throw Error('Invalid\x20extension\x20interface:\x20'+hI['package']['name']);}['getExtension'](hI){const kQ=iA;return this[kQ(0x16b)]['get'](hI)??Array['from'](this['extensions']['values']())['find'](hJ=>hJ['package']['name']===hI)??null;}async['getExtensionForUrl'](hI){const kR=iA;let hJ;try{hJ=new URL(hI);}catch(hK){return v['debug']('Invalid\x20extension\x20URL:\x20'+hI),v['debug'](hK instanceof Error?hK['message']:String(hK)),null;}for(let hL of this['extensions']['values']()){let hM=null,hN=hL['exports']['canHandle'],hO=hJ['hostname']['includes'](hL['package']['name']);if(hM=bu(hL)?bt(hL,hJ):typeof hN==kR(0x129)?await hN(hI):typeof hN=='string'?new URLPattern(hN)['test'](hI):hO,hM)return hL;}return null;}async['install'](hI){const kS=iA;let hJ=await iw['getAvailableExtensions'](),hK=[];for(let hL of hI){let hM=await stat(hL)['then'](hP=>hP['isDirectory']())['catch'](()=>!0x1)?hL:await bh(hL,hJ);if(!hM)throw b8(b5['SOURCE_NOT_FOUND'],kS(0x9c)+hL,{'source':hL});let hN=await c0(hM,hL);if(!hN)throw b8(b5['IMPORT_INVALID'],'Extension\x20import\x20failed:\x20'+hL,{'source':hL,'dir':hM});hK['push'](hN);let hO=this['infoList']['find'](({name:hP})=>hP===hN['name']);if(hO){let hP=hO['source'];hP!==hN['source']&&await aZ(hP);let hQ=hO['dir']?this.#t(hO['dir']):null,hS=hN['dir']?this.#t(hN['dir']):null;hQ&&hQ!==hS&&await aZ(hQ),hO['installedAt']=new Date()['toISOString'](),Object['assign'](hO,cE(hN)),v['info']('Extension\x20'+hN['name']+'\x20updated');}else this['infoList'][kS(0x1ea)](cE(hN)),v['info']('Extension\x20'+hN['name']+'\x20added');}if(await this['saveInfo'](),hK['length']){for(let hT of hK)this['extensions']['set'](hT['name'],hT);}}#t(hI){const kT=iA;let hJ=Q['parse'](hI);return hJ[kT(0xa3)]===o?hI:hJ['dir'];}async['uninstall'](hI){const kU=iA;for(let hJ of hI){let hK=this['infoList']['find'](hN=>hN['name']===hJ);if(!hK){v['error']('Extension\x20'+hJ+'\x20not\x20found');return;}let hL=hK['dir']??'',hM=hL?.['includes'](o);await aX(hL)?(hM&&await aZ(this.#t(hL)),this['infoList']=this[kU(0xcb)]['filter'](hN=>hN[kU(0x215)]!==hJ),v[kU(0x1eb)]('Extension\x20'+hJ+'\x20removed'),this['extensions']['delete'](hJ)):v['warn'](kU(0x131)+hJ+'\x20directory\x20not\x20found:\x20'+hL);}await this[kU(0x1cc)]();}async['importCookies'](hI,hJ){const kV=iA;let hK=this[kV(0x8b)](hI);if(!hK)throw Error(kV(0x131)+hI+'\x20not\x20found');return await hK['context']['cookieStore']['import'](hJ,{'removeSource':!0x1});}async['login'](hI,hJ={}){let hK=this['getExtension'](hI);hK&&await bS(hK,hJ);}async['logout'](hI){const kW=iA;for(let hJ of hI){let hK=this['getExtension'](hJ);if(!hK)return;v['info']('Logging\x20out...'),await bT(hK),v[kW(0xff)]('Clearing\x20localStorage...'),hK[kW(0x1bb)]['localStorage']['clear'](),v['debug']('Clearing\x20cookies\x20store...');let hL=await hK['context']['cookieStore']['getAll']();for(let hM of hL)await hK['context'][kW(0x93)]['delete'](hM);v['info'](kW(0xd2)+hJ);}}['list'](){const kX=iA;return Array['from'](this['extensions'][kX(0xcf)]())['map'](hI=>({'name':hI['package']['name'],'version':hI['package'][kX(0x1e0)],'description':hI['package']['description'],'manifest':hI['manifest'],'package':hI['package']}));}};const cG=(hI,hJ)=>{const kY=iA;let hK=resolve(hI),hL=parse(hI)['name'];return join(hJ,hL+'-'+createHash('sha1')[kY(0x86)](hK)['digest']('hex')['slice'](0x0,0xa));},cH=(hI,hJ=q)=>{const kZ=iA;let hK=new Set();hI?.['output'][kZ(0x12b)]&&hK[kZ(0x146)](hI['output'][kZ(0x12b)]);for(let hM of hI?.['artifacts']??[])hM['path']&&hK['add'](hM['path']);let hL=new Set();for(let hN of hK)hL['add'](hN),hL['add'](hN+'.part.json'),hL['add'](cG(hN,hJ));return hL;},cI=async hI=>{hI['size']!==0x0&&await Promise['all']([...hI]['map'](hJ=>rm(hJ,{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0)));},cJ=(hI=q)=>({async 'purgeRecordArtifacts'(hJ){await cI(cH(hJ,hI));}}),cK=hI=>{const l0=iA;if(!hI||typeof hI!='object'||!(l0(0xf9)in hI))return;let hJ=hI['code'];return typeof hJ=='string'?hJ:void 0x0;},cL='NO_FILES_DOWNLOADED';var cM=class extends Error{['code'];constructor(hI,hJ=hI,hK){super(hJ,hK),this['name']='DownloaderError',this['code']=hI;}};const cN=()=>new cM(cL,'No\x20files\x20were\x20downloaded'),cO=(hI,hJ='DOWNLOAD_FAILED')=>{const l1=iA;if(hI instanceof cM||hI instanceof Error&&hI['name']==='AbortError')return hI;if(hI instanceof Error){let hK=new cM(cK(hI)??hJ,hI['message'],{'cause':hI});return hI['stack']&&(hK['stack']=hI['stack']),hK;}return new cM(hJ,typeof hI==l1(0x132)?hI:'Unknown\x20error');},cP=({id:hI,request:hJ,createdAt:hK})=>({'id':hI,'request':hJ,'status':'queued','progress':{'percent':0x0,'downloadedBytes':0x0},'output':{},'artifacts':[],'createdAt':hK}),cQ=hI=>hI['status']==='queued'||hI['status']==='analyzing'||hI['status']==='transferring'||hI['status']==='processing',cR=(hI,...hJ)=>hJ['includes'](hI['status']),cS=(hI,hJ)=>hI[iA(0x234)]==='failed'&&hI['failure']?.['message']===hJ,cT=(hI,hJ)=>{let hK=hI['findIndex'](hM=>hM['path']===hJ['path']);if(hK===-0x1)return hI['push'](hJ),hI;let hL=hI[hK];return hI[hK]={...hL,...hJ,'role':hL['role']&&hJ['role']==='partial'?hL['role']:hJ['role']??hL['role']},hI;},cU=(hI,hJ)=>{const l2=iA;if(hJ?.['length']){for(let hK of hJ)hK['path']&&cT(hI[l2(0xc7)],hK);}},cV=(hI,hJ)=>({'ok':!0x1,'reason':'Cannot\x20apply\x20'+hJ['type']+'\x20while\x20download\x20is\x20'+hI[iA(0x234)]}),cW=hI=>hI['status']==='queued'||hI[iA(0x234)]==='analyzing'||hI['status']==='transferring'||hI['status']==='processing'||hI['status']==='paused',cX=hI=>hI['status']==='failed',cY=hI=>hI['status']===iA(0x1e1),cZ=hI=>hI['status']==='queued'||hI['status']==='analyzing',d0=hI=>hI['status']==='queued'||hI[iA(0x234)]==='analyzing'||hI['status']==='transferring',d1=hI=>hI['status']==='queued'||hI['status']==='analyzing'||hI['status']==='transferring'||hI['status']===iA(0x1a4),d2=hI=>hI['status']==='transferring',d3=hI=>hI['status']==='analyzing'||hI['status']==='transferring'||hI['status']==='processing',d4=hI=>hI['status']==='queued'||hI['status']==='analyzing'||hI['status']==='transferring'||hI['status']==='processing'||hI['status']==='paused',d5=(hI,hJ)=>{const l3=iA;switch(hJ['type']){case'queued':return cW(hI);case'retrying':return cX(hI);case'analyzing':return cY(hI);case'transferring':return cZ(hI);case'processing':return d2(hI);case'paused':return d0(hI);case'completed':return d3(hI);case'failed':return d1(hI);case l3(0x149):return d4(hI);case'output-resolved':case'file-path-resolved':case'artifact-recorded':case'artifacts-recorded':return d3(hI);case'progress':return d2(hI);}},d6=(hI,hJ)=>{const l4=iA;if(!d5(hI,hJ))return cV(hI,hJ);let hK=structuredClone(hI);switch(hJ[l4(0xb2)]){case'queued':return hK['status']='queued',hK['failure']=void 0x0,{'ok':!0x0,'record':hK};case'retrying':return hK['status']='analyzing',hK['failure']=void 0x0,hK[l4(0x1c0)]['percent']=0x0,hK[l4(0x1c0)]['downloadedBytes']=0x0,hK['progress']['totalBytes']=void 0x0,hK['progress']['totalBytesEstimated']=void 0x0,hK['output']['quality']=void 0x0,hK['output']['codec']=void 0x0,hK['artifacts']=[],{'ok':!0x0,'record':hK};case'analyzing':return hK['status']='analyzing',hK['failure']=void 0x0,{'ok':!0x0,'record':hK};case'transferring':return hK['status']='transferring',hK['failure']=void 0x0,{'ok':!0x0,'record':hK};case'processing':return hK[l4(0x234)]=l4(0x1a4),{'ok':!0x0,'record':hK};case'paused':return hK['status']='paused',hK['failure']=void 0x0,{'ok':!0x0,'record':hK};case'completed':return hK['status']='completed',hK['progress']['percent']=0x64,hJ['progress']&&(hK['progress']['downloadedBytes']=hJ[l4(0x1c0)]['downloadedBytes'],hK['progress']['totalBytes']=hJ['progress']['totalBytes'],hK['progress']['totalBytesEstimated']=hJ['progress'][l4(0x213)]),hK['failure']=void 0x0,{'ok':!0x0,'record':hK};case'failed':return hK['status']='failed',hK['failure']={'message':hJ['message'],'code':hJ['code']},{'ok':!0x0,'record':hK};case'entry-resolved':return hK['request']['entry']=hJ['entry'],{'ok':!0x0,'record':hK};case'output-resolved':return hK['output']['title']=hJ['title'],hK['output'][l4(0x12b)]=hJ['filePath'],{'ok':!0x0,'record':hK};case'file-path-resolved':return hK['output']['filePath']=hJ['filePath'],{'ok':!0x0,'record':hK};case'progress':return hJ['progress'][l4(0x12b)]&&(hK['output']['filePath']=hJ['progress'][l4(0x12b)]),hK['progress'][l4(0x18e)]=hJ['progress'][l4(0x18e)],hK['progress']['downloadedBytes']=hJ['progress']['downloadedBytes'],hK['progress']['totalBytes']=hJ['progress']['totalBytes'],hK['progress'][l4(0x213)]=hJ['progress']['totalBytesEstimated'],hJ['progress']['quality']&&(hK['output']['quality']=hJ['progress']['quality']),hJ['progress'][l4(0x14b)]&&(hK['output'][l4(0x14b)]=hJ[l4(0x1c0)]['codec']),cU(hK,hJ['artifacts']),{'ok':!0x0,'record':hK};case'artifact-recorded':return cU(hK,[hJ['artifact']]),{'ok':!0x0,'record':hK};case'artifacts-recorded':return cU(hK,hJ['artifacts']),{'ok':!0x0,'record':hK};}},d7=(hI,hJ)=>{let hK=d6(hI,hJ);if(hK['ok']===!0x1)throw Error(hK['reason']);return hK['record'];},d8=hI=>hI instanceof Error&&hI['name']==='AbortError',d9=async hI=>{if(hI)try{return(await stat(hI))['size'];}catch(hJ){v['debug']('Unable\x20to\x20read\x20downloaded\x20file\x20size\x20for\x20'+hI+':\x20'+String(hJ));return;}},da=async hI=>{let hJ=[...new Set(hI['filter'](Boolean))];if(!hJ['length'])return;let hK=0x0,hL=!0x1;for(let hM of hJ){let hN=await d9(hM);if(hN===void 0x0){hL=!0x0;continue;}hK+=hN;}return{'downloadedBytes':hK,'totalBytes':hK,'totalBytesEstimated':hL};},db=hI=>hI&&typeof hI=='object'&&'code'in hI?String(hI['code']):void 0x0,dc=()=>void 0x0;var dd=class{#e=new Set();#t;#n;#r;#i;#a;#o=new Set();#s=[];#c=new Map();#l=new Set();#u;#d=0x0;constructor({settings:hI,store:hJ,workflow:hK,analyzer:hL,artifacts:hM=cJ()}){this.#t=hI,this.#n=hJ,this.#r=hK,this.#i=hL,this.#a=hM,this.#u=hI['get']('maxActiveDownloads'),v['debug']('Created\x20download\x20engine\x20with\x20max\x20active\x20downloads:\x20'+this.#u);}get['maxActiveDownloads'](){return this.#u;}['getRecord'](hI){return this.#n['getRecord'](hI);}['listRecords'](){return this.#n['listRecords']();}['subscribe'](hI){return this.#e['add'](hI),()=>this.#e['delete'](hI);}async['initializeFromStorage'](){const l5=iA;for(let hI of this.#n['listRecords']()){if(!cQ(hI))continue;let hJ=hI;cR(hI,l5(0x1e1))||(hJ=await this.#w(hI,{'type':'queued'})),this.#O(hJ['id']);}this.#h();}async['analyze'](hI,hJ={}){if(!hI){let hK=Error('Cannot\x20prepare\x20job\x20without\x20a\x20URL.');throw this.#P({'type':'error','error':hK}),hK;}return await this.#i['analyze'](hI,hJ);}async['add'](hI){const l6=iA;if(!hI['url']&&!hI['entry']?.['source']?.['url'])throw Error('Job\x20must\x20have\x20either\x20a\x20URL\x20or\x20a\x20pre-prepared\x20media\x20entry.');let hJ=cP({'id':crypto['randomUUID'](),'request':hI,'createdAt':new Date()['toISOString']()});v['debug']('Adding\x20new\x20job:\x20'+hJ['id']),v['debug'](l6(0xb9)+hJ['request']['url']),this.#d+=0x1;try{return await this.#n['addRecord'](hJ),this.#P({'type':'job-added','record':hJ}),this.#O(hJ['id']),this.#h(),structuredClone(hJ);}finally{--this.#d,this.#N();}}async['pause'](hI){let hJ=await this.#f(hI,'pause');hJ&&v['debug']('Paused\x20download:\x20'+hJ['id']);}async['resume'](hI){const l7=iA;let hJ=this.#c['get'](hI);if(hJ){hJ[l7(0x20a)]==='pause'||hJ['controller']['signal']['aborted']?(this.#l['add'](hI),v['debug'](l7(0xbc)+hI)):v['debug']('Resume\x20skipped\x20while\x20job\x20is\x20active:\x20'+hI);return;}let hK=this.#D(hI);if(!hK){v['warn']('Resume\x20failed:\x20Job\x20'+hI+'\x20not\x20found');return;}if(cR(hK,'paused')){await this.#p(hK),v['debug']('Resumed\x20download:\x20'+hK['id']);return;}cR(hK,l7(0x226))&&await this.#m(hK)&&v['debug']('Retried\x20download:\x20'+hK['id']);}async['remove'](hI){const l8=iA;await this.#f(hI,l8(0xbe)),await this.#n['deleteRecord'](hI);}async['removeWithFile'](hI){const l9=iA;let hJ=this.#D(hI),hK=await this.#f(hI,l9(0x233))??hJ;await this.#n['deleteRecord'](hI),await this.#a['purgeRecordArtifacts'](hK);}async['drain'](){await new Promise(hI=>{const la=b;let hJ=!0x1,hK=dc,hL=()=>{hJ||(hJ=!0x0,hK(),hI());};hK=this[la(0x174)](hM=>{hM['type']==='idle'&&hL();}),this.#M()&&hL();});}async #f(hI,hJ){const lb=iA;let hK=this.#k(hI),hL=this.#c['get'](hI),hM=this.#D(hI);return hL?hJ==='pause'&&!cR(hL['record'],'analyzing','transferring')?(v['debug']('Pause\x20ignored\x20for\x20non-downloading\x20stage:\x20id='+hI+lb(0x21f)+hL['record']['status']),hL[lb(0xc4)]):(hL[lb(0x20a)]=hJ,hJ==='pause'&&(hL['record']=await this.#T(hL['record'],{'type':'paused'})),hL['controller']['abort'](),await hL['runPromise'],this.#D(hI)):hJ==='pause'&&hM&&(hK||cR(hM,'queued','analyzing'))?await this.#T(hM,{'type':'paused'}):hM;}async #p(hI){let hJ=await this.#T(hI,{'type':'queued'});this.#O(hJ['id']),this.#h();}async #m(hI){const lc=iA;await this.#a['purgeRecordArtifacts'](hI);let hJ=await this.#T(hI,{'type':lc(0x216)});try{if(hJ['request']['url']){let hL=await this['analyze'](hJ[lc(0x180)][lc(0x170)],hJ[lc(0x180)][lc(0xf4)]??{}),hM=this.#C(hJ,hL);if(!hM)throw Error(lc(0x1c8));let hN=this.#D(hJ['id']);if(!hN||!cR(hN,'analyzing','paused')||(hJ=await this.#w(hN,{'type':'entry-resolved','entry':hM}),cR(hJ,'paused')))return!0x1;}let hK=this.#D(hJ['id']);return!hK||!cR(hK,'analyzing')?!0x1:(await this.#p(hK),!0x0);}catch(hO){let hP=this.#D(hJ['id']);if(!hP||!cR(hP,'analyzing'))return!0x1;let hQ=cO(hO);return hJ=await this.#T(hP,{'type':'failed','message':hQ['message'],'code':db(hQ)}),this.#P({'type':'job-error','record':hJ,'error':hQ}),!0x1;}}#h(){for(this.#u=this.#t['get']('maxActiveDownloads');this.#c['size']<this.#u;){let hI=this.#A();if(!hI)break;this.#g(hI);}this.#N();}#g(hI){const ld=iA;if(!cR(hI,'queued')){v['warn']('Skipping\x20non-queued\x20job\x20start:\x20'+hI['id']+'\x20('+hI['status']+')');return;}let hJ={'controller':new AbortController(),'record':hI,'runPromise':Promise[ld(0x11c)]()};hJ['runPromise']=this.#_(hJ)['catch'](hK=>{let hL=hK instanceof Error?hK:Error('Download\x20run\x20failed:\x20'+String(hK));v['error'](hL['message']),this.#P({'type':'error','error':hL});}),this.#c['set'](hI['id'],hJ);}async #_(hI){const le=iA;try{hI['record']=await this.#T(hI['record'],{'type':'analyzing'});let hJ=await this.#r['run']({'jobId':hI['record']['id'],'request':hI['record']['request'],'filePath':hI['record']['output']['filePath'],'signal':hI['controller']['signal'],'emit':async hK=>{hI['record']=await this.#x(hI,hK);}});hI['record']=await this.#v(hI[le(0xc4)],hJ);}catch(hK){if(d8(hK))return;hI[le(0xc4)]=await this.#y(hI['record'],hK);}finally{await this.#b(hI);}}async #v(hI,hJ){const lf=iA;let hK=await this.#w(hI,{'type':'entry-resolved','entry':hJ[lf(0x137)]});if(!hJ['transferResult']['downloaded']['length'])throw cN();let hL=hJ['processedMedia']['outputPath']??hJ['processedMedia']['artifacts'][0x0]?.[lf(0x159)]??hJ['transferResult']['downloaded'][0x0]?.['path'];hK['output']['filePath']||(hK=await this.#w(hK,{'type':'file-path-resolved','filePath':hL})),hK=await this.#w(hK,{'type':'artifacts-recorded','artifacts':hJ['processedMedia']['artifacts']['map'](hN=>({...hN,'role':'track'}))});let hM=hJ['processedMedia']['outputPath']?await da([hJ['processedMedia']['outputPath']]):await da(hJ['processedMedia']['artifacts']['length']?hJ['processedMedia'][lf(0xc7)]['map'](hN=>hN['path']):hJ['transferResult']['downloaded']['map'](hN=>hN['path']));return hK=await this.#T(hK,{'type':'completed','progress':hM}),this.#P({'type':'job-completed','record':hK}),hK;}async #y(hI,hJ){let hK=cO(hJ),hL=cS(hI,hK['message']);if(this.#E(hK),hL)return hI;v['error']('Download\x20job\x20failed:\x20'+hK);let hM=await this.#T(hI,{'type':'failed','message':hK['message'],'code':db(hK)});return this.#P({'type':'job-error','record':hM,'error':hK}),hM;}async #b(hI){const lg=iA;let hJ=hI['cancellationReason'],hK=hJ==='pause'&&this.#j(hI['record']['id']);if(hJ==='pause'&&!cR(hI['record'],'paused')&&(hI[lg(0xc4)]=await this.#T(hI['record'],{'type':'paused'})),this.#c['delete'](hI['record']['id']),hK&&cR(hI[lg(0xc4)],'paused')){let hL=await this.#T(hI['record'],{'type':'queued'});this.#O(hL['id']);}this.#h();}async #x(hI,hJ){const lh=iA;let hK=hI['record'];if(this.#S(hI,hJ))return hK;switch(hJ['type']){case'transferring':case'processing':return await this.#T(hK,hJ);case'entry-resolved':case'output-resolved':case'artifact-recorded':case'artifacts-recorded':return await this.#w(hK,hJ);case lh(0x1c0):{let hL=await this.#w(hK,hJ);return this.#P({'type':'job-progress','record':hL}),hL;}case'queued':case'retrying':case'analyzing':case'paused':case'completed':case'failed':case'file-path-resolved':return await this.#w(hK,hJ);}}#S(hI,hJ){const li=iA;let hK=hI['record'];return hI['cancellationReason']||hI['controller'][li(0x230)]['aborted']?!0x0:hJ['type']==='progress'?!cR(hK,'transferring'):hJ['type']==='transferring'?!cR(hK,'analyzing'):hJ['type']==='processing'?!cR(hK,'transferring'):!0x1;}#C(hI,hJ){const lj=iA;if(hJ[lj(0xb4)]<=0x1)return hJ[0x0];let hK=hI['request']['entry'],hL=hK?.['source']?.[lj(0x170)];return hJ['find'](hM=>hK?.['id']&&hM['id']?hK['id']===hM['id']:hK?.['title']&&hM['title']&&hK['title']===hM[lj(0x20c)]&&hK[lj(0x1d0)]===hM['seasonNumber']&&hK[lj(0x1d7)]===hM['episodeNumber']&&hK['episodeTitle']===hM['episodeTitle']?!0x0:!!hL&&hL===hM['source']?.['url'])??hJ[0x0];}async #w(hI,hJ){const lk=iA;let hK=d7(hI,hJ);await this.#n['updateRecord'](hK);let hL=this.#c[lk(0xed)](hK['id']);return hL&&(hL['record']=hK),hK;}async #T(hI,hJ){let hK=await this.#w(hI,hJ);return this.#P({'type':'job-status-changed','record':hK}),hK;}#E(hI){let hJ=db(hI);hJ&&(hJ==='DOWNLOAD_DIR_NOT_WRITABLE'||hJ==='NO_FILES_DOWNLOADED')&&C['emit']('error',{'code':hJ});}#D(hI){const ll=iA;return this.#c['get'](hI)?.['record']??this.#n[ll(0x1ab)](hI);}#O(hI){const lm=iA;this.#o['has'](hI)||this.#c['has'](hI)||(this.#s[lm(0x1ea)](hI),this.#o['add'](hI));}#k(hI){const ln=iA;if(!this.#o['has'](hI))return!0x1;let hJ=this.#s['indexOf'](hI);return hJ!==-0x1&&this.#s['splice'](hJ,0x1),this.#o[ln(0x1f2)](hI),!0x0;}#A(){for(;this.#s['length']>0x0;){let hI=this.#s['shift']();if(!hI)return;this.#o['delete'](hI);let hJ=this.#D(hI);if(hJ&&cR(hJ,'queued'))return hJ;}}#j(hI){let hJ=this.#l['has'](hI);return hJ&&this.#l['delete'](hI),hJ;}#M(){const lo=iA;return this.#d===0x0&&this.#s['length']===0x0&&this.#c[lo(0x1f1)]===0x0;}#N(){this.#M()&&this.#P({'type':'idle'});}#P(hI){for(let hJ of this.#e)hJ(hI);}};const de=(hI,hJ)=>new Input({'source':new UrlSource(hI['url'],{'requestInit':{'headers':hI['headers']},'fetchFn':hJ}),'formats':ALL_FORMATS}),df=hI=>{const lp=iA;let hJ;try{hJ=new URL(hI);}catch{throw Error('Invalid\x20direct\x20media\x20URL:\x20'+hI);}let hK=hJ['pathname']['replace'](/\/+$/,'')['split']('/')['filter'](Boolean)[lp(0x158)]();return{'type':'video','title':hK?.['split']('.')['slice'](0x0,-0x1)['join']('.')||hK||hJ['hostname']||'download','source':{'url':hI}};},dg=async(hI,hJ)=>{const lq=iA;let hK=hJ['proxy']||hJ['proxyMeta'];hK&&(await hI[lq(0x1bb)]['http']['configure']({'proxyUrl':hK}),await H['configure']({'proxyUrl':hK}));},dh=async(hI,hJ,hK)=>{if(!hK)return v['warn']('No\x20suitable\x20extension\x20available.\x20Downloading\x20as\x20a\x20direct\x20link...'),[df(hI)];await dg(hK,hJ),await bQ(hK),v['info']('Analyzing\x20URL...');let hL=await bP(hK)['getEntries']({'url':hI,'options':hJ});return hL['length']?[...hL]:(v['info']('No\x20media\x20entries\x20found'),[]);},di=async({entry:hI,url:hJ,options:hK,extension:hL,signal:hM})=>{const lr=iA;if(!hL){let hO=hI['source']??{'url':hJ},hP=hK['proxy']||hK['proxyMeta'];return hP&&await H['configure']({'proxyUrl':hP}),{'entry':{...hI,'source':hO},'input':de(hO,hP?H['fetch']['bind'](H):void 0x0)};}await dg(hL,hK),await bQ(hL);let hN=bP(hL);if(typeof hN['resolveEntry']=='function')return await hN[lr(0x10a)]({'url':hJ,'options':hK,'entry':hI,'signal':hM});if(!hI['source']?.['url'])throw Error('Extension\x20'+hL['package']['name']+'\x20must\x20provide\x20entry.source\x20or\x20implement\x20resolveEntry()');return{'entry':hI,'input':de(hI['source'],hL['context'][lr(0x161)]['fetch']['bind'](hL['context']['http']))};},dj=hI=>({async 'analyze'(hJ,hK={}){let hL=await dh(hJ,hK,await hI['getExtensionForUrl'](hJ));if(!hL?.['length'])throw Error('No\x20media\x20entries\x20found');return hL;}}),dk=['code','errno','syscall','address','port','host','hostname','path','type'],dl=hI=>typeof hI=='object'&&!!hI&&'status'in hI&&'statusText'in hI&&'url'in hI,dm=hI=>{let hJ=[],hK=hI;for(let hL of dk){let hM=hK[hL];hM==null||hM===''||hJ['push'](hL+'='+String(hM));}return hJ;},dn=(hI,hJ=0x0)=>{const lt=iA;if(hJ>0x3)return'[max-depth]';if(hI instanceof Error){let hK=dm(hI),hL='cause'in hI?hI['cause']:void 0x0,hM=[hI['name']+':\x20'+hI['message']];return hK['length']&&hM['push']('details='+hK['join'](',\x20')),hL!==void 0x0&&hL!==hI&&hM['push']('cause='+dn(hL,hJ+0x1)),hM['join'](lt(0x1fb));}return dl(hI)?'Response\x20'+hI['status']+'\x20'+hI['statusText']+'\x20url='+hI['url']:inspect(hI,{'depth':0x2,'breakLength':0x1/0x0});},dp=(hI,hJ)=>{v['debug'](hI+':\x20'+dn(hJ)),hJ instanceof Error&&hJ['stack']&&v['debug'](hJ['stack']);},dq=hI=>iA(0xe0)+hI['type']+':'+hI['id'],dr=hI=>{let hJ=new Map();for(let hK of hI){let hL=dq(hK),hM=hJ['get'](hL);if(hM){hM['push'](hK);continue;}hJ['set'](hL,[hK]);}return Array['from'](hJ['entries']())['filter'](([,hN])=>hN['length']>0x1);},ds=hI=>{const lu=iA;let hJ=dr(hI);if(!hJ['length'])return;let hK=hJ['map'](([hL,hM])=>hL+'\x20('+hM['length']+'\x20copies)')['join'](',\x20');throw Object[lu(0x19e)](Error('Duplicate\x20tracks\x20selected:\x20'+hK),{'code':'DUPLICATE_TRACKS_SELECTED'});},dt=iA(0x1a6),du=iA(0x12c),dv=hI=>hI instanceof Error&&hI['message']===du?new cM(dt,hI['message'],{'cause':hI}):hI,dw=hI=>hI?typeof hI=='string'?hI:hI instanceof Uint8Array||hI instanceof ArrayBuffer?Buffer['from'](hI)['toString']('base64'):null:null,dx=async hI=>{let hJ=(await hI['getSegments']()['catch'](()=>[]))[0x0];return hJ?.['initSegment']?.['encryption']??hJ?.['encryption'];},dy=async hI=>{const lv=iA;let hJ=await dx(hI);return[{'system':'widevine','pssh':dw(hJ?.['drm']?.['widevine']?.[lv(0xd4)])},{'system':lv(0xa6),'pssh':dw(hJ?.['drm']?.[lv(0xa6)]?.['pssh'])},{'system':'fairplay','pssh':dw(hJ?.[lv(0xeb)]?.['fairplay']?.['pssh'])}]['filter'](hK=>hK['pssh']);},dz=async hI=>{const lw=iA;let hJ=await dx(hI),hK=await dy(hI),hL=hJ?.['drm']?.['widevine']&&lw(0xde)||hJ?.['drm']?.['playready']&&'playready'||hJ?.['drm']?.['fairplay']&&'fairplay'||null;if(!hL)return null;let hM=hK['find'](hN=>hN['system']===hL);return{'system':hL,'cacheKey':hM?.['pssh']?hL+':'+hM['pssh']:'track:'+dq(hI)};},dA=async hI=>{const lx=iA;let hJ=new Map();for(let hK of hI){let hL=await dy(hK);for(let hM of hL)!hM['pssh']||hJ['has'](hM['pssh'])||hJ['set'](hM[lx(0xd4)],{'pssh':hM['pssh'],'system':hM['system'],'track':hK});}return hJ;},dB=({jobId:hI,title:hJ,entryTitle:hK,psshList:hL,options:hM,error:hN})=>{v['error']('Failed\x20to\x20extract\x20decryption\x20keys\x20for\x20job\x20'+hI),v['debug']('DRM\x20extraction\x20context:\x20title='+(hJ||hK||'(unknown)')+',\x20psshCount='+hL['length']+',\x20providedKeyCount='+(hM['keys']?.['length']??0x0)),hN instanceof Error?(dp('DRM\x20extraction\x20failure',hN),hN['message']==='Unauthorized'&&C['emit']('error',{'code':'DRM_UNAUTHORIZED'}),hN['message']==='Forbidden'&&C['emit']('error',{'code':'DRM_FORBIDDEN'})):v['debug'](String(hN));},dC=async({psshList:hI,requestLicense:hJ})=>{const ly=iA;v[ly(0xff)]('Extracting\x20decryption\x20keys');let hK=[],hL=[...new Set(hI??[])];for(let hM of hL){v['debug']('Resolving\x20DRM\x20keys\x20for\x20PSSH\x20'+hM),v['debug']('PSSH:\x20'+hM);let hN=Buffer['from'](hM,'base64'),hO='cenc',hP=new RemoteCdm({'keySystem':'com.widevine.alpha','baseUrl':c5(c4(),'drm'),'headers':{'Authorization':'Bearer\x20'+cq['accessToken']}}),hQ=null;try{hQ=(await requestMediaKeySystemAccess(hP['keySystem'],[])['createMediaKeys']({'cdm':hP}))['createSession'](),v['debug']('Generating\x20license\x20request...');let hS=hQ['waitForLicenseRequest']();await hQ['generateRequest']('cenc',hN);let hT=await hS;v['debug']('License\x20request\x20of\x20'+hT['length']+'\x20bytes\x20generated\x20for\x20session\x20'+hQ['sessionId']),v[ly(0xff)]('Requesting\x20license...');let hU=await hJ({'pssh':hM,'data':new Uint8Array(hT)});if(hU[0x0]===0x7b||hU[0x0]===0x3c){v['debug']('License\x20response\x20is\x20not\x20binary');let hW=Buffer['from'](hU)['toString']('utf8');if(v['debug'](hW),hW['includes']('<html>'))throw Error('Invalid\x20license\x20response');}v['debug']('Updating\x20session...'),await hQ['update'](new Uint8Array(hU)),v['debug']('Waiting\x20for\x20key\x20statuses\x20change...');let hV=await hQ['waitForKeyStatusesChange']();v[ly(0xff)]('Keys\x20count:\x20'+hV['length']),await hQ['close'](),await hQ['remove']();for(let hX of hV){let hY='Key:\x20'+hX[ly(0x1bc)]+':'+hX['key'];v['debug'](hY),hK[ly(0x1ea)]({'kid':hX['keyId'],'key':hX['key']});}}finally{if(hQ){try{await hQ['close']();}catch{}try{await hQ['remove']();}catch{}}}}return hK[ly(0xb4)]||(v['warn']('Can\x27t\x20get\x20decryption\x20keys'),v['debug'](ly(0xfc)+hL['join'](',\x20'))),hK;},dD=async({jobId:hI,title:hJ,entryTitle:hK,options:hL,psshList:hM,selectedTracks:hN,extension:hO,resource:hP})=>{const lz=iA;let hQ=hL['keys']??[];if(hQ['length'])return hQ;if(!hO)return[];let hS=bP(hO);if(!hS['drm'])return[];let hT=[];if(typeof hS['drm']['resolveKeys']=='function'){let hW=new Map(),hX=new Map();for(let hY of hN){let hZ=await dz(hY);if(!hZ)continue;let i0=hX['get'](hZ['cacheKey']);i0||(i0=await hS['drm'][lz(0x1ec)]({'system':hZ['system'],'resource':hP,'track':hY,'options':hL}),hX['set'](hZ['cacheKey'],i0));for(let i1 of i0)hW['has'](i1[lz(0x208)])||hW[lz(0x8a)](i1['kid'],i1);}hT[lz(0x1ea)](...Array['from'](hW[lz(0xcf)]()));}if(typeof hS['drm']['requestLicense']!='function')return hT;let hU=hS['drm']['requestLicense'],hV=await dA(hN);if(!hV['size'])return hT;try{let i2=await dC({'psshList':hM,'requestLicense':async({pssh:i3,data:i4})=>{let i5=hV['get'](i3);if(!i5)throw Error('No\x20DRM\x20track\x20binding\x20found\x20for\x20PSSH\x20'+i3);return await hU({'system':i5['system'],'resource':hP,'track':i5['track'],'options':hL,'data':i4});}});hT['push'](...i2);}catch(i3){let i4=dv(i3);throw dB({'jobId':hI,'title':hJ,'entryTitle':hK,'psshList':hM,'options':hL,'error':i4}),i4;}return hT;},dE=0x1,dF=0x4,dG=0x8,dH=0x10,dI=(hI,hJ)=>Math['max'](dE,Math['trunc'](typeof hI=='number'&&Number['isFinite'](hI)?hI:hJ)),dJ=hI=>hI['includes']('highConnectionsCount')?dH:hI['includes']('mediumConnectionsCount')?dG:dF,dK=({requestedConnections:hI,fallbackConnections:hJ=dE,grantedBenefits:hK})=>{let hL=dI(hI,dI(hJ,dE)),hM=dJ(hK),hN=Math['min'](hL,hM);return{'connections':hN,'normalizedRequestedConnections':hL,'maxAllowedConnections':hM,'wasClamped':hN<hL};},dL=async hI=>{const lA=iA;let {grantedBenefits:hJ}=await cB(),hK=null,hL=hJ['includes']('parallelDownloads'),hM=hI['maxActiveDownloads']&&hI['maxActiveDownloads']>0x1;if(!hL&&hM&&(hK=Error('PARALLEL_DOWNLOADS_NOT_ALLOWED'),hI['maxActiveDownloads']=0x1),hI['proxy']||hI['proxyMeta']||hI['proxyMedia']){let hN=hJ['includes']('proxy'),hO=hI['proxy']||hI['proxyMeta']||hI['proxyMedia'];!hN&&hO&&(hK=Error('PROXY_NOT_ALLOWED'),delete hI['proxy'],delete hI['proxyMeta'],delete hI['proxyMedia']);}if(hI[lA(0x23b)]&&hI['videoContainerFormat']!=='mp4'&&(hJ['includes'](lA(0x184))||(hK=Error('CUSTOM_MUX_FORMAT_NOT_ALLOWED'),hI['videoContainerFormat']='mp4')),typeof hI['connections']=='number'){let {connections:hP}=dK({'requestedConnections':hI[lA(0x1e4)],'grantedBenefits':hJ});hI['connections']=hP;}return{'error':hK,'data':hI};},dM=async()=>{try{let {grantedBenefits:hI}=await cB();return hI;}catch(hJ){let hK=hJ instanceof Error?hJ['message']:String(hJ);return v['warn']('Failed\x20to\x20resolve\x20customer\x20plan\x20for\x20connection\x20limits.\x20Falling\x20back\x20to\x20Free\x20limits:\x20'+hK),[];}},dN=(hI=dM)=>{let hJ;return async()=>(hJ||=hI(),hJ);},dO=hI=>({'retry':hI['get']('retry'),'connections':hI['get']('connections'),'proxy':hI['get']('proxy'),'proxyMeta':hI['get']('proxyMeta'),'proxyMedia':hI['get']('proxyMedia'),'movieTemplate':hI['get']('movieFilenameTemplate'),'episodeTemplate':hI['get']('seriesFilenameTemplate'),'hardsub':hI['get']('preferHardsub'),'format':hI['get']('videoContainerFormat')}),dP=({options:hI,fallbackConnections:hJ,grantedBenefits:hK})=>{let hL=dK({'requestedConnections':hI['connections'],'fallbackConnections':hJ,'grantedBenefits':hK});return{'options':{...hI,'connections':hL['connections']},'limit':hL};},dQ=({settings:hI,requestedOptions:hJ,filePath:hK,grantedBenefits:hL})=>{let hM=dO(hI),{options:hN,limit:hO}=dP({'options':{...hM,...hJ},'fallbackConnections':hM['connections'],'grantedBenefits':hL});return hK&&(hN['outputPath']=hK),{'baseOptions':hM,'options':hN,'limit':hO};},dR=hI=>{const lB=iA;let hJ=hI['replace'](/[<>:"/\\|?*\x00-\x1F]/g,'');hJ=hJ['replace'](/^[\s.]+|[\s.]+$/g,''),hJ=hJ['replace'](/\s+/g,'\x20');let hK=hJ['lastIndexOf']('.'),hL=hK>0x0,hM=hL?hJ['slice'](hK):'',hN=hL?hJ['slice'](0x0,hK):hJ;if(hM['length']>=0xff)hJ=hJ['slice'](0x0,0xff);else{let hP=0xff-hM['length'];hN['length']>hP&&(hN=hN[lB(0x1ca)](0x0,hP)),hJ=hN+hM;}let hO=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;if(hM['length']<0xff){let hQ=hJ['lastIndexOf']('.'),hS=hQ>0x0;if(hM=hS?hJ[lB(0x1ca)](hQ):'',hN=hS?hJ['slice'](0x0,hQ):hJ,hO['test'](hN)){let hT=0xff-hM['length'];hJ=('_'+hN)[lB(0x1ca)](0x0,hT)+hM;}}return hJ['length']===0x0?'untitled':hJ;},dS=(hI,hJ)=>Object['keys'](hJ)['reduce']((hK,hL)=>{const lC=iA;let hM='{'+hL+'}',hN=hJ[hL];if(!hN){let hO=RegExp('(?:\x5c.|^)\x5c{'+hL+'\x5c}(?=\x5c.|$)|\x5c{'+hL+'\x5c}(\x5c.|$)|\x5c{'+hL+'\x5c}','g');return hK['replace'](hO,(hP,hQ)=>'')['replaceAll']('....','...');}return hK[lC(0xd0)](hM,hN);},hI)['replaceAll']('\x20\x20','\x20')['replace'](/\(\s*[,._ -]+\s*/g,'(')['replace'](/\s*[,._ -]+\s*\)/g,')')['replace'](/\(\s*\)/g,'')['replace'](/\[\s*[,._ -]+\s*/g,'[')['replace'](/\s*[,._ -]+\s*\]/g,']')['replace'](/\[\s*\]/g,'')['replace'](/\{\s*[,._ -]+\s*/g,'{')['replace'](/\s*[,._ -]+\s*\}/g,'}')['replace'](/\{\s*\}/g,'')['replace'](/\s+/g,'\x20')['trim'](),dT=hI=>typeof hI=='string'&&hI[iA(0xb7)]()||'mp4',dU=hI=>{const lD=iA;switch(hI){case'mp3':return'mp3';case'aac':case lD(0x135):case'ac3':case'eac3':return'm4a';default:return'mka';}},dV=hI=>{if(!hI)return'';switch(hI){case'eac3':return'DDP';case'ac3':return'DD';default:return hI['toUpperCase']();}},dW=({options:hI,settings:hJ,tracks:hK,audioCodec:hL})=>hK['audios']['length']>0x0&&hK['videos']['length']===0x0&&hK['subtitles']['length']===0x0?dU(hL):dT(hI['format']||hJ['get']('videoContainerFormat')),dX=hI=>{let hJ=hI['seasonNumber']?''+hI['seasonNumber']:'',hK=hI['episodeNumber']?''+hI['episodeNumber']:'',hL=hJ?'S'+hJ:'',hM=hK?'E'+hK:'',hN=hJ&&hK?hL+':'+hM:'',hO=hI['episodeTitle']?.['trim']()?'\x22'+hI['episodeTitle']+'\x22':'';return((hI['title']??'')+'\x20'+hN+'\x20'+hO)['trim']();},dY=async({settings:hI,options:hJ,entry:hK,tag:hL,tracks:hM})=>{const lE=iA;let [hN,hO]=await Promise['all']([hM['videos'][0x0]?.['getCodec']()??null,hM['audios'][0x0]?.['getCodec']()??null]),hP=hI['get']('downloadDir'),hQ=hJ['movieTemplate']||hI['get']('movieFilenameTemplate'),hS=hJ['episodeTemplate']||hI['get']('seriesFilenameTemplate'),hT=dR(dS(hK['episodeNumber']?hS:hQ,{'title':hK['title']??'','s':hK['seasonNumber']?hK['seasonNumber']['toString']()['padStart'](0x2,'0'):'','e':hK['episodeNumber']?hK['episodeNumber'][lE(0x122)]()['padStart'](0x2,'0'):'','quality':hJ['videoQuality']??'','codec':hN??'','tag':hL??'','episodeTitle':hK['episodeTitle']??'','audioType':dV(hO),'format':'WEB-DL'}))+'.'+dW({'options':hJ,'settings':hI,'tracks':hM,'audioCodec':hO}),hU=hJ['outputPath']||join(hP,hT),hV=parse(hU);return{'outputPath':hU,'outputDirectory':hV[lE(0xa3)]||hP,'fileName':hV['base'],'baseName':hV['name']};},dZ=hI=>{if(!hI)return;let hJ=Object['fromEntries'](new Headers(hI)['entries']());return Object['keys'](hJ)['length']?hJ:void 0x0;},e0=hI=>{let hJ=hI,hK=hJ?.['rootPath'];if(typeof hK!='string'||!hK)throw Error('Resolved\x20media\x20resource\x20is\x20missing\x20a\x20usable\x20input\x20source\x20URL');return{'url':hK,'headers':dZ(hJ['_options']?.['requestInit']?.['headers'])};},e1=({videos:hI,audios:hJ,subtitles:hK,all:hL=[...hI,...hJ,...hK]})=>({'videos':hI,'audios':hJ,'subtitles':hK,'all':hL}),e2=hI=>hI?.['trim']()['toLowerCase']()??'',e3=hI=>e2(hI)['slice'](0x0,0x2),e4=hI=>e2(hI)||'und',e5=(hI,hJ)=>{let hK=e2(hI),hL=e2(hJ);return!hK||!hL?!0x1:hK===hL||hK['startsWith'](hL+'-')?!0x0:e3(hK)===e3(hL);},e6=hI=>Array['from'](new Map(hI['map'](hJ=>e2(hJ))['filter'](Boolean)['map'](hJ=>[e3(hJ),hJ]))['values']()),e7=hI=>(hI??0x0)/0x3e8,e8=async hI=>{const lF=iA;try{return(await hI['getSegments']())['length']+lF(0x1e7);}catch{return'?\x20Segments';}},e9=(hI,hJ)=>{let hK=new Map();for(let hL of hI){let hM=e4(hL['language']),hN=hK['get'](hM);if(!hN){hK['set'](hM,[hL]);continue;}hN['length']<hJ&&hN['push'](hL);}return Array['from'](hK['values']())['flat']();},ea=(hI,hJ,hK=0x1)=>{let hL=hI['toSorted']((hP,hQ)=>hQ['bitrate']-hP['bitrate']),hM=e6(hJ),hN=[];for(let hP of hM){let hQ=[];for(let hS of hL)e5(hS['language'],hP)&&hQ['push'](hS);hQ['length']&&hN['push'](...e9(hQ,hK));}let hO=e6(hL['map'](hT=>hT['language']||'und'));if(!hN['length'])for(let hT of hO){let hU=[];for(let hV of hL)e5(hV['language']||'und',hT)&&hU['push'](hV);hU['length']&&hN['push'](...e9(hU,hK));}return hN;},eb=async(hI,hJ)=>{let hK=hJ?parseInt(String(hJ),0xa)*0x10/0x9:void 0x0;return await hI['getVideoTracks']({'filter':async hL=>!await hL['hasOnlyKeyPackets'](),'sortBy':async hL=>[prefer(!!hJ&&Number(await hL['getDisplayHeight']())===Number(hJ)),prefer(!!hK&&Number(await hL['getDisplayWidth']())===Number(hK)),desc(await hL['getBitrate']())]});},ec=(hI,hJ)=>{const lG=iA;if(!hJ?.[lG(0xb4)])return hI;let hK=[];for(let hL of hI)hL['codec']&&hJ['includes'](hL['codec'])&&hK['push'](hL);return hK['length']?hK:hI;},ed=(hI,hJ)=>{if(!hJ)return hI;let hK=[];for(let hL of hI)hL['channels']===Number(hJ)&&hK['push'](hL);return hK['length']?hK:hI;},ee=async({input:hI,video:hJ})=>await hI['getAudioTracks']({'sortBy':async hK=>[prefer(!hJ||hK['canBePairedWith'](hJ)),desc(await hK['getBitrate']())]}),ef=async hI=>await hI['getSubtitleTracks']({'sortBy':async hJ=>[desc(await hJ['getBitrate']())]}),eg=async hI=>await hI['getName']?.()['catch'](()=>void 0x0)??'',eh=async(hI,hJ={})=>{const lH=iA;let [hK,hL,hM]=await Promise['all']([hI['getLanguageCode']()['catch'](()=>'und'),hI['getCodec']()['catch'](()=>void 0x0),hI['getBitrate']()['catch'](()=>0x0)]),hN={'id':dq(hI),'track':hI,'type':hI['type'],'language':hK??'und','languageFamily':e3(hK),'label':'','codec':hL??void 0x0,'bitrate':hM??0x0};if(hI['type']==='video'||hI['isVideoTrack']?.()===!0x0){let hU=hI,[hV,hW,hX]=await Promise['all']([hU['getDisplayWidth']()['catch'](()=>void 0x0),hU['getDisplayHeight']()[lH(0x1a9)](()=>void 0x0),e8(hU)]);return{...hN,'width':hV??void 0x0,'height':hW??void 0x0,'label':(hV??'?')+'x'+(hW??'?')+'\x20|\x20'+(e7(hM)||'?')+'\x20Kbps\x20|\x20'+(hL??'?')+'\x20|\x20'+hX};}if(!(hI['type']==='audio'||hI['isAudioTrack']?.()===!0x0)){let hY=await e8(hI);return{...hN,'label':(hL??'?')+'\x20|\x20'+(hK||'und')+'\x20|\x20'+hY};}let hO=hI,[hP,hQ,hS,hT]=await Promise['all']([hO[lH(0x17b)]()[lH(0x1a9)](()=>void 0x0),hJ['pairableWithVideo']?Promise['resolve'](hO[lH(0x1b4)](hJ['pairableWithVideo']))['catch'](()=>!0x1):Promise['resolve'](void 0x0),eg(hO),e8(hO)]);return{...hN,'channels':hP??void 0x0,'pairableWithPrimaryVideo':hQ,'label':''+(hS?hS+'\x20|\x20':'')+(e7(hM)||'?')+'\x20Kbps\x20|\x20'+(hL?hL+'\x20|\x20':'')+(hK||'und')+'\x20|\x20'+(hP??'?')+lH(0x15d)+hT};},ei=async(hI,hJ)=>await Promise['all'](hI['map'](async hK=>await eh(hK,hJ))),ej=async({videos:hI,audios:hJ,subtitles:hK})=>{let hL=hI[0x0],[hM,hN,hO]=await Promise['all']([ei(hI),ei(hJ,{'pairableWithVideo':hL}),ei(hK)]);return{'videos':hM,'audios':hN,'subtitles':hO};},ek=async(hI,hJ)=>{let hK=hJ['videoQuality'],hL=ec(await ei(await eb(hI,hK||NaN)),hJ['videoCodecs'])['map'](hM=>hM['track']);return await ej({'videos':hL,'audios':await ee({'input':hI,'video':hL[0x0]}),'subtitles':await ef(hI)});},el=({options:hI,catalog:hJ})=>{const lI=iA;let hK=hI['skipVideo']?void 0x0:hJ[lI(0xa4)][0x0],hL=[...hI['languages']||[]],hM=hJ['audios']['filter'](hP=>hK&&hP[lI(0xef)]);hM['length']||(hM=[...hJ['audios']]),hM=ed(hM,hI['audioChannels']),hM=ec(hM,hI['audioCodecs']);let hN=ea(hM,hL,0x1);hN['length']&&(hM=hN);let hO=[];for(let hP of hJ['subtitles'])(!hI['subtitleLanguages']?.['length']||hI['subtitleLanguages']['some'](hQ=>e5(hP['language']||'und',hQ)))&&hO[lI(0x1ea)](hP);return{'videos':hK?[hK]:[],'audios':hI['skipAudio']?[]:hM,'subtitles':hI['skipSubtitles']?[]:hO};},em=async({options:hI,catalog:hJ})=>{const lJ=iA;let hK=el({'options':hI,'catalog':hJ}),hL=hK['audios']['map'](hN=>hN['track']),hM=(hI['languages']||[])['at'](-0x1);if(hM){for(let hN of hK['audios'])(!hN['language']||hN['language']==='und')&&hN[lJ(0x120)]['setLanguageCode'](hM);}return e1({'videos':hK['videos']['map'](hO=>hO['track']),'audios':hI['skipAudio']?[]:hL,'subtitles':hI[lJ(0xc5)]?[]:hK['subtitles'][lJ(0x181)](hO=>hO['track'])});},en=hI=>{if(!hI)return null;try{return new URL(hI);}catch{return null;}},eo=(hI,hJ)=>{const lK=iA;if(!hJ['languages']?.[lK(0xb4)])return(hI['context']?.['legacy']?.['source'])?.['audioLanguage']?.['trim']()||void 0x0;},ep=(hI,hJ)=>{const lL=iA;if(hI)switch(hI){case'aar':case'abk':return'rus';case lL(0x22a):return'eng';case'zu':return hJ?.['includes']('start.film')?'ru':'zu';default:return hI;}},eq=async(hI,hJ)=>{let hK=await hI['getLanguageCode']()['catch'](()=>void 0x0),hL=ep(hK,hJ);hL&&hL!==hK&&hI['setLanguageCode'](hL);},er=async(hI,hJ)=>{await Promise['all'](hI['map'](hK=>eq(hK,hJ)));},es=(hI,hJ)=>hI['filter'](hK=>hK['type']===hJ)['length'],et=hI=>{const lM=iA;let hJ='Extracted,\x20there\x20are\x20';if(hI['length']===0x0)hJ+='no\x20tracks';else{hJ+=hI['length']+'\x20tracks';let hK=es(hI,'video');hK&&(hJ+=',\x20'+hK+lM(0xd3));let hL=es(hI,'audio');hL&&(hJ+=',\x20'+hL+'\x20audio\x20tracks');let hM=es(hI,'subtitle');hM&&(hJ+=',\x20'+hM+'\x20subtitle\x20tracks');}v[lM(0x1eb)](hJ);},eu=async(hI,hJ)=>{let hK=await hI['getSubtitleTracks']();return await er(hK,hJ),hK;},ev=(hI,hJ)=>{const lN=iA;v['debug']('URL:\x20'+e0(hI['input']['source'])['url']);let hK=hJ['seasonNumber'],hL=hJ[lN(0x1d7)],hM=hJ['episodeTitle']??'',hN=[hJ['title'],hK?'S'+hK:'',hL?'E'+hL:'',hM]['filter'](Boolean)['join']('\x20∙\x20');hN&&v['info'](hN);},ew=(hI,hJ)=>{const lO=iA;if(hI['title'])return;let hK=en(hJ)?.['pathname'][lO(0x207)]('/')['pop']();hK&&(hI['title']=hK);},ex=(hI,hJ)=>{const lP=iA;if(hI['title'])return;let hK=en(hJ)?.[lP(0x85)];hK&&(hI['title']=hK+'_'+r());},ey=(hI,hJ)=>{const lQ=iA;hI[lQ(0x22c)]||=hJ?hJ+'p':void 0x0;},ez=async({options:hI,resource:hJ,entry:hK})=>{let hL=e0(hJ['input']['source'])['url'],hM={...hI},hN={...hK},hO=hJ['input'];ew(hN,hL);let [hP,hQ,hS]=await Promise['all']([hO['getPrimaryVideoTrack'](),hO['getPrimaryAudioTrack'](),eu(hO,hL)]);ey(hM,await hP?.['getCodedHeight']());let hT=hP&&!hM['skipVideo']?[hP]:[],hU=[];hQ&&!hM['skipAudio']&&(await eq(hQ,hL),hU=[hQ]);let hV=e1({'videos':hT,'audios':hU,'subtitles':hS});return et(hV['all']),{'options':hM,'resource':hJ,'entry':hN,'tracks':hV,'isSegmented':!0x1};},eA=async({options:hI,resource:hJ,entry:hK,trackSelector:hL})=>{let hM=e0(hJ['input']['source'])['url'],hN={...hI},hO={...hK};await er(await hJ['input']['getTracks'](),hM),ex(hO,hM);let hP={...hN},hQ=eo(hO,hP);hQ&&(hP['languages']=[hQ]);let hS=await hL({'options':hP,'catalog':await ek(hJ['input'],hP)});if(et(hS['all']),!hS['videos']['length']&&!hS['audios']['length']&&!hS['subtitles']['length'])throw new cM('No\x20tracks\x20selected');return hS['videos'][0x0]&&ey(hN,await hS['videos'][0x0]['getDisplayHeight']()),{'options':hN,'resource':hJ,'entry':hO,'tracks':hS,'isSegmented':!0x0};},eB={'direct':ez,'manifest':eA},eC=hI=>hI===HLS||hI===DASH?'manifest':'direct',eD=async({format:hI,options:hJ,resource:hK,entry:hL,trackSelector:hM})=>(v['info']('Content\x20Matched:\x20'+hI['name']),await eB[eC(hI)]({'options':hJ,'resource':hK,'entry':hL,'trackSelector':hM})),eE=async({options:hI,resource:hJ,entry:hK,trackSelector:hL=em})=>await eD({'format':await hJ['input']['getFormat'](),'options':hI,'resource':hJ,'entry':hK,'trackSelector':hL??em}),eF=async({settings:hI,options:hJ,resource:hK,extensionTag:hL,trackSelector:hM})=>{let hN={...hK['entry'],'id':hK['entry']['id']??crypto['randomUUID']()};ev(hK,hN),v['info']('Parsing\x20streams...');let hO=await eE({'options':{...hJ},'resource':hK,'entry':hN,'trackSelector':hM}),hP=await dY({'settings':hI,'options':hO['options'],'entry':hO['entry'],'tag':hL,'tracks':hO['tracks']});return await b1(hP['outputDirectory']),{...hO,'output':hP,'downloadTitle':dX(hO['entry'])||hP['baseName']};},eG=async({extensionManager:hI,entry:hJ,url:hK,options:hL,signal:hM})=>{let hN=hK?await hI['getExtensionForUrl'](hK):null,hO=await di({'entry':hJ,'url':hK??hJ['source']?.['url']??'','options':hL,'extension':hN,'signal':hM});return{'resource':hO,'extension':hN,'extensionTag':hN?bs(hN):void 0x0,'beforeDownload':async()=>{!hN||!hK||await bV(hN,{'url':hK,'options':hL,'resource':hO,'signal':hM});},'afterDownload':async hP=>{!hN||!hK||await bW(hN,{'url':hK,'options':hL,'resource':hO,'signal':hM,'skipMux':hP});},'dispose':async()=>{const lR=b;if(hO['dispose']){await hO['dispose']();return;}await hO[lR(0x172)]['dispose']?.();}};};function b(c,d){c=c-0x83;const e=a();let f=e[c];return f;}var eH=class{['strategy'];constructor(hI){this['strategy']=hI;}async['prepare'](){const lS=iA;await this[lS(0x114)]['prepare']?.();}async['process'](hI){const lT=iA;let hJ=await this[lT(0x114)]['decryptFile'](hI);return hI['cleanup']&&await rm(hI[lT(0x172)],{'force':!0x0}),hJ;}};const eI=hI=>hI['replaceAll']('-','')['toLowerCase']();var eJ=class{async['decryptFile'](hI){const lU=iA;let hJ=new Map();for(let hK of hI[lU(0x1ed)]){if(!hK['kid'])throw Error('Shifro\x20requires\x20a\x20KID\x20for\x20every\x20decryption\x20key');hJ['set'](eI(hK['kid']),eI(hK['key']));}return v['debug'](lU(0x128)+hI['input']),await(await Decryption['init']({'input':new a1({'source':new FilePathSource(hI['input']),'keys':hJ}),'output':new a2({'target':new FilePathTarget(hI['output'])})}))[lU(0x218)](),hI['output'];}};const eK=async(hI,hJ,hK)=>hK??open(hI,hJ),eL=hI=>{let hJ=null;return new StreamSource({'getSize':async()=>(hJ=await eK(hI,'r',hJ),(await hJ['stat']())['size']),'read':async(hK,hL)=>{hJ=await eK(hI,'r',hJ);let hM=new Uint8Array(hL-hK);return await hJ['read'](hM,0x0,hL-hK,hK),hM;},'dispose':async()=>{let hK=hJ;hJ=null,await hK?.['close']();},'prefetchProfile':'fileSystem'});},eM=hI=>{let hJ=null;return new StreamTarget(new WritableStream({'start':async()=>{hJ=await eK(hI,'w',hJ);},'write':async hK=>{if(!hJ)throw Error('MediaBunny\x20output\x20handle\x20was\x20not\x20initialized\x20for\x20'+hI);await hJ['write'](hK['data'],0x0,hK['data']['byteLength'],hK['position']);},'close':async()=>{let hK=hJ;hJ=null,await hK?.['close']();},'abort':async()=>{let hK=hJ;hJ=null,await hK?.['close']();}}),{'chunked':!0x0});},eN=/(?:(.+?)\n)?((?:\d{2}:)?\d{2}:\d{2}\.\d{3})\s+-->\s+((?:\d{2}:)?\d{2}:\d{2}\.\d{3})([^\n]*)/g,eO=/^\uFEFF?WEBVTT(?:.|\n)*?\n{2}/,eP=/(?:(\d{2}):)?(\d{2}):(\d{2})\.(\d{3})/,eQ={'ar':'ara','de':'deu','en':'eng','es':'spa','fr':'fra','hi':'hin','it':'ita','ja':'jpn','ko':'kor','pl':'pol','pt':'por','ru':'rus','th':'tha','tr':'tur','uk':'ukr','und':'und','vi':'vie','zh':'zho'},eR=hI=>hI==='subtitle'||hI==='text',eS=hI=>{const lV=iA;let hJ=hI['_muxer']?.[lV(0xfe)];hJ?.['start']&&!hJ['started']&&hJ['start']();},eT=hI=>{const lW=iA;let hJ=hI['trim']()['split'](':');if(hJ['length']<0x2||hJ['length']>0x3)throw Error(lW(0x220)+hI);let hK=Number(hJ['at'](-0x1)),hL=Number(hJ['at'](-0x2)),hM=hJ[lW(0xb4)]===0x3?Number(hJ[0x0]):0x0;if(![hM,hL,hK]['every'](hN=>Number['isFinite'](hN)&&hN>=0x0))throw Error('Invalid\x20trim\x20timestamp:\x20'+hI);return hM*0xe10+hL*0x3c+hK;},eU=hI=>{let hJ=eP['exec'](hI);if(!hJ)throw Error('Invalid\x20WebVTT\x20timestamp:\x20'+hI);return 0xe10*0x3e8*Number(hJ[0x1]||'0')+0x3c*0x3e8*Number(hJ[0x2])+0x3e8*Number(hJ[0x3])+Number(hJ[0x4]);},eV=hI=>{const lX=iA;let hJ=Math['floor'](hI/(0xe10*0x3e8)),hK=Math[lX(0x205)](hI%(0xe10*0x3e8)/(0x3c*0x3e8)),hL=Math[lX(0x205)](hI%(0x3c*0x3e8)/0x3e8),hM=hI%0x3e8;return hJ['toString']()['padStart'](0x2,'0')+':'+hK['toString']()['padStart'](0x2,'0')+':'+hL['toString']()['padStart'](0x2,'0')+'.'+hM['toString']()['padStart'](0x3,'0');},eW=hI=>{let hJ=[hI['invalidEntries']?.['length']?hI['invalidEntries']['length']+'\x20invalid\x20entries':void 0x0,hI['invalidTimecodes']?.['length']?hI['invalidTimecodes']['length']+'\x20invalid\x20timecodes':void 0x0,hI['invalidIndices']?.['length']?hI['invalidIndices']['length']+'\x20invalid\x20indices':void 0x0,hI['timecodeIssues']?.['reversedTimecodes']?.['length']?hI['timecodeIssues']['reversedTimecodes']['length']+'\x20reversed\x20timecodes':void 0x0,hI['timecodeIssues']?.['overlappingTimecodes']?.['length']?hI['timecodeIssues']['overlappingTimecodes']['length']+'\x20overlapping\x20timecodes':void 0x0]['filter'](Boolean);return hJ['length']?'\x20('+hJ['join'](',\x20')+')':'';},eX=hI=>!!(hI['invalidEntries']?.['length']||hI['invalidTimecodes']?.['length']||hI['invalidIndices']?.[iA(0xb4)]||hI['timecodeIssues']?.['reversedTimecodes']?.['length']),eY=(hI,hJ='.vtt')=>{let hK=hI['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')['trim']();if(eO['test'](hK))return hK;let {subtitle:hL,status:hM}=convert(hI,hJ);if(!hM['success']&&eX(hM))throw Error('Failed\x20to\x20convert\x20subtitle\x20to\x20WebVTT'+eW(hM)+'.');return hL['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')['trim']();},eZ=hI=>{const lY=iA;if(!hI)return;let hJ=hI[lY(0xb7)]()[lY(0x91)]();if(!hJ)return;let hK=hJ['split']('-')[0x0]??hJ;return/^[a-z]{3}$/['test'](hK)?hK:eQ[hK];},f0=hI=>{switch(extname(hI)['toLowerCase']()){case'.mp4':case'.m4a':return new Mp4OutputFormat();case'.mkv':case'.mka':return new MkvOutputFormat();case'.mp3':return new Mp3OutputFormat();default:throw Error('Unsupported\x20mux\x20output\x20format:\x20'+hI);}},f1=hI=>new Z({'formats':Y,'source':eL(hI)}),f2=hI=>hI instanceof Mp4OutputFormat?'mov_text':'srt',f3=hI=>{const lZ=iA;let hJ=hI['trimBegin']?eT(hI['trimBegin']):void 0x0,hK=hI['trimEnd']?eT(hI[lZ(0x1ef)]):void 0x0;if(hJ!==void 0x0&&hK!==void 0x0&&hK<=hJ)throw Error('trimEnd\x20must\x20be\x20greater\x20than\x20trimBegin');return{'trimBegin':hJ,'trimEnd':hK};},f4=()=>{let hI=0x0,hJ;return hK=>{let hL=hK['timestamp']+hI;return hJ!==void 0x0&&hL<hJ-0x1&&(hI+=hJ+0.000001-hL,hL=hK['timestamp']+hI),hJ=Math['max'](hJ??hL,hL),hL;};},f5=async(hI,hJ,hK,hL,hM)=>{const m0=iA;let hN=f1(hJ),hO=await hN['getPrimaryVideoTrack']();if(!hO)throw Error('Missing\x20video\x20track\x20in\x20'+hJ);let hP=hO[m0(0x14b)];if(!hP)throw Error('Unknown\x20video\x20codec\x20in\x20'+hJ);if(hM!==void 0x0&&hM>=await hO['computeDuration']())throw Error('trimBegin\x20excludes\x20the\x20full\x20video\x20track\x20in\x20'+hJ);let hQ=new EncodedPacketSink(hO),hS=hM===void 0x0?await hQ['getFirstKeyPacket']({'verifyKeyPackets':!0x0}):await hQ['getKeyPacket'](hM,{'verifyKeyPackets':!0x0})??await hQ['getFirstKeyPacket']({'verifyKeyPackets':!0x0});if(!hS)throw Error('No\x20video\x20packets\x20found\x20in\x20'+hJ);let hT=hM===void 0x0?await hQ['getFirstPacket']({'verifyKeyPackets':!0x0}):void 0x0,hU=new EncodedVideoPacketSource(hP);return hI['addVideoTrack'](hU,{'disposition':await hO['getDisposition'](),'name':hK??await hO['getName']()??void 0x0,'rotation':hL['supportsVideoRotationMetadata']?await hO['getRotation']():void 0x0}),{'kind':'video','input':hN,'sink':hQ,'source':hU,'startPacket':hS,'startTimestamp':Math['min'](hS['timestamp'],hT?.['timestamp']??hS['timestamp']),'emit':async hV=>{let hW={'decoderConfig':await hO['getDecoderConfig']()??void 0x0},hX=!0x0,hY=f4();for await(let hZ of hQ['packets'](hS,void 0x0,{'verifyKeyPackets':!0x0}))await hU['add'](hZ['clone']({'timestamp':hY(hZ)-hV}),hX?hW:void 0x0),hX=!0x1;hU['close']();}};},f6=async(hI,hJ,hK,hL,hM)=>{const m1=iA;let hN=f1(hJ),hO=await hN['getPrimaryAudioTrack']();if(!hO)throw Error(m1(0x1f5)+hJ);let hP=await hO['getCodec']();if(!hP)throw Error('Unknown\x20audio\x20codec\x20in\x20'+hJ);if(hM!==void 0x0&&hM>=await hO['computeDuration']())throw Error('trimBegin\x20excludes\x20the\x20full\x20audio\x20track\x20in\x20'+hJ);let hQ=new EncodedPacketSink(hO),hS=hM===void 0x0?await hQ['getFirstPacket']():await hQ['getPacket'](hM)??await hQ['getFirstPacket']();if(!hS)throw Error(m1(0xe1)+hJ);let hT=new EncodedAudioPacketSource(hP);return hI['addAudioTrack'](hT,{'disposition':await hO['getDisposition'](),'languageCode':eZ(hK)??eZ(await hO['getLanguageCode']()),'name':hL??await hO['getName']()??void 0x0}),{'kind':'audio','input':hN,'sink':hQ,'source':hT,'startPacket':hS,'startTimestamp':hS['timestamp'],'emit':async hU=>{let hV={'decoderConfig':await hO['getDecoderConfig']()??void 0x0},hW=!0x0,hX=f4();for await(let hY of hQ['packets'](hS))await hT['add'](hY['clone']({'timestamp':hX(hY)-hU}),hW?hV:void 0x0),hW=!0x1;hT['close']();}};},f7=(hI,{trimBegin:hJ,trimEnd:hK,commonStart:hL})=>{const m2=iA;let hM=hI['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')['trim']();if(!eO[m2(0x1d8)](hM))throw Error('Only\x20WebVTT\x20subtitles\x20are\x20supported\x20by\x20the\x20MediaBunny\x20muxer.');let hN=hJ===void 0x0?void 0x0:Math['round'](hJ*0x3e8),hO=hK===void 0x0?void 0x0:Math[m2(0x116)](hK*0x3e8),hP=Math['round'](hL*0x3e8);eN[m2(0x20b)]=0x0;let hQ=eN['exec'](hM),hS=hM['slice'](0x0,hQ?.['index']??hM['length'])[m2(0x1ef)](),hT=[],hU=hQ?hM['slice'](hQ['index']):'';for(;;){eN['lastIndex']=0x0;let hV=eN['exec'](hU);if(!hV)break;let hW=hV['index']+hV[0x0]['length'],hX=hU['indexOf']('\x0a',hW)+0x1,hY=hU[m2(0x125)]('\x0a\x0a',hW);hY===-0x1&&(hY=hU['length']);let hZ=hV[0x1]?.['trim'](),i0=hV[0x4]?.['trim'](),i1=hU[m2(0x1ca)](hX,hY)['trim'](),i2=eU(hV[0x2]),i3=eU(hV[0x3]),i4=Math['max'](i2,hN??i2)-hP,i5=Math['min'](i3,hO??i3)-hP;if(i5>i4){let i6=eV(i4)+'\x20-->\x20'+eV(i5)+(i0?'\x20'+i0:'');hT['push']([hZ,i6,i1]['filter'](Boolean)['join']('\x0a'));}hU=hU['slice'](hY)['trimStart']();}return[hS,...hT]['filter'](Boolean)['join']('\x0a\x0a');},f8=async(hI,hJ,hK,hL,hM)=>{const m3=iA;if(hK['type']==='video'){if(hJ instanceof Mp3OutputFormat)throw Error('MP3\x20output\x20does\x20not\x20support\x20video\x20tracks.');return f5(hI,hK['path'],hK['label'],hJ,hL);}if(hK['type']==='audio')return f6(hI,hK[m3(0x159)],hK[m3(0x12f)],hK['label'],hL);if(eR(hK['type'])){if(hJ instanceof Mp3OutputFormat)throw Error('MP3\x20output\x20does\x20not\x20support\x20subtitle\x20tracks.');let hN=eY(await readFile(hK['path'],'utf8')),hO=new TextSubtitleSource(f2(hJ));return hI['addSubtitleTrack'](hO,{'disposition':hK['forced']?{'forced':!0x0}:void 0x0,'languageCode':eZ(hK[m3(0x12f)]),'name':hK['label']}),{'kind':'subtitle','source':hO,'emit':async hP=>{let hQ=f7(hN,{'trimBegin':hL,'trimEnd':hM,'commonStart':hP});await hO['add'](hQ),hO['close']();}};}throw Error('Unsupported\x20mux\x20input\x20type:\x20'+hK['type']);};var f9=class{async['mux'](hI){const m4=iA;let {trimBegin:hJ,trimEnd:hK}=f3(hI),hL=f0(hI['output']),hM=new Output({'format':hL,'target':eM(hI['output'])}),hN=[];try{for(let hQ of hI['inputs'])hN['push'](await f8(hM,hL,hQ,hJ,hK));let hO=hN['filter'](hS=>hS[m4(0x15a)]!=='subtitle');if(!hN['length'])throw Error('No\x20tracks\x20provided\x20for\x20muxing.');let hP=hO['length']>0x0?Math['min'](...hO['map'](hS=>hS['startTimestamp'])):hJ??0x0;await hM['start'](),eS(hM);for(let hS of hN){if(hS['kind']==='subtitle'){await hS['emit'](hP);continue;}await hS[m4(0x20e)](hP);}return await hM['finalize'](),hI['output'];}catch(hT){throw await hM['cancel']()['catch'](()=>void 0x0),hT;}finally{for(let hU of hN)hU['kind']!=='subtitle'&&hU[m4(0x172)]['dispose']();}}},fa=class{['strategy'];constructor(hI){this['strategy']=hI;}async['prepare'](){await this['strategy']['prepare']?.();}async['process'](hI){let hJ=await this['strategy']['mux'](hI);if(hI['cleanup']){for(let hK of new Set(hI['inputs']['map'](hL=>hL['path'])))await rm(hK,{'force':!0x0});}return hJ;}};const fb=()=>{const m5=iA;if(!(process['platform']!=='win32'||process.env.ELECTRON_RUN_AS_NODE!=='1')&&!isatty(process['stderr']['fd'])&&af()?.['getConsoleSize']?.()?.['columns'])try{let hI=ad('nanospinner/dist/consts.js');hI&&hI['isTTY']===!0x1&&(hI['isTTY']=!0x0,hI['symbols']?.['frames']?.['length']===0x1&&(hI[m5(0x144)]['frames']=['-','\x5c','|','/']));}catch{}},fc=hI=>{const m6=iA;let hJ=process['stderr'];if(!hI||process['platform']!=='win32'||process.env.ELECTRON_RUN_AS_NODE!=='1')return hJ;if(!hJ['columns']||hJ[m6(0x141)]!==hI){let hK=Object['getOwnPropertyDescriptor'](hJ,'columns')??Object['getOwnPropertyDescriptor'](Object['getPrototypeOf'](hJ),'columns');if(!hK||hK['writable']||hK['set'])try{hJ['columns']=hI;}catch{}if(hJ['columns']!==hI){let hL=Object['create'](hJ);return Object['defineProperty'](hL,'columns',{'value':hI,'configurable':!0x0,'enumerable':!0x0,'writable':!0x0}),v['warn']('Unable\x20to\x20override\x20stderr.columns;\x20using\x20spinner-local\x20width\x20'+hI+'.'),hL;}}return hJ;},fd={'debug':'gray','info':'green','warn':'yellow','error':iA(0xa1)},fe=hI=>{let hJ=hI['toUpperCase'](),hK=T[fd[hI]];return hK(hJ);},ff=(hI,hJ)=>typeof hJ=='string'?hI+'\x20'+hJ:hJ&&{...hJ,'text':(hI+'\x20'+(hJ['text']??''))['trimEnd']()},fg=(hI,hJ)=>{const m7=iA;fb();let hK=F(fe(m7(0x1eb))),hL=createSpinner(hI,{'stream':fc(af()?.['getConsoleSize']?.()?.['columns']??process['stderr'][m7(0x141)]??process['stdout']['columns']??(process['platform']==='win32'?0x78:0x50))})['start']({'text':hK+'\x20'+hI,'color':hJ}),hM=hL['update']['bind'](hL),hN=hL['success']['bind'](hL),hO=hL['error']['bind'](hL);return hL['update']=hP=>hM(ff(hK,hP)),hL['success']=hP=>hN(ff(hK,hP)),hL[m7(0x171)]=hP=>hO(ff(hK,hP)),hL;},fh={'update':()=>void 0x0,'success':()=>void 0x0,'error':()=>void 0x0},fi={'createTask':()=>fh,'progress':()=>void 0x0},fj=()=>({'createTask':(hI,hJ)=>{const m8=iA;let hK=fg(hI,hJ?.['color']);return{'update':hL=>hK['update'](hL),'success':hL=>hK[m8(0x134)](hL),'error':hL=>hK['error'](hL)};},'progress':()=>void 0x0}),fk=async hI=>{const m9=iA;if(!hI['keys']['length'])return[...hI['inputs']];let hJ=hI['inputs']['map'](hN=>({...hN})),hK=(hI['reporter']??fi)['createTask']('Decrypting'),hL=new eH(new eJ());await hL['prepare']();let hM=new Map();for(let hN of hJ){if(hN['type']!=='video'&&hN['type']!=='audio')continue;let hO=hM['get'](hN['path']);if(hO){hN['path']=hO;continue;}let hP=hN['path'],hQ=extname(hP),hS=hP['replace'](hQ,'.dec'+hQ);if(await hL['process']({'input':hP,'output':hS,'keys':hI[m9(0x1ed)],'type':hN['type'],'cleanup':!0x0}),!existsSync(hS))throw Error('Decryption\x20failed\x20for\x20file\x20'+hP+'.\x20Unable\x20to\x20find\x20'+hS);hM['set'](hP,hS),hN['path']=hS;}return hK['success']('Decrypted'),hJ;},fl=async hI=>{const ma=iA;if(hI['skipMux'])return;let hJ=hI['skipSubtitlesMux']?hI['inputs']['filter'](hM=>hM['type']!=='subtitle'):hI['inputs'];if(!hJ['length'])return;let hK=(hI['reporter']??fi)['createTask']('Muxing'),hL=new fa(new f9());if(await hL['prepare'](),await hL['process']({'inputs':hJ,'output':hI['output'],'trimBegin':hI['trimBegin'],'trimEnd':hI['trimEnd'],'cleanup':!0x0}),existsSync(hI['output']))return hK['success']('Muxed'),v['debug']('Muxed:\x20'+hI['output']),hI['output'];hK['error']('Muxing\x20failed.\x20Output\x20file\x20not\x20found:\x20'+hI[ma(0xbb)]);},fm=async hI=>{let hJ=await fk(hI);return{'outputPath':await fl({...hI,'inputs':hJ}),'artifacts':hJ};},fn=async(hI,hJ)=>{const mb=iA;let hK=hJ+'\x20∙\x20';if(hI[mb(0xb2)]==='subtitle'?hK+='SUBTITLES':hK+=hI['type']['toUpperCase'](),hI['isVideoTrack']()){let [hL,hM,hN]=await Promise['all']([hI['getDisplayWidth'](),hI['getDisplayHeight'](),hI['getBitrate']()]);hL&&(hK+='\x20∙\x20'+hL+'x'+hM),hN&&(hK+='\x20∙\x20'+Math['round'](hN/0x3e8)+mb(0x224));}if(hI['isAudioTrack']()){let [hO,hP,hQ,hS]=await Promise['all']([hI['getLanguageCode'](),hI['getName'](),hI['getSampleRate'](),hI['getBitrate']()]);hO&&(hK+='\x20∙\x20'+hO['toUpperCase']()),hP&&(hK+='\x20('+hP+')'),hQ&&(hK+='\x20∙\x20'+hQ+'\x20kHz'),hS&&(hK+='\x20∙\x20'+Math['round'](hS/0x3e8)+'\x20KiB/s');}if(hI['type']==='subtitle'){let [hT,hU,hV]=await Promise['all']([hI['getLanguageCode'](),hI['getName'](),hI['getDisposition']()]);hT&&(hK+='\x20∙\x20'+hT['toUpperCase']()),hU&&(hK+='\x20('+hU+')'),hV[mb(0x92)]&&(hK+='\x20FORCED');}return hK;};var fo=aa((hI,hJ)=>{function hK(hL){var hM=new hL(),hN=hM;function hO(){var hQ=hM;return hQ['next']?hM=hQ['next']:(hM=new hL(),hN=hM),hQ['next']=null,hQ;}function hP(hQ){hN['next']=hQ,hN=hQ;}return{'get':hO,'release':hP};}hJ['exports']=hK;}),fp=aa((hI,hJ)=>{var hK=fo();function hL(hP,hQ,hS){if(typeof hP=='function'&&(hS=hQ,hQ=hP,hP=null),!(hS>=0x1))throw Error('fastqueue\x20concurrency\x20must\x20be\x20equal\x20to\x20or\x20greater\x20than\x201');var hT=hK(hN),hU=null,hV=null,hW=0x0,hX=null,hY={'push':i5,'drain':hM,'saturated':hM,'pause':i0,'paused':!0x1,get 'concurrency'(){return hS;},set 'concurrency'(ic){const mc=b;if(!(ic>=0x1))throw Error(mc(0xdf));if(hS=ic,!hY[mc(0x178)]){for(;hU&&hW<hS;)hW++,i7();}},'running':hZ,'resume':i3,'idle':i4,'length':i1,'getQueue':i2,'unshift':i6,'empty':hM,'kill':i8,'killAndDrain':i9,'error':ib,'abort':ia};return hY;function hZ(){return hW;}function i0(){hY['paused']=!0x0;}function i1(){for(var ic=hU,id=0x0;ic;)ic=ic['next'],id++;return id;}function i2(){for(var ic=hU,id=[];ic;)id['push'](ic['value']),ic=ic['next'];return id;}function i3(){if(hY['paused']){if(hY['paused']=!0x1,hU===null){hW++,i7();return;}for(;hU&&hW<hS;)hW++,i7();}}function i4(){return hW===0x0&&hY['length']()===0x0;}function i5(ic,id){const md=b;var ie=hT['get']();ie['context']=hP,ie['release']=i7,ie['value']=ic,ie[md(0x227)]=id||hM,ie['errorHandler']=hX,hW>=hS||hY['paused']?hV?(hV['next']=ie,hV=ie):(hU=ie,hV=ie,hY[md(0x229)]()):(hW++,hQ['call'](hP,ie['value'],ie['worked']));}function i6(ic,id){const me=b;var ie=hT['get']();ie['context']=hP,ie['release']=i7,ie['value']=ic,ie['callback']=id||hM,ie['errorHandler']=hX,hW>=hS||hY['paused']?hU?(ie['next']=hU,hU=ie):(hU=ie,hV=ie,hY['saturated']()):(hW++,hQ[me(0x121)](hP,ie['value'],ie['worked']));}function i7(ic){const mf=b;ic&&hT[mf(0x8c)](ic);var id=hU;id&&hW<=hS?hY['paused']?hW--:(hV===hU&&(hV=null),hU=id['next'],id['next']=null,hQ['call'](hP,id[mf(0xd7)],id['worked']),hV===null&&hY['empty']()):--hW===0x0&&hY['drain']();}function i8(){hU=null,hV=null,hY['drain']=hM;}function i9(){hU=null,hV=null,hY['drain'](),hY['drain']=hM;}function ia(){const mg=b;var ic=hU;for(hU=null,hV=null;ic;){var id=ic['next'],ie=ic['callback'],ig=ic['errorHandler'],ih=ic['value'],ii=ic['context'];ic['value']=null,ic[mg(0x227)]=hM,ic['errorHandler']=null,ig&&ig(Error('abort'),ih),ie[mg(0x121)](ii,Error('abort')),ic['release'](ic),ic=id;}hY['drain']=hM;}function ib(ic){hX=ic;}}function hM(){}function hN(){this['value']=null,this['callback']=hM,this['next']=null,this['release']=hM,this['context']=null,this['errorHandler']=null;var hP=this;this['worked']=function(hQ,hS){var hT=hP['callback'],hU=hP['errorHandler'],hV=hP['value'];hP['value']=null,hP['callback']=hM,hP['errorHandler']&&hU(hQ,hV),hT['call'](hP['context'],hQ,hS),hP['release'](hP);};}function hO(hP,hQ,hS){typeof hP=='function'&&(hS=hQ,hQ=hP,hP=null);function hT(i0,i1){const mh=b;hQ[mh(0x121)](this,i0)['then'](function(i2){i1(null,i2);},i1);}var hU=hL(hP,hT,hS),hV=hU['push'],hW=hU['unshift'];return hU['push']=hX,hU['unshift']=hY,hU['drained']=hZ,hU;function hX(i0){var i1=new Promise(function(i2,i3){hV(i0,function(i4,i5){if(i4){i3(i4);return;}i2(i5);});});return i1['catch'](hM),i1;}function hY(i0){var i1=new Promise(function(i2,i3){hW(i0,function(i4,i5){if(i4){i3(i4);return;}i2(i5);});});return i1['catch'](hM),i1;}function hZ(){return new Promise(function(i0){process['nextTick'](function(){if(hU['idle']())i0();else{var i1=hU['drain'];hU['drain']=function(){typeof i1=='function'&&i1(),i0(),hU['drain']=i1;};}});});}}hJ['exports']=hL,hJ['exports']['promise']=hO;}),fq=ac(fp(),0x1);const fr=a0['default']??a0,ft=0x493e0,fu=(hI={})=>{const mi=iA;let hJ=hI['maxRetries']??0x5,hK=!0x1,hL=!0x1,hM=null,{proxy:hN}=hI,hO=hN?new ProxyAgent({'uri':hN,'allowH2':!0x0}):new Agent({'allowH2':!0x0}),hP=fr['create']({'fetch':hI['fetch'],'dispatcher':hO,'proxy':hN,'timeout':ft,'retry':{'limit':hJ,'methods':['get','head'],'statusCodes':[0x198,0x19d,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],'backoffLimit':0x7530},'throwHttpErrors':!0x0,'redirect':mi(0x19f),'headers':{'user-agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/127.0.0.0\x20Safari/537.36'}});return Object['assign'](hP,{'close':async()=>{const mj=mi;if(hM)return hM;hK||hL||(hK=!0x0,hM=hO[mj(0x1b9)](),await hM);},'destroy':async hQ=>{if(hM)return hM;hK||hL||(hK=!0x0,hL=!0x0,hM=hO['destroy'](hQ??null),await hM);}});},fv=hI=>new Promise(hJ=>setTimeout(hJ,hI)),fw=async(hI,hJ)=>{const mk=iA;let hK=await V[mk(0x1b2)](hJ)['catch'](()=>null);(!hK||!hK['isDirectory']())&&await V[mk(0x183)](hJ,{'recursive':!0x0});let hL=fx(hI,hJ),hM=await V['stat'](hL)['catch'](()=>null);return(!hM||!hM['isDirectory']())&&await V['mkdir'](hL,{'recursive':!0x0}),hL;},fx=(hI,hJ)=>{const ml=iA;let hK=R['resolve'](hI),hL=R[ml(0x22d)](hI)[ml(0x215)],hM=createHash(ml(0x13d))['update'](hK)['digest']('hex')['slice'](0x0,0xa);return R['join'](hJ,hL+'-'+hM);},fy=async hI=>{let hJ=R['dirname'](hI),hK=R['resolve'](hJ);R['parse'](hK)['root']!==hK&&(await V['stat'](hJ)['then'](()=>!0x0)['catch'](()=>!0x1)||await V['mkdir'](hJ,{'recursive':!0x0}));},fz=async(...hI)=>{let hJ=[];for(let hK of hI)hK&&hJ['push'](V['rm'](hK,{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));await Promise['all'](hJ);},fA=hI=>hI+'.part.json',fB=hI=>{const mm=iA;if(hI['filePath'])return hI[mm(0x12b)];if(hI['output'])return fA(hI['output']);throw Error('Either\x20output\x20or\x20filePath\x20is\x20required\x20for\x20FileResumeStore');},fC=hI=>{const mn=iA;if(!hI||typeof hI!=mn(0x165))return!0x1;let hJ='code'in hI?hI['code']:void 0x0;return hJ==='EPERM'||hJ==='EACCES'||hJ==='EBUSY';},fD=async(hI,hJ)=>{let hK=W['platform']==='win32'?[0x0,0x32,0x96,0x12c,0x1f4]:[0x0],hL;for(let hM of hK){hM>0x0&&await fv(hM);try{await V['rename'](hI,hJ);return;}catch(hN){if(hL=hN,!fC(hN))break;await V['rm'](hJ,{'force':!0x0})['catch'](()=>void 0x0);try{await V['rename'](hI,hJ);return;}catch(hO){if(hL=hO,!fC(hO))break;}}}throw hL;};var fE=class{async['get'](hI){let hJ=fB(hI);if(!await V['stat'](hJ)['then'](()=>!0x0)['catch'](()=>!0x1))return null;try{let hK=await V['readFile'](hJ,'utf8');return JSON['parse'](hK);}catch{return null;}}async['set'](hI,hJ){const mo=iA;let hK=fB(hI);await fy(hK);let hL=hK+'.'+W['pid']+'.'+Date['now']()['toString'](0x24)+'.tmp';await V[mo(0x143)](hL,JSON['stringify'](hJ));try{await fD(hL,hK);}finally{try{await V['rm'](hL,{'force':!0x0});}catch{}}}async['delete'](hI){let hJ=fB(hI);await V['rm'](hJ,{'force':!0x0})['catch'](()=>void 0x0);}};const fF=hI=>R[iA(0x11c)](hI),fG=hI=>createHash('sha1')['update'](fF(hI))['digest']('hex'),fH=hI=>hI['map']((hJ,hK)=>({'index':hK,'start':hJ['start'],'end':hJ['end'],'output':hJ['output'],'completed':!0x1,'bytesWritten':0x0})),fI=(hI,hJ)=>hI['parts']['length']===hJ['length']?hI['parts']['every']((hK,hL)=>{let hM=hJ[hL];return hM?hK['start']===hM['start']&&hK['end']===hM['end']&&(hK['output']??null)===(hM['output']??null):!0x1;}):!0x1,fJ=(hI,hJ)=>!hJ||!hI['sourceSignature']?!0x0:hI['sourceSignature']===hJ,fK=hI=>{let hJ=hI['parts']['reduce']((hK,hL)=>hK+hL['bytesWritten'],0x0);return hJ>0x0?hJ:hI['bytesDownloaded'];},fL=hI=>{const mp=iA;if(!hI||typeof hI!='object')return!0x1;let hJ=hI;return hJ['version']===0x2&&typeof hJ[mp(0x14c)]=='string'&&Array['isArray'](hJ['parts'])&&typeof hJ['bytesDownloaded']=='number';};var fM=class{['key'];['output'];['filePath'];['cleanupOnSuccess'];['store'];['target'];[iA(0x1ac)];constructor(hI={}){const mq=iA;if(this['output']=hI['output'],this['filePath']=hI['filePath'],this['key']=hI['key']??(this['output']?fG(this['output']):''),!this['key'])throw Error('Resume\x20key\x20is\x20required\x20when\x20output\x20is\x20not\x20provided');this['store']=hI['store']??new fE(),this['cleanupOnSuccess']=hI['cleanupOnSuccess']??!0x0,this[mq(0x87)]={'key':this['key'],'output':this['output'],'filePath':this['filePath']},this['trustExplicitKey']=typeof hI['key']=='string'&&hI['key']['length']>0x0;}async['read'](){let hI=await this['store']['get'](this['target']);return fL(hI)?hI:null;}async[iA(0x23c)](hI){const mr=iA;let hJ=new Date()['toISOString'](),hK={...hI,'version':0x2,'key':this['key'],'output':hI[mr(0xbb)]??this['output'],'bytesDownloaded':fK(hI),'createdAt':hI['createdAt']||hJ,'updatedAt':hJ};await this['store']['set'](this['target'],hK);}async['delete'](){await this['store']['delete'](this['target']);}['createState'](hI){const ms=iA;let hJ=new Date()['toISOString']();return{'version':0x2,'key':this[ms(0x14c)],'output':this['output'],'input':hI['input'],'bytesTotal':hI['bytesTotal'],'bytesDownloaded':0x0,'parts':fH(hI['parts']),'sourceSignature':hI['sourceSignature'],'planner':hI['planner'],'createdAt':hJ,'updatedAt':hJ};}['reconcileState'](hI,hJ){const mt=iA;let hK=hI['version']!==0x2,hL=hI['key']!==this['key'],hM=!this[mt(0x1ac)]&&!fJ(hI,hJ['sourceSignature']),hN=!fI(hI,hJ['parts']);if(hK||hL||hM||hN)return{'state':this[mt(0x1de)](hJ),'reset':!0x0};let hO={...hI,'key':this['key'],'output':this['output'],'input':hJ['input'],'bytesTotal':hJ['bytesTotal'],'sourceSignature':hJ['sourceSignature'],'planner':hJ['planner'],'parts':hJ['parts'][mt(0x181)]((hP,hQ)=>{let hS=hI['parts'][hQ];return{'index':hQ,'start':hP['start'],'end':hP['end'],'output':hP['output'],'completed':hS?.['completed']??!0x1,'bytesWritten':hS?.['bytesWritten']??0x0};}),'createdAt':hI['createdAt'],'updatedAt':hI['updatedAt']};return hO['bytesDownloaded']=fK(hO),{'state':hO,'reset':!0x1};}['markPartCompleted'](hI,hJ,hK){let hL=hI['parts'][hJ];if(!hL)return hI;let hM=hL['bytesWritten'];return hL['completed']=!0x0,hL['bytesWritten']=hK,hI['bytesDownloaded']=Math['max'](0x0,hI['bytesDownloaded']-hM+hK),hI['updatedAt']=new Date()['toISOString'](),hI;}async['getProgress'](){const mu=iA;let hI=await this['read']();if(!hI)return null;let hJ=hI['bytesDownloaded'];if(hI['bytesTotal']){let hM=hI['bytesTotal'];return{'bytesDownloaded':hJ,'totalBytes':hM,'percentComplete':hM>0x0?Math[mu(0x116)](hJ/hM*0x64):0x0};}let hK=hI['parts']['length'],hL=hI['parts']['filter'](hN=>hN[mu(0x1fa)])['length'];return{'bytesDownloaded':hJ,'totalBytes':null,'percentComplete':hK>0x0?Math['round'](hL/hK*0x64):0x0,'segmentsCompleted':hL,'segmentsTotal':hK};}};const fN=0x8*0x2**0x14,fO=(hI,hJ,hK)=>{let hL='part_'+hK+'.part';return R['join'](hJ,hL);},fP=(hI,hJ,hK)=>{let hL=Math['ceil'](hI/Math['max'](0x1,hJ));return Math['max'](0x1,Math['min'](hL,Math['max'](0x1,hK)));},fQ=(hI,hJ,hK)=>{let hL=fP(hI,hJ,hK),hM=[],hN=0x0;for(;hN<hI;){let hO=Math['min'](hI-0x1,hN+hL-0x1);hM['push']([hN,hO]),hN=hO+0x1;}return hM;},fR=hI=>{let [hJ,hK]=hI;return'bytes='+hJ+'-'+(hK||'');},fS=hI=>fQ(hI['contentLength'],hI['maxWorkerCount'],hI['maxChunkSize']??fN)['map'](hJ=>{const mv=iA;let [hK,hL]=hJ,hM=new Headers(hI['requestInit']?.[mv(0x9f)]);return hM['set']('Range',fR([hK,hL])),{'url':hI['url'],'headers':hM,'start':hK,'end':hL};}),fT=new WeakMap(),fU=hI=>{let hJ=hI?Error('The\x20operation\x20was\x20aborted',{'cause':hI}):Error('The\x20operation\x20was\x20aborted');return hJ['name']='AbortError',hJ;},fV=hI=>{const mw=iA;if(!(hI instanceof Error))return!0x1;if(hI['name']==='AbortError'||hI[mw(0xf9)]==='ABORT_ERR')return!0x0;let hJ=hI['cause'];return hJ instanceof Error&&hJ['name']==='AbortError';},fW=async hI=>await hI['client']['get'](hI['url'],{'redirect':'follow',...hI['requestInit']}),fX=(hI,hJ,hK)=>async hL=>{const mx=iA;if(hK?.['aborted'])throw fU();let hM=typeof hJ=='number'?{'flags':'r+','start':hJ}:{'flags':'w'},hN=P['createWriteStream'](hI,hM),hO=Readable['fromWeb'](hL['body']),hP=0x0,hQ=new Transform({'transform'(hS,hT,hU){hP+=hS['byteLength'],hU(null,hS);}});try{await pipeline(hO,hQ,hN,{'signal':hK});}catch(hS){throw fV(hS)?fU(hS):hS;}if(hK?.['aborted'])throw fU();return fT[mx(0x8a)](hL,hP),hL;},fY=(hI,hJ,hK)=>hL=>{if(hK?.['aborted'])throw fU();let hM=parseInt(hL['headers']['get']('content-length')||'0',0xa),hN=Number['isFinite'](hM)&&hM>0x0?hM:fT['get'](hL)??0x0;if(hI['increase'](hN),hK?.['aborted'])throw fU();return hJ&&!hK?.['aborted']?hJ(hI['toProgressInfo']()):hI['log'](),hL;},fZ=hI=>typeof hI=='boolean'?{'enabled':hI,'cleanupOnSuccess':!0x0}:hI?{'enabled':hI['enabled']??!0x0,'key':hI['key'],'store':hI['store'],'filePath':hI['filePath'],'cleanupOnSuccess':hI['cleanupOnSuccess']??!0x0}:{'enabled':!0x1,'cleanupOnSuccess':!0x0},g0=hI=>({'tempDir':hI['tempDir']??process['cwd'](),'maxRetries':hI[iA(0x150)]??0x5,'maxChunkSize':hI['maxChunkSize']??fN,'maxWorkerCount':hI['maxWorkerCount']??0x4,'resume':fZ(hI['resume']),'proxy':hI['proxy'],'requestInit':hI['requestInit'],'fetchFn':hI['fetchFn']}),g1={'total':{'b':0x0,'mb':0x0},'current':{'b':0x0,'mb':0x0},'chunkSize':0x0,'chunkSizes':[],'averageSize':{'b':0x0,'mb':0x0},'averageTotal':{'b':0x0,'mb':0x0},'speed':{'bps':0x0,'mbps':0x0},'completedParts':0x0},g2=hI=>{let hJ=Math['floor'](hI/0xe10),hK=Math['floor'](hI%0xe10/0x3c),hL=hI%0x3c,hM=hJ>0x0?hJ+'h':'',hN=hK>0x0?hK+'m':'',hO=hL>0x0?hL+'s':'';return hJ>0x0?hM+'\x20'+(hN||'0m')+'\x20'+(hO&&''+hO):!hJ&&hK>0x0?hN+'\x20'+(hO&&''+hO):hO;},g3=(hI=0x0)=>{let hJ=structuredClone(g1),hK=0x0,hL=setInterval(()=>{hK>0x1&&(hJ['speed']['bps']=hJ['current']['b']/hK),hK+=0.5;},0x1f4);return{'state':hJ,'setTotal':hM=>{const my=b;hJ['total']['b']=hM,hJ[my(0x225)]['mb']=hM/0x400/0x400;},'setCurrent'(hM,hN=0x0){hJ['current']['b']=hM,hJ['current']['mb']=hM/0x400/0x400,hJ['completedParts']=hN,hN>0x0&&(hJ['averageSize']['b']=hM/hN,hJ['averageSize']['mb']=hJ['averageSize']['b']/0x400/0x400,hJ['averageTotal']['b']=hI*hJ['averageSize']['b'],hJ['averageTotal']['mb']=hJ['averageTotal']['b']/0x400/0x400);},'increase'(hM){const mz=b;hJ['current']['b']+=hM,hJ['current']['mb']=hJ['current']['b']/0x400/0x400,hJ['speed']['mbps']=hJ['speed']['bps']/0x400/0x400,hJ['chunkSize']=hM,hJ['chunkSizes']['push'](hM),hJ['completedParts']+=0x1,hJ['averageSize']['b']=hJ[mz(0x1a2)]['b']/hJ['completedParts'],hJ['averageSize']['mb']=hJ['averageSize']['b']/0x400/0x400,hJ['averageTotal']['b']=hI*hJ['averageSize']['b'],hJ['averageTotal']['mb']=hJ['averageTotal']['b']/0x400/0x400;},'stop'(){const mA=b;clearInterval(hL),Object[mA(0x19e)](hJ,g1);},'log'(){let hM=hJ['current']['b'],hN=hJ['total']['b'],hO=hM+(hN?'/'+hN:'');stdout['write']('\x0dDownloading\x20['+hO+']');},'stopLog'(){stdout['write']('\x0a');},'toString'(){const mB=b;let hM='';hJ['speed']['bps']&&(hM+=hJ[mB(0xac)][mB(0xee)]['toFixed'](0x1)+'\x20MB/s\x20–\x20'),hM+=''+hJ['current']['mb']['toFixed'](0x1),hJ[mB(0x225)]['b']?hM+='\x20of\x20'+hJ['total']['mb']['toFixed'](0x1)+'\x20MB':hM+='\x20MB';let hN=hJ['total']['b']||hJ['averageTotal']['b'];if(hN){let hO=hN-hJ['speed']['bps']*hK,hP=Math[mB(0x116)](hO/hJ['speed']['bps']),hQ=g2(hP);hP&&isFinite(hP)&&hQ&&(hM+=',\x20'+hQ+'\x20left');}return hM;},'toProgressInfo'(){const mC=b;let hM=hJ['total']['b']||null,hN=hM?null:hJ[mC(0xc1)]['b']||null,hO=hM??hN,hP=hO?Math['max'](hO-hJ['current']['b'],0x0):null,hQ=hO?Math['min'](Math['max'](hJ['current']['b']/hO*0x64,0x0),0x64):null;return{'bytesDownloaded':hJ['current']['b'],'totalBytes':hM,'estimatedTotalBytes':hN,'percentComplete':hQ,'bytesPerSecond':hJ['speed'][mC(0x104)],'estimatedSecondsRemaining':hJ['speed']['bps']>0x0&&hP!==null?hP/hJ['speed']['bps']:null};}};},g4=new Set(['authorization','cookie','set-cookie','x-amz-date','x-amz-security-token','x-amz-content-sha256','x-goog-date','x-goog-security-token']),g5=(hI,hJ={})=>{if(!hI)return[];let hK=hJ['includeVolatile']??!0x1,hL=[];return new Headers(hI)['forEach']((hM,hN)=>{const mD=b;!hK&&g4['has'](hN[mD(0x91)]())||hL['push']([hN,hM]);}),hL['sort'](([hM],[hN])=>hM['localeCompare'](hN)),hL;},g6=hI=>{const mE=iA;try{let hJ=new URL(hI),hK=hJ['pathname']['split']('/')['map'](hL=>hL&&(hL['includes']('=')||hL['includes'](',')?mE(0xd8):hL))[mE(0x19c)]('/');return''+hJ['origin']+hK;}catch{let hL=String(hI);return(hL['split']('#')[0x0]??hL)['split']('?')[0x0]||hL;}},g7=hI=>({'url':g6(hI['url']),'start':hI[iA(0x23a)],'end':hI['end'],'output':hI['output'],'headers':g5(hI['headers'])}),g8=hI=>{const mF=iA;let hJ={'input':Array['isArray'](hI['input'])?hI['input']['map'](hK=>g7(hK)):g6(String(hI['resolvedUrl'])),'requestHeaders':g5(hI['requestHeaders']),'parts':hI[mF(0x83)]['map'](hK=>g7(hK)),'maxWorkerCount':hI['maxWorkerCount'],'maxChunkSize':hI['maxChunkSize']};return createHash(mF(0x13d))['update'](JSON['stringify'](hJ))['digest']('hex');},g9=async hI=>{const mG=iA;if(!hI[mG(0x15c)])return null;let hJ={'input':Array['isArray'](hI['input'])?hI['input']:hI[mG(0x103)],'parts':hI['parts'],'bytesTotal':hI['bytesTotal'],'sourceSignature':hI['sourceSignature'],'planner':{'maxWorkerCount':hI['maxWorkerCount'],'maxChunkSize':hI['maxChunkSize']}},hK=await hI['manager']['read'](),hL=(hK?hI['manager']['reconcileState'](hK,hJ):null)?.['state']??hI['manager']['createState'](hJ);return await hI['manager']['write'](hL),hL;},ga=hI=>{if(hI&&!hI['parts']['every'](hJ=>hJ['completed']))throw Error('Not\x20all\x20segments\x20were\x20downloaded\x20successfully.\x20Try\x20resuming\x20later.');},gb=hI=>{if(Array['isArray'](hI['input']))return hI['input']['map']((hJ,hK)=>({...hJ,'output':fO(hI['url'],hI['tempFileDir'],hK)}));if(!hI['acceptsRanges'])throw Error('Unable\x20to\x20get\x20parts');if(!hI['size'])throw Error('Size\x20is\x20not\x20known');return fS({'url':hI['url'],'requestInit':hI['requestInit'],'contentLength':hI['size'],'maxWorkerCount':hI['maxWorkerCount'],'maxChunkSize':hI['maxChunkSize']});},gc=async hI=>{const mH=iA;if(!hI['parts']['some'](hK=>typeof hK['start']=='number'&&(hK['output']??hI['output'])===hI['output'])||await V['stat'](hI['output'])[mH(0x1a8)](()=>!0x0)['catch'](()=>!0x1))return;let hJ=await V['open'](hI['output'],'w');hI[mH(0x1f1)]&&hI['size']>0x0&&await hJ[mH(0x155)](hI['size']),await hJ['close']();},gd=()=>{const mI=iA;let hI=Error(mI(0x1cb));return hI['name']='AbortError',hI;},ge=hI=>{let hJ=hI['match'](/bytes\s+(\d+)-(\d+)\/(\d+|\*)/i);if(!hJ||!hJ[0x1]||!hJ[0x2]||!hJ[0x3])return null;let hK=parseInt(hJ[0x1],0xa),hL=parseInt(hJ[0x2],0xa),hM=hJ[0x3];if(!Number['isFinite'](hK)||!Number['isFinite'](hL)||hL<hK)return null;if(hM==='*')return{'start':hK,'end':hL,'total':null};let hN=parseInt(hM,0xa);return!Number['isFinite'](hN)||hN<=0x0?null:{'start':hK,'end':hL,'total':hN};},gf=(hI,hJ)=>{if(typeof hJ['start']!='number'||typeof hJ['end']!='number')return;if(hI['status']!==0xce)throw Error('Range\x20request\x20failed\x20for\x20bytes='+hJ['start']+'-'+hJ['end']+':\x20expected\x20206,\x20got\x20'+hI['status']);let hK=hI['headers']['get']('content-range');if(!hK)throw Error('Range\x20request\x20failed\x20for\x20bytes='+hJ['start']+'-'+hJ['end']+':\x20missing\x20Content-Range\x20header');let hL=ge(hK);if(!hL)throw Error('Range\x20request\x20failed\x20for\x20bytes='+hJ['start']+'-'+hJ['end']+':\x20invalid\x20Content-Range\x20\x22'+hK+'\x22');if(hL['start']!==hJ['start']||hL['end']!==hJ['end'])throw Error('Range\x20request\x20failed\x20for\x20bytes='+hJ['start']+'-'+hJ['end']+':\x20got\x20bytes='+hL['start']+'-'+hL['end']);},gg=async(hI,hJ,hK)=>{const mJ=iA;let hL=hI[mJ(0x9f)]['get']('content-length');if(hL){let hN=parseInt(hL,0xa);if(Number['isFinite'](hN)&&hN>0x0)return hN;}let hM=hI['headers'][mJ(0xed)]('content-range');if(hM){let hO=hM['match'](/bytes\s+(\d+)-(\d+)\//i);if(hO&&hO[0x1]&&hO[0x2]){let hP=parseInt(hO[0x1],0xa),hQ=parseInt(hO[0x2],0xa);if(Number['isFinite'](hP)&&Number['isFinite'](hQ)&&hQ>=hP)return hQ-hP+0x1;}}return typeof hJ['start']=='number'&&typeof hJ['end']=='number'?Math['max'](0x0,hJ['end']-hJ['start']+0x1):hJ['output']&&hJ['output']!==hK?V['stat'](hJ['output'])['then'](hS=>hS['size'])['catch'](()=>0x0):0x0;},gh=(hI,hJ)=>hI['map']((hK,hL)=>hL)['filter'](hK=>!(hJ?.['parts'][hK]?.['completed']??!0x1)),gi=hI=>{let hJ=Promise['resolve']();return{'enqueue':()=>(hJ=hJ['then'](hI),hJ),'onIdle':()=>hJ};},gj=async hI=>{const mK=iA;let hJ=hI['signal']??hI['requestInit']?.['signal']??void 0x0,hK=()=>{if(hJ?.['aborted'])throw gd();};hK();let hL=gh(hI['parts'],hI['resumeState']),hM=fq[mK(0x13c)](async hV=>{const mL=mK;let {index:hW,part:hX}=hV;hK();let hY=await fW({'index':hW,'client':hI['client'],'url':hX['url'],'requestInit':{...hI['requestInit'],'signal':hJ,'headers':hX['headers']??hI[mL(0x18b)]?.['headers']}});if(hK(),gf(hY,hX),await fX(hX['output']??hI['output'],hX['start'],hJ)(hY),fY(hI['progress'],hI['onProgress'],hJ)(hY),hK(),hI['resumeState']&&hI['resumeManager']){let hZ=await gg(hY,hX,hI[mL(0xbb)]);hI['resumeManager']['markPartCompleted'](hI[mL(0x113)],hW,hZ),await hQ['enqueue']();}},hI['maxWorkerCount']),hN=()=>{const mM=mK;hM[mM(0x97)](),hM[mM(0x1c6)](),hM['kill']();};if(hJ?.['aborted'])throw hN(),gd();let hO=()=>{},hP=hJ?new Promise((hV,hW)=>{let hX=()=>{hN(),hW(gd());};hJ['addEventListener']('abort',hX,{'once':!0x0}),hO=()=>hJ['removeEventListener']('abort',hX);}):null,hQ=gi(async()=>{const mN=mK;!hI[mN(0x113)]||!hI['resumeManager']||await hI['resumeManager']['write'](hI['resumeState']);}),hS=hL[mK(0x181)](hV=>{let hW=hI['parts'][hV];return hW?(hK(),hM['push']({'index':hV,'part':hW})):Promise['resolve']();}),hT=[];try{let hV=Promise['allSettled'](hS);hP&&(await Promise['race']([hV,hP]),hK()),hT=await hV;}finally{hO(),await hQ['onIdle']();}let hU=hT[mK(0x1f3)](hW=>hW['status']==='rejected');if(hU?.['status']==='rejected')throw hU['reason'];},gk=async(hI,hJ)=>{await new Promise((hK,hL)=>{let hM=P['createReadStream'](hI),hN=()=>{hJ['off']('error',hO),hM['off']('error',hP),hM['off']('end',hQ);},hO=hS=>{hN(),hL(Error('Output\x20write\x20stream\x20error',{'cause':hS}));},hP=hS=>{hN(),hL(Error('Segment\x20read\x20stream\x20error',{'cause':hS}));},hQ=()=>{hN(),hK();};hJ['on']('error',hO),hM['on']('error',hP),hM['on']('end',hQ),hM['pipe'](hJ,{'end':!0x1});});},gl=async hI=>{const mO=iA;let hJ=hI['parts']['map'](hL=>hL['output'])['filter'](hL=>!!hL&&hL!==hI['output']);if(!hJ['length'])return;let hK=P['createWriteStream'](hI[mO(0xbb)]);for(let hL of hJ)await gk(hL,hK);hK['end'](),await finished(hK);},gm=async hI=>{const mP=iA;if(!hI['expectedSize'])return;let hJ=await V['stat'](hI['output'])['then'](hK=>hK['size'])[mP(0x1a9)](()=>null);if(hJ&&hJ!==hI['expectedSize'])throw Error('Actual\x20size\x20'+hJ+'\x20doesn\x27t\x20match\x20expected\x20size\x20'+hI['expectedSize']);},gn=async hI=>{hI['resumeManager']&&hI['resumeManager']['cleanupOnSuccess']&&await hI['resumeManager']['delete'](),await fz(hI['tempFileDir']);},go=async hI=>{const mQ=iA;let hJ=g8({'input':hI['input'],'resolvedUrl':hI['url'],'parts':hI['parts'],'requestHeaders':hI['requestInit']?.['headers'],'maxWorkerCount':hI['maxWorkerCount'],'maxChunkSize':hI['maxChunkSize']}),hK=await g9({'manager':hI['resumeManager'],'input':hI['input'],'resolvedUrl':hI['url'],'parts':hI['parts'],'bytesTotal':hI[mQ(0x1f1)]??void 0x0,'sourceSignature':hJ,'maxWorkerCount':hI['maxWorkerCount'],'maxChunkSize':hI['maxChunkSize']}),hL=g3(hI['parts'][mQ(0xb4)]);if(hI['size']&&hL['setTotal'](hI['size']),hK?.['bytesDownloaded']){let hM=hK['parts']['filter'](hN=>hN['completed'])['length'];hL['setCurrent'](hK['bytesDownloaded'],hM);}await gc({'output':hI['output'],'size':hI['size'],'parts':hI['parts']});try{await gj({'parts':hI['parts'],'output':hI['output'],'maxWorkerCount':hI['maxWorkerCount'],'client':hI['client'],'requestInit':hI['requestInit'],'progress':hL,'onProgress':hI['onProgress'],'resumeState':hK,'resumeManager':hI['resumeManager'],'signal':hI['signal']});}finally{hL['stop'](),hI['onProgress']||hL[mQ(0x1d6)]();}ga(hK),await gl({'output':hI[mQ(0xbb)],'parts':hI['parts']}),await gm({'output':hI[mQ(0xbb)],'expectedSize':Array['isArray'](hI['input'])?null:hI['size']}),await gn({'tempFileDir':hI['tempFileDir'],'resumeManager':hI['resumeManager']});},gp=async hI=>{const mR=iA;let hJ=new Headers(hI['requestInit']?.['headers']);hJ['set']('Range','bytes=0-0');let hK=Array['isArray'](hI['input'])?hI['input'][0x0]?.['url']:hI['input'];if(!hK)throw Error('Input\x20is\x20empty');let hL=await hI['client']['head'](hK,{...hI[mR(0x18b)],'headers':hJ}),hM=hL['headers']['get']('content-type'),hN=hL['headers'][mR(0xed)]('content-length'),hO=hL['headers']['get']('content-range'),hP=hO?.['split']('/')?.[0x1]||hN,hQ=hP&&!Array['isArray'](hI['input'])?parseInt(hP,0xa):null,hS=hL['headers']['get']('accept-ranges')==='bytes'||!!hO?.['includes']('bytes')||!!hM?.[mR(0x12d)]('video')||!!hM?.['includes']('audio')||!!hM?.['includes']('octet-stream');return{'url':hL['url'],'size':hQ,'acceptsRanges':hS};};var gq=class ix{['input'];['output'];['resume'];['onProgress'];['config'];['client'];['resumeManager'];['executed']=!0x1;[iA(0x1f6)];['tempFileDir'];constructor(hI){const mS=iA;this['input']=hI['input'],this['output']=hI['output'],this['resume']=hI['resume'],this['onProgress']=hI['onProgress'],this['config']=g0(hI),this['client']=fu({'maxRetries':this['config']['maxRetries'],'proxy':this['config']['proxy'],'fetch':this['config']['fetchFn']}),this['config']['resume'][mS(0x1fd)]&&(this['resumeManager']=new fM({'output':this['output'],'key':this['config']['resume'][mS(0x14c)],'filePath':this['config'][mS(0x119)]['filePath'],'store':this['config']['resume']['store'],'cleanupOnSuccess':this['config']['resume']['cleanupOnSuccess']}));}static async['init'](hI){let hJ=new ix(hI);return await hJ['_init'](),hJ;}async['_init'](){const mT=iA;this['probe']=await gp({'client':this['client'],'input':this['input'],'requestInit':this['config'][mT(0x18b)]}),await fy(this['output']),this['tempFileDir']=await fw(this['output'],this['config']['tempDir']),this['config']['resume']['enabled']||(await fz(this['output'],fA(this['output']),this[mT(0xfa)]),this['tempFileDir']=await fw(this['output'],this['config']['tempDir']));}async['execute'](){const mU=iA;if(!this['probe']||!this['tempFileDir'])throw Error('Download\x20was\x20not\x20initialized.\x20Use\x20Download.init(options).');if(this['executed'])throw Error('Download.execute()\x20can\x20only\x20be\x20called\x20once\x20per\x20instance.');this['executed']=!0x0;try{let hI=gb({'input':this['input'],'url':this['probe']['url'],'size':this[mU(0x1f6)]['size'],'acceptsRanges':this[mU(0x1f6)]['acceptsRanges'],'requestInit':this['config']['requestInit'],'tempFileDir':this['tempFileDir'],'maxWorkerCount':this['config']['maxWorkerCount'],'maxChunkSize':this['config']['maxChunkSize']});await go({'input':this['input'],'output':this['output'],'url':this['probe']['url'],'size':this['probe']['size'],'requestInit':this[mU(0xa2)]['requestInit'],'maxWorkerCount':this['config']['maxWorkerCount'],'maxChunkSize':this['config']['maxChunkSize'],'onProgress':this['onProgress'],'client':this['client'],'parts':hI,'tempFileDir':this['tempFileDir'],'resumeManager':this['resumeManager'],'signal':this['config']['requestInit']?.['signal']??void 0x0});}finally{try{await this['close']();}catch{}}}async['getSize'](){const mV=iA;if(this[mV(0x1f6)]||=await gp({'client':this['client'],'input':this['input'],'requestInit':this['config']['requestInit']}),!this[mV(0x1f6)]['size'])throw Error('Size\x20is\x20not\x20known');return this['probe']['size'];}async['close'](){await this['client']['close']();}};const gr=async({attempts:hI,fn:hJ,shouldRetry:hK,onRetry:hL})=>{const mW=iA;let hM=Math['max'](0x1,Math[mW(0x187)](hI)),hN;for(let hO=0x1;hO<=hM;hO+=0x1)try{return await hJ(hO);}catch(hP){if(hN=hP,hO>=hM||!hK?.(hP,hO))throw hP;await hL?.(hP,hO);}throw hN instanceof Error?hN:Error(String(hN));},gs=0x10,gt=hI=>{const mX=iA;let hJ=Math['max'](0x1,Math[mX(0x187)](hI)),hK=Math['min'](gs,hJ);return{'normalizedRequestedConnections':hJ,'maxWorkerCount':hK,'wasClamped':hJ!==hK};},gu=hI=>Math['max'](0x1,Math['trunc'](hI)+0x1),gv=({title:hI,progress:hJ,filepath:hK,target:hL,quality:hM,codec:hN,expectedTotalBytes:hO})=>{const mY=iA;let hP=hJ['totalBytes']??void 0x0,hQ=hJ[mY(0xb3)]??void 0x0,hS=hO??hP??hQ,hT=hJ['bytesPerSecond']??void 0x0,hU=hO===void 0x0?hJ['bytesDownloaded']:Math['min'](hJ['bytesDownloaded'],hO),hV={'b':hS,'mb':hS===void 0x0?void 0x0:hS/0x400/0x400,'estimated':hO===void 0x0&&hP===void 0x0&&hQ!==void 0x0},hW={'b':hU,'mb':hU/0x400/0x400},hX=hS?Math['min'](0x64,Math['round'](hU/hS*0x64)):void 0x0;return{'title':hI,'total':hV,'current':hW,'percentage':hX,'speed':{'bps':hT,'mbps':hT===void 0x0?void 0x0:hT/0x400/0x400},'trackName':basename(hK),'trackPath':hK,'finalName':hL[mY(0xd1)],'finalPath':hL['finalPath'],'state':hX===0x64?'downloaded':'downloading','quality':hM,'codec':hN};},gw=hI=>{const mZ=iA;let hJ=(hI['bytesDownloaded']/0x400/0x400)['toFixed'](0x2)+'\x20MB',hK=hI['totalBytes']??hI['estimatedTotalBytes'],hL=hI['totalBytes']?'':'~';return'Downloading\x20∙\x20'+hJ+(hK?'\x20of\x20'+hL+(hK/0x400/0x400)[mZ(0xf6)](0x2)+'\x20MB':'');},gx=(hI,hJ)=>{const n0=iA;if(hI||!Array['isArray'](hJ))return hI;let hK=hJ[0x0]?.['headers'];if(!hK)return;let hL={...hK};for(let hM of Object[n0(0x1ed)](hL))hM['toLowerCase']()==='range'&&delete hL[hM];return Object[n0(0x1ed)](hL)['length']?hL:void 0x0;},gy=async({input:hI,resume:hJ,filepath:hK,description:hL,target:hM,resource:hN,options:hO,settings:hP,abortSignal:hQ,title:hS,quality:hT,codec:hU,expectedTotalBytes:hV,emitProgress:hW,reporter:hX=fi})=>{const n1=iA;v['info'](hL),v['debug']('Path:\x20'+hK);let hY=gx(e0(hN['input']['source'])['headers'],hI),hZ=hO['connections']??hP['get']('connections')??0x1,{maxWorkerCount:i0,wasClamped:i1}=gt(hZ);i1&&v[n1(0x1af)]('Connections\x20value\x20'+hZ+'\x20was\x20clamped\x20to\x20'+i0+'\x20for\x20stability'),v['debug']('Max\x20worker\x20count:\x20'+i0);let i2=hX[n1(0x1c9)]('Downloading',{'color':'yellow'}),i3='',i4=gu(hO[n1(0x1d9)]??hP['get']('retry')??0x1);try{await gr({'attempts':i4,'fn':async()=>{const n2=n1;let i5=await gq['init']({'input':hI,'output':hK,'tempDir':q,'requestInit':{'headers':hY,'signal':hQ},'proxy':hO['proxyMedia']||hO['proxy']||void 0x0,'resume':hJ,'maxRetries':hO[n2(0x1d9)],'maxWorkerCount':i0,'onProgress':i6=>{let i7=gv({'title':hS,'progress':i6,'filepath':hK,'target':hM,'quality':hT,'codec':hU,'expectedTotalBytes':hV});hW(i7),hX['progress'](i7),i3=gw(i6),i2['update'](i3);}});if(hQ?.['aborted']){v['debug']('Track\x20download\x20skipped,\x20already\x20aborted:\x20'+hK);let i6=Error('The\x20operation\x20was\x20aborted');throw i6['name']='AbortError',i6;}await i5['execute']();},'shouldRetry':i5=>!(i5 instanceof Error&&i5['name']===n1(0x107)),'onRetry':async(i5,i6)=>{let i7=i5 instanceof Error?i5['message']:String(i5);v['warn']('Track\x20download\x20retry\x20'+i6+'/'+(i4-0x1)+'\x20scheduled\x20for\x20'+hK+':\x20'+i7);}}),i2['success'](i3);}catch(i5){if(i2['error'](hL),i5 instanceof Error&&i5['name']==='AbortError')throw i5;let i6=i5 instanceof Error?i5['message']:String(i5);throw v['error']('Download\x20track\x20failed:\x20'+i6),i5 instanceof Error&&i5['stack']?v['debug'](i5['stack']):v['debug'](i6),i5 instanceof Error?i5:Error(i6);}},gz={'eng':'en','rus':'ru'},gA=hI=>{if(!(!hI||typeof hI!='object'||!('drm'in hI)))return hI['drm']?.['widevine']?.['pssh'];},gB=(hI,hJ)=>{if(hJ)return{'Range':'bytes='+hI+'-'+(hI+hJ-0x1)};},gC=(hI,hJ)=>hI?hJ?{...hI,...hJ}:hI:hJ,gD=(hI,hJ)=>{const n3=iA;let hK=[],hL=hI[0x0];hL?.['initSegment']&&hK['push']({'url':hL['initSegment']['location']['path'],'headers':gC(hJ,gB(hL['initSegment']['location']['offset'],hL[n3(0x139)][n3(0x1b5)][n3(0xb4)]))});for(let hM of hI)hK['push']({'url':hM['location']['path'],'headers':gC(hJ,gB(hM[n3(0x1b5)]['offset'],hM['location']['length']))});return hK['length']===0x1&&!hK[0x0]?.['headers']?hK[0x0][n3(0x170)]:hK;},gE=hI=>{let hJ=0x0,hK=hI[0x0],hL=hK?.['initSegment']?.['location']['length'];if(hK?.['initSegment']){if(hL==null)return;hJ+=hL;}for(let hM of hI){let hN=hM['location']['length'];if(hN==null)return;hJ+=hN;}return hJ;},gF=async hI=>{const n4=iA;let hJ=hI['getSegmentedInput']?.();return hJ?.['segments']['length']?hJ['segments']:await hI[n4(0x1fc)]();},gG=hI=>{let hJ=hI[0x0];return hJ?.['location']['path']??hJ?.['initSegment']?.['location']['path'];},gH=async(hI,hJ)=>{if(hJ)return gG(hJ);let hK;try{hK=await hI['getSegments']();}catch(hL){if(hL instanceof Error&&hL['message']['toLowerCase']()['includes']('no\x20segments')){v['debug']('Track\x20segments\x20unavailable\x20for\x20URL\x20logging:\x20'+hL['message']);return;}throw hL;}return gG(hK);},gI=async hI=>{if(hI['type']==='subtitle'){let hJ=await hI['getCodec']();return hJ==='ttml'||hJ==='stpp'?'ttml':hJ==='webvtt'?'vtt':hJ??'srt';}if(hI['isAudioTrack']?.()){let hK=await hI['getCodec']();return hK==='aac'||hK==='alac'||hK==='ac3'||hK==='eac3'?'m4a':hK==='mp3'?'mp3':'mka';}return'mp4';},gJ=async({outputDirectory:hI,baseName:hJ,track:hK})=>join(hI,hJ+'.'+createHash(iA(0x1a1))['update'](dq(hK))['digest'](iA(0xdb))['slice'](0x0,0x6)+'.'+await gI(hK)),gK=hI=>{const n5=iA;let hJ=(hI?.['trim']()['toLowerCase']()['replaceAll']('_','-'))?.['split']('-')[0x0]||n5(0x231);return(gz[hJ]??hJ)['replaceAll'](/[^a-z0-9]+/g,'-')[n5(0xd0)](/^-|-$/g,'')||'und';},gL=async hI=>{const n6=iA;let hJ=new Map(),hK=new Map();for(let hL of hI['tracks']['all']){if(hL['type']!=='subtitle')continue;let [hM,hN]=await Promise['all']([hL['getLanguageCode']()['catch'](()=>void 0x0),gI(hL)]),hO=gK(hM),hP=(hK[n6(0xed)](hO)??0x0)+0x1;hK[n6(0x8a)](hO,hP);let hQ=hP===0x1?hO:hO+'-'+hP;hJ['set'](dq(hL),join(hI['output']['outputDirectory'],hI['output']['baseName']+'.'+hQ+'.'+hN));}return hJ;},gM=(hI,hJ)=>({'enabled':!0x0,'key':createHash('sha1')['update'](hI+':'+dq(hJ))['digest']('hex')}),gN=hI=>{let hJ=[];for(let hK of hI){let hL=hK[0x0],hM=gA(hL?.['initSegment']?.['encryption'])??gA(hL?.['encryption']);hM&&hJ['push'](hM);}return hJ['map'](hN=>{const n7=b;let hO=hN;return typeof hO=='string'?hO:hO instanceof Uint8Array||hO instanceof ArrayBuffer?Buffer['from'](hO)['toString'](n7(0x1e9)):ArrayBuffer['isView'](hO)?Buffer['from'](hO['buffer'],hO['byteOffset'],hO['byteLength'])['toString']('base64'):String(hO);});},gO=async(hI,hJ)=>{let [hK,hL,hM]=await Promise['all']([hI['getLanguageCode']()['catch'](()=>void 0x0),hI['getName']()['catch'](()=>void 0x0),hI['getDisposition']()['catch'](()=>void 0x0)]);return{'path':hJ,'type':hI['type'],'language':hK,'label':hL??void 0x0,'forced':hI['type']==='subtitle'?hM?.['forced']:void 0x0};},gP=async(hI,hJ)=>{const n8=iA;if(!hI['isVideoTrack']())return{'quality':void 0x0,'codec':void 0x0};let [hK,hL,hM]=await Promise['all']([hI['getCodec'](),hJ?hI['getDisplayWidth']():hI['getCodedWidth'](),hJ?hI[n8(0x198)]():hI['getCodedHeight']()]);return{'quality':hL?hL+'x'+hM:void 0x0,'codec':hK??void 0x0};},gQ=async({plan:hI,track:hJ,input:hK,resume:hL,isSegmented:hM,segments:hN,artifactPath:hO})=>{let hP=hO??await gJ({'outputDirectory':hI['output']['outputDirectory'],'baseName':hI['output']['baseName'],'track':hJ}),[hQ,hS,hT,hU]=await Promise['all']([fn(hJ,hI['output']['baseName']),gP(hJ,hM),gO(hJ,hP),hJ['type']==='subtitle'?gH(hJ,hN):Promise['resolve'](void 0x0)]),hV=hN?gE(hN):void 0x0;return{'kind':hJ['type'],'input':hK,'artifactPath':hP,'description':hQ,'target':{'finalName':hI['output']['fileName'],'finalPath':hI['output']['outputPath']},'resume':hL,'progressMetadata':{...hS,'expectedBytes':hV},'artifactMetadata':{'type':hT['type'],'language':hT['language'],'label':hT['label'],'forced':hT['forced']},'logUrl':hU};},gR=async hI=>{const n9=iA;let hJ=hI['options']['skipSubtitlesMux']?await gL(hI):new Map(),hK=hI['entry']['source']?.['headers'];if(hI['isSegmented'])return await Promise['all'](hI['tracks']['all']['map'](async hO=>{let hP=await gF(hO),hQ=e0(hO['source']);return{'task':await gQ({'plan':hI,'track':hO,'input':gD(hP,hQ['headers']??hK),'resume':gM(hQ['url'],hO),'isSegmented':!0x0,'segments':hP,'artifactPath':hJ['get'](dq(hO))}),'segments':hP};}));let hL=hI['tracks']['videos'][0x0],hM=e0(hL['source']),hN=hL?[{'track':hL,'input':hM['url'],'resume':!0x0,'isSegmented':!0x1}]:[];for(let hO of hI['tracks']['audios']){let hP=e0(hO['source']);hN['push']({'track':hO,'input':hP['url'],'resume':!0x0,'isSegmented':!0x1});}for(let hQ of hI['tracks']['subtitles']){let hS=await gF(hQ),hT=e0(hQ['source'])[n9(0x9f)]??hK;hN['push']({'track':hQ,'input':gD(hS,hT),'resume':!0x0,'isSegmented':!0x1,'segments':hS,'artifactPath':hJ['get'](dq(hQ))});}return(await Promise['all'](hN['map'](async hU=>await gQ({'plan':hI,...hU}))))['map'](hU=>({'task':hU,'segments':[]}));},gS=async hI=>{const na=iA;ds(hI['tracks']['all']);let hJ=await gR(hI);return{'tasks':hJ[na(0x181)](({task:hK})=>hK),'psshList':hI['isSegmented']?gN(hJ['map'](({segments:hK})=>hK)):[],'selectedTracks':hI['tracks']['all']};},gT=hI=>JSON['stringify'](hI['input']),gU=hI=>{let hJ=new Map();for(let hK of hI){let hL=gT(hK),hM=hJ['get'](hL);if(hM){hM['tasks']['push'](hK);continue;}hJ['set'](hL,{'representative':hK,'tasks':[hK]});}return[...hJ['values']()];},gV=(hI,hJ)=>{const nb=iA;let hK=hJ[nb(0xfb)]['expectedBytes'];return{'title':hI['downloadTitle'],'total':{'b':hK,'mb':hK===void 0x0?void 0x0:hK/0x400/0x400,'estimated':!0x1},'current':{'b':0x0,'mb':0x0},'percentage':hK===void 0x0?void 0x0:0x0,'speed':{},'trackName':hJ['artifactPath'],'trackPath':hJ['artifactPath'],'finalName':hJ[nb(0x87)]['finalName'],'finalPath':hJ['target']['finalPath'],'quality':hJ['progressMetadata']['quality'],'codec':hJ[nb(0xfb)]['codec'],'state':'downloading'};},gW=async({settings:hI,plan:hJ,task:hK,abortSignal:hL,callbacks:hM,reporter:hN})=>(await gy({'input':hK['input'],'resume':hK[iA(0x119)],'filepath':hK['artifactPath'],'description':hK['description'],'target':hK['target'],'resource':hJ['resource'],'options':hJ[iA(0xf4)],'settings':hI,'abortSignal':hL,'title':hJ['downloadTitle'],'quality':hK['progressMetadata']['quality'],'codec':hK['progressMetadata']['codec'],'expectedTotalBytes':hK['progressMetadata']['expectedBytes'],'reporter':hN,'emitProgress':hO=>{hM?.['onProgress']?.(hO);}}),await aX(hK['artifactPath'])?{'path':hK['artifactPath'],...hK[iA(0x94)]}:null),gX=async({settings:hI,plan:hJ,abortSignal:hK,callbacks:hL,reporter:hM=fi})=>{const nc=iA;v['debug']('Preparing\x20track\x20downloads');let hN=await gS(hJ),hO=gU(hN['tasks']);v['debug']('Downloading\x20tracks'),await hL?.['onTransferReady']?.();for(let hQ of hO)hL?.['onProgress']?.(gV(hJ,hQ['representative']));let hP=[];for(let hS of hO){let hT=hS['representative'];hT['kind']==='subtitle'&&v['debug']('URL:\x20'+(hT['logUrl']??'manifest\x20subtitle\x20track'));let hU=await gW({'settings':hI,'plan':hJ,'task':hT,'abortSignal':hK,'callbacks':hL,'reporter':hM});if(hU){for(let hV of hS[nc(0x1c2)])hP['push']({'path':hU['path'],...hV['artifactMetadata']});}}return{'downloaded':hP,'psshList':hN['psshList'],'selectedTracks':hN['selectedTracks']};},gY={'resolveDownloadJobOptions':dQ,'prepareDownloadResource':eG,'prepareDownloadPlan':eF,'executeTransfer':gX,'resolveContentKeys':dD,'processDownloadedMedia':fm},gZ=()=>em,h0=()=>{let hI=Error('The\x20operation\x20was\x20aborted');return hI['name']='AbortError',hI;},h1=async(hI,hJ)=>{for(let hK of hJ)await hI({'type':'artifact-recorded','artifact':{'path':hK['path'],'role':'partial'}});},h2=hI=>hI['total']['b']&&hI['total']['b']>0x0?Math['min'](0x1,hI[iA(0x1a2)]['b']/hI['total']['b']):+(hI['state']==='downloaded'||hI['state']==='finished'),h3=hI=>{const nd=iA;let hJ=[...hI],hK=0x0,hL=0x0,hM=!0x1,hN=!0x1;for(let hT of hJ){if(hK+=hT['current']['b'],hT['total']['b']===void 0x0){hM=!0x0;continue;}hL+=hT['total']['b'],hN||=hT['total']['estimated']===!0x0;}let hO=hM?void 0x0:hL,hP=hJ['reduce']((hU,hV)=>hU+h2(hV),0x0),hQ=hJ['length']?hP/hJ[nd(0xb4)]*0x64:0x0,hS=hO&&hO>0x0?hK/hO*0x64:0x0;return{'totalDownloaded':hK,'totalSize':hO,'isTotalSizeEstimated':hO!==void 0x0&&hN,'percent':Math['min'](0x64,hO===void 0x0?hQ:hS)};};var h4=class{['settings'];['extensionManager'];#e;#t;#n;#r;constructor(hI,hJ,hK={}){this['settings']=hI,this['extensionManager']=hJ,this.#e=hK['dependencies']??gY,this.#t=hK['trackSelectorFactory']??gZ,this.#n=hK['reporter']??fi,this.#r=hK['resolveBenefits']??dN();}async['run']({jobId:hI,request:hJ,filePath:hK,signal:hL,emit:hM}){const ne=iA;let hN=await this.#r(),{options:hO,limit:hP}=this.#e['resolveDownloadJobOptions']({'settings':this[ne(0x9a)],'requestedOptions':hJ['options'],'filePath':hK,'grantedBenefits':hN});hP['wasClamped']&&v[ne(0x1af)]('Connections\x20value\x20'+hP['normalizedRequestedConnections']+'\x20exceeds\x20tier\x20limit\x20('+hP['maxAllowedConnections']+').\x20Using\x20'+hP['connections']+'.');let hQ=await this.#e[ne(0x18f)]({'extensionManager':this['extensionManager'],'entry':hJ['entry'],'url':hJ[ne(0x170)],'options':hO,'signal':hL});try{await hM({'type':'entry-resolved','entry':hQ['resource']['entry']}),await hQ['beforeDownload']();let hS=await this.#e['prepareDownloadPlan']({'settings':this['settings'],'options':hO,'resource':hQ[ne(0xec)],'extensionTag':hQ['extensionTag'],'trackSelector':this.#t(hO)});await hM({'type':'output-resolved','title':hS['downloadTitle'],'filePath':hS['output']['outputPath']}),await hM({'type':'artifact-recorded','artifact':{'path':hS['output']['outputPath'],'role':'output'}});let {transferResult:hT,processedMedia:hU}=await this.#i({'preparedPlan':hS,'preparedResource':hQ,'jobId':hI,'options':hO,'signal':hL,'emit':hM});return{'entry':hQ['resource']['entry'],'transferResult':hT,'processedMedia':hU};}catch(hV){throw hV instanceof Error&&hV['name']==='AbortError'?(v['debug']('Download\x20was\x20aborted\x20(paused):\x20'+hI),hV):(v['error']('Download\x20workflow\x20failed:\x20'+(hV instanceof Error?hV['message']:hV)),dp(ne(0x18a),hV),hV);}finally{await hQ['dispose']();}}async #i({preparedPlan:hI,preparedResource:hJ,jobId:hK,options:hL,signal:hM,emit:hN}){const nf=iA;let hO={},hP=await this.#e['executeTransfer']({'settings':this['settings'],'plan':hI,'abortSignal':hM,'callbacks':{'onTransferReady':async()=>{await hN({'type':'transferring'});},'onProgress':async hT=>{await this.#a(hN,hO,hT);}},'reporter':this.#n});if(hM['aborted'])throw h0();if(!hP[nf(0x164)][nf(0xb4)])throw cN();await h1(hN,hP['downloaded']),await hN({'type':'processing'});let hQ=await this.#e['resolveContentKeys']({'jobId':hK,'title':hI['downloadTitle'],'entryTitle':hJ['resource']['entry']['title'],'options':hL,'psshList':hP['psshList']??[],'selectedTracks':hP['selectedTracks'],'extension':hJ['extension'],'resource':hJ['resource']}),hS=await this.#e['processDownloadedMedia']({'inputs':hP['downloaded'],'output':hI['output'][nf(0x136)],'keys':hQ,'trimBegin':hL['trimBegin'],'trimEnd':hL['trimEnd'],'binariesDir':this['settings']['get'](nf(0x89)),'skipMux':hL['skipMux'],'skipSubtitlesMux':hL['skipSubtitlesMux'],'reporter':this.#n});return await hJ['afterDownload'](hL[nf(0x1c1)]),{'transferResult':hP,'processedMedia':hS};}async #a(hI,hJ,hK){const ng=iA;hJ[hK['trackPath']]=hK;let {totalDownloaded:hL,totalSize:hM,isTotalSizeEstimated:hN,percent:hO}=h3(Object[ng(0xcf)](hJ));await hI({'type':'progress','progress':{'percent':hO,'downloadedBytes':hL,'totalBytes':hM,'totalBytesEstimated':hN,'filePath':hK['finalPath'],'quality':hK['quality'],'codec':hK['codec']},'artifacts':h5([hK['trackPath'],hK['finalPath']])});}};const h5=hI=>{let hJ=[];for(let hK of hI)hK&&hJ['push']({'path':hK,'role':'partial'});return hJ;},h6=hI=>{const nh=iA;if(!hI)return null;let [hJ,hK]=hI[nh(0x91)]()['split']('e');return[parseInt(hJ['trim']()['toLowerCase']()['replace']('s','')),parseFloat(hK?.['trim']())];},h7=hI=>{const ni=iA;let hJ=0x0,hK=0x270f,hL=[],hM=hI['split'](',');for(let hO of hM){let [hP,hQ]=hO['split']('-'),hS=h6(hP),hT=h6(hQ);if(hS&&!hQ){let [hU,hV]=hS;if(isNaN(hV)){for(let hW=0x0;hW<=hK;hW++)hL['push']([hU,hW]);}else hL['push']([hU,hV]);}else{if(hS&&hT){let [hX,hY]=hS,[hZ,i0]=hT;for(let i1=hX;i1<=hZ;i1++){let i2=hY||0x0,i3=i1===hZ?i0:hK;for(let i4=i2;i4<=i3;i4++)hL['push']([i1,i4]);}}}}let hN=new Map();for(let [i5,i6]of hL)hN['has'](i5)||hN['set'](i5,new Set()),hN[ni(0xed)](i5)?.['add'](i6);return hN;},h8=hI=>{if(!hI)return{};let hJ={},hK=typeof hI=='string'?hI['split']('|'):hI;for(let hL of hK){let [hM,...hN]=hL['split'](':'),hO=hN['join'](':');if(!hO)throw Error('Can\x27t\x20parse\x20header:\x20'+hL);hJ[hM['trim']()]=hO['trim']();}return hJ;},h9=async hI=>{const nj=iA;let hJ=!0x1,hK=hI;do try{hK?hJ=!!new URL(hK):hK=(await y[nj(0x106)]({'fields':{'url':{'label':'URL'}}}))['url'];}catch{hK=(await y['ask']({'fields':{'url':{'label':'URL'}}}))['url'];}while(!hJ);return hK!==hI&&v['debug']('URL:\x20'+hK),hK;},ha=async({message:hI,choices:hJ})=>hJ['length']?await checkbox({'message':hI,'pageSize':0xc,'choices':hJ,'loop':!0x1}):[],hb=async({catalog:hI})=>{const nk=iA;let hJ=await ha({'message':'Select\x20video\x20streams','choices':hI['videos']['map']((hO,hP)=>({'name':hO['label'],'value':hO['id'],'checked':hP===0x0}))}),hK=hI[nk(0xa4)][nk(0x1e3)](hO=>hJ['includes'](hO['id']))['map'](hO=>hO['track']),hL=await ha({'message':'Select\x20audio\x20streams','choices':hI['audios']['map']((hO,hP)=>({'name':hO['label'],'value':hO['id'],'checked':hP===0x0}))}),hM=hI['audios']['filter'](hO=>hL[nk(0x12d)](hO['id']))['map'](hO=>hO[nk(0x120)]),hN=await ha({'message':nk(0x185),'choices':hI['subtitles']['map']((hO,hP)=>({'name':hO['label'],'value':hO['id'],'checked':hP===0x0}))});return e1({'videos':hK,'audios':hM,'subtitles':hI['subtitles']['filter'](hO=>hN['includes'](hO['id']))['map'](hO=>hO['track'])});},hc=hI=>!!hI&&typeof hI=='object',hd=hI=>{const nl=iA;switch(hI){case'analyzing':case'pending':return nl(0x9b);case nl(0x1e1):return'queued';case'downloading':return'transferring';case'processing':return'processing';case'paused':return'paused';case'completed':return'completed';case'error':return'failed';}},he=hI=>hI['phase']==='analyzing'?'analyzing':hI['state']==='running'&&hI['phase']==='processing'?'processing':hI['state']===iA(0x179)?'transferring':hI[iA(0x235)]==='paused'?'paused':hI['state']==='completed'?'completed':hI['state']==='failed'?'failed':'queued',hf=hI=>{const nm=iA;let hJ=hI['resource'];return hI['entry']??{'id':hJ?.['metadata']?.['id'],'title':hJ?.['metadata']?.[nm(0x20c)],'seasonNumber':hJ?.['metadata']?.['seasonNumber'],'episodeNumber':hJ?.['metadata']?.['episodeNumber'],'episodeTitle':hJ?.['metadata']?.['episodeTitle'],'source':hJ?.['source']};},hg=hI=>({'id':hI['id'],'request':{'entry':hf(hI),'url':hI['url'],'options':hI['options']},'status':hd(hI['status']),'progress':{'percent':hI['progress']??0x0,'downloadedBytes':hI['downloadedBytes']??0x0,'totalBytes':hI['totalBytes'],'totalBytesEstimated':hI['totalBytesEstimated']},'output':{'title':hI['title'],'filePath':hI['filePath'],'quality':hI['quality'],'codec':hI['codec']},'artifacts':hI['filePath']?[{'path':hI['filePath'],'role':'output'}]:[],'failure':hI['error']?{'message':hI['error']}:void 0x0,'createdAt':hI['createdAt']});var hh=class{['filePath'];['records']=[];#e=Promise['resolve']();constructor(hI){this['filePath']=hI;}async['load'](){const nn=iA;await this.#e;try{let hI=await readFile(this['filePath'],{'encoding':nn(0x14d)}),hJ=JSON['parse'](hI),hK=Array['isArray'](hJ)?hJ:[];this['records']=hK['map'](hL=>this.#n(hL))['filter'](hL=>!!hL)['toSorted']((hL,hM)=>new Date(hM['createdAt']??0x0)['getTime']()-new Date(hL[nn(0x108)]??0x0)['getTime']());}catch{this['records']=[];}return this;}get[iA(0x1f1)](){const no=iA;return this[no(0xcd)][no(0xb4)];}async['addRecord'](hI){await this.#t(async()=>{const np=b;this['records'][np(0xc9)](hI),await this['save']();});}async['updateRecord'](hI){await this.#t(async()=>{let hJ=this['records']['findIndex'](hK=>hK['id']===hI['id']);hJ!==-0x1&&(this['records'][hJ]=hI,await this['save']());});}['getRecord'](hI){return this['records']['find'](hJ=>hJ['id']===hI);}['listRecords'](){return this['records'];}['has'](hI){return this['records']['some'](hJ=>hJ['id']===hI);}async['deleteRecord'](hI){await this.#t(async()=>{let hJ=this['records']['findIndex'](hK=>hK['id']===hI);hJ!==-0x1&&(this['records']['splice'](hJ,0x1),await this['save']());});}['deleteRecordSync'](hI){let hJ=this['records']['findIndex'](hK=>hK['id']===hI);hJ!==-0x1&&(this['records']['splice'](hJ,0x1),writeFileSync(this['filePath'],JSON['stringify'](this['records'],null,0x2)));}async[iA(0x19d)](){await this.#t(async()=>{this['records']=[],await this['save']();});}async['save'](){writeFileSync(this['filePath'],JSON['stringify'](this['records'],null,0x2));}#t(hI){let hJ=this.#e['then'](hI,hI);return this.#e=hJ['then'](()=>void 0x0,()=>void 0x0),hJ;}#n(hI){const nq=iA;if(hc(hI)){if('request'in hI&&'status'in hI&&'progress'in hI&&'output'in hI)return hI;if('request'in hI&&nq(0x235)in hI&&'progress'in hI&&'output'in hI){let hJ=hI;return{'id':hJ['id'],'request':hJ['request'],'status':he(hJ),'progress':hJ['progress'],'output':hJ['output'],'artifacts':hJ['artifacts'],'failure':hJ['failure'],'createdAt':hJ['createdAt']};}if('status'in hI&&'id'in hI)return hg(hI);}}};const hi=hI=>{process['exit'](hI);},hj=hI=>hI['select']?hb:em,hk=0x7d0,hl=async(hI,hJ,hK)=>{let hL,hM=new Promise((hN,hO)=>{hL=setTimeout(()=>hO(Error(hK)),hJ);});try{return await Promise['race']([hI,hM]);}finally{hL&&clearTimeout(hL);}},hm={'command':['download\x20[urls..]','$0\x20[urls..]'],'aliases':['dl'],'describe':'Download\x20media\x20content\x20by\x20URL','builder':hI=>hI['option']('quality',{'alias':'q','describe':'Video\x20resolution\x20quality\x20-\x202160p/1080p/720p/...,\x20defaults\x20to\x20highest\x20available','type':'string'})['option']('video-codec',{'alias':'v','describe':'Video\x20codec\x20-\x20avc\x20|\x20hevc\x20|\x20vp8\x20|\x20vp9\x20|\x20av1\x20|\x20vc1,\x20defaults\x20to\x20any','type':iA(0x132)})['option']('video-range',{'alias':'r','describe':iA(0x152),'type':'string'})['option']('video-bitrate',{'describe':'Video\x20bitrate\x20(in\x20kbps),\x20defaults\x20to\x20highest\x20available','type':'number'})['option']('video-dimension',{'describe':'Video\x20dimension\x20-\x202D/3D\x20(HSBS/HOU/FSBS/OU),\x20defaults\x20to\x202D','default':'2D','type':'string'})['option']('audio-codec',{'alias':'a','describe':'Audio\x20codec\x20-\x20aac\x20|\x20opus\x20|\x20mp3\x20|\x20vorbis\x20|\x20flac\x20|\x20alac\x20|\x20ac3\x20|\x20eac3\x20|\x20dts,\x20defaults\x20to\x20any','type':'string'})['option'](iA(0x193),{'alias':'c','describe':'Audio\x20channels,\x20matches\x20sub-channel\x20layouts\x20like\x205.1\x20with\x206.0','type':'number'})['option']('audio-bitrate',{'describe':'Audio\x20bitrate\x20(in\x20kbps),\x20defaults\x20to\x20highest\x20available','type':'number'})['option']('subs-format',{'alias':'s','describe':'Subtitle\x20format\x20-\x20SRT/SSA/ASS/TTML/VTT/STPP/WVTT','type':'string'})['option']('subs-lang',{'alias':'S','describe':'Subtitles\x20language(s)','type':'string'})['option']('lang',{'alias':'l','describe':'Video/audio\x20language(s)','type':'string'})['option']('skip-video',{'describe':'do\x20not\x20download\x20video','type':'boolean'})['option']('skip-audio',{'describe':'do\x20not\x20download\x20audio','type':'boolean'})['option']('skip-subtitles',{'describe':'do\x20not\x20download\x20subtitles','type':'boolean'})[iA(0x232)]('skip-mux',{'describe':'Disable\x20merge\x20audio/video/subs\x20into\x20single\x20file','type':'boolean'})['option']('skip-subtitles-mux',{'describe':'Download\x20subtitles\x20as\x20external\x20files\x20while\x20still\x20muxing\x20audio/video','type':'boolean'})['option']('select',{'describe':'Select\x20audio/video/subtitle\x20streams\x20from\x20manifest\x20manually','type':iA(0x222)})['option']('episodes',{'alias':'e','describe':'Seasons/episodes\x20to\x20download,\x20e.g.\x20`S01E01`,\x20`S01-S05,S07`,\x20`S01E01-S02E03`,\x20`S02-S02E03`,\x20etc.','type':'string','coerce':hJ=>h7(hJ)})['option']('retry',{'alias':'R','describe':'Number\x20of\x20retries\x20in\x20case\x20of\x20unsuccessful\x20request','type':'number','default':aV['retry']})['option']('connections',{'alias':'C','describe':'Number\x20of\x20parallel\x20http\x20connections\x20per\x20download','type':'number','default':aV['connections']})['option']('proxy',{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20all\x20requests','type':iA(0x132)})['option']('proxy-meta',{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20metadata\x20fetching','type':'string'})['option']('proxy-media',{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20media\x20downloading','type':'string'})['option']('movie-template',{'describe':'Movie\x20filename\x20template','type':'string','default':aV['movieFilenameTemplate']})['option'](iA(0x18d),{'describe':'Episode\x20filename\x20template','type':'string','default':aV['seriesFilenameTemplate']})['option']('hardsub',{'describe':'Download\x20hardsubbed\x20video\x20if\x20available','type':'boolean'})['option']('trim-begin',{'describe':'Trim\x20video\x20at\x20the\x20beginning;\x20example:\x2000:00:06','type':'string'})['option']('trim-end',{'describe':'Trim\x20video\x20at\x20the\x20end;\x20example:\x2000:01:30','type':'string'})['option'](iA(0x14c),{'describe':'Set\x20content\x20decryption\x20key\x20(if\x20manifest\x20URL\x20as\x20main\x20URL\x20passed),\x20format:\x20KID:KEY','type':iA(0x1b6),'string':!0x0,'coerce':hJ=>hJ['map'](hK=>{let [hL,hM]=hK['split'](':');return{'kid':hL,'key':hM};})})['option'](iA(0x196),{'alias':'H','describe':'Pass\x20custom\x20header(s)\x20for\x20manifest\x20request','type':'array','string':!0x0,'coerce':hJ=>h8(hJ)})['option']('format',{'alias':'f','describe':'Video\x20container\x20format\x20-\x20mp4\x20|\x20mkv\x20(Pro\x20only)','type':iA(0x132),'choices':['mp4','mkv']}),'handler':async hI=>{const nr=iA;let hJ=hI;hJ['videoQuality']=hI['quality'];let hK=new aW(f);if(hJ['format']){let {error:hW}=await dL({'videoContainerFormat':hJ['format']});hW&&(v['error']('Invalid\x20format:\x20'+hW['message']),v['info']('Learn\x20more:\x20https://azot.mov/pricing'),process['exit'](0x1));}let hL=new cF({'dirs':[o],'indexPath':N});await hL['init'](),await hL['loadCoreExtensions'](),await hL['discover']();let hM=new hh(join(G,'downloads.json'));v[nr(0xff)]('Downloads\x20storage\x20path:\x20'+hM['filePath']),await hM['load']();let hN=new dd({'settings':hK,'store':hM,'workflow':new h4(hK,hL,{'trackSelectorFactory':hj,'reporter':fj()}),'analyzer':dj(hL)}),hO=new Set(),hP=cJ(),hQ=!0x1,hS=()=>{const ns=nr;if(!hQ){hQ=!0x0;for(let hX of hO){let hY=hN['getRecord'](hX);if(!(!hY||hY['status']==='completed')){v['debug']('Synchronously\x20cleaning\x20up\x20interrupted\x20CLI\x20download:\x20'+hX),hM['deleteRecordSync'](hX);for(let hZ of cH(hY))rmSync(hZ,{'recursive':!0x0,'force':!0x0});hM[ns(0x1ab)](hX)?v['error']('Interrupted\x20CLI\x20download\x20is\x20still\x20persisted\x20after\x20sync\x20cleanup:\x20'+hX):v['debug']('Synchronously\x20removed\x20interrupted\x20CLI\x20download\x20state:\x20'+hX);}}}},hT=async()=>{if(!hQ){hQ=!0x0;for(let hX of hO){let hY=hN['getRecord'](hX);if(!(!hY||hY['status']==='completed')){v['debug']('Cleaning\x20up\x20interrupted\x20CLI\x20download:\x20'+hX);try{await hl(hN['removeWithFile'](hX),hk,'Timed\x20out\x20while\x20removing\x20interrupted\x20CLI\x20download:\x20'+hX),v['debug']('Removed\x20interrupted\x20CLI\x20download\x20via\x20engine:\x20'+hX);}catch(hZ){let i0=hZ instanceof Error?hZ['message']:String(hZ);v['debug']('Engine\x20cleanup\x20failed\x20for\x20interrupted\x20CLI\x20download\x20'+hX+':\x20'+i0),await hM['deleteRecord'](hX),await hP['purgeRecordArtifacts'](hY),v['debug']('Removed\x20interrupted\x20CLI\x20download\x20directly\x20from\x20storage:\x20'+hX);}hM['getRecord'](hX)&&v['error']('Interrupted\x20CLI\x20download\x20is\x20still\x20persisted\x20after\x20cleanup:\x20'+hX);}}}},hU=ax(hT),hV=hX=>{let hY=hX==='SIGINT'?0x82:0x8f;hS(),hU(),hi(hY);};process['once']('SIGINT',hV),process['once']('SIGTERM',hV),cs()['then'](hX=>Object['assign'](cq,hX)),hN['subscribe'](hX=>{const nt=nr;if(hX['type']==='job-added'){hO['add'](hX['record']['id']);return;}if(hX['type']==='job-completed'){v['debug']('Job\x20completed:\x20'+hX['record']['id']);return;}if(hX['type']==='job-error'){v['debug']('Job\x20failed:\x20'+hX[nt(0xc4)]['failure']?.['message']);return;}hX['type']==='error'&&v['error']('Download\x20engine\x20error:\x20'+hX['error']['message']);});try{let hX=Array['isArray'](hI['urls'])?hI['urls']:[],hY=process.env.ELECTRON_RUN_AS_NODE==='1'?hX['filter'](i1=>i1!==process['argv'][0x1]):hX,hZ=hY['length']>0x0?hY:[''],i0=[];for(let i1 of hZ){let i2=await h9(i1),i3=await hN[nr(0x1ff)](i2,hJ);for(let i4 of i3)i0['push'](hN['add']({'url':i2,'options':hJ,'entry':i4}));}await Promise['all'](i0),await hN['drain']();}catch(i5){throw await hT(),i5;}finally{hU(),process['off']('SIGINT',hV),process['off']('SIGTERM',hV);}}},hn=iA(0xa9),ho=async()=>{const nu=iA;if(await cs()&&!await confirm({'message':'You\x27re\x20already\x20logged\x20in.\x20Do\x20you\x20want\x20to\x20log\x20in\x20again?','default':!0x1})){v['debug'](nu(0x123));return;}let hI=createSpinner('Requesting\x20device\x20authorization...');hI[nu(0x23a)]();try{let hJ=cg(),{data:hK,error:hL}=await hJ['device']['code']({'client_id':hn,'scope':'openid\x20profile\x20email'});if(hI['stop'](),hL||!hK)v['error']('Failed\x20to\x20request\x20device\x20authorization:\x20'+(hL?.['error_description']||hL?.['statusText']||'Unknown\x20error')),v['debug'](hL);else{let {device_code:hM,user_code:hN,verification_uri:hO,verification_uri_complete:hP,interval:hQ=0x5,expires_in:hS}=hK;console['log'](''),console['log'](T['cyan']('📱\x20Device\x20Authorization\x20Required')),console['log'](''),console['log']('Please\x20visit:\x20'+T['underline'](T['blue'](hO))),console['log']('Enter\x20code:\x20'+T['bold'](T['green'](hN))),console['log'](''),await confirm({'message':'Open\x20browser\x20automatically?','default':!0x0})&&await a3(hP||hO),console['log'](T['gray']('Waiting\x20for\x20authorization\x20(expires\x20in\x20'+Math['floor'](hS/0x3c)+'\x20minutes)...'));let hT=await hp(hJ,hM,hn,hQ);if(hT){await cr(hT);let {data:hU}=await hJ['getSession']({'fetchOptions':{'headers':{'Authorization':'Bearer\x20'+hT[nu(0x157)]}}});console['log'](T['green']('✅\x20Login\x20successful!\x20Logged\x20in\x20as\x20'+(hU?.[nu(0x118)]?.['name']||hU?.['user']?.['email']||'User')));}}}catch(hV){hI['stop'](),v['error']('Login\x20failed:\x20'+(hV instanceof Error?hV['message']:'Unknown\x20error'));}};async function hp(hI,hJ,hK,hL){let hM=hL,hN=createSpinner('',{'color':'cyan'}),hO=0x0;return new Promise(hP=>{let hQ=async()=>{const nv=b;hO=(hO+0x1)%0x4,hN['update'](T['gray']('Polling\x20for\x20authorization'+'.'['repeat'](hO)+'\x20'['repeat'](0x3-hO))),hN['isSpinning']()||hN['start']();try{let {data:hS,error:hT}=await hI['device']['token']({'grant_type':'urn:ietf:params:oauth:grant-type:device_code','device_code':hJ,'client_id':hK,'fetchOptions':{'headers':{'user-agent':'Azot\x20Desktop'}}});if(hS?.['access_token']){hN['stop'](),hP(hS);return;}else{if(hT)switch(hT['error']){case'authorization_pending':break;case nv(0x101):hM+=0x5,hN['update'](T['yellow']('Slowing\x20down\x20polling\x20to\x20'+hM+'s'));break;case'access_denied':hN['stop'](),v['error']('Access\x20was\x20denied\x20by\x20the\x20user');break;case'expired_token':hN['stop'](),v['error'](nv(0x13b));break;default:hN['stop'](),v['error']('Error:\x20'+hT['error_description']);}}}catch(hU){hN['stop'](),v['error']('Network\x20error:\x20'+(hU instanceof Error?hU['message']:'Unknown\x20error'));return;}setTimeout(hQ,hM*0x3e8);};setTimeout(hQ,hM*0x3e8);});}const hq=async()=>{const nw=iA;v['info']('Logging\x20out...');let hI=await cg()['signOut']();hI[nw(0x171)]?v['error']('Logout\x20failed:\x20'+hI['error']['message']):(v['info']('Logout\x20successful'),await cr({}));},hr={'command':'login\x20[extension]','describe':'Login\x20to\x20extension\x20(or\x20if\x20no\x20extension\x20is\x20specified,\x20login\x20to\x20Azot\x20account)','builder':hI=>hI['option']('username',{'alias':'u','describe':'Username','type':'string'})['option']('password',{'alias':'p','describe':iA(0x102),'type':iA(0x132)})[iA(0x232)]('otp',{'alias':'o','describe':'One-time\x20password','type':'string'}),'handler':async hI=>{const nx=iA;let hJ=hI['extension'],hK={'username':hI['username'],'password':hI['password'],'otp':hI[nx(0xa0)]};if(hJ){let hL=new cF({'dirs':[o],'indexPath':N});await hL['init'](),await hL['discover'](),await hL[nx(0x10e)](hJ,hK);}else ho();}},hs={'command':'list','aliases':['ls'],'describe':'Lists\x20information\x20about\x20installed/active\x20extensions','handler':async()=>{const ny=iA;let hI=await new cF({'indexPath':N})[ny(0xca)]();if(!hI['infoList']['length'])return console['log']('No\x20added\x20extensions\x20found');for(let hJ of hI['infoList']){let hK=''+T['bold'](T['blue'](hJ['name']['padEnd'](0xf))),hL=T[ny(0x219)](hJ['package']?.['version']);console['log'](hK+hL);}console['log']('\x0a'+T['dim']('Location:\x20'+s));}},ht=new Intl['RelativeTimeFormat']('en',{'style':'long'}),hu=hI=>{const nz=iA;let hJ=Math['floor'](hI/0x18),hK=Math['abs'](hJ);return hK>0x16d?ht['format'](Math['floor'](hJ/0x16d),'year'):hK>0x1e?ht['format'](Math['floor'](hJ/0x1e),'month'):hK>0x7?ht['format'](Math['floor'](hJ/0x7),'week'):hK>0x1?ht[nz(0x1df)](Math['floor'](hJ),'day'):ht['format'](Math['floor'](hI),'hour');},hv=(hI,hJ,hK)=>{const nA=iA;let hL=''+T['bold'](T['blue'](hI['padEnd'](0xf))),hM=T['green'](hJ[nA(0x1f0)](0xa)),hN=T['dim'](hK);console[nA(0x204)](hL+hM+hN);},hw={'command':iA(0x95),'aliases':['ls-remote'],'describe':'List\x20all\x20available\x20extensions','handler':async()=>{cs()['then'](hK=>Object['assign'](cq,hK));let hI=await cF['getAvailableExtensions'](),hJ=Date['now']();for(let hK of hI){let hL=hK['releases']['toSorted']((hP,hQ)=>new Date(hQ['createdAt'])['getTime']()-new Date(hP['createdAt'])['getTime']())['at'](0x0);if(!hL)continue;let hM=hL['createdAt'],hN=new Date(hM)['getTime']()-hJ,hO=hu(Math['floor'](hN/0x36ee80));hv(hK['name'],hL['version'],hO);}}},hx={'command':'logout\x20[extensions..]','describe':iA(0x16a),'handler':async hI=>{let hJ=hI['extensions'];if(hJ?.['length']){let hK=new cF({'dirs':[o],'indexPath':N});await hK['init'](),await hK['discover'](),await hK['logout'](hJ);}else hq();}},hy={'command':'settings\x20[key]\x20[value]','describe':'CLI\x20access\x20to\x20get/set\x20configuration\x20settings','handler':async hI=>{const nB=iA;let hJ=new aW(f),hK=hI['key'],hL=hI[nB(0xd7)];if(hK&&hL){hJ['set']({[hK]:hL}),console['log']('Setting\x20'+T['bold'](T[nB(0x175)](hK))+'\x20set\x20to\x20'+T['green'](hL));return;}else{if(hK){let hN=hJ['get'](hK);console['log'](hN?'Setting\x20'+T['bold'](T['blue'](hK))+'\x20is\x20'+T['green'](hN):'Setting\x20'+T['bold'](T['blue'](hK))+'\x20is\x20not\x20found');return;}}let hM=hJ['getAll']();for(let [hO,hP]of Object[nB(0xad)](hM)){let hQ=(''+hO)['padEnd'](0x19),hS=String(hP)['replaceAll']('{','{{')['replaceAll']('}','}}');console['log'](T['bold'](T['blue'](hQ))+'\x20'+hS);}console[nB(0x204)]('\x0a'+T['dim']('Location:\x20'+f));}},hz={'command':'uninstall\x20<extensions..>','aliases':['rm'],'describe':'Uninstall\x20an\x20extension','handler':async hI=>{const nC=iA;let hJ=hI[nC(0x16b)],hK=new cF({'dirs':[o],'indexPath':N});await hK['init'](),await hK['uninstall'](hJ);}},hA={'command':'install\x20<extensions..>','aliases':['i'],'describe':'Install\x20extension','handler':async hI=>{let hJ=hI['extensions'],hK=new cF({'dirs':[o],'indexPath':N});await hK['init'](),await hK['install'](hJ);}},hB={'command':'logs','describe':'Show\x20logs\x20list','handler':async()=>{let hI=w,hJ=await readdir(hI)['then'](hL=>hL['filter'](hM=>hM['endsWith']('.log'))),hK=hL=>join(hI,hL);hJ['length']||v['info']('No\x20logs\x20found');for(let hL of hJ)v['info'](hK(hL));}};v['debug'](l);const hC=au(process['argv']);v['debug'](B+'\x20'+hC['join']('\x20'));const hD=new Set(['build','dev']);C['on']('error',hI=>{let hJ=K(hI);v['error'](hJ['message']);});const hE=T['magenta'](T['bold'](c))+'\x20is\x20'+j['description']['toLocaleLowerCase'](),hF=T['bold']('Usage:\x20$0\x20<command>\x20'+T['cyan']('[...options]')),hG=async(hI,hJ)=>{const nD=iA;let hK=hJ instanceof Error?hJ:Error(String(hJ));v['fatal'](hI+':\x20'+hK['message']),hK[nD(0xe8)]&&v['debug'](hK[nD(0xe8)]),await ay();try{rmSync(q,{'recursive':!0x0,'force':!0x0});}catch(hL){v['error']('Failed\x20to\x20remove\x20temp\x20directory\x20'+q+':',hL);}process['exit'](0x1);};process['on'](iA(0x1a0),hI=>{hG('Unexpected\x20error',hI);}),process['on']('unhandledRejection',hI=>{hG('Unhandled\x20promise\x20rejection',hI);}),!h&&hD[iA(0x176)](hC[0x0]??'')&&hG('CLI\x20error',Error('The\x20`build`\x20and\x20`dev`\x20commands\x20are\x20unavailable\x20in\x20the\x20desktop-distributed\x20CLI.\x20Use\x20the\x20npm-installed\x20`azot`\x20package\x20in\x20a\x20Node.js\x20environment\x20instead.'));const hH=S(hC)['scriptName'](B)['usage'](hE+'\x0a\x0a'+hF)['command'](hm)['command'](hs)[iA(0x197)](hw)['command'](hA)['command'](hz)['command'](hr)['command'](hx)['command'](hy)['command'](hB)['option']('debug',{'describe':'Debug\x20mode','type':'boolean'})['wrap'](S()['terminalWidth']())['help']()[iA(0x8f)]('h','help')['showHelpOnFail'](!0x1)['version'](i)['updateStrings']({'Commands:':T['bold']('Commands:'),'Options:':T['bold']('Options:'),'default':T['dim']('default'),'aliases':T['dim']('aliases'),'boolean':T['dim']('boolean'),'string':T[iA(0x1d1)]('string'),'number':T['dim']('number')})['epilogue']('Learn\x20more\x20about\x20Azot:\x20'+T['magenta']('https://azot.mov')+'.');h&&hH[iA(0x197)](aO)['command'](aP),at()['then'](()=>hH['parseAsync']())['then'](async hI=>{await u(w);let hJ=String(hI['_'][0x0]??'');hJ==='dev'||hJ==='build'&&hI['watch']===!0x0||process['exit'](0x0);})['catch'](hI=>{const nE=iA;hG(nE(0x112),hI);});export{};
2
+ const jn=b;(function(ic,id){const jm=b,ie=ic();while(!![]){try{const ig=-parseInt(jm(0x1a4))/0x1*(-parseInt(jm(0x214))/0x2)+parseInt(jm(0x2a3))/0x3*(-parseInt(jm(0x265))/0x4)+-parseInt(jm(0x217))/0x5*(-parseInt(jm(0x255))/0x6)+-parseInt(jm(0x2a6))/0x7+parseInt(jm(0x3a7))/0x8*(-parseInt(jm(0x20e))/0x9)+parseInt(jm(0x325))/0xa+parseInt(jm(0x186))/0xb;if(ig===id)break;else ie['push'](ie['shift']());}catch(ih){ie['push'](ie['shift']());}}}(a,0xacf2b));import{A as c,C as d,D as f,E as g,F as h,I as i,L as j,M as k,N as l,O as m,P as n,S as o,T as p,_ as q,a as r,b as s,c as t,d as u,f as v,g as w,h as x,i as y,j as A,k as B,l as C,m as D,n as E,o as F,p as G,r as H,s as I,t as J,u as K,v as L,w as M,x as N,y as O}from'./context-B87wqMxL.mjs';import{createRequire}from'node:module';import P,{constants,existsSync,readFileSync,readdirSync,rmSync,statSync,writeFileSync}from'node:fs';import*as Q from'node:path';import R,{basename,dirname,extname,isAbsolute,join,parse,relative,resolve}from'node:path';import S from'yargs';import'urlpattern-polyfill';import T from'picocolors';import*as U from'node:fs/promises';import V,{open,readFile,readdir,rm,stat}from'node:fs/promises';import W,{platform,stdout}from'node:process';import{hideBin}from'yargs/helpers';import{EventEmitter as X}from'node:events';import{z}from'zod';import{ALL_FORMATS,DASH,HLS,Input,UrlSource,desc,prefer}from'dasha';import{ALL_FORMATS as Y,EncodedAudioPacketSource,EncodedPacketSink,EncodedVideoPacketSource,Input as Z,MkvOutputFormat,Mp3OutputFormat,Mp4OutputFormat,Output,StreamSource,StreamTarget,TextSubtitleSource}from'mediabunny';import a0 from'ky';import{Agent,ProxyAgent}from'undici';import{checkbox,confirm}from'@inquirer/prompts';import{execFileSync}from'node:child_process';import{createAuthClient}from'better-auth/client';import{deviceAuthorizationClient}from'better-auth/client/plugins';import{tributeClient}from'@tribute-tg/better-auth';import{QueryCache,QueryClient}from'@tanstack/query-core';import a1,{createHash}from'node:crypto';import{inspect}from'node:util';import{Remote}from'okova';import{Decryption,FilePathSource,FilePathTarget,Input as a2,Output as a3}from'shifro';import{convert}from'@transcrobes/subs-convert';function b(c,d){c=c-0x185;const e=a();let f=e[c];return f;}import{isatty}from'node:tty';import{createSpinner}from'nanospinner';import{finished,pipeline}from'node:stream/promises';import{Readable,Transform}from'node:stream';import a4 from'open';var a5=Object['create'],a6=Object['defineProperty'],a7=Object['getOwnPropertyDescriptor'],a8=Object['getOwnPropertyNames'],a9=Object['getPrototypeOf'],aa=Object['prototype']['hasOwnProperty'],ab=(ic,id)=>()=>(id||(ic((id={'exports':{}})[jn(0x24d)],id),ic=null),id['exports']),ac=(ic,id,ie,ig)=>{if(id&&typeof id=='object'||typeof id=='function'){for(var ih=a8(id),ii=0x0,ij=ih['length'],ik;ii<ij;ii++)ik=ih[ii],!aa['call'](ic,ik)&&ik!==ie&&a6(ic,ik,{'get':(il=>id[il])['bind'](null,ik),'enumerable':!(ig=a7(id,ik))||ig['enumerable']});}return ic;},ad=(ic,id,ie)=>(ie=ic==null?{}:a5(a9(ic)),ac(id||!ic||!ic[jn(0x3cb)]?a6(ie,'default',{'value':ic,'enumerable':!0x0}):ie,ic)),ae=createRequire(import.meta.url);function a(){const qi=['pairableWithVideo','number','utf8','description','magenta','release','drained','failure','encode','process','\x20|\x20','.zip','created_at','message','Weibo','trim','allow_audio_only','fromCache','Incompatible\x20extension\x20interface','nanospinner/dist/consts.js','videoContainerFormat','The\x20operation\x20was\x20aborted','failed','Invalid\x20extensions\x20index\x20path\x20repaired:\x20','round','stringify','retry','afterDownload','Twitter\x20post\x20is\x20age-restricted\x20and\x20requires\x20login','onTransferReady','video/mp4','connections','📱\x20Device\x20Authorization\x20Required','sources','x-goog-date','document','end','msg','searchParams','.tumblr.com','CLI\x20error','get','bilibili_','bitrate','pathname','bin','player','underline','data','join','start','follow','https://*.loom.com/*','https://fb.watch/*','expectedBytes','tiktok','SHA-256','https://azot.mov/','object','3xeGpJT','trail','XMLHttpRequest','6553785wiSAjF','https://*.tv.naver.com/*','key','expectedSize','output-resolved','isFinite','indexOf','sourceSignature','qualityValue','loom.ts','then','0.0.1','paused','randomUUID','legacy-content','Path:\x20','token_type','sep','private','set','import','Invalid\x20extension\x20URL:\x20','Could\x20not\x20find\x20playable\x20Kakao\x20TV\x20output','Could\x20not\x20fetch','PARALLEL_DOWNLOADS_NOT_ALLOWED','dataUpdatedAt','x-amz-security-token','0.0.6','quality','analyzing','username','read','assign','site','errorUpdatedAt','tumblr.com','writeFile','playready','node','https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread','headers','stack','body','author','https://www.tiktok.com/','cookieStore','resolve','en-US,en;q=0.9','jrsCWX1XDuVxAFO4GkK147syAoN8BJZ5voz8tS80bPcj26Vc5Z','getDisposition','shortcode','https://*.weibo.com/*','cause','story','dailymotion_oauth_token','length','poster','warn','UrlSource','user','/s/:id{/}?','binariesDir','localStorage','matchAll','entry','Audio\x20codec\x20-\x20aac\x20|\x20opus\x20|\x20mp3\x20|\x20vorbis\x20|\x20flac\x20|\x20alac\x20|\x20ac3\x20|\x20eac3\x20|\x20dts,\x20defaults\x20to\x20any','option',':\x20got\x20bytes=','getExtensionForUrl','files','/releases','device_id','uninstall\x20<extensions..>','media_info','fetchContentDrm','strategy','replaceAll','text','vitalygashkov@vk.com','statusText','origin','extension','https://api-v2.soundcloud.com/resolve?url=','password','hostname','Input','context','proxyMeta','backup_url','Invalid\x20WebVTT\x20timestamp:\x20','now','duration','base64','Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/127.0.0.0\x20Safari/537.36','audioChannels','Setting\x20','uri','Bilibili\x20entry\x20is\x20missing\x20source\x20URL','values','kind','resource','https://*.reddit.com/*','extname','CUSTOM_MUX_FORMAT_NOT_ALLOWED','audioUrl','The\x20device\x20code\x20has\x20expired.\x20Please\x20try\x20again.','esm','dailymotion.ts','ask','function','https://www.facebook.com/','value','tumblr_','onIdle','MediaBunny\x20output\x20handle\x20was\x20not\x20initialized\x20for\x20','max','\x20directory\x20not\x20found:\x20','fetchContentMetadata','sleep','\x22\x20/>','notify','endsWith','bold','NsfwLoggedOut','v1:','eac3','removeEventListener','912200bvJhXk','Could\x20not\x20resolve\x20Tumblr\x20video\x20or\x20audio\x20URL','Extension\x20','TweetTombstone','HLS','Cookie','.log','ALL_FORMATS','defineExtension','role','include','qgr0yWwXCrsxA1jnRtRX','device','zvezda','audio','format','\x20updated','https://gitlab.com/api/v4/projects/','bytesDownloaded',':null','https://ntv.ru/*','HLS_FORMATS','toUpperCase','logNo','getTracks','social-networks','<meta[^>]+property=[\x22\x27]','https://pin.it/*','queued','und','720','dim','fetchQuery','width','skip-subtitles','bind','.js','Select\x20subtitles','javascript-obfuscator','maxWorkerCount','noteId','https://m.blog.naver.com/PostView.naver','downloads.json','create','cwd','name','expired_at','token','snapMediaType','drain','getAudioTracks','https://www.bilibili.tv/','execUrlPatterns','https://*.bilibili.com/*','processedMedia','exactPaths','on.soundcloud.com','twitch_clip_','detail','meta','params','isDirectory','tracks','https://www.dailymotion.com/','Legacy\x20extension\x20did\x20not\x20provide\x20a\x20media\x20source','is_active_live','getTime','artifactMetadata','encryption','Clearing\x20cookies\x20store...','navigator','episodeNumber','regions','stop','Entry\x20file\x20must\x20be\x20inside\x20the\x20current\x20working\x20directory:\x20','completed','Bearer\x20','startsWith','indexPath','getSession','masterUrl','default','requestInit','TimelineAddEntries','progressMetadata','com.widevine.alpha','EXTENSION_INSTALL_ASSET_NOT_FOUND','source','episodeTitle','size','stderr','delete','record','cleanupOnSuccess','boolean','.mkv','https://vkvideo.ru/','license\x20request\x20event','once','debug','?extra=','from','\x20invalid\x20entries','fallback_url','path','sourceType','/album/:album/video/:id(\x5cd+){/}?','command','records','find','Request\x20timed\x20out\x20after\x20','speed','Output\x20format','mka','lowConnectionsCount','trustExplicitKey','Vitaly\x20Gashkov','ECDSA','completedParts','string_value','__UNIVERSAL_DATA_FOR_REHYDRATION__','&#39;','/about/','mp3','/video/:id{/}?','total','expired_token','movie','server','score','594736OfXFhN','state','smotrim.ts',':\x20expected\x20206,\x20got\x20','fieldToggles','customScreenshotOrig','twitter.ts','})();','package','Forbidden','sign','loadInfo','console','bytesWritten','options','outputDirectory','green','emit','URL:\x20','filePath','spki','manifest','replace','output','getName','VK\x20request\x20failed:\x20','access_token','live','trunc','parts','\x22name\x22:\x22','createWriteStream','Relevance','toSorted','Tumblr','acceptsRanges','__esModule','https://smotrim.ru/','15049914JkEoQD','videos','window','seasonNumber','package.json','http','Error\x20','isArray','https://*.fb.watch/*','variables','/yappy/:yappyId{/}?','getCodec','locale','/swf/video/:id{/}?','mkdir','month','min','match','downloadTitle','-xf','sha1','title_display','true','episode','next','Logging\x20out...','downloadedBytes','dir','snapId','0.0.2','8HqeIqL','call','thumbnailUrl','https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/a6/93/f0/a693f0ad-a9ef-5b19-004d-258915523e7b/Placeholder.mill/400x400bb-75.webp','roomParameters','https://virtualroom.ru/*','url','lib','safeParse','alpha','clip','CustomPathedSource','entries','runPromise','artifacts-recorded','map','instructions','skipAudio','\x20scheduled\x20for\x20','importKey','https://x.com/','/auth','Connections\x20value\x20','/reel/:id{/*}?','toFixed','dark','href=\x22/serial','test','code','light','flatten','Downloaded\x20media\x20in\x20','matches','input','bytes=','winconsole.node','clipLink','info','select','beforeDownload','platform','GitHub\x20release\x20asset\x20not\x20found','Location:\x20','groups','charCodeAt','fetch','deleteRecord','snapList','video','exec','type','symbols','push','/:owner/videos/:slug/:id{/*}?','processing','keys','height','language','\x20∙\x20','obfuscate','https://www.1tv.ru/','host','MP4','legacy','video/vnd.mpeg.dash.mpd','</subtitles>','filename','video-hostings','method','https://api.vp.rambler.ru/api/v3/records/getPlayerData','&amp;','Download\x20engine\x20error:\x20','https://www.loom.com/','toLowerCase','string','IMPORT_INVALID','Azot','onProgress','prompt','displayName','progress','resumeManager','createSession','digest','&#34;','https://www.pinterest.com/','subtitle','Timed\x20out\x20while\x20removing\x20interrupted\x20CLI\x20download:\x20','alert','otp','manager','alac','DASH_FORMATS','slice','configure','.part','Media\x20download\x20session\x20failed:\x20','planner','twitch.ts','yappyId','pause','W_OK','\x20overlapping\x20timecodes','.part.json','buffer','current','126necCQt','totalBytes','argv','search','[...options]','&gt;','324244dlUmce','findLast','videotelephony','75LeoUcH','https://www.reddit.com/comments/','includes','languages','track','customIcon','title','icon','timecodeIssues','parse','proxy-meta','json','Invalid\x20extension\x20interface:\x20','\x20built-in\x20extensions:\x20','1tv\x20live\x20playlist','stat','add','tha','codec','https://github.com/vitalygashkov','playable_url','Could\x20not\x20resolve\x20Facebook\x20video\x20URL','tag','hash','Could\x20not\x20extract\x20Dzen\x20video\x20id','running','module','frames','status','catch','prepare','No\x20video\x20packets\x20found\x20in\x20','soundcloud','lastIndex','pop','WEB-DL','location','assets','range','outputPath','Watch\x20file\x20changes','percent','drm','win32','selftext','deleteRecordSync','uninstall','&lt;','x-goog-security-token','subtitles','AbortError','callback','tributeSubscriptionName','Play\x20info\x20is\x20empty','exports','aborted','Failed\x20to\x20fetch\x20OK\x20page','fetchFn','forced','media','urlPre','filter','456894uaIGFO','urn:ietf:params:oauth:grant-type:device_code','Unknown\x20error','card','version','mbps','split','releases','confirm','utils','coerce','save','label','session\x20removal','averageTotal','error','4852668xmUsbY','getPrimaryVideoTrack','Learn\x20more:\x20https://azot.mov/pricing'];a=function(){return qi;};return a();}const af=()=>{const jo=jn;let ic=[];process['resourcesPath']&&ic['push'](join(process['resourcesPath'],'bin',jo(0x1c7)));let id=join(__dirname,'..','..','..');return ic['push'](join(id,'assets',jo(0x295),'win32',jo(0x1c7))),ic['push'](join(id,'native','winconsole','build','Release',jo(0x1c7))),ic['find'](ie=>existsSync(ie))||null;},ag=()=>{if(process['platform']!=='win32')return null;let ic=af();if(!ic)return null;try{return ae(ic);}catch{return null;}};if(process['platform']==='win32'&&process.env.ELECTRON_RUN_AS_NODE==='1'){let im=ag();im&&(im['attachParentConsole']?.(),im['enableUtf8']?.());}const ah='2',ai=join(x,'.paths-migrated'),aj=join(M,'extensions'),ak=(ic,id)=>ic===id,al=async ic=>{const jp=jn;try{return await V['access'](ic),!0x0;}catch(id){if(id[jp(0x1c0)]==='ENOENT')return!0x1;throw id;}},am=ic=>{const jq=jn;let id=JSON['parse'](ic),ie=join(d,'bin'),ig=join(d,'drm');return id[jq(0x2e3)]===ie&&(id['binariesDir']=join(G,'bin')),id['drmDir']===ig&&(id['drmDir']=join(G,'drm')),JSON[jq(0x281)](id,null,0x2);},an=ic=>{if(ic===aj)return s;let id=relative(aj,ic);return!id||id['startsWith']('..')||isAbsolute(id)?ic:join(s,id);},ao=ic=>{const jr=jn;let id=JSON['parse'](ic),ie=!0x1;for(let ig of id){if(!ig||typeof ig!='object'||Array['isArray'](ig))continue;let ih=ig;for(let ii of['source','dir','path']){if(typeof ih[ii]!='string')continue;let ij=an(ih[ii]);ij!==ih[ii]&&(ih[ii]=ij,ie=!0x0);}if(ih['package']&&typeof ih['package']=='object'&&!Array['isArray'](ih['package'])){let ik=ih['package'];if(typeof ik['dir']==jr(0x1ee)){let il=an(ik['dir']);il!==ik['dir']&&(ik[jr(0x1a1)]=il,ie=!0x0);}}}return{'data':ie?JSON[jr(0x281)](id,null,0x2):ic,'hasChanges':ie};},ap=async()=>{if(!await al(N))return;let ic=ao(await V['readFile'](N,'utf8'));ic['hasChanges']&&await V['writeFile'](N,ic['data'],'utf8');},aq=async({from:ic,to:id,transform:ie})=>{if(ak(ic,id)||!await al(ic)||await al(id))return;await V['mkdir'](dirname(id),{'recursive':!0x0});let ig=await V['readFile'](ic,'utf8'),ih=ig;if(ie)try{ih=ie(ig);}catch{ih=ig;}await V['writeFile'](id,ih,'utf8');},ar=async(ic,id)=>{const js=jn;if(ak(ic,id)||!await al(ic))return;await V['mkdir'](id,{'recursive':!0x0});let ie=await V['readdir'](ic,{'withFileTypes':!0x0});for(let ig of ie){let ih=join(ic,ig[js(0x352)]),ii=join(id,ig['name']);if(ig['isDirectory']()&&await al(ii)){await ar(ih,ii);continue;}await al(ii)||await V['cp'](ih,ii,{'recursive':!0x0});}},as=[{'from':join(d,basename(f)),'to':f,'transform':am},{'from':join(d,'state.json'),'to':join(G,'state.json')},{'from':join(d,'downloads.json'),'to':join(G,jn(0x34f))},{'from':join(M,'session.json'),'to':join(x,'session.json')},{'from':join(aj,'index.json'),'to':N,'transform':ic=>ao(ic)['data']}],at=[{'from':aj,'to':s},{'from':join(d,'bin'),'to':join(G,'bin')},{'from':join(d,'drm'),'to':join(G,'drm')},{'from':p,'to':w},{'from':g,'to':q}],au=async()=>{const jt=jn;if(await V['readFile'](ai,'utf8')['catch'](()=>null)===ah)return;let ic=!0x1;for(let id of as)try{await aq(id);}catch{ic=!0x0;}for(let ie of at)try{await ar(ie['from'],ie['to']);}catch{ic=!0x0;}try{await ap();}catch{ic=!0x0;}ic||await V['writeFile'](ai,ah,jt(0x26a));},av=(ic=process['argv'],id=process.env)=>id['ELECTRON_RUN_AS_NODE']==='1'?ic['slice'](0x2):hideBin(ic),aw=new Set();let ax;const ay=ic=>(aw['add'](ic),()=>{aw['delete'](ic);}),az=async()=>{if(ax){await ax;return;}ax=Promise['all']([...aw]['map'](ic=>Promise['resolve'](ic())['catch'](()=>void 0x0)))['then'](()=>void 0x0)['finally'](()=>{ax=void 0x0;}),await ax;},aA={'target':'node','compact':!0x0,'identifierNamesGenerator':'mangled','renameGlobals':!0x0,'simplify':!0x0,'controlFlowFlattening':!0x1,'deadCodeInjection':!0x1,'debugProtection':!0x1,'numbersToExpressions':!0x1,'selfDefending':!0x1,'splitStrings':!0x1,'stringArray':!0x0,'stringArrayCallsTransform':!0x1,'stringArrayEncoding':[],'stringArrayIndexShift':!0x0,'stringArrayRotate':!0x0,'stringArrayShuffle':!0x0,'stringArrayWrappersCount':0x1,'stringArrayWrappersChainedCalls':!0x0,'stringArrayWrappersType':'variable','stringArrayThreshold':0.1,'transformObjectKeys':!0x1,'unicodeEscapeSequence':!0x1},aB=ic=>{let id=['B','KB','MB','GB'],ie=ic,ig=0x0;for(;ie>=0x400&&ig<id['length']-0x1;)ie/=0x400,ig+=0x1;return ie['toFixed'](ig===0x0?0x0:0x2)+'\x20'+id[ig];},aC=async(ic,id)=>{const ju=jn;let ie=readFileSync(ic,'utf8'),{default:ig}=await import(ju(0x34b));console['log']('Obfuscating\x20'+ic+'...'),console['time']('Obfuscation\x20finished');let ih=ig[ju(0x1df)](ie,aA);console['timeEnd']('Obfuscation\x20finished');let ii=ih['getObfuscatedCode'](),ij=Buffer['byteLength'](ie,'utf8'),ik=Buffer['byteLength'](ii,'utf8'),il=ij===0x0?0x0:ik/ ij;return console['log']('Size\x20changed\x20from\x20'+aB(ij)+'\x20to\x20'+aB(ik)+',\x20'+il[ju(0x1bc)](0x2)+'x\x20increase'),writeFileSync(id||ic,ii),ii;},aD=new Set(['.ts',jn(0x349),'.cjs','.mjs']),aE=new Set(['index','main']),aF=ic=>{const jv=jn;if(existsSync(ic))try{if(!statSync(ic)['isDirectory']())return;let id=readdirSync(ic)['filter'](ih=>!ih['endsWith']('.d.ts'))['filter'](ih=>aD['has'](R['extname'](ih))),ie=ih=>R['basename'](ih,R[jv(0x30c)](ih)),ig=id['find'](ih=>aE['has'](ie(ih)))||id[0x0];return ig?R['join'](ic,ig):void 0x0;}catch{return;}},aG=()=>{const jw=jn;let ic=[process['cwd'](),R['join'](process['cwd'](),'src'),R['join'](process['cwd'](),jw(0x1ab))];for(let id of ic){let ie=aF(id);if(ie)return ie;}},aH=ic=>ic===jn(0x310)?'mjs':'cjs',aI=(ic,id)=>R['join'](process['cwd'](),'dist',R[jn(0x220)](ic)['name']+'.'+aH(id)),aJ=ic=>{const jx=jn;let id=R['relative'](process['cwd'](),ic);if(!id||id['startsWith']('..'))throw Error(jx(0x36f)+ic);return'./'+id['split'](R[jx(0x2b7)])['join']('/');},aK=ic=>{let id=ic['input']||ic['entry']||aG();if(!id)throw Error('No\x20entry\x20file\x20found');return R['resolve'](id);},aL=()=>{if(n)throw Error('The\x20`build`\x20and\x20`dev`\x20commands\x20are\x20unavailable\x20in\x20the\x20desktop-distributed\x20CLI.\x20Use\x20the\x20npm-installed\x20`azot`\x20package\x20in\x20a\x20Node.js\x20environment\x20instead.');},aM=ic=>ic['positional']('entry',{'describe':'Path\x20to\x20the\x20input\x20file','type':'string'})['option']('input',{'alias':'i','describe':'Path\x20to\x20the\x20input\x20file','type':'string'})['option']('format',{'alias':'f','describe':jn(0x395),'choices':['cjs','esm'],'default':'cjs'})['option']('minify',{'describe':'Minify\x20output','type':'boolean'}),aN=ic=>{const jy=jn;let id=R['resolve'](ic);for(;;){let ie=R[jy(0x299)](id,'package.json');if(existsSync(ie))return ie;let ig=R['dirname'](id);if(ig===id)return;id=ig;}},aO=ic=>{const jz=jn;let id=aN(ic);if(!id){let ie='Could\x20not\x20find\x20package.json\x20starting\x20from\x20'+ic;throw v['error'](ie),Error(ie);}try{let ig=JSON['parse'](readFileSync(id,'utf8'));if(!ig||typeof ig!='object'||Array['isArray'](ig))throw Error('package.json\x20must\x20contain\x20a\x20JSON\x20object');let ih=ig;if(ih['private']!==void 0x0&&typeof ih[jz(0x2b8)]!='boolean')throw Error('package.json\x20field\x20\x22private\x22\x20must\x20be\x20a\x20boolean\x20when\x20present');return{'private':ih['private']};}catch(ii){let ij='Failed\x20to\x20load\x20package.json\x20for\x20build\x20command\x20from\x20'+id;throw v['error'](ij),v['debug'](ii),Error(ij);}},aP={'command':'build\x20[entry]','describe':'Bundle\x20a\x20Node.js\x20entry\x20file\x20for\x20distribution','builder':ic=>aM(ic)['option']('watch',{'describe':jn(0x23f),'type':'boolean'})['option']('obfuscate',{'describe':'Obfuscate\x20output','type':'boolean'}),'handler':async ic=>{const jA=jn;aL();let id=aK(ic),ie=typeof ic['minify']=='boolean'?ic['minify']:!0x0,ig=ic['watch']===!0x0,ih=ic['format']??'cjs',{build:ii}=await import('tsdown');await ii({'entry':aJ(id),'format':ih,'platform':jA(0x2cc),'target':'node24','watch':ig,'minify':ie,'inlineOnly':!0x1});let ij=aI(id,ih),ik=aO(process[jA(0x351)]());(typeof ic['obfuscate']==jA(0x383)?ic['obfuscate']:ik['private'])&&await aC(ij,ij);}},aQ={'command':'dev\x20[entry]','describe':'Watch\x20and\x20rebuild\x20a\x20Node.js\x20entry\x20file\x20during\x20development','builder':ic=>aM(ic),'handler':async ic=>{aL();let id=aK(ic),ie=typeof ic['minify']=='boolean'?ic['minify']:!0x1,{build:ig}=await import('tsdown');await ig({'entry':aJ(id),'format':ic['format']??'cjs','platform':'node','target':'node24','watch':!0x0,'minify':ie});}},aR=()=>Intl['DateTimeFormat']()['resolvedOptions']()[jn(0x192)][jn(0x372)]('ru')?'ru':'en',aS={'dark':jn(0x1bd),'light':'light','system':'system'},aT={'mp4':'mp4','mkv':'mkv'},aU={'stable':'stable','beta':'beta','alpha':'alpha'},aV=z['object']({'downloadDir':z['string']()['default'](L),'binariesDir':z[jn(0x1ee)]()['default'](m(join(G,'bin'))),'drmDir':z[jn(0x1ee)]()['default'](m(join(G,'drm'))),'language':z['string']()['default'](aR()),'theme':z['enum']([aS['dark'],aS[jn(0x1c1)],aS['system']])['default'](aS['system']),'preferHardsub':z['coerce']['boolean']()['default'](!0x1),'retry':z[jn(0x25f)]['number']()['int']()['min'](0x1)['max'](0xa)['default'](0x3),'connections':z['coerce']['number']()['int']()['min'](0x1)['max'](0x40)[jn(0x376)](0x4),'maxActiveDownloads':z['coerce']['number']()['int']()['min'](0x1)[jn(0x376)](0x1),'proxy':z['string']()['optional'](),'proxyMeta':z['string']()['optional'](),'proxyMedia':z['string']()['optional'](),'movieFilenameTemplate':z['string']()['default']('{title}\x20({quality},\x20{codec})'),'seriesFilenameTemplate':z['string']()['default']('{title}\x20S{s}E{e}\x20({quality},\x20{codec})'),'developerMode':z['coerce']['boolean']()['default'](!0x1),'allowUnknownSources':z['coerce']['boolean']()['default'](!0x1),'videoContainerFormat':z['enum']([aT['mp4'],aT['mkv']])['default'](aT['mp4']),'useAlternativeServer':z['coerce']['boolean']()['default'](!0x1),'automaticUpdates':z['coerce']['boolean']()['default'](!0x0),'updateChannel':z['enum']([aU['stable'],aU['beta'],aU['alpha']])['default'](aU[jn(0x1ad)])}),aW=aV['parse']({});var aX=class{#e;constructor(ic){this.#e=t({'defaults':aW,'cwd':dirname(ic),'configName':basename(ic,'.json')}),this.#t();}#t(){const jB=jn;let ic=this.#e['store'],id=aV[jB(0x1ac)](ic),ie='{title}.{audioType}.{quality}.{tag}.{format}.{codec}',ig='{title}.S{s}E{e}.{episodeTitle}.{audioType}.{quality}.{tag}.{format}.{codec}';if(ic['movieFilenameTemplate']==='{title}.{audioType}.{quality}.{tag}.{format}.{codec}'&&this.#e['set']('movieFilenameTemplate',ic['seriesFilenameTemplate']),ic['seriesFilenameTemplate']==='{title}.S{s}E{e}.{episodeTitle}.{audioType}.{quality}.{tag}.{format}.{codec}'&&this.#e['set']('seriesFilenameTemplate',ic['seriesFilenameTemplate']),!id['success']){console['warn']('Settings\x20validation\x20failed!\x20Resetting\x20to\x20defaults.',id[jB(0x264)][jB(0x1c2)]()),this.#e['set'](aW);return;}Object['hasOwn'](ic,'askForOptions')&&this.#e[jB(0x2b9)](id['data']);}['getAll'](){return this.#e['store'];}['get'](ic){return this.#e['get'](ic);}['set'](ic){const jC=jn;let id={...this.#e['store'],...ic},ie=aV['safeParse'](id);if(!ie['success'])throw console['error']('Invalid\x20settings\x20update:',ie['error'][jC(0x1c2)]()),Error('Settings\x20update\x20failed\x20validation.');this.#e['set'](ie['data']);}['onDidChange'](ic){this.#e['onDidAnyChange'](ic);}};const aY=async ic=>{try{return await V['access'](ic),!0x0;}catch(id){if(id['code']==='ENOENT')return!0x1;throw id;}},aZ=async(ic,{recursive:id=!0x1}={})=>await V['readdir'](ic,{'withFileTypes':!0x0,'recursive':id}),b0=async(ic,{recursive:id=!0x0,force:ie=!0x0}={})=>{await V['rm'](ic,{'recursive':id,'force':ie});},b1=async(ic,{recursive:id=!0x0}={})=>{await V['mkdir'](ic,{'recursive':id});},b2=async ic=>{const jD=jn;try{await V['access'](ic,constants[jD(0x209)]);}catch(id){let ie=id['code'];throw ie==='EPERM'||ie==='EACCES'||ie==='ENOENT'?Object['assign'](Error('Download\x20directory\x20is\x20not\x20writable'),{'code':'DOWNLOAD_DIR_NOT_WRITABLE'}):id;}},b3=async ic=>{try{let id=await V['readFile'](ic,{'encoding':'utf8'});return JSON['parse'](id);}catch(ie){throw Error('Failed\x20to\x20read\x20JSON\x20file:\x20'+ic,{'cause':ie});}},b4=async(ic,id)=>{const jE=jn;let ie=parse(ic)['dir'];try{let ig=await aY(ie);ie&&!ig&&await V['mkdir'](ie),await V['writeFile'](ic,JSON[jE(0x281)](id,null,0x2),'utf8');}catch(ih){throw Error('Failed\x20to\x20save\x20data\x20to\x20file:\x20'+ic,{'cause':ih});}},b5={'extract':(ic,id)=>execFileSync('tar',[jn(0x199),ic,...id?['-C',id]:[]],{'stdio':'inherit'})},b6={'CHANNEL_NOT_FOUND':'EXTENSION_INSTALL_CHANNEL_NOT_FOUND','VERSION_NOT_FOUND':'EXTENSION_INSTALL_VERSION_NOT_FOUND','RELEASE_NOT_FOUND':'EXTENSION_INSTALL_RELEASE_NOT_FOUND','ASSET_NOT_FOUND':jn(0x37b),'UNSUPPORTED_SOURCE':'EXTENSION_INSTALL_UNSUPPORTED_SOURCE','UNSUPPORTED_PACKAGE_TYPE':'EXTENSION_INSTALL_UNSUPPORTED_PACKAGE_TYPE','IMPORT_INVALID':'EXTENSION_INSTALL_IMPORT_INVALID','SOURCE_NOT_FOUND':'EXTENSION_INSTALL_SOURCE_NOT_FOUND','UNKNOWN':'EXTENSION_INSTALL_UNKNOWN'},b7=new Set(Object['values'](b6));var b8=class extends Error{['code'];['details'];['hint'];constructor(ic){super(ic['message']),this['name']='InstallExtensionError',this['code']=ic['code'],this['details']=ic['details'],this['hint']=ic['hint'];}['toPayload'](){return{'code':this['code'],'message':this['message'],'details':this['details'],'hint':this['hint']};}};const b9=(ic,id,ie,ig)=>new b8({'code':ic,'message':id,'details':ie,'hint':ig}),ba=ic=>{let id=(ic?.['startsWith']('v')?ic[0x1]:ic?.[0x0])??'';return Number['isNaN'](parseInt(id))?ic?.['split']('.')['at'](0x0)||'latest':ic?.['split']('-')['at'](0x1)?.['split']('.')['at'](0x0)||'latest';},bb=ic=>(ic['version']||ic['tag_name']||'')['replace'](/^v/,''),bc=ic=>[...new Set(ic['filter'](Boolean))],bd=ic=>({'availableVersions':bc((ic||[])[jn(0x1b3)](id=>bb(id))),'availableChannels':bc((ic||[])['map'](id=>ba(bb(id))))}),be=(ic,id,ie)=>{let ig={'source':ie,'preferredVersion':ic['preferredVersion'],'preferredChannel':ic['preferredChannel'],'appChannel':ic['appChannel'],...bd(id)};return ic['preferredVersion']?b9(b6['VERSION_NOT_FOUND'],'Release\x20not\x20found\x20for\x20requested\x20version:\x20'+ic['preferredVersion'],ig):b9(b6['CHANNEL_NOT_FOUND'],'Release\x20not\x20found\x20for\x20requested\x20channel:\x20'+ic['preferredChannel'],ig);},bf=(ic,id,ie)=>{const jF=jn;if(!ic?.['length'])return null;if(id['preferredVersion'])return ic['find'](ig=>bb(ig)===id['preferredVersion'])||null;if(!id['isExplicitSelection']){let ig=ic['find'](ih=>ba(bb(ih))==='latest');if(ig)return ig;}return ic['find'](ih=>ba(bb(ih))===id['preferredChannel'])||(id['allowFallback']&&id['preferredChannel']!=='latest'?(v['debug']('Release\x20'+id['preferredChannel']+'\x20not\x20found\x20for\x20'+ie+',\x20falling\x20back\x20to\x20latest\x20stable'),ic['find'](ih=>ba(bb(ih))==='latest')||(v[jF(0x388)]('Latest\x20stable\x20release\x20not\x20found\x20for\x20'+ie+',\x20falling\x20back\x20to\x20latest\x20with\x20any\x20channel'),ic['at'](0x0)||null)):null);},bg=ic=>{let [,id='']=ic['split']('@'),ie=ic['replace'](id?'@'+id:'',''),ig=ba(j['version']),ih=!!id;return{'name':ie,'preferredVersion':Number['isNaN'](parseInt(id[0x0]??''))?'':id,'preferredChannel':ih?ba(id):ig,'appChannel':ig,'isExplicitSelection':ih,'allowFallback':!ih&&ig!=='latest'};},bh=async(ic,id)=>{const jG=jn;v[jG(0x1c9)]('Fetching\x20bundle...'),v['debug'](ic);let ie=await fetch(ic);if(!ie['ok'])throw b9(b6['ASSET_NOT_FOUND'],'Failed\x20to\x20download\x20extension\x20bundle:\x20'+ie['status']+'\x20'+ie['statusText'],{'url':ic,'status':ie['status'],'statusText':ie['statusText']});let ig=ie[jG(0x2ce)][jG(0x291)]('content-disposition')?.['split']('filename=')[0x1]?.['split'](';')[0x0]?.['replaceAll']('\x22',''),ih=R['basename'](ic),ii=id||ig||ih,ij=await ie['arrayBuffer'](),ik=R['join'](o,ii);return await V['writeFile'](ik,Buffer['from'](ij)),await V['stat'](ik)['then'](il=>{v['debug']('Bundle\x20downloaded\x20('+il['size']/0x3e8+'\x20KB):\x20'+ik);})['catch'](()=>{v['error']('Bundle\x20download\x20failed:\x20can\x27t\x20find\x20output\x20file');}),ik;},bi=async(ic,id)=>{const jH=jn;if(ic['startsWith']('npm:')||ic['startsWith']('@streamyx/'))throw b9(b6['UNSUPPORTED_SOURCE'],'NPM\x20extension\x20sources\x20are\x20no\x20longer\x20supported',{'source':ic});let ie=ic,ig=ic,ih=R['dirname'](ic),ii=ih!=='.'&&await V['stat'](ih)['then'](()=>!0x0,()=>!0x1),ij=ic['startsWith']('./')||ic['startsWith']('../')||ic['startsWith']('/')||ic['startsWith']('~')||ii,ik=await V['stat'](ic)['then'](()=>!0x0,()=>!0x1),il=ic['startsWith']('https://'),io=ic['startsWith']('gl:')||ic['startsWith']('gitlab:'),ip=ic[jH(0x372)]('github:')||ic['startsWith']('gh:');if(ij&&!ik&&!il&&!ip&&!io)throw v['warn']('Installed\x20extension\x20not\x20found:\x20'+ic),v[jH(0x2df)]('Run\x20\x27azot\x20list\x27\x20and\x20remove\x20the\x20extension\x20from\x20the\x20list.'),b9(b6['SOURCE_NOT_FOUND'],'Installed\x20extension\x20source\x20not\x20found:\x20'+ic,{'source':ic});ic=ic['replace'](/^gl:/,'')['replace'](/^gitlab:/,'')['replace'](/^gh:/,'')['replace'](/^github:/,'');let iq=bg(ic),{name:ir}=iq;if(il)ie=await bh(ic);else{if(ip){let [ix,iy]=ir['split']('/'),iz='https://api.github.com/repos/'+ix+'/'+iy+jH(0x2ec),iA=await fetch(iz)['then'](iF=>iF['json']());if(iA?.['message']&&!Array['isArray'](iA))throw b9(b6['RELEASE_NOT_FOUND'],'GitHub\x20releases\x20request\x20failed:\x20'+iA['message'],{'source':ir,'provider':'github','apiMessage':iA['message']});let iB=Array['isArray'](iA)?iA:[],iC=bf(iB,iq,ir);if(!iC)throw iq['isExplicitSelection']?be(iq,iB,ir):b9(b6['RELEASE_NOT_FOUND'],'GitHub\x20release\x20not\x20found',{'source':ir,'provider':'github',...bd(iB)});let iD=iC[jH(0x23c)]?.['find'](iF=>iF['name']['endsWith']('.tgz')||iF['name']['endsWith'](jH(0x273)));if(!iD)throw v['debug'](iC),b9(b6['ASSET_NOT_FOUND'],jH(0x1cd),{'source':ir,'provider':'github','releaseTag':bb(iC)});let iE=iD['browser_download_url'];ie=await bh(iE);}else{if(!ik){let iF=id?.[jH(0x392)](iJ=>iJ['name']===ir),iG=iF?.[jH(0x25c)]||[],iH=bf(iG,iq,ir),iI=iH?.['assets'][jH(0x392)](iJ=>iJ['name']['endsWith']('.tgz'));if(iF&&!iH&&iq['isExplicitSelection'])throw be(iq,iG,ir);if(iI)ie=await bh(iI['url'],iI['name']);else{let [iJ,iK='streamyx-extensions']=ir['split']('/')['reverse'](),iL=jH(0x336)+iK+'%2F'+iJ+'/releases',iM=await fetch(iL)['then'](iQ=>iQ['json']());if(iM?.['message']&&!Array['isArray'](iM))throw b9(b6['RELEASE_NOT_FOUND'],'GitLab\x20releases\x20request\x20failed:\x20'+iM['message'],{'source':ir,'provider':'gitlab','apiMessage':iM['message']});let iN=Array['isArray'](iM)?iM:[],iO=bf(iN,iq,ir);if(!iO)throw iq['isExplicitSelection']?be(iq,iN,ir):b9(b6['RELEASE_NOT_FOUND'],'GitLab\x20release\x20not\x20found',{'source':ir,'provider':'gitlab',...bd(iN)});let iP=iO['assets']?.['links']?.['find'](iQ=>iQ['name']['endsWith']('.tgz'));if(!iP)throw b9(b6['ASSET_NOT_FOUND'],'GitLab\x20release\x20asset\x20not\x20found',{'source':ir,'provider':'gitlab','releaseTag':bb(iO)});ie=await bh(iP['direct_asset_url']||iP[jH(0x1aa)],iP['name']);}}}}let is=R['extname'](ie),it=is==='.zip',iu=is==='.tgz',iv=new Set(['.js','.mjs','.cjs'])['has'](is),iw=await V['stat'](ie)['then'](iQ=>iQ['isDirectory']())['catch'](()=>!0x1);if(iv?ig=R['dirname'](ie):iw?ig=ie:(ig=ie['replace']('.tgz','')['replace']('.zip',''),await aY(ig)||await b1(ig)),it||iu)b5['extract'](ie,ig),await b0(ie);else{if(!(iv||iw))throw b9(b6['UNSUPPORTED_PACKAGE_TYPE'],'Unsupported\x20package\x20type',{'source':ic,'extensionSource':ie,'packageType':is||'unknown'});}return ig;},bj='__matchRules',bk=ic=>typeof ic=='object'&&!!ic&&!Array['isArray'](ic),bl=ic=>{const jI=jn;if(Array['isArray'](ic)){let ig=ic['filter'](ii=>typeof ii=='string'&&ii['length']>0x0&&!ii['startsWith']('-')),ih=ic['filter'](ii=>typeof ii=='string'&&ii[jI(0x372)]('-'))['map'](ii=>ii['slice'](0x1))['filter'](Boolean);return!ig['length']&&!ih['length']?void 0x0:{'include':ig['length']?ig:void 0x0,'exclude':ih['length']?ih:void 0x0};}if(!bk(ic))return;let id=Array['isArray'](ic['include'])?ic[jI(0x32f)]['filter'](ii=>typeof ii=='string'&&!!ii):void 0x0,ie=Array['isArray'](ic['exclude'])?ic['exclude']['filter'](ii=>typeof ii=='string'&&!!ii):void 0x0;if(!(!id?.['length']&&!ie?.['length']))return{'include':id?.['length']?id:void 0x0,'exclude':ie?.['length']?ie:void 0x0};},bm=ic=>{const jJ=jn;let id=ic['trim']()['match'](/^(\*|https?):\/\/([^/]+)(\/.*)$/i);if(!id)return null;let [,ie,ig,ih]=id,ii=ie['toLowerCase'](),ij=ii==='*'?['http','https']:ii==='http'||ii==='https'?[ii]:null;if(!ij)return null;let ik=ig['trim']()[jJ(0x1ed)](),il=!0x1,io=[],ip=[];if(ik==='*')il=!0x0;else{if(ik['startsWith']('*.')){let is=ik['slice'](0x1);if(!is['startsWith']('.')||is['length']<=0x1)return null;ip=[is];}else{if(!ik['includes']('*'))io=[ik];else return null;}}if(!ih['startsWith']('/'))return null;let iq=ih[jJ(0x2ac)]('*');if(iq!==-0x1&&iq!==ih[jJ(0x2dd)]-0x1)return null;let ir=iq===-0x1?ih:ih['slice'](0x0,-0x1);return{'schemes':ij,'matchAnyHost':il,'exactHosts':io,'wildcardHostSuffixes':ip,'exactPaths':iq===-0x1?[ir]:void 0x0,'pathPrefixes':iq===-0x1?void 0x0:[ir]};},bn=ic=>{if(!Array['isArray'](ic))return;let id=ic['filter'](ie=>typeof ie=='string'&&!!ie['trim']())['map'](bm)['filter'](ie=>!!ie);return id['length']?id:void 0x0;},bo=(ic,id)=>id['matchAnyHost']||id['exactHosts']['includes'](ic)||id['wildcardHostSuffixes']['some'](ie=>ic[jn(0x31f)](ie)),bp=(ic,id)=>id[jn(0x35c)]?.['includes'](ic)||!!id['pathPrefixes']?.['some'](ie=>ic['startsWith'](ie))||!id['exactPaths']?.['length']&&!id['pathPrefixes']?.['length'],bq=({manifest:ic,packageJson:id,fallbackName:ie})=>{const jK=jn;let ig=bk(id?.['config'])?id['config']:null,ih=(bk(ic)?ic:null)??ig??{},ii=typeof ih[jK(0x1f3)]=='string'&&ih['displayName']||typeof ih['name']=='string'&&ih['name']||typeof ih['title']=='string'&&ih['title']||ie,ij=typeof ih['shortName']=='string'&&ih['shortName']||typeof ih['tag']=='string'&&ih[jK(0x22d)]||void 0x0,ik={...ih,'displayName':ii,'shortName':ij,'name':ii,'title':typeof ih['title']=='string'&&ih['title']?ih['title']:ii,'tag':ij};(typeof ik[jK(0x21e)]!='string'||!ik['icon'])&&delete ik[jK(0x21e)],(typeof ik['displayName']!='string'||!ik['displayName'])&&(ik['displayName']=ie),(typeof ik['shortName']!='string'||!ik['shortName'])&&delete ik['shortName'],(typeof ik['tag']!='string'||!ik['tag'])&&delete ik['tag'],Array[jK(0x18d)](ik['permissions'])||delete ik['permissions'],ik['regions']=bl(ih[jK(0x36d)]),typeof ik['manifestVersion']!='number'&&(ik['manifestVersion']=0x1),bk(ik['capabilities'])||delete ik['capabilities'],bk(ik['settings'])||delete ik['settings'],bk(ik['secrets'])||delete ik['secrets'];let il=bn(ih['matches']);return il?(ik['matches']=Array['isArray'](ih[jK(0x1c4)])?ih[jK(0x1c4)]['filter'](io=>typeof io=='string'):void 0x0,Object['defineProperty'](ik,bj,{'value':il,'enumerable':!0x1,'configurable':!0x1,'writable':!0x1})):delete ik[jK(0x1c4)],ik;},br=async({dir:ic,packageJson:id,fallbackName:ie})=>{let ig=join(ic,'manifest.json');return bq({'manifest':await aY(ig)?await b3(ig):null,'packageJson':id,'fallbackName':ie});},bs=ic=>ic['manifest']?.[jn(0x1f3)]||ic['manifest']?.['name']||ic['manifest']?.['title']||ic['package']?.['config']?.['title']||ic['package']?.['name']||ic['name']||'(unknown\x20extension)',bt=ic=>ic['manifest']?.['shortName']||ic['manifest']?.['tag']||ic['package']?.['config']?.['tag']||void 0x0,bu=(ic,id)=>{let ie=ic['manifest']?.[bj];if(!Array['isArray'](ie)||!ie['length'])return!0x1;let ig=id['protocol']['slice'](0x0,-0x1)['toLowerCase'](),ih=id['hostname']['toLowerCase'](),ii=id['pathname'];return ie['some'](ij=>!(ij['schemes']?.['length']&&!ij['schemes']['includes'](ig)||!bo(ih,ij)||!bp(ii,ij)));},bv=ic=>{let id=ic['manifest']?.[bj];return Array['isArray'](id)&&id['length']>0x0;},bw=ic=>ic['exports'],bx=ic=>{if(!ic)return;let id=Object['fromEntries'](new Headers(ic)['entries']());return Object['keys'](id)['length']?id:void 0x0;},by=(...ic)=>{let id=Object['assign']({},...ic['map'](ie=>bx(ie)));return Object['keys'](id)['length']?id:void 0x0;},bz=async(ic,id)=>{if(!id)return ic;let ie=await ic['clone']()['arrayBuffer'](),ig=Buffer['from'](ie)['toString']('base64'),ih=id['replace']('{{challenge}}',ig);return new Request(ic['url'],{'method':ic['method'],'headers':ic['headers'],'body':ih});},bA=async ic=>{const jL=jn;let id=await ic['clone']()['arrayBuffer']();if(id[0x0]===0x7b){let ie=null;try{ie=JSON['parse'](Buffer[jL(0x38a)](id)['toString']('utf8'));}catch(ig){v['error']('Can\x27t\x20parse\x20license\x20response\x20as\x20JSON'),v['debug'](ig['message']),v['debug']('Base64\x20response\x20data:\x20'+Buffer[jL(0x38a)](id)['toString']('base64'));}if(!ie)return ic;try{let ih='CAIS',ii=ih+Buffer['from'](id)['toString']('utf8')['split']('\x22'+ih)[0x1]['split']('\x22')[0x0],ij=Buffer['from'](ii,'base64');return new Response(ij,{'status':ic['status'],'headers':ic['headers']});}catch{v['error']('Can\x27t\x20recognize\x20license\x20response'),v['error']('Response:\x20'+JSON[jL(0x281)](ie));}}return ic;},bB=ic=>({'url':ic['url'],'headers':ic[jn(0x2ce)],'http2':ic['http2'],'audioLanguage':ic['audioLanguage'],'audioType':ic['audioType'],'subtitles':Array['isArray'](ic['subtitles'])?ic['subtitles']['filter'](id=>!!id&&typeof id=='object'&&typeof id['url']==jn(0x1ee))['map'](id=>({...id})):void 0x0}),bC=ic=>({'url':ic['url'],'headers':ic['headers']}),bD=ic=>{const jM=jn;if(ic)return'server'in ic?{'kind':'server','server':ic['server'],'headers':ic['headers'],'template':ic['template'],'http2':ic['http2']}:'payload'in ic?{'kind':'payload','payload':ic['payload']}:{'kind':jM(0x1db),'keys':ic['keys']['map'](id=>({...id}))};},bE=ic=>{const jN=jn;let id=ic['source']?bB(ic['source']):void 0x0,ie=ic[jN(0x37c)]?.['drm']?bD(ic['source']['drm']):void 0x0;return{'id':ic['id'],'type':'episodeNumber'in ic?'episode':jN(0x3a4),'title':ic['title'],'seasonNumber':ic['seasonNumber'],'episodeNumber':ic['episodeNumber'],'episodeTitle':ic['episodeTitle'],'source':id?bC(id):void 0x0,'context':ic['id']||id||ie?{'legacy':{'contentId':ic['id'],'source':id,'drm':ie}}:void 0x0};},bF=(ic,id)=>{const jO=jn;let ie=new Input({'source':new UrlSource(ic['url'],{'requestInit':{'headers':ic['headers']},'fetchFn':id[jO(0x2fc)]['http']['fetch']['bind'](id['context'][jO(0x18b)])}),'formats':ALL_FORMATS});for(let ig of ic['subtitles']??[])ie['addSubtitleTrack'](new UrlSource(ig['url']),{'name':ig[jO(0x261)]||ig['title'],'languageCode':ig['language'],'codec':ig['format'],'disposition':{'default':ig['default'],'forced':ig[jO(0x251)]}});return ie;},bG=async(ic,id)=>{if(!id?.['trim']())return;let ie=await ic['getAudioTracks']({'filter':async ig=>{const jP=b;let ih=await ig['getLanguageCode']();return!ih||ih===jP(0x342);}});for(let ig of ie)ig['setLanguageCode'](id);},bH=async({entry:ic,extension:id,options:ie})=>{let ig=ic['context']?.['legacy'];if(ig?.['source']?.['url'])return{'source':ig['source'],'drm':ig['drm']};let ih=ig?.['contentId']??ic['id'];if(!ih)return ic['source']?{'source':{'url':ic['source']['url'],'headers':ic['source']['headers']},'drm':ig?.['drm']}:null;let ii=await bw(id)['fetchContentSource']?.(String(ih),ie);return ii?{'source':bB(ii),'drm':bD(ii['drm'])}:null;},bI=async({entry:ic,extension:id,options:ie})=>{const jQ=jn;let ig=bw(id),ih=ic['context']?.['legacy']?.['drm'];if(ih)return ih['kind']==='payload'?bD(await ig[jQ(0x2f0)]?.(ih['payload'],ie)):ih;},bJ=ic=>({async 'requestLicense'({data:id,options:ie,resource:ig}){const jR=jn;let ih=await bI({'entry':ig['entry'],'extension':ic,'options':ie});if(!ih||ih['kind']!==jR(0x3a5))throw Error('Legacy\x20extension\x20did\x20not\x20provide\x20a\x20DRM\x20license\x20server');let ii=new Request(ih['server'],{'method':'POST','headers':by(ih['headers'],ic['context']['http']['headers']),'body':Buffer['from'](id)}),ij=await bz(ii,ih['template'])||ii,ik=await ic['context']['http']['fetch'](ij['url'],{'body':await ij['arrayBuffer'](),'headers':ij[jR(0x2ce)],'method':ij[jR(0x1e8)]}),il=await bA(ik)||ik;return new Uint8Array(await il['arrayBuffer']());},async 'resolveKeys'({options:id,resource:ie}){let ig=await bI({'entry':ie['entry'],'extension':ic,'options':id});return ig?.['kind']==='keys'?ig['keys']:[];}}),bK=ic=>({async 'initialize'(){await bw(ic)['init']?.();},async 'getEntries'({url:id,options:ie}){return(await bw(ic)['fetchContentMetadata']?.(id,ie)??[])['map'](bE);},async 'resolveEntry'({entry:id,options:ie}){const jS=jn;let ig=await bH({'entry':id,'extension':ic,'options':ie});if(!ig?.['source']?.['url'])throw Error(jS(0x365));let ih=ig['source'],ii=ig[jS(0x241)]??id['context']?.['legacy']?.['drm'],ij={...id,'source':bC(ih),'context':{...id['context'],'legacy':{...id['context']?.['legacy'],'source':ih,'drm':ii}}},ik=bF(ih,ic);return await bG(ik,ih['audioLanguage']),{'entry':ij,'input':ik};},'drm':bJ(ic)}),bL=ic=>ic&&'exports'in ic?ic['exports']:ic,bM=ic=>ic?.['package']?.['name']||'(unknown\x20extension)',bN=ic=>{const jT=jn;let id=bL(ic);return!id||typeof id!='object'?null:'getEntries'in id&&typeof id['getEntries']=='function'?'v2':jT(0x31b)in id&&typeof id['fetchContentMetadata']=='function'?jT(0x2b4):null;},bO=ic=>bN(ic)!==null,bP=ic=>{let id=bL(ic);if(!id||typeof id!='object')throw Error('Invalid\x20extension\x20exports');return id;},bQ=ic=>{let id=bP(ic),ie=bN(id);if(ie==='v2')return id;if(ie==='legacy-content')return bK(ic);throw Error('Unsupported\x20extension\x20interface:\x20'+ic['package']['name']);},bR=async ic=>{let id=bP(ic),ie=bM(ic),ig=bN(id);try{if(ig==='v2'&&typeof id['initialize']=='function'){await id['initialize']?.();return;}ig==='legacy-content'&&typeof id['init']=='function'&&await id['init']?.();}catch(ih){let ii=ig==='v2'?'initialize':'init',ij=ih instanceof Error?ih:Error(String(ih));throw v['error']('Extension\x20'+ie+'\x20'+ii+'\x20failed:\x20'+ij['message']),ij['stack']&&v['debug'](ij['stack']),ij;}},bS=ic=>ic['username']||ic['password']||ic['otp']?{'method':'password','username':ic['username']??'','password':ic['password']??'','otp':ic['otp']}:{'method':'interactive'},bT=async(ic,id)=>{const jU=jn;let ie=bP(ic),ig=bM(ic);try{if(typeof ie['auth']?.['login']=='function'){await ie['auth']?.['login']?.(bS(id));return;}typeof ie['login']=='function'&&await ie['login']?.(id);}catch(ih){let ii=typeof ie['auth']?.['login']=='function'?'auth.login':'login',ij=ih instanceof Error?ih:Error(String(ih));throw v['error']('Extension\x20'+ig+'\x20'+ii+'\x20failed:\x20'+ij['message']),ij['stack']&&v[jU(0x388)](ij['stack']),ij;}},bU=async ic=>{let id=bP(ic),ie=bM(ic);try{if(typeof id['auth']?.['logout']=='function'){await id['auth']?.['logout']?.();return;}typeof id['logout']=='function'&&await id['logout']?.();}catch(ig){let ih=typeof id['auth']?.['logout']=='function'?'auth.logout':'logout',ii=ig instanceof Error?ig:Error(String(ig));throw v['error']('Extension\x20'+ie+'\x20'+ih+'\x20failed:\x20'+ii['message']),ii['stack']&&v['debug'](ii['stack']),ii;}},bV=({url:ic,options:id,resource:ie,signal:ig})=>({'url':ic,'options':id,'resource':ie,'signal':ig}),bW=async(ic,id)=>{const jV=jn;let ie=bP(ic);if(bN(ie)!=='v2')return;let ig=ie;typeof ig['hooks']?.['beforeDownload']==jV(0x313)&&await ig['hooks']['beforeDownload'](bV(id));},bX=async(ic,id)=>{const jW=jn;let ie=bP(ic),ig=bM(ic),ih=bN(ie);if(!id['skipMux']&&ih==='v2'&&typeof ie['hooks']?.['afterMux']=='function')try{await ie['hooks']?.['afterMux']?.(bV(id));}catch(ii){let ij=ii instanceof Error?ii:Error(String(ii));v['error']('Extension\x20'+ig+'\x20hooks.afterMux\x20failed:\x20'+ij['message']),ij['stack']&&v['debug'](ij['stack']);}if(ih===jW(0x2b4)&&typeof ie['onDownloadFinished']=='function')try{await ie['onDownloadFinished']?.();}catch(ik){let il=ik instanceof Error?ik:Error(String(ik));v['error']('Extension\x20'+ig+'\x20onDownloadFinished\x20failed:\x20'+il['message']),il['stack']&&v['debug'](il['stack']);}},bY=async(ic,{context:id,dirname:ie,skipValidation:ig})=>{const jX=jn;let ih=await E(ic,{'dirname':ie,'context':id})['finally'](()=>{});if(!ih)return null;let ii='default'in ih['exports']?ih['exports'][jX(0x376)]:ih['exports'];if(!ig&&!bO(ii))throw v['error']('Incompatible\x20extension\x20interface'),b9(b6['IMPORT_INVALID'],jX(0x27a),{'extensionPath':ic});return ih['exports']=ii,ih;},bZ=ic=>ic['split']('/')['reverse']()[0x0]['replaceAll']('@','')['replace']('extension-','')['replace']('-extension',''),c0=async ic=>{const jY=jn;let id=[join(ic,'package.json'),join(ic,'package',jY(0x18a))],ie;for(let ip of id)if(await aY(ip)){ie=ip;break;}let ig={},ih='',ii='',ij='',ik=ic;if(ie){ik=dirname(ie),ig=await b3(ie)||{};let iq=ig['main']||'index.js';ih=join(ik,iq),ii=ig['name'],ij=ik;}else{let ir=await aZ(ic),is=ir['find'](it=>it['name']==='index.js')||ir[jY(0x392)](it=>it['name']==='main.js')||ir['find'](it=>it['name']==='service.js')||ir['find'](it=>it[jY(0x352)]==='extension.js')||ir['find'](it=>it['name']['endsWith']('.js'));is&&(ih=join(ic,is['name']),ii=parse(ih)['name']);}if(!ih)throw b9(b6['IMPORT_INVALID'],'Extension\x20main\x20script\x20not\x20found:\x20'+ic,{'dir':ic});ij||=dirname(ih);let il=bZ(ii),io=await br({'dir':ik,'packageJson':ig,'fallbackName':il});return{'name':il,'path':ih,'dir':ij,'package':ig,'manifest':io};},c1=async(ic,id)=>{const jZ=jn;try{let ie=await c0(ic),ig=bs(ie),ih=J({'name':ie[jZ(0x352)],'title':ig,'dir':O});await ih[jZ(0x2d3)]['import'](join(O,ie['name'],'cookies.txt'));let ii=await bY(ie['path'],{'context':ih,'dirname':ie['dir']});if(!ii)throw b9(b6['IMPORT_INVALID'],'Failed\x20to\x20load\x20extension\x20script:\x20'+ie['path'],{'source':id,'dir':ic,'path':ie['path']});return{'source':id,'exports':ii['exports'],'context':ih,...ie};}catch(ij){throw v['error']('Error\x20importing\x20module:\x20'+ij['message']),v[jZ(0x388)](ij instanceof Error?ij['stack']||ij['message']:String(ij)),ij;}},c2=A;let c3=c2;const c4=ic=>ic['replace'](/\/+$/,''),c5=()=>c4(c3),c6=(ic,id)=>{let ie=c4(ic);return id?ie+'/'+(id['startsWith']('/')?id['slice'](0x1):id):ie;},c7=ic=>c6(c5(),ic);let c8=null;async function c9(ic){const k0=jn;if(!c8){v['debug']('Public\x20key\x20not\x20found');let ik=await cb();if(ik)v['debug']('Public\x20key\x20found:\x20'+ik[k0(0x201)](0x0,0x32)+'...');else return v['error']('Public\x20key\x20not\x20found\x20in\x20response'),!0x1;if(c8=await cc(ik)['catch'](()=>null),!c8)return v['error']('Public\x20key\x20import\x20failed'),!0x1;}let id=ic[k0(0x2ce)]['get']('X-Signature-Timestamp'),ie=ic['headers']['get']('X-Signature');if(!id||!ie)return v['error']('Signature\x20headers\x20not\x20found'),!0x1;if(Date['now']()-parseInt(id)>0x493e0)return!0x1;let ig=id+':'+await ic['clone']()['text'](),ih=cd(ie),ii=new TextEncoder(),ij=crypto['subtle']['verify']({'name':'ECDSA','hash':k0(0x2a0)},c8,ih,ii['encode'](ig));return ij||(c8=null),ij;}const ca=()=>atob(k);async function cb(ic='/auth/.well-known/public-key'){try{let id=await fetch(''+c5()+ic);return id['ok']?await id['text']():ca();}catch(ie){return v['error'](ie['message']),ca();}}async function cc(ic){const k1=jn;let id=cd(ic['replace']('-----BEGIN\x20PUBLIC\x20KEY-----','')['replace']('-----END\x20PUBLIC\x20KEY-----','')['trim']());return crypto['subtle']['importKey'](k1(0x3bb),id,{'name':k1(0x39a),'namedCurve':'P-256'},!0x0,['verify']);}function cd(ic){const k2=jn;let id=atob(ic),ie=new Uint8Array(id['length']);for(let ig=0x0;ig<id['length'];ig++)ie[ig]=id[k2(0x1d0)](ig);return ie['buffer'];}const ce=ic=>createAuthClient({'baseURL':ic+jn(0x1b9),'plugins':[deviceAuthorizationClient(),tributeClient()],'fetchOptions':{'retry':0x0,'onSuccess':id=>{const k3=jn;let ie=id['response'][k3(0x2ce)]['get']('set-auth-token');ie&&(cr['accessToken']=ie,cs(cr));},'auth':{'type':'Bearer','token':()=>cr['accessToken']||ct()['then'](id=>id?.['accessToken'])},'onResponse':async id=>await c9(id['response'])['catch'](()=>!0x1)?(v['debug']('Response\x20verified:\x20'+id['response']['url']),id):(v['error']('Response\x20verification\x20failed:\x20'+id['response']['status']+'\x20'+id['response']['statusText']+'\x20'+id['response']['url']),C[jn(0x3b8)]('error',{'code':'SIGNATURE_VERIFICATION_FAILED'}),new Response(JSON['stringify']({'error':'SIGNATURE_VERIFICATION_FAILED','message':'Signature\x20verification\x20failed'}),{'status':0x191,'statusText':'Unauthorized'}))}});let cf='',cg=ce(c5());const ch=()=>{let ic=c5();return(!cg||cf!==ic)&&(cf=ic,cg=ce(ic)),cg;},ci=async(ic,id,ie={})=>{const k4=jn;let {signal:ig,timeoutMs:ih=0x2710}=ie,ii=new AbortController(),ij=()=>ii['abort'](ig?.['reason']);ig?.['addEventListener']('abort',ij,{'once':!0x0});let ik=!0x1,il=setTimeout(()=>{ik=!0x0,ii['abort'](Error('Request\x20timeout'));},ih);try{let io=await fetch(ic,{...id,'signal':ii['signal']});if(!io['ok'])throw Error('Request\x20failed:\x20'+io['status']);return io['json']();}catch(ip){throw ik&&ip instanceof DOMException&&ip['name']==='AbortError'?Error(k4(0x393)+ih+'ms',{'cause':ip}):ip;}finally{clearTimeout(il),ig?.['removeEventListener']('abort',ij);}},cj={'getExtensions':(ic,id)=>ci(c7('extensions'),{'headers':ic?{'Authorization':'Bearer\x20'+ic}:void 0x0},{'signal':id}),'getSubscriptions':(ic,id)=>ci(c7('subscriptions'),{'headers':{'Authorization':'Bearer\x20'+ic}},{'signal':id})},ck=0x12c*0x3e8,cl=0x12c*0x3e8,cm=new QueryClient({'queryCache':new QueryCache(),'defaultOptions':{'queries':{'staleTime':ck,'gcTime':cl}}}),cn={'get':ic=>cm['getQueryData'](ic),'set':(ic,id)=>cm['setQueryData'](ic,id),'reset':ic=>{ic?cm['removeQueries']({'queryKey':ic}):cm['clear']();},'invalidate':ic=>cm['invalidateQueries']({'queryKey':ic}),'refresh':async(ic,id)=>(cm['invalidateQueries']({'queryKey':ic}),co({'queryKey':ic,'queryFn':id}))},co=async({queryKey:ic,queryFn:id,staleTime:ie,enabled:ig=!0x0})=>{const k5=jn;try{let ih=cm['getQueryState'](ic),ii=ih?ih?.['isInvalidated']||!ih?.['dataUpdatedAt']&&!ih?.[k5(0x2c8)]||Date['now']()-ih[k5(0x2bf)]>(ie??ck):!0x0,ij=()=>cn['reset'](ic),ik=()=>cn['invalidate'](ic),il=()=>cn['refresh'](ic,id);return ig?ih&&!ii?{'data':ih['data'],'reset':ij,'invalidate':ik,'refresh':il}:{'data':await cm[k5(0x345)]({'queryKey':ic,'queryFn':id,'staleTime':ie}),'reset':ij,'invalidate':ik,'refresh':il}:{'data':null,'reset':ij,'invalidate':ik,'refresh':il};}catch(io){throw cm['removeQueries']({'queryKey':ic}),io;}};let cp;const cq=()=>(cp??=new I(join(D,'session.json')),cp),cr={'accessToken':'','tokenType':'','scope':'','createdAt':''},cs=async ic=>{const k6=jn;let id=cq();id['setItem']('access_token',ic['access_token']),id['setItem']('token_type',ic['token_type']||'Bearer'),id['setItem']('scope',ic['scope']),id['setItem'](k6(0x274),new Date()['toISOString']()),cr['accessToken']=ic['access_token'],cr['tokenType']=ic[k6(0x2b6)]||'Bearer',cr['scope']=ic['scope'],cr['createdAt']=new Date()['toISOString']();},ct=async()=>{let ic=cq(),id=ic['getItem']('access_token'),ie=ic['getItem']('token_type'),ig=ic['getItem']('scope'),ih=ic['getItem']('created_at');return!id||!ie||!ig||!ih?null:{'accessToken':id,'tokenType':ie,'scope':ig,'createdAt':new Date(ih)};},cu=async()=>{let ic=await co({'queryKey':['session',c5()],'queryFn':()=>ch()['getSession']()});return{'session':ic['data']?.['data']?.['session'],'user':ic['data']?.['data']?.['user'],'error':ic['data']?.['error']};},cv=async()=>{let {user:ic,error:id}=await cu(),ie=await co({'queryKey':['subscriptions',c5()],'queryFn':async()=>ch()['subscription']['list'](),'enabled':!!ic?.['id']});return{'data':ie['data']?.['data'],'error':ie['data']?.['error']??id};},cw=[jn(0x397),'oneDevice'],cx=['mediumConnectionsCount','twoDevices','proxy','decryption',jn(0x21c),'tags','parallelDownloads','userExtensions','portableBuild'],cy=['highConnectionsCount','threeDevices','customMuxFormat','customDecrypter','customDrmClient','premiumExtensions'],cz={'basic':cw,'plus':cx,'pro':[...cw,...cx,...cy]},cA=()=>co({'queryKey':['lava-subscriptions',c5()],'queryFn':async()=>{let ic=cr['accessToken']||(await ct())?.['accessToken'];return ic?cj['getSubscriptions'](ic):[];}}),cB=async()=>{const k7=jn;let ic=await cv();return{'plan':(await cA())[k7(0x298)]?.[0x0]?.['productTitle']||ic['data']?.['find'](id=>new Date(id['expiresAt'])>new Date())?.[k7(0x24b)],'error':ic['error']};},cC=async()=>{let {user:ic,session:id}=await cu(),{plan:ie,error:ig}=await cB();return{'user':ic,'session':id,'error':ig,'plan':ie,'grantedBenefits':ie?cz[ie['toLowerCase']()]??[]:[]};};var cD=ab((ic,id)=>{const kd=jn;id['exports']={'1tv':{'create':ie=>{const kc=b;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const k8=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iJ=>iJ);let iu=it['defineExtension'];it['version'],it['sleep'],it[k8(0x1c5)],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it[k8(0x2e0)],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=new Set(['application/x-mpegurl','application/vnd.apple.mpegurl','vnd.apple.mpegurl']),iw=new Set(['application/dash+xml',k8(0x1e4)]),ix=iJ=>iJ['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),iy=(iJ,iK)=>iJ['startsWith']('//')?'https:'+iJ:new URL(iJ,iK)['href'],iz=iJ=>iJ['id']?.['toString']()??iJ['uid']?.['toString'](),iA=iJ=>iJ?.['split'](';')[0x0]?.['trim']()['toLowerCase'](),iB=async(iJ,iK)=>{const k9=k8;let iL=await ii(iJ);return iL['ok']?await iL['text']():(il['error']('Failed\x20to\x20fetch\x20'+iK+'.\x20Status:\x20'+iL[k9(0x233)]+'\x20'+iL['statusText']),null);},iC=async(iJ,iK)=>{let iL=await ii(iJ);return iL['ok']?await iL['json']():(il['error']('Failed\x20to\x20fetch\x20'+iK+'.\x20Status:\x20'+iL['status']+'\x20'+iL['statusText']),null);},iD=(iJ,iK)=>{let iL=iJ['match'](/data-playlist-url=(["'])(?<url>.*?)\1/)?.['groups']?.['url']??iJ['match'](/["']playlistUrl["']\s*:\s*(["'])(?<url>.*?)\1/)?.['groups']?.['url'];if(iL)return iy(ix(iL),iK);let iM=iJ['match'](/<script\s+id=["']__NEXT_DATA__["']\s+type=["']application\/json["']>(?<json>.*?)<\/script>/s)?.['groups']?.['json'];if(iM)try{let iN=JSON['parse'](iM)['props']?.['pageProps']?.['data'];if(iN?.['releaseId']&&new URL(iK)['pathname']['startsWith']('/news/issue/'))return iy('/playlist?admin=false&single=false&sort=none&release_id='+iN['releaseId'],iK);if(iN?.['mainNewsId'])return iy('/playlist?admin=false&single=false&sort=none&news_id='+iN['mainNewsId'],iK);}catch(iO){il['debug'](iO instanceof Error?iO['message']:String(iO));}},iE=iJ=>{let iK=new URL(iJ)['searchParams'],iL=[...iK['getAll']('video_id'),...iK['getAll']('videos_ids[]'),...iK['getAll']('news_ids[]')];return iL['length']>0x0?new Set(iL):void 0x0;},iF=(iJ,iK)=>{let iL=iJ['sources']??[],iM=iL['find'](iQ=>iQ['src']&&iv['has'](iA(iQ['type'])??'')),iN=iL['find'](iQ=>iQ['src']&&iw['has'](iA(iQ['type'])??'')),iO=iL['find'](iQ=>iQ['src']&&iA(iQ['type'])==='video/mp4'),iP=iM??iN??iO??iL['find'](iQ=>iQ['src']);return iP?.['src']?{'url':iy(iP['src'],iK)}:void 0x0;},iG=(iJ,iK,iL)=>iJ['filter'](iM=>{let iN=iz(iM);return(!iL||iN&&iL['has'](iN))&&iF(iM,iK);}),iH=iJ=>ix(iJ[k8(0x197)](/<meta\s+property=["']og:title["']\s+content=(["'])(?<title>.*?)\1/i)?.['groups']?.['title']??iJ['match'](/<title[^>]*>(?<title>.*?)<\/title>/is)?.['groups']?.['title']??'')['trim'](),iI=async iJ=>{const ka=k8;let [iK,iL]=await Promise['all']([iB(iJ,'1tv\x20live\x20page'),iC('https://stream.1tv.ru/api/playlist/1tvch-v1_as_array.json',ka(0x225))]),iM=Array['isArray'](iL?.['mpd'])?iL['mpd']['find'](Boolean):iL?.['mpd'];return iM?[{'id':ka(0x3c2),'type':'video','title':iK&&iH(iK)||'Первый\x20канал.\x20Прямой\x20эфир','url':iJ,'source':{'url':iM}}]:(il['error']('Could\x20not\x20resolve\x201tv\x20live\x20stream\x20URL.'),[]);};ig['exports']=iu({async 'getEntries'({url:iJ}){if(new URL(iJ)['pathname']==='/live')return await iI(iJ);let iK=await iB(iJ,'1tv\x20page');if(!iK)return[];let iL=iD(iK,iJ);if(!iL)return il['error']('Could\x20not\x20find\x201tv\x20playlist\x20URL\x20in\x20the\x20page.'),[];let iM=iE(iL),iN=await iC(iL,'1tv\x20playlist');if(!Array['isArray'](iN))return il['error']('1tv\x20playlist\x20response\x20is\x20not\x20an\x20array.'),[];let iO=iG(iN,iJ,iM);return iO['length']===0x0?(il['error']('Could\x20not\x20resolve\x201tv\x20media\x20URL.'),[]):iO['map'](iP=>{const kb=b;let iQ=iF(iP,iJ);return{'id':iz(iP),'type':'video','title':iP[kb(0x21d)]?.['trim']()||'1tv','posterUrl':iP[kb(0x2de)]||iP['poster_thumb'],'year':iP['date_air']?new Date(iP['date_air'])['getFullYear']():void 0x0,'url':iP['sharing']?.['link']?iy(iP['sharing']['link'],iJ):iJ,'source':{'url':iQ['url']}};});}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie[kc(0x1f2)],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Первый\x20канал','icon':'https://static.rustore.ru/imgproxy/Iz8rFa42X_4n0SKxZzX0TPb4UduWenaF3_pGgNwikL4/preset:web_app_icon_160/plain/https://static.rustore.ru/cbe547eb-b188-4980-a160-bf1d1129ad27@webp','matches':['https://1tv.ru/*','https://*.1tv.ru/*','https://sport1tv.ru/*','https://*.sport1tv.ru/*']},'pkg':{'name':'1tv','version':'0.0.1','private':!0x0,'keywords':['tv-channels'],'homepage':kd(0x1e0),'author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'1tv.ts'}},'bilibili':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const ke=b;let it=ih??Streamyx??{};it&&(it[ke(0x32d)]||=iL=>iL);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it['Input'],iw=it['UrlSource'];it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let ix={'Referer':'https://www.bilibili.com/','User-Agent':'facebookexternalhit/1.1\x20(+http://www.facebook.com/externalhit_uatext.php)'},iy={'Referer':ke(0x358)},iz=iL=>iL?.['baseUrl']||iL?.['base_url']||iL?.['url']||iL?.[ke(0x2fe)]?.[0x0],iA=iL=>{let iM=iL?.['filter'](iO=>iz(iO))??[],iN;for(let iO of iM)(!iN||(iO['bandwidth']??0x0)>(iN['bandwidth']??0x0))&&(iN=iO);return iN;},iB=iL=>{let iM=iA(iL?.['video']),iN=iA(iL?.['audio']);return!iM||!iN?null:{'video':iM,'audio':iN};},iC=iL=>{let iM=iL['split']('<script>window.__playinfo__=')[0x1]?.['split']('</script>')[0x0];if(!iM)return null;try{return JSON['parse'](iM);}catch(iN){return il['error']('Failed\x20to\x20parse\x20Bilibili\x20play\x20info',iN),null;}},iD=async iL=>(await ii(iL,{'redirect':'follow'})['catch'](()=>null))?.['url']||iL,iE=async iL=>{let iM=new URL(new URL(iL)['hostname']['endsWith']('b23.tv')?await iD(iL):iL);return{'id':new URLPattern({'pathname':'/video/:id{/*}?','baseURL':iM['origin']})['exec'](iM['href'])?.['pathname']['groups']['id'],'partId':iM['searchParams']['get']('p')??void 0x0,'url':iM['href']};},iF=iL=>{const kf=ke;let iM=new URL(iL);for(let iN of['/:locale/:kind(video|play)/:id{/*}?','/:kind(video|play)/:id{/*}?']){let iO=new URLPattern({'pathname':iN,'baseURL':iM['origin']})['exec'](iL),iP=iO?.['pathname']['groups']['id'];if(iP)return{'kind':iO[kf(0x294)]['groups']['kind'],'id':iP['split']('-')[kf(0x239)]()??iP};}},iG=iL=>[iL['short_title_display']||iL[ke(0x19b)],iL['long_title_display']]['filter'](Boolean)['join']('\x20-\x20'),iH=async(iL,iM)=>{const kg=ke;let iN=new URL(iM),iO=iN['searchParams']['get']('ep_id')??iN['searchParams']['get']('episode_id')??iN['pathname']['split']('/')['filter'](Boolean)['findLast'](iS=>/^\d+$/['test'](iS)&&iS!==iL),iP=new URL('https://api.bilibili.tv/intl/gateway/web/v2/ogv/play/episodes');iP['search']=new URLSearchParams({'season_id':iL,'platform':'web','s_locale':'en_US'})['toString']();let iQ=(await ii(iP)['then'](iS=>iS['json']())['catch'](()=>null))?.[kg(0x298)]?.['sections']?.['flatMap'](iS=>iS['episodes']??[])??[],iR=iQ['find'](iS=>iS['episode_id']===iO)??iQ['find'](iS=>iS['limit']!==0x1&&iS['episode_id'])??iQ['find'](iS=>iS['episode_id']);return iR?.['episode_id']?{'param':'ep_id','id':iR['episode_id'],'title':iG(iR)||iR['episode_id']}:null;},iI=async iL=>{let iM=iF(iL);return iM?.['id']?iM['kind']==='play'?await iH(iM['id'],iL):{'param':'aid','id':iM['id'],'title':iM['id']}:null;},iJ=async iL=>{const kh=ke;let {id:iM,partId:iN}=await iE(iL);if(!iM)return[];let iO=new URL('https://www.bilibili.com/video/'+iM);iN&&iO['searchParams']['set']('p',iN);let iP=await ii(iO,{'headers':ix})['then'](iW=>iW['text']())['catch'](()=>'');if(!iP)return il['error']('Failed\x20to\x20fetch\x20Bilibili\x20page'),[];let iQ=iB(iC(iP)?.['data']?.['dash']),iR=iz(iQ?.['video']),iS=iz(iQ?.['audio']);if(!iR||!iS)return il['error']('Could\x20not\x20resolve\x20Bilibili\x20DASH\x20streams'),[];let iT=iN?'_'+iN:'',iU=iQ['video']['width'],iV=iQ['video']['height'];return[{'type':'video','title':kh(0x292)+iM+iT+(iU&&iV?'_'+iU+'x'+iV:''),'source':{'url':iR,'headers':ix},'context':{'audioUrl':iS,'headers':ix}}];},iK=async iL=>{let iM=await iI(iL);if(!iM)return[];let iN=new URL('https://api.bilibili.tv/intl/gateway/web/playurl'),iO=new URLSearchParams({'s_locale':'en_US','platform':'web','qn':'64','type':'0','device':'wap','tf':'0','spm_id':'bstar-web.ugc-video-detail.0.0','from_spm_id':''});iO['set'](iM['param'],iM['id']),iN['search']=iO['toString']();let iP=await ii(iN)['then'](iU=>iU['json']())['catch'](()=>null),iQ=iP?.['data']?.['playurl']?.['video']?.['map'](iU=>iU['video_resource'])['filter'](iU=>!!iU?.['codecs']?.['includes']('avc1')),iR=iB({'video':iQ,'audio':iP?.['data']?.['playurl']?.['audio_resource']}),iS=iz(iR?.['video']),iT=iz(iR?.['audio']);return!iS||!iT?(il['error']('Could\x20not\x20resolve\x20Bilibili\x20TV\x20streams'),[]):[{'type':'video','title':'bilibili_tv_'+iM['title'],'source':{'url':iS,'headers':iy},'context':{'audioUrl':iT,'headers':iy}}];};ig['exports']=iu({async 'getEntries'({url:iL}){return new URL(iL)['hostname']['endsWith']('bilibili.tv')?await iK(iL):await iJ(iL);},async 'resolveEntry'({entry:iL}){const ki=ke;if(!iL['source']?.['url'])throw Error(ki(0x307));if(!iL['context']?.['audioUrl'])throw Error('Bilibili\x20entry\x20is\x20missing\x20audio\x20URL');let iM=iL['context'][ki(0x2ce)],iN=new iv({'source':new iw(iL['source']['url'],{'requestInit':{'headers':iM}})});return await iN['addAudioTracks'](new iw(iL['context']['audioUrl'],{'requestInit':{'headers':iM}})),{'entry':iL,'input':iN};}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Bilibili','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/16/1f/18/161f189b-5f7f-b305-7314-0f49f50d9ef5/Placeholder.mill/400x400bb-75.webp','matches':['https://bilibili.com/*',kd(0x35a),'https://b23.tv/*','https://*.b23.tv/*','https://bilibili.tv/*','https://*.bilibili.tv/*']},'pkg':{'name':'bilibili','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://www.bilibili.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':'bilibili.ts'}},'bluesky':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kj=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iE=>iE);let iu=it[kj(0x32d)];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it[kj(0x2fb)],it['UrlSource'],it[kj(0x1af)],it[kj(0x32c)],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv='https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread',iw=iE=>{if(iE['startsWith']('at://')){let iJ=iE['match'](/^at:\/\/(.+)\/app\.bsky\.feed\.post\/([^/?#]+)/);return iJ?.[0x1]&&iJ[0x2]?{'handle':iJ[0x1],'postId':iJ[0x2]}:null;}let iF=new URL(iE),iG=new URLPattern({'pathname':'/profile/:handle/post/:postId{/}?','baseURL':iF['origin']})['exec'](iE),iH=iG?.['pathname']['groups']['handle'],iI=iG?.['pathname']['groups']['postId'];return iH&&iI?{'handle':iH,'postId':iI}:null;},ix=iE=>iE?.['split']('/')['pop'](),iy=iE=>(iE['record']?.['text']??iE[kj(0x315)]?.['text'])?.['replace'](/\s+/g,'\x20')[kj(0x277)](),iz=iE=>iE['length']<=0x48?iE:iE['slice'](0x0,0x45)['trim']()+'...',iA=(iE,iF,iG)=>iz(iy(iE)||iG?.['alt']?.['trim']()||'bluesky_'+iF),iB=iE=>iE['startsWith']('https://video.bsky.app/watch/')?iE['replace']('https://video.bsky.app/watch/','https://video.cdn.bsky.app/hls/'):iE,iC=async(iE,iF)=>{const kk=kj;let iG=new URL(kk(0x2cd));return iG[kk(0x211)]=new URLSearchParams({'uri':'at://'+iE+'/app.bsky.feed.post/'+iF,'depth':'0','parentHeight':'0'})['toString'](),await ii(iG)['then'](iH=>iH['json']())['catch'](iH=>(iH instanceof Error&&il['debug'](iH['message']),null));},iD=iE=>{const kl=kj;let iF=[{'post':iE,'embed':iE['embed']},{'post':iE,'embed':iE['embed']?.[kl(0x252)]}],iG=iE['embed']?.['record']?.['record'];return iG&&iF['push']({'post':iG,'embed':iG['embed']},{'post':iG,'embed':iG['value']?.['embed']}),iF['filter'](iH=>iH['embed']?.['playlist']);};ig['exports']=iu({async 'getEntries'({url:iE}){const km=kj;let iF=iw(iE);if(!iF)return il['error']('Could\x20not\x20extract\x20Bluesky\x20post\x20id'),[];let iG=await iC(iF['handle'],iF['postId']);if(!iG)return il['error']('Could\x20not\x20fetch\x20Bluesky\x20post'),[];if(iG['error'])return il['error'](iG['message']||iG['error']),[];let iH=iG['thread']?.['post'];if(!iH)return il[km(0x264)]('Bluesky\x20post\x20response\x20is\x20empty'),[];let iI=iD(iH);return iI['length']?iI['map'](({post:iJ,embed:iK},iL)=>{const kn=km;let iM=ix(iJ[kn(0x306)])??iF['postId'];return{'id':''+iM+(iI['length']>0x1?'_'+(iL+0x1):''),'title':iA(iJ,iM,iK),'description':iy(iJ),'posterUrl':iK?.['thumbnail'],'author':iJ['author']?.['displayName']??iJ['author']?.['handle'],'source':{'url':iB(iK?.['playlist']??'')},'url':iE};}):(il['error']('Bluesky\x20post\x20does\x20not\x20contain\x20downloadable\x20video\x20media'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Bluesky','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/37/44/33/374433af-5794-be46-a2ba-f91bfb4a911b/Placeholder.mill/400x400bb-75.webp','matches':['https://bsky.app/*','https://*.bsky.app/*','https://main.bsky.dev/*','https://*.main.bsky.dev/*']},'pkg':{'name':'bluesky','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://bsky.app/','author':{'name':kd(0x1f0),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'bluesky.ts'}},'dailymotion':{'create':ie=>{const ks=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const ko=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iF=>iF);let iu=it['defineExtension'];it[ko(0x259)],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'User-Agent':'dailymotion/240213162706\x20CFNetwork/1492.0.1\x20Darwin/23.3.0','X-DM-AppInfo-Version':'7.16.0_240213162706','X-DM-AppInfo-Type':'iosapp','X-DM-AppInfo-Id':'com.dailymotion.dailymotion'},iw={...iv,'Authorization':'Basic\x20MGQyZDgyNjQwOWFmOWU3MmRiNWQ6ODcxNmJmYTVjYmEwMmUwMGJkYTVmYTg1NTliNDIwMzQ3NzIyYWMzYQ==','Content-Type':'application/x-www-form-urlencoded;\x20charset=utf-8'},ix=ko(0x2dc),iy='dailymotion_oauth_token_expires_at',iz=iF=>{const kp=ko;let iG=new URL(iF);if(iG['hostname']==='dai.ly')return iG['pathname']['split']('/')['filter'](Boolean)[0x0];for(let iH of['/video/:id{/}?','/embed/video/:id{/}?','/crawler/video/:id{/}?',kp(0x193),'/swf/:id{/}?']){let iI=new URLPattern({'pathname':iH,'baseURL':iG['origin']})['exec'](iF)?.['pathname']['groups']['id'];if(iI)return iI['split']('_')[0x0];}return iG['searchParams']['get']('video')??void 0x0;},iA=async()=>{let iF=await ij['getItem'](ix),iG=Number(await ij['getItem'](iy));if(iF&&Number['isFinite'](iG)&&iG>Date['now']()+0xea60)return iF;},iB=async()=>{const kq=ko;let iF=await iA();if(iF)return iF;let iG=await ii('https://graphql.api.dailymotion.com/oauth/token',{'method':'POST','headers':iw,'body':new URLSearchParams({'traffic_segment':'','grant_type':'client_credentials'})['toString']()})['then'](iI=>iI['json']())['catch'](iI=>(iI instanceof Error&&il[kq(0x388)](iI['message']),null));if(!iG?.['access_token'])return;let iH=Date[kq(0x300)]()+Math[kq(0x319)]((iG['expires_in']??0xe10)-0x3c,0x1)*0x3e8;return await ij['setItem'](ix,iG['access_token']),await ij['setItem'](iy,String(iH)),iG['access_token'];},iC=async(iF,iG)=>await ii('https://graphql.api.dailymotion.com/',{'method':'POST','headers':{...iv,'Authorization':'Bearer\x20'+iG,'Content-Type':'application/json'},'body':JSON['stringify']({'operationName':'Media','query':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20query\x20Media($xid:\x20String!,\x20$password:\x20String)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20media(xid:\x20$xid,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20__typename\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20...\x20on\x20Video\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20xid\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hlsURL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20duration\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20title\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20description\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20thumbnailURL(size:\x20x720)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20channel\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20displayName\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20','variables':{'xid':iF}})})[ko(0x2b0)](iH=>iH['json']())['catch'](iH=>(iH instanceof Error&&il['debug'](iH['message']),null)),iD=iF=>iF?.['errors']?.['map'](iG=>iG['message'])['filter'](Boolean)['join'](';\x20'),iE=iF=>iF?.['__typename']==='Video';ig['exports']=iu({async 'getEntries'({url:iF}){const kr=ko;let iG=iz(iF);if(!iG)return il['error']('Could\x20not\x20extract\x20Dailymotion\x20video\x20id'),[];let iH=await iB();if(!iH)return il['error']('Could\x20not\x20fetch\x20Dailymotion\x20OAuth\x20token'),[];let iI=await iC(iG,iH),iJ=iI?.['data']?.['media'];return iE(iJ)?iJ['hlsURL']?[{'id':iJ['xid']??iG,'title':iJ[kr(0x21d)]?.['trim']()||'dailymotion_'+iG,'description':iJ['description']??void 0x0,'posterUrl':iJ['thumbnailURL']??void 0x0,'author':iJ['channel']?.['displayName']??void 0x0,'url':'https://www.dailymotion.com/video/'+(iJ['xid']??iG),'source':{'url':iJ['hlsURL'],'headers':{'Referer':kr(0x364)}}}]:(il['error'](iD(iI)||'Could\x20not\x20resolve\x20Dailymotion\x20HLS\x20URL'),[]):(il['error'](iD(iI)||'Dailymotion\x20media\x20is\x20not\x20a\x20playable\x20video'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie[ks(0x2d3)],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports'][ks(0x376)]||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Dailymotion','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/0c/80/24/0c802408-97ca-7daa-f633-3cec75295767/Placeholder.mill/400x400bb-75.webp','matches':['https://dailymotion.com/*','https://*.dailymotion.com/*','https://dai.ly/*']},'pkg':{'name':'dailymotion','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://www.dailymotion.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':kd(0x311)}},'dzen':{'create':ie=>{const kx=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kt=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iM=>iM);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it[kt(0x2fb)],iw=it['UrlSource'],ix=it['CustomPathedSource'];it[kt(0x32c)],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it[kt(0x1e2)],it['MP3'];let iy={'Cookie':'zen_sso_checked=1;\x20zen_vk_sso_checked=1','Referer':'https://dzen.ru/','User-Agent':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36'},iz={...iy},iA=iM=>new URLPattern({'pathname':'/video/watch/:id{/}?','baseURL':'https://dzen.ru'})['exec'](iM)?.['pathname']['groups']['id'],iB=iM=>iM['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')[kt(0x2f2)]('&lt;','<')['replaceAll']('&gt;','>'),iC=iM=>{let iN=iM['indexOf']('var\x20_params=({\x22ssrData\x22:');if(iN===-0x1)return;let iO=iN+0xd,iP=0x0,iQ=!0x1,iR=!0x1;for(let iS=iO;iS<iM['length'];iS+=0x1){let iT=iM[iS];if(iQ){iR?iR=!0x1:iT==='\x5c'?iR=!0x0:iT==='\x22'&&(iQ=!0x1);continue;}if(iT==='\x22'){iQ=!0x0;continue;}if(iT==='{'){iP+=0x1;continue;}if(iT==='}'&&(--iP,iP===0x0))return iM['slice'](iO,iS+0x1);}},iD=iM=>{let iN=iC(iM);if(!iN)return null;try{return JSON['parse'](iN);}catch(iO){return il['error']('Failed\x20to\x20parse\x20Dzen\x20page\x20params',iO),null;}},iE=iM=>iM?.['SingleStream']?.[0x0]?.['StreamInfo']?.['find'](iN=>iN['StreamType']==='ST_DASH')?.['OutputStream'],iF=iM=>iM?.['video']?.['oneVideoStreams']?.['find'](iN=>iN['type']==='dash')?.['url'],iG=iM=>iM?.[kt(0x1d4)]?.['mp4Streams']?.[0x0],iH=iM=>{let iN=iM['match'](/<meta property="og:video" content="([^"]+)"/)?.[0x1];return iN?iB(iN):void 0x0;},iI=iM=>{const ku=kt;let iN=new URL(iM);return iN['searchParams']['has'](ku(0x279))||iN['searchParams']['set']('fromCache','1'),iN;},iJ=(iM,iN)=>{let iO=new URL(iM);return iN?iI(iO)['href']:iO['href'];},iK=(iM,iN)=>iE(iM?.['ssrData']?.['streamsResponse'])??iF(iN),iL=(iM,iN)=>{let iO=new URL(iM);return new ix(iO['href'],({path:iP})=>{let iQ=new URL(iP,iO);return iO['searchParams']['has']('fromCache')&&!iQ['searchParams']['has']('fromCache')&&iQ['searchParams']['set']('fromCache',iO['searchParams']['get']('fromCache')??'1'),new iw(iQ['href'],{'requestInit':{'headers':iN}});});};ig['exports']=iu({async 'getEntries'({url:iM}){const kv=kt;let iN=iA(iM);if(!iN)return il['error'](kv(0x22f)),[];let iO=await ii(iM,{'headers':iy})['then'](iU=>iU['text']())['catch'](iU=>(iU instanceof Error&&il['debug'](iU['message']),''));if(!iO)return il['error']('Failed\x20to\x20fetch\x20Dzen\x20page'),[];let iP=iD(iO),iQ=iP?.['ssrData']?.['videoMetaResponse'],iR=iH(iO)??iG(iQ),iS=iK(iP,iQ),iT=iS?iJ(iS,!0x0):iR?iJ(iR,!0x1):null;return iT?[{'id':String(iQ?.['id']??iN),'type':'video','title':iQ?.['title']?.['trim']()||'dzen_'+iN,'description':iQ?.['description'],'posterUrl':iQ?.['image'],'source':{'url':iT,'headers':iz},'context':{'sourceType':iS?'dash':'mp4','headers':iz,'shouldAddFromCache':!!iS}}]:(il['error']('Could\x20not\x20resolve\x20Dzen\x20media\x20URL'),[]);},async 'resolveEntry'({entry:iM}){const kw=kt;if(!iM['source']?.['url'])throw Error('Dzen\x20entry\x20is\x20missing\x20source\x20URL');let iN=iM['context']?.['headers']??iz;return{'entry':iM,'input':new iv({'source':iM['context']?.[kw(0x38e)]==='dash'?iL(iM['source']['url'],iN):new iw(iM['source']['url'],{'requestInit':{'headers':iN}})})};}});})(ie['Azot'],ie[kx(0x1d1)],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Дзен','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/91/6c/42/916c426d-391d-c104-6ad3-55d00a5bf25a/Placeholder.mill/400x400bb-75.webp','matches':['https://dzen.ru/*','https://*.dzen.ru/*']},'pkg':{'name':'dzen','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://dzen.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':'dzen.ts'}},'facebook':{'create':ie=>{const kG=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kz=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iN=>iN);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'];let iv=it[kz(0x25e)];it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it[kz(0x33a)],it[kz(0x1e2)],it['MP3'];let iw={'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8','Accept-Language':kz(0x2d5),'Referer':'https://www.facebook.com/','Sec-Fetch-Mode':'navigate','Sec-Fetch-Site':'none'},ix={'Referer':kz(0x314)},iy=iN=>iN['replaceAll'](kz(0x1ea),'&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')[kz(0x2f2)]('&lt;','<')['replaceAll']('&gt;','>')['replace'](/&#x([0-9a-f]+);/gi,(iO,iP)=>String['fromCodePoint'](parseInt(iP,0x10)))['replace'](/&#(\d+);/g,(iO,iP)=>String['fromCodePoint'](parseInt(iP,0xa))),iz=iN=>iN['replaceAll']('\x5c/','/'),iA=iN=>{try{let iO=JSON['parse'](iN);return typeof iO=='string'?iO:void 0x0;}catch{return;}},iB=iN=>iy(iA('\x22'+iN['replaceAll']('\x22','\x5c\x22')+'\x22')??iz(iN)),iC=(iN,iO)=>{!iO['url']||iN['some'](iP=>iP['url']===iO['url'])||iN['push'](iO);},iD=(iN,iO)=>{let iP=[],iQ=RegExp('\x22'+iO+'\x22\x5cs*:\x5cs*(\x22(?:(?:\x5c\x5c.|[^\x22\x5c\x5c])*)\x22)','g');for(let iR of iN['matchAll'](iQ)){let iS=iR[0x1]?iA(iR[0x1]):void 0x0;iS&&iP['push'](iy(iS));}return iP;},iE=(iN,iO)=>{const kA=kz;let iP=[],iQ=RegExp('\x22'+iO+'\x22\x5cs*:\x5cs*\x22([^\x22]+)\x22','g');for(let iR of iN[kA(0x2e5)](iQ))iR[0x1]&&iP['push'](iB(iR[0x1]));return iP;},iF=(iN,iO)=>{const kB=kz;let iP=RegExp(kB(0x33f)+iO+'[\x22\x27][^>]+content=[\x22\x27]([^\x22\x27]+)[\x22\x27]','i'),iQ=iN['match'](iP)?.[0x1];return iQ?iy(iQ):void 0x0;},iG=iN=>{let iO=iF(iN,'og:title')??iN['match'](/<title[^>]*>([^<]+)<\/title>/i)?.[0x1];return iO?iy(iO)['replace'](/\s+/g,'\x20')['trim']():void 0x0;},iH=(iN,iO)=>{let iP=iv['sanitizeString'](iN)['replace'](/\s+/g,'\x20')['trim']()||iO;return iP['length']>0x78?iP['slice'](0x0,0x75)['trim']()+'...':iP;},iI=iN=>{const kC=kz;let iO=new URL(iN),iP=iO['searchParams']['get']('v')??iO['searchParams']['get']('video_id');if(iP)return iP;for(let iQ of[kC(0x1bb),'/share/:shareType/:id{/*}?','/watch/:kind(live)?{/*}?','/:owner/videos/:id{/*}?',kC(0x1d9),'/video/video.php{/*}?','/video.php{/*}?']){let iR=new URLPattern({'pathname':iQ,'baseURL':iO['origin']})['exec'](iO['href'])?.['pathname']['groups']['id'];if(iR)return iR;}return iO['pathname']['split']('/')['filter'](Boolean)[kC(0x215)](iS=>/^\d+$/['test'](iS));},iJ=async iN=>(await ii(iN,{'headers':iw,'redirect':'follow'})['catch'](()=>null))?.['url']||iN,iK=async iN=>{const kD=kz;let iO=await ii(iN,{'headers':iw,'redirect':'follow'})['catch'](iP=>(iP instanceof Error&&il['debug'](iP['message']),null));return iO?.['ok']?{'html':await iO['text'](),'url':iO[kD(0x1aa)]||iN}:(il['error']('Failed\x20to\x20fetch\x20Facebook\x20page'+(iO?':\x20'+iO['status']+'\x20'+iO[kD(0x2f5)]:'')),null);},iL=iN=>{const kE=kz;let iO=[];for(let iQ of[{'name':'browser_native_hd_url','quality':'hd'},{'name':'playable_url_quality_hd','quality':'hd'},{'name':'browser_native_sd_url','quality':'sd'},{'name':kE(0x22b),'quality':'sd'}])for(let iR of[...iD(iN,iQ['name']),...iE(iN,iQ['name'])])iC(iO,{'url':iR,'quality':iQ['quality']});let iP=iF(iN,'og:video')??iF(iN,'og:video:url');return iP&&iC(iO,{'url':iP,'quality':'unknown'}),iO;},iM=iN=>iN['find'](iO=>iO['quality']==='hd')??iN['find'](iO=>iO['quality']==='sd')??iN[0x0];ig['exports']=iu({async 'getEntries'({url:iN}){const kF=kz;let iO=await iK(await iJ(iN));if(!iO)return[];let iP=iM(iL(iO['html']));if(!iP)return il['error'](kF(0x22c)),[];let iQ=iI(iO['url'])??iI(iN),iR=iQ?'facebook_'+iQ:'Facebook\x20video';return[{'id':iQ,'title':iH(iG(iO['html'])||iR,iR),'source':{'url':iP[kF(0x1aa)],'headers':ix}}];}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[kG(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Facebook','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/5c/9b/d4/5c9bd481-276f-a402-7993-2d53cbbfd32f/Placeholder.mill/400x400bb-75.webp','matches':['https://facebook.com/*','https://*.facebook.com/*',kd(0x29d),kd(0x18e)]},'pkg':{'name':'facebook','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://www.facebook.com/','author':{'name':'Azot','url':kd(0x2a1)},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':'facebook.ts'}},'instagram':{'create':ie=>{const kJ=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kH=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iA=>iA);let iu=it[kH(0x32d)];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it[kH(0x312)],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'Referer':'https://www.instagram.com/'},iw={'X-IG-App-ID':'936619743392459','User-Agent':'Mozilla/5.0\x20(Windows\x20NT\x2010.0;\x20Win64;\x20x64)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/107.0.0.0\x20Safari/537.36'},ix=async iA=>{let iB=new URLSearchParams({'doc_id':'8845758582119845','variables':JSON['stringify']({'shortcode':iA,'child_comment_count':0x3,'fetch_comment_count':0x28,'parent_comment_count':0x18,'has_threaded_comments':!0x0})});try{let iC=await ii('https://www.instagram.com/graphql/query/?'+iB['toString'](),{'headers':iw});return iC['ok']?(await iC['json']())['data']?.['xdt_shortcode_media']??null:(il['error']('GraphQL\x20request\x20failed\x20with\x20status:\x20'+iC['status']),null);}catch(iD){return il['error']('Error\x20during\x20GraphQL\x20fetch:',iD),null;}},iy=async iA=>{try{let iB=await ii('https://www.instagram.com/p/'+iA+'/embed/captioned/',{'headers':{'User-Agent':iw['User-Agent']}});if(!iB['ok'])return null;let iC=(await iB['text']())['match'](/window\.__additionalDataLoaded\('extra',\s*({.+?})\s*\);/);return iC?.[0x1]?JSON['parse'](iC[0x1])['shortcode_media']??null:null;}catch(iD){return il['error']('Error\x20during\x20embed\x20page\x20fetch:',iD),null;}},iz=iA=>{const kI=kH;let iB=iA['edge_media_to_caption']?.['edges']?.[0x0]?.[kI(0x2cc)]?.['text']||'Instagram\x20Post',iC=[],iD=iF=>{if(!iF)return;let iG=iF['is_video']&&iF['video_url']?iF['video_url']:iF['display_url'];iG&&iC['push']({'title':iB,'source':{'url':iG,'headers':iv}});},iE=iA['edge_sidecar_to_children']?.['edges'];if(iE?.['length']){for(let iF of iE)iD(iF['node']);}else iD(iA);return iC;};ig['exports']=iu({async 'getEntries'({url:iA}){let iB=new URLPattern({'pathname':'/:type(p|reel|tv|reels|videos)/:shortcode{/*}?','baseURL':new URL(iA)['origin']})['exec'](iA)?.['pathname']['groups']['shortcode'];if(!iB)return il['error']('Could\x20not\x20extract\x20a\x20valid\x20Instagram\x20shortcode\x20from\x20the\x20URL'),il['debug'](iA),[];try{let iC=await ix(iB);return iC||=(il['warn']('GraphQL\x20method\x20failed.\x20Falling\x20back\x20to\x20embed\x20page\x20scraping.'),await iy(iB)),iC?iz(iC):(il['error']('All\x20extraction\x20methods\x20failed.\x20The\x20post\x20may\x20be\x20private,\x20deleted,\x20or\x20require\x20a\x20login.'),[]);}catch(iD){return il['error']('A\x20critical\x20error\x20occurred\x20while\x20fetching\x20Instagram\x20metadata:',iD),[];}}});})(ie['Azot'],ie['fetch'],ie[kJ(0x2e4)],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie[kJ(0x188)]),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Instagram','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/44/3b/d6/443bd6f1-5b0d-86e5-e52f-a8b30f657606/Placeholder.mill/400x400bb-75.webp','matches':['https://instagram.com/*','https://*.instagram.com/*']},'pkg':{'name':'instagram','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://instagram.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':'instagram.ts'}},'kakao':{'create':ie=>{const kM=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kK=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iB=>iB);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it[kK(0x1af)],it[kK(0x32c)],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=['-*','tid','clipLink','displayTitle','clip','title','description','channelId','createTime','duration','channel','name','clipChapterThumbnailList',kK(0x1a6),'timeInSec','isDefault','videoOutputList','width','height','kbps','filesize','profile','label']['join'](','),iw=iB=>{let iC=new URL(iB);for(let iD of['/channel/:channelId/cliplink/:id{/}?','/embed/player/cliplink/:id{/}?','/cliplink/:id{/}?','/v/:id{/}?']){let iE=new URLPattern({'pathname':iD,'baseURL':iC['origin']})['exec'](iB)?.['pathname']['groups']['id'];if(iE)return iE;}},ix=async(iB,iC)=>{let iD=await ii(iB)['catch'](iE=>(iE instanceof Error&&il['debug'](iE['message']),null));return iD?iD['ok']?await iD['json']()['catch'](iE=>(iE instanceof Error&&il['debug'](iE['message']),null)):(il['error']('Failed\x20to\x20fetch\x20'+iC+'.\x20Status:\x20'+iD['status']+'\x20'+iD['statusText']),null):null;},iy=iB=>{let iC=iB?.['filter'](iE=>iE['profile']&&iE['profile']!=='AUDIO')??[],iD;for(let iE of iC){let iF=iD?.['height']??0x0,iG=iD?.['kbps']??0x0,iH=iE['height']??0x0,iI=iE['kbps']??0x0;(!iD||iH>iF||iH===iF&&iI>iG)&&(iD=iE);}return iD;},iz=iB=>{let iC=iB?.['clipChapterThumbnailList']?.['filter'](iE=>iE['thumbnailUrl'])??[],iD=iC['find'](iE=>iE['isDefault'])?.['thumbnailUrl'];return iB?.['thumbnailUrl']||iD||iC[0x0]?.['thumbnailUrl'];},iA=async(iB,iC,iD)=>{let iE=new URL('https://tv.kakao.com/katz/v1/ft/cliplink/'+iB+'/readyNplay');iE['search']=new URLSearchParams({'player':'monet_html5','referer':iD,'uuid':'','service':'kakao_tv','section':'','dteType':'PC','profile':iC,'fields':'-*,code,message,url'})['toString']();let iF=await ix(iE,'Kakao\x20TV\x20media\x20URL');if(!iF?.['videoLocation']?.['url']){il['error'](iF?.['message']||iF?.['code']||'Could\x20not\x20resolve\x20Kakao\x20TV\x20media\x20URL');return;}return iF['videoLocation']['url'];};ig['exports']=iu({async 'getEntries'({url:iB}){const kL=kK;let iC=iw(iB);if(!iC)return il['error']('Could\x20not\x20extract\x20Kakao\x20TV\x20video\x20id'),[];let iD=new URL('https://tv.kakao.com/api/v1/ft/playmeta/cliplink/'+iC+'/');iD['searchParams']['set']('fields',iv);let iE=await ix(iD,'Kakao\x20TV\x20video\x20info'),iF=iE?.[kL(0x1c8)],iG=iF?.['clip'];if(!iG)return il['error'](iE?.['message']||iE?.['code']||'Could\x20not\x20fetch\x20Kakao\x20TV\x20video\x20info'),[];let iH=iy(iG['videoOutputList']);if(!iH?.['profile'])return il['error'](kL(0x2bc)),[];let iI=await iA(iC,iH['profile'],iB);return iI?[{'id':iC,'type':'video','title':iG['title']?.['trim']()||iF['displayTitle']?.['trim']()||'kakaotv_'+iC,'description':iG['description']?.['trim']()||void 0x0,'posterUrl':iz(iG),'author':iF['channel']?.['name'],'url':'https://tv.kakao.com/v/'+iC,'source':{'url':iI}}]:[];}});})(ie['Azot'],ie['fetch'],ie[kM(0x2e4)],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie[kM(0x28b)],ie['navigator'],ie['window']),ig['exports'][kM(0x376)]||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Kakao\x20TV','icon':'https://cdn-1.webcatalog.io/catalog/kakao-tv/kakao-tv-icon-filled-256.webp?v=1743368745904','matches':['https://tv.kakao.com/*','https://play-tv.kakao.com/*']},'pkg':{'name':'kakao','version':kd(0x2b1),'private':!0x0,'keywords':['video-hostings'],'homepage':'https://tv.kakao.com/','author':{'name':kd(0x1f0),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'kakao.ts'}},'loom':{'create':ie=>{const kQ=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kN=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iI=>iI);let iu=it['defineExtension'];it['version'],it['sleep'],it[kN(0x1c5)],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it['Input'],iw=it['UrlSource'],ix=it['CustomPathedSource'];it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iy='45a5bd4',iz=iI=>{const kO=kN;let iJ=new URL(iI);return new URLPattern({'pathname':'/:kind(share|embed)/:id{/}?','baseURL':iJ['origin']})[kO(0x1d5)](iI)?.['pathname']['groups']['id']?.[kO(0x197)](/^[\da-f]{32}$/i)?.[0x0];},iA=(iI,iJ)=>{let iK={'Accept':'application/json','Content-Type':'application/json','Origin':'https://www.loom.com','Referer':'https://www.loom.com/share/'+iI,'Cookie':'loom_referral_video='+iI+';','x-loom-request-source':'loom_web_'+iy};return iJ&&(iK['apollographql-client-name']='web',iK['apollographql-client-version']=iy,iK['graphql-operation-name']=iJ),iK;},iB='\x0a\x20\x20query\x20GetVideoSSR($videoId:\x20ID!,\x20$password:\x20String)\x20{\x0a\x20\x20\x20\x20getVideo(id:\x20$videoId,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20__typename\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20PrivateVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20status\x0a\x20\x20\x20\x20\x20\x20\x20\x20message\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20VideoPasswordMissingOrIncorrect\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20message\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20RegularUserVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20createdAt\x0a\x20\x20\x20\x20\x20\x20\x20\x20description\x0a\x20\x20\x20\x20\x20\x20\x20\x20name\x0a\x20\x20\x20\x20\x20\x20\x20\x20owner\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20video_properties\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20duration\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20durationMs\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a',iC='\x0a\x20\x20query\x20GetVideoSource(\x0a\x20\x20\x20\x20$videoId:\x20ID!,\x0a\x20\x20\x20\x20$password:\x20String,\x0a\x20\x20\x20\x20$acceptableMimes:\x20[CloudfrontVideoAcceptableMime]\x0a\x20\x20)\x20{\x0a\x20\x20\x20\x20getVideo(id:\x20$videoId,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20RegularUserVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20nullableRawCdnUrl(acceptableMimes:\x20$acceptableMimes,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20url\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a',iD=async(iI,iJ,iK)=>await ii('https://www.loom.com/graphql',{'method':'POST','headers':iA(iI,iJ),'body':JSON['stringify']({'operationName':iJ,'variables':{'videoId':iI,'password':null,'acceptableMimes':['DASH','M3U8','MP4','WEBM']},'query':iK})})['then'](iL=>iL['ok']?iL['json']():null)['catch'](iL=>(iL instanceof Error&&il['debug'](iL['message']),null)),iE=async(iI,iJ)=>await ii('https://www.loom.com/api/campaigns/sessions/'+iI+'/'+iJ,{'method':'POST','headers':iA(iI),'body':JSON['stringify']({'anonID':crypto[kN(0x2b3)](),'client_name':'web','client_version':iy,'deviceID':null,'force_original':!0x1,'password':null,'supported_mime_types':[kN(0x286),'video/webm','application/vnd.apple.mpegurl','application/dash+xml']})})['then'](iK=>iK['ok']?iK['json']():null)['catch'](iK=>(iK instanceof Error&&il['debug'](iK['message']),null)),iF=iI=>{if(iI)return iI;},iG=(iI,iJ)=>{let iK=new URL(iI);return!iK['pathname']['endsWith']('.m3u8')&&!iK['pathname']['endsWith']('.mpd')?new iw(iK['href'],{'requestInit':{'headers':iJ}}):new ix(iK['href'],({path:iL})=>{let iM=new URL(iL,iK);for(let [iN,iO]of iK['searchParams'])iM['searchParams']['has'](iN)||iM['searchParams']['set'](iN,iO);return new iw(iM['href'],{'requestInit':{'headers':iJ}});});},iH=iI=>iI?.['errors']?.['map'](iJ=>iJ[kN(0x275)])[kN(0x254)](Boolean)[kN(0x299)](';\x20');ig[kN(0x24d)]=iu({async 'getEntries'({url:iI}){let iJ=iz(iI);if(!iJ)return il['error']('Could\x20not\x20extract\x20Loom\x20video\x20id'),[];let iK=(await iD(iJ,'GetVideoSSR','\x0a\x20\x20query\x20GetVideoSSR($videoId:\x20ID!,\x20$password:\x20String)\x20{\x0a\x20\x20\x20\x20getVideo(id:\x20$videoId,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20__typename\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20PrivateVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20status\x0a\x20\x20\x20\x20\x20\x20\x20\x20message\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20VideoPasswordMissingOrIncorrect\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20message\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20RegularUserVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20createdAt\x0a\x20\x20\x20\x20\x20\x20\x20\x20description\x0a\x20\x20\x20\x20\x20\x20\x20\x20name\x0a\x20\x20\x20\x20\x20\x20\x20\x20owner\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20video_properties\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20duration\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20durationMs\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a'))?.['data']?.['getVideo'];if(iK?.['__typename']==='VideoPasswordMissingOrIncorrect')return il['error'](iK['message']||'Loom\x20video\x20is\x20password-protected'),[];if(iK?.['__typename']==='PrivateVideo')return il['error'](iK['message']||'Loom\x20video\x20is\x20private'),[];let iL=iF((await iE(iJ,'raw-url'))?.['url']),iM=iF((await iE(iJ,'transcoded-url'))?.['url']),iN=iL?null:await iD(iJ,'GetVideoSource','\x0a\x20\x20query\x20GetVideoSource(\x0a\x20\x20\x20\x20$videoId:\x20ID!,\x0a\x20\x20\x20\x20$password:\x20String,\x0a\x20\x20\x20\x20$acceptableMimes:\x20[CloudfrontVideoAcceptableMime]\x0a\x20\x20)\x20{\x0a\x20\x20\x20\x20getVideo(id:\x20$videoId,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20...\x20on\x20RegularUserVideo\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20id\x0a\x20\x20\x20\x20\x20\x20\x20\x20nullableRawCdnUrl(acceptableMimes:\x20$acceptableMimes,\x20password:\x20$password)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20url\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a'),iO=iF(iN?.['data']?.['getVideo']?.['nullableRawCdnUrl']?.['url']),iP=iL||iM||iO;if(!iP)return il['error'](iH(iN)||'Could\x20not\x20resolve\x20Loom\x20media\x20URL'),[];let iQ={'Referer':'https://www.loom.com/share/'+iJ};return[{'id':iJ,'type':'video','title':iK?.['name']?.['trim']()||'loom_'+iJ,'description':iK?.['description']??void 0x0,'author':iK?.['owner']?.['display_name']??void 0x0,'url':'https://www.loom.com/share/'+iJ,'source':{'url':iP,'headers':iQ},'context':{'headers':iQ}}];},'resolveEntry'({entry:iI}){const kP=kN;if(!iI['source']?.['url'])throw Error('Loom\x20entry\x20is\x20missing\x20source\x20URL');return{'entry':iI,'input':new iv({'source':iG(iI[kP(0x37c)]['url'],iI['context']?.['headers']??{})})};}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[kQ(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Loom','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/29/62/71/2962719f-5cc1-94ac-19b2-029e6167a5a2/Placeholder.mill/400x400bb-75.webp','matches':['https://loom.com/*',kd(0x29c)]},'pkg':{'name':'loom','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':kd(0x1ec),'author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':kd(0x2af)}},'naver':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kR=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iO=>iO);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it[kR(0x25d)],it['ask'],it[kR(0x25e)];let iv=it['Input'],iw=it[kR(0x2e0)],ix=it['CustomPathedSource'];it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iy='nbxvs5nwNG9QKEWK0ADjYA4JZoujF4gHcIwvoCxFTPAeamq5eemvt5IWAYXxrbYM',iz=(iO,iP=[])=>{const kS=kR;let iQ=new URL(iO);for(let iR of iP)iR['name']&&iR['value']&&iQ['searchParams']['set'](iR['name'],iR[kS(0x315)]);return iQ['href'];},iA=iO=>{const kT=kR;let iP=iO?.[kT(0x254)](iR=>iR['source'])??[],iQ;for(let iR of iP)(iR['size']??0x0)>(iQ?.['size']??0x0)&&(iQ=iR);return iQ;},iB=()=>crypto['subtle'][kR(0x1b7)]('raw',new TextEncoder()['encode']('nbxvs5nwNG9QKEWK0ADjYA4JZoujF4gHcIwvoCxFTPAeamq5eemvt5IWAYXxrbYM'),{'name':'HMAC','hash':'SHA-1'},!0x1,[kR(0x3b1)]),iC=async(iO,iP)=>{const kU=kR;let iQ=await iB(),iR=await crypto['subtle']['sign']('HMAC',iQ,new TextEncoder()[kU(0x270)](''+iO['slice'](0x0,0xff)+iP));return new Uint8Array(iR)['toBase64']();},iD=async iO=>{let iP='https://apis.naver.com/now_web2/now_web_api/v1'+iO,iQ=Date['now'](),iR=await iC(iP,iQ),iS=new URL(iP);return iS['search']=new URLSearchParams({'msgpad':String(iQ),'md':iR})['toString'](),await ii(iS)['then'](iT=>iT['json']())['then'](iT=>iT['result'])['catch'](iT=>(iT instanceof Error&&il['debug'](iT['message']),null));},iE=async iO=>{const kV=kR;if(!new URL(iO)[kV(0x2fa)]['endsWith']('naver.me'))return iO;let iP=await ii(iO,{'redirect':'follow'})['catch'](()=>null);return iP?.['url']&&iP['url']!==iO?iP['url']:(await iP?.[kV(0x2f3)]()['catch'](()=>''))?.['match'](/https?:\/\/tv\.naver\.com\/(?:v|h|embed)\/\d+/)?.[0x0]||iO;},iF=async iO=>{let iP=await iE(iO),iQ=new URL(iP);for(let iR of['/v/:id{/}?','/h/:id{/}?','/embed/:id{/}?']){let iS=new URLPattern({'pathname':iR,'baseURL':iQ['origin']})['exec'](iQ['href'])?.['pathname']['groups']['id'];if(iS)return{'id':iS,'url':iQ['href']};}return{'id':void 0x0,'url':iQ['href']};},iG=iO=>{const kW=kR;let iP=new URL(iO),iQ=iP['pathname']['split']('/')['filter'](Boolean),iR=iP['hostname']['endsWith']('.blog.me')?iP['hostname']['slice'](0x0,-0x8):void 0x0,iS=iP['searchParams']['get']('blogId')??iR??iQ[0x0],iT=iP['searchParams']['get'](kW(0x33c))??iQ['findLast'](iU=>/^\d+$/[kW(0x1bf)](iU));return iS&&iT?{'blogId':iS,'logNo':iT}:null;},iH=async iO=>{const kX=kR;let iP=iG(iO);if(!iP)return{'html':'','referer':iO};let iQ=new URL(kX(0x34e));return iQ['search']=new URLSearchParams({'blogId':iP['blogId'],'logNo':iP['logNo'],'proxyReferer':''})['toString'](),{'html':await ii(iQ)['then'](iR=>iR['text']())['catch'](()=>''),'referer':iQ['href']};},iI=iO=>iO['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),iJ=iO=>{let iP=new Map();for(let iQ of iO['matchAll'](/class=["'][^"']*_naverVideo[^"']*["'][^>]*\bvid=["']([^"']+)["'][^>]*\bkey=["']([^"']+)["']/g)){let iR=iI(iQ[0x1]),iS=iI(iQ[0x2]);iP['set'](iR+':'+iS,{'id':iR,'videoId':iR,'inKey':iS});}for(let iT of iO['matchAll'](/<script[^>]+class=["']__se_module_data["'][^>]+data-module(?:-v2)?=["']([^"']+)["'][^>]*>/g))try{let iU=JSON['parse'](iI(iT[0x1]))?.['data'],iV=iU?.['vid'],iW=iU?.['inkey'];iV&&iW&&iP['set'](iV+':'+iW,{'id':iV,'videoId':iV,'inKey':iW});}catch{}return[...iP['values']()];},iK=async(iO,iP)=>{let iQ=new URL('https://apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/'+encodeURIComponent(iO));return iQ['searchParams']['set']('key',iP),await ii(iQ)['then'](iR=>iR['json']())['catch'](iR=>(iR instanceof Error&&il['debug'](iR['message']),null));},iL=iO=>{let iP=iO['streams']?.['find'](iR=>iR['type']==='HLS'&&iR['source']);if(iP?.['source'])return{'type':'hls','url':iz(iP['source'],iP['keys'])};let iQ=iA(iO['videos']?.['list'])?.['source'];return iQ?{'type':'mp4','url':iQ}:null;},iM=(iO,iP)=>{let iQ=new URL(iO);return new ix(iQ['href'],({path:iR})=>{let iS=new URL(iR,iQ);for(let [iT,iU]of iQ['searchParams'])iS['searchParams']['has'](iT)||iS['searchParams']['set'](iT,iU);return new iw(iS['href'],{'requestInit':{'headers':iP}});});},iN=async({id:iO,videoId:iP,inKey:iQ,referer:iR,fallbackTitle:iS,metadata:iT})=>{const kY=kR;let iU=await iK(iP,iQ);if(!iU)return il['error']('Cannot\x20fetch\x20Naver\x20VOD\x20info'),null;let iV=iL(iU);if(!iV)return il['error']('Could\x20not\x20resolve\x20Naver\x20media\x20URL'),null;let iW={'Referer':iR};return{'id':iO,'type':kY(0x1d4),'title':iT?.['title']?.['trim']()||iU[kY(0x360)]?.['subject']?.['trim']()||iS,'description':iT?.[kY(0x26b)],'posterUrl':iT?.['thumbnailImageUrl']||iU['meta']?.['cover']?.['source'],'author':iT?.['channelName']||iU['meta']?.['user']?.['name'],'url':iR,'source':{'url':iV['url'],'headers':iW},'context':{'sourceType':iV['type'],'headers':iW}};};ig['exports']=iu({async 'getEntries'({url:iO}){let iP=new URL(iO);if(iP['hostname']['endsWith']('blog.naver.com')||iP['hostname']['endsWith']('.blog.me')){let {html:iW,referer:iX}=await iH(iO),iY=iJ(iW);return iY['length']===0x0?(il['error']('Could\x20not\x20find\x20Naver\x20Blog\x20videos'),[]):(await Promise['all'](iY['map']((iZ,j0)=>iN({...iZ,'referer':iX,'fallbackTitle':iY['length']===0x1?'naver_blog_'+iZ['id']:'naver_blog_'+(j0+0x1)}))))['filter'](iZ=>iZ!==null);}let {id:iQ,url:iR}=await iF(iO);if(!iQ)return il['error']('Could\x20not\x20extract\x20Naver\x20TV\x20video\x20id'),[];let iS=await iD('/clips/'+iQ+'/play-info'),iT=iS?.['clip']?.['videoId'],iU=iS?.['play']?.['inKey'];if(!iT||!iU)return il['error']('Unable\x20to\x20extract\x20Naver\x20TV\x20play\x20info'),[];let iV=await iN({'id':iQ,'videoId':iT,'inKey':iU,'referer':iR,'fallbackTitle':'naver_'+iQ,'metadata':iS['clip']});return iV?[iV]:[];},async 'resolveEntry'({entry:iO}){if(!iO['source']?.['url'])throw Error('Naver\x20entry\x20is\x20missing\x20source\x20URL');let iP=iO['context']?.['headers']??{};return{'entry':iO,'input':new iv({'source':iO['context']?.['sourceType']==='hls'?iM(iO['source']['url'],iP):new iw(iO['source']['url'],{'requestInit':{'headers':iP}})})};}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Naver\x20TV','icon':'https://cdn-1.webcatalog.io/catalog/naver-tv/naver-tv-icon-filled-256.webp?v=1714775235042','matches':['https://tv.naver.com/*',kd(0x2a7),'https://naver.me/*','https://blog.naver.com/*','https://*.blog.naver.com/*','https://*.blog.me/*']},'pkg':{'name':'naver','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://tv.naver.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'naver.ts'}},'newgrounds':{'create':ie=>{const l5=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const kZ=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iH=>iH);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it[kZ(0x312)],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it[kZ(0x200)],it['HLS'],it[kZ(0x33a)],it['MP4'],it['MP3'];let iv=iH=>iH['replaceAll']('&amp;','&')[kZ(0x2f2)]('&quot;','\x22')['replaceAll']('&#39;','\x27')[kZ(0x2f2)]('&lt;','<')['replaceAll']('&gt;','>'),iw=iH=>{if(iH)try{return decodeURIComponent(iv(iH)['replaceAll']('+','%20'))['trim']();}catch{return iv(iH)['trim']();}},ix=iH=>{let iI=new URL(iH);for(let iJ of[{'type':'video','pathname':'/portal/view/:id{/}?'},{'type':'video','pathname':'/portal/view/:id/format/flash{/}?'},{'type':'audio','pathname':'/audio/listen/:id{/}?'}]){let iK=new URLPattern({'pathname':iJ['pathname'],'baseURL':iI['origin']})['exec'](iI['href'])?.['pathname']['groups']['id'];if(iK)return{'type':iJ['type'],'id':iK};}return null;},iy=(iH,iI)=>{const l0=kZ;let iJ=RegExp('<meta\x5cs+(?:property|name)=[\x22\x27]'+iI+'[\x22\x27]\x5cs+content=[\x22\x27]([^\x22\x27]+)[\x22\x27][^>]*>','i'),iK=iH[l0(0x197)](iJ)?.[0x1];return iK?iv(iK):void 0x0;},iz=async iH=>await ii(iH)['then'](iI=>iI['text']())['catch'](iI=>(iI instanceof Error&&il['debug'](iI['message']),'')),iA=iH=>iH==='4k'?0x870:Number['parseInt'](iH,0xa)||0x0,iB=iH=>{const l1=kZ;let iI=[];for(let [iJ,iK]of Object['entries'](iH??{}))for(let iL of iK)!iL['src']||!iL['type']?.['includes']('mp4')||iI['push']({'quality':iJ,'qualityValue':iA(iJ),'url':iL['src']});return iI['sort']((iM,iN)=>iN['qualityValue']-iM[l1(0x2ae)]),iI[0x0]??null;},iC=async(iH,iI)=>{const l2=kZ;let iJ=await ii('https://www.newgrounds.com/portal/video/'+iI,{'headers':{'X-Requested-With':'XMLHttpRequest'}})['then'](iM=>iM['json']())['catch'](iM=>(iM instanceof Error&&il[l2(0x388)](iM['message']),null)),iK=iB(iJ?.[l2(0x289)]);if(!iK)return il['error']('Could\x20not\x20resolve\x20Newgrounds\x20video\x20source'),[];let iL=await iz(iH);return[{'id':String(iJ?.['id']??iI),'type':'video','title':iw(iJ?.['title'])||'newgrounds_'+iI+'_'+iK['quality'],'author':iw(iJ?.['author']),'description':iL?iy(iL,'og:description'):void 0x0,'posterUrl':iL?iy(iL,'og:image'):void 0x0,'source':{'url':iK['url']}}];},iD=iH=>{const l3=kZ;let iI=iH[l3(0x2ac)]('new\x20embedController(');if(iI===-0x1)return;let iJ=iH['indexOf']('[',iI+0x14);if(iJ===-0x1)return;let iK=0x0,iL=!0x1,iM=!0x1;for(let iN=iJ;iN<iH['length'];iN+=0x1){let iO=iH[iN];if(iL){iM?iM=!0x1:iO==='\x5c'?iM=!0x0:iO==='\x22'&&(iL=!0x1);continue;}if(iO==='\x22'){iL=!0x0;continue;}if(iO==='['){iK+=0x1;continue;}if(iO===']'&&(--iK,iK===0x0))return iH['slice'](iJ,iN+0x1);}},iE=iH=>{let iI=iD(iH);if(!iI)return[];try{return JSON['parse'](iI);}catch(iJ){return iJ instanceof Error&&il['debug'](iJ['message']),[];}},iF=iH=>{let iI=iH['split'](',\x22params\x22:{')[0x1]?.['split'](',\x22images\x22:')[0x0];if(!iI)return null;try{return JSON['parse']('{'+iI+'}');}catch(iJ){return iJ instanceof Error&&il['debug'](iJ['message']),null;}},iG=async(iH,iI)=>{const l4=kZ;let iJ=await iz(iH);if(!iJ)return il[l4(0x264)]('Failed\x20to\x20fetch\x20Newgrounds\x20audio\x20page'),[];let iK=iF(iJ),iL=iK?void 0x0:iE(iJ)[l4(0x392)](iN=>iN['params']?.[l4(0x1e6)]||iN['url']||iN['description']==='Audio\x20File'),iM=iK?.['filename']??iL?.['url']??iy(iJ,'og:audio');return iM?[{'id':iI,'type':'audio','title':iw(iK?.['name'])||iy(iJ,'og:title')||'newgrounds_'+iI,'author':iw(iK?.['artist']),'description':iy(iJ,'og:description'),'posterUrl':iy(iJ,'og:image')??iK?.['icon'],'source':{'url':iM}}]:(il['error']('Could\x20not\x20resolve\x20Newgrounds\x20audio\x20source'),[]);};ig['exports']=iu({async 'getEntries'({url:iH}){let iI=ix(iH);return iI?iI['type']==='audio'?await iG(iH,iI['id']):await iC(iH,iI['id']):(il['error']('Could\x20not\x20extract\x20Newgrounds\x20media\x20id'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie[l5(0x36b)],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Newgrounds','icon':'https://play-lh.googleusercontent.com/MVSKy2RjqK0h-OKyI_tV2BdBgeicfIRFkVvuWI3aoJsjBfmER3zrv_-CYe3CH78Pw3yX=s75-rw','matches':['https://newgrounds.com/*','https://*.newgrounds.com/*']},'pkg':{'name':'newgrounds','version':kd(0x2b1),'private':!0x0,'keywords':[kd(0x1e7),'audio'],'homepage':'https://www.newgrounds.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'newgrounds.ts'}},'ntv':{'create':ie=>{const lb=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const l6=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iC=>iC);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it['Input'],iw=it['UrlSource'];it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it[l6(0x329)],it['HLS_FORMATS'],it['MP4'],it['MP3'];let ix=(iC,iD,iE)=>iC[l6(0x25b)](iD)[0x1]?.['split'](iE)[0x0],iy=(iC,iD)=>{const l7=l6;let iE=ix(iC,'<'+iD+'>','</'+iD+'>')?.['trim']();if(!iE)return;let iF=iE['match'](/<!\[CDATA\[(.*?)\]\]>/s);return iF?.[0x1]?iF[0x1]['trim']():iE[l7(0x25b)]('DATA[')[0x1]?.['split'](']')[0x0]?.['trim']()||iE;},iz=async(iC,iD)=>{let iE=await ii(iC);return iE['ok']?await iE['text']():(il['error']('Failed\x20to\x20fetch\x20'+iD+'.\x20Status:\x20'+iE['status']+'\x20'+iE['statusText']),null);},iA=async(iC,iD,iE)=>{const l8=l6;let iF=new URL(iC)['pathname'],iG=new Set();for(let iI of iD['split'](l8(0x1be))){if(!iI['startsWith']('/'))continue;let iJ=iI['split']('\x22')[0x0];!iJ||iJ['length']<=0x1||iJ['includes']('/issues/')||iJ[l8(0x219)](l8(0x39f))||iJ[l8(0x25b)]('/')['length']<=0x2||iG['add'](iC['replace'](iF,'/serial'+iJ));}let iH=[];for(let iK of iG)iH['push'](...await iB(iK,iE));return iH;},iB=async(iC,iD=new Set())=>{const l9=l6;if(iD['has'](iC))return[];iD['add'](iC);let iE=await iz(iC,'NTV\x20page');if(!iE)return[];let iF=ix(iE,'<meta\x20property=\x22ya:ovs:feed_url\x22\x20content=\x22','\x22>')??ix(iE,'<meta\x20property=\x22ya:ovs:feed_url\x22\x20content=\x22',l9(0x31d));if(!iF)return new URL(iC)['pathname']['includes']('/serial')?iA(iC,iE,iD):(il[l9(0x264)]('Could\x20not\x20find\x20video\x20link\x20in\x20the\x20page.'),[]);let iG=iF['split']('video/')[0x1]?.['split']('/')[0x0];if(!iG)return il['error']('Could\x20not\x20parse\x20NTV\x20video\x20id.'),[];let iH=await iz('https://www.ntv.ru/vi'+iG+'/','NTV\x20XML\x20metadata');if(!iH)return[];let iI=iy(iH,'dash')||iy(iH,'hls'),iJ=iy(iH,'file')||iy(iH,'video'),iK=iy(iH,'hifile')||iy(iH,'hd_video')||iI||iJ;if(!iK)return il['error']('Could\x20not\x20resolve\x20NTV\x20media\x20URL.'),[];let iL=ix(iH,'<embed_tag>','</embed_tag>')||'NTV',iM=ix(iE,l9(0x3c5),'\x22'),iN=iM?.[l9(0x219)]('серия')?iM['split']('-')[0x0]:void 0x0,iO=iN?parseInt(iN,0xa):void 0x0,iP=ix(iH,'<subtitles>',l9(0x1e5)),iQ=iP?'https://www.ntv.ru'+iP:void 0x0;return iQ&&il['debug']('Subtitles:\x20'+iQ),[{'type':iO?'episode':'video','title':iL,'seasonNumber':iO?0x1:void 0x0,'episodeNumber':iO,'source':{'url':iK},'context':iQ?{'subtitles':[{'url':iQ,'language':'ru','label':'Russian'}]}:void 0x0}];};ig['exports']=iu({'getEntries'({url:iC}){return iB(iC,new Set());},'resolveEntry'({entry:iC}){const la=l6;if(!iC['source']?.['url'])throw Error('NTV\x20entry\x20is\x20missing\x20source\x20URL');let iD=new iv({'source':new iw(iC['source']['url'])}),iE=iC['context']?.['subtitles']??[];for(let iF of iE)iD['addSubtitleTrack'](new iw(iF['url']),{'languageCode':iF['language'],'name':iF[la(0x261)]});return{'entry':iC,'input':iD};}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie[lb(0x1f2)],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'НТВ','icon':'https://static.ntv.ru/static/images/logo.png','matches':[kd(0x339),'https://*.ntv.ru/*']},'pkg':{'name':'ntv','version':'0.0.9','private':!0x0,'keywords':['tv-channels'],'homepage':'https://www.ntv.ru/','author':{'name':kd(0x1f0),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'ntv.ts'}},'ok':{'create':ie=>{const lf=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lc=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iD=>iD);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it[lc(0x25e)],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'ultra':'2160','quad':'1440','full':'1080','hd':lc(0x343),'sd':'480','low':'360','lowest':'240','mobile':'144'},iw=[lc(0x3a1),'/videoembed/:id{/}?'],ix={'Referer':'https://ok.ru/','User-Agent':'Azot'},iy=iD=>iD['replaceAll']('&quot;','\x22')[lc(0x2f2)](lc(0x1f8),'\x22')[lc(0x2f2)]('&lt;','<')['replaceAll']('&gt;','>')['replaceAll']('&#38;','&')['replaceAll']('&amp;','&'),iz=iD=>{let iE=new URL(iD);for(let iF of iw){let iG=new URLPattern({'pathname':iF,'baseURL':iE['origin']})['exec'](iD)?.['pathname']['groups']['id'];if(iG)return iG;}},iA=iD=>{const ld=lc;let iE=(iD['match'](/<div\b[^>]*\bdata-module=(["'])OKVideo\1[^>]*>/)?.[0x0])?.['match'](/\bdata-options=(["'])(.*?)\1/)?.[0x2];if(!iE)return null;try{let iF=JSON[ld(0x220)](iy(iE))['flashvars']?.['metadata'];return iF?JSON['parse'](iF):null;}catch(iG){return il['error']('Failed\x20to\x20parse\x20OK\x20video\x20metadata',iG),null;}},iB=iD=>{let iE=iD?.['replace']('p','')['trim']();return iE==='max'?void 0x0:iE;},iC=(iD,iE)=>{let iF=iB(iE),iG=iD['filter'](iH=>iH['url']&&!iH['disallowed']);if(!iG['length'])return null;if(iF){let iH=iG['find'](iI=>iv[iI['name']]===iF);if(iH)return iH;}return iG[iG['length']-0x1]??null;};ig['exports']=iu({async 'getEntries'({url:iD,options:iE}){const le=lc;let iF=iz(iD);if(!iF)return il['error']('Could\x20not\x20extract\x20OK\x20video\x20id'),[];let iG=await ii('https://ok.ru/video/'+iF,{'headers':ix})['then'](iJ=>iJ['text']())['catch'](()=>'');if(!iG)return il['error'](le(0x24f)),[];let iH=iA(iG);if(!iH)return il['error']('Could\x20not\x20find\x20OK\x20video\x20metadata'),[];if(iH['provider']!=='UPLOADED_ODKL')return il['error']('Only\x20uploaded\x20OK\x20videos\x20are\x20supported'),[];if(iH['movie']?.['is_live']||iH['movie']?.['isLive'])return il['error']('Live\x20videos\x20are\x20not\x20supported'),[];let iI=iC(iH[le(0x187)]??[],iE['videoQuality']);return iI?.['url']?[{'type':'video','title':iH['movie']?.['title']?.['trim']()||'ok_'+iF,'author':(iH['author']?.['name']||iH['compilationTitle'])?.['trim'](),'source':{'url':iI[le(0x1aa)],'headers':ix}}]:(il['error']('Could\x20not\x20resolve\x20OK\x20video\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie[lf(0x2d3)],ie['console'],ie['prompt'],ie['alert'],ie[lf(0x28b)],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Одноклассники','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/6e/62/54/6e62540e-10d6-7d4c-f9cf-8a7b082692cb/Placeholder.mill/400x400bb-75.webp','matches':['https://ok.ru/*','https://*.ok.ru/*']},'pkg':{'name':'ok','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://ok.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'ok.ts'}},'pinterest':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lg=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iL=>iL);let iu=it[lg(0x32d)];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it[lg(0x25e)],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'Referer':lg(0x1f9)},iw={...iv,'X-Pinterest-PWS-Handler':'www/[username].js'},ix=iL=>iL['replaceAll']('&amp;','&')[lg(0x2f2)]('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),iy=iL=>new URL(iL)['pathname']['match'](/\/pin\/(?:[\w-]+--)?(\d+)/)?.[0x1]??null,iz=iL=>iL['match'](/pinterest\.[^/]+\/pin\/(?:[\w-]+--)?(\d+)/)?.[0x1]??iL['match'](/"id"\s*:\s*"(\d+)"/)?.[0x1]??null,iA=async iL=>{let iM=new URL(iL);if(iM['hostname']==='pin.it'||iM['hostname']['endsWith']('.pin.it')){let iN=iM['pathname']['split']('/')['filter'](Boolean)[0x0];if(!iN)return null;let iO=await ii('https://api.pinterest.com/url_shortener/'+iN+'/redirect/',{'headers':iv,'redirect':'follow'})['catch'](()=>null),iP=iO?.['url']||iO?.['headers']['get']('location');if(iP){let iR=iy(new URL(iP,'https://www.pinterest.com/')['href']);if(iR)return iR;}let iQ=iO?await iO['text']()['catch'](()=>''):'';return iQ?iz(iQ):null;}return iy(iL);},iB=async iL=>{const lh=lg;let iM=new URL('https://www.pinterest.com/resource/PinResource/get/');iM['searchParams'][lh(0x2b9)]('data',JSON['stringify']({'options':{'field_set_key':'unauth_react_main_pin','id':iL}}));let iN=await ii(iM,{'headers':iw})['catch'](iP=>(iP instanceof Error&&il['debug'](iP['message']),null));if(!iN?.['ok'])return il['debug']('Pinterest\x20API\x20request\x20failed'+(iN?':\x20'+iN['status']+'\x20'+iN['statusText']:'')),null;let iO=await iN[lh(0x222)]()['catch'](()=>null);return iO?.['resource_response']?.['status']&&iO['resource_response']['status']!=='success'&&il['debug']('Pinterest\x20API\x20status:\x20'+iO['resource_response']['status']),iO?.['resource_response']?.['data']??null;},iC=iL=>iL['story_pin_data']?.['pages']?.['flatMap'](iM=>iM['blocks']??[])['map'](iM=>iM['video']?.['video_list'])['filter'](iM=>!!iM)??[],iD=iL=>{let iM=[iL['videos']?.['video_list'],...iC(iL)]['filter'](iO=>!!iO),iN=new Map();for(let iO of iM)for(let [iP,iQ]of Object['entries'](iO))!iQ?.['url']||iN['has'](iQ['url'])||iN['set'](iQ['url'],{...iQ,'formatId':iP});return[...iN['values']()];},iE=iL=>{try{return new URL(iL)['pathname']['endsWith']('.mp4');}catch{return iL['includes']('.mp4');}},iF=iL=>(iL['width']??0x0)*(iL[lg(0x1dc)]??0x0)+(iL[lg(0x301)]??0x0)/0x3e8,iG=iL=>{let iM=iL['filter'](iP=>iE(iP['url']??'')),iN=iM['length']?iM:iL,iO;for(let iP of iN)(!iO||iF(iP)>iF(iO))&&(iO=iP);return iO??null;},iH=(iL,iM)=>iM?.['thumbnail']??iL['images']?.['orig']?.['url']??Object[lg(0x308)](iL['images']??{})['find'](Boolean)?.[lg(0x1aa)],iI=iL=>{const li=lg;let iM=[...iL['matchAll'](/"url"\s*:\s*"((?:https?:)?\\?\/\\?\/v1\.pinimg\.com\/videos\/[^"]+)"/g)]['map'](iN=>ix(iN[0x1][li(0x2f2)]('\x5c/','/')))['map'](iN=>iN['startsWith']('//')?'https:'+iN:iN);return iM['find'](iE)??iM[0x0]??null;},iJ=iL=>{const lj=lg;let iM=iL[lj(0x197)](/<title[^>]*>([^<]+)<\/title>/)?.[0x1]?.['trim']();return iM?ix(iM)['split']('|')[0x0]?.['trim']()||iM:null;},iK=async iL=>{let iM=await ii('https://www.pinterest.com/pin/'+iL+'/',{'headers':iv})['catch'](()=>null);return iM?.['ok']?await iM['text']():null;};ig[lg(0x24d)]=iu({async 'getEntries'({url:iL}){const lk=lg;let iM=await iA(iL);if(!iM)return il['error']('Could\x20not\x20extract\x20Pinterest\x20pin\x20id'),[];let iN=await iB(iM),iO=iN?iG(iD(iN)):null,iP=iO?.['url']??null,iQ=iN?.['title']?.['trim']()||iN?.['grid_title']?.['trim']()||iN?.['description']?.[lk(0x277)]()||null;if(!iP){let iR=await iK(iM);iP=iR?iI(iR):null,iQ??=iR?iJ(iR):null;}return iP?[{'id':iM,'title':iQ||'pinterest_'+iM,'description':iN?.['seo_description']||iN?.['description'],'posterUrl':iN?iH(iN,iO):void 0x0,'source':{'url':iP,'headers':iv}}]:(il['error']('Could\x20not\x20resolve\x20Pinterest\x20video\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Pinterest','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/70/20/34/702034fc-5fc4-c18f-92fa-881ed14f0c47/Placeholder.mill/400x400bb-75.webp','matches':['https://pinterest.com/*','https://*.pinterest.com/*',kd(0x340),'https://*.pin.it/*']},'pkg':{'name':'pinterest','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://www.pinterest.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'pinterest.ts'}},'qq':{'create':ie=>{const lr=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const ll=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iO=>iO);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it[ll(0x312)],it[ll(0x25e)],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it[ll(0x33a)],it[ll(0x1e2)],it['MP3'];let iv='3.2.19.333',iw=['11','2','1'],ix='shd',iy={'Referer':'https://v.qq.com/'},iz=iO=>{let iP=(iO['match'](/QZOutputJson=([\s\S]*?)\s*;?\s*$/)?.[0x1]??iO)['trim']();try{return JSON['parse'](iP);}catch(iQ){return il['debug'](iQ instanceof Error?iQ['message']:String(iQ)),null;}},iA=async(iO,iP)=>await ii(iO,{'headers':iP})['then'](iQ=>iQ['text']())['then'](iQ=>iz(iQ))['catch'](iQ=>(iQ instanceof Error&&il['debug'](iQ['message']),null)),iB=iO=>{const lm=ll;let iP=new URL(iO),iQ=iP['searchParams']['get']('vid');if(iQ)return iQ;let iR=new URLPattern({'pathname':'/x/:kind(page|cover){/:seriesId}?/:id.html','baseURL':iP['origin']})[lm(0x1d5)](iO)?.['pathname']['groups']['id'];return iR&&iR['length']===0xb?iR:iP['pathname']['split']('/')['filter'](Boolean)['findLast'](iS=>/^\w{11}(?:\.html)?$/['test'](iS))?.['replace'](/\.html$/,'');},iC=iO=>iD(iO)?.['videoArr']?.['map'](iP=>iP['vid']||iP['videoId'])['find'](Boolean)??[/\bvid["']?\s*[:=]\s*["']?\s*(\w{11})/,/\bvideoId["']?\s*[:=]\s*["']?\s*(\w{11})/,/\bvid=(\w{11})/,/\/x\/(?:page|cover)\/(?:\w+\/)?(\w{11})\.html/]['map'](iP=>iO['match'](iP)?.[0x1])['find'](Boolean),iD=iO=>{let iP=iO['match'](/window\.DATA\s*=\s*({[\s\S]*?})\s*;/)?.[0x1];if(!iP)return null;try{return JSON['parse'](iP);}catch(iQ){return il['debug'](iQ instanceof Error?iQ['message']:String(iQ)),null;}},iE=async iO=>iB(iO)||iC(await ii(iO,{'headers':iy})['then'](iP=>iP['text']())['catch'](()=>'')),iF=(iO,iP,iQ)=>{let iR=new URL('https://vv.video.qq.com/getinfo');return iR['search']=new URLSearchParams({'otype':'json','platform':iQ,'defnpayver':'1','appver':iv,'defn':iP,'vid':iO})['toString'](),iR;},iG=async(iO,iP='shd')=>{for(let iQ of iw){let iR=await iA(iF(iO,iP,iQ),iy);if(iR?.['vl']?.['vi']?.[0x0]&&!iR['msg'])return{'info':iR,'platform':iQ};}return null;},iH=(iO,iP,iQ,iR)=>{let iS=new URL('https://vv.video.qq.com/getkey');return iS['search']=new URLSearchParams({'otype':'json','platform':iR,'appver':iv,'filename':iQ,'vid':iO,'format':String(iP)})['toString'](),iS;},iI=iO=>iO?.['find'](iP=>iP[ll(0x1aa)]&&!iP[ll(0x1aa)]['includes']('vip'))?.[ll(0x1aa)]??iO?.['find'](iP=>iP['url'])?.['url'],iJ=(iO,iP)=>{let iQ=iO['split']('.'),iR=iP>0x186a0?'m':iP>0x2710?'p':'';if(!iR)return/^[pm]\d+$/['test'](iQ[0x1]??'')&&iQ['splice'](0x1,0x1),{'parts':iQ,'clips':0x0};let iS=''+iR+iP%0x2710;return/^[pm]\d+$/['test'](iQ[0x1]??'')?iQ[0x1]=iS:iQ['splice'](0x1,0x0,iS),{'parts':iQ,'clips':iR==='p'?void 0x0:0x0};},iK=(iO,iP,iQ)=>{const ln=ll;let {parts:iR,clips:iS}=iJ(iO,iP);if(iS===0x0)return[iR['join']('.')];let iT=Math[ln(0x319)](iQ,0x1),iU=[];iR['splice'](-0x1,0x0,'1');for(let iV=0x1;iV<=iT;iV+=0x1)iR[iR['length']-0x2]=String(iV),iU['push'](iR['join']('.'));return iU;},iL=async(iO,iP,iQ,iR,iS,iT)=>{let iU=await iA(iH(iP,iQ,iR,iT)),iV=iU?.['key']||iS;if(!(!iV||iU?.['msg']==='not\x20pay'))return''+iO+iR+'?vkey='+iV;},iM=async(iO,iP,iQ,iR)=>{const lo=ll;if(!iP['fn']||!iQ['id'])return null;let iS=(iQ[lo(0x352)]==='shd'?{'info':null}:await iG(iO,iQ['name']))?.['info']?.['vl']?.['vi']?.[0x0]??iP,iT=iI(iS['ul']?.['ui'])??iI(iP['ul']?.['ui']);if(!iT)return null;let iU=iK(iS['fn']??iP['fn'],iQ['id'],iS['cl']?.['fc']??0x0),iV=(await Promise['all'](iU['map'](iW=>iL(iT,iO,iQ['id'],iW,iS['fvkey']??iP['fvkey'],iR))))['filter'](iW=>!!iW);return iV['length']===0x0?null:{'title':iS['ti']||iP['ti']||'qq_'+iO,'format':iQ,'partUrls':iV,'score':iQ['bandwidth']??iQ['fs']??0x0};},iN=async iO=>{const lp=ll;let iP=await iG(iO);if(!iP)return null;let iQ=iP['info']['vl']?.['vi']?.[0x0],iR=iP['info']['fl']?.['fi']?.['filter'](iT=>iT['id']&&iT['name'])??[];if(!iQ||iR['length']===0x0)return iP['info']['msg']&&il['error'](iP['info'][lp(0x28d)]),null;let iS=(await Promise['all'](iR['map'](iT=>iM(iO,iQ,iT,iP['platform']))))[lp(0x254)](iT=>!!iT);return iS['sort']((iT,iU)=>iU[lp(0x3a6)]-iT['score']),iS[0x0]??null;};ig['exports']=iu({async 'getEntries'({url:iO}){const lq=ll;let iP=await iE(iO);if(!iP)return il['error']('Could\x20not\x20extract\x20Tencent\x20Video\x20id'),[];let iQ=await iN(iP);if(!iQ)return il['error']('Could\x20not\x20resolve\x20Tencent\x20Video\x20streams'),[];let iR=iQ[lq(0x334)]['resolution']||iQ['format']['cname']||iQ['format']['name'],iS=[iQ['title'],iR]['filter'](Boolean)['join']('\x20-\x20');return iQ['partUrls']['length']===0x1?[{'type':'video','title':iS,'source':{'url':iQ['partUrls'][0x0],'headers':iy}}]:iQ['partUrls']['map']((iT,iU)=>({'type':lq(0x1d4),'title':iS+'\x20-\x20Part\x20'+(iU+0x1),'source':{'url':iT,'headers':iy}}));}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie[lr(0x2d3)],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig[lr(0x24d)]['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'QQ\x20/\x20Tencent\x20Video','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/02/7e/6e/027e6e02-a9e8-eddc-6d48-c690dd1ab465/Placeholder.mill/400x400bb-75.webp','matches':['https://v.qq.com/*','https://*.v.qq.com/*','https://news.qq.com/*']},'pkg':{'name':'qq','version':kd(0x2b1),'private':!0x0,'keywords':['video-hostings'],'homepage':'https://v.qq.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'qq.ts'}},'rambler':{'create':ie=>{const ly=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lt=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iF=>iF);let iu=it['defineExtension'];it['version'],it[lt(0x31c)],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it[lt(0x1e2)],it['MP3'];let iv=lt(0x1e9),iw=iF=>iF['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),ix=(iF,iG)=>{let iH=0x0,iI=!0x1,iJ=!0x1;for(let iK=iG;iK<iF['length'];iK+=0x1){let iL=iF[iK];if(iI){iJ?iJ=!0x1:iL==='\x5c'?iJ=!0x0:iL==='\x22'&&(iI=!0x1);continue;}if(iL==='\x22'){iI=!0x0;continue;}if(iL==='{'){iH+=0x1;continue;}if(iL==='}'&&(--iH,iH===0x0))return iF['slice'](iG,iK+0x1);}},iy=iF=>{let iG=iF['indexOf']('window.__PRELOADED_STATE__');if(iG===-0x1)return null;let iH=iF['indexOf']('=',iG),iI=iH===-0x1?-0x1:iF['indexOf']('{',iH);if(iI===-0x1)return null;let iJ=ix(iF,iI)?.['replaceAll'](/new Date\("[^"]*"\)/g,'\x22\x22')['replaceAll'](/:\s*undefined([,}])/g,':null$1');if(!iJ)return null;try{return JSON['parse'](iJ);}catch(iK){return il['error']('Failed\x20to\x20parse\x20Rambler\x20page\x20state',iK),null;}},iz=function*(iF){if(!(!iF||typeof iF!='object')){if('video'in iF&&(yield iF),Array['isArray'](iF)){for(let iG of iF)yield*iz(iG);return;}for(let iH of Object['values'](iF))yield*iz(iH);}},iA=iF=>{const lu=lt;let iG=iF?.['commonData']?.['entries']?.['entities'];for(let iH of iz(iG))if(iH[lu(0x1d4)]?.['recordId'])return iH;},iB=iF=>{const lv=lt;let iG=iF[lv(0x197)](/"recordId"\s*:\s*"([^"]+)"/)?.[0x1]??iF['match'](/data-id="(record::[^"]+)"/)?.[0x1]??iF[lv(0x197)](/(?:[?&]|&amp;)(?:uuid|id)=(record(?:::|%3A%3A)[a-f0-9-]+)/i)?.[0x1];return iG?decodeURIComponent(iw(iG)):void 0x0;},iC=iF=>{let iG=iF['match'](/<meta property="og:image" content="([^"]+)"/)?.[0x1];return iG?iw(iG):void 0x0;},iD=iF=>{let iG=iF['match'](/<meta property="og:title" content="([^"]+)"/)?.[0x1]??iF['match'](/<title[^>]*>(.*?)<\/title>/s)?.[0x1];return iG?iw(iG)['replace'](/\s+-\s+Рамблер\/.+$/,'')['trim']():void 0x0;},iE=async iF=>{const lw=lt;let iG=new URL('https://api.vp.rambler.ru/api/v3/records/getPlayerData');iG['searchParams']['set'](lw(0x361),JSON['stringify']({'uuid':iF}));let iH=await ii(iG)[lw(0x2b0)](iI=>iI['json']())['catch'](iI=>(iI instanceof Error&&il['debug'](iI['message']),null));if(!iH?.['success']||!iH['result']?.['playList']){let iI=[iH?.['error']?.['type'],iH?.['error']?.['subtype']]['filter'](Boolean)['join'](':\x20');return il['error'](iI||'Could\x20not\x20fetch\x20Rambler\x20player\x20data'),null;}return iH['result']['playList'];};ig['exports']=iu({async 'getEntries'({url:iF}){const lx=lt;let iG=await ii(iF)['then'](iL=>iL['text']())['catch'](iL=>(iL instanceof Error&&il['debug'](iL['message']),''));if(!iG)return il['error']('Failed\x20to\x20fetch\x20Rambler\x20page'),[];let iH=iA(iy(iG)),iI=iH?.['video']?.['recordId']??iB(iG);if(!iI)return il['error']('Could\x20not\x20extract\x20Rambler\x20video\x20id'),[];if(iH?.['video']?.['isLive'])return il['error']('Live\x20videos\x20are\x20not\x20supported'),[];let iJ=await iE(iI),iK=iJ?.['source']??iJ?.['directSource'];return iK?iJ?.['type']==='live'?(il['error']('Live\x20videos\x20are\x20not\x20supported'),[]):[{'id':iJ['uuid']??iI,'type':'video','title':iJ['title']?.['trim']()||iH?.['title']?.['trim']()||iD(iG)||iI,'posterUrl':iJ[lx(0x3ac)]??iJ['snapshot']??iH?.['image']?.[lx(0x1aa)]??iC(iG),'url':iF,'source':{'url':iK}}]:(il['error']('Could\x20not\x20resolve\x20Rambler\x20media\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie[ly(0x1fc)],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[ly(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Рамблер','icon':'https://cdn-1.webcatalog.io/catalog/rambler-ru/rambler-ru-icon-filled-256.webp?v=1714782637284','matches':['https://rambler.ru/*','https://*.rambler.ru/*']},'pkg':{'name':'rambler','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://www.rambler.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'rambler.ts'}},'rbc':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lz=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iv=>iv);let iu=it[lz(0x32d)];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it[lz(0x25e)],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'],ig[lz(0x24d)]=iu({async 'getEntries'({url:iv}){let iw=await ii(iv);if(!iw['ok'])throw Error('Failed\x20to\x20fetch\x20RBC\x20page:\x20'+iw['status']+'\x20'+iw['statusText']);let ix=(await iw['text']())['match'](/(?:https?:)?\/\/[^\s"'<>]+\.m3u8(?:\?[^\s"'<>]*)?/i)?.[0x0];if(!ix)throw Error('Could\x20not\x20find\x20RBC\x20playlist\x20URL.');return[{'type':'video','source':{'url':ix['startsWith']('//')?'https:'+ix:ix}}];}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'РБК','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/95/bc/9c/95bc9c01-05ee-54ac-5714-555a5081e4e8/Placeholder.mill/400x400bb-75.webp','matches':['https://rbc.ru/*','https://*.rbc.ru/*']},'pkg':{'name':'rbc','version':kd(0x1a3),'private':!0x0,'keywords':['news'],'homepage':'https://rbc.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':kd(0x22a)}],'type':'module','main':'rbc.ts'}},'reddit':{'create':ie=>{const lF=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lA=b;let it=ih??Streamyx??{};it&&(it[lA(0x32d)]||=iP=>iP);let iu=it['defineExtension'];it['version'],it[lA(0x31c)],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it['Input'],iw=it[lA(0x2e0)];it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it[lA(0x329)],it[lA(0x33a)],it['MP4'],it['MP3'];let ix={'Accept':'application/json','Referer':'https://www.reddit.com/'},iy={...ix,'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'},iz={'Referer':'https://www.reddit.com/'},iA=iP=>iP['replaceAll']('&amp;','&')[lA(0x2f2)]('&quot;','\x22')['replaceAll'](lA(0x39e),'\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),iB=async iP=>(await ii(iP,{'headers':ix,'redirect':'follow'})['catch'](()=>null))?.['url']||iP,iC=async iP=>{let iQ=new URL(await iB(iP));for(let iR of['/:kind(r|user)/:name/comments/:id{/*}?','/comments/:id{/*}?','/video/:id{/*}?']){let iS=new URLPattern({'pathname':iR,'baseURL':iQ['origin']})['exec'](iQ['href'])?.['pathname']['groups']['id'];if(iS)return{'id':iS,'url':iQ['href']};}return{'id':void 0x0,'url':iQ['href']};},iD=iP=>lA(0x218)+iP+'.json',iE=(iP,iQ)=>iP['match'](RegExp('name=\x22'+iQ+'\x22\x20value=\x22([^\x22]*)\x22'))?.[0x1],iF=async iP=>{const lB=lA;let iQ=await ii(iP,{'headers':iy})['then'](iV=>iV[lB(0x2f3)]())['catch'](()=>''),iR=iQ['match'](/await\(async e=>e\+e\)\("([^"]+)"\)/)?.[0x1],iS=iE(iQ,'token'),iT=iQ['match'](/<form hidden method="GET" action="([^"]+)"/)?.[0x1];if(!iR||!iS||!iT)return!0x1;let iU=new URL(iT,'https://www.reddit.com');return iU['searchParams']['set']('solution',iR+iR),iU[lB(0x28e)][lB(0x2b9)]('js_challenge',iE(iQ,'js_challenge')||'1'),iU['searchParams']['set']('token',iS),iU['searchParams']['set']('jsc_orig_r',iE(iQ,'jsc_orig_r')||''),(await ii(iU,{'headers':iy,'redirect':lB(0x29b)})['catch'](()=>null))?.['ok']??!0x1;},iG=iP=>iP?.['secure_media']?.['reddit_video']??iP?.['media']?.['reddit_video']??iP?.['crosspost_parent_list']?.['find'](iQ=>iQ['secure_media']?.['reddit_video']??iQ['media']?.['reddit_video'])?.['secure_media']?.['reddit_video']??iP?.['crosspost_parent_list']?.['find'](iQ=>iQ['secure_media']?.['reddit_video']??iQ['media']?.['reddit_video'])?.['media']?.['reddit_video'],iH=(iP,iQ)=>new URLPattern({'pathname':'/:id{/*}?','baseURL':'https://v.redd.it'})['exec'](iP)?.['pathname']['groups']['id']??iQ,iI=iP=>iA(iP)['split']('?')[0x0],iJ=async iP=>(await ii(iP,{'method':'HEAD','headers':iz})['catch'](()=>null))?.['ok']??!0x1,iK=iP=>{const lC=lA;let iQ=iI(iP),iR=new URL(iQ),iS=iR[lC(0x2f6)]+'/'+iR['pathname']['split']('/')['filter'](Boolean)[0x0],iT=iQ['includes']('_')?iQ['split']('_')[0x0]:iS;return[iS+'/DASH_audio.mp4',iT+'_audio.mp4',iT+'_AUDIO_128.mp4',iT+'_AUDIO_64.mp4'];},iL=async iP=>{for(let iQ of iK(iP))if(await iJ(iQ))return iQ;},iM=async iP=>await ii(iD(iP),{'headers':ix})['then'](iQ=>iQ[lA(0x222)]())['catch'](()=>null),iN=async(iP,iQ)=>{let iR=await iM(iP);if(!iR&&await iF(iQ)&&(iR=await iM(iP)),!iR){il['debug']('Failed\x20to\x20fetch\x20Reddit\x20JSON\x20metadata');return;}return iR?.[0x0]?.['data']?.['children']?.[0x0]?.['data'];},iO=async iP=>{let iQ=await ii(iP,{'headers':iy})['then'](iS=>iS['text']())['catch'](iS=>(iS instanceof Error&&il['debug'](iS['message']),null));if(!iQ)return;let iR=iQ['match'](/<script id="data">window\.___r = (.+?)<\/script>/)?.[0x1];if(iR)try{return JSON['parse'](iA(iR));}catch{return;}};ig['exports']=iu({async 'getEntries'({url:iP}){const lD=lA;let {id:iQ,url:iR}=await iC(iP);if(!iQ)return il[lD(0x264)]('Could\x20not\x20extract\x20Reddit\x20post\x20id'),[];let iS=await iN(iQ,iR)??await iO(iR);if(!iS)return il['error']('Failed\x20to\x20fetch\x20Reddit\x20post\x20metadata'),[];let iT=iG(iS),iU=iT?.[lD(0x38c)];if(!iU)return il['error']('Could\x20not\x20resolve\x20Reddit\x20video\x20URL'),[];let iV=iI(iU),iW=await iL(iV),iX=iH(iV,iS['id']??iQ),iY=iT?.['width']&&iT?.['height']?'_'+iT['width']+'x'+iT['height']:'';return[{'id':iX,'type':'video','title':iS['title']?.[lD(0x277)]()||'reddit_'+iQ+iY,'description':iS[lD(0x243)],'author':iS[lD(0x2d1)],'posterUrl':iS['thumbnail']?.['startsWith']('http')?iA(iS['thumbnail']):void 0x0,'source':{'url':iV,'headers':iz},'context':{'audioUrl':iW,'headers':iz}}];},async 'resolveEntry'({entry:iP}){const lE=lA;if(!iP['source']?.['url'])throw Error('Reddit\x20entry\x20is\x20missing\x20source\x20URL');let iQ=iP['context']?.['headers']??iz,iR=new iv({'source':new iw(iP['source']['url'],{'requestInit':{'headers':iQ}})});return iP['context']?.[lE(0x30e)]&&await iR['addAudioTracks'](new iw(iP['context']['audioUrl'],{'requestInit':{'headers':iQ}})),{'entry':iP,'input':iR};}});})(ie['Azot'],ie['fetch'],ie[lF(0x2e4)],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[lF(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Reddit','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/2a/9f/3c/2a9f3c3c-b422-642e-b2e9-d2efe02e9df7/Placeholder.mill/400x400bb-75.webp','matches':['https://reddit.com/*',kd(0x30b)]},'pkg':{'name':'reddit','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://www.reddit.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':kd(0x231),'main':'reddit.ts'}},'rutube':{'create':ie=>{const lJ=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lG=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iy=>iy);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it[lG(0x25d)],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it[lG(0x32c)],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=['/video/:id{/}?','/play/embed/:id{/}?','/shorts/:id{/}?',lG(0x190),'/video/private/:id{/}?'],iw=iy=>{let iz={'yappyId':'','id':'','key':''};iz['key']=new URL(iy)['searchParams']['get']('p')??'';for(let iA of iv){let iB=new URLPattern(iA,'https://rutube.ru')['exec'](iy);iB&&(Object['assign'](iz,iB['pathname']['groups']),Object['assign'](iz,iB['search']['groups']));}return iz;},ix=async iy=>{const lH=lG;let iz=(await ii('https://rutube.ru/pangolin/api/web/yappy/yappypage/?client=wdp&videoId='+iy+'&page=1&page_size=15')['then'](iA=>iA['json']())['catch'](()=>null))?.['results']?.['find'](iA=>String(iA['id'])===iy)?.['link'];return iz?[{'type':'video','title':'rutube_yappy_'+iy,'source':{'url':iz}}]:(il[lH(0x264)]('ErrorEmptyDownload'),[]);};ig['exports']=iu({async 'getEntries'({url:iy}){const lI=lG;let iz=iw(iy);if(iz['yappyId'])return ix(iz[lI(0x207)]);if(!iz['id'])return il['error']('Could\x20not\x20extract\x20Rutube\x20video\x20id'),[];let iA=new URL('https://rutube.ru/api/play/options/'+iz['id']+'/?no_404=true&referer&pver=v2');iz['key']&&iA['searchParams']['set']('p',iz[lI(0x2a8)]);let iB=await ii(iA)['then'](iC=>iC['json']())['catch'](iC=>(iC instanceof Error&&il['debug'](iC['message']),null));return iB?iB[lI(0x35f)]||!iB['video_balancer']?.['m3u8']?(il['error'](lI(0x24c)),[]):iB['live_streams']?.['hls']?(il['error']('Live\x20videos\x20are\x20not\x20supported'),[]):[{'type':'video','title':iB[lI(0x21d)]?.[lI(0x277)]()||'rutube_'+iz['id'],'source':{'url':iB['video_balancer']['m3u8']}}]:(il['error']('Cannot\x20fetch\x20play\x20info'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie[lJ(0x1fc)],ie[lJ(0x28b)],ie[lJ(0x36b)],ie['window']),ig['exports'][lJ(0x376)]||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'RUTUBE','icon':'https://static.rustore.ru/imgproxy/vcyBc0LG-3ybXcGs_-_OJXH9ULjoegHlLs-DacemG08/preset:app_card_icon/aHR0cHM6Ly9zdGF0aWMucnVzdG9yZS5ydS9hcGsvMjQ2MjA3L2NvbnRlbnQvSUNPTi9hNTZhZWJlMy01NjVhLTRiZjYtOTQyZC0xZjE0OTk0YjlhNmUucG5n.webp','matches':['https://rutube.ru/*','https://*.rutube.ru/*']},'pkg':{'name':'rutube','version':'0.0.13','private':!0x0,'keywords':['video-hostings'],'homepage':'https://rutube.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'rutube.ts'}},'smotrim':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lK=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iD=>iD);let iu=it[lK(0x32d)];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'];let iv=it['Input'],iw=it['UrlSource'];it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it[lK(0x1e2)],it['MP3'];let ix='https://player-api.smotrim.ru/api/v1',iy=(iD,iE)=>{const lL=lK;let iF=new URL(iD);return new URLPattern({'pathname':'/'+iE+'/:id{/}?','baseURL':iF['origin']})[lL(0x1d5)](iD)?.['pathname'][lL(0x1cf)]['id'];},iz=(iD,iE)=>{let iF=iE==='video'?[/playing[_-]video=(\d+)/i,/playing[_-]full_video=(\d+)/i]:[/playing[_-]audio=(\d+)/i],iG=iD['search']+'&'+iD['hash']['replace'](/^#/,'');for(let iH of iF){let iI=iG['match'](iH)?.[0x1];if(iI)return iI;}},iA=iD=>{const lM=lK;let iE=new URL(iD);for(let iF of[lM(0x1d4),'audio']){let iG=iy(iD,iF)??iz(iE,iF);if(iG)return{'id':iG,'kind':iF};}return null;},iB=iD=>iD?.['large']||iD?.['medium']||iD?.['small'],iC=(iD,iE)=>iE==='audio'?iD['streams']?.['mp3']||iD['streams']?.['m3u8']||iD['streams']?.['http']:iD['streams']?.['m3u8']||iD['streams']?.['http'];ig['exports']=iu({async 'getEntries'({url:iD}){const lN=lK;let iE=iA(iD);if(!iE)return il['error']('Could\x20not\x20extract\x20Smotrim\x20media\x20id'),[];let iF=await ii('https://player-api.smotrim.ru/api/v1/'+iE[lN(0x309)]+'/'+iE['id'])['then'](iO=>iO['json']())['catch'](iO=>(iO instanceof Error&&il['debug'](iO['message']),null));if(!iF)return il[lN(0x264)]('Cannot\x20fetch\x20Smotrim\x20media\x20info'),[];if(iF['status']!=='OK'||!iF['data'])return il['error'](iF['notice']||'Smotrim\x20media\x20info\x20is\x20empty'),[];let iG=iF['data'],iH=iC(iG,iE['kind']);if(!iH)return il['error']('Could\x20not\x20resolve\x20Smotrim\x20media\x20URL'),[];let iI=iG['brand']?.['title']?.['trim'](),iJ=iG['title']?.['trim'](),iK=iG['episode']?.['title']?.['trim'](),iL=iI||iJ||'smotrim_'+iE['id'],iM=iE['kind']==='audio'?'audio':iG['episode']?'episode':'video',iN=iG['subtitles']?.['filter'](iO=>iO['vtt'])[lN(0x1b3)](iO=>({'url':iO['vtt'],'language':iO[lN(0x1c0)],'label':iO[lN(0x21d)]}))??[];return[{'id':String(iG['publicId']??iE['id']),'type':iM,'title':iL,'episodeTitle':iK||(iI?iJ:void 0x0),'seasonNumber':iG['episode']?.['season']?.['number'],'episodeNumber':iG[lN(0x19d)]?.['number'],'posterUrl':iB(iG['episode']?.['splash'])||iB(iG['brand']?.[lN(0x2de)]),'year':iG['brand']?.['yearReleasedFrom'],'url':iG['shareLink']||lN(0x185)+iE['kind']+'/'+iE['id'],'source':{'url':iH},'context':iN['length']?{'subtitles':iN}:void 0x0}];},'resolveEntry'({entry:iD}){const lO=lK;if(!iD['source']?.['url'])throw Error('Smotrim\x20entry\x20is\x20missing\x20source\x20URL');let iE=new iv({'source':new iw(iD['source']['url'])}),iF=iD['context']?.['subtitles']??[];for(let iG of iF)iE['addSubtitleTrack'](new iw(iG[lO(0x1aa)]),{'languageCode':iG['language'],'name':iG['label']});return{'entry':iD,'input':iE};}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Смотрим','icon':'https://static.rustore.ru/imgproxy/uH0PgALto0YjcSkOPkEgY_wre6dd04edOXPijHVnQEE/preset:web_app_icon_160/plain/https://static.rustore.ru/2026/3/23/b0/apk/1085375/content/ICON/e9aaac4f-63fa-4a97-a81c-8f27f7ab37e4.png@webp','matches':['https://smotrim.ru/*','https://*.smotrim.ru/*']},'pkg':{'name':'smotrim','version':'0.0.1','private':!0x0,'keywords':['tv-channels','video-hostings'],'homepage':'https://smotrim.ru/','author':{'name':'Azot','url':kd(0x2a1)},'contributors':[{'name':kd(0x399),'email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':kd(0x3a9)}},'snapchat':{'create':ie=>{const lU=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lP=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iI=>iI);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it[lP(0x329)],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'Referer':'https://www.snapchat.com/'},iw=0x1,ix=iI=>iI['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')['replaceAll']('&lt;','<')['replaceAll']('&gt;','>'),iy=iI=>{let iJ=new URL(iI)['pathname']['split']('/')['filter'](Boolean),iK=iJ['indexOf']('spotlight');if(iK!==-0x1)return iJ[iK+0x1];if(iJ[0x0]?.['startsWith']('@'))return iJ[0x2]??iJ[0x1];if(iJ[0x0]==='add')return iJ[0x2];},iz=iI=>{let iJ=new URL(iI)['pathname']['split']('/')['filter'](Boolean);if(iJ[0x0]?.['startsWith']('@'))return iJ[0x0]['slice'](0x1);if(iJ[0x0]==='add')return iJ[0x1];},iA=iI=>{let iJ=iI['match'](/<script id="__NEXT_DATA__" type="application\/json">(.*?)<\/script>/s)?.[0x1];if(!iJ)return null;try{return JSON['parse'](ix(iJ));}catch(iK){return il['error']('Failed\x20to\x20parse\x20Snapchat\x20page\x20data',iK),null;}},iB=iI=>ix(iI['match'](/<link[^>]+rel="preload"[^>]+href="([^"]+)"[^>]+as="video"[^>]*>/)?.[0x1]??iI['match'](/<meta property="og:video" content="([^"]+)"/)?.[0x1]??'')||void 0x0,iC=iI=>iI?.['videoMetadata']?.['name']?.[lP(0x277)]()||void 0x0,iD=(iI,iJ)=>iI?.['videoMetadata']?.['description']||iI?.['description']||iJ?.['value'],iE=iI=>iI?.['videoMetadata']?.['creator']?.['personCreator']?.['name']||iI?.['videoMetadata']?.['creator']?.['personCreator']?.['username'],iF=(iI,iJ)=>{let iK=iI??[],iL=iJ??[];return iK['length']===0x0?iL['map'](iM=>({'metadata':iM})):iK['map']((iM,iN)=>({...iM,'metadata':iM['metadata']??iL[iN]}));},iG=(iI,iJ,iK)=>(iI??[])['filter'](iL=>{const lQ=lP;if(!iJ)return!0x0;let iM=!!iL['story']?.['storyId']?.['value'],iN=!!iL['story']?.['snapList']?.['some'](iO=>iO[lQ(0x1a2)]?.['value']);return!iM&&!iN?!!iL['metadata']?.['videoMetadata']?.['contentUrl']:iL['story']?.['storyId']?.['value']===iJ||iL[lQ(0x2db)]?.['snapList']?.['some'](iO=>iO['snapId']?.['value']===iJ);})['flatMap'](iL=>{const lR=lP;let iM=iL['metadata'],iN=iM?.['videoMetadata']?.['contentUrl'],iO=iL['story']?.['snapList']?.['find'](iR=>iR['snapId']?.['value']===iJ)??iL['story']?.['snapList']?.['find'](iR=>iR[lR(0x355)]===0x1),iP=iN??iO?.['snapUrls']?.['mediaUrl'],iQ=iL[lR(0x2db)]?.['storyId']?.[lR(0x315)]??iO?.['snapId']?.['value']??iJ;return!iP||!iQ?[]:[{'id':iQ,'type':'video','title':iC(iM)||iO?.['snapTitle']?.['trim']()||'snapchat_'+iQ,'description':iD(iM,iK),'posterUrl':iM?.['videoMetadata']?.['thumbnailUrl']??iL['story']?.['thumbnailUrl']?.['value']??iO?.['snapUrls']?.['mediaPreviewUrl']?.['value'],'author':iE(iM),'source':{'url':iP,'headers':iv}}];}),iH=(iI,iJ,iK,iL,iM)=>(iI??[])['filter'](iN=>iN['snapMediaType']===0x1)['filter'](iN=>!iJ||iN['snapId']?.['value']===iJ)['map'](iN=>{const lS=lP;let iO=iN['snapId']?.['value'];return iO&&iN['snapUrls']?.['mediaUrl']?{'id':iO,'type':'video','title':iN['snapTitle']?.['trim']()||iL?.['trim']()||'snapchat_'+(iK??iO),'description':iM?.['value'],'posterUrl':iN['snapUrls']['mediaPreviewUrl']?.[lS(0x315)],'source':{'url':iN['snapUrls']['mediaUrl'],'headers':iv}}:null;})['filter'](iN=>iN!==null);ig['exports']=iu({async 'getEntries'({url:iI}){const lT=lP;let iJ=await ii(iI,{'headers':iv,'redirect':'follow'})[lT(0x234)](iV=>(iV instanceof Error&&il['debug'](iV['message']),null)),iK=await iJ?.['text']();if(!iK)return il['error']('Failed\x20to\x20fetch\x20Snapchat\x20page'),[];let iL=iy(iJ?.['url']||iI),iM=iz(iJ?.['url']||iI),iN=iA(iK),iO=iN?.['props']?.['pageProps'],iP=iN?.['query']?.['snapId']??iN?.['query']?.['snapID'],iQ=iL??iP,iR=iO?.['pageMetadata']?.['pageDescription'],iS=iG([...iO?.['spotlightFeed']?.['spotlightStories']??[],...iF(iO?.['spotlightHighlights'],iO?.['spotlightStoryMetadata'])],iQ,iR);if(iS['length']>0x0)return iS;let iT=iH(iO?.[lT(0x2db)]?.[lT(0x1d3)],iQ,iM??iN?.['query']?.['username']?.['replace'](/^@/,''),iO?.['pageMetadata']?.['pageTitle'],iR);if(iT['length']>0x0)return iT;let iU=iB(iK);return iU&&iQ?[{'id':iQ,'title':'snapchat_'+iQ,'source':{'url':iU,'headers':iv}}]:(il[lT(0x264)]('Could\x20not\x20resolve\x20Snapchat\x20video\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie[lU(0x3b3)],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Snapchat','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/1c/55/7a/1c557a67-2d33-4cb7-9db9-8e49d6d7cfa0/Placeholder.mill/400x400bb-75.webp','matches':['https://snapchat.com/*','https://*.snapchat.com/*']},'pkg':{'name':'snapchat','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://www.snapchat.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'snapchat.ts'}},'soundcloud':{'create':ie=>{const lZ=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const lV=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iA=>iA);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'];let iv=it['utils'];it[lV(0x2fb)],it['UrlSource'],it['CustomPathedSource'],it[lV(0x32c)],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iw={'version':'','id':''},ix=async()=>{const lX=lV;try{let iA=await ii('https://soundcloud.com/')['then'](iD=>iD['text']())['catch'](iD=>{const lW=b;let iE=iD instanceof Error&&iD['cause']!=null?String(iD[lW(0x2da)]):'';return iD instanceof Error&&iE['includes']('ECONNRESET')&&il['warn']('Soundcloud\x20may\x20be\x20blocked\x20in\x20your\x20region.\x20Use\x20proxy\x20or\x20VPN\x20to\x20bypass\x20restrictions.'),'';}),iB=iA['match'](/window\.__sc_version="([0-9]{10})"/)?.[0x1];if(iB&&iw['version']===iB)return iw['id'];let iC=iA['match'](/"hydratable"\s*:\s*"apiClient"\s*,\s*"data"\s*:\s*\{\s*"id"\s*:\s*"([^"]+)"/)?.[0x1]??'';for(let iD of iA['matchAll'](/<script.+src="(.+)">/g)){if(iC)break;let iE=iD[0x1];if(!iE?.['startsWith']('https://a-v2.sndcdn.com/'))continue;let iF=await ii(iE)['then'](iH=>iH[lX(0x2f3)]())['catch'](()=>''),iG=iF['match'](/\("client_id=([A-Za-z0-9]{32})"\)/)?.[0x1]??iF['match'](/,client_id:"([A-Za-z0-9]{32})",/)?.[0x1]??iF['match'](/client_id=([A-Za-z0-9]{32})/)?.[0x1];if(iG){iC=iG;break;}}return iB&&(iw['version']=iB,iw['id']=iC),iC;}catch{return'';}},iy=iA=>iA['audioCodecs']?.['some'](iB=>iB==='aac'||iB==='mp3')??!0x1,iz=(iA,iB)=>{let iC;for(let iD of iA){let iE=iD['format']?.['protocol'];if(!(iD['snipped']||iE?.['includes']('encrypted'))&&iD['preset']?.['startsWith'](iB+'_')){if(iE==='progressive')return iD;iC=iD;}}return iC;};ig['exports']=iu({async 'getEntries'({url:iA,options:iB}){const lY=lV;let {author:iC,song:iD,accessKey:iE,shortLink:iF}=iv[lY(0x359)](iA,[':author/:song/s-:accessKey',':author/:song',':shortLink'],['https://soundcloud.com','https://on.soundcloud.com'])['pathname'],iG=await ix();if(!iG)throw Error('No\x20client\x20ID');let iH;if(new URL(iA)['hostname']===lY(0x35d)&&iF&&(iH=await ii('https://on.soundcloud.com/'+iF+'/',{'redirect':'manual'})['then'](iO=>{let iP=iO['headers']['get']('location');if(iO['status']===0x12e&&iP?.['startsWith']('https://soundcloud.com/'))return iP['split']('?',0x1)[0x0];})['catch'](()=>void 0x0)),!iH&&iC&&iD&&(iH='https://soundcloud.com/'+iC+'/'+iD+(iE?'/s-'+iE:'')),!iH)throw Error('Could\x20not\x20fetch');let iI=await ii(lY(0x2f8)+iH+'&client_id='+iG)['then'](iO=>iO['status']===0xc8?iO['json']():null)['catch'](()=>null);if(!iI)throw Error(lY(0x2bd));let iJ=iI['media']?.['transcodings'];if(!iJ?.['length'])throw Error('Empty\x20download');let iK=iz(iJ,'opus'),iL=iz(iJ,'mp3');if(iL&&(iy(iB)||!iK)&&(iK=iL),!iK)throw Error('Empty\x20download');let iM=''+iK['url']+(iK['url']['includes']('?')?'&':'?')+'client_id='+iG+'&track_authorization='+iI['track_authorization'];if(!iM['startsWith']('https://api-v2.soundcloud.com/media/soundcloud:tracks:'))throw Error('Empty\x20download');let iN=await ii(iM)['then'](async iO=>(await iO['json']())[lY(0x1aa)]??'')['catch'](()=>'');if(!iN)throw Error('Could\x20not\x20fetch');return[{'type':'audio','title':iI['title']['trim'](),'author':iI['user']['username']['trim'](),'source':{'url':iN}}];}});})(ie['Azot'],ie[lZ(0x1d1)],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie[lZ(0x36b)],ie['window']),ig['exports'][lZ(0x376)]||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'SoundCloud','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/b6/ba/14/b6ba14ee-32c4-609b-1325-b23cb17e853f/Placeholder.mill/400x400bb-75.webp','matches':['https://soundcloud.com/*','https://*.soundcloud.com/*']},'pkg':{'name':kd(0x237),'version':'0.0.6','private':!0x0,'keywords':['music'],'homepage':'https://soundcloud.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':kd(0x2f4),'url':'https://github.com/vitalygashkov'}],'type':'module','main':'soundcloud.ts'}},'streamable':{'create':ie=>{const m2=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const m0=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iA=>iA);let iu=it['defineExtension'];it[m0(0x259)],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=['/:id{/}?','/e/:id{/}?','/o/:id{/}?',m0(0x2e2),'/s/:id/:token{/}?'],iw=iA=>{let iB=new URL(iA);for(let iC of iv){let iD=new URLPattern({'pathname':iC,'baseURL':iB['origin']})['exec'](iA)?.['pathname']['groups']['id'];if(iD)return iD;}},ix=iA=>iA['startsWith']('//')?'https:'+iA:iA,iy=iA=>(iA[m0(0x1dc)]??0x0)*0xf4240+(iA['width']??0x0)*0x3e8+(iA[m0(0x293)]??0x0)+(iA[m0(0x37e)]??0x0)/0xf4240,iz=iA=>{let iB=Object['values'](iA??{})['filter'](iD=>!!iD?.['url']),iC;for(let iD of iB)(!iC||iy(iD)>iy(iC))&&(iC=iD);return iC;};ig['exports']=iu({async 'getEntries'({url:iA}){const m1=m0;let iB=iw(iA);if(!iB)return il['error']('Could\x20not\x20extract\x20Streamable\x20video\x20id'),[];let iC=await ii('https://ajax.streamable.com/videos/'+iB)['then'](iH=>iH['ok']?iH['json']():null)['catch'](iH=>(iH instanceof Error&&il['debug'](iH['message']),null));if(!iC)return il[m1(0x264)]('Cannot\x20fetch\x20Streamable\x20video\x20info'),[];if(iC['status']!==0x2)return il['error']('Streamable\x20video\x20is\x20not\x20ready\x20or\x20is\x20unavailable'),[];let iD=iz(iC['files']);if(!iD?.['url'])return il['error']('Could\x20not\x20resolve\x20Streamable\x20media\x20URL'),[];let iE=iD['width'],iF=iD['height'],iG=iE&&iF?'_'+iE+'x'+iF:'';return[{'id':iB,'title':iC['reddit_title']?.['trim']()||iC['title']?.[m1(0x277)]()||'streamable_'+iB+iG,'description':iC['description'],'posterUrl':iC['thumbnail_url']?ix(iC['thumbnail_url']):void 0x0,'author':iC['owner']?.['user_name'],'source':{'url':ix(iD['url'])}}];}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports'][m2(0x376)]||ig[m2(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Streamable','icon':'https://cdn-1.webcatalog.io/catalog/streamable/streamable-icon-filled-256.webp?v=1714776006971','matches':['https://streamable.com/*','https://*.streamable.com/*']},'pkg':{'name':'streamable','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://streamable.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'streamable.ts'}},'threads':{'create':ie=>{const m8=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const m3=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iF=>iF);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it[m3(0x2e0)],it[m3(0x1af)],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=new Set(['threads.com','www.threads.com','threads.net','www.threads.net']),iw={'amp':'&','apos':'\x27','gt':'>','lt':'<','nbsp':'\x20','quot':'\x22'},ix=iF=>iF['replace'](/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(iG,iH)=>{if(iH[0x0]==='#'){let iI=iH[0x1]?.['toLowerCase']()==='x'?0x10:0xa,iJ=Number['parseInt'](iH['slice'](iI===0x10?0x2:0x1),iI);return Number['isFinite'](iJ)?String['fromCodePoint'](iJ):iG;}return iw[iH['toLowerCase']()]??iG;}),iy=iF=>ix(iF['replace'](/<[^>]*>/g,''))[m3(0x3bd)](/\s+/g,'\x20')['trim'](),iz=iF=>iF['length']<=0x48?iF:iF[m3(0x201)](0x0,0x45)['trim']()+'...',iA=iF=>{let iG=new URL(iF);if(!iv['has'](iG['hostname']))return null;let iH=new URLPattern({'pathname':'/:username/post/:shortcode{/*}?','baseURL':iG['origin']})['exec'](iF),iI=iH?.['pathname']['groups']['username'],iJ=iH?.['pathname']['groups']['shortcode'];return!iI||!iJ?null:{'username':decodeURIComponent(iI)['replace'](/^@/,''),'shortcode':iJ,'origin':iG['origin']};},iB=iF=>{let iG=new URL(iF);return iG['search']='',iG['hash']='',iG['pathname']['endsWith']('/embed')||(iG['pathname']=iG['pathname']['replace'](/\/$/,'')+'/embed'),iG['href'];},iC=(iF,iG)=>{const m4=m3;let iH=RegExp('<meta\x5cs+[^>]*(?:property|name)=[\x22\x27]'+iG+'[\x22\x27][^>]*content=[\x22\x27]([^\x22\x27]*)[\x22\x27][^>]*>','i')['exec'](iF)?.[0x1];return iH?ix(iH)[m4(0x277)]():void 0x0;},iD=iF=>{let iG=/<span[^>]*class=["'][^"']*BodyTextContainer[^"']*["'][^>]*>([\s\S]*?)<\/span>/i['exec'](iF)?.[0x1];return iG?iy(iG):void 0x0;},iE=iF=>{const m5=m3;let iG=new Set();for(let iH of iF['matchAll'](/<video\b[\s\S]*?<\/video>/gi)){let iI=iH[0x0];for(let iK of iI['matchAll'](/<source\b[^>]*\bsrc=["']([^"']+)["'][^>]*>/gi))iG['add'](ix(iK[0x1]));let iJ=/<video\b[^>]*\bsrc=["']([^"']+)["'][^>]*>/i['exec'](iI)?.[0x1];iJ&&iG[m5(0x227)](ix(iJ));}return[...iG];};ig['exports']=iu({async 'getEntries'({url:iF}){const m6=m3;let iG=iA(iF);if(!iG)return il['error']('Could\x20not\x20extract\x20a\x20valid\x20Threads\x20post\x20shortcode\x20from\x20the\x20URL'),il['debug'](iF),[];let iH=await ii(iB(iF));if(!iH['ok'])return il['error']('Threads\x20embed\x20request\x20failed\x20with\x20status:\x20'+iH[m6(0x233)]),[];let iI=await iH['text'](),iJ=iE(iI);if(!iJ['length'])return il['error']('Threads\x20post\x20does\x20not\x20contain\x20downloadable\x20video\x20media'),[];let iK=iD(iI)??iC(iI,'og:description'),iL=iC(iI,'og:title')?.[m6(0x197)](/\(@([^)]+)\)/)?.[0x1]??iG['username'],iM=iC(iI,'og:image'),iN=iK?iz(iK):'threads_'+iG['username']+'_'+iG[m6(0x2d8)];return iJ['map']((iO,iP)=>{const m7=m6;let iQ=iJ[m7(0x2dd)]>0x1?'_'+(iP+0x1):'';return{'id':''+iG['shortcode']+iQ,'type':'video','title':iN,'description':iK,'posterUrl':iM,'author':iL,'url':iF,'source':{'url':iO}};});}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie[m8(0x2d3)],ie[m8(0x3b3)],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[m8(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':'Threads','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/e1/00/ae/e100ae1d-9060-a604-55fd-573dde58db50/Placeholder.mill/400x400bb-75.webp','matches':['https://threads.com/*','https://*.threads.com/*','https://threads.net/*','https://*.threads.net/*']},'pkg':{'name':'threads','version':'0.0.1','private':!0x0,'keywords':[kd(0x33e)],'homepage':'https://www.threads.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'threads.ts'}},'tiktok':{'create':ie=>{const me=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const m9=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iJ=>iJ);let iu=it['defineExtension'];it[m9(0x259)],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv='https://www.tiktok.com/',iw=m9(0x39d),ix=(iJ,iK)=>iJ['match'](RegExp('<script[^>]+id=[\x22\x27]'+iK+'[\x22\x27][^>]*>(.*?)</script>','s'))?.[0x1]?.['trim'](),iy=(iJ,iK)=>{try{return JSON['parse'](iJ);}catch(iL){return il['error']('Failed\x20to\x20parse\x20TikTok\x20page\x20JSON',iL,{'url':iK}),null;}},iz=iJ=>{try{return JSON['parse']('\x22'+iJ['replace'](/"/g,'\x5c\x22')+'\x22');}catch{return iJ['replaceAll']('\x5cu002F','/')['replaceAll']('\x5c/','/');}},iA=iJ=>{try{return new URL(iJ)['pathname']['match'](/\/(?:video|photo)\/(\d+)/)?.[0x1]??null;}catch{return null;}},iB=iJ=>{const ma=m9;let iK=iJ['match'](/<a\s+href="([^"]*tiktok\.com[^"]*)"/)?.[0x1];if(iK)return iK[ma(0x2f2)](ma(0x1ea),'&');let iL=iJ['match'](/<meta[^>]+property=["']og:url["'][^>]+content=["']([^"']+)["']/)?.[0x1];return iL?iL[ma(0x2f2)]('&amp;','&'):null;},iC=iJ=>'https://www.tiktok.com/@i/video/'+iJ,iD=async iJ=>{let iK=await ii(iJ);return iK['ok']?await iK['text']():(il['error']('Failed\x20to\x20fetch\x20TikTok\x20page.\x20Status:\x20'+iK['status']),null);},iE=(iJ,iK)=>{let iL=[iJ],iM=iB(iK);iM&&iL['push'](iM);let iN=iA(iM??iJ);return iN&&iL['push'](iC(iN)),[...new Set(iL)];},iF=(iJ,iK)=>{const mb=m9;let iL=ix(iJ,'__UNIVERSAL_DATA_FOR_REHYDRATION__');if(!iL)return null;let iM=iy(iL,iK)?.['__DEFAULT_SCOPE__']?.['webapp.video-detail'],iN=iM?.['itemInfo']?.['itemStruct']??null;return!iN&&iM?.['statusMsg']&&il[mb(0x264)](mb(0x18c)+iM['statusCode']+':\x20'+iM['statusMsg']),iN;},iG=iJ=>{let iK=iJ['match'](/"downloadAddr"\s*:\s*"([^"]+)"/)??iJ['match'](/"playAddr"\s*:\s*"([^"]+)"/);return iK?.[0x1]?iz(iK[0x1]):null;},iH=iJ=>{const mc=m9;let iK=iJ[mc(0x197)](/"desc"\s*:\s*"([^"]*)"/)?.[0x1];if(iK)return iz(iK);let iL=iJ['match'](/<title[^>]*>([^<]+)<\/title>/)?.[0x1]?.['trim']();return!iL||iL==='TikTok\x20-\x20Make\x20Your\x20Day'?null:iL['split']('|')['slice'](0x0,-0x1)['join']('|')['trim']()||iL;},iI=()=>{const md=m9;let iJ={'Referer':'https://www.tiktok.com/'};return iq['cookie']&&(iJ[md(0x32a)]=iq['cookie']),iJ;};ig['exports']=iu({async 'getEntries'({url:iJ}){let iK=await iD(iJ);if(!iK)return[];for(let iL of iE(iJ,iK)){let iM=iL===iJ?iK:await iD(iL);if(!iM)continue;let iN=iF(iM,iL),iO=iN?.['video']?.['downloadAddr']??iN?.['video']?.['playAddr']??iG(iM);if(iO)return[{'type':'video','title':iN?.['desc']||iH(iM)||'TikTok\x20Video','source':{'url':iO,'headers':iI()}}];}return il['error']('Could\x20not\x20find\x20TikTok\x20media\x20data.\x20The\x20content\x20might\x20be\x20unavailable\x20or\x20the\x20structure\x20has\x20changed.'),[];}});})(ie['Azot'],ie['fetch'],ie[me(0x2e4)],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'TikTok','shortName':'TT','icon':kd(0x1a7),'permissions':[],'matches':['https://tiktok.com/*','https://*.tiktok.com/*']},'pkg':{'name':kd(0x29f),'version':kd(0x1a3),'private':!0x0,'keywords':['social-networks'],'homepage':kd(0x2d2),'author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':kd(0x399),'email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'tiktok.ts'}},'tumblr':{'create':ie=>{const mm=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mf=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iK=>iK);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it[mf(0x2fb)],it[mf(0x2e0)],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=mf(0x2d6),iw='https://api-http2.tumblr.com',ix={'User-Agent':'Tumblr/iPhone/33.3/333010/17.3.1/tumblr','X-Version':'iPhone/33.3/333010/17.3.1/tumblr'},iy=iK=>iK['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')[mf(0x2f2)]('&#39;','\x27')[mf(0x2f2)](mf(0x246),'<')['replaceAll']('&gt;','>'),iz=(iK,iL)=>{const mg=mf;let iM=iL['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),iN=iK[mg(0x197)](RegExp('<meta[^>]+(?:property|name)=[\x22\x27]'+iM+'[\x22\x27][^>]+content=[\x22\x27]([^\x22\x27]+)[\x22\x27]','i'))??iK['match'](RegExp('<meta[^>]+content=[\x22\x27]([^\x22\x27]+)[\x22\x27][^>]+(?:property|name)=[\x22\x27]'+iM+'[\x22\x27]','i'));return iN?.[0x1]?iy(iN[0x1]):void 0x0;},iA=iK=>{let iL=iz(iK,'og:title')??iK['match'](/<title[^>]*>([^<]+)<\/title>/i)?.[0x1];return iL?iy(iL)['replace'](/\s+\| Tumblr$/,'')['trim']():void 0x0;},iB=iK=>{const mh=mf;let iL=new URL(iK),iM=iL['hostname']['replace'](/^www\./,''),iN=iL['pathname']['split']('/')['filter'](Boolean);if(iM===mh(0x2c9)){let [iO,iP]=iN[0x0]==='blog'&&iN[0x1]==='view'?[iN[0x2],iN[0x3]]:[iN[0x0],iN[0x1]];return iO&&/^\d+$/['test'](iP??'')?{'blog':iO,'id':iP}:null;}if(iM['endsWith'](mh(0x28f))){let iQ=iM['slice'](0x0,-0xb),iR=iN[0x0]==='post'||iN[0x0]==='video'?iN['find'](iS=>/^\d+$/['test'](iS)):iN[0x1];return iQ&&iR&&/^\d+$/[mh(0x1bf)](iR)?{'blog':iQ,'id':iR}:null;}return null;},iC=({blog:iK,id:iL})=>{let iM=new URL('/v2/blog/'+iK+'.tumblr.com/posts/'+iL+'/permalink','https://api-http2.tumblr.com');return iM['searchParams']['set']('api_key','jrsCWX1XDuVxAFO4GkK147syAoN8BJZ5voz8tS80bPcj26Vc5Z'),iM;},iD=async iK=>{const mi=mf;let iL=await ii(iC(iK),{'headers':ix})['then'](iN=>iN['json']())['catch'](iN=>(iN instanceof Error&&il['debug'](iN['message']),null)),iM=iL?.['response']?.['timeline']?.['elements']?.[0x0];return!iM&&iL?.['meta']?.['status']&&iL['meta']['status']!==0xc8&&il['error']('Tumblr\x20API\x20error\x20'+iL[mi(0x360)]['status']+':\x20'+(iL['meta']['msg']??mi(0x257))),iM??null;},iE=iK=>[...iK['content']??[],...iK[mf(0x2a4)]?.['flatMap'](iL=>iL['content']??[])??[]],iF=iK=>iE(iK)['filter'](iL=>iL['type']==='text'&&iL['text'])['map'](iL=>iL['text'])[mf(0x299)]('\x0a\x0a')['trim']()||void 0x0,iG=(iK,iL,iM)=>{const mj=mf;let iN=iL['type']==='audio'?[iL['artist'],iL['title']]['filter'](Boolean)['join']('\x20-\x20'):iK['summary']?.['trim']();if(iN)return iN;let iO=iK['id_string']??iK['id'];return iM>0x0?'tumblr_'+iO+'_'+(iM+0x1):mj(0x316)+iO;},iH=iK=>{const mk=mf;let iL=iF(iK);return iE(iK)['filter'](iM=>(iM['type']==='video'||iM['type']==='audio')&&(iM['provider']==='tumblr'||!iM['provider'])&&(iM[mk(0x252)]?.['url']||iM['url']))['map']((iM,iN)=>({'id':[iK['id_string']??iK['id'],iN||void 0x0]['filter'](Boolean)['join']('_'),'type':iM['type']==='audio'?'audio':'video','title':iG(iK,iM,iN),'description':iL,'posterUrl':iM['poster']?.['find'](iO=>iO[mk(0x1aa)])?.['url'],'author':iK['blog_name'],'url':iK['post_url'],'source':{'url':iM['media']?.['url']??iM['url']??''}}));},iI=async iK=>{let iL=await ii(iK)['catch'](()=>null);return iL?.['ok']?await iL['text']():(il['error']('Failed\x20to\x20fetch\x20Tumblr\x20page'+(iL?'.\x20Status:\x20'+iL['status']+'\x20'+iL['statusText']:'')),null);},iJ=(iK,iL,iM)=>{let iN=iz(iK,'og:video')??iz(iK,'og:video:url');return iN?{'id':iL['id'],'title':iA(iK)||'tumblr_'+iL['id'],'description':iz(iK,'og:description'),'posterUrl':iz(iK,'og:image'),'author':iL['blog'],'url':iM,'source':{'url':iN}}:null;};ig['exports']=iu({async 'getEntries'({url:iK}){const ml=mf;let iL=iB(iK);if(!iL)return il['error']('Could\x20not\x20extract\x20Tumblr\x20post\x20id'),[];let iM=await iD(iL),iN=iM?iH(iM):[];if(iN[ml(0x2dd)]>0x0)return iN;let iO=await iI(iK),iP=iO?iJ(iO,iL,iK):null;return iP?[iP]:(il['error'](ml(0x326)),[]);}});})(ie['Azot'],ie['fetch'],ie[mm(0x2e4)],ie['cookieStore'],ie[mm(0x3b3)],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig[mm(0x24d)];},'manifest':{'manifestVersion':0x1,'displayName':kd(0x3c9),'icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/57/c9/fe/57c9fed7-5434-633f-23fb-9fcb2a2804b9/Placeholder.mill/400x400bb-75.webp','permissions':[],'matches':['https://tumblr.com/*','https://*.tumblr.com/*']},'pkg':{'name':'tumblr','version':'0.0.1','private':!0x0,'keywords':['social-networks'],'homepage':'https://www.tumblr.com/','author':{'name':kd(0x1f0),'url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'tumblr.ts'}},'twitch':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mq=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iH=>iH);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv='https://gql.twitch.tv/gql',iw={'Client-ID':'kimne78kx3ncx6brgo4mv6wki5h1ko','Content-Type':'application/json'},ix='query\x20PlaybackAccessToken_Template($login:\x20String!,\x20$isLive:\x20Boolean!,\x20$vodID:\x20ID!,\x20$isVod:\x20Boolean!,\x20$playerType:\x20String!)\x20{\x20streamPlaybackAccessToken(channelName:\x20$login,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isLive)\x20{\x20value\x20signature\x20authorization\x20{\x20isForbidden\x20forbiddenReasonCode\x20}\x20__typename\x20}\x20videoPlaybackAccessToken(id:\x20$vodID,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isVod)\x20{\x20value\x20signature\x20__typename\x20}}',iy=async iH=>{let iI=await ii('https://gql.twitch.tv/gql',{'method':'POST','headers':iw,'body':JSON['stringify'](iH)})['catch'](iJ=>(iJ instanceof Error&&il['debug'](iJ['message']),null));return iI?iI['ok']?await iI['json']()['catch'](()=>null):(il['error']('Twitch\x20GraphQL\x20request\x20failed:\x20'+iI['status']+'\x20'+iI['statusText']),null):(il['error']('Failed\x20to\x20fetch\x20Twitch\x20GraphQL\x20endpoint'),null);},iz=iH=>{const mn=b;let iI=new URL(iH),iJ=iI['hostname']['toLowerCase'](),iK=iI[mn(0x294)][mn(0x25b)]('/')['filter'](Boolean);return iJ['endsWith']('clips.twitch.tv')?iK[0x0]?{'type':mn(0x1ae),'id':iK[0x0]}:null:iK[0x0]===mn(0x187)&&iK[0x1]?{'type':'vod','id':iK[0x1]}:iK[0x1]==='clip'&&iK[0x2]?{'type':mn(0x1ae),'id':iK[0x2]}:iK[0x0]==='clip'&&iK[0x1]?{'type':mn(0x1ae),'id':iK[0x1]}:null;},iA=(iH,iI)=>{const mo=b;if(!iI?.['signature']||!iI['value'])return null;let iJ=new URL(iH);return iJ['searchParams'][mo(0x2b9)]('sig',iI['signature']),iJ['searchParams']['set'](mo(0x354),iI['value']),iJ['href'];},iB=iH=>{const mp=b;let iI=iH?.['filter'](iK=>iK['sourceURL'])??[],iJ;for(let iK of iI){let iL=Number['parseInt'](iK['quality']??'0',0xa),iM=Number['parseInt'](iJ?.[mp(0x2c2)]??'0',0xa);(!iJ||iL>iM)&&(iJ=iK);}return iJ;},iC=iH=>iH?.['displayName']||iH?.['login'],iD=async iH=>(await iy([{'operationName':'VideoAccessToken_Clip','variables':{'slug':iH},'extensions':{'persistedQuery':{'version':0x1,'sha256Hash':'36b89d2507fce29e5ca551df756d27c1cfe079e2609642b4390aa4c35796eb11'}}}]))?.[0x0]?.['data']?.[mq(0x1ae)]?.['playbackAccessToken']??null,iE=async iH=>(await iy({'operationName':'PlaybackAccessToken_Template','query':'query\x20PlaybackAccessToken_Template($login:\x20String!,\x20$isLive:\x20Boolean!,\x20$vodID:\x20ID!,\x20$isVod:\x20Boolean!,\x20$playerType:\x20String!)\x20{\x20streamPlaybackAccessToken(channelName:\x20$login,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isLive)\x20{\x20value\x20signature\x20authorization\x20{\x20isForbidden\x20forbiddenReasonCode\x20}\x20__typename\x20}\x20videoPlaybackAccessToken(id:\x20$vodID,\x20params:\x20{platform:\x20\x22web\x22,\x20playerBackend:\x20\x22mediaplayer\x22,\x20playerType:\x20$playerType})\x20@include(if:\x20$isVod)\x20{\x20value\x20signature\x20__typename\x20}}','variables':{'isLive':!0x1,'login':'','isVod':!0x0,'vodID':iH,'playerType':mq(0x2c7)}}))?.['data']?.['videoPlaybackAccessToken']??null,iF=async iH=>{const mr=mq;let iI=(await iy({'query':'query\x20{\x20clip(slug:\x20'+JSON['stringify'](iH)+')\x20{\x20id\x20slug\x20title\x20durationSeconds\x20thumbnailURL(width:\x20640,\x20height:\x20360)\x20broadcaster\x20{\x20login\x20displayName\x20}\x20curator\x20{\x20login\x20displayName\x20}\x20videoQualities\x20{\x20quality\x20sourceURL\x20frameRate\x20}\x20}\x20}'}))?.['data']?.['clip'];if(!iI)return il['error']('Could\x20not\x20resolve\x20Twitch\x20clip\x20metadata'),[];let iJ=iB(iI['videoQualities']),iK=await iD(iH),iL=iJ?.['sourceURL']?iA(iJ['sourceURL'],iK):null;return iL?[{'id':iI['id']??iI['slug']??iH,'type':'video','title':iI['title']?.['trim']()||mr(0x35e)+iH,'posterUrl':iI['thumbnailURL'],'author':iC(iI['broadcaster']),'source':{'url':iL}}]:(il['error']('Could\x20not\x20resolve\x20Twitch\x20clip\x20media\x20URL'),[]);},iG=async iH=>{const ms=mq;let [iI,iJ]=await Promise['all']([iy({'query':'query\x20{\x20video(id:\x20'+JSON['stringify'](iH)+')\x20{\x20id\x20title\x20description\x20createdAt\x20lengthSeconds\x20previewThumbnailURL(width:\x20640,\x20height:\x20360)\x20owner\x20{\x20login\x20displayName\x20}\x20}\x20}'}),iE(iH)]),iK=iI?.[ms(0x298)]?.['video'];if(!iK)return il['error']('Could\x20not\x20resolve\x20Twitch\x20VOD\x20metadata'),[];let iL=iA('https://usher.ttvnw.net/vod/'+iH+'.m3u8',iJ);if(!iL)return il['error']('Could\x20not\x20resolve\x20Twitch\x20VOD\x20playlist\x20URL'),[];let iM=new URL(iL);return iM['searchParams']['set']('allow_source','true'),iM['searchParams']['set'](ms(0x278),'true'),[{'id':iK['id']??iH,'type':'video','title':iK['title']?.['trim']()||'twitch_vod_'+iH,'description':iK['description'],'posterUrl':iK['previewThumbnailURL'],'author':iC(iK['owner']),'source':{'url':iM['href']}}];};ig['exports']=iu({async 'getEntries'({url:iH}){const mt=mq;let iI=iz(iH);return iI?iI['type']==='clip'?await iF(iI['id']):await iG(iI['id']):(il[mt(0x264)]('Could\x20not\x20extract\x20Twitch\x20video\x20or\x20clip\x20id'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Twitch','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/83/19/c0/8319c058-a099-c1ed-8b10-eb4a3f2fe98e/Placeholder.mill/400x400bb-75.webp','matches':['https://twitch.tv/*','https://*.twitch.tv/*','https://clips.twitch.tv/*','https://*.clips.twitch.tv/*']},'pkg':{'name':'twitch','version':kd(0x2b1),'private':!0x0,'keywords':['streaming-services','video-hostings'],'homepage':'https://www.twitch.tv/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':kd(0x206)}},'twitter':{'create':ie=>{const mB=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mu=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iR=>iR);let iu=it['defineExtension'];it[mu(0x259)],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it[mu(0x2e0)],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv='https://api.x.com/graphql/4Siu98E55GquhG52zHdY5w/TweetDetail',iw='https://api.x.com/1.1/guest/activate.json',ix='AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA',iy='Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36',iz={'rweb_video_screen_enabled':!0x1,'payments_enabled':!0x1,'rweb_xchat_enabled':!0x1,'profile_label_improvements_pcf_label_in_post_enabled':!0x0,'rweb_tipjar_consumption_enabled':!0x0,'verified_phone_label_enabled':!0x1,'creator_subscriptions_tweet_preview_api_enabled':!0x0,'responsive_web_graphql_timeline_navigation_enabled':!0x0,'responsive_web_graphql_skip_user_profile_image_extensions_enabled':!0x1,'premium_content_api_read_enabled':!0x1,'communities_web_enable_tweet_community_results_fetch':!0x0,'c9s_tweet_anatomy_moderator_badge_enabled':!0x0,'responsive_web_grok_analyze_button_fetch_trends_enabled':!0x1,'responsive_web_grok_analyze_post_followups_enabled':!0x0,'responsive_web_jetfuel_frame':!0x0,'responsive_web_grok_share_attachment_enabled':!0x0,'articles_preview_enabled':!0x0,'responsive_web_edit_tweet_api_enabled':!0x0,'graphql_is_translatable_rweb_tweet_is_translatable_enabled':!0x0,'view_counts_everywhere_api_enabled':!0x0,'longform_notetweets_consumption_enabled':!0x0,'responsive_web_twitter_article_tweet_consumption_enabled':!0x0,'tweet_awards_web_tipping_enabled':!0x1,'responsive_web_grok_show_grok_translated_post':!0x1,'responsive_web_grok_analysis_button_from_backend':!0x0,'creator_subscriptions_quote_tweet_preview_enabled':!0x1,'freedom_of_speech_not_reach_fetch_enabled':!0x0,'standardized_nudges_misinfo':!0x0,'tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled':!0x0,'longform_notetweets_rich_text_read_enabled':!0x0,'longform_notetweets_inline_media_enabled':!0x0,'responsive_web_grok_image_annotation_enabled':!0x0,'responsive_web_grok_imagine_annotation_enabled':!0x0,'responsive_web_grok_community_note_auto_translation_is_enabled':!0x1,'responsive_web_enhance_cards_enabled':!0x1},iA={'withArticleRichContentState':!0x0,'withArticlePlainText':!0x1,'withGrokAnalyze':!0x1,'withDisallowedReplyControls':!0x1},iB={'User-Agent':'Mozilla/5.0\x20(Macintosh;\x20Intel\x20Mac\x20OS\x20X\x2010_15_7)\x20AppleWebKit/537.36\x20(KHTML,\x20like\x20Gecko)\x20Chrome/125.0.0.0\x20Safari/537.36','Referer':mu(0x1b8)},iC={...iB,'Authorization':'Bearer\x20AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA','x-twitter-client-language':'en','x-twitter-active-user':'yes','accept-language':'en'},iD=null,iE=iR=>new URL(iR)['pathname']['match'](/\/(?:i\/)?(?:status|statuses)\/(\d+)/)?.[0x1]??null,iF=iR=>{const mv=mu;let iS=new URL(iR);return iS[mv(0x28e)]['delete']('tag'),iS['href'];},iG=iR=>{let iS=iR?.['filter'](iU=>iU['content_type']==='video/mp4'&&iU['url']);if(!iS?.['length'])return null;let iT=iS[0x0];for(let iU of iS)Number(iU['bitrate']??0x0)>Number(iT['bitrate']??0x0)&&(iT=iU);return iT['url']?iF(iT['url']):null;},iH=async(iR=!0x1)=>(iD&&!iR||(iD=(await ii('https://api.x.com/1.1/guest/activate.json',{'method':'POST','headers':iC})[mu(0x2b0)](iS=>iS['ok']?iS['json']():null)['catch'](()=>null))?.['guest_token']??null),iD),iI=iR=>(Number(iR)/0x38d7ea4c68000*Math['PI'])['toString'](0x24)['replace'](/(0+|\.)/g,''),iJ=async iR=>{const mw=mu;let iS=new URL('https://cdn.syndication.twimg.com/tweet-result');iS['searchParams'][mw(0x2b9)]('id',iR),iS['searchParams']['set']('token',iI(iR));let iT=await ii(iS,{'headers':iB})['catch'](iU=>(iU instanceof Error&&il['debug'](iU['message']),null));return iT?iT['ok']?await iT['json']():(il['debug']('Twitter\x20syndication\x20request\x20failed:\x20'+iT['status']),null):null;},iK=async(iR,iS)=>{const mx=mu;let iT=new URL('https://api.x.com/graphql/4Siu98E55GquhG52zHdY5w/TweetDetail');iT['searchParams']['set'](mx(0x18f),JSON[mx(0x281)]({'focalTweetId':iR,'with_rux_injections':!0x1,'rankingMode':mx(0x3c7),'includePromotedContent':!0x0,'withCommunity':!0x0,'withQuickPromoteEligibilityTweetFields':!0x0,'withBirdwatchNotes':!0x0,'withVoice':!0x0})),iT['searchParams']['set']('features',JSON['stringify'](iz)),iT['searchParams']['set'](mx(0x3ab),JSON['stringify'](iA));let iU={...iC,'content-type':'application/json','x-guest-token':iS,'Cookie':'guest_id='+encodeURIComponent(mx(0x322)+iS)},iV=await ii(iT,{'headers':iU})[mx(0x234)](iW=>(iW instanceof Error&&il['debug'](iW['message']),null));if(!iV)return null;if(iV['status']===0x193||iV['status']===0x1ad){let iW=await iH(!0x0);if(!iW||(iV=await ii(iT,{'headers':{...iU,'x-guest-token':iW,'Cookie':'guest_id='+encodeURIComponent('v1:'+iW)}})['catch'](iX=>(iX instanceof Error&&il['debug'](iX['message']),null)),!iV))return null;}return iV['ok']?await iV['json']():(il['debug']('Twitter\x20GraphQL\x20request\x20failed:\x20'+iV['status']),null);},iL=iR=>{const my=mu;let iS=iR?.['legacy']?.['binding_values']?.[0x0]?.['value']?.['string_value']??iR?.['binding_values']?.['unified_card']?.[my(0x39c)];if(!iS)return null;try{let iT=JSON['parse'](iS);if(!['video_website','image_website']['includes'](iT['type']??'')||!iT['media_entities']||iT['component_objects']?.['media_1']?.[my(0x1d6)]!=='media')return null;let iU=iT['component_objects']['media_1']['data']?.['id'],iV=iU?iT['media_entities'][iU]:void 0x0;return iV?[iV]:null;}catch(iW){return il['debug']('Failed\x20to\x20parse\x20Twitter\x20card',iW),null;}},iM=(iR,iS)=>((iR?.['data']?.['threaded_conversation_with_injections_v2']?.[mu(0x1b4)]??[])[mu(0x392)](iT=>iT['type']===mu(0x378))?.['entries']??[])['find'](iT=>iT['entryId']==='tweet-'+iS)?.['content']?.['itemContent']?.['tweet_results']?.['result']??null,iN=iR=>iR['__typename']==='TweetWithVisibilityResults'?iR['tweet']:iR,iO=(iR,iS)=>{const mz=mu;let iT=iM(iR,iS),iU=iT?.['__typename'];if(!iT||!iU)return null;if(iU==='TweetUnavailable'||iU===mz(0x328)){let iY=iT['result']?.['reason'],iZ=iT['tombstone']?.[mz(0x2f3)]?.['text']??'';return iY==='Protected'?il['error']('Twitter\x20post\x20is\x20private'):iY===mz(0x321)||iZ['startsWith']('Age-restricted')?il['error'](mz(0x284)):il['error']('Twitter\x20post\x20is\x20unavailable'),null;}if(!['Tweet','TweetWithVisibilityResults']['includes'](iU))return null;let iV=iN(iT),iW=iV?.[mz(0x1e3)],iX=iW?.['retweeted_status_result']?.['result']?.['legacy']??iW?.['retweeted_status_result']?.['result']?.['tweet']?.['legacy'];return iL(iV?.['card'])??iX?.['extended_entities']?.['media']??iW?.['extended_entities']?.['media']??null;},iP=async iR=>{const mA=mu;let iS=await iJ(iR),iT=iL(iS?.[mA(0x258)])??iS?.['mediaDetails'];if(iT?.['length'])return{'media':iT,'text':iS?.['text']};let iU=await iH();if(iU){let iV=await iK(iR,iU),iW=iV?iM(iV,iR):null,iX=iW?iN(iW):null,iY=iV?iO(iV,iR):null;if(iY?.['length'])return{'media':iY,'text':iX?.['legacy']?.['full_text']};}return{'media':[],'text':void 0x0};},iQ=(iR,iS,iT)=>iT>0x1?'twitter_'+iR+'_'+(iS+0x1):'twitter_'+iR;ig['exports']=iu({async 'getEntries'({url:iR}){let iS=iE(iR);if(!iS)return il['error']('Could\x20not\x20extract\x20Twitter/X\x20tweet\x20id'),[];let iT=await iP(iS);if(!iT['media']['length'])return il['error']('Could\x20not\x20resolve\x20Twitter/X\x20media'),[];let iU=[];for(let iW of iT['media']){if(iW['type']==='photo')continue;let iX=iG(iW['video_info']?.['variants']);iX&&iU['push']({'mediaUrl':iX});}let iV=[];for(let iY=0x0;iY<iU['length'];iY+=0x1){let iZ=iU[iY];iV['push']({'id':iS+'_'+(iY+0x1),'title':iQ(iS,iY,iU['length']),'description':iT['text']?.['trim'](),'source':{'url':iZ['mediaUrl'],'headers':iB},'url':iR});}return iV['length']||il['error']('Twitter/X\x20post\x20does\x20not\x20contain\x20downloadable\x20video\x20or\x20photo\x20media'),iV;}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie[mB(0x36b)],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'X\x20/\x20Twitter','shortName':'X','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/a8/46/4c/a8464cd5-48d9-aa90-a689-e74c85303c67/Placeholder.mill/400x400bb-75.webp','matches':['https://x.com/*','https://*.x.com/*','https://twitter.com/*','https://*.twitter.com/*']},'pkg':{'name':'twitter','version':kd(0x2b1),'private':!0x0,'keywords':['social-networks'],'homepage':'https://x.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':kd(0x3ad)}},'vimeo':{'create':ie=>{const mG=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mC=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iF=>iF);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it[mC(0x32c)],it['DASH'],it[mC(0x200)],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv={'Accept':'application/vnd.vimeo.*+json;\x20version=3.4.10','Accept-Language':'en','User-Agent':'Vimeo/1.6.3\x20(com.vimeo.mac;\x20build:251121.142637.0;\x20macOS\x2013.7.8)\x20Alamofire/5.9.0\x20VimeoNetworking/5.0.0'},iw={...iv,'Authorization':'Basic\x20NDc1N2JlN2Y5ZjZmMjU3NzE3NTRkZTg1NmY2YzU2MTI0OTFlNjJiYjpwVUNDWUlBZmZqSHhQcndBYWxGMzgyYys2NkN5d1JrREJZZXdPcEdsU05tdjFlVVo2aE1lYk9GcWE3ZW9KVldlYnFlOWh5Vno5UWtpUGJ5empYZFBpYkFwV0FFTnB5VWV4ZEh3aHZnRUNEL0VySnBzTmFraDdNbS9nMXhWanhIcw=='},ix=['uri','name','description','link','duration','width','height','privacy','pictures','uploader',mC(0x2e1),'files','download','play','status','is_playable','has_audio']['join'](','),iy=['/:id(\x5cd+){/}?','/:id(\x5cd+)/:hash{/}?','/channels/:channel/:id(\x5cd+){/}?','/channels/:channel/:id(\x5cd+)/:hash{/}?','/groups/:group/videos/:id(\x5cd+){/}?','/groups/:group/videos/:id(\x5cd+)/:hash{/}?',mC(0x38f),'/album/:album/video/:id(\x5cd+)/:hash{/}?','/showcase/:showcase/video/:id(\x5cd+){/}?','/showcase/:showcase/video/:id(\x5cd+)/:hash{/}?'],iz=iF=>{const mD=mC;let iG=new URL(iF),iH=new URLPattern({'pathname':'/video/:id(\x5cd+){/}?','baseURL':iG['origin']})['exec'](iF);if(iH)return{'id':iH['pathname']['groups']['id'],'hash':iG['searchParams']['get']('h')??void 0x0};for(let iJ of iy){let iK=new URLPattern({'pathname':iJ,'baseURL':iG['origin']})['exec'](iF),iL=iK?.[mD(0x294)]['groups']['id'];if(iL)return{'id':iL,'hash':iK['pathname']['groups']['hash']};}let iI=iG['searchParams'][mD(0x291)]('clip_id');return iI&&/^\d+$/['test'](iI)?{'id':iI}:null;},iA=async()=>{let iF=await ij['getItem']('vimeo_oauth_token');if(iF)return iF;let iG=await ii('https://api.vimeo.com/oauth/authorize/client',{'method':'POST','headers':{...iw,'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'grant_type':'client_credentials','scope':'private\x20public\x20create\x20edit\x20delete\x20interact\x20upload\x20purchased\x20stats\x20video_files'})['toString']()})['then'](iH=>iH['json']())['catch'](iH=>(iH instanceof Error&&il['debug'](iH['message']),null));return iG?.['access_token']&&await ij['setItem']('vimeo_oauth_token',iG['access_token']),iG?.['access_token'];},iB=async(iF,iG)=>{const mE=mC;let iH=iF[mE(0x22e)]?iF['id']+':'+iF['hash']:iF['id'],iI=new URL('https://api.vimeo.com/videos/'+iH);return iI['searchParams']['set']('fields',ix),await ii(iI,{'headers':{...iv,'Authorization':mE(0x371)+iG}})['then'](iJ=>iJ[mE(0x222)]())['catch'](iJ=>(iJ instanceof Error&&il['debug'](iJ['message']),null));},iC=iF=>{let iG=iF['rendition']?.['match'](/^(\d+)p$/)?.[0x1];return iF['height']??(iG?Number(iG):0x0);},iD=iF=>{let iG=iF?.['filter'](iI=>iI['type']==='video/mp4'&&iI['link'])??[],iH=null;for(let iI of iG)(!iH||iC(iI)>iC(iH))&&(iH=iI);return iH;},iE=iF=>iF?.['find'](iG=>iG['type']==='video/mp4'&&iG['quality']==='hls'&&iG['link']);ig['exports']=iu({async 'getEntries'({url:iF}){const mF=mC;let iG=iz(iF);if(!iG)return il['error']('Could\x20not\x20extract\x20Vimeo\x20video\x20id'),[];let iH=await iA();if(!iH)return il['error']('Could\x20not\x20fetch\x20Vimeo\x20OAuth\x20token'),[];let iI=await iB(iG,iH);if(!iI||iI['error']||iI['error_code'])return il['error'](iI?.['developer_message']||iI?.['error']||'Could\x20not\x20fetch\x20Vimeo\x20video\x20info'),[];if(iI['is_playable']===!0x1)return il[mF(0x264)]('Vimeo\x20video\x20is\x20not\x20playable'),[];let iJ=iD(iI[mF(0x2eb)])??iE(iI['files']);return iJ?.['link']?[{'id':iG['id'],'title':iI['name']?.['trim']()||'vimeo_'+iG['id'],'description':iI['description'],'posterUrl':iI['pictures']?.['base_link'],'author':iI['uploader']?.['name']??iI['user']?.['name'],'url':iI['link']??iF,'source':{'url':iJ['link']}}]:(il['error']('Could\x20not\x20resolve\x20Vimeo\x20media\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie[mG(0x1f2)],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports'][mG(0x376)]||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Vimeo','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/65/e9/04/65e904a0-0164-84c0-5131-a570ab011678/Placeholder.mill/400x400bb-75.webp','matches':['https://vimeo.com/*','https://*.vimeo.com/*']},'pkg':{'name':'vimeo','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://vimeo.com/','author':{'name':'Azot','url':kd(0x2a1)},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'vimeo.ts'}},'virtualroom':{'create':ie=>{const mK=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mH=b;let it=ih??Streamyx??{};it&&(it[mH(0x32d)]||=ix=>ix);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it['prompt'],it['notify'],it['confirm'],it[mH(0x312)],it['utils'];let iv=it['Input'],iw=it['UrlSource'];it[mH(0x1af)],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it[mH(0x1e2)],it['MP3'],ig['exports']=iu({async 'getEntries'({url:ix}){const mI=mH;let iy=new URL(ix)['searchParams']['get']('recordId');if(!iy)return il[mI(0x264)]('Could\x20not\x20extract\x20VirtualRoom\x20recordId.'),[];let iz=await ii('https://mv1.virtualroom.ru/vr/player/records/'+iy+'/info')['then'](iD=>iD['ok']?iD['json']():null)[mI(0x234)](()=>null),iA=await ii('https://mv1.virtualroom.ru/vr/player/records/'+iy+'/events')['then'](iD=>iD['ok']?iD['json']():null)['catch'](()=>null),iB=iz?.['data']?.[mI(0x1a8)]?.['name']??'VirtualRoom',iC=new Map();for(let iD of iA?.[mI(0x298)]?.['translations']??[]){if(!iD['url'])continue;let iE=iD['source']??iD[mI(0x1d6)]??'default',iF=iC['get'](iE);iF?iF['push'](iD):iC['set'](iE,[iD]);}return[...iC['values']()][mI(0x1b3)](iG=>{let iH=iG[0x0];return{'title':[iB,iH?.['source'],iH?.['start']]['filter'](Boolean)['join']('\x20'),'context':{'tracks':iG}};});},async 'resolveEntry'({entry:ix}){const mJ=mH;let iy=ix['context'][mJ(0x363)],iz=iy['find'](iC=>iC['type']==='video'&&iC['url'])??iy[0x0];if(!iz?.['url'])throw Error('VirtualRoom\x20entry\x20is\x20missing\x20playable\x20media\x20URL');let iA=new iv({'source':new iw(iz['url'])}),iB=iy['filter'](iC=>iC!==iz&&iC[mJ(0x1d6)]==='audio');for(let iC of iB)iC['url']&&await iA['addAudioTracks'](new iw(iC['url']));return{'input':iA,'entry':ix};}});})(ie['Azot'],ie['fetch'],ie[mK(0x2e4)],ie['cookieStore'],ie['console'],ie[mK(0x1f2)],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'VirtualRoom','icon':'https://sun9-50.userapi.com/impg/rY5N7sdA93TFdjkeYqPTnPIjvCJ0rALo_V7V8g/zLAaAv0PpvY.jpg?size=400x400&quality=95&sign=5ddcd6358131b204b8619cb8eeff943f&type=album','matches':[kd(0x1a9),'https://*.virtualroom.ru/*']},'pkg':{'name':'virtualroom','version':'0.0.7','private':!0x0,'keywords':[kd(0x216)],'homepage':'https://virtualroom.ru/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':kd(0x22a)}],'type':'module','main':'virtualroom.ts'}},'vk':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mL=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=j5=>j5);let iu=it['defineExtension'];it['version'],it[mL(0x31c)],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=(j5='')=>j5[mL(0x3bd)](/&quot;/g,'\x22')[mL(0x3bd)](/&#34;/g,'\x22')['replace'](/&#39;/g,'\x27')['replace'](/&amp;/g,'&')['replace'](/&lt;/g,'<')['replace'](/&gt;/g,'>'),iw=(...j5)=>j5['map'](j6=>iv(j6??'')['trim']())['filter'](Boolean)['join']('\x20-\x20'),ix=j5=>{let j6=new Set(),j7=[];for(let j8 of j5){let j9=j8['id']??j8['source']?.['url']??j8['url'];!j9||j6['has'](j9)||(j6['add'](j9),j7['push'](j8));}return j7;},iy=j5=>{const mM=mL;let j6=new URL(j5),j7=j6['searchParams']['get']('z');return j7?.['startsWith']('audio_playlist')||j7?.[mM(0x372)]('video')?'https://'+j6['hostname']+'/'+j7:j5;},iz=j5=>{let j6=iy(j5)['match'](/video(-?\d+)_(\d+)(?:_([a-z0-9]+))?/i);return j6?{'ownerId':j6[0x1],'videoId':j6[0x2],'accessKey':j6[0x3]}:null;},iA=j5=>{let j6=iy(j5),j7=j6['match'](/audio(-?\d+)_(\d+)(?:_([a-z0-9]+))?/i);return!j7||j6['includes']('audio_playlist')?null:{'ownerId':j7[0x1],'audioId':j7[0x2],'accessKey':j7[0x3]};},iB=j5=>{let j6=iy(j5),j7=j6['match'](/audio_playlist(-?\d+)_(\d+)/i)??j6['match'](/\/music\/playlist\/(-?\d+)_(\d+)/i);return j7?{'ownerId':j7[0x1],'playlistId':j7[0x2]}:null;},iC=j5=>/\/audios-?\d+/i['test'](iy(j5)),iD=j5=>/\/wall-?\d+_\d+/i['test'](iy(j5)),iE='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/=',iF=j5=>{let j6='',j7=0x0,j8=0x0;for(let j9 of j5){let ja='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/='['indexOf'](j9);if(ja<0x0)continue;let jb=j8%0x4;j7=jb?0x40*j7+ja:ja,j8+=0x1,jb&&(j6+=String['fromCharCode'](0xff&j7>>(-0x2*j8&0x6)));}return j6;},iG=(j5,j6)=>{const mN=mL;if(!j5['includes']('audio_api_unavailable'))return j5;let j7=j5['split'](mN(0x389))[0x1]?.['split']('#');if(!j7?.[0x0]||!j7[0x1])return'';let [,j8]=iF(j7[0x1])['split']('\x0b'),j9=[...iF(j7[0x0])],ja=[],jb=Number(j8)^j6;for(let jc=j9['length']-0x1;jc>=0x0;--jc)jb=(j9['length']*(jc+0x1)^jb+jc)%j9['length'],ja[jc]=jb;for(let jd=0x1;jd<j9['length'];jd+=0x1){let je=ja[j9['length']-0x1-jd],jf=j9[jd];j9[jd]=j9[je]??'',j9[je]=jf??'';}return j9['join']('');},iH=j5=>{try{return JSON['parse'](j5);}catch{return null;}},iI=j5=>{let j6=Array['isArray'](j5),j7=j6?j5[0x0]:j5['id'],j8=j6?j5[0x1]:j5['owner_id']??j5['ownerId'],j9=j6?j5[0x2]:j5['url'],ja=j6?j5[0x3]:j5['title'],jb=j6?j5[0x4]:j5['artist']??j5['performer'];if(j7==null||j8==null||!j9)return null;let jc=Number(j7),jd=iG(iv(j9),jc);return!jd||!/^https?:\/\//['test'](jd)?null:{'type':'audio','id':j8+'_'+j7,'title':iw(jb,ja),'author':iv(jb??'')['trim']()||void 0x0,'posterUrl':j6?j5[0xe]?.['split'](',')['at'](-0x1):j5['coverUrl']?.['split'](',')['at'](-0x1),'source':{'url':jd}};},iJ=(j5,j6)=>{let j7=0x0,j8=!0x1,j9=!0x1;for(let ja=j6;ja<j5['length'];ja+=0x1){let jb=j5[ja];if(j8){j9?j9=!0x1:jb==='\x5c'?j9=!0x0:jb==='\x22'&&(j8=!0x1);continue;}if(jb==='\x22'){j8=!0x0;continue;}if(jb==='{')j7+=0x1;else{if(jb==='}'&&(--j7,j7===0x0))return j5['slice'](j6,ja+0x1);}}return'';},iK=j5=>iv(j5)['replace'](/\\"/g,'\x22')['replace'](/\\\//g,'/'),iL=(j5,j6=[])=>{const mO=mL;if(typeof j5==mO(0x1ee))j6['push'](j5);else{if(Array['isArray'](j5)){for(let j7 of j5)iL(j7,j6);}else{if(j5&&typeof j5=='object'){for(let j8 of Object['values'](j5))iL(j8,j6);}}}return j6;},iM=(j5,j6=[])=>{const mP=mL;if(Array['isArray'](j5)){typeof j5[0x0]=='number'&&typeof j5[0x1]=='number'&&typeof j5[0x3]=='string'&&typeof j5[0x4]=='string'&&j6['push'](j5);for(let j7 of j5)iM(j7,j6);}else{if(j5&&typeof j5==mP(0x2a2)){let j8=j5;j8['audio']&&typeof j8['audio']=='object'?j6['push'](j8['audio']):j8['id']!=null&&j8['owner_id']!=null&&j8[mP(0x1aa)]!=null&&j6['push'](j8);for(let j9 of Object['values'](j8))iM(j9,j6);}}return j6;},iN=j5=>{const mQ=mL;let j6=iK(j5),j7=[];for(let j9 of j6['matchAll'](/data-audio=(["'])(.*?)\1/gs)){let ja=iH(iv(j9[0x2]??'')),jb=ja?iI(ja):null;jb&&j7['push'](jb);}for(let jc of j6[mQ(0x2e5)](/AudioUtils\.drawAudio(?:Playlist)?\((\[.*?\])\)/gs)){let jd=iH(iv(jc[0x1]??''));if(Array['isArray'](jd))for(let je of jd){let jf=Array['isArray'](je)?iI(je):null;jf&&j7['push'](jf);}}let j8=0x0;for(;;){let jg=j6['indexOf']('\x22audio\x22:{',j8);if(jg<0x0)break;let jh=jg+0x8,ji=iJ(j6,jh),jj=ji?iH(ji):null,jk=jj?iI(jj):null;jk&&j7['push'](jk),j8=jh+Math['max'](ji['length'],0x1);}return ix(j7);},iO=j5=>{let j6=iN(j5),j7=iH(j5);if(!j7)return j6;for(let j8 of iL(j7))j6['push'](...iN(j8));for(let j9 of iM(j7)){let ja=iI(j9);ja&&j6['push'](ja);}return ix(j6);},iP=async j5=>{let j6=await ii(j5,{'headers':{'accept-language':'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7'}});if(!j6['ok'])throw Error('VK\x20request\x20failed:\x20'+j6['status']+'\x20'+j6['statusText']);return j6['text']();},iQ=async(j5,j6)=>{const mR=mL;let j7=await ii(j5,{'method':'POST','headers':{'content-type':'application/x-www-form-urlencoded;\x20charset=utf-8','x-requested-with':'XMLHttpRequest'},'body':new URLSearchParams(j6)['toString']()});if(!j7['ok'])throw Error(mR(0x3c0)+j7['status']+'\x20'+j7['statusText']);return j7['text']();},iR=j5=>{const mS=mL;let j6=iy(j5),j7=[()=>iP(j6)],j8=new URL(j6);j8['hostname']!=='m.vk.com'&&j7['push'](()=>iP('https://m.vk.com'+j8['pathname']+j8['search']));let j9=iA(j6);j9&&(j7[mS(0x1d8)](()=>iQ('https://vk.com/al_audio.php',{'act':'load_section','al':'1','owner_id':j9['ownerId'],'playlist_id':'-1','type':'playlist'})),j7['push'](()=>iP('https://vk.com/audios'+j9['ownerId']+'?z=audio'+j9['ownerId']+'_'+j9['audioId'])));let ja=iB(j6);ja&&j7['push'](()=>iQ('https://vk.com/al_audio.php',{'act':'load_section','al':'1','owner_id':ja['ownerId'],'playlist_id':ja['playlistId'],'type':'playlist'}));let jb=j6['match'](/\/audios(-?\d+)/i);jb?.[0x1]&&j7['push'](()=>iQ('https://vk.com/al_audio.php',{'act':'load_section','al':'1','owner_id':jb[0x1],'playlist_id':'-1','type':'playlist'}));let jc=j6['match'](/wall(-?\d+_\d+)/i)?.[0x1];return(jc||iD(j6))&&j7['push'](()=>iQ('https://vk.com/wkview.php',{'act':'show','al':'1','w':'wall'+jc})),j7;},iS=async(j5,j6)=>{for(let j7 of iR(j5)){let j8=iO(await j7()['catch'](()=>'')),j9=j6?j8['filter'](ja=>ja['id']===j6['ownerId']+'_'+j6['audioId']):j8;if(j9['length'])return j9;}return[];},iT=['2160','1440','1080','720','480','360','240','144'],iU='5.274',iV='51552953',iW='qgr0yWwXCrsxA1jnRtRX',iX='com.vk.vkvideo.prod/1955\x20(iPhone,\x20iOS\x2016.7.15,\x20iPhone10,4,\x20Scale/2.0)\x20SAK/1.135',iY={'token':'','expiry':0x0,'deviceId':''},iZ=(j5,j6)=>{const mT=mL;let j7=j6['videoQuality']?.['replace']('p','')['trim'](),j8=iT[mT(0x254)](j9=>j5[j9]);return j8['length']?j7&&j8[mT(0x219)](j7)?j7:j8[0x0]:null;},j0=async()=>{const mU=mL;let j5=Math['floor'](Date['now']()/0x3e8);if(iY['token']&&iY['expiry']-0xa>j5)return iY;let j6=crypto['randomUUID']()[mU(0x33b)](),j7=new URL('https://api.vk.ru/method/auth.getAnonymToken');j7[mU(0x28e)]['set']('client_id','51552953'),j7['searchParams'][mU(0x2b9)]('client_secret',mU(0x330)),j7['searchParams'][mU(0x2b9)](mU(0x2ed),j6),j7['searchParams']['set']('v',iU);let j8=await ii(j7,{'headers':{'user-agent':iX}})['then'](j9=>j9['ok']?j9['json']():null)['catch'](()=>null);return j8?.['response']?.['token']&&j8['response'][mU(0x353)]&&(iY['token']=j8['response']['token'],iY['expiry']=j8['response']['expired_at'],iY['deviceId']=j6),iY['token']?iY:null;},j1=async(j5,j6)=>{let j7=await j0();if(!j7)return null;let j8=(await ii('https://api.vkvideo.ru/method/video.get',{'method':'POST','headers':{'content-type':'application/x-www-form-urlencoded;\x20charset=utf-8','user-agent':iX},'body':new URLSearchParams({'anonymous_token':j7['token'],'device_id':j7['deviceId'],'lang':'en','v':iU,'videos':j5['ownerId']+'_'+j5['videoId']+(j5['accessKey']?'_'+j5['accessKey']:'')})['toString']()})['then'](jc=>jc['ok']?jc['json']():null)['catch'](()=>null))?.['response']?.['items']?.[0x0];if(!j8?.['files']||j8['restriction'])return null;let j9=Object['fromEntries'](iT['map'](jc=>[jc,j8['files']?.['mp4_'+jc]])),ja=iZ(j9,j6),jb=ja?j9[ja]:j8['files']['hls']??j8['files']['dash'];return jb?{'type':'video','id':j5['ownerId']+'_'+j5['videoId'],'title':iw(j8['title']),'source':{'url':jb,'headers':{'user-agent':iX}}}:null;},j2=j5=>{const mV=mL;if(!j5)return null;for(let j6 of j5)if(Array['isArray'](j6)){for(let j7 of j6)if(j7&&typeof j7=='object'&&mV(0x296)in j7)return j7;}return null;},j3=async(j5,j6,j7)=>{const mW=mL;let j8=await ii('https://vkvideo.ru/al_video.php?act=show',{'method':'POST','headers':{'content-type':'application/x-www-form-urlencoded;\x20charset=utf-8','accept':'*/*','x-requested-with':mW(0x2a5)},'body':new URLSearchParams({'al':'1','autoplay':'1','claim':'','force_no_repeat':mW(0x19c),'is_video_page':'true','list':'','module':'direct','t':'','video':j5['ownerId']+'_'+j5['videoId']+(j5['accessKey']?'_'+j5['accessKey']:'')})['toString']()});if(!j8['ok'])return null;let j9=j2((await j8['json']())['payload']),ja=j9?.['player']?.['params']?.[0x0];if(!ja||j9?.['mvData']?.[mW(0x366)]===0x1||j9?.['mvData']?.['is_active_live']==='1')return null;let jb=Object['fromEntries'](iT['map'](je=>[je,ja['url'+je]])),jc=iZ(jb,j7),jd=ja['dash_sep']||(jc?jb[jc]:void 0x0)||ja['hls'];return jd?{'type':'video','id':j5['ownerId']+'_'+j5['videoId'],'title':iw(ja['md_author'],ja['md_title']),'source':{'url':jd,'headers':{'Referer':j6,'Cookie':iq['cookie']}}}:null;},j4=async(j5,j6,j7)=>await j1(j5,j7)??j3(j5,j6,j7);ig[mL(0x24d)]=iu({async 'getEntries'({url:j5,options:j6}){let j7=iy(j5),j8=iz(j7);if(j8){let ja=await j4(j8,j7,j6);return ja?[ja]:[];}let j9=iA(j7);return j9?iS(j7,j9):iC(j7)||iD(j7)||j7['includes']('/music/playlist/')||j7['includes']('audio_playlist')?iS(j7):(il['error']('Unsupported\x20VK\x20URL'),[]);}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'VK','icon':'https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/58/49/1d/58491d31-6ffa-1117-8b63-e07887bb841f/Placeholder.mill/400x400bb-75.webp','matches':['https://vk.com/*','https://*.vk.com/*','https://vkvideo.ru/*','https://*.vkvideo.ru/*']},'pkg':{'name':'vk','version':'0.0.8','private':!0x0,'keywords':['video-hostings'],'homepage':kd(0x385),'author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'vk.ts'}},'weibo':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mX=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iw=>iw);let iu=it['defineExtension'];it['version'],it['sleep'],it['input'],it[mX(0x1f2)],it['notify'],it['confirm'],it['ask'];let iv=it['utils'];it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it['MP4'],it['MP3'],ig['exports']=iu({async 'getEntries'({url:iw}){const mY=mX;let ix=iv['execUrlPatterns'](iw,['/:userId(\x5cd+)/:bid','/detail/:mid'],['https://weibo.com/','https://m.weibo.cn']),iy=ix['pathname']['bid']||ix['pathname']['mid'];if(!iy)return[];let iz=await ii('https://m.weibo.cn/statuses/show?id='+iy,{'credentials':'include','referrer':'https://m.weibo.cn/status/'+(ix['pathname']['bid']??iy)+'?jumpfrom=weibocom','method':'GET','mode':'cors'})['then'](iD=>iD['json']())[mY(0x234)](()=>null);if(!iz?.['data'])return il['error']('Could\x20not\x20resolve\x20Weibo\x20post\x20metadata'),[];let iA=[],iB=iz['data']['pics'],iC=iz['data']['page_info'];if(iB?.['length']){for(let iD of iB['filter'](iE=>iE['type']==='video'||iE['type']==='livephoto'))iD['videoSrc']&&iA['push']({'type':'video','title':iD['pid'],'source':{'url':iD['videoSrc']}});}else{if(iC?.['type']==='video'){let iE=Object['values'](iC['urls']??{})[0x0],iF=iC[mY(0x2ef)]?.['stream_url_hd']||iC['media_info']?.['stream_url'],iG=iE||iF;iG&&iA[mY(0x1d8)]({'type':mY(0x1d4),'title':iC[mY(0x21d)]||iC['page_title'],'source':{'url':iG}});}}return iA;}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':kd(0x276),'icon':'https://play-lh.googleusercontent.com/TTKq2trnzgtoyM0jc1pyrrmXtA_Yd3A2hxubZtDahdZStYf4GPANZa-wjDb1ELHrGqh_=w480-h960-rw','matches':['https://weibo.com/*',kd(0x2d9),'https://weibo.cn/*','https://*.weibo.cn/*']},'pkg':{'name':'weibo','version':kd(0x2c1),'private':!0x0,'keywords':[kd(0x33e)],'homepage':'https://weibo.com/','author':{'name':'Azot','url':'https://azot.mov/'},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'weibo.ts'}},'xiaohongshu':{'create':ie=>{let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const mZ=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iH=>iH);let iu=it[mZ(0x32d)];it['version'],it[mZ(0x31c)],it['input'],it['prompt'],it[mZ(0x31e)],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it['HLS'],it['HLS_FORMATS'],it[mZ(0x1e2)],it['MP3'];let iv={'Referer':'https://www.xiaohongshu.com/'},iw=iH=>{let iI=new URL(iH);return new URLPattern({'pathname':'/:kind(explore|discovery/item)/:id{/*}?','baseURL':iI['origin']})['exec'](iI['href'])?.['pathname']['groups']['id'];},ix=(iH,iI)=>{let iJ=iH['indexOf']('{',iI);if(iJ===-0x1)return;let iK=0x0,iL=!0x1,iM=!0x1;for(let iN=iJ;iN<iH['length'];iN+=0x1){let iO=iH[iN];if(iL){iM?iM=!0x1:iO==='\x5c'?iM=!0x0:iO==='\x22'&&(iL=!0x1);continue;}if(iO==='\x22'){iL=!0x0;continue;}if(iO==='{'){iK+=0x1;continue;}if(iO==='}'&&(--iK,iK===0x0))return iH['slice'](iJ,iN+0x1);}},iy=iH=>{const n0=mZ;let iI=iH['indexOf']('window.__INITIAL_STATE__');if(iI===-0x1)return null;let iJ=ix(iH,iI);if(!iJ)return null;try{return JSON['parse'](iJ[n0(0x2f2)](':undefined',n0(0x338)));}catch(iK){return il['debug']('Failed\x20to\x20parse\x20Xiaohongshu\x20initial\x20state',iK),null;}},iz=iH=>{const n1=mZ;if(typeof iH=='number')return Number['isFinite'](iH)?iH:void 0x0;if(typeof iH=='string'&&iH[n1(0x277)]()){let iI=Number(iH);return Number['isFinite'](iI)?iI:void 0x0;}},iA=iH=>/\.mp4(?:[?#]|$)/i['test'](iH)||/video/i['test'](iH),iB=iH=>{const n2=mZ;let iI=[],iJ=Object['values'](iH?.['video']?.['media']?.['stream']??{})['flatMap'](iK=>iK??[]);for(let iK of iJ){let iL=[iK[n2(0x375)],...iK['backupUrls']??[]]['filter'](iN=>!!(iN&&iA(iN))),iM=iz(iK['avgBitrate'])??iz(iK['videoBitrate'])??iz(iK['size'])??iz(iK['width'])??0x0;for(let iN of iL)iI['push']({'url':iN,'score':iM,'width':iz(iK['width']),'height':iz(iK['height'])});}return iI;},iC=iH=>{let iI=iH?.['video']?.['consumer']?.['originVideoKey'];return iI?new URL(iI,'https://sns-video-bd.xhscdn.com/')['href']:void 0x0;},iD=async iH=>{const n3=mZ;let iI=await ii(iH,{'headers':{...iv,'Range':'bytes=0-0'}})[n3(0x234)](()=>null);return await iI?.[n3(0x2d0)]?.['cancel']()['catch'](()=>void 0x0),!!iI?.['ok'];},iE=iH=>{const n4=mZ;let iI=[],iJ=iH[n4(0x2e5)](/"backupUrls"\s*:\s*(\[[^\]]+\])/g);for(let iK of iJ)try{let iL=JSON['parse'](iK[0x1]);if(Array['isArray'](iL)){for(let iM of iL)typeof iM=='string'&&iA(iM)&&iI['push']({'url':iM,'score':0x0});}}catch{}return iI;},iF=iH=>{const n5=mZ;let iI=new Map();for(let iJ of iH){let iK=iI['get'](iJ['url']);(!iK||iJ['score']>iK['score'])&&iI['set'](iJ['url'],iJ);}return[...iI[n5(0x308)]()]['sort']((iL,iM)=>iM['score']-iL[n5(0x3a6)])[0x0];},iG=iH=>iH?.['imageList']?.['find'](iI=>iI['urlDefault']||iI['urlPre'])?.['urlDefault']??iH?.['imageList']?.['find'](iI=>iI['urlPre'])?.[mZ(0x253)];ig['exports']=iu({async 'getEntries'({url:iH}){const n6=mZ;let iI=iw(iH);if(!iI)return il['error']('Could\x20not\x20extract\x20Xiaohongshu\x20note\x20id'),[];let iJ=await ii(iH,{'headers':iv})['then'](iP=>iP['text']())['catch'](iP=>(iP instanceof Error&&il['debug'](iP['message']),''));if(!iJ)return il['error']('Failed\x20to\x20fetch\x20Xiaohongshu\x20page'),[];let iK=iy(iJ)?.['note']?.['noteDetailMap']?.[iI]?.['note'],iL=iF([...iB(iK),...iE(iJ)]),iM=iC(iK),iN=iM&&await iD(iM)?{'url':iM,'score':0x2**0x35-0x1}:iL;if(!iN)return il['error']('Could\x20not\x20resolve\x20Xiaohongshu\x20video\x20URL'),[];let iO=iN['width']&&iN['height']?'_'+iN[n6(0x346)]+'x'+iN['height']:'';return[{'id':iK?.[n6(0x34d)]??iI,'type':'video','title':iK?.['title']?.['trim']()||'xiaohongshu_'+iI+iO,'description':iK?.['desc'],'posterUrl':iG(iK),'author':iK?.['user']?.['nickname']??iK?.['user']?.['userId'],'source':{'url':iN['url'],'headers':iv}}];}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie['window']),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Xiaohongshu','icon':'https://cdn-1.webcatalog.io/catalog/xiaohongshu/xiaohongshu-icon-filled-256.webp?v=1779064483353','matches':['https://www.xiaohongshu.com/explore/*','https://www.xiaohongshu.com/discovery/item/*']},'pkg':{'name':'xiaohongshu','version':'0.0.1','private':!0x0,'keywords':['video-hostings'],'homepage':'https://www.xiaohongshu.com/','author':{'name':'Azot','url':kd(0x2a1)},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'xiaohongshu.ts'}},'zvezda':{'create':ie=>{const nc=kd;let ig={'exports':{}};return((ih,ii,ij,ik,il,io,ip,iq,ir,is)=>{const n7=b;let it=ih??Streamyx??{};it&&(it['defineExtension']||=iH=>iH);let iu=it['defineExtension'];it['version'],it[n7(0x31c)],it['input'],it['prompt'],it['notify'],it['confirm'],it['ask'],it['utils'],it['Input'],it['UrlSource'],it['CustomPathedSource'],it['ALL_FORMATS'],it['DASH'],it['DASH_FORMATS'],it[n7(0x329)],it['HLS_FORMATS'],it['MP4'],it['MP3'];let iv=/https?:\\?\/\\?\/cdn\.tvzvezda\.ru\/[^"'\\<>\s]+?\.m3u8(?:\?[^"'\\<>\s]+)?/g,iw=iH=>iH['replaceAll']('&amp;','&')['replaceAll']('&quot;','\x22')['replaceAll']('&#39;','\x27')[n7(0x2f2)]('&lt;','<')['replaceAll'](n7(0x213),'>')['replaceAll']('\x5cu0026','&')[n7(0x2f2)]('\x5c/','/'),ix=(iH,iI)=>{let iJ=RegExp('<meta\x5cs+(?:property|name)=[\x22\x27]'+iI+'[\x22\x27]\x5cs+content=[\x22\x27]([^\x22\x27]+)[\x22\x27]','i');return iH['match'](iJ)?.[0x1]?iw(iH['match'](iJ)?.[0x1]??''):void 0x0;},iy=(iH,iI)=>{const n8=n7;let iJ=RegExp('<script[^>]+id=[\x22\x27]'+iI+'[\x22\x27][^>]*>(?<json>[\x5cs\x5cS]+?)<\x5c/script>','i');return iH[n8(0x197)](iJ)?.['groups']?.['json'];},iz=(iH,iI)=>{try{return JSON['parse'](iH);}catch(iJ){return il['debug']('Failed\x20to\x20parse\x20TV\x20Zvezda\x20'+iI,iJ),null;}},iA=(iH,iI)=>{const n9=n7;if(iI(iH),Array[n9(0x18d)](iH)){for(let iJ of iH)iA(iJ,iI);return;}if(iH&&typeof iH=='object'){for(let iK of Object['values'](iH))iA(iK,iI);}},iB=iH=>iH?.['i16x9']?.[n7(0x1aa)]??iH?.['i16x7']?.[n7(0x1aa)]??iH?.['i4x3']?.['url']??iH?.['i1x1']?.['url'],iC=(iH,iI)=>iH['match'](/\/([^/]+)\.mp4\/index\.m3u8/)?.[0x1]??new URL(iI)['pathname']['split']('/')['filter'](Boolean)['at'](-0x1)?.['replace'](/\.html?$/i,''),iD=iH=>{let iI=[];return iA(iH,iJ=>{if(!iJ||typeof iJ!='object'||Array['isArray'](iJ))return;let iK=iJ;iK['media']?.['video']?.['url']&&iI['push'](iK);}),iI;},iE=iH=>{const na=n7;let iI=[],iJ=iy(iH,'__NEXT_DATA__');if(iJ){let iK=iz(iJ,'NEXT_DATA'),iL=iK?.['props']?.['pageProps']?.['news'];iL?.['media']?.['video']?.['url']&&iI['push'](iL),iI['push'](...iD(iK));}for(let iM of iH['matchAll'](/self\.__next_f\.push\((?<json>\[[\s\S]*?\])\)<\/script>/g)){let iN=iz(iM['groups']?.['json']??'','next\x20flight\x20payload');iI[na(0x1d8)](...iD(iN));}return iI;},iF=iH=>{let iI=new Set();for(let iJ of iH['matchAll'](iv))iI['add'](iw(iJ[0x0]));return[...iI];},iG=async iH=>{let iI=await ii(iH);return iI['ok']?await iI['text']():(il['error']('Failed\x20to\x20fetch\x20TV\x20Zvezda\x20page.\x20Status:\x20'+iI['status']+'\x20'+iI['statusText']),null);};ig['exports']=iu({async 'getEntries'({url:iH}){const nb=n7;let iI=await iG(iH);if(!iI)return[];let iJ=ix(iI,'og:title')??iI['match'](/<title>([^<]+)<\/title>/i)?.[0x1],iK=ix(iI,'og:description')??ix(iI,'description'),iL=ix(iI,'og:image'),iM=iE(iI)['find'](iQ=>iQ['media']?.['video']?.['url']),iN=iF(iI)[0x0],iO=iM?.['media']?.['video']?.['url']??iN;if(!iO)return il['error']('Could\x20not\x20resolve\x20TV\x20Zvezda\x20media\x20URL'),[];let iP=iw(iO);return[{'id':iC(iP,iH),'type':'video','title':iM?.['title']?.[nb(0x277)]()||iJ?.['trim']()||'tvzvezda','description':iM?.['anons']??iK,'posterUrl':iB(iM?.['media']?.['images'])??iL,'source':{'url':iP,'headers':{'Referer':iH}}}];}});})(ie['Azot'],ie['fetch'],ie['localStorage'],ie['cookieStore'],ie['console'],ie['prompt'],ie['alert'],ie['document'],ie['navigator'],ie[nc(0x188)]),ig['exports']['default']||ig['exports'];},'manifest':{'manifestVersion':0x1,'displayName':'Звезда','icon':'https://sf0.market.xiaomi.com/thumbnail/png/w300/AppStore/01ac5efa157e9487794fcae52aac0814d24f2219f','matches':['https://tvzvezda.ru/*','https://*.tvzvezda.ru/*']},'pkg':{'name':kd(0x332),'version':'0.0.1','private':!0x0,'keywords':['tv-channels'],'homepage':'https://tvzvezda.ru/','author':{'name':kd(0x1f0),'url':kd(0x2a1)},'contributors':[{'name':'Vitaly\x20Gashkov','email':'vitalygashkov@vk.com','url':'https://github.com/vitalygashkov'}],'type':'module','main':'zvezda.ts'}}};}),cE=ad(cD(),0x1);const cF=ic=>({'name':ic[jn(0x352)],'source':ic['source'],'dir':ic['dir'],'path':ic['path'],'package':ic['package'],'manifest':ic['manifest'],'installedAt':ic['installedAt']||new Date()['toISOString']()});var cG=class jl extends X{['extensions']=new Map();['extensionDirs'];['indexPath'];['infoList']=[];constructor({dirs:ic,indexPath:id}={}){const nd=jn;super(),this['extensionDirs']=ic??[process[nd(0x351)]()],this['indexPath']=id??Q['join'](process['cwd'](),'index.json');}async['init'](){const ne=jn;return await this['ensureValidIndexPath'](),await this[ne(0x3b2)](),this;}async[jn(0x3b2)](){const nf=jn;return this['infoList']=await b3(this['indexPath'])[nf(0x234)](()=>[]),this['infoList'];}async['saveInfo'](){return await this['ensureValidIndexPath'](),await b4(this['indexPath'],this['infoList']);}async['ensureValidIndexPath'](){const ng=jn;(await U[ng(0x226)](this['indexPath'])['catch'](()=>null))?.['isDirectory']()&&(v['warn'](ng(0x27f)+this['indexPath']),await b0(this['indexPath']),await U[ng(0x2ca)](this[ng(0x373)],'[]','utf8'));}static async['getAvailableExtensions'](){const nh=jn;try{return(await cj['getExtensions'](cr['accessToken'],AbortSignal['timeout'](0x1f40)))['data'];}catch(ic){let id=ic&&typeof ic=='object'&&'code'in ic?ic['code']:ic&&typeof ic=='object'&&'cause'in ic?ic[nh(0x2da)]?.['code']:void 0x0;return v['warn']('Failed\x20to\x20fetch\x20extensions\x20catalog:\x20'+(ic instanceof Error?ic['message']:String(ic))+'\x20('+id+')'),[];}}async['discover'](){for(let ic of this['extensionDirs']){v['debug']('Loading\x20extensions\x20from\x20'+ic);let id=await U['readdir'](ic,{'withFileTypes':!0x0})['catch'](()=>[]);for(let ie of id)if(ie['isDirectory']()){let ig=Q['join'](ic,ie['name']);if(await U['readdir'](ig)['then'](ih=>ih['filter'](ii=>!ii['startsWith']('.')))['then'](ih=>!ih['length']))continue;await this['loadExtension'](ig);}}for(let ih of this['infoList'])this['extensionDirs']['some'](ii=>ih['dir']?.['includes'](ii))||!ih['dir']||(v['debug']('Loading\x20dev\x20extension\x20from\x20'+ih['dir']),await this['loadExtension'](ih['dir']));}async #e(ic,id){const ni=jn,ie=await U['readFile'](ic,'utf8'),{Azot:ig,fetch:ih,console:ii,localStorage:ij,cookieStore:ik,window:il,document:io,navigator:ip}=id,iq={'exports':{}};eval('(()\x20=>\x20{'+ie+ni(0x3ae));const ir=iq['exports'];return{'exports':ir,'context':id};}async['prepareContext'](ic,id){const nj=jn;let ie=J({'name':ic,'dir':O,'title':id});return await ie['cookieStore'][nj(0x2ba)](Q['join'](O,ic,'cookies.txt')),ie;}async['loadScript'](ic,id){const nk=jn;let ie=id['name'],ig=bs(id),ih=await this['prepareContext'](ie,ig),ii=await E(ic,{'dirname':id['dir'],'context':ih});if(ii)return ii['exports']='default'in ii['exports']?ii['exports']['default']:ii[nk(0x24d)],ii;}async['loadCoreExtensions'](){const nl=jn;let ic=Object['keys'](cE['default']);v['debug']('Loading\x20'+ic['length']+nl(0x224)+ic['join'](',\x20'));for(let id of Object['values'](cE['default'])){let ie=id['pkg']['name'],ig=bq({'manifest':id['manifest'],'packageJson':id['pkg'],'fallbackName':ie}),ih=ig['displayName'];try{let ii=await this['prepareContext'](ie,ih),ij={'exports':id[nl(0x350)](ii),'package':id['pkg'],'manifest':ig,'context':ii};this['validate'](ij),this['extensions'][nl(0x2b9)](ie,ij),this['emit']('loaded',ie);}catch(ik){v['debug'](ik instanceof Error?ik['message']:String(ik)),this['emit']('error',ik,ie);}}}async['loadExtension'](ic){const nm=jn;try{v['debug']('Loading\x20extension\x20from\x20'+ic);let id=await c0(ic)[nm(0x234)](ih=>v['error'](ih));if(!id)return;id['package']['dir']=id['dir'];let ie=await this['loadScript'](id['path'],id);if(!ie)return;let ig={'package':id['package'],'manifest':id[nm(0x3bc)],'exports':ie['exports'],'context':ie['context']};this['validate'](ig),this['extensions']['set'](id['package']['name'],ig),this['emit']('loaded',id['package']['name']);}catch(ih){this['emit'](nm(0x264),ih,ic);}}['validate'](ic){const nn=jn;if(typeof ic!='object'||!ic||!bO(ic['exports']))throw Error(nn(0x223)+ic['package']['name']);}['getExtension'](ic){return this['extensions']['get'](ic)??Array['from'](this['extensions']['values']())['find'](id=>id['package']['name']===ic)??null;}async[jn(0x2ea)](ic){const no=jn;let id;try{id=new URL(ic);}catch(ie){return v[no(0x388)](no(0x2bb)+ic),v['debug'](ie instanceof Error?ie[no(0x275)]:String(ie)),null;}for(let ig of this['extensions']['values']()){let ih=null,ii=ig['exports']['canHandle'],ij=id['hostname']['includes'](ig['package']['name']);if(ih=bv(ig)?bu(ig,id):typeof ii==no(0x313)?await ii(ic):typeof ii=='string'?new URLPattern(ii)['test'](ic):ij,ih)return ig;}return null;}async['install'](ic){const np=jn;let id=await jl['getAvailableExtensions'](),ie=[];for(let ig of ic){let ih=await stat(ig)['then'](ik=>ik['isDirectory']())['catch'](()=>!0x1)?ig:await bi(ig,id);if(!ih)throw b9(b6['SOURCE_NOT_FOUND'],'Extension\x20source\x20not\x20found:\x20'+ig,{'source':ig});let ii=await c1(ih,ig);if(!ii)throw b9(b6[np(0x1ef)],'Extension\x20import\x20failed:\x20'+ig,{'source':ig,'dir':ih});ie['push'](ii);let ij=this['infoList']['find'](({name:ik})=>ik===ii['name']);if(ij){let ik=ij['source'];ik!==ii['source']&&await b0(ik);let il=ij['dir']?this.#t(ij['dir']):null,io=ii['dir']?this.#t(ii['dir']):null;il&&il!==io&&await b0(il),ij['installedAt']=new Date()['toISOString'](),Object['assign'](ij,cF(ii)),v['info'](np(0x327)+ii['name']+np(0x335));}else this['infoList']['push'](cF(ii)),v['info']('Extension\x20'+ii['name']+'\x20added');}if(await this['saveInfo'](),ie['length']){for(let ip of ie)this['extensions']['set'](ip['name'],ip);}}#t(ic){const nq=jn;let id=Q['parse'](ic);return id[nq(0x1a1)]===o?ic:id['dir'];}async['uninstall'](ic){const nr=jn;for(let id of ic){let ie=this['infoList']['find'](ii=>ii[nr(0x352)]===id);if(!ie){v[nr(0x264)]('Extension\x20'+id+'\x20not\x20found');return;}let ig=ie[nr(0x1a1)]??'',ih=ig?.['includes'](o);await aY(ig)?(ih&&await b0(this.#t(ig)),this['infoList']=this['infoList']['filter'](ii=>ii['name']!==id),v['info']('Extension\x20'+id+'\x20removed'),this['extensions']['delete'](id)):v['warn']('Extension\x20'+id+nr(0x31a)+ig);}await this['saveInfo']();}async['importCookies'](ic,id){let ie=this['getExtension'](ic);if(!ie)throw Error('Extension\x20'+ic+'\x20not\x20found');return await ie['context']['cookieStore']['import'](id,{'removeSource':!0x1});}async['login'](ic,id={}){let ie=this['getExtension'](ic);ie&&await bT(ie,id);}async['logout'](ic){const ns=jn;for(let id of ic){let ie=this['getExtension'](id);if(!ie)return;v['info']('Logging\x20out...'),await bU(ie),v['debug']('Clearing\x20localStorage...'),ie['context']['localStorage']['clear'](),v['debug'](ns(0x36a));let ig=await ie['context'][ns(0x2d3)]['getAll']();for(let ih of ig)await ie['context']['cookieStore']['delete'](ih);v['info']('Logged\x20out\x20from\x20extension\x20'+id);}}['list'](){const nt=jn;return Array['from'](this['extensions']['values']())['map'](ic=>({'name':ic['package']['name'],'version':ic[nt(0x3af)]['version'],'description':ic['package']['description'],'manifest':ic['manifest'],'package':ic['package']}));}};const cH=(ic,id)=>{let ie=resolve(ic),ig=parse(ic)['name'];return join(id,ig+'-'+createHash('sha1')['update'](ie)['digest']('hex')['slice'](0x0,0xa));},cI=(ic,id=q)=>{const nu=jn;let ie=new Set();ic?.['output'][nu(0x3ba)]&&ie['add'](ic['output']['filePath']);for(let ih of ic?.['artifacts']??[])ih['path']&&ie['add'](ih['path']);let ig=new Set();for(let ii of ie)ig['add'](ii),ig['add'](ii+nu(0x20b)),ig['add'](cH(ii,id));return ig;},cJ=async ic=>{ic['size']!==0x0&&await Promise['all']([...ic]['map'](id=>rm(id,{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0)));},cK=(ic=q)=>({async 'purgeRecordArtifacts'(id){await cJ(cI(id,ic));}}),cL=ic=>{const nv=jn;if(!ic||typeof ic!='object'||!('code'in ic))return;let id=ic['code'];return typeof id==nv(0x1ee)?id:void 0x0;},cM='NO_FILES_DOWNLOADED';var cN=class extends Error{['code'];constructor(ic,id=ic,ie){const nw=jn;super(id,ie),this['name']='DownloaderError',this[nw(0x1c0)]=ic;}};const cO=()=>new cN(cM,'No\x20files\x20were\x20downloaded'),cP=(ic,id='DOWNLOAD_FAILED')=>{const nx=jn;if(ic instanceof cN||ic instanceof Error&&ic['name']===nx(0x249))return ic;if(ic instanceof Error){let ie=new cN(cL(ic)??id,ic['message'],{'cause':ic});return ic['stack']&&(ie['stack']=ic['stack']),ie;}return new cN(id,typeof ic=='string'?ic:'Unknown\x20error');},cQ=({id:ic,request:id,createdAt:ie})=>({'id':ic,'request':id,'status':'queued','progress':{'percent':0x0,'downloadedBytes':0x0},'output':{},'artifacts':[],'createdAt':ie}),cR=ic=>ic['status']==='queued'||ic['status']==='analyzing'||ic['status']==='transferring'||ic['status']==='processing',cS=(ic,...id)=>id['includes'](ic['status']),cT=(ic,id)=>ic['status']==='failed'&&ic[jn(0x26f)]?.[jn(0x275)]===id,cU=(ic,id)=>{const ny=jn;let ie=ic['findIndex'](ih=>ih['path']===id['path']);if(ie===-0x1)return ic['push'](id),ic;let ig=ic[ie];return ic[ie]={...ig,...id,'role':ig['role']&&id[ny(0x32e)]==='partial'?ig['role']:id['role']??ig['role']},ic;},cV=(ic,id)=>{if(id?.['length']){for(let ie of id)ie['path']&&cU(ic['artifacts'],ie);}},cW=(ic,id)=>({'ok':!0x1,'reason':'Cannot\x20apply\x20'+id['type']+'\x20while\x20download\x20is\x20'+ic['status']}),cX=ic=>ic['status']==='queued'||ic['status']==='analyzing'||ic[jn(0x233)]==='transferring'||ic['status']==='processing'||ic['status']==='paused',cY=ic=>ic['status']==='failed',cZ=ic=>ic['status']==='queued',d0=ic=>ic[jn(0x233)]==='queued'||ic['status']==='analyzing',d1=ic=>ic['status']==='queued'||ic['status']==='analyzing'||ic['status']==='transferring',d2=ic=>ic['status']==='queued'||ic['status']==='analyzing'||ic['status']==='transferring'||ic['status']==='processing',d3=ic=>ic['status']==='transferring',d4=ic=>ic['status']==='analyzing'||ic[jn(0x233)]==='transferring'||ic['status']==='processing',d5=ic=>ic['status']==='queued'||ic['status']==='analyzing'||ic['status']==='transferring'||ic['status']==='processing'||ic['status']===jn(0x2b2),d6=(ic,id)=>{const nz=jn;switch(id['type']){case'queued':return cX(ic);case'retrying':return cY(ic);case'analyzing':return cZ(ic);case'transferring':return d0(ic);case'processing':return d3(ic);case'paused':return d1(ic);case'completed':return d4(ic);case nz(0x27e):return d2(ic);case'entry-resolved':return d5(ic);case nz(0x2aa):case'file-path-resolved':case'artifact-recorded':case'artifacts-recorded':return d4(ic);case'progress':return d3(ic);}},d7=(ic,id)=>{const nA=jn;if(!d6(ic,id))return cW(ic,id);let ie=structuredClone(ic);switch(id['type']){case'queued':return ie[nA(0x233)]='queued',ie['failure']=void 0x0,{'ok':!0x0,'record':ie};case'retrying':return ie['status']='analyzing',ie['failure']=void 0x0,ie['progress']['percent']=0x0,ie['progress']['downloadedBytes']=0x0,ie['progress']['totalBytes']=void 0x0,ie['progress']['totalBytesEstimated']=void 0x0,ie['output']['quality']=void 0x0,ie[nA(0x3be)]['codec']=void 0x0,ie['artifacts']=[],{'ok':!0x0,'record':ie};case'analyzing':return ie['status']=nA(0x2c3),ie[nA(0x26f)]=void 0x0,{'ok':!0x0,'record':ie};case'transferring':return ie['status']='transferring',ie['failure']=void 0x0,{'ok':!0x0,'record':ie};case nA(0x1da):return ie[nA(0x233)]='processing',{'ok':!0x0,'record':ie};case'paused':return ie[nA(0x233)]='paused',ie['failure']=void 0x0,{'ok':!0x0,'record':ie};case'completed':return ie['status']=nA(0x370),ie['progress'][nA(0x240)]=0x64,id[nA(0x1f4)]&&(ie['progress']['downloadedBytes']=id['progress'][nA(0x1a0)],ie['progress']['totalBytes']=id['progress']['totalBytes'],ie['progress']['totalBytesEstimated']=id['progress']['totalBytesEstimated']),ie['failure']=void 0x0,{'ok':!0x0,'record':ie};case'failed':return ie[nA(0x233)]='failed',ie['failure']={'message':id['message'],'code':id['code']},{'ok':!0x0,'record':ie};case'entry-resolved':return ie['request']['entry']=id['entry'],{'ok':!0x0,'record':ie};case'output-resolved':return ie['output']['title']=id[nA(0x21d)],ie['output']['filePath']=id[nA(0x3ba)],{'ok':!0x0,'record':ie};case'file-path-resolved':return ie['output']['filePath']=id['filePath'],{'ok':!0x0,'record':ie};case'progress':return id['progress']['filePath']&&(ie['output']['filePath']=id['progress']['filePath']),ie['progress']['percent']=Math['max'](ie['progress'][nA(0x240)],id['progress']['percent']),ie['progress']['downloadedBytes']=Math['max'](ie['progress']['downloadedBytes'],id['progress']['downloadedBytes']),ie['progress']['totalBytes']=id['progress'][nA(0x20f)],ie['progress']['totalBytesEstimated']=id[nA(0x1f4)]['totalBytesEstimated'],id['progress']['quality']&&(ie[nA(0x3be)][nA(0x2c2)]=id['progress']['quality']),id['progress'][nA(0x229)]&&(ie['output']['codec']=id['progress']['codec']),cV(ie,id['artifacts']),{'ok':!0x0,'record':ie};case'artifact-recorded':return cV(ie,[id['artifact']]),{'ok':!0x0,'record':ie};case'artifacts-recorded':return cV(ie,id['artifacts']),{'ok':!0x0,'record':ie};}},d8=(ic,id)=>{let ie=d7(ic,id);if(ie['ok']===!0x1)throw Error(ie['reason']);return ie['record'];},d9=async ic=>{if(ic)try{return(await stat(ic))['size'];}catch(id){v['debug']('Unable\x20to\x20read\x20downloaded\x20file\x20size\x20for\x20'+ic+':\x20'+String(id));return;}},da=async ic=>{let id=new Set();for(let ih of ic)ih&&id['add'](ih);if(!id['size'])return;let ie=0x0,ig=!0x1;for(let ii of id){let ij=await d9(ii);if(ij===void 0x0){ig=!0x0;continue;}ie+=ij;}return{'downloadedBytes':ie,'totalBytes':ie,'totalBytesEstimated':ig};},db=ic=>ic['processedMedia']['outputPath']??ic['processedMedia']['artifacts'][0x0]?.['path']??ic['transferResult']['downloaded'][0x0]?.['path'],dc=async ic=>ic['processedMedia']['outputPath']?await da([ic['processedMedia']['outputPath']]):await da(ic['processedMedia']['artifacts']['length']?ic[jn(0x35b)]['artifacts']['map'](id=>id['path']):ic['transferResult']['downloaded']['map'](id=>id['path'])),dd=ic=>ic['processedMedia']['artifacts']['map'](id=>({...id,'role':'track'}));var de=class{#e=new Set();#t=[];get['size'](){const nB=jn;return this.#t[nB(0x2dd)];}['has'](ic){return this.#e['has'](ic);}['enqueue'](ic){return this.#e['has'](ic)?!0x1:(this.#e['add'](ic),this.#t['push'](ic),!0x0);}['remove'](ic){if(!this.#e['has'](ic))return!0x1;let id=this.#t['indexOf'](ic);return id!==-0x1&&this.#t['splice'](id,0x1),this.#e['delete'](ic),!0x0;}['shift'](){let ic=this.#t['shift']();return ic&&this.#e['delete'](ic),ic;}};const df=(ic,id)=>ic['id']&&id['id']?ic['id']===id['id']:!!ic['title']&&!!id['title']&&ic['title']===id['title']&&ic['seasonNumber']===id[jn(0x189)]&&ic['episodeNumber']===id['episodeNumber']&&ic['episodeTitle']===id['episodeTitle'],dg=(ic,id)=>{if(id['length']<=0x1)return id[0x0];let ie=ic['request']['entry'],ig=ie?.['source']?.['url'];return id['find'](ih=>df(ie,ih)?!0x0:!!ig&&ig===ih['source']?.['url'])??id[0x0];},dh=ic=>ic instanceof Error&&ic['name']==='AbortError',di=ic=>ic&&typeof ic=='object'&&'code'in ic?String(ic['code']):void 0x0,dj=()=>void 0x0;var dk=class{#e=new Set();#t;#n;#r;#i;#a;#o=new de();#s=new Map();#c=new Set();#l;#u=0x0;constructor({settings:ic,store:id,session:ie,analyzer:ig,artifacts:ih=cK()}){this.#t=ic,this.#n=id,this.#r=ie,this.#i=ig,this.#a=ih,this.#l=ic['get']('maxActiveDownloads'),v['debug']('Created\x20download\x20engine\x20with\x20max\x20active\x20downloads:\x20'+this.#l);}get['maxActiveDownloads'](){return this.#l;}['getRecord'](ic){return this.#n['getRecord'](ic);}['listRecords'](){return this.#n['listRecords']();}['subscribe'](ic){const nC=jn;return this.#e[nC(0x227)](ic),()=>this.#e[nC(0x380)](ic);}async['initializeFromStorage'](){for(let ic of this.#n['listRecords']()){if(!cR(ic))continue;let id=ic;cS(ic,'queued')||(id=await this.#w(ic,{'type':'queued'})),this.#O(id['id']);}this.#g();}async['analyze'](ic,id={},ie){if(!ic){let ig=Error('Cannot\x20prepare\x20job\x20without\x20a\x20URL.');throw this.#P({'type':'error','error':ig}),ig;}return await this.#i['analyze'](ic,id,ie);}async['add'](ic){const nD=jn;if(!ic['url']&&!ic['entry']?.['source']?.['url'])throw Error('Job\x20must\x20have\x20either\x20a\x20URL\x20or\x20a\x20pre-prepared\x20media\x20entry.');let id=cQ({'id':crypto['randomUUID'](),'request':ic,'createdAt':new Date()['toISOString']()});v['debug']('Adding\x20new\x20job:\x20'+id['id']),v['debug'](nD(0x3b9)+id['request']['url']),this.#u+=0x1;try{return await this.#n['addRecord'](id),this.#P({'type':'job-added','record':id}),this.#O(id['id']),this.#g(),structuredClone(id);}finally{--this.#u,this.#N();}}async['pause'](ic){let id=await this.#f(ic,'pause');id&&v['debug']('Paused\x20download:\x20'+id['id']);}async['resume'](ic){let id=this.#s['get'](ic);if(id){id['cancellationReason']==='pause'||id['controller']['signal']['aborted']?(this.#c['add'](ic),v['debug']('Resume\x20queued\x20until\x20stop\x20completes:\x20'+ic)):v['debug']('Resume\x20skipped\x20while\x20job\x20is\x20active:\x20'+ic);return;}let ie=this.#D(ic);if(!ie){v['warn']('Resume\x20failed:\x20Job\x20'+ic+'\x20not\x20found');return;}if(cS(ie,'paused')){await this.#m(ie),v['debug']('Resumed\x20download:\x20'+ie['id']);return;}cS(ie,'failed')&&await this.#h(ie)&&v['debug']('Retried\x20download:\x20'+ie['id']);}async['remove'](ic){this.#d(ic,'remove'),await this.#n['deleteRecord'](ic);}async['removeWithFile'](ic){const nE=jn;let id=this.#D(ic),ie=this.#d(ic,'remove-with-file')??id;await this.#n[nE(0x1d2)](ic),await this.#a['purgeRecordArtifacts'](ie);}async['drain'](){await new Promise(ic=>{let id=!0x1,ie=dj,ig=()=>{id||(id=!0x0,ie(),ic());};ie=this['subscribe'](ih=>{ih['type']==='idle'&&ig();}),this.#M()&&ig();});}#d(ic,id){const nF=jn;this.#k(ic);let ie=this.#s[nF(0x291)](ic),ig=this.#D(ic);return ie?(ie['cancellationReason']=id,ie['controller']['abort'](),ie['record']):ig;}async #f(ic,id){let ie=this.#k(ic),ig=this.#s['get'](ic),ih=this.#D(ic);return ig?id==='pause'&&!cS(ig['record'],'analyzing','transferring')?(v['debug']('Pause\x20ignored\x20for\x20non-downloading\x20stage:\x20id='+ic+',\x20stage='+ig['record']['status']),ig['record']):(ig['cancellationReason']=id,await this.#p(ig)):id==='pause'&&ih&&(ie||cS(ih,'queued','analyzing'))?this.#T(ih,{'type':'paused'}):ih;}async #p(ic){const nG=jn;return ic['record']=await this.#T(ic['record'],{'type':'paused'}),ic['controller']['abort'](),await ic[nG(0x1b1)],this.#D(ic['record']['id']);}async #m(ic){let id=await this.#T(ic,{'type':'queued'});this.#O(id['id']),this.#g();}async #h(ic){const nH=jn;await this.#a['purgeRecordArtifacts'](ic);let id=await this.#T(ic,{'type':'retrying'});try{if(id['request']['url']){let ig=await this['analyze'](id['request']['url'],id['request']['options']??{}),ih=dg(id,ig);if(!ih)throw Error('No\x20media\x20entry\x20found');let ii=this.#D(id['id']);if(!ii||!cS(ii,'analyzing','paused')||(id=await this.#w(ii,{'type':'entry-resolved','entry':ih}),cS(id,'paused')))return!0x1;}let ie=this.#D(id['id']);return!ie||!cS(ie,'analyzing')?!0x1:(await this.#m(ie),!0x0);}catch(ij){let ik=this.#D(id['id']);if(!ik||!cS(ik,nH(0x2c3)))return!0x1;let il=cP(ij);return id=await this.#T(ik,{'type':'failed','message':il['message'],'code':di(il)}),this.#P({'type':'job-error','record':id,'error':il}),!0x1;}}#g(){const nI=jn;for(this.#l=this.#t['get']('maxActiveDownloads');this.#s[nI(0x37e)]<this.#l;){let ic=this.#A();if(!ic)break;this.#_(ic);}this.#N();}#_(ic){if(!cS(ic,'queued')){v['warn']('Skipping\x20non-queued\x20job\x20start:\x20'+ic['id']+'\x20('+ic['status']+')');return;}let id={'controller':new AbortController(),'record':ic,'runPromise':Promise['resolve']()};id['runPromise']=this.#v(id)['catch'](ie=>{let ig=ie instanceof Error?ie:Error('Download\x20run\x20failed:\x20'+String(ie));v['error'](ig['message']),this.#P({'type':'error','error':ig});}),this.#s['set'](ic['id'],id);}async #v(ic){const nJ=jn;try{ic['record']=await this.#T(ic['record'],{'type':'analyzing'});let id=await this.#r['run']({'jobId':ic['record']['id'],'request':ic['record']['request'],'filePath':ic['record']['output'][nJ(0x3ba)],'signal':ic['controller']['signal'],'emit':async ie=>{ic['record']=await this.#S(ic,ie);}});if(ic['cancellationReason']||ic['controller']['signal']['aborted'])return;ic['record']=await this.#y(ic['record'],id);}catch(ie){if(dh(ie)||ic['cancellationReason']||ic['controller']['signal']['aborted'])return;ic['record']=await this.#b(ic['record'],ie);}finally{await this.#x(ic);}}async #y(ic,id){let ie=await this.#w(ic,{'type':'entry-resolved','entry':id['entry']});if(!id['transferResult']['downloaded']['length'])throw cO();let ig=db(id);return ie['output']['filePath']||(ie=await this.#w(ie,{'type':'file-path-resolved','filePath':ig})),ie=await this.#w(ie,{'type':'artifacts-recorded','artifacts':dd(id)}),ie=await this.#T(ie,{'type':'completed','progress':await dc(id)}),this.#P({'type':'job-completed','record':ie}),ie;}async #b(ic,id){let ie=cP(id),ig=cT(ic,ie['message']);if(this.#E(ie),ig)return ic;v['error']('Download\x20job\x20failed:\x20'+ie);let ih=await this.#T(ic,{'type':'failed','message':ie['message'],'code':di(ie)});return this.#P({'type':'job-error','record':ih,'error':ie}),ih;}async #x(ic){const nK=jn;let id=ic['cancellationReason'],ie=id==='pause'&&this.#j(ic['record']['id']);if(id===nK(0x208)&&!cS(ic['record'],'paused')&&(ic['record']=await this.#T(ic['record'],{'type':'paused'})),this.#s['delete'](ic['record']['id']),ie&&cS(ic['record'],'paused')){let ig=await this.#T(ic['record'],{'type':nK(0x341)});this.#O(ig['id']);}this.#g();}async #S(ic,id){const nL=jn;let ie=ic['record'];if(this.#C(ic,id))return ie;switch(id['type']){case'transferring':case'processing':return await this.#T(ie,id);case'entry-resolved':case'output-resolved':case'artifact-recorded':case nL(0x1b2):return await this.#w(ie,id);case nL(0x1f4):{let ig=await this.#w(ie,id);return this.#P({'type':'job-progress','record':ig}),ig;}case'queued':case'retrying':case'analyzing':case'paused':case'completed':case'failed':case'file-path-resolved':return await this.#w(ie,id);}}#C(ic,id){let ie=ic['record'];return ic['cancellationReason']||ic['controller']['signal']['aborted']?!0x0:id['type']==='progress'?!cS(ie,'transferring'):id['type']==='transferring'?!cS(ie,'analyzing'):id['type']==='processing'?!cS(ie,'transferring'):!0x1;}async #w(ic,id){let ie=d8(ic,id);await this.#n['updateRecord'](ie);let ig=this.#s['get'](ie['id']);return ig&&(ig['record']=ie),ie;}async #T(ic,id){let ie=await this.#w(ic,id);return this.#P({'type':'job-status-changed','record':ie}),ie;}#E(ic){let id=di(ic);id&&(id==='DOWNLOAD_DIR_NOT_WRITABLE'||id==='NO_FILES_DOWNLOADED')&&C['emit']('error',{'code':id});}#D(ic){return this.#s['get'](ic)?.['record']??this.#n['getRecord'](ic);}#O(ic){this.#s['has'](ic)||this.#o['enqueue'](ic);}#k(ic){return this.#o['remove'](ic);}#A(){for(;this.#o['size']>0x0;){let ic=this.#o['shift']();if(!ic)return;let id=this.#D(ic);if(id&&cS(id,'queued'))return id;}}#j(ic){let id=this.#c['has'](ic);return id&&this.#c['delete'](ic),id;}#M(){return this.#u===0x0&&this.#o['size']===0x0&&this.#s['size']===0x0;}#N(){this.#M()&&this.#P({'type':'idle'});}#P(ic){for(let id of this.#e)id(ic);}};const dl=(ic,id)=>new Input({'source':new UrlSource(ic['url'],{'requestInit':{'headers':ic['headers']},'fetchFn':id}),'formats':ALL_FORMATS}),dm=ic=>{let id;try{id=new URL(ic);}catch{throw Error('Invalid\x20direct\x20media\x20URL:\x20'+ic);}let ie=id['pathname']['replace'](/\/+$/,'')['split']('/')['filter'](Boolean)['pop']();return{'type':'video','title':ie?.['split']('.')['slice'](0x0,-0x1)['join']('.')||ie||id['hostname']||'download','source':{'url':ic}};},dn=async(ic,id)=>{const nM=jn;let ie=id['proxy']||id['proxyMeta'];ie&&(await ic['context']['http'][nM(0x202)]({'proxyUrl':ie}),await H['configure']({'proxyUrl':ie}));},dp=async(ic,id,ie,ig)=>{if(!ie)return v['warn']('No\x20suitable\x20extension\x20available.\x20Downloading\x20as\x20a\x20direct\x20link...'),[dm(ic)];await dn(ie,id),await bR(ie),v['info']('Analyzing\x20URL...');let ih=await bQ(ie)['getEntries']({'url':ic,'options':id,'signal':ig});return ih['length']?[...ih]:(v['info']('No\x20media\x20entries\x20found'),[]);},dq=async({entry:ic,url:id,options:ie,extension:ig,signal:ih})=>{const nN=jn;if(!ig){let ij=ic['source']??{'url':id},ik=ie['proxy']||ie['proxyMeta'];return ik&&await H['configure']({'proxyUrl':ik}),{'entry':{...ic,'source':ij},'input':dl(ij,ik?H['fetch'][nN(0x348)](H):void 0x0)};}await dn(ig,ie),await bR(ig);let ii=bQ(ig);if(typeof ii['resolveEntry']=='function')return await ii['resolveEntry']({'url':id,'options':ie,'entry':ic,'signal':ih});if(!ic[nN(0x37c)]?.['url'])throw Error('Extension\x20'+ig['package']['name']+'\x20must\x20provide\x20entry.source\x20or\x20implement\x20resolveEntry()');return{'entry':ic,'input':dl(ic['source'],ig['context']['http']['fetch']['bind'](ig['context'][nN(0x18b)]))};},dr=ic=>({async 'analyze'(id,ie={},ig){let ih=await dp(id,ie,await ic['getExtensionForUrl'](id),ig);if(!ih?.['length'])throw Error('No\x20media\x20entries\x20found');return ih;}}),ds=['code','errno','syscall','address','port',jn(0x1e1),'hostname','path','type'],dt=ic=>typeof ic=='object'&&!!ic&&'status'in ic&&'statusText'in ic&&'url'in ic,du=ic=>{let id=[],ie=ic;for(let ig of ds){let ih=ie[ig];ih==null||ih===''||id['push'](ig+'='+String(ih));}return id;},dv=(ic,id=0x0)=>{const nO=jn;if(id>0x3)return'[max-depth]';if(ic instanceof Error){let ie=du(ic),ig='cause'in ic?ic['cause']:void 0x0,ih=[ic['name']+':\x20'+ic['message']];return ie['length']&&ih['push']('details='+ie['join'](',\x20')),ig!==void 0x0&&ig!==ic&&ih[nO(0x1d8)]('cause='+dv(ig,id+0x1)),ih['join']('\x20|\x20');}return dt(ic)?'Response\x20'+ic['status']+'\x20'+ic[nO(0x2f5)]+'\x20url='+ic['url']:inspect(ic,{'depth':0x2,'breakLength':0x1/0x0});},dw=(ic,id)=>{v['debug'](ic+':\x20'+dv(id)),id instanceof Error&&id['stack']&&v['debug'](id['stack']);},dx='-----BEGIN\x20PUBLIC\x20KEY-----\x0aMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEySNmB2LZCVyFWw72QX9R+YqlNZRj\x0aOS+aJ6F3EDPV1N3LKoORRHLVh4VtQDObVfNeMpUkhkbZhGt8MaT3VsaZ3A==\x0a-----END\x20PUBLIC\x20KEY-----',dy=({signature:ic,...id})=>{if(!id['timestamp']||!(Math['abs'](Date['now']()-id['timestamp'])<=0x3c*0x3e8)||!ic)return!0x1;let ie=JSON['stringify'](id);return a1['verify']('sha256',Buffer['from'](ie),dx,Buffer['from'](ic,'base64'));},dz=async(ic,id={})=>{const nP=jn;let ie=id['method']||(id['body']?'POST':'GET'),ig={...id['body']?{'Content-Type':'application/json'}:{},...id[nP(0x2ce)]};v['debug'](ie+'\x20'+ic);let ih=await fetch(''+c5()+ic,{'signal':id['signal'],'method':ie,'body':JSON['stringify'](id['body']),'headers':ig})['then'](ii=>ii['json']())['catch'](ii=>(v['error']('Request\x20failed:\x20'+ie+'\x20'+ic),dw('API\x20request\x20failure',ii),null));return v['debug'](ih),!id['skipVerify']&&!dy(ih)?(v['debug'](ih),v['error']('Invalid\x20response\x20from\x20server'),null):ih;},dA=ic=>'manifest:'+ic['type']+':'+ic['id'],dB=ic=>{const nQ=jn;let id=new Map();for(let ie of ic){let ig=dA(ie),ih=id['get'](ig);if(ih){ih['push'](ie);continue;}id[nQ(0x2b9)](ig,[ie]);}return Array['from'](id[nQ(0x1b0)]())['filter'](([,ii])=>ii['length']>0x1);},dC=ic=>{const nR=jn;let id=dB(ic);if(!id['length'])return;let ie=id[nR(0x1b3)](([ig,ih])=>ig+'\x20('+ih['length']+'\x20copies)')['join'](',\x20');throw Object[nR(0x2c6)](Error('Duplicate\x20tracks\x20selected:\x20'+ie),{'code':'DUPLICATE_TRACKS_SELECTED'});},dD='DRM_FREE_TIER_RATE_LIMIT',dE='Free\x20DRM\x20usage\x20is\x20limited\x20to\x20one\x20successful\x20key\x20retrieval\x20every\x2024\x20hours.',dF=0x7530,dG=new Uint8Array([0x8,0x4]),dH=ic=>ic instanceof Error&&ic['message']===dE?new cN(dD,ic[jn(0x275)],{'cause':ic}):ic,dI=ic=>ic?typeof ic=='string'?ic:ic instanceof Uint8Array||ic instanceof ArrayBuffer?Buffer['from'](ic)['toString']('base64'):null:null,dJ=ic=>{if(ArrayBuffer['isView'](ic)){let id=new Uint8Array(ic['buffer'],ic['byteOffset'],ic['byteLength']),ie=new Uint8Array(id['byteLength']);return ie['set'](id),ie;}return new Uint8Array(ic);},dK=async(ic,id)=>{let ie=AbortSignal['timeout'](dF);if(ie['aborted'])throw Error('DRM\x20'+id+'\x20timed\x20out\x20after\x20'+dF+'ms');let ig,ih=new Promise((ii,ij)=>{ig=()=>{ij(Error('DRM\x20'+id+'\x20timed\x20out\x20after\x20'+dF+'ms'));},ie['addEventListener']('abort',ig,{'once':!0x0});});try{return await Promise['race']([ic,ih]);}finally{ig&&ie['removeEventListener']('abort',ig);}},dL=ic=>new Promise(id=>{let ie=ig=>{const nS=b;ic[nS(0x324)]('message',ie),id(ig[nS(0x35f)]['message']);};ic['addEventListener']('message',ie);}),dM=async ic=>{const nT=jn;if(!ic['sessionId']){v['debug']('Skipping\x20DRM\x20session\x20cleanup\x20because\x20the\x20session\x20id\x20is\x20empty');return;}await dK(ic['close'](),'session\x20close'),ic['remove']&&await dK(ic['remove'](),nT(0x262));},dN=({error:ic,initDataBytes:id,initDataType:ie,pssh:ig,sessionId:ih,step:ii})=>{v['debug']('Remote\x20DRM\x20step\x20failure:\x20step='+ii+',\x20sessionId='+(ih||'(none)')+',\x20initDataType='+ie+',\x20initDataBytes='+id+',\x20psshPrefix='+ig['slice'](0x0,0x20)+',\x20error='+dv(ic));},dO=async ic=>{const nU=jn;let id=(await ic['getSegments']()['catch'](()=>[]))[0x0];return id?.['initSegment']?.['encryption']??id?.[nU(0x369)];},dP=async ic=>{const nV=jn;let id=await dO(ic);return[{'system':'widevine','pssh':dI(id?.['drm']?.['widevine']?.['pssh'])},{'system':'playready','pssh':dI(id?.['drm']?.[nV(0x2cb)]?.['pssh'])},{'system':'fairplay','pssh':dI(id?.['drm']?.['fairplay']?.['pssh'])}]['filter'](ie=>ie['pssh']);},dQ=async ic=>{let id=await dO(ic),ie=await dP(ic),ig=id?.['drm']?.['widevine']&&'widevine'||id?.['drm']?.['playready']&&'playready'||id?.['drm']?.['fairplay']&&'fairplay'||null;if(!ig)return null;let ih=ie['find'](ii=>ii['system']===ig);return{'system':ig,'cacheKey':ih?.['pssh']?ig+':'+ih['pssh']:'track:'+dA(ic)};},dR=async ic=>{let id=new Map();for(let ie of ic){let ig=await dP(ie);for(let ih of ig)!ih['pssh']||id['has'](ih['pssh'])||id['set'](ih['pssh'],{'pssh':ih['pssh'],'system':ih['system'],'track':ie});}return id;},dS=({jobId:ic,title:id,entryTitle:ie,psshList:ig,options:ih,error:ii})=>{const nW=jn;v['error']('Failed\x20to\x20extract\x20decryption\x20keys\x20for\x20job\x20'+ic),v['debug']('DRM\x20extraction\x20context:\x20title='+(id||ie||'(unknown)')+',\x20psshCount='+ig[nW(0x2dd)]+',\x20providedKeyCount='+(ih['keys']?.['length']??0x0)),ii instanceof Error?(dw('DRM\x20extraction\x20failure',ii),ii['message']==='Unauthorized'&&C['emit']('error',{'code':'DRM_UNAUTHORIZED'}),ii['message']===nW(0x3b0)&&C['emit']('error',{'code':'DRM_FORBIDDEN'})):v['debug'](String(ii));},dT=async({psshList:ic,requestCertificate:id,requestLicense:ie})=>{const nX=jn;v['debug']('Extracting\x20decryption\x20keys');let ig=[],ih=[...new Set(ic??[])];for(let ii of ih){v[nX(0x388)]('Resolving\x20DRM\x20keys\x20for\x20PSSH\x20'+ii),v['debug']('PSSH:\x20'+ii);let ij=Buffer['from'](ii,'base64'),ik='cenc',il=new Remote({'keySystem':nX(0x37a),'baseUrl':c6(c5(),'drm'),'headers':{'Authorization':nX(0x371)+cr['accessToken']}}),io=null,ip=nX(0x1f6);try{if(io=await il['createSession'](),v['debug']('Created\x20remote\x20DRM\x20session\x20'+(io['sessionId']||'(empty)')),id){ip='requestCertificate',v['debug']('Requesting\x20server\x20certificate...');let iu=dJ(await dK(id({'pssh':ii,'data':dG}),'server\x20certificate\x20transport'));ip='setServerCertificate',await dK(dz('/drm/sessions/'+io['sessionId']+'/set-server-certificate',{'body':{'certificate':Buffer['from'](iu)['toString']('base64')},'headers':{'Authorization':'Bearer\x20'+cr['accessToken']},'skipVerify':!0x0})['then'](iv=>{if(!iv?.['success'])throw Error('Failed\x20to\x20set\x20DRM\x20server\x20certificate');}),'server\x20certificate\x20update');}ip='generateRequest',v['debug']('Generating\x20license\x20request...');let iq=dL(io);await dK(io['generateRequest'](ij,ik),'license\x20request'),ip='licenseRequestEvent';let ir=await dK(iq,nX(0x386));v['debug']('License\x20request\x20of\x20'+ir['length']+'\x20bytes\x20generated\x20for\x20session\x20'+io['sessionId']),ip='requestLicense',v['debug']('Requesting\x20license...');let is=dJ(await dK(ie({'pssh':ii,'data':new Uint8Array(ir)}),'license\x20request\x20transport'));if(is[0x0]===0x7b||is[0x0]===0x3c){v['debug']('License\x20response\x20is\x20not\x20binary');let iv=Buffer['from'](is)['toString']('utf8');if(v['debug'](iv),iv['includes']('<html>'))throw Error('Invalid\x20license\x20response');}ip='updateSession',v['debug']('Updating\x20session...'),await dK(io['update'](is),'session\x20update'),ip='waitForKeys',v['debug']('Waiting\x20for\x20key\x20statuses\x20change...');let it=await dK(io['waitForKeys'](),'key\x20status\x20update');v[nX(0x388)]('Keys\x20count:\x20'+it['size']),ip='cleanup',await dM(io),io=null;for(let [iw,ix]of it){let iy='Key:\x20'+iw+':'+ix;v['debug'](iy),ig[nX(0x1d8)]({'kid':iw,'key':ix});}}catch(iz){throw dN({'error':iz,'initDataBytes':ij['byteLength'],'initDataType':ik,'pssh':ii,'sessionId':io?.['sessionId'],'step':ip}),iz;}finally{if(io)try{await dM(io);}catch{}}}return ig['length']||(v['warn']('Can\x27t\x20get\x20decryption\x20keys'),v['debug']('PSSH:\x20'+ih['join'](',\x20'))),ig;},dU=async({jobId:ic,title:id,entryTitle:ie,options:ig,psshList:ih,selectedTracks:ii,extension:ij,resource:ik})=>{const nY=jn;let il=ig['keys']??[];if(il[nY(0x2dd)])return il;if(!ij)return[];let io=bQ(ij);if(!io['drm'])return[];let ip=[];if(typeof io['drm']['resolveKeys']=='function'){let is=new Map(),it=new Map();for(let iu of ii){let iv=await dQ(iu);if(!iv)continue;let iw=it['get'](iv['cacheKey']);iw||(iw=await io['drm']['resolveKeys']({'system':iv['system'],'resource':ik,'track':iu,'options':ig}),it['set'](iv['cacheKey'],iw));for(let ix of iw)is['has'](ix['kid'])||is['set'](ix['kid'],ix);}ip['push'](...Array['from'](is['values']()));}if(typeof io['drm']['requestLicense']!='function')return ip;let iq=io[nY(0x241)]['requestLicense'],ir=await dR(ii);if(!ir['size'])return ip;try{let iy=await dT({'psshList':ih,'requestCertificate':io['drm']['requestCertificate']?async({pssh:iz,data:iA})=>{const nZ=nY;let iB=ir['get'](iz);if(!iB)throw Error('No\x20DRM\x20track\x20binding\x20found\x20for\x20PSSH\x20'+iz);return await io['drm']['requestCertificate']({'system':iB['system'],'resource':ik,'track':iB[nZ(0x21b)],'options':ig,'data':iA});}:void 0x0,'requestLicense':async({pssh:iz,data:iA})=>{let iB=ir['get'](iz);if(!iB)throw Error('No\x20DRM\x20track\x20binding\x20found\x20for\x20PSSH\x20'+iz);return await iq({'system':iB['system'],'resource':ik,'track':iB['track'],'options':ig,'data':iA});}});ip['push'](...iy);}catch(iz){let iA=dH(iz);throw dS({'jobId':ic,'title':id,'entryTitle':ie,'psshList':ih,'options':ig,'error':iA}),iA;}return ip;},dV=0x1,dW=0x4,dX=0x8,dY=0x10,dZ=(ic,id)=>Math[jn(0x319)](dV,Math['trunc'](typeof ic=='number'&&Number['isFinite'](ic)?ic:id)),e0=ic=>ic['includes']('highConnectionsCount')?dY:ic['includes']('mediumConnectionsCount')?dX:dW,e1=({requestedConnections:ic,fallbackConnections:id=dV,grantedBenefits:ie})=>{const o0=jn;let ig=dZ(ic,dZ(id,dV)),ih=e0(ie),ii=Math[o0(0x196)](ig,ih);return{'connections':ii,'normalizedRequestedConnections':ig,'maxAllowedConnections':ih,'wasClamped':ii<ig};},e2=async ic=>{const o1=jn;let {grantedBenefits:id}=await cC(),ie=null,ig=id['includes']('parallelDownloads'),ih=ic['maxActiveDownloads']&&ic['maxActiveDownloads']>0x1;if(!ig&&ih&&(ie=Error(o1(0x2be)),ic['maxActiveDownloads']=0x1),ic['proxy']||ic['proxyMeta']||ic['proxyMedia']){let ii=id['includes']('proxy'),ij=ic['proxy']||ic['proxyMeta']||ic['proxyMedia'];!ii&&ij&&(ie=Error('PROXY_NOT_ALLOWED'),delete ic['proxy'],delete ic['proxyMeta'],delete ic['proxyMedia']);}if(ic['videoContainerFormat']&&ic['videoContainerFormat']!=='mp4'&&(id['includes']('customMuxFormat')||(ie=Error(o1(0x30d)),ic['videoContainerFormat']='mp4')),typeof ic['connections']=='number'){let {connections:ik}=e1({'requestedConnections':ic['connections'],'grantedBenefits':id});ic[o1(0x287)]=ik;}return{'error':ie,'data':ic};},e3=async()=>{try{let {grantedBenefits:ic}=await cC();return ic;}catch(id){let ie=id instanceof Error?id['message']:String(id);return v['warn']('Failed\x20to\x20resolve\x20customer\x20plan\x20for\x20connection\x20limits.\x20Falling\x20back\x20to\x20Free\x20limits:\x20'+ie),[];}},e4=(ic=e3)=>{let id;return async()=>(id||=ic(),id);},e5=ic=>({'retry':ic['get']('retry'),'connections':ic[jn(0x291)]('connections'),'proxy':ic['get']('proxy'),'proxyMeta':ic['get'](jn(0x2fd)),'proxyMedia':ic[jn(0x291)]('proxyMedia'),'movieTemplate':ic[jn(0x291)]('movieFilenameTemplate'),'episodeTemplate':ic[jn(0x291)]('seriesFilenameTemplate'),'hardsub':ic['get']('preferHardsub'),'format':ic[jn(0x291)](jn(0x27c))}),e6=({options:ic,fallbackConnections:id,grantedBenefits:ie})=>{const o2=jn;let ig=e1({'requestedConnections':ic['connections'],'fallbackConnections':id,'grantedBenefits':ie});return{'options':{...ic,'connections':ig[o2(0x287)]},'limit':ig};},e7=({settings:ic,requestedOptions:id,filePath:ie,grantedBenefits:ig})=>{const o3=jn;let ih=e5(ic),{options:ii,limit:ij}=e6({'options':{...ih,...id},'fallbackConnections':ih['connections'],'grantedBenefits':ig});return ie&&(ii[o3(0x23e)]=ie),{'baseOptions':ih,'options':ii,'limit':ij};},e8=ic=>{const o4=jn;let id=ic['replace'](/[<>:"/\\|?*\x00-\x1F]/g,'');id=id['replace'](/^[\s.]+|[\s.]+$/g,''),id=id[o4(0x3bd)](/\s+/g,'\x20');let ie=id['lastIndexOf']('.'),ig=ie>0x0,ih=ig?id['slice'](ie):'',ii=ig?id[o4(0x201)](0x0,ie):id;if(ih['length']>=0xff)id=id['slice'](0x0,0xff);else{let ik=0xff-ih[o4(0x2dd)];ii['length']>ik&&(ii=ii['slice'](0x0,ik)),id=ii+ih;}let ij=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])$/i;if(ih['length']<0xff){let il=id['lastIndexOf']('.'),io=il>0x0;if(ih=io?id['slice'](il):'',ii=io?id['slice'](0x0,il):id,ij['test'](ii)){let ip=0xff-ih['length'];id=('_'+ii)['slice'](0x0,ip)+ih;}}return id['length']===0x0?'untitled':id;},e9=(ic,id)=>Object[jn(0x1db)](id)['reduce']((ie,ig)=>{let ih='{'+ig+'}',ii=id[ig];if(!ii){let ij=RegExp('(?:\x5c.|^)\x5c{'+ig+'\x5c}(?=\x5c.|$)|\x5c{'+ig+'\x5c}(\x5c.|$)|\x5c{'+ig+'\x5c}','g');return ie['replace'](ij,(ik,il)=>'')['replaceAll']('....','...');}return ie['replaceAll'](ih,ii);},ic)['replaceAll']('\x20\x20','\x20')['replace'](/\(\s*[,._ -]+\s*/g,'(')['replace'](/\s*[,._ -]+\s*\)/g,')')['replace'](/\(\s*\)/g,'')['replace'](/\[\s*[,._ -]+\s*/g,'[')['replace'](/\s*[,._ -]+\s*\]/g,']')['replace'](/\[\s*\]/g,'')['replace'](/\{\s*[,._ -]+\s*/g,'{')['replace'](/\s*[,._ -]+\s*\}/g,'}')['replace'](/\{\s*\}/g,'')['replace'](/\s+/g,'\x20')['trim'](),ea=ic=>typeof ic=='string'&&ic['trim']()||'mp4',eb=ic=>{const o5=jn;switch(ic){case'mp3':return o5(0x3a0);case'aac':case o5(0x1ff):case'ac3':case'eac3':return'm4a';default:return o5(0x396);}},ec=ic=>{if(!ic)return'';switch(ic){case'eac3':return'DDP';case'ac3':return'DD';default:return ic['toUpperCase']();}},ed=({options:ic,settings:id,tracks:ie,audioCodec:ig})=>ie['audios']['length']>0x0&&ie['videos']['length']===0x0&&ie['subtitles'][jn(0x2dd)]===0x0?eb(ig):ea(ic[jn(0x334)]||id['get']('videoContainerFormat')),ee=ic=>{let id=ic['seasonNumber']?''+ic['seasonNumber']:'',ie=ic['episodeNumber']?''+ic['episodeNumber']:'',ig=id?'S'+id:'',ih=ie?'E'+ie:'',ii=id&&ie?ig+':'+ih:'',ij=ic['episodeTitle']?.['trim']()?'\x22'+ic['episodeTitle']+'\x22':'';return((ic['title']??'')+'\x20'+ii+'\x20'+ij)['trim']();},ef=async({settings:ic,options:id,entry:ie,tag:ig,tracks:ih})=>{const o6=jn;let [ii,ij]=await Promise['all']([ih['videos'][0x0]?.['getCodec']()??null,ih['audios'][0x0]?.['getCodec']()??null]),ik=ic['get']('downloadDir'),il=id['movieTemplate']||ic['get']('movieFilenameTemplate'),io=id['episodeTemplate']||ic['get']('seriesFilenameTemplate'),ip=e8(e9(ie['episodeNumber']?io:il,{'title':ie['title']??'','s':ie['seasonNumber']?ie['seasonNumber']['toString']()['padStart'](0x2,'0'):'','e':ie['episodeNumber']?ie['episodeNumber']['toString']()['padStart'](0x2,'0'):'','quality':id['videoQuality']??'','codec':ii??'','tag':ig??'','episodeTitle':ie['episodeTitle']??'','audioType':ec(ij),'format':o6(0x23a)}))+'.'+ed({'options':id,'settings':ic,'tracks':ih,'audioCodec':ij}),iq=id['outputPath']||join(ik,ip),ir=parse(iq);return{'outputPath':iq,'outputDirectory':ir['dir']||ik,'fileName':ir['base'],'baseName':ir['name']};},eg=ic=>{if(!ic)return;let id=Object['fromEntries'](new Headers(ic)['entries']());return Object['keys'](id)['length']?id:void 0x0;},eh=ic=>{let id=ic,ie=id?.['rootPath'];if(typeof ie!='string'||!ie)throw Error('Resolved\x20media\x20resource\x20is\x20missing\x20a\x20usable\x20input\x20source\x20URL');return{'url':ie,'headers':eg(id['_options']?.['requestInit']?.['headers'])};},ei=({videos:ic,audios:id,subtitles:ie,all:ig=[...ic,...id,...ie]})=>({'videos':ic,'audios':id,'subtitles':ie,'all':ig}),ej=ic=>ic?.['trim']()[jn(0x1ed)]()??'',ek=ic=>ej(ic)['slice'](0x0,0x2),el=ic=>(ic??0x0)/0x3e8,em=async ic=>{try{return(await ic['getSegments']())['length']+'\x20Segments';}catch{return'?\x20Segments';}},en=async(ic,id)=>{let ie=id?parseInt(String(id),0xa)*0x10/0x9:void 0x0;return await ic['getVideoTracks']({'filter':async ig=>!await ig['hasOnlyKeyPackets'](),'sortBy':async ig=>[prefer(!!id&&Number(await ig['getDisplayHeight']())===Number(id)),prefer(!!ie&&Number(await ig['getDisplayWidth']())===Number(ie)),desc(await ig['getBitrate']())]});},eo=(ic,id)=>{if(!id?.['length'])return ic;let ie=[];for(let ig of ic)ig['codec']&&id['includes'](ig['codec'])&&ie['push'](ig);return ie['length']?ie:ic;},ep=async({input:ic,video:id})=>await ic[jn(0x357)]({'sortBy':async ie=>[prefer(!id||ie['canBePairedWith'](id)),desc(await ie['getBitrate']())]}),eq=async ic=>await ic['getSubtitleTracks']({'sortBy':async id=>[desc(await id['getBitrate']())]}),er=async ic=>await ic['getName']?.()['catch'](()=>void 0x0)??'',es=async(ic,id={})=>{const o7=jn;let [ie,ig,ih]=await Promise['all']([ic['getLanguageCode']()['catch'](()=>'und'),ic['getCodec']()['catch'](()=>void 0x0),ic['getBitrate']()[o7(0x234)](()=>0x0)]),ii={'id':dA(ic),'track':ic,'type':ic['type'],'language':ie??'und','languageFamily':ek(ie),'label':'','codec':ig??void 0x0,'bitrate':ih??0x0};if(ic['type']==='video'||ic['isVideoTrack']?.()===!0x0){let iq=ic,[ir,is,it]=await Promise['all']([iq['getDisplayWidth']()['catch'](()=>void 0x0),iq['getDisplayHeight']()[o7(0x234)](()=>void 0x0),em(iq)]);return{...ii,'width':ir??void 0x0,'height':is??void 0x0,'label':(ir??'?')+'x'+(is??'?')+'\x20|\x20'+(el(ih)||'?')+'\x20Kbps\x20|\x20'+(ig??'?')+'\x20|\x20'+it};}if(!(ic[o7(0x1d6)]===o7(0x333)||ic['isAudioTrack']?.()===!0x0)){let iu=await em(ic);return{...ii,'label':(ig??'?')+o7(0x272)+(ie||'und')+'\x20|\x20'+iu};}let ij=ic,[ik,il,io,ip]=await Promise['all']([ij['getNumberOfChannels']()['catch'](()=>void 0x0),id[o7(0x268)]?Promise['resolve'](ij['canBePairedWith'](id['pairableWithVideo']))['catch'](()=>!0x1):Promise['resolve'](void 0x0),er(ij),em(ij)]);return{...ii,'channels':ik??void 0x0,'pairableWithPrimaryVideo':il,'label':''+(io?io+'\x20|\x20':'')+(el(ih)||'?')+'\x20Kbps\x20|\x20'+(ig?ig+'\x20|\x20':'')+(ie||'und')+'\x20|\x20'+(ik??'?')+'CH\x20|\x20'+ip};},et=async(ic,id)=>await Promise['all'](ic['map'](async ie=>await es(ie,id))),eu=async({videos:ic,audios:id,subtitles:ie})=>{let ig=ic[0x0],[ih,ii,ij]=await Promise['all']([et(ic),et(id,{'pairableWithVideo':ig}),et(ie)]);return{'videos':ih,'audios':ii,'subtitles':ij};},ev=async(ic,id)=>{let ie=id['videoQuality'],ig=eo(await et(await en(ic,ie||NaN)),id['videoCodecs'])['map'](ih=>ih['track']);return await eu({'videos':ig,'audios':await ep({'input':ic,'video':ig[0x0]}),'subtitles':await eq(ic)});},ew=ic=>ic?.['trim']()['toLowerCase']()??'',ex=ic=>ew(ic)['slice'](0x0,0x2),ey=ic=>ew(ic)||'und',ez=(ic,id)=>{let ie=ew(ic),ig=ew(id);return!ie||!ig?!0x1:ie===ig||ie['startsWith'](ig+'-')?!0x0:ex(ie)===ex(ig);},eA=ic=>Array['from'](new Map(ic['map'](id=>ew(id))['filter'](Boolean)['map'](id=>[ex(id),id]))['values']()),eB=(ic,id)=>{let ie=new Map();for(let ig of ic){let ih=ey(ig['language']),ii=ie['get'](ih);if(!ii){ie['set'](ih,[ig]);continue;}ii['length']<id&&ii['push'](ig);}return Array['from'](ie['values']())['flat']();},eC=(ic,id,ie=0x1)=>{const o8=jn;let ig=ic[o8(0x3c8)]((ik,il)=>il['bitrate']-ik['bitrate']),ih=eA(id),ii=[];for(let ik of ih){let il=[];for(let io of ig)ez(io['language'],ik)&&il['push'](io);il['length']&&ii[o8(0x1d8)](...eB(il,ie));}let ij=eA(ig['map'](ip=>ip['language']||'und'));if(!ii['length'])for(let ip of ij){let iq=[];for(let ir of ig)ez(ir['language']||'und',ip)&&iq['push'](ir);iq['length']&&ii['push'](...eB(iq,ie));}return ii;},eD=(ic,id)=>{const o9=jn;if(!id?.['length'])return ic;let ie=[];for(let ig of ic)ig['codec']&&id['includes'](ig[o9(0x229)])&&ie['push'](ig);return ie['length']?ie:ic;},eE=(ic,id)=>{if(!id)return ic;let ie=[];for(let ig of ic)ig['channels']===Number(id)&&ie['push'](ig);return ie['length']?ie:ic;},eF=({options:ic,catalog:id})=>{const oa=jn;let ie=ic['skipVideo']?void 0x0:id['videos'][0x0],ig=[...ic['languages']||[]],ih=id['audios']['filter'](ik=>ie&&ik['pairableWithPrimaryVideo']);ih['length']||(ih=[...id['audios']]),ih=eE(ih,ic[oa(0x304)]),ih=eD(ih,ic['audioCodecs']);let ii=eC(ih,ig,0x1);ii['length']&&(ih=ii);let ij=[];for(let ik of id['subtitles'])(!ic['subtitleLanguages']?.['length']||ic['subtitleLanguages']['some'](il=>ez(ik['language']||'und',il)))&&ij['push'](ik);return{'videos':ie?[ie]:[],'audios':ic['skipAudio']?[]:ih,'subtitles':ic['skipSubtitles']?[]:ij};},eG=async({options:ic,catalog:id})=>{const ob=jn;let ie=eF({'options':ic,'catalog':id}),ig=ie['audios']['map'](ii=>ii['track']),ih=(ic['languages']||[])['at'](-0x1);if(ih){for(let ii of ie['audios'])(!ii['language']||ii[ob(0x1dd)]==='und')&&ii['track']['setLanguageCode'](ih);}return ei({'videos':ie['videos']['map'](ij=>ij[ob(0x21b)]),'audios':ic[ob(0x1b5)]?[]:ig,'subtitles':ic['skipSubtitles']?[]:ie['subtitles']['map'](ij=>ij['track'])});},eH=ic=>{if(!ic)return null;try{return new URL(ic);}catch{return null;}},eI=(ic,id)=>{if(!id['languages']?.['length'])return(ic['context']?.['legacy']?.['source'])?.['audioLanguage']?.['trim']()||void 0x0;},eJ=(ic,id)=>{const oc=jn;if(ic)switch(ic){case'aar':case'abk':return'rus';case'ave':return'eng';case'zu':return id?.[oc(0x219)]('start.film')?'ru':'zu';default:return ic;}},eK=async(ic,id)=>{const od=jn;let ie=await ic['getLanguageCode']()[od(0x234)](()=>void 0x0),ig=eJ(ie,id);ig&&ig!==ie&&ic['setLanguageCode'](ig);},eL=async(ic,id)=>{const oe=jn;await Promise['all'](ic[oe(0x1b3)](ie=>eK(ie,id)));},eM=(ic,id)=>ic['filter'](ie=>ie['type']===id)[jn(0x2dd)],eN=ic=>{let id='Extracted,\x20there\x20are\x20';if(ic['length']===0x0)id+='no\x20tracks';else{id+=ic['length']+'\x20tracks';let ie=eM(ic,'video');ie&&(id+=',\x20'+ie+'\x20video\x20tracks');let ig=eM(ic,'audio');ig&&(id+=',\x20'+ig+'\x20audio\x20tracks');let ih=eM(ic,'subtitle');ih&&(id+=',\x20'+ih+'\x20subtitle\x20tracks');}v['info'](id);},eO=async(ic,id)=>{let ie=await ic['getSubtitleTracks']();return await eL(ie,id),ie;},eP=(ic,id)=>{const of=jn;v['debug']('URL:\x20'+eh(ic['input']['source'])[of(0x1aa)]);let ie=id['seasonNumber'],ig=id['episodeNumber'],ih=id['episodeTitle']??'',ii=[id['title'],ie?'S'+ie:'',ig?'E'+ig:'',ih]['filter'](Boolean)['join'](of(0x1de));ii&&v['info'](ii);},eQ=(ic,id)=>{const og=jn;if(ic[og(0x21d)])return;let ie=eH(id)?.['pathname']['split']('/')['pop']();ie&&(ic['title']=ie);},eR=(ic,id)=>{if(ic['title'])return;let ie=eH(id)?.['host'];ie&&(ic['title']=ie+'_'+r());},eS=(ic,id)=>{ic['videoQuality']||=id?id+'p':void 0x0;},eT=async({options:ic,resource:id,entry:ie})=>{const oh=jn;let ig=eh(id['input'][oh(0x37c)])['url'],ih={...ic},ii={...ie},ij=id[oh(0x1c5)];eQ(ii,ig);let [ik,il,io]=await Promise['all']([ij[oh(0x266)](),ij['getPrimaryAudioTrack'](),eO(ij,ig)]);eS(ih,await ik?.['getCodedHeight']());let ip=ik&&!ih['skipVideo']?[ik]:[],iq=[];il&&!ih['skipAudio']&&(await eK(il,ig),iq=[il]);let ir=ei({'videos':ip,'audios':iq,'subtitles':io});return eN(ir['all']),{'options':ih,'resource':id,'entry':ii,'tracks':ir,'isSegmented':!0x1};},eU=async({options:ic,resource:id,entry:ie,trackSelector:ig})=>{const oi=jn;let ih=eh(id['input']['source'])['url'],ii={...ic},ij={...ie};await eL(await id['input'][oi(0x33d)](),ih),eR(ij,ih);let ik={...ii},il=eI(ij,ik);il&&(ik[oi(0x21a)]=[il]);let io=await ig({'options':ik,'catalog':await ev(id['input'],ik)});if(eN(io['all']),!io['videos']['length']&&!io['audios']['length']&&!io[oi(0x248)]['length'])throw new cN('No\x20tracks\x20selected');return io['videos'][0x0]&&eS(ii,await io['videos'][0x0]['getDisplayHeight']()),{'options':ii,'resource':id,'entry':ij,'tracks':io,'isSegmented':!0x0};},eV={'direct':eT,'manifest':eU},eW=ic=>ic===HLS||ic===DASH?'manifest':'direct',eX=async({format:ic,options:id,resource:ie,entry:ig,trackSelector:ih})=>(v['info']('Content\x20Matched:\x20'+ic['name']),await eV[eW(ic)]({'options':id,'resource':ie,'entry':ig,'trackSelector':ih})),eY=async({options:ic,resource:id,entry:ie,trackSelector:ig=eG})=>await eX({'format':await id['input']['getFormat'](),'options':ic,'resource':id,'entry':ie,'trackSelector':ig??eG}),eZ=async({settings:ic,options:id,resource:ie,extensionTag:ig,trackSelector:ih})=>{const oj=jn;let ii={...ie[oj(0x2e6)],'id':ie['entry']['id']??crypto['randomUUID']()};eP(ie,ii),v['info']('Parsing\x20streams...');let ij=await eY({'options':{...id},'resource':ie,'entry':ii,'trackSelector':ih}),ik=await ef({'settings':ic,'options':ij['options'],'entry':ij['entry'],'tag':ig,'tracks':ij['tracks']});return await b2(ik[oj(0x3b6)]),{...ij,'output':ik,'downloadTitle':ee(ij['entry'])||ik['baseName']};},f0=async({extensionManager:ic,entry:id,url:ie,options:ig,signal:ih})=>{const ok=jn;let ii=ie?await ic['getExtensionForUrl'](ie):null,ij=await dq({'entry':id,'url':ie??id[ok(0x37c)]?.['url']??'','options':ig,'extension':ii,'signal':ih});return{'resource':ij,'extension':ii,'extensionTag':ii?bt(ii):void 0x0,'beforeDownload':async()=>{!ii||!ie||await bW(ii,{'url':ie,'options':ig,'resource':ij,'signal':ih});},'afterDownload':async ik=>{!ii||!ie||await bX(ii,{'url':ie,'options':ig,'resource':ij,'signal':ih,'skipMux':ik});},'dispose':async()=>{if(ij['dispose']){await ij['dispose']();return;}await ij['input']['dispose']?.();}};};var f1=class{['strategy'];constructor(ic){this['strategy']=ic;}async['prepare'](){await this['strategy']['prepare']?.();}async['process'](ic){let id=await this['strategy']['decryptFile'](ic);return ic['cleanup']&&await rm(ic['input'],{'force':!0x0}),id;}};const f2=ic=>ic['replaceAll']('-','')['toLowerCase']();var f3=class{async['decryptFile'](ic){const ol=jn;let id=new Map();for(let ie of ic['keys']){if(!ie['kid'])throw Error('Shifro\x20requires\x20a\x20KID\x20for\x20every\x20decryption\x20key');id['set'](f2(ie['kid']),f2(ie['key']));}return v[ol(0x388)]('Decrypting\x20via\x20shifro:\x20'+ic['input']),await(await Decryption['init']({'input':new a2({'source':new FilePathSource(ic['input']),'keys':id}),'output':new a3({'target':new FilePathTarget(ic['output'])})}))['execute'](),ic['output'];}};const f4=async(ic,id,ie)=>ie??open(ic,id),f5=ic=>{let id=null;return new StreamSource({'getSize':async()=>(id=await f4(ic,'r',id),(await id['stat']())['size']),'read':async(ie,ig)=>{const om=b;id=await f4(ic,'r',id);let ih=new Uint8Array(ig-ie);return await id[om(0x2c5)](ih,0x0,ig-ie,ie),ih;},'dispose':async()=>{let ie=id;id=null,await ie?.['close']();},'prefetchProfile':'fileSystem'});},f6=ic=>{let id=null;return new StreamTarget(new WritableStream({'start':async()=>{id=await f4(ic,'w',id);},'write':async ie=>{const on=b;if(!id)throw Error(on(0x318)+ic);await id['write'](ie['data'],0x0,ie['data']['byteLength'],ie['position']);},'close':async()=>{let ie=id;id=null,await ie?.['close']();},'abort':async()=>{let ie=id;id=null,await ie?.['close']();}}),{'chunked':!0x0});},f7=/(?:(.+?)\n)?((?:\d{2}:)?\d{2}:\d{2}\.\d{3})\s+-->\s+((?:\d{2}:)?\d{2}:\d{2}\.\d{3})([^\n]*)/g,f8=/^\uFEFF?WEBVTT(?:.|\n)*?\n{2}/,f9=/(?:(\d{2}):)?(\d{2}):(\d{2})\.(\d{3})/,fa={'ar':'ara','de':'deu','en':'eng','es':'spa','fr':'fra','hi':'hin','it':'ita','ja':'jpn','ko':'kor','pl':'pol','pt':'por','ru':'rus','th':jn(0x228),'tr':'tur','uk':'ukr','und':'und','vi':'vie','zh':'zho'},fb=ic=>ic==='subtitle'||ic===jn(0x2f3),fc=ic=>{let id=ic['_muxer']?.['auxWriter'];id?.['start']&&!id['started']&&id['start']();},fd=ic=>{const oo=jn;let id=ic['trim']()['split'](':');if(id['length']<0x2||id['length']>0x3)throw Error('Invalid\x20trim\x20timestamp:\x20'+ic);let ie=Number(id['at'](-0x1)),ig=Number(id['at'](-0x2)),ih=id['length']===0x3?Number(id[0x0]):0x0;if(![ih,ig,ie]['every'](ii=>Number[oo(0x2ab)](ii)&&ii>=0x0))throw Error('Invalid\x20trim\x20timestamp:\x20'+ic);return ih*0xe10+ig*0x3c+ie;},fe=ic=>{const op=jn;let id=f9['exec'](ic);if(!id)throw Error(op(0x2ff)+ic);return 0xe10*0x3e8*Number(id[0x1]||'0')+0x3c*0x3e8*Number(id[0x2])+0x3e8*Number(id[0x3])+Number(id[0x4]);},ff=ic=>{let id=Math['floor'](ic/(0xe10*0x3e8)),ie=Math['floor'](ic%(0xe10*0x3e8)/(0x3c*0x3e8)),ig=Math['floor'](ic%(0x3c*0x3e8)/0x3e8),ih=ic%0x3e8;return id['toString']()['padStart'](0x2,'0')+':'+ie['toString']()['padStart'](0x2,'0')+':'+ig['toString']()['padStart'](0x2,'0')+'.'+ih['toString']()['padStart'](0x3,'0');},fg=ic=>{const oq=jn;let id=[ic['invalidEntries']?.[oq(0x2dd)]?ic['invalidEntries']['length']+oq(0x38b):void 0x0,ic['invalidTimecodes']?.['length']?ic['invalidTimecodes']['length']+'\x20invalid\x20timecodes':void 0x0,ic['invalidIndices']?.[oq(0x2dd)]?ic['invalidIndices']['length']+'\x20invalid\x20indices':void 0x0,ic['timecodeIssues']?.['reversedTimecodes']?.['length']?ic['timecodeIssues']['reversedTimecodes']['length']+'\x20reversed\x20timecodes':void 0x0,ic[oq(0x21f)]?.['overlappingTimecodes']?.['length']?ic['timecodeIssues']['overlappingTimecodes']['length']+oq(0x20a):void 0x0]['filter'](Boolean);return id['length']?'\x20('+id['join'](',\x20')+')':'';},fh=ic=>!!(ic['invalidEntries']?.['length']||ic['invalidTimecodes']?.['length']||ic['invalidIndices']?.['length']||ic['timecodeIssues']?.['reversedTimecodes']?.['length']),fi=(ic,id='.vtt')=>{const or=jn;let ie=ic['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')[or(0x277)]();if(f8['test'](ie))return ie;let {subtitle:ig,status:ih}=convert(ic,id);if(!ih['success']&&fh(ih))throw Error('Failed\x20to\x20convert\x20subtitle\x20to\x20WebVTT'+fg(ih)+'.');return ig['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')['trim']();},fj=ic=>{if(!ic)return;let id=ic['trim']()['toLowerCase']();if(!id)return;let ie=id['split']('-')[0x0]??id;return/^[a-z]{3}$/['test'](ie)?ie:fa[ie];},fk=ic=>{const os=jn;switch(extname(ic)['toLowerCase']()){case'.mp4':case'.m4a':return new Mp4OutputFormat();case os(0x384):case'.mka':return new MkvOutputFormat();case'.mp3':return new Mp3OutputFormat();default:throw Error('Unsupported\x20mux\x20output\x20format:\x20'+ic);}},fl=ic=>new Z({'formats':Y,'source':f5(ic)}),fm=ic=>ic instanceof Mp4OutputFormat?'mov_text':'srt',fn=ic=>{let id=ic['trimBegin']?fd(ic['trimBegin']):void 0x0,ie=ic['trimEnd']?fd(ic['trimEnd']):void 0x0;if(id!==void 0x0&&ie!==void 0x0&&ie<=id)throw Error('trimEnd\x20must\x20be\x20greater\x20than\x20trimBegin');return{'trimBegin':id,'trimEnd':ie};},fo=(ic=0x1)=>{let id=0x0,ie;return ig=>{let ih=ig['timestamp']+id;return ie!==void 0x0&&ih<ie-ic&&(id+=ie+0.000001-ih,ih=ig['timestamp']+id),ie=Math['max'](ie??ih,ih),ih;};},fp=async(ic,id,ie,ig,ih)=>{const ot=jn;let ii=fl(id),ij=await ii['getPrimaryVideoTrack']();if(!ij)throw Error('Missing\x20video\x20track\x20in\x20'+id);let ik=ij['codec'];if(!ik)throw Error('Unknown\x20video\x20codec\x20in\x20'+id);if(ih!==void 0x0&&ih>=await ij['computeDuration']())throw Error('trimBegin\x20excludes\x20the\x20full\x20video\x20track\x20in\x20'+id);let il=new EncodedPacketSink(ij),io=ih===void 0x0?await il['getFirstKeyPacket']({'verifyKeyPackets':!0x0}):await il['getKeyPacket'](ih,{'verifyKeyPackets':!0x0})??await il['getFirstKeyPacket']({'verifyKeyPackets':!0x0});if(!io)throw Error(ot(0x236)+id);let ip=ih===void 0x0?await il['getFirstPacket']({'verifyKeyPackets':!0x0}):void 0x0,iq=new EncodedVideoPacketSource(ik);return ic['addVideoTrack'](iq,{'disposition':await ij['getDisposition'](),'name':ie??await ij[ot(0x3bf)]()??void 0x0,'rotation':ig['supportsVideoRotationMetadata']?await ij['getRotation']():void 0x0}),{'kind':'video','input':ii,'sink':il,'source':iq,'startPacket':io,'startTimestamp':Math['min'](io['timestamp'],ip?.['timestamp']??io['timestamp']),'emit':async ir=>{let is={'decoderConfig':await ij['getDecoderConfig']()??void 0x0},it=!0x0,iu=fo();for await(let iv of il['packets'](io,void 0x0,{'verifyKeyPackets':!0x0}))await iq['add'](iv['clone']({'timestamp':iu(iv)-ir}),it?is:void 0x0),it=!0x1;iq['close']();}};},fq=async(ic,id,ie,ig,ih)=>{const ou=jn;let ii=fl(id),ij=await ii['getPrimaryAudioTrack']();if(!ij)throw Error('Missing\x20audio\x20track\x20in\x20'+id);let ik=await ij[ou(0x191)]();if(!ik)throw Error('Unknown\x20audio\x20codec\x20in\x20'+id);if(ih!==void 0x0&&ih>=await ij['computeDuration']())throw Error('trimBegin\x20excludes\x20the\x20full\x20audio\x20track\x20in\x20'+id);let il=new EncodedPacketSink(ij),io=ih===void 0x0?await il['getFirstPacket']():await il['getPacket'](ih)??await il['getFirstPacket']();if(!io)throw Error('No\x20audio\x20packets\x20found\x20in\x20'+id);let ip=new EncodedAudioPacketSource(ik);return ic['addAudioTrack'](ip,{'disposition':await ij['getDisposition'](),'languageCode':fj(ie)??fj(await ij['getLanguageCode']()),'name':ig??await ij['getName']()??void 0x0}),{'kind':'audio','input':ii,'sink':il,'source':ip,'startPacket':io,'startTimestamp':io['timestamp'],'emit':async iq=>{const ov=ou;let ir={'decoderConfig':await ij['getDecoderConfig']()??void 0x0},is=!0x0,it=fo(0x0);for await(let iu of il['packets'](io))await ip[ov(0x227)](iu['clone']({'timestamp':it(iu)-iq}),is?ir:void 0x0),is=!0x1;ip['close']();}};},fr=(ic,{trimBegin:id,trimEnd:ie,commonStart:ig})=>{const ow=jn;let ih=ic['replaceAll']('\x0d\x0a','\x0a')['replaceAll']('\x0d','\x0a')['trim']();if(!f8['test'](ih))throw Error('Only\x20WebVTT\x20subtitles\x20are\x20supported\x20by\x20the\x20MediaBunny\x20muxer.');let ii=id===void 0x0?void 0x0:Math[ow(0x280)](id*0x3e8),ij=ie===void 0x0?void 0x0:Math['round'](ie*0x3e8),ik=Math['round'](ig*0x3e8);f7[ow(0x238)]=0x0;let il=f7['exec'](ih),io=ih['slice'](0x0,il?.['index']??ih['length'])['trimEnd'](),ip=[],iq=il?ih['slice'](il['index']):'';for(;;){f7['lastIndex']=0x0;let ir=f7['exec'](iq);if(!ir)break;let is=ir['index']+ir[0x0]['length'],it=iq['indexOf']('\x0a',is)+0x1,iu=iq['indexOf']('\x0a\x0a',is);iu===-0x1&&(iu=iq['length']);let iv=ir[0x1]?.['trim'](),iw=ir[0x4]?.['trim'](),ix=iq['slice'](it,iu)['trim'](),iy=fe(ir[0x2]),iz=fe(ir[0x3]),iA=Math[ow(0x319)](iy,ii??iy)-ik,iB=Math['min'](iz,ij??iz)-ik;if(iB>iA){let iC=ff(iA)+'\x20-->\x20'+ff(iB)+(iw?'\x20'+iw:'');ip[ow(0x1d8)]([iv,iC,ix]['filter'](Boolean)['join']('\x0a'));}iq=iq['slice'](iu)['trimStart']();}return[io,...ip]['filter'](Boolean)['join']('\x0a\x0a');},ft=async(ic,id,ie,ig,ih)=>{const ox=jn;if(ie['type']==='video'){if(id instanceof Mp3OutputFormat)throw Error('MP3\x20output\x20does\x20not\x20support\x20video\x20tracks.');return fp(ic,ie['path'],ie['label'],id,ig);}if(ie['type']===ox(0x333))return fq(ic,ie['path'],ie['language'],ie['label'],ig);if(fb(ie[ox(0x1d6)])){if(id instanceof Mp3OutputFormat)throw Error('MP3\x20output\x20does\x20not\x20support\x20subtitle\x20tracks.');let ii=fi(await readFile(ie['path'],ox(0x26a))),ij=new TextSubtitleSource(fm(id));return ic['addSubtitleTrack'](ij,{'disposition':ie['forced']?{'forced':!0x0}:void 0x0,'languageCode':fj(ie['language']),'name':ie['label']}),{'kind':ox(0x1fa),'source':ij,'emit':async ik=>{let il=fr(ii,{'trimBegin':ig,'trimEnd':ih,'commonStart':ik});await ij['add'](il),ij['close']();}};}throw Error('Unsupported\x20mux\x20input\x20type:\x20'+ie['type']);};var fu=class{async['mux'](ic){let {trimBegin:id,trimEnd:ie}=fn(ic),ig=fk(ic['output']),ih=new Output({'format':ig,'target':f6(ic['output'])}),ii=[];try{for(let il of ic['inputs'])ii['push'](await ft(ih,ig,il,id,ie));let ij=ii['filter'](io=>io['kind']!=='subtitle');if(!ii['length'])throw Error('No\x20tracks\x20provided\x20for\x20muxing.');let ik=ij['length']>0x0?Math['min'](...ij['map'](io=>io['startTimestamp'])):id??0x0;await ih['start'](),fc(ih);for(let io of ii){if(io['kind']==='subtitle'){await io['emit'](ik);continue;}await io['emit'](ik);}return await ih['finalize'](),ic['output'];}catch(ip){throw await ih['cancel']()['catch'](()=>void 0x0),ip;}finally{for(let iq of ii)iq['kind']!=='subtitle'&&iq['input']['dispose']();}}},fv=class{['strategy'];constructor(ic){this['strategy']=ic;}async[jn(0x235)](){const oy=jn;await this[oy(0x2f1)]['prepare']?.();}async['process'](ic){let id=await this['strategy']['mux'](ic);if(ic['cleanup']){for(let ie of new Set(ic['inputs']['map'](ig=>ig['path'])))await rm(ie,{'force':!0x0});}return id;}};const fw=()=>{const oz=jn;if(!(process['platform']!=='win32'||process.env.ELECTRON_RUN_AS_NODE!=='1')&&!isatty(process['stderr']['fd'])&&ag()?.['getConsoleSize']?.()?.['columns'])try{let ic=ae(oz(0x27b));ic&&ic['isTTY']===!0x1&&(ic['isTTY']=!0x0,ic[oz(0x1d7)]?.['frames']?.['length']===0x1&&(ic['symbols'][oz(0x232)]=['-','\x5c','|','/']));}catch{}},fx=ic=>{const oA=jn;let id=process[oA(0x37f)];if(!ic||process[oA(0x1cc)]!=='win32'||process.env.ELECTRON_RUN_AS_NODE!=='1')return id;if(!id['columns']||id['columns']!==ic){let ie=Object['getOwnPropertyDescriptor'](id,'columns')??Object['getOwnPropertyDescriptor'](Object['getPrototypeOf'](id),'columns');if(!ie||ie['writable']||ie['set'])try{id['columns']=ic;}catch{}if(id['columns']!==ic){let ig=Object['create'](id);return Object['defineProperty'](ig,'columns',{'value':ic,'configurable':!0x0,'enumerable':!0x0,'writable':!0x0}),v['warn']('Unable\x20to\x20override\x20stderr.columns;\x20using\x20spinner-local\x20width\x20'+ic+'.'),ig;}}return id;},fy={'debug':'gray','info':jn(0x3b7),'warn':'yellow','error':'red'},fz=ic=>{let id=ic['toUpperCase'](),ie=T[fy[ic]];return ie(id);},fA=(ic,id)=>typeof id=='string'?ic+'\x20'+id:id&&{...id,'text':(ic+'\x20'+(id['text']??''))['trimEnd']()},fB=(ic,id)=>{fw();let ie=F(fz('info')),ig=createSpinner(ic,{'stream':fx(ag()?.['getConsoleSize']?.()?.['columns']??process['stderr']['columns']??process['stdout']['columns']??(process['platform']==='win32'?0x78:0x50))})['start']({'text':ie+'\x20'+ic,'color':id}),ih=ig['update']['bind'](ig),ii=ig['success']['bind'](ig),ij=ig['error']['bind'](ig);return ig['update']=ik=>ih(fA(ie,ik)),ig['success']=ik=>ii(fA(ie,ik)),ig['error']=ik=>ij(fA(ie,ik)),ig;},fC={'update':()=>void 0x0,'success':()=>void 0x0,'error':()=>void 0x0},fD={'createTask':()=>fC,'progress':()=>void 0x0},fE=()=>({'createTask':(ic,id)=>{let ie=fB(ic,id?.['color']);return{'update':ig=>ie['update'](ig),'success':ig=>ie['success'](ig),'error':ig=>ie['error'](ig)};},'progress':()=>void 0x0}),fF=async ic=>{const oB=jn;if(!ic[oB(0x1db)]['length'])return[...ic['inputs']];let id=ic['inputs']['map'](ii=>({...ii})),ie=(ic['reporter']??fD)['createTask']('Decrypting'),ig=new f1(new f3());await ig['prepare']();let ih=new Map();for(let ii of id){if(ii['type']!=='video'&&ii['type']!=='audio')continue;let ij=ih['get'](ii['path']);if(ij){ii['path']=ij;continue;}let ik=ii['path'],il=extname(ik),io=ik['replace'](il,'.dec'+il);if(await ig[oB(0x271)]({'input':ik,'output':io,'keys':ic['keys'],'type':ii['type'],'cleanup':!0x0}),!existsSync(io))throw Error('Decryption\x20failed\x20for\x20file\x20'+ik+'.\x20Unable\x20to\x20find\x20'+io);ih['set'](ik,io),ii['path']=io;}return ie['success']('Decrypted'),id;},fG=async ic=>{const oC=jn;if(ic['skipMux'])return;let id=ic['skipSubtitlesMux']?ic['inputs']['filter'](ih=>ih['type']!=='subtitle'):ic['inputs'];if(!id['length'])return;let ie=(ic['reporter']??fD)['createTask']('Muxing'),ig=new fv(new fu());if(await ig['prepare'](),await ig['process']({'inputs':id,'output':ic['output'],'trimBegin':ic['trimBegin'],'trimEnd':ic['trimEnd'],'cleanup':!0x0}),existsSync(ic[oC(0x3be)]))return ie['success']('Muxed'),v['debug']('Muxed:\x20'+ic['output']),ic['output'];ie['error']('Muxing\x20failed.\x20Output\x20file\x20not\x20found:\x20'+ic[oC(0x3be)]);},fH=async ic=>{let id=await fF(ic);return{'outputPath':await fG({...ic,'inputs':id}),'artifacts':id};},fI=a0['default']??a0,fJ=0x5,fK=0x493e0,fL=(ic={})=>{const oD=jn;let id=ic['maxRetries']??0x5,ie=!0x1,ig=!0x1,ih=null,{proxy:ii}=ic,ij=ii?new ProxyAgent({'uri':ii,'allowH2':!0x0}):new Agent({'allowH2':!0x0}),ik=fI['create']({'fetch':ic['fetch'],'dispatcher':ij,'proxy':ii,'timeout':fK,'retry':{'limit':id,'methods':['get','head'],'statusCodes':[0x198,0x19d,0x1ad,0x1f4,0x1f6,0x1f7,0x1f8],'backoffLimit':0x7530},'throwHttpErrors':!0x0,'redirect':'follow','headers':{'user-agent':oD(0x303)}});return Object['assign'](ik,{'close':async()=>{if(ih)return ih;ie||ig||(ie=!0x0,ih=ij['close'](),await ih);},'destroy':async il=>{if(ih)return ih;ie||ig||(ie=!0x0,ig=!0x0,ih=ij['destroy'](il??null),await ih);}});},fM=ic=>new Promise(id=>setTimeout(id,ic)),fN=async(ic,id)=>{const oE=jn;let ie=await V['stat'](id)['catch'](()=>null);(!ie||!ie[oE(0x362)]())&&await V[oE(0x194)](id,{'recursive':!0x0});let ig=fO(ic,id),ih=await V['stat'](ig)['catch'](()=>null);return(!ih||!ih['isDirectory']())&&await V['mkdir'](ig,{'recursive':!0x0}),ig;},fO=(ic,id)=>{let ie=R['resolve'](ic),ig=R['parse'](ic)['name'],ih=createHash('sha1')['update'](ie)['digest']('hex')['slice'](0x0,0xa);return R['join'](id,ig+'-'+ih);},fP=async ic=>{let id=R['dirname'](ic),ie=R['resolve'](id);R['parse'](ie)['root']!==ie&&(await V['stat'](id)['then'](()=>!0x0)['catch'](()=>!0x1)||await V['mkdir'](id,{'recursive':!0x0}));},fQ=async(...ic)=>{let id=[];for(let ie of ic)ie&&id['push'](V['rm'](ie,{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));await Promise['all'](id);},fR=ic=>ic+'.part.json',fS=ic=>{const oF=jn;if(ic[oF(0x3ba)])return ic['filePath'];if(ic['output'])return fR(ic['output']);throw Error('Either\x20output\x20or\x20filePath\x20is\x20required\x20for\x20FileResumeStore');},fT=ic=>{if(!ic||typeof ic!='object')return!0x1;let id='code'in ic?ic['code']:void 0x0;return id==='EPERM'||id==='EACCES'||id==='EBUSY';},fU=async(ic,id)=>{const oG=jn;let ie=W['platform']===oG(0x242)?[0x0,0x32,0x96,0x12c,0x1f4]:[0x0],ig;for(let ih of ie){ih>0x0&&await fM(ih);try{await V['rename'](ic,id);return;}catch(ii){if(ig=ii,!fT(ii))break;await V['rm'](id,{'force':!0x0})['catch'](()=>void 0x0);try{await V['rename'](ic,id);return;}catch(ij){if(ig=ij,!fT(ij))break;}}}throw ig;};var fV=class{async['get'](ic){let id=fS(ic);if(!await V['stat'](id)['then'](()=>!0x0)['catch'](()=>!0x1))return null;try{let ie=await V['readFile'](id,'utf8');return JSON['parse'](ie);}catch{return null;}}async[jn(0x2b9)](ic,id){let ie=fS(ic);await fP(ie);let ig=ie+'.'+W['pid']+'.'+Date['now']()['toString'](0x24)+'.tmp';await V['writeFile'](ig,JSON['stringify'](id));try{await fU(ig,ie);}finally{try{await V['rm'](ig,{'force':!0x0});}catch{}}}async['delete'](ic){let id=fS(ic);await V['rm'](id,{'force':!0x0})['catch'](()=>void 0x0);}};const fW=0x2,fX=ic=>R['resolve'](ic),fY=ic=>createHash('sha1')['update'](fX(ic))['digest']('hex'),fZ=ic=>ic['map']((id,ie)=>({'index':ie,'start':id['start'],'end':id['end'],'output':id['output'],'completed':!0x1,'bytesWritten':0x0})),g0=(ic,id)=>ic['parts']['length']===id['length']?ic['parts']['every']((ie,ig)=>{const oH=jn;let ih=id[ig];return ih?ie['start']===ih['start']&&ie['end']===ih['end']&&(ie['output']??null)===(ih[oH(0x3be)]??null):!0x1;}):!0x1,g1=(ic,id)=>!id||!ic['sourceSignature']?!0x0:ic['sourceSignature']===id,g2=ic=>{let id=ic['parts']['reduce']((ie,ig)=>ie+ig['bytesWritten'],0x0);return id>0x0?id:ic['bytesDownloaded'];},g3=ic=>{const oI=jn;if(!ic||typeof ic!='object')return!0x1;let id=ic;return id['version']===0x2&&typeof id[oI(0x2a8)]=='string'&&Array['isArray'](id[oI(0x3c4)])&&typeof id['bytesDownloaded']=='number';};var g4=class{['key'];['output'];['filePath'];['cleanupOnSuccess'];['store'];['target'];['trustExplicitKey'];constructor(ic={}){const oJ=jn;if(this['output']=ic['output'],this['filePath']=ic['filePath'],this['key']=ic['key']??(this['output']?fY(this['output']):''),!this['key'])throw Error('Resume\x20key\x20is\x20required\x20when\x20output\x20is\x20not\x20provided');this['store']=ic['store']??new fV(),this[oJ(0x382)]=ic['cleanupOnSuccess']??!0x0,this['target']={'key':this['key'],'output':this['output'],'filePath':this['filePath']},this['trustExplicitKey']=typeof ic[oJ(0x2a8)]=='string'&&ic['key']['length']>0x0;}async['read'](){let ic=await this['store']['get'](this['target']);return g3(ic)?ic:null;}async['write'](ic){let id=new Date()['toISOString'](),ie={...ic,'version':0x2,'key':this['key'],'output':ic['output']??this['output'],'bytesDownloaded':g2(ic),'createdAt':ic['createdAt']||id,'updatedAt':id};await this['store']['set'](this['target'],ie);}async['delete'](){await this['store']['delete'](this['target']);}['createState'](ic){let id=new Date()['toISOString']();return{'version':0x2,'key':this['key'],'output':this['output'],'input':ic['input'],'bytesTotal':ic['bytesTotal'],'bytesDownloaded':0x0,'parts':fZ(ic['parts']),'sourceSignature':ic['sourceSignature'],'planner':ic['planner'],'createdAt':id,'updatedAt':id};}['reconcileState'](ic,id){const oK=jn;let ie=ic['version']!==0x2,ig=ic['key']!==this['key'],ih=!this[oK(0x398)]&&!g1(ic,id[oK(0x2ad)]),ii=!g0(ic,id['parts']);if(ie||ig||ih||ii)return{'state':this['createState'](id),'reset':!0x0};let ij={...ic,'key':this['key'],'output':this['output'],'input':id['input'],'bytesTotal':id['bytesTotal'],'sourceSignature':id['sourceSignature'],'planner':id[oK(0x205)],'parts':id['parts']['map']((ik,il)=>{const oL=oK;let io=ic['parts'][il];return{'index':il,'start':ik['start'],'end':ik['end'],'output':ik['output'],'completed':io?.['completed']??!0x1,'bytesWritten':io?.[oL(0x3b4)]??0x0};}),'createdAt':ic['createdAt'],'updatedAt':ic['updatedAt']};return ij['bytesDownloaded']=g2(ij),{'state':ij,'reset':!0x1};}['markPartCompleted'](ic,id,ie){let ig=ic['parts'][id];if(!ig)return ic;let ih=ig['bytesWritten'];return ig['completed']=!0x0,ig['bytesWritten']=ie,ic['bytesDownloaded']=Math['max'](0x0,ic['bytesDownloaded']-ih+ie),ic['updatedAt']=new Date()['toISOString'](),ic;}async['getProgress'](){const oM=jn;let ic=await this['read']();if(!ic)return null;let id=ic['bytesDownloaded'];if(ic['bytesTotal']){let ih=ic['bytesTotal'];return{'bytesDownloaded':id,'totalBytes':ih,'percentComplete':ih>0x0?Math['round'](id/ ih*0x64):0x0};}let ie=ic['parts']['length'],ig=ic[oM(0x3c4)]['filter'](ii=>ii['completed'])['length'];return{'bytesDownloaded':id,'totalBytes':null,'percentComplete':ie>0x0?Math[oM(0x280)](ig/ ie*0x64):0x0,'segmentsCompleted':ig,'segmentsTotal':ie};}};const g5=0x8*0x2**0x14,g6=(ic,id,ie)=>{const oN=jn;let ig='part_'+ie+oN(0x203);return R['join'](id,ig);},g7=(ic,id,ie)=>{let ig=Math['ceil'](ic/Math['max'](0x1,id));return Math['max'](0x1,Math['min'](ig,Math['max'](0x1,ie)));},g8=(ic,id,ie)=>{let ig=g7(ic,id,ie),ih=[],ii=0x0;for(;ii<ic;){let ij=Math['min'](ic-0x1,ii+ig-0x1);ih['push']([ii,ij]),ii=ij+0x1;}return ih;},g9=ic=>{let [id,ie]=ic;return'bytes='+id+'-'+(ie||'');},ga=ic=>g8(ic['contentLength'],ic['maxWorkerCount'],ic['maxChunkSize']??g5)['map'](id=>{const oO=jn;let [ie,ig]=id,ih=new Headers(ic[oO(0x377)]?.['headers']);return ih['set']('Range',g9([ie,ig])),{'url':ic['url'],'headers':ih,'start':ie,'end':ig};}),gb=ic=>{const oP=jn;let id=ic?Error('The\x20operation\x20was\x20aborted',{'cause':ic}):Error(oP(0x27d));return id['name']='AbortError',id;},gc=ic=>{if(!(ic instanceof Error))return!0x1;if(ic['name']==='AbortError'||ic['code']==='ABORT_ERR')return!0x0;let id=ic['cause'];return id instanceof Error&&id['name']==='AbortError';},gd=new WeakMap(),ge=new WeakSet(),gf=async ic=>await ic['client']['get'](ic['url'],{'redirect':'follow',...ic['requestInit']}),gg=(ic,id,ie,ig)=>async ih=>{const oQ=jn;if(ie?.['aborted'])throw gb();let ii=typeof id=='number'?{'flags':'r+','start':id}:{'flags':'w'},ij=P[oQ(0x3c6)](ic,ii),ik=Readable['fromWeb'](ih['body']),il=0x0,io=new Transform({'transform'(ip,iq,ir){il+=ip['byteLength'],ig?.(ip['byteLength']),ir(null,ip);}});try{await pipeline(ik,io,ij,{'signal':ie});}catch(ip){throw gc(ip)?gb(ip):ip;}if(ie?.['aborted'])throw gb();return gd[oQ(0x2b9)](ih,il),ig&&ge[oQ(0x227)](ih),ih;},gh=(ic,id,ie)=>ig=>{const oR=jn;if(ie?.['aborted'])throw gb();let ih=parseInt(ig['headers'][oR(0x291)]('content-length')||'0',0xa),ii=Number['isFinite'](ih)&&ih>0x0?ih:gd[oR(0x291)](ig)??0x0;if(ge['has'](ig)?ic['completePart'](ii):ic['increase'](ii),ie?.['aborted'])throw gb();return id&&!ie?.['aborted']?id(ic['toProgressInfo']()):ic['log'](),ig;},gi=ic=>typeof ic=='boolean'?{'enabled':ic,'key':void 0x0,'store':void 0x0,'filePath':void 0x0,'cleanupOnSuccess':!0x0}:ic?{'enabled':ic['enabled']??!0x0,'key':ic['key'],'store':ic['store'],'filePath':ic['filePath'],'cleanupOnSuccess':ic['cleanupOnSuccess']??!0x0}:{'enabled':!0x1,'key':void 0x0,'store':void 0x0,'filePath':void 0x0,'cleanupOnSuccess':!0x0},gj=ic=>({'tempDir':ic['tempDir']??process['cwd'](),'maxRetries':ic['maxRetries']??0x5,'maxChunkSize':ic['maxChunkSize']??g5,'maxWorkerCount':ic['maxWorkerCount']??0x4,'resume':gi(ic['resume']),'proxy':ic['proxy'],'requestInit':ic['requestInit'],'fetchFn':ic[jn(0x250)]}),gk={'total':{'b':0x0,'mb':0x0},'current':{'b':0x0,'mb':0x0},'chunkSize':0x0,'chunkSizes':[],'averageSize':{'b':0x0,'mb':0x0},'averageTotal':{'b':0x0,'mb':0x0},'speed':{'bps':0x0,'mbps':0x0},'completedParts':0x0},gl=(ic,id)=>id<=0x0||ic>=id?0x64:Math['min'](99.9,(ic+0x1)/ id*0x64),gm=ic=>{let id=Math['floor'](ic/0xe10),ie=Math['floor'](ic%0xe10/0x3c),ig=ic%0x3c,ih=id>0x0?id+'h':'',ii=ie>0x0?ie+'m':'',ij=ig>0x0?ig+'s':'';return id>0x0?ih+'\x20'+(ii||'0m')+'\x20'+(ij&&''+ij):!id&&ie>0x0?ii+'\x20'+(ij&&''+ij):ij;},gn=(ic=0x0)=>{let id=structuredClone(gk),ie=0x0,ig=setInterval(()=>{const oS=b;ie>0x1&&(id['speed']['bps']=id[oS(0x20d)]['b']/ ie),ie+=0.5;},0x1f4);return{'state':id,'setTotal':ih=>{id['total']['b']=ih,id['total']['mb']=ih/0x400/0x400;},'setCurrent'(ih,ii=0x0){const oT=b;id['current']['b']=ih,id['current']['mb']=ih/0x400/0x400,id['completedParts']=ii,ii>0x0&&(id['averageSize']['b']=ih/ ii,id['averageSize']['mb']=id['averageSize']['b']/0x400/0x400,id[oT(0x263)]['b']=ic*id['averageSize']['b'],id['averageTotal']['mb']=id['averageTotal']['b']/0x400/0x400);},'addBytes'(ih){const oU=b;id['current']['b']+=ih,id['current']['mb']=id['current']['b']/0x400/0x400,id['speed'][oU(0x25a)]=id['speed']['bps']/0x400/0x400,id['chunkSize']=ih;},'completePart'(ih=id['chunkSize']){id['chunkSizes']['push'](ih),id['completedParts']+=0x1,id['averageSize']['b']=id['current']['b']/ id['completedParts'],id['averageSize']['mb']=id['averageSize']['b']/0x400/0x400,id['averageTotal']['b']=ic*id['averageSize']['b'],id['averageTotal']['mb']=id['averageTotal']['b']/0x400/0x400;},'increase'(ih){this['addBytes'](ih),this['completePart']();},'stop'(){clearInterval(ig),Object['assign'](id,gk);},'log'(){let ih=id['current']['b'],ii=id['total']['b'],ij=ih+(ii?'/'+ii:'');stdout['write']('\x0dDownloading\x20['+ij+']');},'stopLog'(){stdout['write']('\x0a');},'toString'(){const oV=b;let ih='';id['speed']['bps']&&(ih+=id['speed']['mbps']['toFixed'](0x1)+'\x20MB/s\x20–\x20'),ih+=''+id['current']['mb']['toFixed'](0x1),id['total']['b']?ih+='\x20of\x20'+id['total']['mb']['toFixed'](0x1)+'\x20MB':ih+='\x20MB';let ii=id['total']['b']||id['averageTotal']['b'];if(ii){let ij=ii-id['speed']['bps']*ie,ik=Math['round'](ij/ id[oV(0x394)]['bps']),il=gm(ik);ik&&isFinite(ik)&&il&&(ih+=',\x20'+il+'\x20left');}return ih;},'toProgressInfo'(){const oW=b;let ih=id['total']['b']||null,ii=ih?null:id[oW(0x263)]['b']||null,ij=ih??ii,ik=ij?Math['min'](Math['max'](id['current']['b']/ ij*0x64,0x0),0x64):null;if(ii!==null&&ik!==null&&id[oW(0x39b)]<ic){let io=gl(id[oW(0x39b)],ic);ik>io&&(ik=io,ii=Math['ceil'](id['current']['b']/(io/0x64)),ij=ii);}let il=ij?Math['max'](ij-id['current']['b'],0x0):null;return{'bytesDownloaded':id['current']['b'],'totalBytes':ih,'estimatedTotalBytes':ii,'percentComplete':ik,'bytesPerSecond':id['speed']['bps'],'estimatedSecondsRemaining':id['speed']['bps']>0x0&&il!==null?il/ id['speed']['bps']:null};}};},go=new Set(['authorization','cookie','set-cookie','x-amz-date',jn(0x2c0),'x-amz-content-sha256',jn(0x28a),jn(0x247)]),gp=(ic,id={})=>{if(!ic)return[];let ie=id['includeVolatile']??!0x1,ig=[];return new Headers(ic)['forEach']((ih,ii)=>{!ie&&go['has'](ii['toLowerCase']())||ig['push']([ii,ih]);}),ig['sort'](([ih],[ii])=>ih['localeCompare'](ii)),ig;},gq=ic=>{const oX=jn;try{let id=new URL(ic),ie=id['pathname']['split']('/')['map'](ig=>ig&&(ig['includes']('=')||ig['includes'](',')?':volatile':ig))[oX(0x299)]('/');return''+id['origin']+ie;}catch{let ig=String(ic);return(ig['split']('#')[0x0]??ig)['split']('?')[0x0]||ig;}},gr=ic=>({'url':gq(ic['url']),'start':ic['start'],'end':ic[jn(0x28c)],'output':ic['output'],'headers':gp(ic['headers'])}),gs=ic=>{let id={'input':Array['isArray'](ic['input'])?ic['input']['map'](ie=>gr(ie)):gq(String(ic['resolvedUrl'])),'requestHeaders':gp(ic['requestHeaders']),'parts':ic['parts']['map'](ie=>gr(ie)),'maxWorkerCount':ic['maxWorkerCount'],'maxChunkSize':ic['maxChunkSize']};return createHash('sha1')['update'](JSON['stringify'](id))['digest']('hex');},gt=async ic=>{const oY=jn;if(!ic['manager'])return null;let id={'input':Array['isArray'](ic['input'])?ic['input']:ic['resolvedUrl'],'parts':ic['parts'],'bytesTotal':ic['bytesTotal'],'sourceSignature':ic['sourceSignature'],'planner':{'maxWorkerCount':ic['maxWorkerCount'],'maxChunkSize':ic['maxChunkSize']}},ie=await ic[oY(0x1fe)]['read'](),ig=(ie?ic['manager']['reconcileState'](ie,id):null)?.[oY(0x3a8)]??ic['manager']['createState'](id);return await ic['manager']['write'](ig),ig;},gu=ic=>{const oZ=jn;if(ic&&!ic['parts']['every'](id=>id[oZ(0x370)]))throw Error('Not\x20all\x20segments\x20were\x20downloaded\x20successfully.\x20Try\x20resuming\x20later.');},gv=ic=>{const p0=jn;if(Array[p0(0x18d)](ic[p0(0x1c5)]))return ic['input']['map']((id,ie)=>({...id,'output':g6(ic['url'],ic['tempFileDir'],ie)}));if(!ic['acceptsRanges'])throw Error('Unable\x20to\x20get\x20parts');if(!ic['size'])throw Error('Size\x20is\x20not\x20known');return ga({'url':ic['url'],'requestInit':ic['requestInit'],'contentLength':ic['size'],'maxWorkerCount':ic['maxWorkerCount'],'maxChunkSize':ic['maxChunkSize']});},gw=async ic=>{const p1=jn;if(!ic[p1(0x3c4)]['some'](ie=>typeof ie[p1(0x29a)]=='number'&&(ie['output']??ic['output'])===ic['output'])||await V['stat'](ic[p1(0x3be)])['then'](()=>!0x0)['catch'](()=>!0x1))return;let id=await V['open'](ic['output'],'w');ic['size']&&ic[p1(0x37e)]>0x0&&await id['truncate'](ic['size']),await id['close']();};var gx=ab((ic,id)=>{function ie(ig){var ih=new ig(),ii=ih;function ij(){var il=ih;return il['next']?ih=il['next']:(ih=new ig(),ii=ih),il['next']=null,il;}function ik(il){ii['next']=il,ii=il;}return{'get':ij,'release':ik};}id['exports']=ie;}),gy=ab((ic,id)=>{var ie=gx();function ig(ik,il,io){if(typeof ik=='function'&&(io=il,il=ik,ik=null),!(io>=0x1))throw Error('fastqueue\x20concurrency\x20must\x20be\x20equal\x20to\x20or\x20greater\x20than\x201');var ip=ie(ii),iq=null,ir=null,is=0x0,it=null,iu={'push':iB,'drain':ih,'saturated':ih,'pause':iw,'paused':!0x1,get 'concurrency'(){return io;},set 'concurrency'(iI){if(!(iI>=0x1))throw Error('fastqueue\x20concurrency\x20must\x20be\x20equal\x20to\x20or\x20greater\x20than\x201');if(io=iI,!iu['paused']){for(;iq&&is<io;)is++,iD();}},'running':iv,'resume':iz,'idle':iA,'length':ix,'getQueue':iy,'unshift':iC,'empty':ih,'kill':iE,'killAndDrain':iF,'error':iH,'abort':iG};return iu;function iv(){return is;}function iw(){iu['paused']=!0x0;}function ix(){for(var iI=iq,iJ=0x0;iI;)iI=iI['next'],iJ++;return iJ;}function iy(){for(var iI=iq,iJ=[];iI;)iJ['push'](iI['value']),iI=iI['next'];return iJ;}function iz(){const p2=b;if(iu[p2(0x2b2)]){if(iu['paused']=!0x1,iq===null){is++,iD();return;}for(;iq&&is<io;)is++,iD();}}function iA(){return is===0x0&&iu['length']()===0x0;}function iB(iI,iJ){const p3=b;var iK=ip[p3(0x291)]();iK['context']=ik,iK['release']=iD,iK['value']=iI,iK['callback']=iJ||ih,iK['errorHandler']=it,is>=io||iu['paused']?ir?(ir['next']=iK,ir=iK):(iq=iK,ir=iK,iu['saturated']()):(is++,il['call'](ik,iK['value'],iK['worked']));}function iC(iI,iJ){const p4=b;var iK=ip[p4(0x291)]();iK['context']=ik,iK['release']=iD,iK['value']=iI,iK['callback']=iJ||ih,iK['errorHandler']=it,is>=io||iu['paused']?iq?(iK['next']=iq,iq=iK):(iq=iK,ir=iK,iu['saturated']()):(is++,il['call'](ik,iK[p4(0x315)],iK['worked']));}function iD(iI){const p5=b;iI&&ip[p5(0x26d)](iI);var iJ=iq;iJ&&is<=io?iu['paused']?is--:(ir===iq&&(ir=null),iq=iJ[p5(0x19e)],iJ[p5(0x19e)]=null,il['call'](ik,iJ['value'],iJ['worked']),ir===null&&iu['empty']()):--is===0x0&&iu['drain']();}function iE(){iq=null,ir=null,iu['drain']=ih;}function iF(){iq=null,ir=null,iu['drain'](),iu['drain']=ih;}function iG(){const p6=b;var iI=iq;for(iq=null,ir=null;iI;){var iJ=iI['next'],iK=iI['callback'],iL=iI['errorHandler'],iM=iI['value'],iN=iI['context'];iI[p6(0x315)]=null,iI['callback']=ih,iI['errorHandler']=null,iL&&iL(Error('abort'),iM),iK[p6(0x1a5)](iN,Error('abort')),iI['release'](iI),iI=iJ;}iu[p6(0x356)]=ih;}function iH(iI){it=iI;}}function ih(){}function ii(){this['value']=null,this['callback']=ih,this['next']=null,this['release']=ih,this['context']=null,this['errorHandler']=null;var ik=this;this['worked']=function(il,io){const p7=b;var ip=ik[p7(0x24a)],iq=ik['errorHandler'],ir=ik['value'];ik['value']=null,ik['callback']=ih,ik['errorHandler']&&iq(il,ir),ip[p7(0x1a5)](ik['context'],il,io),ik['release'](ik);};}function ij(ik,il,io){const p8=b;typeof ik=='function'&&(io=il,il=ik,ik=null);function ip(iw,ix){il['call'](this,iw)['then'](function(iy){ix(null,iy);},ix);}var iq=ig(ik,ip,io),ir=iq['push'],is=iq['unshift'];return iq['push']=it,iq['unshift']=iu,iq[p8(0x26e)]=iv,iq;function it(iw){var ix=new Promise(function(iy,iz){ir(iw,function(iA,iB){if(iA){iz(iA);return;}iy(iB);});});return ix['catch'](ih),ix;}function iu(iw){var ix=new Promise(function(iy,iz){is(iw,function(iA,iB){if(iA){iz(iA);return;}iy(iB);});});return ix['catch'](ih),ix;}function iv(){return new Promise(function(iw){process['nextTick'](function(){if(iq['idle']())iw();else{var ix=iq['drain'];iq['drain']=function(){const p9=b;typeof ix=='function'&&ix(),iw(),iq[p9(0x356)]=ix;};}});});}}id['exports']=ig,id['exports']['promise']=ij;}),gz=ad(gy(),0x1);const gA=ic=>{const pa=jn;let id=ic['match'](/bytes\s+(\d+)-(\d+)\/(\d+|\*)/i);if(!id||!id[0x1]||!id[0x2]||!id[0x3])return null;let ie=parseInt(id[0x1],0xa),ig=parseInt(id[0x2],0xa),ih=id[0x3];if(!Number['isFinite'](ie)||!Number['isFinite'](ig)||ig<ie)return null;if(ih==='*')return{'start':ie,'end':ig,'total':null};let ii=parseInt(ih,0xa);return!Number[pa(0x2ab)](ii)||ii<=0x0?null:{'start':ie,'end':ig,'total':ii};},gB=(ic,id)=>{const pb=jn;if(typeof id['start']!='number'||typeof id['end']!='number')return;if(ic['status']!==0xce)throw Error('Range\x20request\x20failed\x20for\x20bytes='+id['start']+'-'+id[pb(0x28c)]+pb(0x3aa)+ic['status']);let ie=ic['headers']['get']('content-range');if(!ie)throw Error('Range\x20request\x20failed\x20for\x20bytes='+id['start']+'-'+id['end']+':\x20missing\x20Content-Range\x20header');let ig=gA(ie);if(!ig)throw Error('Range\x20request\x20failed\x20for\x20bytes='+id[pb(0x29a)]+'-'+id['end']+':\x20invalid\x20Content-Range\x20\x22'+ie+'\x22');if(ig['start']!==id['start']||ig['end']!==id['end'])throw Error('Range\x20request\x20failed\x20for\x20bytes='+id['start']+'-'+id['end']+pb(0x2e9)+ig['start']+'-'+ig['end']);},gC=async(ic,id,ie)=>{const pc=jn;let ig=ic['headers']['get']('content-length');if(ig){let ii=parseInt(ig,0xa);if(Number['isFinite'](ii)&&ii>0x0)return ii;}let ih=ic['headers']['get']('content-range');if(ih){let ij=ih['match'](/bytes\s+(\d+)-(\d+)\//i);if(ij&&ij[0x1]&&ij[0x2]){let ik=parseInt(ij[0x1],0xa),il=parseInt(ij[0x2],0xa);if(Number[pc(0x2ab)](ik)&&Number['isFinite'](il)&&il>=ik)return il-ik+0x1;}}return typeof id['start']=='number'&&typeof id['end']=='number'?Math['max'](0x0,id['end']-id['start']+0x1):id[pc(0x3be)]&&id['output']!==ie?V['stat'](id['output'])['then'](io=>io['size'])['catch'](()=>0x0):0x0;},gD=()=>{},gE=(ic,id)=>{let ie=[];for(let ig=0x0;ig<ic['length'];ig+=0x1)(id?.['parts'][ig]?.['completed']??!0x1)||ie['push'](ig);return ie;},gF=ic=>{let id=Promise['resolve']();return{'enqueue':()=>(id=id['then'](ic),id),'onIdle':()=>id};},gG=ic=>{let id={...ic['requestInit']},ie=ic['part']['headers']??ic['requestInit']?.['headers'];return ie&&(id['headers']=ie),ic['signal']&&(id['signal']=ic['signal']),id;},gH=async ic=>{const pf=jn;let id=ic['signal']??ic['requestInit']?.['signal']??void 0x0,ie=()=>{const pd=b;if(id?.[pd(0x24e)])throw gb();};ie();let ig=gE(ic['parts'],ic['resumeState']),ih=gF(async()=>{!ic['resumeState']||!ic['resumeManager']||await ic['resumeManager']['write'](ic['resumeState']);}),ii=gz['promise'](async ir=>{let {index:is,part:it}=ir;ie();let iu=gG({'part':it,'requestInit':ic['requestInit'],'signal':id}),iv=await gf({'index':is,'client':ic['client'],'url':it['url'],'requestInit':iu});if(ie(),gB(iv,it),await gg(it['output']??ic['output'],it['start'],id,iw=>{const pe=b;id?.[pe(0x24e)]||(ic['progress']['addBytes'](iw),ic['onProgress']?ic['onProgress'](ic['progress']['toProgressInfo']()):ic['progress']['log']());})(iv),gh(ic['progress'],ic['onProgress'],id)(iv),ie(),ic['resumeState']&&ic['resumeManager']){let iw=await gC(iv,it,ic['output']);ic['resumeManager']['markPartCompleted'](ic['resumeState'],is,iw),await ih['enqueue']();}},ic[pf(0x34c)]),ij=()=>{ii['pause'](),ii['killAndDrain'](),ii['kill']();};if(id?.['aborted'])throw ij(),gb();let ik=gD,il=id?new Promise((ir,is)=>{let it=()=>{ij(),is(gb());};id['addEventListener']('abort',it,{'once':!0x0}),ik=()=>id['removeEventListener']('abort',it);}):null,io=ig[pf(0x1b3)](ir=>{let is=ic['parts'][ir];return is?(ie(),ii['push']({'index':ir,'part':is})):Promise['resolve']();}),ip=[];try{let ir=Promise['allSettled'](io);il&&(await Promise['race']([ir,il]),ie()),ip=await ir;}finally{ik(),await ih[pf(0x317)]();}let iq=ip[pf(0x392)](is=>is[pf(0x233)]==='rejected');if(iq?.['status']==='rejected')throw iq['reason'];},gI=async(ic,id)=>{await new Promise((ie,ig)=>{const ph=b;let ih=P['createReadStream'](ic),ii=()=>{const pg=b;id['off']('error',ij),ih['off']('error',ik),ih['off'](pg(0x28c),il);},ij=io=>{ii(),ig(Error('Output\x20write\x20stream\x20error',{'cause':io}));},ik=io=>{ii(),ig(Error('Segment\x20read\x20stream\x20error',{'cause':io}));},il=()=>{ii(),ie();};id['on'](ph(0x264),ij),ih['on']('error',ik),ih['on']('end',il),ih['pipe'](id,{'end':!0x1});});},gJ=async ic=>{let id=ic['parts']['map'](ig=>ig['output'])['filter'](ig=>!!ig&&ig!==ic['output']);if(!id['length'])return;let ie=P['createWriteStream'](ic['output']);for(let ig of id)await gI(ig,ie);ie['end'](),await finished(ie);},gK=async ic=>{const pi=jn;if(!ic['expectedSize'])return;let id=await V['stat'](ic['output'])['then'](ie=>ie['size'])[pi(0x234)](()=>null);if(id&&id!==ic[pi(0x2a9)])throw Error('Actual\x20size\x20'+id+'\x20doesn\x27t\x20match\x20expected\x20size\x20'+ic['expectedSize']);},gL=async ic=>{const pj=jn;ic['resumeManager']&&ic[pj(0x1f5)]['cleanupOnSuccess']&&await ic[pj(0x1f5)]['delete'](),await fQ(ic['tempFileDir']);},gM=async ic=>{const pk=jn;let id=gs({'input':ic['input'],'resolvedUrl':ic['url'],'parts':ic[pk(0x3c4)],'requestHeaders':ic[pk(0x377)]?.[pk(0x2ce)],'maxWorkerCount':ic['maxWorkerCount'],'maxChunkSize':ic['maxChunkSize']}),ie=await gt({'manager':ic['resumeManager'],'input':ic['input'],'resolvedUrl':ic['url'],'parts':ic['parts'],'bytesTotal':ic['size']??void 0x0,'sourceSignature':id,'maxWorkerCount':ic['maxWorkerCount'],'maxChunkSize':ic['maxChunkSize']}),ig=gn(ic['parts']['length']);if(ic['size']&&ig['setTotal'](ic['size']),ie?.['bytesDownloaded']){let ih=ie['parts']['filter'](ii=>ii['completed'])[pk(0x2dd)];ig['setCurrent'](ie[pk(0x337)],ih);}await gw({'output':ic['output'],'size':ic['size'],'parts':ic['parts']});try{await gH({'parts':ic['parts'],'output':ic[pk(0x3be)],'maxWorkerCount':ic['maxWorkerCount'],'client':ic['client'],'requestInit':ic[pk(0x377)],'progress':ig,'onProgress':ic['onProgress'],'resumeState':ie,'resumeManager':ic['resumeManager'],'signal':ic['signal']});}finally{ig['stop'](),ic['onProgress']||ig['stopLog']();}gu(ie),await gJ({'output':ic['output'],'parts':ic['parts']}),await gK({'output':ic['output'],'expectedSize':Array['isArray'](ic['input'])?null:ic['size']}),await gL({'tempFileDir':ic['tempFileDir'],'resumeManager':ic['resumeManager']});},gN=async ic=>{const pl=jn;let id=new Headers(ic['requestInit']?.['headers']);id['set']('Range','bytes=0-0');let ie=Array['isArray'](ic['input'])?ic['input'][0x0]?.['url']:ic['input'];if(!ie)throw Error('Input\x20is\x20empty');let ig=await ic['client']['head'](ie,{...ic['requestInit'],'headers':id}),ih=ig['headers']['get']('content-type'),ii=ig['headers']['get']('content-length'),ij=ig['headers']['get']('content-range'),ik=ij?.['split']('/')?.[0x1]||ii,il=ik&&!Array['isArray'](ic['input'])?parseInt(ik,0xa):null,io=ig['headers']['get']('accept-ranges')==='bytes'||!!ij?.['includes']('bytes')||!!ih?.[pl(0x219)]('video')||!!ih?.['includes']('audio')||!!ih?.['includes']('octet-stream');return{'url':ig['url'],'size':il,'acceptsRanges':io};},gO=(ic,id)=>{const pm=jn;if(id['enabled'])return new g4({'output':ic,'key':id['key'],'filePath':id[pm(0x3ba)],'store':id['store'],'cleanupOnSuccess':id[pm(0x382)]});},gP=async ic=>{const pn=jn;let id=gj(ic),ie=fL({'maxRetries':id['maxRetries'],'proxy':id['proxy'],'fetch':id['fetchFn']}),ig=gO(ic['output'],id['resume']);try{let ih=await gN({'client':ie,'input':ic['input'],'requestInit':id['requestInit']});await fP(ic['output']);let ii=await fN(ic['output'],id['tempDir']);id['resume']['enabled']||(await fQ(ic['output'],fR(ic['output']),ii),ii=await fN(ic['output'],id['tempDir'])),await ic['beforeTransfer']?.();let ij=gv({'input':ic['input'],'url':ih['url'],'size':ih[pn(0x37e)],'acceptsRanges':ih[pn(0x3ca)],'requestInit':id['requestInit'],'tempFileDir':ii,'maxWorkerCount':id['maxWorkerCount'],'maxChunkSize':id['maxChunkSize']});await gM({'input':ic['input'],'output':ic['output'],'url':ih[pn(0x1aa)],'size':ih['size'],'requestInit':id['requestInit'],'maxWorkerCount':id['maxWorkerCount'],'maxChunkSize':id['maxChunkSize'],'onProgress':ic['onProgress'],'client':ie,'parts':ij,'tempFileDir':ii,'resumeManager':ig,'signal':id['requestInit']?.['signal']??void 0x0});}finally{try{await ie['close']();}catch{}}},gQ=async({attempts:ic,fn:id,shouldRetry:ie,onRetry:ig})=>{const po=jn;let ih=Math['max'](0x1,Math[po(0x3c3)](ic)),ii;for(let ij=0x1;ij<=ih;ij+=0x1)try{return await id(ij);}catch(ik){if(ii=ik,ij>=ih||!ie?.(ik,ij))throw ik;await ig?.(ik,ij);}throw ii instanceof Error?ii:Error(String(ii));},gR=async(ic,id)=>{const pp=jn;let ie=id+'\x20∙\x20';if(ic['type']==='subtitle'?ie+='SUBTITLES':ie+=ic['type'][pp(0x33b)](),ic['isVideoTrack']()){let [ig,ih,ii]=await Promise['all']([ic['getDisplayWidth'](),ic['getDisplayHeight'](),ic['getBitrate']()]);ig&&(ie+=pp(0x1de)+ig+'x'+ih),ii&&(ie+='\x20∙\x20'+Math['round'](ii/0x3e8)+'\x20KiB/s');}if(ic['isAudioTrack']()){let [ij,ik,il,io]=await Promise['all']([ic['getLanguageCode'](),ic['getName'](),ic['getSampleRate'](),ic['getBitrate']()]);ij&&(ie+='\x20∙\x20'+ij['toUpperCase']()),ik&&(ie+='\x20('+ik+')'),il&&(ie+='\x20∙\x20'+il+'\x20kHz'),io&&(ie+='\x20∙\x20'+Math['round'](io/0x3e8)+'\x20KiB/s');}if(ic['type']==='subtitle'){let [ip,iq,ir]=await Promise['all']([ic['getLanguageCode'](),ic[pp(0x3bf)](),ic['getDisposition']()]);ip&&(ie+='\x20∙\x20'+ip['toUpperCase']()),iq&&(ie+='\x20('+iq+')'),ir['forced']&&(ie+='\x20FORCED');}return ie;},gS={'eng':'en','rus':'ru'},gT=ic=>{if(!(!ic||typeof ic!='object'||!('drm'in ic)))return ic['drm']?.['widevine']?.['pssh'];},gU=(ic,id)=>{const pq=jn;if(id)return{'Range':pq(0x1c6)+ic+'-'+(ic+id-0x1)};},gV=(ic,id)=>ic?id?{...ic,...id}:ic:id,gW=ic=>ic??void 0x0,gX=(ic,id)=>{const pr=jn;let ie=[],ig=ic[0x0];if(ig?.['initSegment']){let ih=ig['initSegment']['location']['offset']??0x0,ii=ig['initSegment'][pr(0x23b)]['length'],ij=ih>0x0?0x0:ih,ik=ii==null?ii:ii+ih;ie['push']({'url':ig['initSegment']['location']['path'],'headers':gV(id,gU(ij,ik)),'byteLength':gW(ik),'encryption':ig['initSegment']['encryption']});}for(let il of ic){let io=il['location']['length'];ie['push']({'url':il['location']['path'],'headers':gV(id,gU(il['location']['offset'],il['location']['length'])),'byteLength':gW(io),'encryption':il['encryption']});}return ie;},gY=ic=>ic['length']===0x0?[]:ic[jn(0x2dd)]===0x1&&!ic[0x0]?.['headers']?ic[0x0]['url']:ic['map'](id=>({'url':id['url'],'headers':id['headers']})),gZ=ic=>{let id=0x0;for(let ie of ic){if(ie['byteLength']===void 0x0)return;id+=ie['byteLength'];}return id;},h0=async ic=>{let id=ic['getSegmentedInput']?.();return id?.['segments']['length']?id['segments']:await ic['getSegments']();},h1=ic=>ic[0x0]?.['url'],h2=async(ic,id)=>{const ps=jn;if(id)return h1(id);let ie;try{ie=await ic['getSegments']();}catch(ig){if(ig instanceof Error&&ig['message']['toLowerCase']()[ps(0x219)]('no\x20segments')){v['debug']('Track\x20segments\x20unavailable\x20for\x20URL\x20logging:\x20'+ig['message']);return;}throw ig;}return h1(gX(ie));},h3=async ic=>{const pt=jn;if(ic['type']==='subtitle'){let id=await ic['getCodec']();return id==='ttml'||id==='stpp'?'ttml':id==='webvtt'?'vtt':id??'srt';}if(ic['isAudioTrack']?.()){let ie=await ic['getCodec']();return ie==='aac'||ie==='alac'||ie==='ac3'||ie===pt(0x323)?'m4a':ie==='mp3'?'mp3':'mka';}return'mp4';},h4=async({outputDirectory:ic,baseName:id,track:ie})=>join(ic,id+'.'+createHash('sha256')['update'](dA(ie))[jn(0x1f7)]('hex')['slice'](0x0,0x6)+'.'+await h3(ie)),h5=ic=>{const pu=jn;let id=(ic?.[pu(0x277)]()['toLowerCase']()['replaceAll']('_','-'))?.['split']('-')[0x0]||'und';return(gS[id]??id)['replaceAll'](/[^a-z0-9]+/g,'-')['replaceAll'](/^-|-$/g,'')||'und';},h6=async ic=>{let id=new Map(),ie=new Map();for(let ig of ic['tracks']['all']){if(ig['type']!=='subtitle')continue;let [ih,ii]=await Promise['all']([ig['getLanguageCode']()['catch'](()=>void 0x0),h3(ig)]),ij=h5(ih),ik=(ie['get'](ij)??0x0)+0x1;ie['set'](ij,ik);let il=ik===0x1?ij:ij+'-'+ik;id['set'](dA(ig),join(ic['output']['outputDirectory'],ic['output']['baseName']+'.'+il+'.'+ii));}return id;},h7=(ic,id)=>({'enabled':!0x0,'key':createHash(jn(0x19a))['update'](ic+':'+dA(id))['digest']('hex')}),h8=ic=>{let id=[];for(let ie of ic)for(let ig of ie){let ih=gT(ig['encryption']);if(ih){id['push'](ih);break;}}return id['map'](ii=>{const pv=b;let ij=ii;return typeof ij=='string'?ij:ij instanceof Uint8Array||ij instanceof ArrayBuffer?Buffer['from'](ij)['toString']('base64'):ArrayBuffer['isView'](ij)?Buffer['from'](ij[pv(0x20c)],ij['byteOffset'],ij['byteLength'])['toString'](pv(0x302)):String(ij);});},h9=async(ic,id)=>{const pw=jn;let [ie,ig,ih]=await Promise['all']([ic['getLanguageCode']()['catch'](()=>void 0x0),ic['getName']()['catch'](()=>void 0x0),ic[pw(0x2d7)]()['catch'](()=>void 0x0)]);return{'path':id,'type':ic['type'],'language':ie,'label':ig??void 0x0,'forced':ic['type']==='subtitle'?ih?.['forced']:void 0x0};},ha=async(ic,id)=>{if(!ic['isVideoTrack']())return{'quality':void 0x0,'codec':void 0x0};let [ie,ig,ih]=await Promise['all']([ic['getCodec'](),id?ic['getDisplayWidth']():ic['getCodedWidth'](),id?ic['getDisplayHeight']():ic['getCodedHeight']()]);return{'quality':ig?ig+'x'+ih:void 0x0,'codec':ie??void 0x0};},hb=async({plan:ic,track:id,source:ie,resume:ig,isSegmented:ih,artifactPath:ii})=>{const px=jn;let ij=ii??await h4({'outputDirectory':ic['output']['outputDirectory'],'baseName':ic['output']['baseName'],'track':id}),[ik,il,io,ip]=await Promise['all']([gR(id,ic['output']['baseName']),ha(id,ih),h9(id,ij),id['type']==='subtitle'&&ie['kind']==='segments'?h2(id,ie['segments']):Promise['resolve'](void 0x0)]),iq=ie['kind']==='segments'?gZ(ie['segments']):void 0x0;return{'kind':id[px(0x1d6)],'source':ie,'artifactPath':ij,'description':ik,'target':{'finalName':ic['output']['fileName'],'finalPath':ic['output']['outputPath']},'resume':ig,'progressMetadata':{...il,'expectedBytes':iq},'artifactMetadata':{'type':io['type'],'language':io[px(0x1dd)],'label':io['label'],'forced':io['forced']},'logUrl':ip};},hc=async ic=>{const py=jn;let id=ic['options']['skipSubtitlesMux']?await h6(ic):new Map(),ie=ic['entry']['source']?.['headers'];if(ic['isSegmented'])return await Promise['all'](ic[py(0x363)]['all']['map'](async ii=>{let ij=await h0(ii),ik=eh(ii['source']),il=gX(ij,ik['headers']??ie);return{'unit':await hb({'plan':ic,'track':ii,'source':{'kind':'segments','input':gY(il),'segments':il},'resume':h7(ik['url'],ii),'isSegmented':!0x0,'artifactPath':id['get'](dA(ii))}),'segments':il};}));let ig=ic[py(0x363)]['videos'][0x0],ih=[];if(ig){let ii=eh(ig[py(0x37c)]);ih['push']({'track':ig,'source':{'kind':'file','input':ii['url']},'resume':!0x0,'isSegmented':!0x1});}for(let ij of ic['tracks']['audios']){let ik=eh(ij['source']);ih['push']({'track':ij,'source':{'kind':'file','input':ik['url']},'resume':!0x0,'isSegmented':!0x1});}for(let il of ic['tracks']['subtitles']){let io=gX(await h0(il),eh(il['source'])['headers']??ie);ih['push']({'track':il,'source':{'kind':'segments','input':gY(io),'segments':io},'resume':!0x0,'isSegmented':!0x1,'artifactPath':id['get'](dA(il))});}return(await Promise['all'](ih['map'](async ip=>await hb({'plan':ic,...ip}))))['map'](ip=>({'unit':ip,'segments':[]}));},hd=async ic=>{const pz=jn;dC(ic[pz(0x363)]['all']);let id=await hc(ic);return{'units':id['map'](({unit:ie})=>ie),'psshList':ic['isSegmented']?h8(id['map'](({segments:ie})=>ie)):[],'selectedTracks':ic['tracks']['all']};},he=0x10,hf=ic=>{const pA=jn;let id=Math['max'](0x1,Math[pA(0x3c3)](ic)),ie=Math['min'](he,id);return{'normalizedRequestedConnections':id,'maxWorkerCount':ie,'wasClamped':id!==ie};},hg=ic=>Math['max'](0x1,Math[jn(0x3c3)](ic)+0x1),hh=({title:ic,progress:id,filepath:ie,target:ig,quality:ih,codec:ii,expectedTotalBytes:ij})=>{const pB=jn;let ik=id['totalBytes']??void 0x0,il=id['estimatedTotalBytes']??void 0x0,io=ij??ik??il,ip=id['bytesPerSecond']??void 0x0,iq=ij===void 0x0?id['bytesDownloaded']:Math[pB(0x196)](id['bytesDownloaded'],ij),ir={'b':io,'mb':io===void 0x0?void 0x0:io/0x400/0x400,'estimated':ij===void 0x0&&ik===void 0x0&&il!==void 0x0},is={'b':iq,'mb':iq/0x400/0x400},it=id['percentComplete']??(io?Math['min'](0x64,iq/ io*0x64):void 0x0);return{'title':ic,'total':ir,'current':is,'percentage':it,'speed':{'bps':ip,'mbps':ip===void 0x0?void 0x0:ip/0x400/0x400},'trackName':basename(ie),'trackPath':ie,'finalName':ig['finalName'],'finalPath':ig['finalPath'],'state':it===0x64?'downloaded':'downloading','quality':ih,'codec':ii};},hi=ic=>{let id=(ic['bytesDownloaded']/0x400/0x400)['toFixed'](0x2)+'\x20MB',ie=ic['totalBytes']??ic['estimatedTotalBytes'],ig=ic['totalBytes']?'':'~';return'Downloading\x20∙\x20'+id+(ie?'\x20of\x20'+ig+(ie/0x400/0x400)['toFixed'](0x2)+'\x20MB':'');},hj=(ic,id)=>{const pC=jn;if(ic||!Array['isArray'](id))return ic;let ie=id[0x0]?.['headers'];if(!ie)return;let ig={...ie};for(let ih of Object['keys'](ig))ih['toLowerCase']()===pC(0x23d)&&delete ig[ih];return Object['keys'](ig)[pC(0x2dd)]?ig:void 0x0;},hk=async({input:ic,resume:id,filepath:ie,description:ig,target:ih,resource:ii,options:ij,settings:ik,abortSignal:il,title:io,quality:ip,codec:iq,expectedTotalBytes:ir,emitProgress:is,onTransferReady:it,reporter:iu=fD})=>{const pD=jn;v['info'](ig),v[pD(0x388)](pD(0x2b5)+ie);let iv=hj(eh(ii['input']['source'])['headers'],ic),iw=ij['connections']??ik['get']('connections')??0x1,{maxWorkerCount:ix,wasClamped:iy}=hf(iw);iy&&v['warn']('Connections\x20value\x20'+iw+'\x20was\x20clamped\x20to\x20'+ix+'\x20for\x20stability'),v['debug']('Max\x20worker\x20count:\x20'+ix);let iz,iA='',iB=hg(ij['retry']??ik['get'](pD(0x282))??0x1);try{await gQ({'attempts':iB,'fn':async()=>{const pE=pD;let iC=Date['now'](),iD=0x0,iE=()=>{if(!il?.['aborted'])return;v['debug']('Media\x20download\x20skipped,\x20already\x20aborted:\x20'+ie);let iF=Error('The\x20operation\x20was\x20aborted');throw iF['name']='AbortError',iF;};iE(),await gP({'input':ic,'output':ie,'tempDir':q,'requestInit':{'headers':iv,'signal':il},'proxy':ij['proxyMedia']||ij['proxy']||void 0x0,'resume':id,'maxRetries':ij['retry'],'maxWorkerCount':ix,'beforeTransfer':async()=>{iE(),iz=iu['createTask']('Downloading',{'color':'yellow'}),await it?.();},'onProgress':iF=>{iD||(iD=Date['now'](),v['debug']('First\x20download\x20progress\x20for\x20'+ie+':\x20'+iF['bytesDownloaded']+'\x20bytes\x20after\x20'+(iD-iC)+'ms'));let iG=hh({'title':io,'progress':iF,'filepath':ie,'target':ih,'quality':ip,'codec':iq,'expectedTotalBytes':ir});is(iG),iu['progress'](iG),iA=hi(iF),iz?.['update'](iA);}}),v['debug']('Downloaded\x20'+ie+'\x20in\x20'+(Date[pE(0x300)]()-iC)+'ms');},'shouldRetry':iC=>!(iC instanceof Error&&iC['name']==='AbortError'),'onRetry':async(iC,iD)=>{const pF=pD;let iE=iC instanceof Error?iC[pF(0x275)]:String(iC);v['warn']('Media\x20download\x20retry\x20'+iD+'/'+(iB-0x1)+pF(0x1b6)+ie+':\x20'+iE);}}),iz?.['success'](iA);}catch(iC){if(iz?.['error'](ig),iC instanceof Error&&iC['name']==='AbortError')throw iC;let iD=iC instanceof Error?iC['message']:String(iC);throw v['error']('Media\x20download\x20failed:\x20'+iD),iC instanceof Error&&iC['stack']?v['debug'](iC['stack']):v['debug'](iD),iC instanceof Error?iC:Error(iD);}},hl=ic=>JSON['stringify'](ic['source']['input']),hm=ic=>{const pG=jn;let id=new Map();for(let ie of ic){let ig=hl(ie),ih=id['get'](ig);if(ih){ih['units'][pG(0x1d8)](ie);continue;}id['set'](ig,{'representative':ie,'units':[ie]});}return[...id['values']()];},hn=(ic,id)=>{const pH=jn;let ie=id['progressMetadata']['expectedBytes'];return{'title':ic[pH(0x198)],'total':{'b':ie,'mb':ie===void 0x0?void 0x0:ie/0x400/0x400,'estimated':!0x1},'current':{'b':0x0,'mb':0x0},'percentage':ie===void 0x0?void 0x0:0x0,'speed':{},'trackName':id['artifactPath'],'trackPath':id['artifactPath'],'finalName':id['target']['finalName'],'finalPath':id['target']['finalPath'],'quality':id['progressMetadata']['quality'],'codec':id['progressMetadata']['codec'],'state':'downloading'};},ho=async({settings:ic,plan:id,unit:ie,abortSignal:ig,callbacks:ih,reporter:ii,onTransferReady:ij})=>(await hk({'input':ie['source']['input'],'resume':ie['resume'],'filepath':ie['artifactPath'],'description':ie['description'],'target':ie['target'],'resource':id['resource'],'options':id[jn(0x3b5)],'settings':ic,'abortSignal':ig,'title':id['downloadTitle'],'quality':ie[jn(0x379)]['quality'],'codec':ie['progressMetadata']['codec'],'expectedTotalBytes':ie['progressMetadata'][jn(0x29e)],'reporter':ii,'onTransferReady':ij,'emitProgress':ik=>{ih?.['onProgress']?.(ik);}}),await aY(ie['artifactPath'])?{'path':ie['artifactPath'],...ie[jn(0x368)]}:null),hp=async({settings:ic,plan:id,abortSignal:ie,callbacks:ig,reporter:ih=fD})=>{const pJ=jn;v['debug']('Preparing\x20media\x20transfers');let ii=Date['now'](),ij=await hd(id),ik=hm(ij['units']);v['debug']('Prepared\x20'+ij['units']['length']+'\x20media\x20transfer\x20unit(s)\x20in\x20'+(Date['now']()-ii)+'ms;\x20'+ik['length']+'\x20unique\x20transfer\x20input(s)'),v['debug']('Downloading\x20media');let il=Date['now'](),io=!0x1,ip=async()=>{const pI=b;if(!io){io=!0x0,await ig?.[pI(0x285)]?.();for(let ir of ik)ig?.[pI(0x1f1)]?.(hn(id,ir['representative']));}},iq=[];for(let ir of ik){let is=ir['representative'];is['kind']==='subtitle'&&v['debug']('URL:\x20'+(is['logUrl']??'manifest\x20subtitle\x20track'));let it=await ho({'settings':ic,'plan':id,'unit':is,'abortSignal':ie,'callbacks':ig,'reporter':ih,'onTransferReady':ip});if(it){for(let iu of ir['units'])iq[pJ(0x1d8)]({'path':it[pJ(0x38d)],...iu['artifactMetadata']});}}return v['debug'](pJ(0x1c3)+(Date['now']()-il)+'ms'),{'downloaded':iq,'psshList':ij['psshList'],'selectedTracks':ij['selectedTracks']};},hq=ic=>ic['total']['estimated']&&typeof ic['percentage']=='number'?Math['min'](0x1,Math['max'](0x0,ic['percentage']/0x64)):ic['total']['b']&&ic['total']['b']>0x0?Math['min'](0x1,ic['current']['b']/ ic['total']['b']):+(ic['state']==='downloaded'||ic['state']==='finished'),hr=ic=>{const pK=jn;let id=[...ic],ie=0x0,ig=0x0,ih=!0x1,ii=!0x1,ij=0x0,ik=0x0;for(let is of id){let it=hq(is);if(ie+=is['current']['b'],ij+=it,is['total']['b']===void 0x0){ih=!0x0;continue;}ig+=is['total']['b'],ik+=is[pK(0x3a2)]['b']*it,ii||=is['total']['estimated']===!0x0;}let il=ig>0x0?ig:void 0x0,io=id['length']?ij/ id['length']*0x64:0x0,ip=il&&il>0x0?ik/ il*0x64:0x0,iq=il===void 0x0?io:ip,ir=id['length']>0x0&&ij<id[pK(0x2dd)]?Math['min'](iq,0x63):iq;return{'totalDownloaded':ie,'totalSize':il,'isTotalSizeEstimated':il!==void 0x0&&(ii||ih),'percent':Math['min'](0x64,ir)};},hs=()=>{let ic=0x0;return{'clamp'(id){return ic=Math['max'](ic,id),ic;}};},ht=ic=>{let id=[];for(let ie of ic)ie&&id['push']({'path':ie,'role':'partial'});return id;},hu=()=>{let ic={},id=hs();return{'update'(ie){const pL=b;ic[ie['trackPath']]=ie;let {totalDownloaded:ig,totalSize:ih,isTotalSizeEstimated:ii,percent:ij}=hr(Object['values'](ic));return{'type':'progress','progress':{'percent':id['clamp'](ij),'downloadedBytes':ig,'totalBytes':ih,'totalBytesEstimated':ii,'filePath':ie['finalPath'],'quality':ie[pL(0x2c2)],'codec':ie['codec']},'artifacts':ht([ie['trackPath'],ie['finalPath']])};}};},hv={'resolveDownloadJobOptions':e7,'prepareDownloadResource':f0,'prepareDownloadPlan':eZ,'executeMediaTransfer':hp,'resolveContentKeys':dU,'processDownloadedMedia':fH},hw=()=>eG,hx=()=>{const pM=jn;let ic=Error(pM(0x27d));return ic['name']='AbortError',ic;},hy=async(ic,id)=>{for(let ie of id)await ic({'type':'artifact-recorded','artifact':{'path':ie['path'],'role':'partial'}});};var hz=class{['settings'];['extensionManager'];#e;#t;#n;#r;constructor(ic,id,ie={}){this['settings']=ic,this['extensionManager']=id,this.#e=ie['dependencies']??hv,this.#t=ie['trackSelectorFactory']??hw,this.#n=ie['reporter']??fD,this.#r=ie['resolveBenefits']??e4();}async['run']({jobId:ic,request:id,filePath:ie,signal:ig,emit:ih}){const pN=jn;let ii=await this.#r(),{options:ij,limit:ik}=this.#e['resolveDownloadJobOptions']({'settings':this['settings'],'requestedOptions':id['options'],'filePath':ie,'grantedBenefits':ii});ik['wasClamped']&&v['warn'](pN(0x1ba)+ik['normalizedRequestedConnections']+'\x20exceeds\x20tier\x20limit\x20('+ik['maxAllowedConnections']+').\x20Using\x20'+ik['connections']+'.');let il=await this.#e['prepareDownloadResource']({'extensionManager':this['extensionManager'],'entry':id['entry'],'url':id['url'],'options':ij,'signal':ig});try{await ih({'type':'entry-resolved','entry':il[pN(0x30a)]['entry']}),await il[pN(0x1cb)]();let io=await this.#e['prepareDownloadPlan']({'settings':this['settings'],'options':ij,'resource':il['resource'],'extensionTag':il['extensionTag'],'trackSelector':this.#t(ij)});await ih({'type':'output-resolved','title':io['downloadTitle'],'filePath':io['output']['outputPath']}),await ih({'type':'artifact-recorded','artifact':{'path':io['output']['outputPath'],'role':'output'}});let {transferResult:ip,processedMedia:iq}=await this.#i({'preparedPlan':io,'preparedResource':il,'jobId':ic,'options':ij,'signal':ig,'emit':ih});return{'entry':il[pN(0x30a)]['entry'],'transferResult':ip,'processedMedia':iq};}catch(ir){throw ir instanceof Error&&ir['name']==='AbortError'?(v['debug']('Download\x20was\x20aborted\x20(paused):\x20'+ic),ir):(v['error'](pN(0x204)+(ir instanceof Error?ir['message']:ir)),dw('Media\x20download\x20session\x20failure',ir),ir);}finally{await il['dispose']();}}async #i({preparedPlan:ic,preparedResource:id,jobId:ie,options:ig,signal:ih,emit:ii}){const pO=jn;let ij=hu(),ik=await this.#e['executeMediaTransfer']({'settings':this['settings'],'plan':ic,'abortSignal':ih,'callbacks':{'onTransferReady':async()=>{await ii({'type':'transferring'});},'onProgress':async ip=>{await ii(ij['update'](ip));}},'reporter':this.#n});if(ih[pO(0x24e)])throw hx();if(!ik['downloaded']['length'])throw cO();await hy(ii,ik['downloaded']),await ii({'type':'processing'});let il=await this.#e['resolveContentKeys']({'jobId':ie,'title':ic[pO(0x198)],'entryTitle':id['resource']['entry']['title'],'options':ig,'psshList':ik['psshList']??[],'selectedTracks':ik['selectedTracks'],'extension':id['extension'],'resource':id['resource']}),io=await this.#e['processDownloadedMedia']({'inputs':ik['downloaded'],'output':ic[pO(0x3be)]['outputPath'],'keys':il,'trimBegin':ig['trimBegin'],'trimEnd':ig['trimEnd'],'binariesDir':this['settings']['get']('binariesDir'),'skipMux':ig['skipMux'],'skipSubtitlesMux':ig['skipSubtitlesMux'],'reporter':this.#n});return await id[pO(0x283)](ig['skipMux']),{'transferResult':ik,'processedMedia':io};}};const hA=ic=>{if(!ic)return null;let [id,ie]=ic['toLowerCase']()['split']('e');return[parseInt(id['trim']()['toLowerCase']()['replace']('s','')),parseFloat(ie?.['trim']())];},hB=ic=>{const pP=jn;let id=0x0,ie=0x270f,ig=[],ih=ic['split'](',');for(let ij of ih){let [ik,il]=ij['split']('-'),io=hA(ik),ip=hA(il);if(io&&!il){let [iq,ir]=io;if(isNaN(ir)){for(let is=0x0;is<=ie;is++)ig['push']([iq,is]);}else ig['push']([iq,ir]);}else{if(io&&ip){let [it,iu]=io,[iv,iw]=ip;for(let ix=it;ix<=iv;ix++){let iy=iu||0x0,iz=ix===iv?iw:ie;for(let iA=iy;iA<=iz;iA++)ig[pP(0x1d8)]([ix,iA]);}}}}let ii=new Map();for(let [iB,iC]of ig)ii['has'](iB)||ii['set'](iB,new Set()),ii['get'](iB)?.[pP(0x227)](iC);return ii;},hC=ic=>{const pQ=jn;if(!ic)return{};let id={},ie=typeof ic=='string'?ic['split']('|'):ic;for(let ig of ie){let [ih,...ii]=ig['split'](':'),ij=ii[pQ(0x299)](':');if(!ij)throw Error('Can\x27t\x20parse\x20header:\x20'+ig);id[ih[pQ(0x277)]()]=ij['trim']();}return id;},hD=async ic=>{const pR=jn;let id=!0x1,ie=ic;do try{ie?id=!!new URL(ie):ie=(await y['ask']({'fields':{'url':{'label':'URL'}}}))[pR(0x1aa)];}catch{ie=(await y['ask']({'fields':{'url':{'label':'URL'}}}))['url'];}while(!id);return ie!==ic&&v['debug']('URL:\x20'+ie),ie;},hE=async({message:ic,choices:id})=>id['length']?await checkbox({'message':ic,'pageSize':0xc,'choices':id,'loop':!0x1}):[],hF=async({catalog:ic})=>{const pS=jn;let id=await hE({'message':'Select\x20video\x20streams','choices':ic['videos']['map']((ij,ik)=>({'name':ij['label'],'value':ij['id'],'checked':ik===0x0}))}),ie=ic['videos'][pS(0x254)](ij=>id['includes'](ij['id']))[pS(0x1b3)](ij=>ij['track']),ig=await hE({'message':'Select\x20audio\x20streams','choices':ic['audios']['map']((ij,ik)=>({'name':ij['label'],'value':ij['id'],'checked':ik===0x0}))}),ih=ic['audios']['filter'](ij=>ig[pS(0x219)](ij['id']))['map'](ij=>ij[pS(0x21b)]),ii=await hE({'message':pS(0x34a),'choices':ic['subtitles']['map']((ij,ik)=>({'name':ij['label'],'value':ij['id'],'checked':ik===0x0}))});return ei({'videos':ie,'audios':ih,'subtitles':ic['subtitles']['filter'](ij=>ii['includes'](ij['id']))['map'](ij=>ij['track'])});},hG=ic=>!!ic&&typeof ic=='object',hH=ic=>{const pT=jn;switch(ic){case'analyzing':case'pending':return'analyzing';case'queued':return'queued';case'downloading':return'transferring';case'processing':return'processing';case'paused':return'paused';case'completed':return pT(0x370);case pT(0x264):return'failed';}},hI=ic=>ic['phase']==='analyzing'?'analyzing':ic['state']==='running'&&ic['phase']==='processing'?'processing':ic['state']===jn(0x230)?'transferring':ic['state']==='paused'?'paused':ic[jn(0x3a8)]==='completed'?'completed':ic['state']==='failed'?'failed':'queued',hJ=ic=>{const pU=jn;let id=ic['resource'];return ic['entry']??{'id':id?.['metadata']?.['id'],'title':id?.['metadata']?.['title'],'seasonNumber':id?.['metadata']?.['seasonNumber'],'episodeNumber':id?.['metadata']?.[pU(0x36c)],'episodeTitle':id?.['metadata']?.[pU(0x37d)],'source':id?.['source']};},hK=ic=>({'id':ic['id'],'request':{'entry':hJ(ic),'url':ic['url'],'options':ic['options']},'status':hH(ic['status']),'progress':{'percent':ic['progress']??0x0,'downloadedBytes':ic['downloadedBytes']??0x0,'totalBytes':ic['totalBytes'],'totalBytesEstimated':ic['totalBytesEstimated']},'output':{'title':ic['title'],'filePath':ic['filePath'],'quality':ic['quality'],'codec':ic['codec']},'artifacts':ic['filePath']?[{'path':ic['filePath'],'role':'output'}]:[],'failure':ic['error']?{'message':ic['error']}:void 0x0,'createdAt':ic['createdAt']});var hL=class{['filePath'];['records']=[];#e=Promise[jn(0x2d4)]();constructor(ic){this['filePath']=ic;}async['load'](){const pV=jn;await this.#e;try{let ic=await readFile(this['filePath'],{'encoding':'utf8'}),id=JSON['parse'](ic),ie=Array['isArray'](id)?id:[];this['records']=ie[pV(0x1b3)](ig=>this.#n(ig))['filter'](ig=>!!ig)[pV(0x3c8)]((ig,ih)=>new Date(ih['createdAt']??0x0)[pV(0x367)]()-new Date(ig['createdAt']??0x0)['getTime']());}catch{this['records']=[];}return this;}get['size'](){return this['records']['length'];}async['addRecord'](ic){await this.#t(async()=>{const pW=b;this['records']['unshift'](ic),await this[pW(0x260)]();});}async['updateRecord'](ic){await this.#t(async()=>{const pX=b;let id=this['records']['findIndex'](ie=>ie['id']===ic['id']);id!==-0x1&&(this[pX(0x391)][id]=ic,await this['save']());});}['getRecord'](ic){const pY=jn;return this[pY(0x391)][pY(0x392)](id=>id['id']===ic);}['listRecords'](){return this['records'];}['has'](ic){return this['records']['some'](id=>id['id']===ic);}async['deleteRecord'](ic){await this.#t(async()=>{const pZ=b;let id=this[pZ(0x391)]['findIndex'](ie=>ie['id']===ic);id!==-0x1&&(this['records']['splice'](id,0x1),await this['save']());});}['deleteRecordSync'](ic){let id=this['records']['findIndex'](ie=>ie['id']===ic);id!==-0x1&&(this['records']['splice'](id,0x1),writeFileSync(this['filePath'],JSON['stringify'](this['records'],null,0x2)));}async['clear'](){await this.#t(async()=>{this['records']=[],await this['save']();});}async['save'](){writeFileSync(this['filePath'],JSON['stringify'](this['records'],null,0x2));}#t(ic){let id=this.#e['then'](ic,ic);return this.#e=id['then'](()=>void 0x0,()=>void 0x0),id;}#n(ic){const q0=jn;if(hG(ic)){if('request'in ic&&'status'in ic&&'progress'in ic&&q0(0x3be)in ic)return ic;if('request'in ic&&'state'in ic&&'progress'in ic&&'output'in ic){let id=ic;return{'id':id['id'],'request':id['request'],'status':hI(id),'progress':id['progress'],'output':id[q0(0x3be)],'artifacts':id['artifacts'],'failure':id['failure'],'createdAt':id['createdAt']};}if('status'in ic&&'id'in ic)return hK(ic);}}};const hM=ic=>{process['exit'](ic);},hN=ic=>ic['select']?hF:eG,hO=0x7d0,hP=async(ic,id,ie)=>{let ig,ih=new Promise((ii,ij)=>{ig=setTimeout(()=>ij(Error(ie)),id);});try{return await Promise['race']([ic,ih]);}finally{ig&&clearTimeout(ig);}},hQ={'command':['download\x20[urls..]','$0\x20[urls..]'],'aliases':['dl'],'describe':'Download\x20media\x20content\x20by\x20URL','builder':ic=>ic['option']('quality',{'alias':'q','describe':'Video\x20resolution\x20quality\x20-\x202160p/1080p/720p/...,\x20defaults\x20to\x20highest\x20available','type':jn(0x1ee)})['option']('video-codec',{'alias':'v','describe':'Video\x20codec\x20-\x20avc\x20|\x20hevc\x20|\x20vp8\x20|\x20vp9\x20|\x20av1\x20|\x20vc1,\x20defaults\x20to\x20any','type':'string'})['option']('video-range',{'alias':'r','describe':'Video\x20color\x20range\x20-\x20sdr\x20|\x20hlg\x20|\x20hdr10\x20|\x20hdr10+\x20|\x20dv,\x20defaults\x20to\x20sdr','type':'string'})['option']('video-bitrate',{'describe':'Video\x20bitrate\x20(in\x20kbps),\x20defaults\x20to\x20highest\x20available','type':'number'})['option']('video-dimension',{'describe':'Video\x20dimension\x20-\x202D/3D\x20(HSBS/HOU/FSBS/OU),\x20defaults\x20to\x202D','default':'2D','type':'string'})['option']('audio-codec',{'alias':'a','describe':jn(0x2e7),'type':'string'})['option']('audio-channels',{'alias':'c','describe':'Audio\x20channels,\x20matches\x20sub-channel\x20layouts\x20like\x205.1\x20with\x206.0','type':jn(0x269)})['option']('audio-bitrate',{'describe':'Audio\x20bitrate\x20(in\x20kbps),\x20defaults\x20to\x20highest\x20available','type':'number'})['option']('subs-format',{'alias':'s','describe':'Subtitle\x20format\x20-\x20SRT/SSA/ASS/TTML/VTT/STPP/WVTT','type':'string'})['option']('subs-lang',{'alias':'S','describe':'Subtitles\x20language(s)','type':'string'})['option']('lang',{'alias':'l','describe':'Video/audio\x20language(s)','type':'string'})[jn(0x2e8)]('skip-video',{'describe':'do\x20not\x20download\x20video','type':'boolean'})['option']('skip-audio',{'describe':'do\x20not\x20download\x20audio','type':jn(0x383)})['option'](jn(0x347),{'describe':'do\x20not\x20download\x20subtitles','type':'boolean'})['option']('skip-mux',{'describe':'Disable\x20merge\x20audio/video/subs\x20into\x20single\x20file','type':'boolean'})['option']('skip-subtitles-mux',{'describe':'Download\x20subtitles\x20as\x20external\x20files\x20while\x20still\x20muxing\x20audio/video','type':'boolean'})['option'](jn(0x1ca),{'describe':'Select\x20audio/video/subtitle\x20streams\x20from\x20manifest\x20manually','type':'boolean'})['option']('episodes',{'alias':'e','describe':'Seasons/episodes\x20to\x20download,\x20e.g.\x20`S01E01`,\x20`S01-S05,S07`,\x20`S01E01-S02E03`,\x20`S02-S02E03`,\x20etc.','type':'string','coerce':id=>hB(id)})['option']('retry',{'alias':'R','describe':'Number\x20of\x20retries\x20in\x20case\x20of\x20unsuccessful\x20request','type':'number','default':aW['retry']})['option']('connections',{'alias':'C','describe':'Number\x20of\x20parallel\x20http\x20connections\x20per\x20download','type':'number','default':aW['connections']})['option']('proxy',{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20all\x20requests','type':'string'})['option'](jn(0x221),{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20metadata\x20fetching','type':'string'})['option']('proxy-media',{'describe':'Use\x20specified\x20HTTP/HTTPS\x20proxy\x20for\x20media\x20downloading','type':'string'})['option']('movie-template',{'describe':'Movie\x20filename\x20template','type':'string','default':aW['movieFilenameTemplate']})['option']('episode-template',{'describe':'Episode\x20filename\x20template','type':'string','default':aW['seriesFilenameTemplate']})['option']('hardsub',{'describe':'Download\x20hardsubbed\x20video\x20if\x20available','type':jn(0x383)})['option']('trim-begin',{'describe':'Trim\x20video\x20at\x20the\x20beginning;\x20example:\x2000:00:06','type':jn(0x1ee)})['option']('trim-end',{'describe':'Trim\x20video\x20at\x20the\x20end;\x20example:\x2000:01:30','type':'string'})[jn(0x2e8)](jn(0x2a8),{'describe':'Set\x20content\x20decryption\x20key\x20(if\x20manifest\x20URL\x20as\x20main\x20URL\x20passed),\x20format:\x20KID:KEY','type':'array','string':!0x0,'coerce':id=>id[jn(0x1b3)](ie=>{const q1=jn;let [ig,ih]=ie[q1(0x25b)](':');return{'kid':ig,'key':ih};})})['option']('header',{'alias':'H','describe':'Pass\x20custom\x20header(s)\x20for\x20manifest\x20request','type':'array','string':!0x0,'coerce':id=>hC(id)})['option'](jn(0x334),{'alias':'f','describe':'Video\x20container\x20format\x20-\x20mp4\x20|\x20mkv\x20(Pro\x20only)','type':'string','choices':['mp4','mkv']}),'handler':async ic=>{const q2=jn;let id=ic;id['videoQuality']=ic['quality'];let ie=new aX(f);if(id['format']){let {error:is}=await e2({'videoContainerFormat':id['format']});is&&(v['error']('Invalid\x20format:\x20'+is['message']),v['info'](q2(0x267)),process['exit'](0x1));}let ig=new cG({'dirs':[o],'indexPath':N});await ig['init'](),await ig['loadCoreExtensions'](),await ig['discover']();let ih=new hL(join(G,q2(0x34f)));v['debug']('Downloads\x20storage\x20path:\x20'+ih['filePath']),await ih['load']();let ii=new dk({'settings':ie,'store':ih,'session':new hz(ie,ig,{'trackSelectorFactory':hN,'reporter':fE()}),'analyzer':dr(ig)}),ij=new Set(),ik=cK(),il=!0x1,io=()=>{const q3=q2;if(!il){il=!0x0;for(let it of ij){let iu=ii['getRecord'](it);if(!(!iu||iu[q3(0x233)]==='completed')){v['debug']('Synchronously\x20cleaning\x20up\x20interrupted\x20CLI\x20download:\x20'+it),ih[q3(0x244)](it);for(let iv of cI(iu))rmSync(iv,{'recursive':!0x0,'force':!0x0});ih['getRecord'](it)?v['error']('Interrupted\x20CLI\x20download\x20is\x20still\x20persisted\x20after\x20sync\x20cleanup:\x20'+it):v['debug']('Synchronously\x20removed\x20interrupted\x20CLI\x20download\x20state:\x20'+it);}}}},ip=async()=>{const q4=q2;if(!il){il=!0x0;for(let it of ij){let iu=ii['getRecord'](it);if(!(!iu||iu[q4(0x233)]==='completed')){v[q4(0x388)]('Cleaning\x20up\x20interrupted\x20CLI\x20download:\x20'+it);try{await hP(ii['removeWithFile'](it),hO,q4(0x1fb)+it),v[q4(0x388)]('Removed\x20interrupted\x20CLI\x20download\x20via\x20engine:\x20'+it);}catch(iv){let iw=iv instanceof Error?iv['message']:String(iv);v['debug']('Engine\x20cleanup\x20failed\x20for\x20interrupted\x20CLI\x20download\x20'+it+':\x20'+iw),await ih['deleteRecord'](it),await ik['purgeRecordArtifacts'](iu),v['debug']('Removed\x20interrupted\x20CLI\x20download\x20directly\x20from\x20storage:\x20'+it);}ih['getRecord'](it)&&v['error']('Interrupted\x20CLI\x20download\x20is\x20still\x20persisted\x20after\x20cleanup:\x20'+it);}}}},iq=ay(ip),ir=it=>{let iu=it==='SIGINT'?0x82:0x8f;io(),iq(),hM(iu);};process[q2(0x387)]('SIGINT',ir),process['once']('SIGTERM',ir),ct()['then'](it=>Object['assign'](cr,it)),ii['subscribe'](it=>{const q5=q2;if(it['type']==='job-added'){ij['add'](it['record']['id']);return;}if(it['type']==='job-completed'){v['debug']('Job\x20completed:\x20'+it[q5(0x381)]['id']);return;}if(it['type']==='job-error'){v['debug']('Job\x20failed:\x20'+it['record']['failure']?.['message']);return;}it['type']==='error'&&v['error'](q5(0x1eb)+it['error']['message']);});try{let it=Array['isArray'](ic['urls'])?ic['urls']:[],iu=process.env.ELECTRON_RUN_AS_NODE==='1'?it['filter'](ix=>ix!==process[q2(0x210)][0x1]):it,iv=iu['length']>0x0?iu:[''],iw=[];for(let ix of iv){let iy=await hD(ix),iz=await ii['analyze'](iy,id);for(let iA of iz)iw['push'](ii['add']({'url':iy,'options':id,'entry':iA}));}await Promise['all'](iw),await ii['drain']();}catch(iB){throw await ip(),iB;}finally{iq(),process['off']('SIGINT',ir),process['off']('SIGTERM',ir);}}},hR='azot-desktop',hS=async()=>{const q6=jn;if(await ct()&&!await confirm({'message':'You\x27re\x20already\x20logged\x20in.\x20Do\x20you\x20want\x20to\x20log\x20in\x20again?','default':!0x1})){v['debug']('Login\x20cancelled');return;}let ic=createSpinner('Requesting\x20device\x20authorization...');ic['start']();try{let id=ch(),{data:ie,error:ig}=await id[q6(0x331)]['code']({'client_id':hR,'scope':'openid\x20profile\x20email'});if(ic['stop'](),ig||!ie)v['error']('Failed\x20to\x20request\x20device\x20authorization:\x20'+(ig?.['error_description']||ig?.['statusText']||'Unknown\x20error')),v['debug'](ig);else{let {device_code:ih,user_code:ii,verification_uri:ij,verification_uri_complete:ik,interval:il=0x5,expires_in:io}=ie;console['log'](''),console['log'](T['cyan'](q6(0x288))),console['log'](''),console['log']('Please\x20visit:\x20'+T[q6(0x297)](T['blue'](ij))),console['log']('Enter\x20code:\x20'+T['bold'](T['green'](ii))),console['log'](''),await confirm({'message':'Open\x20browser\x20automatically?','default':!0x0})&&await a4(ik||ij),console['log'](T['gray']('Waiting\x20for\x20authorization\x20(expires\x20in\x20'+Math['floor'](io/0x3c)+'\x20minutes)...'));let ip=await hT(id,ih,hR,il);if(ip){await cs(ip);let {data:iq}=await id[q6(0x374)]({'fetchOptions':{'headers':{'Authorization':'Bearer\x20'+ip['access_token']}}});console['log'](T['green']('✅\x20Login\x20successful!\x20Logged\x20in\x20as\x20'+(iq?.['user']?.['name']||iq?.['user']?.['email']||'User')));}}}catch(ir){ic['stop'](),v['error']('Login\x20failed:\x20'+(ir instanceof Error?ir['message']:'Unknown\x20error'));}};async function hT(ic,id,ie,ig){let ih=ig,ii=createSpinner('',{'color':'cyan'}),ij=0x0;return new Promise(ik=>{let il=async()=>{const q7=b;ij=(ij+0x1)%0x4,ii['update'](T['gray']('Polling\x20for\x20authorization'+'.'['repeat'](ij)+'\x20'['repeat'](0x3-ij))),ii['isSpinning']()||ii['start']();try{let {data:io,error:ip}=await ic['device']['token']({'grant_type':q7(0x256),'device_code':id,'client_id':ie,'fetchOptions':{'headers':{'user-agent':'Azot\x20Desktop'}}});if(io?.[q7(0x3c1)]){ii['stop'](),ik(io);return;}else{if(ip)switch(ip['error']){case'authorization_pending':break;case'slow_down':ih+=0x5,ii['update'](T['yellow']('Slowing\x20down\x20polling\x20to\x20'+ih+'s'));break;case'access_denied':ii['stop'](),v['error']('Access\x20was\x20denied\x20by\x20the\x20user');break;case q7(0x3a3):ii['stop'](),v['error'](q7(0x30f));break;default:ii[q7(0x36e)](),v[q7(0x264)]('Error:\x20'+ip['error_description']);}}}catch(iq){ii['stop'](),v['error']('Network\x20error:\x20'+(iq instanceof Error?iq['message']:'Unknown\x20error'));return;}setTimeout(il,ih*0x3e8);};setTimeout(il,ih*0x3e8);});}const hU=async()=>{const q8=jn;v['info'](q8(0x19f));let ic=await ch()['signOut']();ic['error']?v['error']('Logout\x20failed:\x20'+ic['error']['message']):(v[q8(0x1c9)]('Logout\x20successful'),await cs({}));},hV={'command':'login\x20[extension]','describe':'Login\x20to\x20extension\x20(or\x20if\x20no\x20extension\x20is\x20specified,\x20login\x20to\x20Azot\x20account)','builder':ic=>ic['option'](jn(0x2c4),{'alias':'u','describe':'Username','type':'string'})['option'](jn(0x2f9),{'alias':'p','describe':'Password','type':'string'})['option'](jn(0x1fd),{'alias':'o','describe':'One-time\x20password','type':'string'}),'handler':async ic=>{const q9=jn;let id=ic[q9(0x2f7)],ie={'username':ic['username'],'password':ic[q9(0x2f9)],'otp':ic['otp']};if(id){let ig=new cG({'dirs':[o],'indexPath':N});await ig['init'](),await ig['discover'](),await ig['login'](id,ie);}else hS();}},hW={'command':'list','aliases':['ls'],'describe':'Lists\x20information\x20about\x20installed/active\x20extensions','handler':async()=>{const qa=jn;let ic=await new cG({'indexPath':N})['init']();if(!ic['infoList']['length'])return console['log']('No\x20added\x20extensions\x20found');for(let id of ic['infoList']){let ie=''+T['bold'](T['blue'](id['name']['padEnd'](0xf))),ig=T['green'](id['package']?.['version']);console['log'](ie+ig);}console['log']('\x0a'+T['dim'](qa(0x1ce)+s));}},hX=new Intl['RelativeTimeFormat']('en',{'style':'long'}),hY=ic=>{const qb=jn;let id=Math['floor'](ic/0x18),ie=Math['abs'](id);return ie>0x16d?hX['format'](Math['floor'](id/0x16d),'year'):ie>0x1e?hX['format'](Math['floor'](id/0x1e),qb(0x195)):ie>0x7?hX['format'](Math['floor'](id/0x7),'week'):ie>0x1?hX['format'](Math['floor'](id),'day'):hX['format'](Math['floor'](ic),'hour');},hZ=(ic,id,ie)=>{let ig=''+T['bold'](T['blue'](ic['padEnd'](0xf))),ih=T['green'](id['padEnd'](0xa)),ii=T['dim'](ie);console['log'](ig+ih+ii);},i0={'command':'list-remote','aliases':['ls-remote'],'describe':'List\x20all\x20available\x20extensions','handler':async()=>{const qc=jn;ct()['then'](ie=>Object[qc(0x2c6)](cr,ie));let ic=await cG['getAvailableExtensions'](),id=Date['now']();for(let ie of ic){let ig=ie['releases']['toSorted']((ik,il)=>new Date(il['createdAt'])['getTime']()-new Date(ik['createdAt'])['getTime']())['at'](0x0);if(!ig)continue;let ih=ig['createdAt'],ii=new Date(ih)['getTime']()-id,ij=hY(Math['floor'](ii/0x36ee80));hZ(ie['name'],ig['version'],ij);}}},i1={'command':'logout\x20[extensions..]','describe':'Logout\x20from\x20extension\x20(or\x20if\x20no\x20extension\x20is\x20specified,\x20logout\x20from\x20Azot\x20account)','handler':async ic=>{let id=ic['extensions'];if(id?.['length']){let ie=new cG({'dirs':[o],'indexPath':N});await ie['init'](),await ie['discover'](),await ie['logout'](id);}else hU();}},i2={'command':'settings\x20[key]\x20[value]','describe':'CLI\x20access\x20to\x20get/set\x20configuration\x20settings','handler':async ic=>{const qd=jn;let id=new aX(f),ie=ic['key'],ig=ic['value'];if(ie&&ig){id['set']({[ie]:ig}),console['log']('Setting\x20'+T['bold'](T['blue'](ie))+'\x20set\x20to\x20'+T['green'](ig));return;}else{if(ie){let ii=id['get'](ie);console['log'](ii?'Setting\x20'+T['bold'](T['blue'](ie))+'\x20is\x20'+T['green'](ii):qd(0x305)+T['bold'](T['blue'](ie))+'\x20is\x20not\x20found');return;}}let ih=id['getAll']();for(let [ij,ik]of Object['entries'](ih)){let il=(''+ij)['padEnd'](0x19),io=String(ik)['replaceAll']('{','{{')['replaceAll']('}','}}');console['log'](T['bold'](T['blue'](il))+'\x20'+io);}console['log']('\x0a'+T['dim']('Location:\x20'+f));}},i3={'command':jn(0x2ee),'aliases':['rm'],'describe':'Uninstall\x20an\x20extension','handler':async ic=>{const qe=jn;let id=ic['extensions'],ie=new cG({'dirs':[o],'indexPath':N});await ie['init'](),await ie[qe(0x245)](id);}},i4={'command':'install\x20<extensions..>','aliases':['i'],'describe':'Install\x20extension','handler':async ic=>{let id=ic['extensions'],ie=new cG({'dirs':[o],'indexPath':N});await ie['init'](),await ie['install'](id);}},i5={'command':'logs','describe':'Show\x20logs\x20list','handler':async()=>{const qf=jn;let ic=w,id=await readdir(ic)['then'](ig=>ig['filter'](ih=>ih[qf(0x31f)](qf(0x32b)))),ie=ig=>join(ic,ig);id['length']||v[qf(0x1c9)]('No\x20logs\x20found');for(let ig of id)v['info'](ie(ig));}};v['debug'](l);const i6=av(process['argv']);v['debug'](B+'\x20'+i6['join']('\x20'));const i7=new Set(['build','dev']);C['on']('error',ic=>{let id=K(ic);v['error'](id['message']);});const i8=T['magenta'](T['bold'](c))+'\x20is\x20'+j['description']['toLocaleLowerCase'](),i9=T[jn(0x320)]('Usage:\x20$0\x20<command>\x20'+T['cyan'](jn(0x212))),ia=async(ic,id)=>{const qg=jn;let ie=id instanceof Error?id:Error(String(id));v['fatal'](ic+':\x20'+ie['message']),ie[qg(0x2cf)]&&v['debug'](ie['stack']),await az();try{rmSync(q,{'recursive':!0x0,'force':!0x0});}catch(ig){v[qg(0x264)]('Failed\x20to\x20remove\x20temp\x20directory\x20'+q+':',ig);}process['exit'](0x1);};process['on']('uncaughtException',ic=>{ia('Unexpected\x20error',ic);}),process['on']('unhandledRejection',ic=>{ia('Unhandled\x20promise\x20rejection',ic);}),!h&&i7['has'](i6[0x0]??'')&&ia('CLI\x20error',Error('The\x20`build`\x20and\x20`dev`\x20commands\x20are\x20unavailable\x20in\x20the\x20desktop-distributed\x20CLI.\x20Use\x20the\x20npm-installed\x20`azot`\x20package\x20in\x20a\x20Node.js\x20environment\x20instead.'));const ib=S(i6)['scriptName'](B)['usage'](i8+'\x0a\x0a'+i9)[jn(0x390)](hQ)[jn(0x390)](hW)['command'](i0)['command'](i4)['command'](i3)['command'](hV)['command'](i1)['command'](i2)['command'](i5)['option']('debug',{'describe':'Debug\x20mode','type':'boolean'})['wrap'](S()['terminalWidth']())['help']()['alias']('h','help')['showHelpOnFail'](!0x1)['version'](i)['updateStrings']({'Commands:':T[jn(0x320)]('Commands:'),'Options:':T['bold']('Options:'),'default':T['dim']('default'),'aliases':T[jn(0x344)]('aliases'),'boolean':T['dim']('boolean'),'string':T['dim']('string'),'number':T['dim'](jn(0x269))})['epilogue']('Learn\x20more\x20about\x20Azot:\x20'+T[jn(0x26c)]('https://azot.mov')+'.');h&&ib['command'](aP)[jn(0x390)](aQ),au()['then'](()=>ib['parseAsync']())[jn(0x2b0)](async ic=>{await u(w);let id=String(ic['_'][0x0]??'');id==='dev'||id==='build'&&ic['watch']===!0x0||process['exit'](0x0);})['catch'](ic=>{const qh=jn;ia(qh(0x290),ic);});export{};