coze-bridge 0.1.20 → 0.1.21
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/index.js +61 -61
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,25 +5,25 @@ import { dirname as __coze_dirname } from 'node:path';
|
|
|
5
5
|
const require = __coze_createRequire(import.meta.url);
|
|
6
6
|
const __filename = __coze_fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __coze_dirname(__filename);
|
|
8
|
-
var
|
|
9
|
-
`,
|
|
10
|
-
`):
|
|
11
|
-
`)}function R(n){return{debug:(e,s)=>Xt("debug",n,e,s),info:(e,s)=>Xt("info",n,e,s),warn:(e,s)=>Xt("warn",n,e,s),error:(e,s)=>Xt("error",n,e,s),child:e=>R(`${n}.${e}`)}}var Qt,Mi,g0,p0,zi,F=Pe(()=>{"use strict";Qt={debug:10,info:20,warn:30,error:40},Mi=(()=>{let n=process.env.COZE_BRIDGE_LOG_LEVEL;return n==="debug"||n==="info"||n==="warn"||n==="error"?n:"info"})(),g0=process.stdout,p0=process.stderr,zi={}});import{homedir as m0}from"node:os";import{join as te}from"node:path";function G(n){let e=n??m0(),s=te(e,".coze"),a=te(s,"bridge"),x=te(a,"lib");return{cozeRoot:s,bridgeRoot:a,libDir:x,libEntry:te(x,"index.js"),pidFile:te(a,"bridge.pid"),portFile:te(a,"bridge.port"),tokenFile:te(a,"bridge.token"),logFile:te(a,"bridge.log"),installLock:te(a,"install.lock"),configFile:te(a,"config.json"),agentsRoot:te(s,"agents")}}function Ie(n,e=G()){let s=te(e.agentsRoot,n);return{root:s,config:te(s,"config.json"),workspace:te(s,"workspace"),logs:te(s,"logs")}}var ce=Pe(()=>{"use strict"});var nn={};Li(nn,{AGENT_CONFIG_FILE_MODE:()=>en,enforceAgentConfigMode:()=>y0,loadAgentConfig:()=>ue,persistAgentSessions:()=>yr,persistAgentSkills:()=>tn,saveAgentConfig:()=>me});import{chmod as w0,stat as _0}from"node:fs/promises";function ue(n,e){return xt(Ie(n,e).config)}function me(n,e){return Zt(Ie(n.agentId,e).config,n,{mode:en})}async function y0(n,e){if(process.platform==="win32")return;let s=Ie(n,e).config;try{let a=await _0(s);if(!a.isFile())return;let x=a.mode&511;x!==en&&(await w0(s,en),Ui.warn("agent config mode auto-corrected to 0600",{path:s,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;Ui.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:s,err:String(a)})}}async function yr(n,e,s){let a=await ue(n,s);a&&(a.sessions=Object.fromEntries(e),await me(a,s))}async function tn(n,e,s){let a=await ue(n,s);a&&(a.skills=e,await me(a,s))}var Ui,en,Fe=Pe(()=>{"use strict";$t();F();ce();Ui=R("agent-config"),en=384});var Ms=oe($=>{"use strict";var E=N;(function(n,e){let s=N,a=n();for(;;)try{if(parseInt(s(578))/1+parseInt(s(1640))/2+parseInt(s(1432))/3*(parseInt(s(1708))/4)+-parseInt(s(864))/5*(-parseInt(s(1339))/6)+-parseInt(s(1346))/7+parseInt(s(1492))/8*(-parseInt(s(1994))/9)+-parseInt(s(1019))/10*(parseInt(s(1938))/11)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(Rn,644387);var Yx=Object[E(1729)+"operty"],Zx=Object[E(677)+E(1211)+E(1178)],Rs=(n,e)=>function(){return n&&(e=(0,n[Zx(n)[0]])(n=0)),e},$x=(n,e)=>{let s=E,a={naFBq:function(c,f,l,m){return c(f,l,m)}};for(var x in e)a[s(1670)](Yx,n,x,{get:e[x],enumerable:!0})};function Xx(){return Ds||(Ds=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Rn(){let n=["twv5qNK","Ee5qBge","uu9WvLm","tvbowhq","ywnkDK0","r3vuAu0","Aunzt2i","wLDuCNO","y1vOwuG","yw5ZzM9YBvq","yw5pCxC","yvruBKW","q0jRu0S","rgrVyLe","wejADxG","twLZC2LUzYa","shPpEgi","y3jLyxrLuMu","t2rqvKy","sw9Azhy","zvvYBa","mJKYDgzxqxvJ","txP0D20","D0rvCNu","x0rctMfTzq","BgLTAxq","tKfusvzfx0u","tg9JAW","CM92AwrLige","zxjFAxnFywm","qM1tC28","z3HdtLO","AgvHzgvY","DhjPzxm","Ae9srgy","zLfMzMq","Ec1TC2CTy3u","AwrI","uM1ktei","DgvZDa","wgHeBKO","DKn1EvG","zgvMAw5Luhi","zgv2AwnLx2K","DvLAqM4","u1rjtLu","x3nLBMrby2S","qNncwKG","EwDHC2K","AefJA01LC3m","shvtswS","z2j0Bem","y2HLy2Tszwe","rfnJC3a","CMvTB3zLrxy","sKzkswu","D3bNqxm","zwrPyxrLBhK","t0HLy2e","C2v0","zNjVBujPDhm","yw5Hz2vY","DeDts3G","Efrurw52","vffWBu0","BM5Ly3q","BuDRu2m","y29UDgLUDwu","vMT1BLa","BuHiy1K","r29Ms0W","DxnLCKLW","q3DNA2O","EeDqDfe","AgH3zxy","zcWGDw5RBM8","C3vJy2vZCW","y2TWtfC","CM5zt3m","x3bPBMDmB3m","y3jLyxrLq2W","v3rtD3y","C3bSAxq","yNn1z0u","wvPyD2y","BM93","vu5OrK4","ANzRu0y","z0ntuxi","Cg93","zeXtzxu","CgLUz0XVC3m","y1L3qLi","z2v0q3vYCMu","Bwv0Ag9K","AwPsv3y","ELzfvxC","zxjFCw9Z","y1jJvgK","AgvHzgvYCW","rfvvCe0","Cgf5Bg9Hzfq","q3jHr0O","Aw9U","x2n1CNnVCK0","Dw5KzwzPBMu","sxn1Dfm","y0DZEvK","aaaaaaaaaaa","y29UDgv4Da","zxblz1y","rwTTCKG","vwXhEhq","Ec1TC2CTCw8","C2vYDMLJzq","rgTHs0W","zMvY","yxnZAwDU","AMTXvLm","CMfTzq","sK1Mv3K","B3nLza","v3bpwKS","Cej6D1O","Bu1yB0q","BuTeteC","BgvY","DgLTzw91Da","wfDnAuq","EvPxAee","wuTorM8","wgLXBuO","A3nIswq","tKTpDK8","y2PgDui","AMTnsgu","zxjYtxnN","v0rOt28","zNDMEgO","EvzrDKK","B25nzxnZywC","zxH0zw5ZAw8","zNvcvNu","yNL0zxm","q25xvee","q09oveLovuu","CeTruKS","A2r2suq","C2DStM0","v1rgt2q","B3bLBKrc","DMLNsu0","AwXLtMfTzq","rMvYAw8","Ae1LC3nHz2u","r0PIzKe","q0PcDfu","tvvqrKO","B25pCgvU","z2zdDfy","z2v0u3rVCMe","qw1VDw50","t29dtfe","DgLUzYbZzxi","BwLUAvbYB2C","CujPs0C","zMzmAw5L","BgXbDKW","y3vYC29Y","AgLNAa","zhDlrMG","AMzHB28","tfbPsM8","vM9MC2y","Dg9Y","Be9XreW","rezkEge","y2XVC2uSihC","yxzxt2O","Agrgruq","AujuAvq","sw1RuNu","r0XREhO","Aw1qEKS","y2vZC0HHBMq","AvLwB1y","r1ztB3m","C2HPzNq","wK5QtMG","B2LUDfjLywm","tfPvuvu","yxv0B21HDgK","A1Dpwvi","yMrFzgLK","CMvJzxzPzwq","D0fVuuK","tuLNsue","C3rYAw5N","Dg9tDhjPBMC","y0LUrKe","CIb0DhDjra","t3rWBvm","BeruuNe","AK9MtLu","quPcu0m","uKL0v1u","z1nerfa","y2fSBa","wgD6wwK","ywXty29Wzq","zNjVBNrPzxi","yLDOEhC","twXYBgG","BMXIA0K","tLnPsey","ihbYB3rVy28","zNjVBu51Bwi","se1nwM8","BeTZAuS","yLjIAvC","rKjYuMS","DgvmwNi","DLbZBKi","Cw1YzMG","B1fWAvu","tNDZtLq","C0nVDw50zxi","BLHUz2S","DLvys1y","D2zqtwG","yMLUza","wePVDfi","zg9Uzq","y2rxwK8","qNLLq0q","zgvSzxrL","D1rQuMC","CMvXDwLYzwq","BMfTzq","A2PAwKe","t2jYyKu","AgvKtwf4uMu","x29UtwvZC2e","yNLL","zxLnru0","tKDFrvjst1i","x2fKzfDZtgK","CMvKDwnL","BKvYtuy","DgLLCKPtt04","ugvbq0u","ntyXqNrdwKru","BMrWB2LUDfq","C3rVCcbPBw0","tw9KDwXL","EM9buxK","r3LivNG","AwXSihvZzsa","AxnFywnR","D24GCMvHC28","x3jLywr5q2W","y1bpAKS","zhrtvKu","B1n6uvm","uuTct3K","s2TuAfq","s05uqKS","nhWXFdv8mG","zw5KCg9PBNq","Bg93","B2fK","EK5zrgW","yurduhO","ufrZquq","ihn1y2nLC3m","C3PzBMi","DhjPBq","DwjiC2m","EvDvu1O","rxnoBfa","txvxAvy","zgvS","CvfltNm","zMveD2u","A21mvhK","wvDHCKW","DhPmC3q","yu5yu3e","tMPsu1G","yMfJA3vWigu","B0r1zgq","vNLuq2O","x2LZsw5PDa","DhLWzq","zg9iEu8","Bg9yyxu","BgLUzw5V","BuzQq0W","Aw5N","sM9NsMe","qNjWvvu","Aw50zwDLCIa","DMfSDwu","uLblv1O","Eujpv24","A2jezha","B2nRzxq","ndeWnffRtKv5qq","zMzLCG","sKLyBgq","uwHQyuS","C3rYAw5NAwy","Bw9NBwC","BwvY","zw50","sNnRt0C","C0nNtNC","lcbTyxGGCMu","D0L3DLu","zfDVCMTLCKC","zeLwEKq","rxjYB3jdB2q","CMnfEgq","DcbVzIbYyw4","x2nSzwfYugK","DxbKyxrLq3u","q1biBvu","mhWYFdr8m3W","CNfYCwS","Aw5L","y29Kzq","vKPmAeK","y2XVC2veqG","q1LADKq","DhDVCMTdAge","rvbhwem","Bg9Nsurhzw4","werlqNa","DNrrwNK","BfH6rgO","BMDXs3i","y29Uy2f0","zwzvz2K","z2v0qwXS","sejmBeO","ChjVDg90Exa","C0vUsLK","rwH2ENe","ChbL","CxPzwfi","vhbmDge","BwvZC2fNztO","q1zTswC","zNjVBunOyxi","sg9nCuy","A0TAEfy","ywXOwfC","Be5NAxe","vLHHvLu","q0nbAxe","CeDpv1a","Ag1xwLq","AhPeBem","ignVzgu6ia","C0jf","ChfyA1i","Dhr6DgG","yNvMzMvY","ruXnqxm","DgLSCKy","vxPVr2O","CMfTugfYyw0","zMjpDLy","Aw1LCYbPBIa","uuz6ufC","AufctgC","v0Pnt1q","v2XkDxq","r0rnAwK","zLv4r3C","Bg9NsurozxC","C3jJ","x2nVBM5Ly3q","nhWXFdj8mhW","CMvUDevUzha","zeTHqwS","ruH4v0G","y291BNq","DurfuuO","y3r4","swnVu0i","DhnAvNm","BMv4DcGPigm","yxrLq291BNq","qwDrDwy","y2nfC28","B3jRzxjhBg8","y29UBMvJDgK","B2nRzxrgywK","y29UBMvJDeu","zw5XDwv1zq","vgfN","Au1gtee","y1fzwhO","v0zyzfe","yvDIvNu","qvfYuMm","Dw5RBM93BIa","tLfIs2q","tvb1zfm","BefvuKu","Bw1rDwK","t1DeBgK","BxLxzK8","twvZC2fNzuu","Cgj2tu0","B2nRzxrtDwm","vvPYBNe","uLfSuvm","y2HLy2TdDxi","refTAhu","Dhr3Awq","DgXLD1a","qMjcr20","A1Lurxu","rMzfwwK","t3HiDNK","DfHsugW","zfPctLy","mtaZmJK2ohHjAwLZqG","yxrHlcbKyxq","EfriEwS","AMrlAeK","sgjjBha","z3fezMS","wvbKwNy","ywDLsgLKzq","sfDnuvi","CfLrwgC","zeH4DM0","sg9PwKO","EKrKqMW","AxnszwfKEq","sfnsBha","yw1Rvxm","CxHvB1y","DeLWswu","rKPiCwG","AKnSBvG","uMTADhe","AwDHDg9Yt24","sMnRA2e","uwLKwgu","C3nHz2vfDMu","DgfYz2v0","CM1tAhm","wLH3CgW","vgHTAfi","rgPHDwe","yMLZDuG","zxmGCMvHy2G","CMvHzfvjBNq","C3vdzuG","yMXVy2TLza","Bg9IywXty28","B2Xfu0S","yNDKwu4","ywnRx2LK","rgvKAwnHDgu","DhDqAva","ywnR","zxjHDg9Y","zw5NDgG","Ew9Huxq","Cg9PBNrbBMq","u0Hgwhm","v09NzK0","DKXVDfG","z3fwDKy","CgLUz1rPBwu","zw50zwqGDhK","B0PptMi","q0rtt1u","z3fJBfi","Cw9Zx18","B05Zz0G","t0DXqu8","z2u6ia","C2XPy2u","r3fbvfm","s3vjquC","u2HHCMvKv28","sMrHy1m","C25myKW","wNHjqwW","CNnNAwK","uMvJB25Uzwm","uujQs2S","ExbL","D1HZqLO","wvjMu2y","B25tDg9Wsw0","x3bYB3rVy28","u3zHqw8","B25JBg9Zzq","BMnLq2XVC2u","wxnvvM8","zxj2AwnL","yw1Lu3bHy2u","qKH0ru8","D3zOELe","BNruCMLLC0m","Dg9oDw1Izxi","x2DLBMvYyxq","AhfuDNu","CwLTvfG","ufvnBfe","CuPZzLG","BLbPy0O","s0f2CeO","Bwf4twvZC2e","uw5SvKC","CgjsrK0","C0DTrgi","CgLUz0LUDgu","sxvxs3i","sg9iEK0","x3nLCuLK","z2v0t3DUuhi","D1ffChK","EvnjuwW","AhPVC1O","wfjVCK4","BgLZDgvUtMu","x2LUAxrqCM8","vgLmufK","CvDAzwm","yM9KEq","tMf2Cwu","tfPtBw4","v2nxq2W","AM9PBG","Dg9cExrLCW","nhWYFdn8mhW","B2zMC2v0","BhrPCgXLihq","t2nhsMi","EKjvu2m","D2fZq2XLyw4","y3jLyxrLt3a","C2fNzq","sNb4sfK","mxWZFdr8mNW","D2nmte8","CgjICdi","DKXkBvC","zxjFywnRx20","qwn0Dfi","r25TD2C","shvyvwK","Dg9cExrLC0i","Cej4ze4","yxnL","y29UC3rYDwm","DxDbzLO","zxHQA3u","CMvTB3zLq2G","z2LcB3G","yNHTt0u","re9ku2C","Aw5JBhvKzxm","DwL2tvK","B3bLBIa","AxjLza","rvjst1i","ywDL","yw1LoIa","igzHAwWSig0","DuH5tg4","Dxrjza","y1zMBMC","Cgf5Bg9Hzeu","u2vXsuq","uLLSCMS","zgrjrcWGzgu","x3DZsw5ZDge","quvuD3y","qvjmwvy","uLjpuG","De5xAeO","yxrPqwW","x2rItMfTzq","u3rYyxrLz3K","C2v0q3vYC28","zM9Yy2u","D0nMDuu","Aw5KzxHpzG","x29UvgLTzw8","EvjLy29UBMu","tNbYuxq","vgPSuxe","qLPpwLu","s1PlywS","q2LkAgm","zu1kwNO","tgLZDgvUzxi","zgvJB2rLzey","ywrKt25L","B25tDgfYDfi","Aw47y2HHCNm","De1HBMfNzxi","zMXVB3i","DwvtqMW","vwjdru4","DK5Org4","qwTqshu","A2nOB1m","C1rmtwO","x0vysvnu","Dxb1zKW","x2n1CNnVCK4","zuf0r00","u2vYDMLJzvC","zfnjC1q","Cfnbzey","yNvMzMvYzwq","zNjVBuj5Dgu","x25HDMLNyxq","zMX1C2HfEha","BNzXruC","Fdn8mxW0","zxjYB3i","BMDuAw1LCG","DhjHBNnHy3q","y2XLyxjtDg8","Bwf4uMv0CMK","yxrVrva","ysbTDxn0igi","v2v6tMq","qML5DK4","q3vZDg9Tq2W","wMHiqLu","BNrLCG","ANL5B2S","AwLsC2G","DvjOt0q","A2v5","v3rlqxm","C2vUzf9Hy2S","zfD0Chq","B2jctxO","zNvUy3rPB24","AMjsAMy","nxW3Fdz8mG","Cw9Z","DKLgvhK","A2v5CW","Dg9VigXHCMC","C2DPza","q3foA3q","DNHxsfK","yxb2rvC","DgLTzw91DcW","CMvQzwn0","BhveEwW","ChrVCG","CNjVCK1LC3m","rwz2qwy","ihrPBwvVDxq","ugTWrLK","ufjLyLa","vMzAwKW","D2vI","zuDTwKy","CgXLyxnLiha","BMnVzgLUzW","qNvXwMK","t294C0O","ueDdy1u","C29Tzq","x2n1CNnVCKy","q0Hvsve","lcbOB3n0BMe","B2jQzwn0u3q","z3flA3a","zxjYtM8","CYbPBNn0yw4","yKTwAw8","ywWGy3vYC28","suvtx0vsuK8","y3buwu0","x3bPBMDqB24","uNzeBu4","BMvJDa","CujWr3O","AxmGDw5Kzwy","igXHCMDLCIa","r3vQyu4","q05mz0O","x29UrxjYB3i","DgfIyxnL","rvLysfO","x2rPC3bHDgm","m3WY","DePyEKm","BKXPDfi","zw5JB2rLrNi","sNrQv0K","rxzLBNq","DMfSDwvZ","uK1JuxG","CLzHBhvLCW","BgvUz3rO","Cg9PBNrdB24","yvnPAvu","nta5nZC0nxjgt2jyDq","zw1LBNq","B25ozxr3B3i","DwD3tw0","A1rwqMq","Dg9hzw5LCMe","qLvxAe4","uND3CeG","s0XQD3e","Dxr2rwO","yuzfD0O","uNDMtu4","wNfJr04","mhW1Fdj8mxW","u3Pqu1C","C3vIyxjYyxK","y09Wzw4","sxPKtLq","uNLcyxK","CNzHBa","BLHVzwy","werVtgC","q0Xpu0ve","zMzMzG","z2vjBMzVu3K","sfPMwfq","x3jLy29UBMu","A0H1DMy","y2zzvuS","CMfUzg9T","sKvOq3e","z2v0sxrLBq","zM56q1K","C2v0y3vYC28","sLfHA2G","q09KCwm","rvvdqKy","q09otKvdveK","ywDLu2HVDW","v2rLvMq","ihrYEsbYzwm","y3jLyxrLt2i","v0T0C24","y2z4AhO","t21PBeG","CgfNzwHPzgu","wvDlsvu","tLDds1m","DxnOAM4","tg9NsurozxC","rfvvvuO","t2jgyM8","Bu54z1y","s0Pdqum","v0f1vwG","BLnxtMq","AfnszNK","y3vYCMvUDeK","x2zVCM1HDeu","sMXxAuS","q1nABeW","DhD5BfO","DxjS","weLjwNO","ALbeu2O","rwPqDhi","EKzSAxy","z05dywS","EunUBLm","oxW3Fdb8nNW","CKHMC2y","EuLruxG","CgvYC2LZDgu","rLjptLrjrvi","wuLywMO","mNWXmhW1FdG","x3fVC0rc","tLrJzNK","C29YDa","EKnMz0S","DMvUDa","A0TgrhK","wwjLyw8","zwnVBM5Ly3q","vfvPvvi","Dg9sENm","A2v0ignVBNm","t2zJsfG","uNDrwNu","C2v0sxrLBq","rMXUq3e","zgf0yq","tLvhA2y","BLvoshK","rvbLyMe","rKvfuKK","r21Vtxe","r2Tny24","q3DzzwS","EuLkrKi","x2rYB3bhBg8","Ahf5wvK","C3blrxa","A01eEui","uLHABeu","x2rPC2nVBM4","CMzQC28","s3nVt2S","sgPjyK8","rw5es1C","CwvPrKK","DKXkvuq","BezSDxnO","zgvSzxrLrge","C3nJzwm","ufLzuhu","DeLK","DNLmBva","ELH0C0G","s214u0e","q0Xpu0LorW","AhvsveS","zvbqAwS","reTRq1G","wMXiAMG","BNrfBMrWB2K","t2jQzwn0","l3DZl3yY","ihzHBgLKigq","BML0AwfSAxO","wfvUuvK","sNfovxC","sLnptLa","zw1PDa","tfb5sw4","Cujoqxy","z2vY","z29PBMCGyxC","yKreAwS","shn2wxu","nhWWFdj8mxW","z2v0q3vYC28","q1PXrNO","BMv3vMvYC2K","ywXSzwqGBxu","x29Uq2XVC2u","zv90Aw1LB3u","A1PiALq","DLzTDei","ihzHBgLKihm","x2rLC3rYB3K","Bg9N","ChjVy2vZCW","t3bLBKv2zw4","swDgseG","mtuYmZmWvMrLte5f","tuvtu0fhrv8","DxfvC3i","x2HHBMrSzva","BfzJD3y","ywrKq291BNq","BKHZuwq","uMn3r2e","x194x21Zz18","y2HHCKnVzgu","u0zlBem","B25dBg9Zzq","x3nVy2TLDa","s2HRCwO","BwvZC2fNzv8","DLLfDfC","BM1JB0y","x2LZtwLUAvC","yxv0BW","EwPTwxu","ywnRtxnNswq","DeTzBg4","rMDny1O","wLbKA3i","u1rWz2K","uhjPBwfYEuS","shbprue","tKretNa","tMfoB2y","s2PmBgy","t25uBwm","tfnRwvO","AgfZ","x3jLBw92zvC","BNrbBMrvCgq","Aw5Lza","B0jlEfe","tMLQEu0","u0nkrgi","r1j5Buy","AwPKB0i","Dfrxzey","C0jkEwy","yMfSu2nVCgu","zw5HyMXLuw8","CNzHBfzHBhu","uxvLDwu","tNzZrfG","z1rPBwvVDxq","CMTLCKDSB2i","CezJExO","wwD4DNG","CM96t3K","q29Kzq","C3vIC3rYAw4","t2Lcq24","vuXpq00","C0XPC3rLBMu","wenSBK0","x3DZ","zcWG","zezREK0","y0jPCM4","sMjNtMq","ywzL","t1v3vxK","CMvZzxruCMK","D3jPDgvvAw4","Bur0wK8","s2TxEuy","qMzIqLu","CMvHC29U","DgvmB2Djre4","BMCGzMfPBgu","rNnJCMe","wxDLyNi","wgTvrge","y2nHy1a","s1rqu2S","v1j5vfm","zM9YrwfJAa","BxDkwxa","z1zMy28","Ehzuv1K","vxzcyM0","sgv0sKC","vNLAD1u","C3rWDMi","CwzpwKG","wLf4rwC","A2r4AK0","zw50tgLZDgu","B2zMBgLUzq","z1PfuK0","y3jLyxrLrwW","DwnVvwS","yw1L","CMfNzvn5BMm","CgfYC2u","A2fSrgW","whjcrNC","AxnAzxjV","Bgztwxa","BMrWB2LUDca","y3ruAw1LB3u","ANvxDLm","s3LcBwO","CMLLC0nVDw4","AuzOwgO","z3ndwMi","DxnLq2y","x2LUAxrhBg8","CgLUz19VBMm","zhDtAKq","q1jyEMG","vgLTzw91Da","A1PlDgi","y3vYCMvUDeu","r3bcr3G","zfvUBe0","BxnN","Aw9Ul2PZB24","uvjNvfa","CxLpDeq","wMPxBxa","BMDLza","u0nxweO","EMzrz2G","ihjLy29UBMu","Bhfmwfm","zNfQt0C","sMPvzeO","ign1CNnVCIa","whHev2u","AK5WzwK","C0r3wgO","A3bTB3K","y3vYC29Yx24","reXAtgS","rKnZD1O","CMvZB2X2zq","B3jLtMfTzxm","sKPzyw4","yxf1wem","EwjOsui","zNbcBNK","zeT6EKy","qKnnuxu","z0rJzgW","BwLZzq","x3bPBMC","rxbxC1y","BKTtr1K","uNfqDg8","yuD1BKC","r3H5rMy","x3vYBa","AwXK","rerpCMS","BwvZ","wwfZDfm","Exj5vNK","zhDvs0u","BNvTyMvY","rerkufm","DhjuzuK","zePfqNC","txfqBgG","B25Uzwn0Aw4","CMvZzxrfBMq","AwjgEhe","CLLvuLy","AuDmALa","z1Hjq2G","rerjENa","zgLZCgf0y2G","pxv0zI04","CenPsei","B2XKvMvYC2K","C2vYDMvYvgK","B25VCgvU","zxnzzKq","uLjrBwi","DhbizwfKzxi","y2XVC2u","q2TPBuy","Dg9iyxnO","BwvKAwf0zwW","u2vsvLG","Ahr0Chm6","BgzzDNi","rNbHsK4","B3bLCNr5tMe","rfrJru0","x2TLEvbHDgG","CfvzCK0","vgLduLK","x19LC01Vzhu","qu5VtgO","CMrVthq","Ae9Wzw5fDMu","AgfZt3DUuhi","q3H5zw4","C21fshu","q3j0Aha","x3bHDgHlzxK","CMXutKm","BeHHBMrSzxi","refmsxy","z05bAhO","zxHWB3j0CW","m3W0","tg9Nsuq","vNPIAxG","Ec11C2uT","tuv1sMG","lcbxzwjtB2m","ihrPBwvZ","rgDhC0y","Bwu6ia","DhrUwwq","zsbHihn0CMK","rLDt","y29SBM8","vNf2vvu","x3DHAxq","Efbwzhi","shviAhG","BKXPBMu","vfjWrgO","DuP1tee","r1Ljr3a","x2LZqNjVD3m","vxLksgS","vgfWuwu","ChrMC0y","Au51D1e","BgLUzq","AeTjrNq","v2vIu29JA2u","CLPfD3u","s01szwm","uKjNree","z1HIzLy","x2vUzhbVAw4","B3nNqKC","yxnqAg0","vw9LvKe","z2vrDwv1zuW","ELjczLu","qMvnEhe","yxbWBgLJyxq","CNnVCL9Uyw0","zg1bs1e","DLLeAha","AxnrB1nnzxm","ihrVihjLDhi","DvDwBw4","B3Liq3q","v2vPEgLUsLm","u3vzvLi","ywnOzwqSihC","Eervr0e","Dev2zw50","BMrLEa","zu9eDLi","DxPPuKy","uxDwr08","CefQs1a","z1jPB08","BfjjD3C","zMLN","AfrOvfO","B25TzxnZywC","CenXzeG","AevYCM9Yrxy","D0Pvr0i","Dgv4Dc9WBge","CwfxEwO","x2LZtwLUAvq","AeHgDNy","B3bLBG","z2v0","tLbusK4","C2vYDMLJzs0","z1z6uw0","txj1Cvq","yw5YyvC","CvvmAxO","whziuxu","zNjHBwvuExa","mdaWmdaWmda","wKPJvha","ywDLrxzLBNq","DufzrwO","B3nLrxzLBNq","Dhj1y3rVCIa","x1fVu01HBMe","wvvlshu","vw5PBxbSzw0","Dg9cExrLC0W","txDvywe","x21PBMLoyxy","twHktwi","Avnvs2K","zw5HyMXLvhi","C2v0zgi","B3jpBMXPBMu","ANz3zxy","rNjVBNrPzxi","Ef9MCM9UDgK","BLzhzKO","y3vYC29Yx2y","AwXLx25HBwu","zNb5Cwm","EwHlq3m","uvDZsKG","B3v0sw50zxi","ywrKrxzLBNq","Aw5KzxGGB3u","nLHoBMvwEG","ruXctuq","Bxr5Cu4","BfrPBwvVDxq","CMvJzwL2zwq","qwHmvg4","EKPVsvG","nJaYmdC4nfjZv3LVrq","C0Xf","EKzgDhi","x2nYzwf0zvm","EvPVEum","DxrMofDYAxq","CgzUqLq","wLPoC2W","B3bLCNr5","CM9YrxzLBNq","vLPjBwW","ywXSB2nvBNm","BxnNsuq","DMrIALy","v2TOs1e","qxjhrhi","DhbOzem","ywnOzwq","Dgv4DfbHEwW","BMnNzw4","C0TsCee","A1n0yxr1C0m","ExPZs0e","x2jPBMfYEvq","BhL4AhO","uevrD1i","ELnczui","rMzbBvq","Ce5MDg0","ruvwvNe","quXm","y2HnyxHuCMK","zw5JB2rPBMC","y2fwuNy","vw5Oyw5KBgu","reiGzMfPBgu","yM9Uy0u","t1bftG","t1bftL9fuLi","y2XLyxi","zufJAW","q29UzMLN","t2HQvgW","zerrBgq","yMfSrxzLBNq","x2LZv29YA2u","C3rLBMvYCW","DeLUDgvYy2u","Bu1TB3O","vgX5A3q","uenLBu4","B25mAw5L","thzKBuu","CMvWBgfJzq","C2vUza","qMjjA0u","BKXkuwm","AefutLK","EsbJBg9Zzwq","EgXYEuu","tfvtDhO","DhjPzxmGCMu","C0rNv3a","Dg9mB3DLCKm","qwjVCNrfCNi","qMfHvLu","igfYCMf5yNu","EfvZzuvUDG","q1PVqKq","zMLUza","z2v0qwXSs2u","q3vZDg9Trxi","EKTLreW","zNj0tLu","Bwf4tg9ZC0m","igzPzwXKoIa","Cgf5Bg9Hza","Aw5PDcbrB1m","DvLqwwW","u2TPCcbWyxm","wfj0D0O","uNfRBxq","q05nrxy","EgXRCe8","x2HHBMrSzvi","y3vZDg9Tshq","ndm4nJLJqM9VwM0","suHuCNm","yNbTtfC","vfb6Agi","DMvYC2LVBMm","AxPuqxa","ywr2yw5Jzq","y2n6wu0","CMvZzxrdB3u","CwnStKS","tLLps0e","suLhEM0","BwvZC2fNzq","rfbpAee","tuPSrgG","x29WDgLVBNm","vhLVvvm","zKXWz2G","qwLqCK4","twnWuvq","uuHfuLq","Dw5ZAwDUzwq","wwDktuG","rurquhi","EMP1qKm","sMHxwuS","zhD1BLy","ywnRx2nVzgu","yunnq0O","rgPSvxC","zxzAq00","t0DotLi","C2nIvLu","BMvY","ChvZAa","icSG","z2vtEw5J","yMLUyxj5vhK","CYbHBhjLywq","CgLUz09Uy2u","zgLZywjSzue","AxnbCNjHEq","CxHtz0O","DgHLBG","v1rdBfu","qurbvNu","y3jLyxrLrxi","quvqDuO","BgXgsg4","qM9mzgy","AxnrB1nby2S","C3rVCMu","zunvAuS","ugTWwwK","yxvbuM0","x2LUDgvYDMe","s3nzDeK","vvnqq3C","zgvIDwC","yxGGCMv0CMK","mtyXmZzhDNvIqNu","Bhm6ia","ugvjCgS","yuzxCLu","v0XPvNK","EK1Mwve","tun3A1C","x2nSzwfYvgK","y2r3yMy","Bwjxv3u","y29PrNC","CMvHzhLtDge","zw5HyMXLqxu","y29UBMvJDfm","uNnvr2K","D3nZoI8V","CM92AwrLigi","C2nYAxb0","vgfdAKq","CMvJB25Uzwm","twHgCfq","rNrnCu4","wNjUr2m","r0D0Deu","x3bYzwzPEa","sKDgt3K","B3jRig9MzMW","CNnVCKzPBgu","AxvzC1C","ru5RANC","B3vUDa","DwDnv2i","AgfUz2u","AvbHv0O","x2LUAxq","qMPSAuW","ALzWvNi","uxnkvgy","zNjVBuHHC2G","CgneAM0","sfL2A3e","yNL0zu9MzNm","t1vlAM0","Avjes2O","CLrKs2S","CMvZDwX0","zwvKzwq","s3PTDwe","wLblz0e","D0DUs2S","y3vYDMfSDwu","AMnwtgy","sgLbEhq","C0DbBfa","zKTcz1O","zv9ZDwnJzxm","t2LPzKO","rM1ez1G","zMLSzw5HBwu","EKTtv1m","rfzpEwG","sMHtuNu","tuLPEKC","z0nir3O","y29TCgXLDgu","zwnHtwK","BNbMvfu","s3Lrzwu","wvf3rem","x21LC3nHz2u","zxjFDhrS","zxq9DxrMltG","uLDAzM8","A3j3rha","tgrsy28","x2XPC3rLBMu","A2XSuvi","zMLSDgvY","wMfMCKy","y2uGBM90igK","x2rLyNvN","suftrhK","we1Yr0K","u2z5Cu4","EwjMv2K","qw95AKm","AenSB3nLrxy","wgHvwee","sgLizeu","y1n2vKi","t1LVvhe","y2f0y2G","t0LTtuK","BvHlzha","yw5Nzq","C1bLrNm","BuL3Ce8","B25szwnLAxy","sMffCgm","B25LCNjVCG","A09eALi","wNLgwgK","D0Tms2O","BLHcuhG","qvvTCuG","o2nOyxjZzxq","y29UBMvJDca","rKLmrv9ot1q","mxWZFdb8mNW","tMfTzq","tgPrshq","yNrPrwG","rwDgzKe","ufDTvwe","AhnHAK4","C2v0u3rVCMe","AxnmB25N","y1zxC20","A01MB1K","CMf4qM0","D3jPDgu","rwPjteC","t1vusNC","BKH3DwS","ywjVCNq","zxrxB3jRq2G","s3vSBMi","Cg9W","uffgu3O","x29UugfNzu4","ywnRDxbfBMq","id4G","y2HnyxHdB3u","thPStxe","BLndCxO","tvrnz3y","Aw9UvgLTzw8","zxH0ugf5Bg8","z0LIEeO","r1bIqKi","yxbWBhK","wenMvfK","D3jSrfO","sgfrCKG","zxzICKC","zMPvuMK","BMzPre4","zwn0","mtyYmJC2DwDjveTK","C1bkv3a","AvHqq1u","v0DUDgm","x29Ut3bLBG","yxjYyxLIDwy","mhWY","CNnVCL92ywW","vKvvtuS","yNL0zuXLBMC","tvnQqMy","BIWGAg9ZDg4","y3vYC29YlNm","s0zJzKm","y29UBMvJDa","y3jLyxrLtwu","tMrOEhK","vLPrteu","zw5fDMvUDa","y012CgO","t05Uuum","BePJvMq","x2HHBMrSzu8","DuD3yw0","ywX3yxLZ","B25SAw5L","A1rQwKi","r1HutgG","su5tvefova","rvLLBvG","BMfgqNe","tufyx1jfvfi","rer4uw4","qNjwqLG","C2vUDa","uwXNDfG","tKjNB0q","zhrfDuC","D3PvuMC","whrWwfm","yxnJCMLWDa","Ae9fC1C","qxfOt0S","B2zM","ChjVDg9JB2W","uevivMW","CM9mwM4"];return Rn=function(){return n},Rn()}function N(n,e){n=n-500;let s=Rn(),a=s[n];if(N.OZfyCa===void 0){var x=function(m){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",b="",_="";for(let S=0,k,P,I=0;P=m.charAt(I++);~P&&(k=S%4?k*64+P:P,S++%4)?b+=String.fromCharCode(255&k>>(-2*S&6)):0)P=w.indexOf(P);for(let S=0,k=b.length;S<k;S++)_+="%"+("00"+b.charCodeAt(S).toString(16)).slice(-2);return decodeURIComponent(_)};N.fMkcbb=x,N.HJTnaU={},N.OZfyCa=!0}let c=s[0],f=n+c,l=N.HJTnaU[f];return l?a=l:(a=N.fMkcbb(a),N.HJTnaU[f]=a),a}function Qx(){let n=E;return ks||(ks=[IDBCursor.prototype[n(1438)],IDBCursor[n(2032)+"e"][n(1754)],IDBCursor[n(2032)+"e"][n(1754)+n(1044)+"ey"]])}function ec(n){let e=E,s={UbCEN:function(x,c){return x(c)},KMRec:function(x){return x()},CSZlL:"success",lAURE:e(780),kWOYR:function(x,c){return x instanceof c},oDudd:function(x,c){return x!==c},iiVUN:"XUltW"},a=new Promise((x,c)=>{let f=e,l={TPzhb:f(1501),AEkqk:s[f(924)],CRXzh:s[f(559)],nHsQd:function(_,S){return s[f(762)](_,S)},HLCtC:function(_){return s[f(1260)](_)}},m=()=>{let _=f;if(l.TPzhb===l[_(1435)])n[_(1741)+_(1110)+_(1465)](l.AEkqk,w),n[_(1741)+_(1110)+_(1465)](l[_(1133)],b);else try{this[_(940)]?.close(),this._qosDB=void 0}catch(S){_0x5e36a6.log(S)}},w=()=>{let _=f;l[_(1025)](x,Ce(n[_(1537)])),l.HLCtC(m)},b=()=>{let _=f;s[_(762)](c,n.error),s[_(1260)](m)};n["addEvent"+f(754)](f(1763),w),n[f(1337)+f(754)](f(780),b)});return a[e(1475)](x=>{let c=e;if(s[c(1879)](x,IDBCursor)){if(s[c(1977)](s.iiVUN,s.iiVUN))return null;Tr.set(x,n)}}).catch(()=>{}),Ln[e(1746)](a,n),a}function tc(n){let e=E,s={jkMHe:function(x){return x()},oFyKU:function(x,c){return x(c)},wcLLO:"AbortError",iABLg:function(x,c){return x|c},IsutS:function(x,c){return x&c},ChUwh:function(x,c){return x>>c},VdfXl:function(x,c){return x>>c},apJpQ:function(x,c){return x!==c},HjIbO:e(1145),HpOEA:e(1556),DUUpM:e(780)};if(Nn[e(1051)](n))return;let a=new Promise((x,c)=>{let f=e,l={krwDp:function(_,S){return s[N(524)](_,S)},HuSIk:function(_,S){return s[N(1793)](_,S)},OcGJb:function(_,S){return s.ChUwh(_,S)},GGttE:function(_,S){return s.VdfXl(_,S)},kHzWF:function(_,S){return s.apJpQ(_,S)},FlnCq:s[f(972)],GWafU:s.HpOEA,vLJUD:s[f(1787)],kTVBd:f(1616)},m=()=>{let _=f;l.kHzWF(l[_(954)],_(1587))?(n[_(1741)+_(1110)+"ner"](l.GWafU,w),n[_(1741)+_(1110)+"ner"](l[_(975)],b),n[_(1741)+_(1110)+_(1465)](l[_(868)],b)):(_0x266464[_0x863e3d++]=l.krwDp(l[_(1737)](l[_(695)](_0xe35f19,18),7),240),_0x1b0b2d[_0x3d8855++]=l[_(1565)](l[_(1737)](l[_(1515)](_0x27d3c8,12),63),128))},w=()=>{s[f(1822)](x),m()},b=()=>{let _=f;s.oFyKU(c,n[_(780)]||new DOMException(s[_(702)],s[_(702)])),m()};n[f(1337)+"Listener"](s[f(1045)],w),n[f(1337)+"Listener"](s[f(1787)],b),n["addEvent"+f(754)](f(1616),b)});Nn[e(1746)](n,a)}function nc(n){On={ZXzRx:function(s,a){return s(a)}}.ZXzRx(n,On)}function rc(n){let e=E,s={zKSWS:function(a,x){return a(x)},AgQuf:function(a,x){return a(x)},HoHzM:function(a,x){return a===x},LiYMl:function(a,x){return a in x},XWMiD:e(832)+"oreNames"};return s[e(675)](n,IDBDatabase[e(2032)+"e"][e(782)+e(1790)])&&!s.LiYMl(s[e(1815)],IDBTransaction[e(2032)+"e"])?function(a,...x){let c=e,f=n[c(1894)](zt(this),a,...x);return Pr[c(1746)](f,a[c(942)]?a[c(942)]():[a]),Ce(f)}:Qx()[e(719)](n)?function(...a){let x=e;return n[x(1632)](s[x(1551)](zt,this),a),s[x(1551)](Ce,Tr[x(1301)](this))}:function(...a){let x=e;return s[x(543)](Ce,n[x(1632)](s[x(1551)](zt,this),a))}}function ic(n){let e=E,s={LZSmn:function(a,x){return a instanceof x},wXsBZ:function(a,x,c){return a(x,c)},qaWyj:function(a){return a()}};return typeof n===e(800)?rc(n):(s[e(688)](n,IDBTransaction)&&tc(n),s[e(648)](Ns,n,s[e(1297)](Xx))?new Proxy(n,On):n)}function Ce(n){let e=E,s={RRQmb:function(x,c){return x instanceof c},twPiP:function(x,c){return x(c)},KTPSk:function(x,c){return x(c)},uqUsr:function(x,c){return x!==c},npfTU:"zZRab"};if(s[e(1201)](n,IDBRequest))return s[e(618)](ec,n);if(Tn.has(n))return Tn[e(1301)](n);let a=s[e(1097)](ic,n);return s[e(1021)](a,n)&&(s[e(1558)]===e(1536)?_0x36a710[e(1746)](_0x1e6dbb,_0x385e18):(Tn.set(n,a),Ln.set(a,n))),a}var Ns,Ds,ks,Tr,Nn,Pr,Tn,Ln,On,zt,Ps=Rs({"node_modules/idb/build/wrap-idb-value.js"(){let n=E,e={JjUdJ:function(s,a){return s instanceof a},nUNHy:function(s,a){return s===a},QGTmq:n(1919),xhfmf:n(832)+n(1160),cekge:function(s,a){return s===a},xPVdr:"hqTvu",ybfWi:function(s,a){return s(a)},Ferio:function(s,a){return s===a},ULOCM:function(s,a){return s===a},GPbBB:n(1483),WFXdQ:function(s,a){return s in a}};Ns=(s,a)=>a[n(828)](x=>s instanceof x),Tr=new WeakMap,Nn=new WeakMap,Pr=new WeakMap,Tn=new WeakMap,Ln=new WeakMap,On={get(s,a,x){let c=n;if(e[c(1150)](s,IDBTransaction)){if(e[c(957)](a,e.QGTmq))return Nn[c(1301)](s);if(e[c(957)](a,e.xhfmf))return e.cekge(c(663),e[c(1245)])?s[c(832)+c(1160)]||Pr.get(s):this[c(1031)].extensions;if(a==="store")return x[c(832)+c(1160)][1]?void 0:x[c(832)+"ore"](x[c(832)+c(1160)][0])}return e[c(1576)](Ce,s[a])},set(s,a,x){return s[a]=x,!0},has(s,a){let x=n;return e[x(1150)](s,IDBTransaction)&&(e[x(1840)](a,x(1919))||e[x(1075)](a,e[x(1631)]))?!0:e[x(553)](a,s)}},zt=s=>Ln[n(1301)](s)}}),Ls={};$x(Ls,{deleteDB:()=>oc,openDB:()=>sc,unwrap:()=>zt,wrap:()=>Ce});function sc(n,e,{blocked:s,upgrade:a,blocking:x,terminated:c}={}){let f=E,l={BiyvN:function(b,_,S,k,P){return b(_,S,k,P)},OoCLQ:function(b,_){return b(_)},JQakh:function(b,_){return b(_)},ePPik:"complete",scbVU:f(1777),NBqpN:"versionc"+f(1524),gVzQm:function(b,_){return b(_)}},m=indexedDB.open(n,e),w=l[f(1304)](Ce,m);return a&&m[f(1337)+f(754)]("upgraden"+f(1538),b=>{let _=f;l[_(788)](a,l[_(1849)](Ce,m[_(1537)]),b[_(1197)+"on"],b[_(1007)+"on"],l[_(898)](Ce,m["transact"+_(1790)]))}),s&&m[f(1337)+f(754)]("blocked",()=>s()),w[f(1475)](b=>{let _=f,S={dKzzF:l[_(986)]};l[_(1464)]===l[_(1464)]?(c&&b[_(1337)+_(754)](_(1203),()=>c()),x&&b[_(1337)+_(754)](l.NBqpN,()=>x())):(_0x8b75c3["removeEv"+_(1110)+_(1465)](MTCEiz[_(1165)],_0x321233),_0x42b71a[_(1741)+_(1110)+_(1465)](_(780),_0x70b2de),_0x2d3ae0["removeEv"+_(1110)+"ner"]("abort",_0x3d471e))})[f(1583)](()=>{}),w}function oc(n,{blocked:e}={}){let s=E,a={yzsKA:function(c,f){return c(f)}},x=indexedDB[s(977)+s(849)](n);return e&&x["addEvent"+s(754)](s(612),()=>e()),a[s(1368)](Ce,x)[s(1475)](()=>{})}function Ts(n,e){let s=E,a={alQBv:"readwrite",CqNkt:"readonly",zSBeB:function(m,w){return m in w},BsBZH:function(m,w){return m===w},BarbI:s(1884)};if(!(n instanceof IDBDatabase&&!a[s(1372)](e,n)&&a[s(1734)](typeof e,a.BarbI)))return;if(In[s(1301)](e))return In[s(1301)](e);let x=e.replace(/FromIndex$/,""),c=e!==x,f=Bs[s(719)](x);if(!(x in(c?IDBIndex:IDBObjectStore)[s(2032)+"e"])||!(f||Os[s(719)](x)))return;let l=async function(m,...w){let b=s,_=this["transact"+b(1790)](m,f?a.alQBv:a[b(808)]),S=_[b(1483)];return c&&(S=S.index(w[b(1874)]())),(await Promise.all([S[x](...w),f&&_.done]))[0]};return In[s(1746)](e,l),l}var Os,Bs,In,ac=Rs({"node_modules/idb/build/index.js"(){let n=E,e={PeIpk:"getKey",ngqKr:n(2030),WGntc:"getAllKeys",wCfuE:n(536),ytxLM:function(x,c){return x(c)},BjliL:"put",qULiz:"add",XiqmJ:"delete",jMGms:function(x){return x()}},s=("1|5|0|4|"+n(852)).split("|"),a=0;for(;;){switch(s[a++]){case"0":Os=[n(1301),e[n(1494)],e[n(2027)],e[n(1643)],e[n(744)]];continue;case"1":Ps();continue;case"2":e.ytxLM(nc,x=>({...x,get:(c,f,l)=>Ts(c,f)||x.get(c,f,l),has:(c,f)=>!!Ts(c,f)||x[n(1051)](c,f)}));continue;case"3":In=new Map;continue;case"4":Bs=[e[n(1527)],e[n(1307)],e[n(1818)],n(1385)];continue;case"5":e.jMGms(Ps);continue}break}}}),xc={idb:function(n){let e=E,s={gXICh:e(911),Fvsqa:e(1943)};n[e(1229)]=Promise[e(1159)]()[e(1475)](()=>(ac(),Ls)).then(function(a){let x=e;if(s[x(1192)]===s.Fvsqa)_0x11da46.d=(c,f)=>{let l=x;for(var m in f)_0x243ab3.o(f,m)&&!_0x1e70af.o(c,m)&&_0x1ab468[l(1729)+l(1354)](c,m,{enumerable:!0,get:f[m]})};else return a})}},Is={};function Ee(n){let e=E,s={RqPto:e(701)+"0",stpvb:function(l,m){return l!==m}},a=s[e(1172)][e(1769)]("|"),x=0;for(;;){switch(a[x++]){case"0":return f[e(1229)];case"1":var c=Is[n];continue;case"2":xc[n](f,f.exports,Ee);continue;case"3":if(s[e(1106)](void 0,c))return c.exports;continue;case"4":var f=Is[n]={exports:{}};continue}break}}Ee.d=(n,e)=>{let s=N;for(var a in e)Ee.o(e,a)&&!Ee.o(n,a)&&Object[s(1729)+"operty"](n,a,{enumerable:!0,get:e[a]})},(()=>{let n=E;Ee.o=(e,s)=>Object[n(2032)+"e"][n(1220)+n(1354)][n(1894)](e,s)})(),(()=>{let n=E,e={HWMQR:function(s,a){return s!=a},JhSRu:n(1792)+"d",EsNlP:n(1941),COdqc:"__esModule"};Ee.r=s=>{let a=n;e[a(586)](e[a(1553)],typeof Symbol)&&Symbol[a(1885)+"Tag"]&&Object.defineProperty(s,Symbol[a(1885)+a(550)],{value:e[a(1966)]}),Object[a(1729)+a(1354)](s,e[a(899)],{value:!0})}})();var Z={};(()=>{let n=E,e={NTcfy:n(797),EUCBF:function(r,t){return r===t},CPHmU:n(1215),fisUA:n(1974),CiJhc:function(r,t){return r(t)},jNpei:function(r,t){return r+t},SDGui:function(r,t){return r+t},FfAmT:function(r,t){return r+t},lRIww:function(r,t){return r*t},sEnJY:function(r,t){return r+t},fLpgh:function(r,t,i){return r(t,i)},vNhDn:function(r,t){return r+t},ThmhR:function(r,t,i){return r(t,i)},tzLst:function(r,t){return r(t)},LPiJo:function(r,t){return r(t)},cSvVB:function(r,t){return r+t},anOqw:"0000",FBrRk:n(887),SFKlC:function(r,t){return r(t)},bKvTl:n(1310)+n(1310)+n(1310)+n(1310),dZBNV:function(r,t){return r>=t},BbIkE:n(710),kODjR:function(r,t){return r>t},sTLMj:function(r,t){return r<t},oNsgH:function(r,t){return r!==t},xvTWY:n(872),GqATS:function(r,t){return r>t},ELMAs:function(r,t){return r<t},XDKBp:function(r,t){return r!==t},iPaWJ:n(1510),ENkjw:function(r,t){return r-t},PEQwR:function(r,t){return r!==t},wIwvU:n(685),kbDdp:function(r,t){return r-t},zFFtr:function(r,t){return r!==t},vaSok:"dzpmB",PkpYi:function(r,t,i){return r(t,i)},YWKIU:"aqwep",zVEUw:function(r,t,i){return r(t,i)},PTsAD:function(r,t){return r(t)},tphdC:function(r,t){return r>>>t},WHstf:function(r,t,i){return r(t,i)},FpaJN:function(r,t,i){return r(t,i)},LUStz:function(r,t,i){return r(t,i)},HSRlp:function(r,t){return r&t},wKLKj:function(r,t){return r===t},OdPVF:"Missing "+n(1924)+n(1421)+n(1989),mMXoD:function(r){return r()},cdwbf:function(r,t){return r(t)},yryVy:function(r,t){return r&t},dHxvm:function(r,t,i){return r(t,i)},aquXC:function(r,t,i){return r(t,i)},sDgWp:function(r,t,i){return r(t,i)},jcVLf:function(r,t,i){return r(t,i)},teLZr:function(r,t,i){return r(t,i)},mNxgV:function(r,t){return r(t)},gDcdl:function(r,t){return r!==t},EqunA:function(r,t,i){return r(t,i)},uYPYl:function(r,t,i){return r(t,i)},lOqDL:function(r,t,i){return r(t,i)},doHyO:function(r,t){return r(t)},XtpXS:function(r,t,i){return r(t,i)},anraW:function(r,t,i){return r(t,i)},HsvYu:function(r,t){return r!==t},fpBny:n(1873),MPNXt:function(r,t){return r!==t},YgJMH:function(r,t){return r!==t},gfCtV:function(r,t,i){return r(t,i)},VqvUU:function(r,t){return r!==t},WLiVy:"DOCoC",eMJZz:n(551),myWfO:function(r,t){return r(t)},ubHsc:function(r,t){return r(t)},EDPPr:function(r,t){return r(t)},vtQZy:function(r,t,i){return r(t,i)},vyLmP:function(r,t){return r(t)},XBZux:function(r,t){return r(t)},HuHhx:function(r,t,i){return r(t,i)},qQKNs:function(r,t){return r(t)},ROUSU:function(r,t,i){return r(t,i)},iNuwQ:function(r,t,i){return r(t,i)},tIpIe:function(r,t){return r(t)},ZXwpl:function(r,t){return r(t)},spKEp:function(r,t,i){return r(t,i)},NwsNT:n(1702)+n(1924)+n(1421)+n(731),sVbIn:function(r,t){return r===t},HZfXT:"Missing "+n(1924)+n(1421)+n(1231),zJoIX:function(r,t){return r===t},TUXaG:n(1702)+n(1924)+n(1421)+n(1801),VJLhI:function(r,t){return r===t},Gnmwg:function(r,t){return r(t)},Djaua:function(r,t,i){return r(t,i)},qimTX:n(1318)+n(629)+"pe: ",tilrF:function(r,t){return r>>t},gNAhz:function(r,t){return r>=t},BoLdf:n(1300),IgFHH:n(1444),XRtwJ:n(780),LzlMq:n(644),Ygxvx:function(r,t){return r>t},FZebK:n(1425)+"t limit",tNWhJ:function(r,t){return r*t},eCUiK:function(r,t){return r+t},YQwDC:function(r,t,i){return r(t,i)},caVRv:function(r,t){return r<t},NUGkf:function(r,t){return r&t},cYwBR:function(r,t){return r>=t},BmSso:function(r,t){return r&t},dwunV:function(r,t){return r|t},ygasi:function(r,t){return r<<t},pGqMR:function(r,t){return r(t)},XvHQu:function(r,t){return r>=t},cVWsm:function(r,t){return r+t},CnWTA:function(r,t){return r+t},yoaQt:function(r,t){return r&t},pNftm:function(r,t){return r|t},EkmrH:function(r,t){return r<<t},fuBVu:function(r,t){return r&t},kMfoY:function(r,t){return r<<t},wAoQI:function(r,t){return r&t},BbBGm:function(r,t){return r<=t},OImMI:function(r,t){return r==t},ZafrF:function(r,t){return r+t},dDQld:function(r,t){return r+t},wzURg:function(r,t){return r+t},dwKFh:function(r,t){return r|t},auARm:function(r,t){return r<<t},dJEBw:function(r,t){return r|t},vLJmW:function(r,t){return r|t},tsZVs:function(r,t){return r&t},EpWsV:function(r,t){return r<<t},Mlrlh:function(r,t){return r&t},bWhxw:function(r,t){return r<t},aGunG:function(r,t){return r+t},GRymF:function(r,t){return r<=t},SvaAo:function(r,t){return r<t},mmQui:function(r,t){return r+t},dSIsT:function(r,t){return r-t},ccEso:function(r,t){return r+t},YPdZv:function(r,t){return r<t},esYfD:function(r,t){return r<t},JMfWy:n(1098),vfuHy:function(r,t){return r>=t},BHtEO:function(r,t){return r<=t},TjlQq:function(r,t){return r<<t},xlkpO:function(r,t){return r<t},GXTLh:function(r,t){return r&t},FtMqN:function(r,t){return r&t},AhLTn:function(r,t){return r>>t},jdKhI:function(r,t){return r>t},kKFDy:n(943),KkThT:n(736),xAhuC:function(r,t){return r<t},ZPdkr:function(r,t){return r+t},USPCw:function(r,t){return r!==t},gVfco:function(r,t,i){return r(t,i)},SfyqN:function(r,t,i){return r(t,i)},VEUMK:function(r,t){return r>=t},kdvID:function(r,t){return r&t},xNPla:function(r,t){return r<=t},luDyl:function(r,t){return r===t},AJBSC:function(r,t){return r-t},fqjOG:function(r,t){return r&t},foiQe:function(r,t){return r&t},trTeI:function(r,t){return r&t},ZZNsl:"GZtIw",gxCNZ:function(r,t){return r<<t},MUPFJ:function(r,t){return r&t},NaNof:function(r,t){return r&t},cQYXz:function(r,t){return r&t},jISKP:function(r,t){return r<<t},iBTiT:function(r,t){return r&t},Rihxp:function(r,t){return r&t},VyTCj:function(r,t){return r&t},qxSgJ:function(r,t){return r===t},pKQRK:n(1904),DDOrk:"olVuY",AQrRc:function(r,t){return r<<t},XhUXA:function(r,t){return r>>>t},sscec:function(r,t){return r<<t},sPJWp:function(r,t){return r>>>t},mtyqN:function(r,t){return r<<t},giBox:function(r,t){return r>>>t},kYTEu:function(r,t){return r<t},SHFXs:function(r,t){return r|t},DALIv:function(r,t){return r|t},TiLPY:function(r,t){return r>>>t},sBJyf:function(r,t){return r|t},NBgoD:function(r,t){return r!==t},lNgiq:function(r,t){return r|t},CVmIg:function(r,t){return r&t},EjPtr:function(r,t){return r+t},dIVzD:function(r,t){return r|t},Rbmtx:function(r,t){return r+t},OmilH:function(r,t){return r>>>t},AUmqH:function(r,t){return r>>>t},DTcEM:function(r,t){return r<<t},TapQe:function(r,t){return r+t},XCfTY:function(r,t){return r+t},NprQt:function(r,t){return r+t},pqXkR:function(r,t){return r|t},ldhJM:function(r,t){return r|t},jvwev:function(r,t){return r|t},PGCcU:n(1375),CNLgJ:function(r,t){return r|t},DkaKL:function(r,t){return r===t},UTEnk:n(1650),aTTnL:function(r,t){return r|t},PEHVl:function(r,t){return r===t},KFcfC:function(r,t){return r|t},asPhm:function(r,t){return r|t},UWPgH:function(r,t){return r<<t},RmJLB:function(r,t){return r<<t},oQpiU:function(r,t){return r<<t},cUhYH:function(r,t){return r|t},DDIzp:function(r,t){return r|t},QsJTf:function(r,t){return r<<t},DVOyh:function(r,t){return r|t},tzKcW:function(r,t){return r<<t},gqclR:function(r,t){return r|t},BZOZU:function(r,t){return r|t},QKBOy:function(r,t){return r===t},apvEW:function(r,t){return r|t},fnzCY:function(r,t){return r<<t},nPicJ:function(r,t){return r|t},MGqiQ:function(r,t){return r<<t},roLZn:function(r,t){return r<<t},TpLta:function(r,t){return r>>>t},aCMCJ:function(r,t){return r&t},ttnYd:function(r,t){return r>>>t},ijRWv:function(r,t){return r<t},EKHze:function(r,t){return r|t},DFJxa:function(r,t){return r&t},rdoLt:function(r,t){return r&t},yVQvI:function(r,t){return r+t},TQpmM:function(r,t){return r+t},lDTRq:function(r,t){return r>>t},bxUwy:function(r,t){return r>>t},bKVio:function(r,t){return r|t},JFJIe:function(r,t){return r&t},UZrnq:function(r,t){return r(t)},lfSYp:function(r,t){return r===t},uGwam:"gRioO",QgRfL:function(r,t){return r<=t},OhjTl:function(r,t){return r%t},sGmDb:function(r,t){return r|t},acJvM:function(r,t){return r/t},hATNY:function(r,t){return r>>>t},GxyFf:function(r,t){return r>>>t},RWZfo:function(r,t){return r+t},SuYVR:function(r,t,i,o){return r(t,i,o)},ZMraE:function(r,t){return r+t},kuQqr:n(1872),cPOjK:function(r,t){return r>>>t},qmrfh:function(r,t){return r&t},szYnb:function(r,t){return r+t},TRpDj:function(r,t){return r>>>t},jClmX:function(r,t){return r>>>t},zjuBC:function(r,t){return r+t},pCqdH:function(r,t){return r+t},JSBEp:function(r,t){return r<<t},juWvS:function(r,t){return r|t},RwwpH:function(r,t){return r!==t},RQlQS:function(r,t){return r===t},RvDmN:function(r,t){return r===t},HbIlp:function(r,t){return r===t},aBZSB:function(r,t){return r+t},aDCPz:function(r,t){return r&t},gCSQr:function(r,t){return r&t},eEDGe:function(r,t){return r>>>t},rZEwu:function(r,t){return r&t},SCJDb:function(r,t){return r>>>t},DdobQ:function(r,t){return r&t},jEEPd:function(r,t){return r&t},JdacS:function(r,t){return r>>>t},aFEwJ:function(r,t){return r&t},WcWCl:function(r,t){return r&t},suCeH:function(r,t){return r&t},MwUaa:function(r,t){return r&t},pGOWP:function(r,t){return r>>>t},QBjKk:function(r,t){return r>>>t},wfPMh:function(r,t){return r&t},smRuf:n(877)+n(1230),nlbkI:"NATIVE_E"+n(737),vLotX:"MESSAGE_ERROR",IHTrs:"MAX_RETR"+n(838)+"R",exjku:"OPEN_ERROR",EdExJ:n(901)+n(1932),aSiiU:n(1203),SAmXs:function(r,t){return r===t},NKmtK:n(1396),rmShs:n(583),ueSBl:n(1600)+"4",mKDLG:function(r,t){return r|t},lqLXS:function(r,t){return r<<t},vCuyX:function(r,t){return r&t},LvdmE:function(r,t){return r<t},pYQXg:n(1196),ecaMi:function(r,t,i){return r(t,i)},bisuH:function(r,t){return r>>>t},OUwUy:function(r,t){return r<<t},AkPHu:function(r,t){return r===t},JICwj:n(1183),EfvAf:n(1249),waDQl:function(r,t){return r(t)},hzosZ:n(1814),WTFOd:n(1131)+"e_timeout",UoeVA:function(r,t){return r!==t},DOJSg:"GDYQg",XClnM:n(1657),fjDRt:function(r,t){return r>=t},kMDyB:function(r,t){return r===t},Ehvzq:function(r,t){return r instanceof t},yIQQx:n(1380)+"d error.",inGhM:function(r,t){return r+t},VZIml:"Tqvia",HBLlJ:function(r,t,i){return r(t,i)},CHUIQ:function(r,t,i){return r(t,i)},nErMF:function(r,t,i){return r(t,i)},lXzDj:n(1436)+n(1524),yhKCs:function(r,t){return r===t},nXoef:n(1566),FAhbi:n(1108),RBgDA:n(1556),TKDPS:n(1616),VJVYP:function(r){return r()},KNTBK:function(r,t){return r(t)},KdsAx:n(1443),ZPKgA:"boe",olTVf:"ppe",CBkSK:function(r,t){return r===t},WOgfM:n(1991),ybhIB:n(1302),CGSua:n(1987),sKRpA:function(r,t){return r||t},MPudS:function(r,t){return r!=t},gXbfV:"undefined",fwfxj:function(r,t){return r+t},yZWhA:function(r,t){return r+t},ijdoB:function(r,t){return r+t},sRCeI:function(r,t){return r+t},HYvkq:function(r,t){return r+t},mIwpO:function(r,t){return r!==t},CNMEv:function(r,t){return r|t},PUMlQ:function(r,t){return r<<t},gNCak:function(r,t){return r|t},gCHGz:function(r,t){return r&t},lVcwv:function(r,t){return r<<t},SERDY:function(r,t){return r&t},Cxyen:function(r,t){return r>>t},ArGDr:function(r,t){return r<=t},nWKOg:n(541)+n(1008)+n(694)+n(522)+n(1016),efUgi:function(r,t){return r===t},KAvpJ:function(r,t){return r+t},ibFxq:n(1821),Kulnb:n(1317),sDwXj:function(r,t){return r(t)},rHfsf:n(1111),QRgTP:"pageshow",GofKL:"close, w"+n(1470)+n(1404),xKNQZ:n(1864)+n(835)+n(1571)+n(993)+"ed",Crthp:n(1759),zDdBl:n(1394),bqNYo:function(r,t){return r<t},yCnnS:function(r,t){return r===t},jkqVS:function(r,t){return r&t},LPyIn:function(r,t){return r===t},BeMxq:function(r,t){return r&t},gZERM:function(r,t){return r+t},nKSGY:function(r,t){return r!==t},uivMY:n(1081),dwSjD:function(r,t){return r<t},nLJQc:function(r,t){return r&t},ANoLj:function(r,t){return r&t},STINU:function(r,t){return r<t},BUWhN:function(r,t){return r&t},DKkCX:function(r,t){return r-t},HtGpX:function(r,t){return r|t},pBzwZ:function(r,t){return r|t},uHyLn:function(r,t){return r|t},pEJZC:function(r,t){return r&t},pFcyz:function(r,t){return r&t},RcwGa:function(r,t){return r>>t},iGLjP:function(r,t){return r instanceof t},rqrqk:n(1296)+n(758)+n(1563),nLitR:n(1270)+n(1140),nRJmA:"applicat"+n(1140)+n(1597)+"=utf-8",dwUKE:n(1884),llFHn:"none_none",HaQrH:"binary",ZVYvz:function(r,t,i,o){return r(t,i,o)},NrdgP:function(r,t){return r<t},CYZvD:n(1445),AQWbi:function(r,t){return r<t},IoZdv:function(r,t){return r<t},DgGsF:function(r,t){return r|t},gbtlC:function(r,t){return r===t},tJXzC:function(r,t){return r&t},feDwe:"4|5|3|1|"+n(1646),GLkxz:function(r,t){return r&t},PYYPu:function(r,t){return r|t},RwQZu:function(r,t){return r&t},GYIGp:function(r,t){return r+t},staDT:function(r,t){return r&t},cjmrH:function(r,t){return r>>t},ZhHBU:function(r,t){return r|t},rcExd:function(r,t){return r&t},hzDlC:function(r,t){return r-t},HEetp:function(r,t){return r(t)},AiPrN:function(r,t){return r<<t},EYXHZ:"YKNFo",pRiLq:"RLqfP",XxDWe:function(r,t){return r(t)},LSkYZ:function(r,t){return r instanceof t},kdxjM:n(674),oyHCt:function(r,t){return r!=t},ZhMpB:function(r,t){return r instanceof t},dKaAk:function(r,t){return r!=t},JogJa:function(r,t){return r!==t},aauIH:n(867),JlWiK:n(556)+"reason",GujaN:"text/jav"+n(1680),izTAp:"http",icIlG:"&jscallback=fron"+n(1936)+"P",fpyqc:function(r,t){return r(t)},huRTK:n(1615),OWZYQ:"NYOKA",uziRF:function(r,t){return r|t},NTmlZ:function(r,t){return r!==t},QFzPW:n(906),smEHu:function(r,t){return r>>>t},zFliv:function(r,t){return r>>>t},Nliqg:function(r,t){return r<<t},YZXwf:function(r,t){return r>>>t},zLdxI:function(r,t){return r===t},ZmWaf:function(r,t){return r<t},ZIAQA:function(r,t){return r<t},rfjso:function(r,t){return r<t},mGkSc:function(r,t){return r<t},XgzYi:function(r,t){return r&t},KkWyF:function(r,t){return r+t},vRwpi:function(r,t){return r!==t},oBKxQ:function(r,t){return r&t},bDDik:function(r,t){return r|t},FCswZ:function(r,t){return r>>>t},MEuJh:function(r,t){return r>>>t},bRbiW:function(r,t){return r|t},xGPtQ:function(r,t){return r+t},VfZZL:function(r,t){return r!==t},QwVGO:function(r,t){return r|t},okdTb:function(r,t){return r>>>t},fdCeb:function(r,t){return r!==t},UnHjf:function(r,t){return r|t},FfEYi:function(r,t){return r!==t},cRcTi:function(r,t){return r>>>t},lfYvr:function(r,t){return r|t},RMcQx:function(r,t){return r+t},ZNjNh:function(r){return r()},raxBm:function(r,t){return r!==t},hOEsW:n(557),OWDli:n(505),ttzth:function(r,t){return r(t)},fBaZx:function(r){return r()},CkimF:function(r,t){return r!==t},hHFvv:n(1281),XRorN:function(r,t){return r!==t},QWsJH:n(1330),CZqFz:function(r,t){return r+t},XDoLg:function(r,t){return r(t)},JqNUw:function(r,t){return r===t},jpATf:n(1352),ActtR:n(2003),JhWYK:n(507),JtjWI:function(r,t){return r||t},pUYrM:function(r,t){return r&t},CJBtU:function(r,t){return r!==t},ZxIAl:n(1892),MCwkW:function(r,t){return r<t},wpgAs:function(r,t){return r(t)},EtsHT:function(r,t){return r>t},EgFfA:function(r,t){return r+t},BuqZi:function(r,t){return r||t},wrlDZ:function(r,t){return r!==t},GmoMq:n(907),UzoGj:function(r,t){return r||t},DjlUw:function(r,t){return r|t},uAYEj:function(r,t){return r|t},aihqQ:function(r,t){return r<<t},DUUUJ:function(r,t){return r<<t},aPVIF:function(r,t){return r<<t},WkhKQ:function(r,t){return r|t},qyOtD:function(r,t){return r|t},uRhOD:function(r,t){return r<<t},OtpmS:n(580),PWmUa:function(r,t){return r||t},vIFTy:function(r,t){return r||t},epKgV:function(r,t){return r||t},ucoUk:function(r,t){return r!=t},EYemX:"eHWkn",coiFw:function(r,t,i){return r(t,i)},qxUoV:n(803),toRzs:"message_id",ptfsF:function(r,t,i){return r(t,i)},nvqEG:function(r,t){return r|t},GkMcn:function(r,t){return r<<t},mDtZO:function(r,t){return r<<t},nSCqz:function(r,t){return r<<t},RXZlE:function(r,t){return r&t},oFfGF:function(r,t){return r<t},pUBuK:function(r,t){return r>t},pbvMM:function(r,t){return r+t},OpaHA:function(r,t){return r&t},zoAQy:n(1534),MDrgo:function(r,t){return r(t)},Vzbix:function(r,t,i,o){return r(t,i,o)},CwYek:"x_fronti"+n(1784),tUroB:n(1329)+"er_qos_ack",lJcVd:n(1329)+n(1716)+"k",BWoSf:"x_fronti"+n(705)+n(807),UvBbm:function(r,t){return r instanceof t},kVeEp:"objectSt"+n(1160),oJONb:function(r,t){return r===t},pSAdF:n(1483),UyJHk:n(912),vACRw:"xkgFc",NvsDX:n(1137),fUxGw:function(r,t,i,o){return r(t,i,o)},YvSDu:"need_ack",WezNd:n(1945),yWUSZ:n(616),WtSwv:function(r,t){return r||t},cMvpj:n(1459),HzOxb:function(r,t){return r+t},HoiZJ:function(r,t){return r<<t},gsCZb:function(r,t){return r|t},QHERT:function(r,t){return r<<t},cpTYM:function(r,t){return r&t},XerRy:function(r,t){return r>=t},wvhzQ:"XNvzg",FmDgX:function(r){return r()},TUiUR:function(r,t){return r instanceof t},mFjCL:n(1322),Rstad:"cuUOI",YastS:function(r){return r()},WTClU:function(r,t){return r(t)},hKIFt:n(1041),vYDhp:function(r,t){return r&t},hqyYY:function(r,t){return r||t},RrCBc:function(r,t){return r>>>t},LILXK:function(r,t){return r(t)},lEPAk:function(r,t){return r+t},Tlykt:function(r,t){return r+t},uEGRy:n(1338)+n(2010)+n(636),tXRPl:function(r,t){return r>=t},upufL:function(r,t){return r+t},ugMWb:function(r,t){return r<t},JEhCq:n(2014)+"1",loXau:function(r,t){return r<t},vUXKV:function(r,t){return r+t},yARED:function(r,t,i,o){return r(t,i,o)},MuWiV:function(r,t){return r+t},BUrqm:function(r,t){return r+t},LZUQU:function(r,t){return r|t},wGnKk:function(r,t){return r+t},jPDSj:function(r,t){return r+t},wzghz:function(r,t){return r+t},Ywebr:function(r,t){return r|t},jbRjf:function(r,t){return r|t},aFWrU:function(r,t){return r+t},PkpFY:function(r,t){return r+t},RkZtq:function(r,t){return r<<t},bpmLW:function(r,t){return r+t},eGmZF:function(r,t){return r+t},NijyM:function(r,t){return r&t},OfcHX:function(r,t){return r>>>t},YRfSf:function(r,t){return r+t},WSNCr:function(r,t){return r&t},XTDqA:function(r,t){return r>>>t},JbgNd:function(r,t){return r+t},dwHev:function(r,t){return r&t},zMfYQ:function(r,t){return r+t},EiyNy:function(r,t){return r&t},evbrG:function(r,t){return r+t},atiAl:function(r,t){return r>>>t},ZyFXi:function(r,t){return r<t},ZeQmK:function(r,t){return r|t},YWarL:function(r,t){return r<<t},IPFXt:function(r,t){return r<t},Iukpe:function(r,t){return r<t},XUnQY:function(r,t){return r<t},btiEh:n(933)+n(939)+n(779),flUFo:"service",IcoSB:"name",Ybeao:n(1542),EnDKW:n(1411),KsoOk:n(1166),ZEKGU:function(r,t){return r(t)},rozOy:n(1331)+n(1332),llAvL:function(r,t){return r<t},xlryE:function(r,t,i){return r(t,i)},ZuxPZ:function(r,t,i){return r(t,i)},uDEQJ:function(r,t,i,o){return r(t,i,o)},vxWHY:function(r,t){return r+t},KyQee:function(r,t,i){return r(t,i)},HetJG:n(1156)+n(1115),VPaZy:"allCurso"+n(860),McpQT:n(1376),QnlVG:n(1832),zKeDL:function(r){return r()},etHHJ:function(r,t){return r!==t},Ndhxy:n(1740),DDxQn:n(1893),hdFED:n(1325),HoMqF:function(r,t){return r(t)},OYoTq:n(1870),eSYvB:n(897)+"r",WAuUh:function(r,t){return r!==t},wDUru:n(1038),KyBmj:function(r,t){return r||t},cSWtQ:function(r,t,i){return r(t,i)},fKBgZ:"code",tlewP:function(r,t,i){return r(t,i)},kmLTy:n(1329)+"er_msgid",LUhjl:function(r,t){return r(t)},cczYM:function(r,t,i){return r(t,i)},nHZLf:n(1800)+"s",OiBCn:n(1723)+n(1271)+"e",wQqxF:function(r){return r()},kHuvf:function(r,t){return r>t},ncgen:function(r,t){return r!==t},dUnlM:n(1186),hsajN:function(r){return r()},jyyok:function(r){return r()},QhjaK:function(r,t){return r===t},zwDbw:function(r,t){return r(t)},RsUGi:function(r){return r()},iIoeG:function(r){return r()},sGAlP:function(r){return r()},KsYtI:function(r,t){return r===t},tKYln:n(1773),XhDnJ:function(r,t,i){return r(t,i)},kllQR:function(r,t){return r===t},KJCAC:n(796),nmcoF:function(r,t){return r===t},pcDjm:n(1664),cGsyY:"auto",ZqcGN:n(1131)+n(1547)+"s",osgBG:"success",JaEpc:function(r,t,i,o){return r(t,i,o)},XrBFw:function(r,t){return r===t},PQFSz:n(1852),EPGXC:n(1930),mfNZZ:function(r,t){return r!==t},twylZ:function(r,t){return r!==t},xRDlj:n(1207),lKsiK:n(1614),MJlDh:function(r,t){return r(t)},SzPSW:function(r,t,i){return r(t,i)},CDSOU:function(r,t){return r!==t},fQffd:function(r,t,i){return r(t,i)},ukQVs:function(r,t,i){return r(t,i)},iSUKi:function(r,t){return r>t},MIgIA:n(1988)+"too large",hSRfy:function(r,t){return r>=t},QlgtX:n(1645)+n(1803),fjURi:n(703),enoYV:function(r,t){return r/t},JGFOy:function(r,t){return r===t},GDMii:n(823)+"rovide valid url",ccacP:function(r,t){return r(t)},oSzQS:n(823)+"rovide ws params"+n(1235)+n(950)+n(1315)+n(844)+n(1054),PRebP:"RWgzy",STpgi:n(1511)+"t",kalDl:n(909),jOfNU:n(1665),ySIQl:n(1865),JpxHY:n(1842),iRDKj:function(r,t){return r!==t},ZrnGc:function(r,t){return r==t},snLbL:n(1208),bwdYN:n(1507),nXBPx:n(1880),URpaK:n(570),hThTZ:n(1730)+"d",Niiry:n(823)+n(1508)+n(733)+"viceID o"+n(1887),ckpLW:"function",xjCLt:function(r){return r()},iiRsh:n(821),NKOvO:"fws_1.0.0",JIXld:n(873),KmxSA:function(r,t,i){return r(t,i)},CraGJ:"start",AqhOK:function(r,t,i){return r(t,i)},OvgDJ:function(r,t,i){return r(t,i)},vigIM:function(r,t){return r(t)},KZKak:function(r,t){return r(t)},Fscra:n(937)+">",HiAxt:function(r,t){return r!==t},ObrbE:n(1001)+"ay, try reconnec"+n(1850)+"ver",wbmCJ:n(811)+n(904)+n(1187)+"g",BfbBU:n(692)+"1",CwLAc:n(532)+"3",zXtsH:function(r,t){return r!==t},mXKdp:n(1990),eyMEM:n(1001)+"ay, netw"+n(1518)+n(2016),HuXUi:n(619),eAtGM:function(r,t){return r<<t},MIizG:function(r,t){return r(t)},kZHjT:function(r,t){return r<<t},yZoyC:n(1520),IzdNT:"xToSY",zNYDl:function(r,t,i){return r(t,i)},lOpJi:function(r,t){return r!==t},ZlHjh:n(1630),Rqkmt:n(1926),WpOZK:function(r,t){return r===t},dFkzM:n(823)+"rovide a"+n(992)+n(579)+n(786)+n(1240)+"ng or an"+n(1412)+n(1995),cdWZO:n(1182),uYZBn:function(r,t){return r(t)},PADxo:function(r,t){return r(t)},boncE:function(r,t){return r(t)},KuIAG:n(823)+n(1715)+n(1013)+"ervice",RyBay:function(r,t){return r instanceof t},yEmVH:function(r,t){return r(t)},dtEuG:n(1674),TyoUS:n(549),XkfzC:function(r,t){return r==t},XMrGI:"manual r"+n(947)+n(1985),UxxSj:function(r,t){return r(t)},XIIZz:function(r,t){return r>t},KjLlf:function(r,t){return r===t},qJsfX:n(1755),XJotR:n(1795),bsugE:function(r,t){return r*t},caTtb:function(r,t){return r/t},WDhOo:"Window",KSShN:function(r,t){return r===t},tGSKx:function(r,t){return r!=t},LjQHt:function(r,t){return r!=t},XkUDa:function(r,t){return r===t},WdeVd:n(617)+n(2006)+n(613)+"pe",EPeba:function(r,t){return r!=t},FEERI:n(990),gvvAw:function(r,t){return r!=t},gqKkp:function(r,t){return r!=t},NifQU:function(r,t){return r===t},HmhbZ:n(640)+n(1068)+n(1896),RwfMN:function(r,t){return r===t},eODvR:function(r,t){return r!=t},GuTiM:function(r,t){return r===t},KLCap:n(1027)+n(633)};Ee.r(Z),Ee.d(Z,{FWS:()=>t0,CustomErrorEvent:()=>mi,createCloseEvent:()=>pe,ReconnectEvent:()=>pi,createErrorEvent:()=>de,decodedFrame:()=>fi,createOpenEvent:()=>Si,CustomCloseEvent:()=>wi,createReconnectEvent:()=>ar,FrontierMessageEvent:()=>yi,encodeFrame:()=>or,createMessageEvent:()=>bi,OpenEvent:()=>vi,ErrorCode:()=>qe,Event:()=>it,MessageEvent:()=>_i});let s="";function a(r=""){let t=n;if(e[t(900)](e[t(2013)],e.fisUA))this[t(1078)]&&this[t(1078)][t(1400)](_0x435bbc),this[t(1572)](e.NTcfy,_0x2a4c2b);else{let o=""+Date.now(),u=s||(s=e.CiJhc(m,r)),h=Math[t(893)]()[t(1885)](16)[t(637)](-6);return e[t(1153)](e.SDGui("02"+o,u),h)}}function x(){let r=n;return e.FfAmT(e[r(1289)](1e4,Date[r(1772)]()),Math[r(760)](1e4*Math[r(893)]()))}function c(r){let t=n;return e[t(2033)](e.CiJhc(Array,8)[t(690)]("0"),e[t(1449)](parseInt,r,10)[t(1885)](2)).slice(-8)}function f(r){let t=n;return e[t(763)](Array(4).join("0"),e[t(606)](parseInt,r,2)[t(1885)](16)).slice(-4)}function l(r){let t=n,i=r[t(1769)](/\./).map(h=>c(h)),o=[];return o[0]=e[t(1973)](f,i[0]+i[1]),o[1]=e[t(1859)](f,e.cSvVB(i[2],i[3])),[e[t(1697)],e.anOqw,e[t(1697)],e[t(1697)],"0000",e[t(1907)],o[0],o[1]][t(690)]("")}function m(r){let t=n,i=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/[t(1726)](r),o=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(1726)](r);return i?e[t(1029)](l,r):o?e[t(1029)](w,r):e.bKvTl}function w(r){let t=n,i={JEtmP:t(1763),qFqeT:t(780)};if(e[t(900)](e[t(1401)],t(1539)))this.on(_0x3ab7a5,_0x516f15);else{let o="",u=[],h=0,p=0,g=!0,d=e[t(1697)];if(e.kODjR(r.indexOf("::"),-1)){let y=r[t(1769)]("::");for(let A=0;e[t(766)](A,y.length);A++){if(e[t(634)](e.xvTWY,e[t(1102)]))return this[t(1136)+"ndpointTriesCount"]++,this[t(1780)+t(989)+"nt"]();{let L=y[A];if(e[t(638)](L.indexOf(":"),0)){let T=L[t(1769)](":");g&&(h=T[t(861)]),p+=T[t(861)];for(let O=0;e[t(517)](O,T[t(861)]);O++)if(e[t(2024)](4,T[O][t(861)]))if(e[t(1525)]!=="NPWUs"){let j=d.substring(0,e[t(1521)](4,T[O][t(861)])),xe=j[t(2028)](T[O]);u[t(1466)](xe)}else _0x2bedbb[t(1741)+t(1110)+"ner"](AtbdRZ.JEtmP,_0x4dc52e),_0x240428[t(1741)+t(1110)+"ner"](AtbdRZ.qFqeT,_0xba746e);else u[t(1466)](T[O]);g=!1}else if(e[t(1371)](e[t(2005)],e[t(2005)])){if(e[t(577)](_0x175aea,_0x52fdee))return _0x20f37c}else{if(e[t(2024)](4,L.length)){let T=d[t(1073)+"g"](0,e[t(1521)](4,L[t(861)])),O=T.concat(L);u[t(1466)](O)}else u[t(1466)](L);g&&(h+=1),p+=1,g=!1}}}let v="";for(let A=0;A<8-p;A++)v=v.concat(d);for(let A=0;A<u[t(861)];A++)A===h?(o=o[t(2028)](v),o=o[t(2028)](u[A])):o=o.concat(u[A]);return o}{let y=r.split(":");for(let v=0;e[t(517)](v,y[t(861)]);v++){let A=y[v];if(y[v][t(861)]!==4){let L=d[t(1073)+"g"](0,e.kbDdp(4,y[v][t(861)])),T=L[t(2028)](A);o=o[t(2028)](T)}else o=o[t(2028)](A)}return o}}}function b(r,t){let i=n;if(e.zFFtr(e.vaSok,"dzpmB")){let o=_0x257a97(_0x125bfb,_0x3060eb[i(861)]);_0x263d39[i(1830)][i(1746)](_0x48bf00,o)}else{let o=r.key;o!==void 0&&(V(t,10),e[i(1485)](ve,t,o));let u=r[i(1989)];e[i(1371)](void 0,u)&&(e.XDKBp(e[i(910)],e[i(910)])?_0x3de42b[i(1159)]()[i(1475)](()=>{let h=i;this[h(1933)+h(1392)]()}):(e[i(1783)](V,t,18),e[i(1485)](ve,t,u)))}}function _(r){let t=n,i={};e:for(;!e[t(1960)](De,r);){let o=K(r);switch(e[t(1362)](o,3)){case 0:break e;case 1:i.key=e.WHstf(ye,r,e.PTsAD(K,r));break;case 2:i.value=e[t(1210)](ye,r,e.tzLst(K,r));break;default:e[t(1406)](ie,r,e[t(592)](7,o))}}if(e[t(1594)](void 0,i[t(795)]))throw new Error("Missing "+t(1924)+" field: "+t(795));if(e[t(900)](void 0,i[t(1989)]))throw new Error(e[t(1705)]);return i}function S(r){let t=e.mMXoD(ae);return k(r,t),e.CiJhc(J,t)}function k(r,t){let i=n,o=r[i(731)];e.oNsgH(void 0,o)&&(e[i(588)](V,t,8),e[i(1162)](Et,t,o));let u=r.LogID;u!==void 0&&(e[i(588)](V,t,16),e[i(1408)](Et,t,u));let h=r[i(1801)];e[i(1348)](void 0,h)&&(V(t,24),e[i(1543)](Et,t,e.SFKlC(Q,h)));let p=r[i(1781)];p!==void 0&&(e[i(1908)](V,t,32),Et(t,e[i(916)](Q,p)));let g=r.headers;if(e.gDcdl(void 0,g))for(let j of g){e.EqunA(V,t,42);let xe=e[i(1811)](ae);e[i(1783)](b,j,xe),e.uYPYl(V,t,xe[i(1712)]),e[i(1862)](Vt,t,xe),e[i(1981)](D,xe)}let d=r[i(730)+i(824)];d!==void 0&&(V(t,50),e.FpaJN(ve,t,d));let y=r[i(1788)+i(647)];e.oNsgH(void 0,y)&&(e[i(1679)](V,t,58),e.zVEUw(ve,t,y));let v=r.payload;e[i(1348)](void 0,v)&&(e[i(1485)](V,t,66),V(t,v[i(861)]),e[i(1306)](Jt,t,v));let A=r[i(913)];if(e[i(1003)](void 0,A))if(e[i(1167)](i(1873),e[i(1164)])){let j=0,xe=0,at;do at=e.cdwbf(_0x2bdfc8,_0x380743),j<32&&(xe|=e[i(1180)](127,at)<<j),j+=7;while(128&at);return xe}else e.XtpXS(V,t,74),e[i(1424)](ve,t,A);let L=r[i(1198)+"ming"];e[i(1690)](void 0,L)&&(e[i(1485)](V,t,82),e[i(588)](ve,t,L));let T=r.msgID;e[i(1371)](void 0,T)&&(e[i(1406)](V,t,90),e.fLpgh(ve,t,T));let O=r[i(1309)+"e"];e.YgJMH(void 0,O)&&(e[i(1846)](V,t,96),e[i(1783)](Et,t,e[i(1859)](Q,O)))}function P(r){let t=n;if(e.VqvUU(e[t(1496)],e[t(753)]))return e[t(916)](I,e[t(562)](q,r));this[t(1031)]&&this[t(1031)][t(1203)]({code:_0x3db914,reason:_0x41f1ed})}function I(r){let t=n,i={};e:for(;!e[t(1964)](De,r);){let o=e[t(1455)](K,r);switch(e[t(1362)](o,3)){case 0:break e;case 1:i.SeqID=e.FpaJN(ke,r,!0);break;case 2:i[t(1231)]=e.vtQZy(ke,r,!0);break;case 3:i[t(1801)]=e[t(752)](K,r);break;case 4:i[t(1781)]=e[t(916)](K,r);break;case 5:{let u=e[t(981)](z,r);(i[t(1786)]||(i[t(1786)]=[]))[t(1466)](e[t(1701)](_,r)),r[t(1712)]=u;break}case 6:i["payloadE"+t(824)]=ye(r,e[t(981)](K,r));break;case 7:i["payloadT"+t(647)]=e[t(1246)](ye,r,K(r));break;case 8:i[t(1422)]=St(r,e[t(1969)](K,r));break;case 9:i.LogIDNew=e.uYPYl(ye,r,e[t(1455)](K,r));break;case 10:i[t(1198)+"ming"]=e.ROUSU(ye,r,K(r));break;case 11:i[t(1358)]=e[t(1255)](ye,r,e[t(595)](K,r));break;case 12:i[t(1309)+"e"]=e[t(605)](K,r);break;default:e[t(966)](ie,r,7&o)}}if(i.SeqID===void 0)throw new Error(e[t(1912)]);if(e.sVbIn(void 0,i[t(1231)]))throw new Error(e[t(889)]);if(e[t(1345)](void 0,i[t(1801)]))throw new Error(e.TUXaG);if(e[t(2018)](void 0,i[t(1781)]))throw new Error(t(1702)+"required"+t(1421)+"method");return i}function z(r){let t=n,i=e[t(1964)](K,r),o=r[t(1712)];return r[t(1712)]=e.SDGui(r[t(693)],i),o}function ie(r,t){let i=n;switch(t){case 0:for(;e[i(1180)](128,se(r)););break;case 2:ee(r,e[i(707)](K,r));break;case 5:e[i(607)](ee,r,4);break;case 1:e[i(1162)](ee,r,8);break;default:throw new Error(e[i(1581)](e[i(664)],t))}}function Q(r){return r|=0,{low:r,high:e.tilrF(r,31),unsigned:e.gNAhz(r,0)}}let _e=[];function ae(){let r=n;if(e[r(900)](e[r(1625)],e[r(1625)])){let t=_e[r(1619)]();return t?(t[r(693)]=t[r(1712)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}else{if(!this[r(1078)])return;this[r(1078)][r(1741)+r(1110)+r(1465)](e[r(1481)],this[r(1644)]),this[r(1078)][r(1741)+r(1110)+r(1465)]("close",this[r(1009)]),this[r(1078)][r(1741)+r(1110)+r(1465)](e[r(1018)],this[r(1929)+"ge"]),this[r(1078)][r(1741)+r(1110)+r(1465)](e.XRtwJ,this[r(848)])}}function D(r){_e[n(1466)](r)}function q(r){return{bytes:r,offset:0,limit:r.length}}function J(r){let t=n,i=r[t(1830)],o=r[t(1712)];return e[t(2018)](i[t(861)],o)?i:i[t(879)](0,o)}function ee(r,t){let i=n;if(e[i(1070)](e[i(763)](r[i(693)],t),r[i(1712)]))throw new Error(e.FZebK);r[i(693)]+=t}function De(r){let t=n;return e[t(1228)](r[t(693)],r[t(1712)])}function ge(r,t){let i=n,o=r.bytes,u=r[i(693)],h=r[i(1712)],p=e.jNpei(u,t);if(e[i(1592)](p,o[i(861)])){let g=new Uint8Array(e[i(738)](2,p));g.set(o),r[i(1830)]=g}return r.offset=p,p>h&&(r[i(1712)]=p),u}function Je(r,t){let i=n,o=r[i(693)];if(e[i(1484)](o,t)>r[i(1712)])throw new Error("Read past limit");return r.offset+=t,o}function St(r,t){let i=n,o=e[i(1560)](Je,r,t);return r[i(1830)][i(879)](o,e[i(1484)](o,t))}function Jt(r,t){let i=n,o=e[i(1783)](ge,r,t[i(861)]);r.bytes[i(1746)](t,o)}function ye(r,t){let i=n,o=Je(r,t),u=String.fromCharCode,h=r[i(1830)],p="\uFFFD",g="";for(let d=0;e[i(1379)](d,t);d++){let y=h[d+o],v,A,L,T;e.HSRlp(128,y)===0?g+=u(y):e.EUCBF(e[i(956)](224,y),192)?e[i(1779)](d+1,t)?g+=p:(v=h[e.SDGui(e[i(1153)](d,o),1)],e.zFFtr(e[i(1717)](192,v),128)?g+=p:(T=e[i(1458)](e[i(1735)](31&y,6),e[i(1180)](63,v)),e[i(517)](T,128)?g+=p:(g+=e.pGqMR(u,T),d++))):(240&y)==224?e[i(1308)](d+2,t)?g+=p:(v=h[e[i(1609)](d,o)+1],A=h[e[i(1831)](d+o,2)],e.HsvYu(e[i(622)](e[i(1458)](v,A<<8),49344),32896)?g+=p:(T=e[i(1374)](e[i(1798)](e.fuBVu(15,y),12),e[i(1610)](e.wAoQI(63,v),6))|63&A,e[i(1379)](T,2048)||e[i(577)](T,55296)&&e[i(572)](T,57343)?g+=p:(g+=u(T),d+=2))):e[i(1584)](e[i(1717)](248,y),240)?e.XvHQu(e.ZafrF(d,3),t)?g+=p:(v=h[e.dDQld(d,o)+1],A=h[e[i(1678)](e[i(1570)](d,o),2)],L=h[e[i(1609)](d+o,3)],e.HSRlp(e[i(1857)](v|e.auARm(A,8),e[i(1798)](L,16)),12632256)!==8421504?g+=p:(T=e[i(1374)](e[i(1185)](e[i(704)](e[i(540)](7,y)<<18,e[i(1486)](63&v,12)),e[i(1170)](e[i(1899)](63,A),6)),63&L),T<65536||e[i(1592)](T,1114111)?g+=p:(T-=65536,g+=e.YQwDC(u,e[i(1831)](e[i(518)](T,10),55296),e[i(1609)](1023&T,56320)),d+=3))):g+=p}return g}function ve(r,t){let i=n,o={kTjZB:function(d,y){return e[N(1898)](d,y)},gqVvF:function(d,y){return e[N(1500)](d,y)},xIGsY:function(d,y){return e[N(1173)](d,y)}},u=t[i(861)],h=0;for(let d=0;e[i(517)](d,u);d++){let y=t[i(1028)+"At"](d);y>=55296&&e[i(1058)](y,56319)&&e[i(652)](e[i(560)](d,1),u)&&(y=e[i(772)](e[i(544)](e[i(1486)](y,10),t.charCodeAt(++d)),56613888)),h+=e.YPdZv(y,128)?1:e[i(652)](y,2048)?2:e[i(1200)](y,65536)?3:4}e[i(1862)](V,r,h);let p=ge(r,h),g=r[i(1830)];for(let d=0;e.sTLMj(d,u);d++)if(e[i(2018)](e[i(1807)],i(1098))){let y=t.charCodeAt(d);e.vfuHy(y,55296)&&e[i(658)](y,56319)&&e[i(544)](d,1)<u&&(y=e.vNhDn(e[i(749)](y,10),t.charCodeAt(++d))-56613888),e[i(1429)](y,128)?g[p++]=y:(e[i(584)](y,2048)?g[p++]=e[i(1857)](e.NUGkf(y>>6,31),192):(e[i(1200)](y,65536)?g[p++]=e[i(1185)](e[i(1667)](e.tilrF(y,12),15),224):(g[p++]=e[i(1857)](e[i(1513)](e[i(518)](y,18),7),240),g[p++]=e.dwKFh(e.fuBVu(e[i(518)](y,12),63),128)),g[p++]=e.pNftm(e.AhLTn(y,6)&63,128)),g[p++]=e[i(1899)](63,y)|128)}else{let y=0,v={};for(let A=0;o[i(1666)](A,_0x865270[i(861)]);A++)v[_0xdb4475[A][i(1156)+i(1115)]]=o[i(627)](_0x5b2afb,_0x39e235[A][i(1156)+"ame"]),y+=o.xIGsY(14,v[_0x4c21e4[A]["cursor_n"+i(1115)]]);return[y,v]}}function Vt(r,t){let i=n,o={Mztwm:function(u,h){return u<h},EjILG:function(u,h){return e.jdKhI(u,h)},jVpVr:function(u,h){return u(h)},CCAiq:function(u,h){return u+h},ONnQC:function(u,h){return u(h)},pbRFM:function(u,h){return e.wAoQI(u,h)},ObFbo:function(u,h){return e.pNftm(u,h)}};if(e.oNsgH(e[i(945)],e[i(1952)])){let u=e.vtQZy(ge,r,t[i(1712)]),h=r[i(1830)],p=t[i(1830)];for(let g=0,d=t[i(1712)];e.xAhuC(g,d);g++)h[e[i(1042)](g,u)]=p[g]}else{if(o[i(1709)](_0x21f4eb,1)||o[i(1613)](_0x1509ce,_0x193146))return o[i(1528)](_0x93a3ca,_0xc7a96);o[i(508)](_0x40fd35,_0x2482b7)>_0x12fa19&&(_0x184cf9=o[i(1660)](_0x19cea5,_0x43f675),_0x47c3e4=0);let u=_0x1445f9[i(1894)](_0xb7d28d,_0x48ddda,_0x51c247+=_0x21c294);return o[i(671)](7,_0x1e31ec)&&(_0x3a372d=o[i(915)](7,_0x10d73b)+1),u}}function se(r){let t=n;return e[t(1489)](t(1858),t(1858))?_0x195fcb[t(1159)]():r[t(1830)][e[t(1101)](Je,r,1)]}function Yt(r,t){let i=n,o=e[i(1575)](ge,r,1);r[i(1830)][o]=t}function K(r){let t=n,i=0,o=0,u;do u=e.CiJhc(se,r),e[t(1898)](i,32)&&(o|=e[t(1486)](e[t(1180)](127,u),i)),i+=7;while(e[t(1667)](128,u));return o}function V(r,t){let i=n;for(t>>>=0;e[i(1648)](t,128);)Yt(r,e[i(1834)](127,t)|128),t>>>=7;e.gfCtV(Yt,r,t)}function ke(r,t){let i=n,o={oyFym:function(d,y){return e[N(1891)](d,y)}},u=0,h=0,p=0,g;if(g=se(r),u=e.fuBVu(127,g),e[i(956)](128,g)&&(g=e[i(1455)](se,r),u|=e[i(592)](127,g)<<7,e[i(1149)](128,g)&&(g=se(r),u|=e[i(749)](e.foiQe(127,g),14),e[i(1184)](128,g))))if(e[i(2018)](e[i(1353)],"GZtIw")){if(g=e[i(1500)](se,r),u|=e[i(749)](127&g,21),e[i(592)](128,g)&&(g=se(r),h=e[i(1513)](127,g),e.yoaQt(128,g)&&(g=e[i(1859)](se,r),h|=e[i(1718)](e[i(1844)](127,g),7),e[i(1047)](128,g)&&(g=se(r),h|=e.EpWsV(e[i(552)](127,g),14),e[i(1882)](128,g)&&(g=e[i(1455)](se,r),h|=e.jISKP(e[i(1867)](127,g),21),e.Rihxp(128,g)&&(g=e[i(1455)](se,r),p=e[i(1978)](127,g),e[i(540)](128,g))))))){if(e[i(1474)](e[i(1833)],e[i(1177)]))return e[i(1688)](_0x571483,_0x45190a)?_0x1fd367.reject(new _0x4d812f(i(541)+"alled mu"+i(694)+"imes in process")):(_0x2f6ff1=_0x551692,e[i(813)](_0x3c089e,_0x1d0a82[i(861)])?_0x5545f7.resolve():_0x51fca4[_0x3490af].bind(_0x173fe7)(_0x595ee9,_0x1b9e7c[i(1917)](null,e[i(560)](_0x292b3d,1))));g=se(r),p|=e.FtMqN(127,g)<<7}}else{let d=_0x21e5d5.substring(0,Pcafbp.oyFym(4,_0x50388a[_0x2e7fd6][i(861)])),y=d[i(2028)](_0x2f0565);_0x50688e=_0x9b81a4[i(2028)](y)}return{low:e[i(704)](u,e.AQrRc(h,28)),high:e[i(1579)](h,4)|e[i(978)](p,24),unsigned:t}}function Et(r,t){let i=n,o=e[i(1579)](t[i(1956)],0),u=e[i(1579)](e[i(1374)](e.sPJWp(t.low,28),e[i(1341)](t[i(1856)],4)),0),h=e.giBox(t.high,24),p=h===0?u===0?o<16384?e[i(573)](o,128)?1:2:e[i(1379)](o,2097152)?3:4:e.ELMAs(u,16384)?u<128?5:6:e[i(573)](u,2097152)?7:8:e.xlkpO(h,128)?9:10,g=ge(r,p),d=r.bytes;switch(p){case 10:d[g+9]=e[i(1180)](h>>>7,1);case 9:d[e[i(1389)](g,8)]=p!==9?e[i(624)](128,h):127&h;case 8:d[g+7]=e[i(2024)](8,p)?e[i(624)](u>>>21,128):u>>>21&127;case 7:d[e.cVWsm(g,6)]=p!==7?e[i(1227)](e[i(684)](u,14),128):e.giBox(u,14)&127;case 6:d[g+5]=p!==6?e[i(1458)](e[i(1362)](u,7),128):e[i(716)](u,7)&127;case 5:d[e[i(1609)](g,4)]=e[i(1243)](5,p)?e[i(1061)](128,u):e.HSRlp(127,u);case 4:d[e.cVWsm(g,3)]=e[i(1676)](4,p)?e[i(506)](e[i(1362)](o,21),128):e[i(501)](o>>>21,127);case 3:d[e[i(929)](g,2)]=e[i(1167)](3,p)?e[i(2007)](e[i(1579)](o,14),128):e[i(1184)](e.XhUXA(o,14),127);case 2:d[e.Rbmtx(g,1)]=e[i(1676)](2,p)?e.pNftm(e[i(908)](o,7),128):e[i(1596)](o,7)&127;case 1:d[g]=p!==1?128|o:e[i(552)](127,o)}}function fi(r){let t=n;if(e[t(1454)](e[t(827)],t(1375))){let i=new _0x1dcf4c(e[t(1185)](e[t(506)](e.dIVzD(e[t(1212)](_0x1dd8d7[e.sEnJY(_0x5de990,4)],24),_0x2a8c5a[e.TapQe(_0x4e909d,5)]<<16),_0x1800e6[e[t(1633)](_0x26a4b8,6)]<<8),_0x2dcedc[e[t(748)](_0x548ceb,7)]),e[t(514)](e.ldhJM(e[t(1327)](_0x2aee7e[e.XCfTY(_0x10f80d,0)]<<24,e[t(749)](_0x1f72a2[_0xc84f4e+1],16)),_0x256c1c[e[t(1831)](_0x4e37e8,2)]<<8),_0x26e85b[e.FfAmT(_0x827284,3)]),!0);return _0x12baa5+=8,{value:i,offset:_0x30b6dd+8}}else return e[t(1981)](P,r)}function or(r){return S(r)}let di=65536,da=e[n(1918)],rt=e[n(1289)](di,di),li=e[n(1770)](rt,rt),hi=e.caTtb(li,2),ze=String[n(2032)+"e"][n(1028)+"At"];class M{constructor(t,i,o){let u=n,h={vPsnB:function(p,g,d){return e[N(1783)](p,g,d)},FTtsF:function(p,g){return e[N(847)](p,g)}};e[u(1802)](u(1650),e.UTEnk)?(this[u(1608)]=!0,this[u(1956)]=e[u(1698)](0,t),this[u(1856)]=e[u(847)](0,i),this[u(1453)]=!!o):(hdzQZY[u(1909)](_0x510fe9,_0x1ff262,hdzQZY.FTtsF(127&_0x33e512,128)),_0x53c03e>>>=7)}static[n(1608)](t){return t&&e[n(1685)](!0,t.isLong)}static[n(1747)](t,i,o){return new M(t,i,o)}static[n(775)+"s"](t,i,o){let u=n;return o?M[u(775)+u(1347)](t,i):M[u(775)+u(513)](t,i)}static[n(775)+n(1347)](t,i){let o=n;return new M(e.jvwev(e[o(1653)](e[o(1265)](t[0],e.UWPgH(t[1],8)),e.RmJLB(t[2],16)),e[o(1911)](t[3],24)),e[o(1695)](e[o(1193)](e[o(514)](t[4],e[o(1170)](t[5],8)),e[o(1529)](t[6],16)),e[o(555)](t[7],24)),i)}static[n(775)+n(513)](t,i){let o=n;return new M(e[o(1552)](e[o(1193)](e.auARm(t[4],24)|e.tzKcW(t[5],16),e[o(1798)](t[6],8)),t[7]),e[o(1193)](e[o(632)](e[o(750)](t[0]<<24,e[o(1341)](t[1],16)),t[2]<<8),t[3]),i)}static[n(1530)](t){let i=n;return e[i(1951)](t,da)?gi:new M(e.TiLPY(e[i(1327)](e[i(810)](e[i(1552)](ze[i(1894)](t,0),ze[i(1894)](t,1)<<8),e[i(896)](ze.call(t,2),16)),ze[i(1894)](t,3)<<24),0),e.giBox(e[i(667)](e[i(1857)](ze.call(t,4),e.MGqiQ(ze[i(1894)](t,5),8))|e[i(1686)](ze[i(1894)](t,6),16),e[i(1486)](ze[i(1894)](t,7),24)),0),!0)}[n(1205)](){let t=n;return String["fromChar"+t(1072)](e[t(1184)](255,this[t(1956)]),e[t(2037)](this.low,8)&255,e[t(1460)](e[t(716)](this[t(1956)],16),255),e[t(1239)](this[t(1956)],24),255&this[t(1856)],e.iBTiT(this[t(1856)]>>>8,255),e[t(1149)](e[t(2037)](this[t(1856)],16),255),this.high>>>24)}static fromNumber(t,i=!0){let o=n;if(e[o(566)](isNaN,t))return i?la:gi;if(i){if(t>=li)return ga}else if(e.lfSYp(o(1288),e[o(1663)])){if(e.QgRfL(t,-hi))return pa;if(e[o(1779)](e[o(763)](t,1),hi))return ha}else _0x48f30c=_0x4402cb[o(1028)+"At"](_0x36627d),e.SvaAo(_0x28b5f5,128)?_0x45ee92[_0x1282f4++]=_0x1bf7e6:e.ijRWv(_0x4f56f5,2048)?(_0x52581e[_0x585cae++]=e.EKHze(e[o(1344)](_0x5776e3,6),192),_0x28bb23[_0x14ee9b++]=e.cUhYH(e[o(1513)](63,_0x53cb96),128)):e[o(2018)](e[o(1863)](64512,_0x3ffd72),55296)&&e[o(1685)](e[o(1218)](64512,_0x70c58e=_0xffe459[o(1028)+"At"](_0x3e5455+1)),56320)?(_0x530c3d=e[o(1826)](e[o(1751)](65536,e.fnzCY(e[o(1717)](1023,_0x3bdd44),10)),1023&_0x99cabf),++_0x577a45,_0x411cb5[_0x34a6df++]=e.lDTRq(_0x184c69,18)|240,_0x49e0ca[_0x16f464++]=e.bxUwy(_0x5be72b,12)&63|128,_0x11aa96[_0x55b7a0++]=e[o(750)](e[o(1978)](_0x133ec1>>6,63),128),_0x452eea[_0x13c8e4++]=e[o(1227)](e.DFJxa(63,_0xa6b2d7),128)):(_0x52897f[_0x1b6701++]=e[o(836)](e[o(1889)](_0x436efc,12),224),_0x34dad5[_0x49f991++]=e[o(1265)](e[o(622)](_0x4217b0>>6,63),128),_0xb9ab5d[_0x40e3a1++]=e[o(1552)](e[o(1742)](63,_0x2e9107),128));return M[o(1747)](e[o(514)](e[o(1388)](t,rt),0),e[o(672)](e[o(1691)](t,rt),0),i)}[n(661)](){let t=n;return this[t(1453)]?e[t(1042)](e[t(738)](e[t(1403)](this.high,0),rt),e[t(1174)](this[t(1956)],0)):e[t(1564)](this[t(1856)]*rt,this[t(1956)]>>>0)}[n(1120)](){let t=n;return e[t(1345)](0,this[t(1856)])&&e[t(1802)](0,this[t(1956)])}add(t){let i=n,o={kZKtb:function(u,h){return u&h},JcUOh:function(u,h,p,g){return e.SuYVR(u,h,p,g)},jvkSF:function(u,h){return e.ZMraE(u,h)}};if(e.kuQqr!=="iYVoV"){let u=o[i(1135)](255,_0x52cf70);o.JcUOh(_0x164dd0,u,_0x3d6c70,o[i(1774)](_0xf0bfd9,_0x137ee7)),_0x15ac2f>>>=8,_0x318563--}else{M[i(1608)](t)||(t=M[i(1903)+"er"](t));let u=e[i(1948)](this[i(1856)],16),h=e.Mlrlh(65535,this.high),p=e[i(1403)](this[i(1956)],16),g=65535&this.low,d=t[i(1856)]>>>16,y=e[i(1910)](65535,t[i(1856)]),v=e.XhUXA(t[i(1956)],16),A=e[i(1717)](65535,t.low),L=0,T=0,O=0,j=0;return j+=e[i(1962)](g,A),O+=e[i(1248)](j,16),j&=65535,O+=e.ZMraE(p,v),T+=e[i(597)](O,16),O&=65535,T+=e[i(1456)](h,y),L+=T>>>16,T&=65535,L+=e[i(1293)](u,d),L&=65535,M.fromBits(e[i(847)](e.JSBEp(O,16),j),e[i(1124)](e[i(1798)](L,16),T),this[i(1453)])}}equals(t){let i=n;return M[i(1608)](t)||(t=M.fromNumber(t)),e[i(871)](this[i(1453)],t[i(1453)])&&e.VJLhI(this[i(1856)]>>>31,1)&&e[i(567)](t[i(1856)]>>>31,1)?!1:e[i(841)](this[i(1856)],t[i(1856)])&&e[i(582)](this[i(1956)],t.low)}[n(756)](){let t=n;return this[t(1956)]===-1&&this.high===-1?M[t(1747)](0,0,this[t(1453)]):this.low===-1?M[t(1747)](0,this[t(1856)]+1,this[t(1453)]):M[t(1747)](e.aBZSB(this[t(1956)],1),this.high,this[t(1453)])}[n(691)](t){return t?this[n(1319)+"E"]():this.toBytesBE()}[n(1319)+"E"](){let t=n,i=this[t(1856)],o=this[t(1956)];return[e[t(1959)](255,o),e[t(1775)](e.eEDGe(o,8),255),e[t(1259)](o>>>16,255),e[t(1057)](o,24),e[t(1700)](255,i),e.jEEPd(e.JdacS(i,8),255),e[t(874)](i>>>16,255),e[t(1248)](i,24)]}[n(709)+"E"](){let t=n,i=this[t(1856)],o=this.low;return[e.giBox(i,24),e[t(689)](e[t(1641)](i,16),255),e[t(611)](e[t(1057)](i,8),255),e[t(1320)](255,i),e[t(509)](o,24),e.WcWCl(e[t(646)](o,16),255),e[t(1916)](o>>>8,255),255&o]}}let gi=new M(0,0,!1),la=new M(0,0,!0),ha=M[n(1747)](-1,2147483647,!1),ga=M[n(1747)](-1,-1,!0),pa=M.fromBits(0,-2147483648,!1);var qe=(function(r){let t=n,i=e.smRuf[t(1769)]("|"),o=0;for(;;){switch(i[o++]){case"0":r[r[t(1713)+"RROR"]=5001]=e[t(1900)];continue;case"1":r[r[e[t(626)]]=5004]=e[t(626)];continue;case"2":r[r[e[t(1433)]]=5003]=e[t(1433)];continue;case"3":r[r[e[t(714)]]=5005]=e.exjku;continue;case"4":return r;case"5":r[r[e.EdExJ]=5002]=e.EdExJ;continue}break}})({});class it{constructor(t){let i=n;this.type=t,this[i(603)]=null}}class pi extends it{constructor(t,i){let o=n;super(t),this[o(1444)]=i&&i[o(1444)]||null}}class mi extends it{constructor(t,i){let o=n,u={sglNm:function(h,p,g){return e.iNuwQ(h,p,g)},iCYOb:e[o(863)]};if(e.SAmXs(e.NKmtK,e[o(604)])){if(this[o(1263)+"tManager"]?.["checkRea"+o(1377)+"es"]()){let p=this[o(1263)+o(759)]?.[o(1780)+"ntEndpoint"]();this[o(851)+o(1578)+o(2001)](u[o(1835)](_0x762394,u[o(1693)],{code:1006,reason:o(1598)+p+(o(817)+o(2004)+o(1407)+o(1363)),wasClean:!0}))}else{let p=this[o(1447)][o(1511)+o(1393)+o(814)](_0x269bd5,_0x50cb2a);this["_dispatc"+o(1578)+"ent"](u[o(1835)](_0x5efb53,u[o(1693)],{code:_0x51e842,reason:_0x2fd6fd,wasClean:!0,willReconnect:p})),p&&this._connect()}return}else super(t),this[o(780)]=i&&i[o(780)]||null,this[o(1242)]=i&&i[o(1242)]||0,this.filename=i&&i[o(1550)]||"",this[o(1983)]=i&&i[o(1983)]||0,this[o(1444)]=i&&i[o(1444)]||"",this.code=i&&i[o(2017)]||5001}}class wi extends it{constructor(t,i){let o=n,u=e[o(761)][o(1769)]("|"),h=0;for(;;){switch(u[h++]){case"0":this[o(1090)]=i&&i[o(1090)]||"";continue;case"1":super(t);continue;case"2":this[o(697)]=i&&i[o(697)]||!1;continue;case"3":this.code=i&&i[o(2017)]||0;continue;case"4":this["willReco"+o(1752)]=i&&i.willReconnect||!1;continue}break}}}class _i extends it{constructor(t,i){let o=n;o(535)===e[o(587)]?(_0x290a1f=e[o(1812)](e[o(1148)](e[o(1728)](31,_0x76f823),6),e.wAoQI(63,_0xca1a4d)),e[o(1398)](_0x107b44,128)?_0x5e1b48+=_0x52efd2:(_0x5cf4de+=e.ZXwpl(_0x309633,_0x396858),_0x384d98++)):(super(t),this[o(955)]=i&&i.data||null)}}class yi extends _i{constructor(t,i){let o=n;super(t),this[o(955)]=i&&i[o(955)]||null,this.message=i&&i[o(1444)]||null}}class vi extends it{constructor(t,i){let o=n;super(t),this.data=i&&i[o(955)]||null}}function de(r,{message:t,code:i,error:o}){return new mi(r,{message:t,code:i,error:o})}function pe(r,{code:t,reason:i,wasClean:o,willReconnect:u}){return new wi(r,{code:t,reason:i,wasClean:o,willReconnect:u})}function bi(r,{data:t,message:i}){return new yi(r,{data:t,message:i})}function Si(r,{data:t}){return new vi(r,{data:t})}function ar(r,{message:t}){return new pi(r,{message:t})}class Ei{constructor(t,i){let o=n,u={qBNAv:function(h,p,g){return e[N(1557)](h,p,g)},QidXe:function(h,p){return e[N(608)](h,p)},syiKn:function(h,p){return e[N(1084)](h,p)}};if(e[o(764)](e.JICwj,e[o(816)])){let{value:h,offset:p}=u[o(999)](_0x4ac7ae,_0x1ed467,_0x56767b);_0x4c7814=p,_0xfd5f5e=u[o(601)](u.syiKn(_0x3406f6,8),0),_0x399cff+=h}else this.endpoints=t,this.maxRetries=i,this[o(921)+o(1283)]=0,this[o(1136)+o(1939)+o(1126)+"t"]=0}[n(1188)+n(862)+n(1290)](){let t=n;this[t(921)+"ndex"]=0,this[t(1136)+t(1939)+t(1126)+"t"]=0}[n(1085)+"es"](){let t=n;this[t(1136)+t(1939)+t(1126)+"t"]=0}["getCurre"+n(989)+"nt"](){let t=n;if(e.UoeVA(e[t(718)],e[t(1077)]))return this[t(1955)+"s"][this[t(921)+t(1283)]];e.waDQl(_0x48478c,e[t(680)]),this[t(1683)](t(1131)+t(1547)+"s",_0x50ee38),this[t(1683)](e.WTFOd,_0xa985a0)}[n(1780)+n(989)+n(660)+"ount"](){let t=n;return this[t(1136)+"ndpointT"+t(1126)+"t"]}[n(1739)+n(1377)+"es"](){let t=n;return!!(e.fjDRt(this["currentI"+t(1283)],this.endpoints.length)||e[t(967)](this[t(921)+t(1283)],e[t(1992)](this.endpoints[t(861)],1))&&e.kMDyB(this[t(1136)+t(1939)+t(1126)+"t"],this[t(784)+"es"]))}["checkCur"+n(533)+n(1876)+n(1928)+"tries"](){let t=n;return this[t(921)+t(1283)]==this[t(1955)+"s"][t(861)]?!0:e[t(638)](this[t(1136)+"ndpointT"+t(1126)+"t"],this[t(784)+"es"])}["replaceB"+n(1622)+"pointAndUpdateCount"](){let t=n;return this[t(1136)+t(1939)+t(1126)+"t"]=1,this[t(921)+t(1283)]++,this[t(1955)+"s"][this[t(921)+t(1283)]]}[n(1780)+"ntEndpoi"+n(1053)+n(542)](){let t=n;return this[t(1136)+t(1939)+"riesCount"]++,this[t(1780)+"ntEndpoint"]()}}let st=(e.MPudS(e.gXbfV,typeof globalThis)&&e[n(1824)]===globalThis["construc"+n(1861)][n(1925)]||n(1792)+"d"!=typeof window&&e.KSShN(e[n(1824)],window[n(712)+"tor"][n(1925)]))&&e[n(1749)](e[n(1262)],typeof document),Ve=e[n(1602)](n(1792)+"d",typeof globalThis)&&(e[n(1095)]("Object",globalThis[n(712)+"tor"][n(1925)])||e[n(764)](e[n(903)],globalThis[n(712)+n(1861)][n(1925)]))&&e[n(958)](e[n(1262)],typeof tt),Ct=(e[n(534)]("undefined",typeof globalThis)&&e[n(959)]===globalThis[n(712)+n(1861)][n(1925)]||typeof globalThis>"u"||e.gvvAw(e[n(1262)],typeof globalThis)&&!!globalThis[n(1278)+"Bridge"])&&e[n(833)](e[n(1262)],typeof wx),At=e[n(1262)]!=typeof globalThis&&(e[n(2018)](e.WdeVd,globalThis[n(712)+n(1861)].name)||e.NifQU(e.HmhbZ,globalThis.constructor[n(1925)])||e[n(875)](n(771)+n(545)+n(1062),globalThis[n(712)+n(1861)].name))&&e[n(1284)](e[n(1262)],typeof self),ma=e[n(1749)](e[n(1262)],typeof globalThis)&&e.FEERI===globalThis[n(712)+n(1861)][n(1925)]&&e[n(1749)](e[n(1262)],typeof global)&&e[n(1692)]("Object",global[n(712)+"tor"][n(1925)])&&e.gXbfV!=typeof process&&!!process.version;class xr{constructor(){let t=n;this[t(1567)+"rs"]={}}[n(997)](t,...i){let o=n,u=this[o(1567)+"rs"][t];if(u)u[o(637)]()[o(1099)](h=>h.fn[o(1632)](h[o(538)],i));else if(e[o(1121)](e[o(1426)],t)&&!this[o(1591)]){let h=i[o(861)]&&i[0];if(e[o(2034)](h,Error))throw h;let p=new Error(e[o(1293)](e[o(935)],h?e.inGhM(" (",h[o(1444)])+")":""));throw p[o(1796)]=h,h}return this}[n(1683)](t,i){let o=n;if(e[o(967)](void 0,t))this[o(1567)+"rs"]={};else if(i===void 0)this[o(1567)+"rs"][t]=null;else{let u=this[o(1567)+"rs"][t];if(u)for(let h=0;h<u.length;)e[o(567)](u[h].fn,i)?u.splice(h,1):++h}return this}on(t,i,o){let u=n;return(this[u(1567)+"rs"][t]||(this._listeners[t]=[]))[u(1466)]({fn:i,ctx:o||this}),this}}class wa extends xr{["_formatE"+n(815)+n(724)](t){let i=n;return t[i(1823)]||t[i(834)]?(i(500)+" "+(t.errMsg||"")+i(512)+(t[i(834)]||""))[i(1963)]():JSON.stringify(t)}constructor(t,i,o){let u=n;super(),this[u(1031)]=null,Ct&&wx[u(1505)+u(1993)]&&(this[u(1031)]=wx["connectS"+u(1993)]({url:t,protocols:i,header:o,fail:this[u(1349)+u(547)+u(1226)][u(1917)](this),success:this["_createSocketSuc"+u(1871)+u(1813)][u(1917)](this)})),Ve&&tt[u(1505)+"ocket"]&&(this[u(1031)]=tt[u(1505)+u(1993)]({url:t,protocols:i,header:o,fail:this[u(1349)+u(547)+u(1226)][u(1917)](this),success:this[u(1349)+u(565)+"cessHandler"][u(1917)](this)}))}[n(1349)+n(565)+"cessHand"+n(1813)](){let t=n,i={qclNK:t(909),ImkRu:"pageshow"};e[t(1489)](e[t(1356)],t(1060))?Promise[t(1159)]()[t(1475)](()=>{let o=t;this[o(1933)+o(1392)]()}):(this[t(1251)+"er"]&&_0x3aa7ed[t(1741)+t(1110)+t(1465)](i[t(1441)],this["_handleP"+t(585)]),this._isBrowser&&_0x4bcf1e["removeEventListe"+t(1465)](i[t(1868)],this[t(1022)+t(902)]),this.close())}[n(1349)+"ocketFai"+n(1226)](t){let i=n,o={yIJFB:e.XRtwJ,qBpGz:e[i(863)]};Promise[i(1159)]().then(()=>{let u=i,h=de(o.yIJFB,{message:this[u(922)+u(815)+u(724)](t)});this[u(997)](o[u(963)],h);let p=pe("close",{reason:this[u(922)+u(815)+u(724)](t)});this[u(997)](o[u(843)],p)})}[n(1933)+n(1392)](){let t=n,i={atoEP:e.aSiiU,FJHqh:function(o,u,h){return e[N(830)](o,u,h)},ZJcTp:e.IgFHH,OoxsJ:function(o,u,h){return e[N(1935)](o,u,h)}};this._socket[t(1845)](o=>{let u=t;this[u(997)](e[u(1481)],e[u(2031)](Si,e[u(1481)],{...o,data:o[u(1823)]||""}))}),this._socket[t(1030)](o=>{let u=t;this[u(997)](i[u(785)],i[u(596)](pe,u(1203),{...o}))}),this[t(1031)][t(1827)+"e"](o=>{let u=t;this[u(997)](i[u(1311)],i[u(826)](bi,i[u(1311)],{...o}))}),this._socket.onError(o=>{let u=t;this[u(997)](u(780),e[u(2025)](de,e.XRtwJ,{...o,message:o[u(1823)]||""}))})}[n(1400)](t){let i=n;if(t instanceof Uint8Array){let o=t[i(516)][i(637)](t[i(1533)+"et"],t[i(1649)+"th"]+t[i(1533)+"et"]);this[i(1031)]&&this._socket[i(1400)]({data:o,fail:u=>{let h=i;this.emit(e[h(1426)],e.lOqDL(de,e[h(1426)],{message:this[h(922)+h(815)+h(724)](u)}))}})}else this[i(1031)]&&this._socket[i(1400)]({data:t,fail:o=>{let u=i;this[u(997)](e[u(1426)],e[u(1783)](de,u(780),{message:this[u(922)+u(815)+u(724)](o)}))}})}[n(1203)](t,i){let o=n;this[o(1031)]&&this[o(1031)][o(1203)]({code:t,reason:i})}[n(1337)+n(754)](t,i){let o=n;e[o(1334)](e[o(884)],e.FAhbi)?(_0x5e6a1b&&_0x2542d2["addEvent"+o(754)](wfvZsA.aSiiU,()=>_0xd61372()),_0x17d28f&&_0x4280cb.addEventListener(wfvZsA[o(2026)],()=>_0x5c3caa())):this.on(t,i)}[n(1741)+n(1110)+"ner"](t,i){this.off(t,i)}get[n(1503)+"te"](){let t=n,i={WlJut:e[t(1261)],OGqAO:e.TKDPS,kpmoy:function(o){return e.VJVYP(o)},zRBfU:function(o,u){return e[t(1953)](o,u)},ADAVu:t(1410)+"or"};if(e[t(813)](t(1340),e.KdsAx)){let o=()=>{let p=t;_0xd68f68[p(1741)+p(1110)+p(1465)](WEtvRU[p(526)],u),_0x105602[p(1741)+"entListe"+p(1465)](p(780),h),_0x5756b8["removeEv"+p(1110)+p(1465)](WEtvRU[p(635)],h)},u=()=>{let p=t;_0x4b9b7f(),WEtvRU[p(1155)](o)},h=()=>{let p=t;WEtvRU[p(1268)](_0x51b896,_0x35b2c1.error||new _0x32b3b8(WEtvRU[p(1477)],WEtvRU[p(1477)])),o()};_0xd98165[t(1337)+t(754)](wfvZsA[t(1261)],u),_0x15a8e0[t(1337)+t(754)](wfvZsA[t(1426)],h),_0x3cb41c[t(1337)+"Listener"]("abort",h)}else return this._socket[t(1503)+"te"]}get[n(1469)+"pe"](){let t=n;return this[t(1031)][t(1469)+"pe"]}set[n(1469)+"pe"](t){}get url(){let t=n;return this[t(1031)][t(926)]}get[n(1684)](){let t=n;if(e[t(1699)](e[t(625)],e[t(1163)]))switch(_0x16805c){case e[t(1540)]:case e.olTVf:return{[t(1233)+_0x3109e3]:1,"x-tt-env":_0x48c330};default:return{}}else return this[t(1031)][t(1684)]}get[n(1828)+"ns"](){let t=n;return this[t(1031)][t(1828)+"ns"]}get[n(774)+n(1848)](){return 0}}function _a(r,t){let i=n;if(i(735)!==e.CGSua){if(t)return new t(r[i(926)],r[i(1684)]);if(Ct||Ve)return new wa(r.url,r[i(1684)],r[i(1786)]);if(e[i(1366)](st,At)&&e[i(558)](e[i(1262)],typeof WebSocket)&&WebSocket)return new WebSocket(r[i(926)],r[i(1684)+"s"])}else{let o=this._qosDB[i(1847)+i(888)+"nc"](this[i(1516)]),u=_0x3cd538[i(1117)](o||"{}");return _0x2c6c06.keys(u)}}function ya(r){let t=n;return!!(r||Ct&&wx[t(1505)+t(1993)]||Ve&&tt[t(1505)+t(1993)]||e[t(1366)](st,At)&&t(1792)+"d"!=typeof WebSocket&&WebSocket)}function Ci(r,t,i){let o=n;if(e[o(1189)]===e[o(1618)])_0x341111=_0x5c4419[e[o(1825)](_0x3b29a3,_0x572c0a)+1],_0xf522e2=_0x5adf45[e[o(1816)](e[o(1059)](_0x458178,_0x531d97),2)],_0x264f20=_0x3f55c8[e.sRCeI(e[o(1532)](_0x68739e,_0x361b00),3)],e.mIwpO(e[o(1428)](_0x323bf8|_0x645a69<<8,e[o(665)](_0x1a6fc7,16))&12632256,8421504)?_0x44b59e+=_0x38b282:(_0xc662c2=e[o(931)](e[o(1653)](e[o(1555)](7,_0x287286)<<18,e[o(1978)](63,_0x2391c0)<<12),e.lVcwv(e.SERDY(63,_0x500fc2),6))|e[o(1717)](63,_0x4a9db9),e[o(517)](_0x567486,65536)||e.jdKhI(_0x578f93,1114111)?_0x4aa218+=_0xdfe00d:(_0x311a42-=65536,_0x3eb606+=_0x5dba0e(e.wzURg(e.Cxyen(_0x53c0fe,10),55296),e[o(1581)](1023&_0x367818,56320)),_0x4902fa+=3));else{let u=-1;async function h(p){let g=o;return e[g(1361)](p,u)?Promise[g(812)](new Error(e.nWKOg)):(u=p,e[g(2029)](p,i[g(861)])?Promise.resolve():i[p][g(1917)](r)(t,h[g(1917)](null,e[g(668)](p,1))))}e[o(1154)](h,0)}}function Ai(r){let t=n,i={wJUGB:"online",vYEtW:e.rHfsf,IASDy:t(909),MeyBy:e[t(1141)],nQryB:function(o,u){return e[t(1594)](o,u)},zBUSc:e[t(1757)],evZCM:e.xKNQZ};if(e[t(582)](e[t(1223)],e[t(590)]))this._isBrowser&&_0x58eec2[t(1337)+"Listener"](i[t(1295)],this[t(1662)+t(1247)]),this[t(1251)+"er"]&&_0x7a7a77[t(1337)+"Listener"](i[t(1034)],this[t(1662)+t(1853)]),this[t(1251)+"er"]&&_0x25d378[t(1337)+t(754)](i[t(1573)],this["_handleP"+t(585)]),this._isBrowser&&_0x56ee8b[t(1337)+t(754)](i[t(1687)],this["_handleP"+t(902)]);else{let o=0,u=0;for(let h=0;e.bqNYo(h,r[t(861)]);++h)if(u=r[t(1028)+"At"](h),e[t(1782)](u,128))o+=1;else if(e[t(1782)](u,2048))o+=2;else if(e[t(932)](e[t(1805)](64512,u),55296)&&e[t(998)](e[t(1269)](64512,r.charCodeAt(e[t(1112)](h,1))),56320))if(e[t(1171)]("cBirn",e[t(720)])){let p=("0|1|4|3|"+t(802)).split("|"),g=0;for(;;){switch(p[g++]){case"0":this[t(1947)+t(1808)]=!0;continue;case"1":this[t(1499)+"mer"]();continue;case"2":this[t(1014)+t(1258)+"t"](_0x21b4db,_0x1f0196);continue;case"3":this[t(964)+t(1390)+t(754)]();continue;case"4":this[t(2011)+"ngTimer"]();continue;case"5":this["_QoSMana"+t(1e3)]?.[t(2019)]();continue;case"6":if(this._ws[t(1503)+"te"]===this[t(886)]||i.nQryB(this._ws[t(1503)+"te"],this[t(984)]))return void this[t(1572)](i[t(696)]);continue;case"7":if(!this._ws)return void this[t(1572)](i[t(1462)]);continue}break}}else++h,o+=4;else o+=3;return o}}function Di(r,t,i){let o=n;if(e.caVRv(e[o(772)](i,t),1))return"";let u="";for(let h=t;e[o(1132)](h,i);){let p=r[h++];if(p<=127)u+=String[o(502)+o(1072)](p);else if(p>=192&&e[o(1200)](p,224))u+=String[o(502)+o(1072)](e.pNftm(e[o(1402)](31,p)<<6,e[o(1217)](63,r[h++])));else if(e[o(577)](p,224)&&e[o(1732)](p,240))u+=String[o(502)+o(1072)](e[o(1227)](e[o(1061)](e[o(1700)](15,p)<<12,(63&r[h++])<<6),e[o(870)](63,r[h++])));else if(p>=240){let g=e[o(987)](e.HtGpX(e[o(1810)](e[o(727)](e[o(1725)](e.pEJZC(7,p),18),e[o(1742)](63,r[h++])<<12),e[o(1069)](63,r[h++])<<6),e[o(1844)](63,r[h++])),65536);u+=String[o(502)+o(1072)](e[o(1609)](55296,e[o(1026)](g,10))),u+=String[o(502)+o(1072)](56320+(1023&g))}}return u}function cr(r,t,i){let o=n,u=i,h,p;for(let g=0;e.NrdgP(g,r[o(861)]);++g)if(e[o(1588)](e[o(2020)],e[o(2020)])){let d=this._options[o(730)+o(824)]instanceof _0x560f7e?{force:!!this[o(1447)][o(730)+o(824)][o(743)],encoding:this[o(1447)][o(730)+"ncoding"][o(1378)]?this[o(1447)][o(730)+o(824)][o(1378)][o(1399)](/\s/g,"")[o(1409)+o(711)]():""}:{force:!1,encoding:this._options[o(730)+o(824)]?this[o(1447)][o(730)+o(824)].replace(/\s/g,"")[o(1409)+o(711)]():""},y=_0x2ddf77["payloadE"+o(824)]?_0x5a8adc[o(730)+o(824)].replace(/\s/g,"")[o(1409)+o(711)]():"",v=e[o(1191)](this[o(1447)][o(1788)+o(647)],_0x4e5fa8)?{force:!!this[o(1447)]["payloadT"+o(647)].force,type:this._options[o(1788)+"ype"][o(1980)]?this[o(1447)][o(1788)+o(647)][o(1980)].replace(/\s/g,"")[o(1409)+o(711)]():""}:{force:!1,type:this[o(1447)][o(1788)+"ype"]?this[o(1447)][o(1788)+o(647)][o(1399)](/\s/g,"")[o(1409)+o(711)]():""},A=_0x3fdc56[o(1788)+o(647)]?_0x4dba53[o(1788)+o(647)][o(1399)](/\s/g,"")["toLowerC"+o(711)]():"",L=v[o(743)]?v[o(1980)]:A||v[o(1980)],T=d[o(743)]?d[o(1378)]:y||d[o(1378)],O=[e[o(2015)],e.nLitR,e.nRJmA,e[o(1181)]],j=[e[o(1480)],e[o(1635)]];this[o(1447)]["enableTr"+o(1696)+o(1629)+"ad"]&&O[o(719)](L)&&(!T||j[o(719)](T))?_0x310b61[o(1364)+o(1957)]=e.ZVYvz(_0x47f00a,_0x36c066.payload,0,_0x293271[o(1422)][o(1649)+"th"]):_0x5251eb.textPayload=""}else if(h=r[o(1028)+"At"](g),e.AQWbi(h,128))t[i++]=h;else if(e[o(1706)](h,2048))t[i++]=e[o(1237)](e[o(1026)](h,6),192),t[i++]=e[o(1695)](63&h,128);else if(e[o(1738)](e[o(689)](64512,h),55296)&&e[o(967)](e.tJXzC(64512,p=r[o(1028)+"At"](e.EjPtr(g,1))),56320)){let d=e[o(1970)][o(1769)]("|"),y=0;for(;;){switch(d[y++]){case"0":t[i++]=e[o(1061)](e[o(1869)](e[o(1344)](h,6),63),128);continue;case"1":t[i++]=e[o(979)](e[o(1829)](e[o(1889)](h,12),63),128);continue;case"2":t[i++]=e[o(952)](63,h)|128;continue;case"3":t[i++]=e.lDTRq(h,18)|240;continue;case"4":h=e[o(1250)](65536,e[o(1084)](e[o(1916)](1023,h),10))+e.staDT(1023,p);continue;case"5":++g;continue}break}}else t[i++]=e[o(672)](e.cjmrH(h,12),224),t[i++]=e[o(790)](e[o(2009)](h>>6,63),128),t[i++]=e[o(1185)](63&h,128);return e[o(511)](i,u)}async function ki(r){let t=n;if(e[t(567)](t(1817),e[t(850)])){if(e.OImMI("string",typeof r))if(e.pRiLq==="RLqfP"){let i=new Uint8Array(e[t(1152)](Ai,r));return e.SuYVR(cr,r,i,0),i}else return _0x2bd75f[t(1015)](_0x253a06),!1;return e[t(1050)](r,ArrayBuffer)?new Uint8Array(r):new Uint8Array(r[t(516)],r[t(1533)+"et"],r[t(1649)+"th"])}else _0x2e76b8=e.HEetp(_0x571239,_0x5d8e31),_0x44d039|=e[t(1450)](127&_0x188769,7)}function va(r){let t=n;if(e[t(1171)](e[t(1109)],e[t(1109)]))this[t(1078)]&&this[t(1078)].send(_0x25c691),this[t(1561)+t(1065)][_0x45ecc7]=null;else try{return e[t(1277)](e.dwUKE,typeof r)&&(e[t(1191)](r,ArrayBuffer)||r[t(516)]&&e.ZhMpB(r[t(516)],ArrayBuffer))||e.dKaAk("string",typeof r)?"":(JSON[t(1117)](r),e[t(854)])}catch{return e[t(1584)](e[t(1181)],typeof r)?e[t(2015)]:""}}let ba=(r,t)=>{let i=n;switch(r){case e[i(1540)]:case i(2035):return{[i(1233)+r]:1,"x-tt-env":t};default:return{}}};class Sa{constructor(t){let i=n;this[i(1420)+"ount"]=t,this[i(536)]=0}[n(1024)](){let t=n;this[t(536)]++}[n(1739)+"chMaxCount"](){let t=n;return this[t(536)]>=this["maxLossC"+t(1522)]}[n(1440)+"nter"](t=0){let i=n;if(e[i(1986)](e.aauIH,i(798)))this[i(1420)+i(1522)]=t,this[i(536)]=0;else return!!this[i(940)]}}async function Ea(r){let t=n,i={cInFA:function(o,u){return o<u},vVmtB:function(o,u){return o!==u},qeiFI:function(o,u){return e.dSIsT(o,u)},dmAKQ:function(o,u){return e.UZrnq(o,u)},kKZxV:t(556)+t(1090)};if(e[t(1266)](e[t(985)],e[t(985)])){let o=_0x5c5f2b[t(1769)](":");_0x436030&&(_0x3abb5f=o[t(861)]),_0x568334+=o[t(861)];for(let u=0;EFMWoj[t(1886)](u,o.length);u++)if(EFMWoj[t(1012)](4,o[u][t(861)])){let h=_0x2bf9f2.substring(0,EFMWoj[t(974)](4,o[u][t(861)])),p=h[t(2028)](o[u]);_0x13ef99.push(p)}else _0x33b7a8.push(o[u]);_0x12828d=!1}else return new Promise(o=>{let u=t;if(!st)return o(e.JlWiK);try{let h=document[u(1113)+u(865)](u(1509));window[u(1897)+"JSONP"]=p=>{let g=u;document.body.removeChild(h),window[g(1897)+g(996)]=void 0,i[g(1272)](o,p&&p[g(1139)]||i[g(504)])},h.type=e[u(846)],h[u(530)]=e[u(1962)](r.replace(/^ws/,e[u(1437)]),e.icIlG);try{document[u(686)]["appendCh"+u(1176)](h)}catch{document.body[u(715)+"ild"](h)}}catch{window[u(1897)+u(996)]=void 0,e.fpyqc(o,"unknown reason")}})}function Ue(r,t,i){let o=n;return!!r?.[o(1415)](u=>u[o(795)]===t&&u[o(1989)]===i)}function ot(r,t){let i=n;return r?.[i(1415)](o=>o[i(795)]===t)?.[i(1989)]}let ur=null;async function Ca(){let r=n;if(e.OWZYQ===r(1442))return ur||(ur=Promise[r(1159)]()[r(1475)](Ee[r(1917)](Ee,r(1724)))),ur;this[r(1447)][r(1490)]&&_0x1cfaa0.log.apply(_0x1c6a38,["FRONTIER>",..._0x1723c7])}class Aa extends xr{constructor(t,i){let o=n;super(),this[o(740)]=t,this._keyPath=i,this[o(940)]=void 0,this["_initPro"+o(1168)]=null}async[n(1837)](){let t=n,i={UlGxt:function(o,u){return e.uziRF(o,u)},wTjRg:function(o,u){return e.DDIzp(o,u)}};e.NTmlZ(e[t(523)],"WKtsn")?(this[t(1608)]=!0,this[t(1956)]=CEVHEY[t(1799)](0,_0x5ecd20),this.high=CEVHEY[t(1923)](0,_0x4d4283),this[t(1453)]=!!_0x4125da):await this[t(1526)]()}async _init(){let t=n,i={vdbjV:function(o,u){return e[N(956)](o,u)},ZjWmp:function(o,u){return e[N(859)](o,u)},iFhXj:function(o){return e[N(1875)](o)},cfYUK:function(o,u,h,p){return e.SuYVR(o,u,h,p)}};if(!this[t(940)]){if(this[t(683)+"mise"])return this[t(683)+t(1168)];try{if(e[t(1611)](e[t(1681)],e[t(1681)]))return _0x3f3d43.readUInt8?{value:_0x5ae9a6[t(610)+"8"](_0xd8ee9d),offset:_0x4ce573+1}:{value:i[t(1359)](255,_0x3646cb[_0x229a87]),offset:i[t(1143)](_0x32a691,1)};{let o=this[t(740)],u=this[t(1213)];this[t(683)+t(1168)]=(async()=>{let h=t,{openDB:p}=await i[h(1127)](Ca);this[h(940)]=await i[h(892)](p,h(1897)+"_"+o,1,{upgrade(g){g[h(905)+"jectStore"](o,{keyPath:u})}})})(),await this[t(683)+t(1168)]}}catch(o){console[t(1015)](o)}finally{if(e[t(634)]("alhXW",e[t(561)])){let o=e.smEHu(_0x490fc3[t(1956)],0),u=e.bisuH(e.zFliv(_0x1c4a1f.low,28)|e.Nliqg(_0x1a91cb[t(1856)],4),0),h=e[t(1771)](_0x4be91a[t(1856)],24),p=e.zLdxI(0,h)?e[t(841)](0,u)?e[t(1706)](o,16384)?e.xlkpO(o,128)?1:2:o<2097152?3:4:e.ZmWaf(u,16384)?e.ZIAQA(u,128)?5:6:e[t(970)](u,2097152)?7:8:e[t(1753)](h,128)?9:10,g=e[t(606)](_0x28e2e9,_0x2518e8,p),d=_0x15656c[t(1830)];switch(p){case 10:d[e[t(1373)](g,9)]=e[t(1895)](h>>>7,1);case 9:d[e[t(1088)](g,8)]=e.vRwpi(9,p)?128|h:e[t(1055)](127,h);case 8:d[e.sEnJY(g,7)]=p!==8?e.bDDik(e[t(930)](u,21),128):e.pEJZC(e[t(1403)](u,21),127);case 7:d[e[t(1373)](g,6)]=e.YgJMH(7,p)?u>>>14|128:e[t(1916)](e[t(1158)](u,14),127);case 6:d[g+5]=p!==6?e[t(1002)](e[t(1158)](u,7),128):e[t(540)](e[t(1234)](u,7),127);case 5:d[e[t(1456)](g,4)]=e[t(1690)](5,p)?e[t(1906)](128,u):e.Mlrlh(127,u);case 4:d[e.xGPtQ(g,3)]=e[t(820)](4,p)?e[t(1286)](e[t(1239)](o,21),128):e.okdTb(o,21)&127;case 3:d[e[t(1816)](g,2)]=e.fdCeb(3,p)?e.UnHjf(e.eEDGe(o,14),128):e[t(641)](o,14)&127;case 2:d[g+1]=e[t(574)](2,p)?e[t(2007)](e[t(1222)](o,7),128):e.CVmIg(e[t(1785)](o,7),127);case 1:d[g]=e[t(1266)](1,p)?e[t(1209)](128,o):127&o}}else this[t(683)+t(1168)]=null}}}async[n(1301)](t){let i=n;try{return await this._init(),this[i(940)]?.[i(1301)](this[i(740)],t)}catch(o){console[i(1015)](o)}}async[n(1746)](t,i){let o=n;return await this[o(1526)](),this[o(940)]?.put(this[o(740)],t)}async[n(1968)](t){let i=n;try{return await this[i(1526)](),this[i(940)]?.[i(1922)](this[i(740)],t)}catch(o){console[i(1015)](o)}}async[n(1385)](){let t=n;try{return await this[t(1526)](),this._qosDB?.clear(this[t(740)])}catch(i){console[t(1015)](i)}}async[n(805)](){let t=n;if(e[t(1204)](t(521),e[t(1299)]))return await this[t(1526)](),this[t(940)]?.[t(1416)+"ys"](this._dbName);wfvZsA.tIpIe(_0x129f79,wfvZsA[t(515)](_0x160cb5,_0x53de77[t(1537)])),wfvZsA.fBaZx(_0x41356b)}async[n(2030)](){let t=n;return await this[t(1526)](),this[t(940)]?.[t(2030)](this[t(740)])}async closeDB(){let t=n;if(e[t(681)](e[t(1335)],e[t(1335)])){let i=new _0xeb6101(2*_0x30da52);i[t(1746)](_0x3ba721),_0x3c9b68[t(1830)]=i}else try{this[t(940)]?.[t(1203)](),this[t(940)]=void 0}catch(i){console[t(1015)](i)}}get isReady(){let t=n;try{return!!this[t(940)]}catch(i){return console[t(1015)](i),!1}}}class Da{constructor(t,i){let o=n;if(e[o(995)](o(687),e.jpATf))return e[o(1006)](e[o(885)](_0x572b69,8)[o(690)]("0"),e[o(1783)](_0x1406ad,_0x580947,10)[o(1885)](2))[o(637)](-8);this[o(1711)]=t,this[o(1224)]=i,this[o(940)]=localStorage}async[n(1837)](){}get[n(1516)](){let t=n;return t(1897)+"_"+this[t(1711)]}async[n(1301)](t){let i=n,o=this._qosDB.getItem(this[i(1516)]);return JSON[i(1117)](o||"{}")[t]}async set(t,i){let o=n,u=this[o(940)][o(895)](this._prefix),h=JSON.parse(u||"{}");return h[i||t[this[o(1224)]]]=t,this[o(940)][o(953)](this[o(1516)],JSON[o(1998)+"y"](h)),i||t[this[o(1224)]]}async[n(1968)](t){let i=n,o=this[i(940)].getItem(this[i(1516)]),u=JSON[i(1117)](e[i(1366)](o,"{}"));return u[t]=void 0,this[i(940)][i(953)](this._prefix,JSON.stringify(u))}async[n(1385)](){let t=n,i={vUvof:function(o,u){return e[N(772)](o,u)},ByeCD:function(o,u){return o>u}};if(e[t(1474)](e[t(706)],e[t(1457)])){let{initReconnectInterval:o,maxReconnectInterval:u,reconnectIntervalGrowFactor:h}=this[t(1447)],p=o*_0x543f61.pow(h,i.vUvof(_0xbc47b2,1));return i[t(1921)](p,u)?u:p}else return this[t(940)][t(1385)]()}async[n(805)](){let t=n,i={RrrOm:e[t(863)]};if(e[t(820)](t(1100),t(1100))){let o=this[t(1263)+"tManager"]?.[t(1780)+"ntEndpoint"]();this[t(851)+t(1578)+t(2001)](_0x102c35(i.RrrOm,{code:1006,reason:t(1598)+o+(t(817)+t(2004)+t(1407)+"ached"),wasClean:!0}))}else{let o=this._qosDB[t(895)](this[t(1516)]),u=JSON[t(1117)](e.JtjWI(o,"{}"));return Object[t(805)](u)}}async[n(2030)](){let t=n,i=this[t(940)][t(895)](this[t(1516)]),o=JSON[t(1117)](i||"{}");return Object[t(858)](o)}[n(2019)](){return Promise[n(1159)]()}get[n(591)](){let t=n,i={JskOG:function(o,u){return o|u},RYlrk:function(o,u){return e[N(1829)](o,u)},nSWNd:function(o,u){return e[N(1221)](o,u)},kchoS:function(o,u){return e[N(1214)](o,u)}};if(e[t(1843)](t(1161),e[t(643)]))return!!this[t(940)];_0x1bc680<65536?_0x374c34[_0x31a8bf++]=mcYtEk[t(2002)](mcYtEk[t(732)](mcYtEk[t(919)](_0x4df54f,12),15),224):(_0x497522[_0x29fc8e++]=mcYtEk[t(732)](mcYtEk[t(919)](_0x28594c,18),7)|240,_0x23af2d[_0xb858c4++]=mcYtEk[t(2002)](mcYtEk[t(765)](mcYtEk[t(919)](_0x11c4e1,12),63),128)),_0x5ad62d[_0x4846a9++]=mcYtEk[t(2002)](mcYtEk[t(919)](_0x4499f9,6)&63,128)}}class ka{constructor(t,i){this._DBName=t,this._pathKey=i,this._qosDB=Ve?tt:Ct?wx:null}async openDB(){}get[n(1516)](){let t=n;if(e[t(1634)](e[t(960)],"cfxhz")){let i={rYURV:function(g,d){return e[t(1498)](g,d)},obBMz:function(g,d){return g>d},OiifJ:function(g,d){return e[t(1743)](g,d)},jVMcO:function(g,d){return e.EtsHT(g,d)},OHeca:function(g,d){return e[t(1604)](g,d)},MhFpT:function(g,d){return e.dJEBw(g,d)}},o=e[t(825)](_0x5399da,8192),u=o>>>1,h=null,p=o;return function(g){let d=t;if(i[d(1190)](g,1)||i[d(799)](g,u))return i[d(1548)](_0x1ece67,g);i.jVMcO(p+g,o)&&(h=i[d(1548)](_0x174648,o),p=0);let y=_0x268d50[d(1894)](h,p,p+=g);return 7&p&&(p=i[d(1745)](i[d(1512)](7,p),1)),y}}else return t(1897)+"_"+this[t(1711)]}async[n(1301)](t){let i=n,o=this[i(940)].getStorageSync(this[i(1516)]);return JSON[i(1117)](o||"{}")[t]}async set(t,i){let o=n,u=this[o(940)][o(1847)+o(1468)](this._prefix),h=JSON[o(1117)](u||"{}");return h[i||t[this[o(1224)]]]=t,this[o(940)][o(1607)+"geSync"](this[o(1516)],JSON[o(1998)+"y"](h)),i||t[this[o(1224)]]}async[n(1968)](t){let i=n,o=this[i(940)][i(1847)+i(1468)](this[i(1516)]),u=JSON[i(1117)](e[i(519)](o,"{}"));return u[t]=void 0,this[i(940)][i(1607)+"geSync"](this._prefix,JSON[i(1998)+"y"](u))}async clear(){let t=n;return e[t(1888)]!=="xTHyk"?new _0x3d78bd(e[t(1461)](e[t(1285)](e[t(1313)](e.aihqQ(_0x43f040[4],24),e[t(914)](_0x2af917[5],16)),e.aPVIF(_0x528787[6],8)),_0x538e11[7]),e[t(1360)](e[t(1142)](e[t(794)](_0x1d48d7[0],24),_0x275772[1]<<16)|e[t(1911)](_0x8b1476[2],8),_0x3650cf[3]),_0x77305b):this[t(940)][t(783)+t(1116)]()}async[n(805)](){let t=n,i=this[t(940)][t(1847)+t(888)+"nc"](this[t(1516)]),o=JSON.parse(e[t(1605)](i,"{}"));return Object.keys(o)}async[n(2030)](){let t=n,i=this._qosDB[t(1847)+t(888)+"nc"](this[t(1516)]),o=JSON[t(1117)](e[t(519)](i,"{}"));return Object[t(858)](o)}closeDB(){return Promise[n(1159)]()}get[n(591)](){return!!this[n(940)]}}function Pi(r,t){let i=n;if(e[i(804)](Ve,Ve))return new ka(r,t);if(e[i(1797)](st,At)&&e[i(1114)](e[i(1262)],typeof indexedDB))return new Aa(r,t);if(e[i(856)](st,At)&&e[i(1114)](e.gXbfV,typeof localStorage))return new Da(r,t);throw new Error(i(1423)+i(1381)+"d")}class Pa{constructor(){let t=n;if(e[t(900)](e[t(1669)],e[t(1669)]))this[t(1487)+t(1342)+"Id"]=null,this[t(1487)+"l"]=36e5,this._qosDB=e[t(1502)](Pi,e[t(594)],e[t(949)]);else return e[t(566)](_0x4460a9,_0x5dc31a)}async[n(1487)+n(976)](){let t=n;e[t(1969)](clearInterval,this[t(1487)+t(1342)+"Id"]),this[t(1487)+t(1342)+"Id"]=e[t(1254)](setInterval,()=>{this[t(777)+"ired"]()},this[t(1487)+"l"])}async[n(1837)](){let t=n;await this[t(940)][t(1837)]()[t(1475)](()=>{let i=t;this[i(1487)+i(976)]()})}async[n(777)+n(722)](){let t=n;(await this[t(940)]?.getAll()||[])[t(1569)](({timestamp:u})=>u<Date[t(1772)]())[t(1099)](u=>{let h=t;this[h(940)]?.[h(1968)](u[h(1033)+"id"])})}async[n(1968)](t){let i=n;if(i(1419)!==i(2036))return this[i(940)]?.[i(1968)](t);_0x40e5cf[_0x1996a6[_0x5b6167][i(1156)+i(1115)]]=_0x50f55d(_0x32a273[_0x9f48fa].cursor_name),_0x5f7074+=e.CnWTA(14,_0x5ddc21[_0x18a774[_0x3455db][i(1156)+i(1115)]])}async[n(1746)](t,i){let o=n;return this._qosDB?.[o(1746)]({message_id:t,timestamp:i})}async[n(1301)](t){let i=n;if(e.RvDmN(e[i(1942)],i(1534)))return this[i(940)]?.get(t);_0x5d57f3=e[i(778)](e[i(961)](7&_0x174f65,18)|e[i(1087)](63&_0x26ba17,12),e[i(1626)](e[i(968)](63,_0x268724),6))|63&_0x1f8221,e.oFfGF(_0x2cbb40,65536)||e.pUBuK(_0x11c459,1114111)?_0x3ce7fd+=_0x44ea40:(_0x3cdf6f-=65536,_0x3bed4b+=e[i(1485)](_0x17a6a1,e[i(564)](_0x1d4a96>>10,55296),e.OpaHA(1023,_0xd5f54f)+56320),_0x3537b0+=3)}async closeDB(){let t=n;e.MDrgo(clearInterval,this["_interva"+t(1342)+"Id"]),await this[t(940)]?.closeDB()}get isReady(){let t=n;return this[t(940)]?.[t(591)]}}function fr(r){let t=n,i=!!this[t(1447)].enableQoS;if(!i)return{enabled:i,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e[t(1232)](Ue,r.message[t(1786)],e[t(962)],"2"),u=o&&Ue(r.message[t(1786)],e.tUroB,"1"),h=o&&e[t(1232)](Ue,r[t(1444)][t(1786)],e[t(1661)],"1"),p=h?e[t(1255)](ot,r[t(1444)][t(1786)],e.BWoSf)?.split(",")[t(1569)](Boolean)||[]:[];return{enabled:i,isQoSMessage:o,isQoSAck:u,isAckCleanupMessage:h,ackMsgIds:p}}async function Ti(){let r=n;if(e[r(1252)]!==e.vACRw)return this[r(1316)+r(1e3)]||(this["_QoSMana"+r(1e3)]=new Pa),this[r(1316)+r(1e3)][r(591)]||await this[r(1316)+r(1e3)][r(1837)](),this[r(1316)+"ger"];if(wfvZsA[r(1103)](_0x317f3a,_0x1309d6)){if(wfvZsA[r(1121)](_0xf47a10,r(1919)))return _0x52d24d[r(1301)](_0x3f3ca8);if(wfvZsA[r(932)](_0x10cec1,wfvZsA.kVeEp))return _0x208d33.objectStoreNames||_0x36736[r(1301)](_0x169c32);if(wfvZsA[r(630)](_0x3014e4,wfvZsA[r(773)]))return _0x2d33e8[r(832)+r(1160)][1]?void 0:_0x58c59c.objectStore(_0xe4b41f[r(832)+r(1160)][0])}return wfvZsA[r(515)](_0x4f93ea,_0x2434e9[_0x57dee0])}async function Ta(r,t){let i=n;if(e.NvsDX===e[i(1066)]){let{enableAutoAck:o}=this[i(1447)],u=e[i(528)](Ue,r[i(1444)][i(1786)],e.YvSDu,"1"),h=Ue(r.message[i(1786)],e[i(787)],"1"),p=fr[i(1894)](this,r);if(o&&u){let{SeqID:g,LogID:d,service:y,LogIDNew:v,method:A}=r[i(1444)];this[i(1733)]({SeqID:g,LogID:d,LogIDNew:v,service:y,method:A,headers:[{key:e.WezNd,value:"1"},{key:e[i(1965)],value:e[i(1768)](v,"")},{key:e[i(1659)],value:"0"}]})}h&&!p[i(1482)]&&this[i(851)+i(1736)+i(1312)](r),t()}else _0x5a1101.frontierJSONP=void 0,_0x4401aa(e[i(923)])}async function Ia(r,t){let i=n;e[i(630)](i(1819),e[i(659)])?(_0x4af405=_0x4d7771[e[i(564)](e[i(1703)](_0x53ad6d,_0x11cc52),1)],_0x4be47d=_0x3c9eb8[e[i(763)](_0x2903f4+_0xb2f667,2)],e[i(1959)](_0x3f018c|e[i(589)](_0x205f76,8),49344)!==32896?_0x5e98f6+=_0x4db948:(_0x464c08=e[i(1128)](e[i(1452)](e[i(853)](15,_0x47766d),12)|e.roLZn(e[i(839)](63,_0x5b09fe),6),e.gCHGz(63,_0x19e5a2)),e.LvdmE(_0x403575,2048)||e.XerRy(_0x4bcd79,55296)&&e[i(658)](_0x35025d,57343)?_0x16930d+=_0x39836f:(_0x5d14ea+=e.XxDWe(_0xf5a0ee,_0x2e2160),_0x31bba4+=2))):(this._debug(i(1343),r[i(1444)]),e[i(1549)](t))}async function Ra(r,t){let i=n,o=fi(await ki(r[i(955)]));try{if(e[i(948)](o.payload,Uint8Array)){if(e[i(1984)]===e.Rstad)return"frontier_"+this[i(1711)];{let u=e[i(1050)](this[i(1447)][i(730)+i(824)],Object)?{force:!!this._options[i(730)+i(824)][i(743)],encoding:this[i(1447)][i(730)+i(824)][i(1378)]?this[i(1447)][i(730)+"ncoding"][i(1378)][i(1399)](/\s/g,"")[i(1409)+"ase"]():""}:{force:!1,encoding:this[i(1447)][i(730)+i(824)]?this._options["payloadE"+i(824)][i(1399)](/\s/g,"")[i(1409)+i(711)]():""},h=o["payloadE"+i(824)]?o.payloadEncoding.replace(/\s/g,"")[i(1409)+i(711)]():"",p=e[i(2034)](this[i(1447)]["payloadT"+i(647)],Object)?{force:!!this[i(1447)].payloadType[i(743)],type:this[i(1447)][i(1788)+i(647)][i(1980)]?this[i(1447)][i(1788)+"ype"].type[i(1399)](/\s/g,"").toLowerCase():""}:{force:!1,type:this[i(1447)].payloadType?this._options[i(1788)+i(647)].replace(/\s/g,"")[i(1409)+i(711)]():""},g=o[i(1788)+i(647)]?o[i(1788)+i(647)][i(1399)](/\s/g,"")[i(1409)+i(711)]():"",d=p[i(743)]?p.type:g||p[i(1980)],y=u[i(743)]?u.encoding:h||u[i(1378)],v=[i(1296)+i(758)+i(1563),e[i(854)],"applicat"+i(1140)+i(1597)+i(1195),i(1884)],A=[e[i(1480)],e[i(1635)]];this[i(1447)][i(1324)+i(1696)+"extPayload"]&&v[i(719)](d)&&(!y||A.includes(y))?o[i(1364)+i(1957)]=Di(o[i(1422)],0,o[i(1422)][i(1649)+"th"]):o[i(1364)+i(1957)]=""}}else o[i(1364)+i(1957)]=""}catch(u){o[i(1364)+i(1957)]="",console[i(1015)](u)}r[i(1444)]=o,e[i(1179)](t)}function Na(r,t,i){let o=n,u={CZoBD:function(y,v){return e[N(1379)](y,v)},tipET:function(y,v){return e[N(638)](y,v)},YsUVo:function(y,v){return e[N(1476)](y,v)},VyZwU:function(y,v){return e[N(1676)](y,v)},nXngk:e[o(1257)],rnYOs:function(y,v){return e[o(1273)](y,v)},BrVBX:function(y,v){return e[o(1193)](y,v)}},h=e[o(965)](i,8192),p=e.RrCBc(h,1),g=null,d=h;return function(y){let v=o;if(u[v(1414)](y,1)||u.tipET(y,p))return u[v(655)](r,y);if(d+y>h){if(u[v(1105)](u[v(1914)],u[v(1914)]))return this._socket.url;g=r(h),d=0}let A=t.call(g,d,d+=y);return u[v(1765)](7,d)&&(d=u[v(1673)](7,d)+1),A}}let La=4294967295;function Oa(r,t,i){let o=n;return e.LILXK(RangeError,e[o(929)](e.lEPAk(e[o(1609)](e[o(1250)](e[o(1395)](e.uEGRy,r),o(1467)),t||1),o(1623)),i))}function Ba(r,t,i){let o=n;if(e[o(581)](i,La))throw new Error(o(1988)+o(806)+"e");let u=3;for(;e[o(576)](u,0);){let h=e[o(1805)](255,i);lr(h,r,e[o(859)](t,u)),i>>>=8,u--}return t+4}function Ma(r,t){let i=n,o=0,u=t,h=e[i(768)](t,4);for(;e[i(1523)](u,h);){let{value:p,offset:g}=e[i(2025)](dr,r,u);u=g,o=e.eEDGe(e.GkMcn(o,8),0),o+=p}return{value:o,offset:h}}function za(r,t,i){let o=n,u=e[o(894)][o(1769)]("|"),h=0;for(;;){switch(u[h++]){case"0":if(!r)return i;continue;case"1":return e[o(1484)](e.Vzbix(cr,r,t,i),i);case"2":if(e[o(1982)](r[o(861)],40))return e[o(1915)](e.yARED(cr,r,t,i),i);continue;case"3":if(t[o(1612)])return e[o(1967)](t[o(1612)](r,i),i);continue;case"4":if(t[o(1351)+"e"])return e.BUrqm(t[o(1351)+"e"](r,i),i);continue}break}}function qa(r,t){let i=n,o=new M(e[i(1877)](e[i(1360)](e.JSBEp(r[e[i(1541)](t,4)],24),r[e[i(928)](t,5)]<<16)|e[i(589)](r[e.wzghz(t,6)],8),r[t+7]),e[i(1094)](e[i(801)](r[e[i(1495)](t,0)]<<24|e[i(1023)](r[e[i(818)](t,1)],16),e[i(598)](r[t+2],8)),r[e[i(1434)](t,3)]),!0);return t+=8,{value:o,offset:e[i(929)](t,8)}}function Ua(r,t,i){let o=n,u=r[o(1956)],h=r[o(1856)];return t[i]=e.SCJDb(h,24),t[e[o(822)](i,1)]=e[o(1056)](e[o(951)](h,16),255),t[e[o(649)](i,2)]=e[o(930)](h,8)&255,t[i+3]=e.WSNCr(255,h),t[i+4]=u>>>24,t[i+5]=e.aFEwJ(e.XTDqA(u,16),255),t[e[o(1082)](i,6)]=e.dwHev(u>>>8,255),t[e[o(2033)](i,7)]=255&u,i+=8,i}function dr(r,t){let i=n;return r[i(610)+"8"]?{value:r[i(610)+"8"](t),offset:e[i(1497)](t,1)}:{value:e[i(1320)](255,r[t]),offset:e[i(1570)](t,1)}}function lr(r,t,i){let o=n;return t.writeUint8?t[o(1086)+"t8"](r,i):t[i]=e.EiyNy(255,r),e[o(1636)](i,1)}let Fa=function(r){return new Uint8Array(r)},Ha=e[n(1262)]!=typeof Buffer?Buffer[n(1357)+n(1083)]:e[n(1162)](Na,Fa,Uint8Array[n(2032)+"e"][n(879)]),Ka=16,hr=32;function ja(r){let t=n,i=0,o={};for(let u=0;e[t(994)](u,r[t(861)]);u++)o[r[u][t(1156)+"ame"]]=Ai(r[u][t(1156)+t(1115)]),i+=14+o[r[u][t(1156)+t(1115)]];return[i,o]}function Ii(r,t,i){let o=n,u={wHfOw:e[o(1603)],WJMOT:function(h,p,g,d){return e[o(1232)](h,p,g,d)},mogmg:e.flUFo,VbVgo:e[o(539)],lyxhz:e[o(946)],cieIJ:function(h,p,g,d){return h(p,g,d)},pAjKP:function(h,p,g,d){return e[o(1279)](h,p,g,d)},uwAfZ:function(h,p,g,d){return h(p,g,d)}};if(e[o(973)]!==e[o(971)]){let[h,p]=e.ZEKGU(ja,r),g=e[o(595)](Ha,h),d=0;return r[o(1099)](y=>{let v=o,A=u.wHfOw[v(1769)]("|"),L=0;for(;;){switch(A[L++]){case"0":console[v(1015)](v(1719),d);continue;case"1":d=u[v(525)](Ua,M[v(1903)+"er"](y[v(1855)]||t),g,d);continue;case"2":console[v(1015)](u[v(1999)],d);continue;case"3":console[v(1015)](u.VbVgo,d);continue;case"4":console.log(u[v(1370)],d);continue;case"5":console[v(1015)](v(1303)+v(1925),d);continue;case"6":d=Ba(g,d,y[v(1801)]||0);continue;case"7":d=u.cieIJ(lr,0,g,d);continue;case"8":d=u[v(1287)](za,y[v(1156)+v(1115)],g,d);continue;case"9":console[v(1015)](v(1652)+v(656),y,y[v(1801)]);continue;case"10":d=u[v(713)](lr,p[y[v(1156)+"ame"]],g,d);continue}break}}),{frameType:hr,headers:[{key:e[o(1071)],value:i}],payload:g}}else wfvZsA[o(1179)](_0xc9968e),_0x2229c8()}function Ga(r){let t=n,i=0,o=[];for(;e[t(1854)](i,r[t(1649)+"th"]);){let{offset:u}=e[t(1405)](dr,r,i);i=u;let h={cursor_name:"",cursor:0,service:0},{value:p,offset:g}=e.ZuxPZ(Ma,r,i);h[t(1801)]=p,i=g;let{value:d,offset:y}=e.zVEUw(dr,r,i);i=y,h.cursor_name=e[t(537)](Di,r,i,e[t(809)](i,d)),i+=d;let{value:v,offset:A}=qa(r,i);h[t(1855)]=v.toNumber(),i=A,o[t(1466)](h)}return o}function Wa(){let r=n;return{frameType:hr,headers:[{key:e[r(1071)],value:r(1599)+r(767)}],payload:void 0}}class Ja{constructor(t,i,o){let u=n;this[u(769)+u(657)]=t,this["_cursorF"+u(1839)]=i,this[u(1561)+u(741)]=o,this._qosDB=e[u(1559)](Pi,this[u(769)+u(657)],e[u(1104)])}async[n(1837)](){let t=n;await this._qosDB[t(1837)]()}async[n(1005)+"rs"](){let t=n;if(!this[t(940)][t(591)])return;let i=this._messageStrategy,o=await this[t(940)].getAll();switch(console.log(e.VPaZy,o),i){case e[t(1451)]:return o&&o[t(861)]?Ii(o,0,this[t(829)+t(1839)]):void 0;case t(1668):return;case e[t(670)]:return o&&o[t(861)]?Ii(o,0,this[t(829)+"ileName"]):e[t(1418)](Wa)}}async[n(1746)](t,i,o){let u=n;return e.etHHJ(e[u(1656)],e[u(1672)])?(console[u(1015)](e[u(1866)],t,i,o),this[u(940)][u(1746)]({cursor_name:t,cursor:i,service:o})):wfvZsA[u(1743)](_0x54eb85,_0x57bbf8[u(1632)](_0x495036(this),_0x433e0e))}async[n(742)+"rs"](t){let i=n,o=e[i(503)](Ga,t);for(let u of o){if(e[i(1582)]!==i(1870))return!!this[i(940)];console.log(e.eSYvB,o),await this[i(940)][i(1746)](u)}}async get(t){let i=n,o={mgLFt:i(1131)+i(1010)+"t"};if(e[i(918)](e[i(1710)],"DKBrZ"))return(await this[i(940)][i(1301)](t))?.[i(1855)];_0x843b12(i(1763)),this[i(1683)]("ping_once_success",_0x37e7ec),this[i(1683)](o.mgLFt,_0x5526aa)}async[n(2019)](){let t=n;await this[t(940)][t(2019)]()}[n(2012)+n(1519)+n(1601)](t){let i=n;this[i(829)+i(1839)]=t}get[n(591)](){let t=n;return this[t(940)][t(591)]}}let Va=e.KLCap;async function Ri(r){let t=n;if(!this[t(1447)][t(1063)+"S"])return null;let{aID:i,fpID:o,messageStrategy:u}=this[t(1447)],h=e[t(1125)](r,Va);try{return this[t(1791)+t(1748)]?r&&this["_cursorM"+t(1748)]["updateCursorFile"+t(1601)](r):this["_cursorM"+t(1748)]=new Ja(o+"_"+i+"_"+h,h,u),this["_cursorM"+t(1748)][t(591)]||await this[t(1791)+t(1748)].openDB(),this[t(1791)+t(1748)]}catch{return null}}async function Ya(r,t){let i=n,o={iXPCU:function(T,O,j){return e.cSWtQ(T,O,j)},NDDNp:e.HetJG},u=Ue(r.message[i(1786)],e[i(1546)],"-1"),h=e[i(528)](Ue,r[i(1444)][i(1786)],e[i(787)],"1"),p=e[i(571)](ot,r[i(1444)].headers,e[i(1971)]),g=e.LUhjl(Number,e.cczYM(ot,r.message[i(1786)],i(1329)+i(1562)))||0,d=fr.call(this,r),y=e[i(1232)](Ue,r[i(1444)][i(1786)],e.nHZLf,"2"),v=ot(r[i(1444)][i(1786)],e[i(1074)]),A=e[i(515)](Number,e[i(1783)](ot,r[i(1444)][i(1786)],i(1723)+i(1647)+"ue"));if(d.isQoSAck)return e.wQqxF(t);let L=d[i(1274)+"sage"]?await Ti[i(1894)](this):null;if(e[i(1592)](r[i(1444)][i(1801)],0)&&h&&!u||e[i(891)](r[i(1444)][i(1801)],0))if(e[i(1365)](i(1186),e[i(1138)]))this[i(769)+"ameSpace"]=_0x4bdce4,this[i(829)+"ileName"]=_0x4efe40,this["_message"+i(741)]=_0x49c2df,this._qosDB=pBDEIF[i(1642)](_0x44cc1d,this[i(769)+"ameSpace"],pBDEIF[i(1046)]);else{if(p&&d[i(1274)+"sage"]&&L)return!!!await L[i(1301)](p)&&(this[i(851)+i(1841)+"Event"](r),await L[i(1746)](p,e[i(1760)](Date[i(1772)](),g))),t();if(y){let T=await Ri[i(1894)](this);if(!T)return this["_dispatc"+i(1841)+i(857)](r),e[i(1606)](t);let O=await T[i(1301)](v)??-1;if(e[i(573)](O,A))this["_dispatchMessage"+i(857)](r),T[i(1746)](v,A,r[i(1444)].service);else throw new Error(i(1881)+" message"+i(1151)+A+(i(845)+"than loc"+i(837)+"r ")+O);return e[i(1418)](t)}return this[i(851)+i(1841)+"Event"](r),e.FmDgX(t)}}async function Za(r,t){let i=n,o=fr[i(1894)](this,r);if(!o[i(1274)+i(699)])return t();let u=await Ti.call(this);if(o["isAckCleanupMess"+i(724)]&&o.ackMsgIds.length)for(let h of o[i(1039)+"s"])await u[i(1968)](h);e[i(792)](t)}async function $a(r,t){let i=n,o=e[i(998)](r[i(1444)][i(1309)+"e"],Ka),u=e[i(1997)](r.message.frameType,hr);if(!o&&!u)return t();let h=ot(r.message[i(1786)],i(1331)+"ile_name");if(!h)return e.VJVYP(t);let p=await Ri.call(this,h);if(!p)return e[i(1811)](t);if(o){let g=await p[i(1005)+"rs"](),d={frameType:g?.["frameType"],SeqID:M[i(1903)+"er"](this[i(676)]++),LogID:M[i(1903)+"er"](this[i(1447)][i(2023)+i(620)]()),service:9e3,method:5,headers:g?.headers,payload:g?.payload},y=e.zwDbw(S,d);this[i(1078)]&&this[i(1078)][i(1503)+"te"]&&this[i(1078)][i(1400)](y)}if(u){let g=r[i(1444)][i(1422)];g&&p.setCursors(g)}}let Xa=async function(r,t){let i=n;this[i(1979)]=!1,e[i(1743)](clearTimeout,this[i(531)+i(1628)+"utId"]),e[i(1506)](t)},Qa=async function(r,t){let i=n;if(!this[i(1078)]||e[i(574)](this[i(1078)].readyState,this.OPEN))return e[i(1545)](t);let{pingInterval:o}=this._options;this["_endpoin"+i(759)]?.["resetEnd"+i(862)+i(1290)]();for(let h=0;e[i(970)](h,this["_message"+i(1065)][i(861)]);h++)if(e[i(1488)](e[i(1040)],e[i(1040)])){let p=this["_message"+i(1065)][h];if(this._ws.readyState===this.OPEN&&e[i(1365)](null,p))this._ws&&this[i(1078)][i(1400)](p),this[i(1561)+i(1065)][h]=null;else break}else{let p=this[i(1263)+"tManager"]?.[i(1780)+i(989)+"nt"]();this[i(1572)](i(721)+p),e.iIoeG(_0xced9b0)}this["_message"+i(1065)]=this["_message"+i(1065)].filter(h=>!!h),this[i(840)+i(1067)+"Id"]=e[i(1727)](setTimeout,()=>this[i(1169)](),o),this[i(851)+i(1219)+"nt"](r),this._isBrowser&&this[i(1078)]&&(this._ws[i(1469)+"pe"]=this[i(1369)+i(647)]);let u=this[i(1263)+i(759)]?.[i(1780)+i(989)+"nt"]();this[i(1572)](i(721)+u+i(1961)),e[i(792)](t)},e0=async function(r,t){let i=n,o=this["_endpoin"+i(759)]?.getCurrentEndpoint();this[i(1572)](i(721)+o),t()};class t0 extends xr{constructor(t){let i=n,o={dtSVE:function(g,d,y){return e.ukQVs(g,d,y)},mHHcY:e[i(1426)],MruqT:function(g,d){return e[i(1323)](g,d)},rlTNC:e[i(1883)],zfQgh:function(g,d){return e[i(920)](g,d)},MjHkT:function(g,d){return e[i(1059)](g,d)},hhwev:i(1627),HiHdE:function(g,d,y){return e.XhDnJ(g,d,y)},AoyjC:function(g,d){return e[i(900)](g,d)}};super(),this[i(1321)+"igatorOn"+i(1256)]=!0,this[i(1251)+"er"]=st,this._isNode=ma,this[i(1298)+"T"]=Ve,this[i(1036)+"X"]=Ct,this[i(1391)+"r"]=At,this["_message"+i(1065)]=[],this["_endpoin"+i(759)]=null,this[i(1947)+"osed"]=!1,this[i(1369)+i(647)]=e[i(1675)],this["_connect"+i(1714)]=!1,this[i(531)+i(1628)+"utId"]=null,this[i(890)+i(1123)+i(980)]=null,this[i(840)+"gTimeoutId"]=null,this[i(676)]=0,this[i(1979)]=!1,this._url="",this[i(1316)+i(1e3)]=null,this[i(1791)+i(1748)]=null,this[i(1766)+i(1913)]=null,this._protocols=e[i(1637)],this.CLOSED=3,this.CONNECTING=0,this.OPEN=1,this[i(984)]=2,this[i(1644)]=g=>{let d=i;try{Ci(this,g,[Xa,Qa,e0])}catch(y){let v=o[d(1949)](de,o[d(1756)],{message:y[d(1444)],code:qe[d(1384)+"OR"],error:y});this[d(851)+d(1294)+"ent"](v)}},this[i(1929)+"ge"]=async g=>{let d=i;if(e[d(1568)](d(510),e[d(917)]))return new _0x2c54c1(_0x42a899,{message:_0x39d885});{let{pingInterval:y,pingFrequency:v}=this[d(1447)];if((e[d(1035)]("hi",g[d(955)])&&e.zJoIX(e[d(1531)],v)||e[d(1794)]===v)&&(this[d(2011)+"ngTimer"](),this[d(997)](e[d(876)],e[d(1264)]),this[d(840)+d(1067)+"Id"]=e.ThmhR(setTimeout,this[d(1169)].bind(this),y)),g.data==="hi")return;try{e[d(1590)](Ci,this,g,[Ra,Ta,Za,$a,Ya,Ia])}catch(A){if(e[d(1119)](d(575),"OxHvy")){let L=e[d(1935)](de,e[d(1426)],{message:A[d(1444)],code:qe[d(1020)+d(723)],error:A});this[d(851)+d(1294)+d(2001)](L)}else{let L=_0x2512a5[d(1444)].payload;L&&_0x5ae568[d(742)+"rs"](L)}}}},this[i(848)]=g=>{let d=i,y={Vofsf:function(v,A){return o[N(1305)](v,A)},qfOZH:o[d(1225)],hORDf:function(v,A){return o[d(1146)](v,A)},NjRSX:function(v,A){return o.MjHkT(v,A)}};if(o[d(1761)]!==o[d(1761)]){if(PKOgiT[d(1860)](_0x5bfa91,_0x4f7e26))throw new _0x5b772b(PKOgiT[d(1107)]);let v=3;for(;PKOgiT[d(1721)](v,0);){let A=255&_0x4e5d49;_0x5b9da4(A,_0x4d5149,_0x2a638c+v),_0x2cb479>>>=8,v--}return PKOgiT[d(1975)](_0xd196f9,4)}else{let v=this[d(1263)+"tManager"]?.[d(1739)+d(1377)+"es"](),A=this[d(1263)+"tManager"]?.[d(1780)+"ntEndpoint"]();if(v&&!g[d(1444)]){let L=d(1598)+A+(d(726)+d(1491)+d(609)+"ed");this._dispatchErrorEvent(o[d(1580)](de,o.mHHcY,{message:L,code:qe[d(1671)+"IES_ERROR"],error:g}));return}this[d(1078)]&&o[d(1577)](this[d(1078)][d(1503)+"te"],this[d(1383)])&&this._disconnect(),this["_dispatc"+d(1294)+"ent"](de(o.mHHcY,{message:g[d(1444)],code:qe[d(1713)+"RROR"],error:g}))}},this[i(1009)]=async g=>{let d=i;this[d(1499)+d(2e3)](),this["_clearPi"+d(781)](),this._removeWsListeners(),this[d(1078)]=null,this[d(531)+d(1714)]=!1;let y=this[d(1263)+d(759)]?.[d(1739)+d(1377)+"es"]();if(!y&&this["_navigat"+d(1326)]()&&!this[d(1947)+d(1808)])if(e[d(1620)]!==e[d(1620)])this[d(940)]?.[d(1968)](_0x3dfd95[d(1033)+"id"]);else{let v=this[d(1263)+d(759)]?.[d(1780)+"ntEndpoint"](),A=this[d(1447)][d(1511)+d(1393)+d(814)](g.code,g[d(1090)]);this["_dispatc"+d(1578)+d(2001)](e[d(2025)](pe,"close",{code:1006,reason:g.reason||d(546)+d(1092)+d(1762)+d(1946)+d(1651)+d(725)+v,willReconnect:A})),A&&this[d(531)]();return}if(e[d(1454)](1e3,g[d(2017)])&&this[d(1947)+d(1808)]){this[d(851)+"hCloseEvent"](pe(e.aSiiU,{code:1e3,reason:e.EPGXC})),this[d(1263)+d(759)]?.["resetEnd"+d(862)+d(1290)](),this[d(1766)+d(1913)]?.[d(1440)+d(791)]();return}if(e.mfNZZ(1e3,g[d(2017)])&&y)if(e[d(925)](e.xRDlj,e[d(1905)])){let v=this[d(1263)+d(759)]?.[d(1780)+"ntEndpoint"](),A=g[d(1090)];A||(A=await e[d(1446)](Ea,this[d(1175)])),A=d(546)+d(1092)+d(1079)+A+(d(831)+d(1238))+v+(d(2004)+"tries re"+d(1363)),this[d(851)+d(1578)+d(2001)](e[d(878)](pe,e[d(863)],{code:g[d(2017)],reason:A}));let L=d(1598)+v+(" fail, max retri"+d(609)+"ed");this[d(851)+d(1294)+d(2001)](de(e[d(1426)],{message:L,code:qe[d(1671)+d(838)+"R"]})),this[d(1263)+d(759)]?.[d(1188)+d(862)+d(1290)](),this[d(1766)+d(1913)]?.[d(1440)+d(791)]();return}else return _0x428b23;if(e[d(631)](1e3,g.code)&&!g.reason){let v=this[d(1263)+d(759)]?.[d(1780)+d(989)+"nt"]();this[d(851)+d(1578)+d(2001)](e[d(1722)](pe,e[d(863)],{code:g.code,reason:d(546)+d(1092)+"d, unkno"+d(1946)+d(1651)+"ame: "+v})),this[d(1263)+d(759)]?.[d(1188)+d(862)+"fig"](),this[d(1766)+d(1913)]?.[d(1440)+d(791)]();return}this["_dispatc"+d(1578)+d(2001)](g),this[d(1263)+d(759)]?.[d(1188)+d(862)+d(1290)](),this[d(1766)+d(1913)]?.[d(1440)+d(791)]()},this[i(653)]=null,this[i(1591)]=null,this.onmessage=null,this.onopen=null,this["onStartR"+i(947)]=null,this["onReceiv"+i(1386)]=null,this[i(650)+i(1206)+i(747)+"ct"]=null,this["_handleO"+i(1247)]=this[i(1662)+i(1247)][i(1917)](this),this[i(1662)+"ffLine"]=this[i(1662)+"ffLine"][i(1917)](this),this[i(1022)+"ageHide"]=this[i(1022)+"ageHide"][i(1917)](this),this[i(1022)+i(902)]=this[i(1022)+"ageShow"][i(1917)](this),this[i(1447)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:e.enoYV(1,0),service:0,logIDGenerator:x,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:i(1037),pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:i(1832),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:u,ws:h}=t,p=Array[i(1473)](u)?u:e.OImMI(i(1884),typeof u)?[u]:[];if(!p||e[i(1517)](0,p[i(861)]))throw new Error(e[i(527)]);if(!e[i(1096)](ya,h))throw new Error(e[i(1950)]);Object[i(1804)](this[i(1447)],t),this["_endpoin"+i(759)]=new Ei(p,this[i(1447)].maxRetries),this._pingLossCounter=new Sa(this[i(1447)][i(1778)+"Count"]),this._options[i(1878)+i(880)]&&(this[i(1979)]=!0,this[i(531)]()),this[i(1447)][i(682)+i(2021)+i(1144)]&&(this[i(1298)+"T"]||this[i(1036)+"X"]?this[i(1621)+i(1617)+i(1586)]():this[i(1251)+"er"]&&this[i(1130)+"balEvent"+i(754)]())}[n(1662)+"nLine"](){let t=n;if(e.JGFOy(e[t(819)],e.PRebP)){if(this[t(1447)][t(1472)+"utoRecon"+t(842)]||this[t(1947)+t(1808)])return;this[t(1430)+t(947)]()}else try{return!!this[t(940)]}catch(i){return _0xe5050b[t(1015)](i),!1}}[n(1662)+"ffLine"](){let t=n;this[t(1014)+t(1258)+"t"]();let i=e[t(1101)](ar,e[t(1043)],{message:t(1940)+t(1744)+t(1147)+"ct"});this[t(650)+t(1206)+t(747)+"ct"]&&this[t(650)+"mediatel"+t(747)+"ct"](i)}[n(1130)+n(1390)+n(754)](){let t=n;this[t(1251)+"er"]&&window[t(1337)+"Listener"]("online",this[t(1662)+t(1247)]),this[t(1251)+"er"]&&window.addEventListener(t(1111),this[t(1662)+t(1853)]),this._isBrowser&&window[t(1337)+t(754)](e[t(1118)],this[t(1022)+"ageHide"]),this[t(1251)+"er"]&&window[t(1337)+t(754)](e.QRgTP,this[t(1022)+"ageShow"])}["_dropGlo"+n(1390)+n(754)](){let t=n;this._isBrowser&&window[t(1741)+t(1110)+"ner"](e[t(1890)],this[t(1662)+t(1247)]),this[t(1251)+"er"]&&window[t(1741)+t(1110)+t(1465)](t(1111),this[t(1662)+"ffLine"]),this[t(1251)+"er"]&&window["removeEv"+t(1110)+t(1465)]("pagehide",this._handlePageHide),this[t(1251)+"er"]&&window[t(1741)+t(1110)+t(1465)](e.QRgTP,this._handlePageShow)}[n(1022)+n(585)](t){let i=n;!t[i(936)+"d"]&&(this._isBrowser&&window[i(1741)+i(1110)+i(1465)](i(909),this[i(1022)+i(585)]),this._isBrowser&&window[i(1741)+i(1110)+"ner"](e[i(1141)],this[i(1022)+i(902)]),this[i(1203)]()),this[i(1251)+"er"]&&window[i(1741)+"entListe"+i(1465)](e[i(1890)],this[i(1662)+"nLine"]),this[i(1251)+"er"]&&window[i(1741)+i(1110)+i(1465)](e[i(934)],this[i(1662)+i(1853)])}[n(1022)+n(902)](t){let i=n;if(e[i(932)](e[i(679)],e[i(700)])){let o=this[i(940)][i(1847)+i(888)+"nc"](this[i(1516)]),u=_0x1eafa5[i(1117)](o||"{}");return _0xac8c72[i(858)](u)}else t[i(936)+"d"]&&(this[i(776)+i(1326)]()&&(!this[i(1078)]||e[i(1535)](this[i(1078)].readyState,this.OPEN)||e.zFFtr(this[i(1078)][i(1503)+"te"],this[i(901)+"NG"]))&&this[i(1662)+i(1247)](),this._isBrowser&&window[i(1337)+i(754)](e[i(1890)],this["_handleO"+i(1247)]),this[i(1251)+"er"]&&window[i(1337)+i(754)](e[i(934)],this[i(1662)+i(1853)]))}async["_generat"+n(1707)](t){let i=n,{fpID:o,deviceID:u,bddID:h,ttwID:p,accessKey:g,aID:d,customParams:y={},enableAutoAck:v,enableQoS:A,QoSLevel:L,env:T}=this[i(1447)],O,j,xe;this._isBrowser||this[i(1036)+"X"]||this[i(1298)+"T"]?(O=location&&e[i(1514)](e[i(642)],location[i(1684)])?e[i(615)]:"ws://",j=t[i(1399)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),xe=/^wss(.*:\/\/)/[i(1726)](t)?t:""+O+j):(O=e[i(615)],j=t[i(1399)](/(^http)((?:[s]*:\/\/))/,""),xe=/(^ws)((?:[s]*:\/\/))/[i(1726)](j)?j:""+O+j);let at=h?e[i(1595)]:p?e.URpaK:e[i(1291)],Ni=h||p||u;if(!Ni||!at)throw new Error(e.Niiry);let n0=e[i(1514)](e[i(1764)],typeof y)?await e.xjCLt(y):y,r0=T?e[i(1210)](ba,T[i(1413)],T[i(1750)]):{},gr=Object[i(1804)]({device_platform:e[i(793)],version_code:e[i(1820)],access_key:g,fpid:o,aid:d,[at]:Ni,xsack:v?1:0,xaack:v?1:0,xsqos:A?1:0,qos_level:A?L:void 0,qos_sdk_version:2,...r0},n0),i0=Object[i(805)](gr).reduce((pr,mr)=>gr[mr]!==void 0?""+pr+(pr?"&":"?")+mr+"="+gr[mr]:pr,"");return xe+i(991)+i0}async[n(531)](){let t=n;if(!(this[t(531)+"Lock"]||this._readyClosed)){this[t(531)+t(1714)]=!0;try{if(e.LPyIn(t(873),e[t(1996)])){let i=this[t(1263)+t(759)]?.[t(568)+t(533)+"ointReac"+t(1928)+t(1720)](),{timeoutInterval:o}=this[t(1447)];if(i){let h=this["_endpoin"+t(759)]?.[t(1780)+"ntEndpoint"](),p=this[t(1263)+t(759)]?.["replaceBackupEnd"+t(623)+"UpdateCount"](),g=this[t(1263)+t(759)]?.[t(1780)+"ntEndpoi"+t(660)+t(1522)]();if(p){let d=t(1598)+h+(t(817)+t(2004)+t(1407)+t(1280)+t(1944)+t(1976)+t(1122))+p+(t(1275)+"y"),y=e[t(983)](de,t(780),{message:d,code:qe[t(1671)+t(838)+"R"]});this[t(1572)](d),this["_dispatc"+t(1294)+t(2001)](y),this._url=await this[t(662)+"eUrl"](p),this[t(1572)]("connect "+p+" "+g+" times"),this[t(1052)+"sListeners"]()}else{let d=t(1598)+h+(" timeout"+t(2004)+"tries re"+t(1363));this[t(1572)](d),this["_dispatc"+t(1294)+t(2001)](de(e[t(1426)],{message:d,code:qe.MAX_RETRIES_ERROR}));return}}else{let h=this[t(1263)+t(759)]?.["getCurre"+t(989)+t(1053)+t(542)](),p=this["_endpoin"+t(759)]?.[t(1780)+t(989)+t(660)+t(1522)]();this[t(1175)]=await this[t(662)+t(1707)](h||""),this[t(1572)](t(1598)+h+" "+p+t(1236)),this[t(1052)+t(1076)+"rs"]()}if(this[t(1979)])this[t(1979)]=!1;else{let h=e[t(1306)](ar,t(1511)+"t",{message:e[t(1789)]});this[t(757)+"econnect"]&&this[t(757)+t(947)](h)}let u=this[t(1263)+t(759)]?.[t(1780)+"ntEndpoi"+t(660)+t(1522)]()||0;u>1&&await this[t(1244)](u-1),this[t(1572)](t(546)+"ng url: "+this[t(1175)]+(t(1902)+t(1493))+this[t(651)+"ls"]),this._ws=e[t(1682)](_a,{url:this[t(1175)],protocols:[this[t(651)+"ls"]],headers:this[t(1447)][t(1851)+t(520)+"s"][t(1431)+t(1202)]},this[t(1447)].ws),(this._isBrowser||this[t(1391)+"r"])&&this._ws&&(this[t(1078)][t(1469)+"pe"]=this[t(1369)+t(647)]),this[t(1933)+t(1392)](),this[t(531)+t(1628)+t(728)]=e.OvgDJ(setTimeout,this[t(746)+"ut"][t(1917)](this),o)}else _0xa054cf[t(686)][t(715)+t(1176)](_0x1342cb),_0x4e0f29[t(1897)+t(996)]=void 0,e.mNxgV(_0x187502,_0x57f7ca&&_0x195a2f[t(1139)]||e[t(923)])}catch(i){throw this[t(531)+t(1714)]=!1,i}}}_clearTimer(){let t=n;e[t(1838)](clearTimeout,this[t(531)+t(1628)+t(728)]),this[t(531)+t(1628)+t(728)]=null}[n(2011)+n(781)](){let t=n;e[t(1333)](clearTimeout,this["_pingPon"+t(1067)+"Id"]),e[t(751)](clearTimeout,this[t(890)+t(1123)+t(980)]),this[t(840)+t(1067)+"Id"]=null,this[t(890)+t(1123)+"tId"]=null}_debug(...t){let i=n;this[i(1447)][i(1490)]&&console[i(1015)][i(1632)](console,[e[i(1093)],...t])}["_getInte"+n(1064)+"e"](t){let i=n,{initReconnectInterval:o,maxReconnectInterval:u,reconnectIntervalGrowFactor:h}=this[i(1447)],p=o*Math[i(1776)](h,e.hzDlC(t,1));return e[i(1323)](p,u)?u:p}_ping(){let t=n;if(this[t(1078)]&&e[t(1517)](this[t(1078)][t(1503)+"te"],this.CONNECTING)){this[t(2011)+t(781)](),this[t(840)+t(1067)+"Id"]=e[t(1485)](setTimeout,this._ping[t(1917)](this),this[t(1447)][t(673)+t(883)]);return}if(!this._ws||e[t(1544)](this._ws[t(1503)+"te"],this[t(1383)]))return void this[t(1430)+t(947)]();this._ws&&this._ws[t(1400)]("hi"),this[t(890)+t(1123)+t(980)]=e[t(1682)](setTimeout,this[t(1430)+t(947)+t(1134)][t(1917)](this),this._options[t(628)+t(1336)+"val"])}[n(1430)+n(947)+n(1134)](){let t=n;this[t(1766)+"sCounter"]?.[t(1024)](),this[t(997)](e[t(1836)],t(1814)),this[t(1766)+t(1913)]?.[t(1739)+t(1624)+"nt"]()?this["_handleR"+t(947)]():this[t(1169)]()}["_navigat"+n(1326)](){let t=n;return this[t(1298)+"T"]||this[t(1036)+"X"]?this[t(1321)+t(599)+t(1256)]:(this[t(1251)+"er"]||this[t(1391)+"r"])&&this[t(1447)]["listenNe"+t(2021)+"nged"]?navigator[t(1397)]:!0}[n(1430)+"econnect"](){let t=n;!this[t(776)+"orOnline"]()||this[t(1947)+t(1808)]||(this._endpointManager?.[t(1188)+t(862)+t(1290)](),this[t(1766)+t(1913)]?.[t(1440)+t(791)](),this._ws?this[t(969)+t(1639)](1001,e[t(1927)],!0):this[t(531)]())}[n(1621)+n(1617)+"ange"](){let t=n;this[t(1298)+"T"]?tt[t(866)+t(1367)+t(1524)](({isConnected:i})=>{let o=t;this[o(1321)+o(599)+o(1256)]=i,i?this[o(1662)+o(1247)]():this["_handleO"+o(1853)]()}):this._isMiniWX&&wx["onNetwor"+t(1367)+t(1524)](({isConnected:i})=>{let o=t;this[o(1321)+o(599)+"line"]=i,i?this[o(1662)+o(1247)]():this["_handleO"+o(1853)]()})}[n(1244)](t){return new Promise(i=>{setTimeout(i,this["_getInte"+N(1064)+"e"](t))})}[n(969)+n(1639)](t=1e3,i="",o=!1){let u=n;this[u(1078)]&&this[u(1014)+u(1258)+"t"](t,i,o)}[n(746)+"ut"](){let t=n,i=this[t(1263)+t(759)]?.getCurrentEndpoint();this[t(1572)](t(1598)+i+" timeout"),this["_disconn"+t(1639)](1001,e.wbmCJ,!0)}[n(1733)](t){let i=n,o=e[i(605)](or,t);this[i(1078)]&&e.oJONb(this[i(1078)][i(1503)+"te"],this[i(1383)])&&(this[i(1078)]&&this._ws[i(1400)](o),this._debug(e[i(941)],t))}[n(1052)+n(1076)+"rs"](){let t=n,i=e[t(1089)][t(1769)]("|"),o=0;for(;;){switch(i[o++]){case"0":this[t(1078)]["removeEv"+t(1110)+"ner"](e[t(1018)],this[t(1929)+"ge"]);continue;case"1":this[t(1078)][t(1741)+t(1110)+t(1465)](t(780),this._onError);continue;case"2":this[t(1078)][t(1741)+t(1110)+t(1465)](e[t(1481)],this[t(1644)]);continue;case"3":this[t(1078)][t(1741)+t(1110)+"ner"](e[t(863)],this._onClose);continue;case"4":if(!this[t(1078)])return;continue}break}}[n(1933)+"steners"](){let t=n,i=e.CwLAc[t(1769)]("|"),o=0;for(;;){switch(i[o++]){case"0":this[t(1078)][t(1337)+t(754)](e[t(1018)],this[t(1929)+"ge"]);continue;case"1":this[t(1078)][t(1337)+t(754)](t(1300),this[t(1644)]);continue;case"2":this[t(1078)][t(1337)+t(754)](e[t(863)],this[t(1009)]);continue;case"3":this[t(1078)][t(1337)+"Listener"](e[t(1426)],this[t(848)]);continue;case"4":if(!this._ws)return;continue}break}}[n(734)+n(654)](t=1e3,i=""){let o=n;try{this[o(1078)]&&this[o(1078)].close(t,i)}catch{}}[n(1014)+n(1258)+"t"](t=1e3,i="",o=!1){let u=n,h={ikLMk:function(p,g){return e[N(1152)](p,g)}};if(this["_clearPi"+u(781)](),this[u(1499)+u(2e3)](),this[u(1052)+u(1076)+"rs"](),this[u(734)+u(654)](1e3,i),this[u(531)+u(1714)]=!1,o&&this[u(776)+"orOnline"]()&&!this[u(1947)+"osed"]){if(e[u(982)](e[u(1585)],"RPKWZ"))return _0x36b59c&&(_0xe1db54=(0,_0x9891ce[VwvhXJ.ikLMk(_0x266f10,_0x5765af)[0]])(_0x5145ae=0)),_0x6c4346;if(this[u(1263)+u(759)]?.[u(1739)+u(1377)+"es"]()){let g=this[u(1263)+u(759)]?.[u(1780)+u(989)+"nt"]();this["_dispatc"+u(1578)+u(2001)](e[u(571)](pe,e.aSiiU,{code:1006,reason:u(1598)+g+(" timeout"+u(2004)+u(1407)+"ached"),wasClean:!0}))}else{let g=this[u(1447)]["reconnec"+u(1393)+u(814)](t,i);this["_dispatchCloseEv"+u(2001)](pe(e[u(863)],{code:t,reason:i,wasClean:!0,willReconnect:g})),g&&this[u(531)]()}return}this[u(776)+"orOnline"]()||this[u(1947)+"osed"]?this[u(851)+u(1578)+u(2001)](pe(e[u(863)],{code:t,reason:e[u(2022)]})):this[u(851)+"hCloseEv"+u(2001)](pe("close",{code:1006,reason:e[u(1931)]})),this[u(1078)]=null,this["_endpoin"+u(759)]?.[u(1188)+"pointCon"+u(1290)](),this["_pingLos"+u(1913)]?.["resetCou"+u(791)]()}[n(851)+n(1219)+"nt"](t){let i=n;this[i(997)](e[i(1481)],t),this[i(1199)]&&this.onopen(t)}[n(851)+n(1841)+n(857)](t){let i=n;this[i(997)](e[i(1018)],t),this[i(1292)+"e"]&&this[i(1292)+"e"](t)}[n(851)+n(1736)+n(1312)](t){let i=n;this[i(997)](e[i(708)],t),this[i(1589)+"eAck"]&&this["onReceiv"+i(1386)](t)}[n(851)+n(1294)+"ent"](t){let i=n;i(1520)===e[i(1350)]?(this.emit(e[i(1426)],t),this[i(1591)]&&this[i(1591)](t)):(_0x4bcb0f=e[i(1960)](_0x4541be,_0x11b283),_0x2c8861|=e[i(770)](127&_0x4ea3db,21),128&_0x1e2f2b&&(_0x38059c=e[i(1476)](_0x57bcff,_0x5d8a0e),_0x5dceb4=e[i(1460)](127,_0x4722c9),e[i(1829)](128,_0x3f96ee)&&(_0x100a88=e[i(1554)](_0xd2cd2c,_0x504ee0),_0x4eeb51|=e[i(1011)](127&_0x6950f1,7))))}[n(851)+"hCloseEvent"](t){let i=n;this[i(997)](e[i(863)],t),this[i(653)]&&this.onclose(t)}get[n(1469)+"pe"](){let t=n;return this._ws?this[t(1078)][t(1469)+"pe"]:this[t(1369)+t(647)]}set[n(1469)+"pe"](t){let i=n;this[i(1369)+"ype"]=t,this[i(1078)]&&(this[i(1078)][i(1469)+"pe"]=t)}get retryCount(){let t=n;return this[t(1263)+t(759)]?.[t(1780)+"ntEndpoi"+t(660)+t(1522)]()||0}get[n(774)+n(1848)](){let t=n;if(e.PEHVl(e[t(881)],"xToSY")){let i=this[t(1561)+"Queue"][t(1934)]((o,u)=>(o+=u&&u[t(1649)+"th"]||0,o),0);return e[t(1253)](i,this[t(1078)]?this._ws[t(774)+t(1848)]:0)}else return this[t(1031)][t(1684)]}get[n(1828)+"ns"](){let t=n;return this[t(1078)]?this[t(1078)][t(1828)+"ns"]:""}get protocol(){let t=n,i={cVfng:t(780),NSiHF:function(o,u,h){return e[t(1958)](o,u,h)}};if(e.lOpJi(e[t(988)],e[t(1427)]))return this[t(1078)]?this[t(1078)][t(1684)]:"";{let o=_0x31ad2e[t(516)][t(637)](_0x3c5760[t(1533)+"et"],e[t(1609)](_0x304a1a[t(1649)+"th"],_0x1dcc62[t(1533)+"et"]));this[t(1031)]&&this[t(1031)].send({data:o,fail:u=>{let h=t;this.emit(vceaWS[h(729)],vceaWS[h(1901)](_0x2fb803,vceaWS[h(729)],{message:this[h(922)+h(815)+"age"](u)}))}})}}get[n(1503)+"te"](){let t=n;return this[t(1078)]?this._ws[t(1503)+"te"]:this[t(1447)]["automati"+t(880)]?this[t(901)+"NG"]:this.CLOSED}get url(){return this[n(1078)]?this._ws.url:this._url}close(t=1e3,i){let o=n,u=("3|6|0|7|"+o(1954))[o(1769)]("|"),h=0;for(;;){switch(u[h++]){case"0":this[o(2011)+o(781)]();continue;case"1":if(!this[o(1078)])return void this[o(1572)]("close, w"+o(835)+o(1571)+"nitialized");continue;case"2":this[o(1014)+o(1258)+"t"](t,i);continue;case"3":this["_readyCl"+o(1808)]=!0;continue;case"4":this[o(1316)+o(1e3)]?.[o(2019)]();continue;case"5":if(e[o(1809)](this[o(1078)][o(1503)+"te"],this[o(886)])||e.sVbIn(this[o(1078)][o(1503)+"te"],this[o(984)]))return void this[o(1572)](e[o(1757)]);continue;case"6":this["_clearTi"+o(2e3)]();continue;case"7":this[o(964)+o(1390)+"Listener"]();continue}break}}async[n(1400)](t,i){let o=n;if(e[o(1514)](null,t))throw new Error(e[o(1080)]);e[o(1514)](e[o(1920)],typeof t)&&(t=JSON[o(1998)+"y"](t)),e[o(558)](e[o(1181)],typeof t)&&!e[o(1191)](t,ArrayBuffer)&&!(t[o(516)]&&e.UvBbm(t[o(516)],ArrayBuffer))&&(t=JSON.stringify(t));let u=await e[o(1731)](ki,t),h=e.PADxo(va,t),{method:p=0,service:g=this[o(1447)].service,logID:d=this._options[o(2023)+"erator"](),headers:y=this[o(1447)][o(1786)],payloadEncoding:v=this[o(1447)][o(730)+o(824)],payloadType:A=this._options[o(1788)+o(647)],logIDNew:L=this[o(1447)][o(529)+"Config"][o(1504)+o(869)+o(1091)+"ew"]?e[o(1382)](a,this[o(1447)][o(529)+o(1387)][o(1758)]):""}=e[o(1366)](i,{});if(!g)throw new Error(e[o(639)]);let T={SeqID:M[o(1903)+"er"](this._seqId++),LogID:M[o(1903)+"er"](d),service:g,method:p,headers:y,payloadEncoding:v instanceof Object?v[o(1378)]?v.encoding:"":v,payloadType:e[o(882)](A,Object)?A[o(1980)]?A[o(1980)]:h:A||h,payload:u,LogIDNew:L},O=e.yEmVH(or,T);return this._ws&&this[o(1078)][o(1503)+"te"]===this[o(1383)]?(this[o(1078)]&&this[o(1078)][o(1400)](O),this._debug(e[o(1677)],T)):e[o(994)](this[o(1561)+o(1065)][o(861)],this[o(1447)][o(669)+o(1267)+o(621)])?(this[o(1561)+o(1065)].push(O),this._debug(e[o(1448)],T)):(this[o(1561)+"Queue"][o(1874)](),this[o(1561)+o(1065)].push(O)),{seqID:this._seqId,logID:d,logIDNew:L}}async reconnect(t){let i=n,{url:o}=e[i(825)](t,{}),u=Array.isArray(o)?o:e.XkfzC(e[i(1181)],typeof o)?[o]:[];t&&Object[i(1804)](this._options,t),u&&u[i(861)]?this[i(1263)+i(759)]=new Ei(u,this[i(1447)][i(784)+"es"]):this["_endpoin"+i(759)]?.["resetEnd"+i(862)+i(1290)](),this[i(1766)+i(1913)]?.[i(1440)+i(791)](this[i(1447)][i(1778)+"Count"]),this[i(1947)+i(1808)]=!1,this[i(1078)]&&this[i(1078)][i(1503)+"te"]!==this[i(886)]?this[i(969)+"ect"](1e3,e[i(1574)],!0):(this._isInit=!0,this[i(531)]())}async[n(1654)](){let t=n;if(!this["_connect"+t(1714)]){let i=(t(1004)+"3").split("|"),o=0;for(;;){switch(i[o++]){case"0":this["_pingLos"+t(1913)]?.resetCounter();continue;case"1":this[t(1979)]=!0;continue;case"2":this[t(1947)+t(1808)]=!1;continue;case"3":this._connect();continue;case"4":this[t(1263)+t(759)]?.[t(1188)+"pointConfig"]();continue}break}}}[n(1337)+n(754)](t,i){this.on(t,i)}[n(1194)+n(857)](t){let i=n,{type:o}=t;this[i(997)](o,t)}[n(1741)+n(1110)+n(1465)](t,i){this[n(1683)](t,i)}[n(1471)](){let t=n,i={olESK:function(o,u){return e[N(1831)](o,u)},nfiDN:function(o,u){return e[N(927)](o,u)},aWbVu:function(o,u){return e.ZXwpl(o,u)},AEPuJ:"ping_onc"+t(1547)+"s"};if(e[t(1048)]("bHYsb",e[t(666)])){let o=_0x262060[t(1830)],u=_0x5a9e53.offset,h=_0x47a04d[t(1712)],p=tERpHe[t(614)](u,_0x4bf689);if(p>o[t(861)]){let g=new _0x131d36(2*p);g[t(1746)](o),_0x2393c8.bytes=g}return _0x58813e.offset=p,tERpHe[t(1638)](p,h)&&(_0x31ffc4.limit=p),u}else return new Promise((o,u)=>{let h=t,p={amkUs:function(y,v){return e.UxxSj(y,v)},DvVDC:h(1763),rTyPY:e.ZqcGN,wQEpy:e.WTFOd};this[h(2011)+h(781)](),this._pingPongTimeoutId=e[h(1439)](setTimeout,this[h(1169)][h(1917)](this),this[h(1447)][h(673)+h(883)]);let g=()=>{let y=h;p[y(593)](o,p.DvVDC),this[y(1683)](p.rTyPY,g),this[y(1683)](p[y(678)],d)},d=()=>{let y=h;i[y(554)](u,y(1814)),this[y(1683)](i[y(1479)],g),this.off(y(1131)+y(1010)+"t",d)};this.on(e[h(876)],g),this.on(e[h(1836)],d),this._ping()})}}})(),$[E(789)+E(1314)]=Z.CustomCloseEvent,$[E(1417)+E(1355)]=Z[E(1417)+E(1355)],$[E(2008)+"e"]=Z[E(2008)+"e"],$.Event=Z[E(857)],$[E(1241)]=Z.FWS,$[E(1328)+"MessageE"+E(944)]=Z[E(1328)+"MessageE"+E(944)],$.MessageEvent=Z[E(563)+E(944)],$.OpenEvent=Z[E(1017)+"t"],$[E(645)+E(1282)]=Z.ReconnectEvent,$[E(1767)+E(1314)]=Z[E(1767)+E(1314)],$["createEr"+E(1355)]=Z[E(1478)+E(1355)],$[E(1655)+E(602)+"nt"]=Z[E(1655)+E(602)+"nt"],$[E(698)+E(1658)]=Z["createOp"+E(1658)],$[E(1704)+"connectE"+E(944)]=Z["createRe"+E(548)+E(944)],$[E(755)+E(1806)]=Z["decodedF"+E(1806)],$[E(855)+E(1115)]=Z[E(855)+E(1115)];for(Pn in Z)["CustomCloseEvent",E(1417)+E(1355),E(2008)+"e",E(857),E(1241),"Frontier"+E(563)+E(944),E(563)+E(944),E(1017)+"t",E(645)+E(1282),"createCloseEvent","createEr"+E(1355),E(1655)+E(602)+"nt",E(698)+"enEvent",E(1704)+E(548)+"vent",E(755)+E(1806),E(855)+E(1115)][E(745)](Pn)===-1&&($[Pn]=Z[Pn]);var Pn;Object[E(1729)+E(1354)]($,E(1216)+"le",{value:!0})});var Le=oe((hh,Us)=>{"use strict";var zs=["nodebuffer","arraybuffer","fragments"],qs=typeof Blob<"u";qs&&zs.push("blob");Us.exports={BINARY_TYPES:zs,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:qs,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var qt=oe((gh,Bn)=>{"use strict";var{EMPTY_BUFFER:cc}=Le(),Ir=Buffer[Symbol.species];function uc(n,e){if(n.length===0)return cc;if(n.length===1)return n[0];let s=Buffer.allocUnsafe(e),a=0;for(let x=0;x<n.length;x++){let c=n[x];s.set(c,a),a+=c.length}return a<e?new Ir(s.buffer,s.byteOffset,a):s}function Fs(n,e,s,a,x){for(let c=0;c<x;c++)s[a+c]=n[c]^e[c&3]}function Hs(n,e){for(let s=0;s<n.length;s++)n[s]^=e[s&3]}function fc(n){return n.length===n.buffer.byteLength?n.buffer:n.buffer.slice(n.byteOffset,n.byteOffset+n.length)}function Rr(n){if(Rr.readOnly=!0,Buffer.isBuffer(n))return n;let e;return n instanceof ArrayBuffer?e=new Ir(n):ArrayBuffer.isView(n)?e=new Ir(n.buffer,n.byteOffset,n.byteLength):(e=Buffer.from(n),Rr.readOnly=!1),e}Bn.exports={concat:uc,mask:Fs,toArrayBuffer:fc,toBuffer:Rr,unmask:Hs};if(!process.env.WS_NO_BUFFER_UTIL)try{let n=Y("bufferutil");Bn.exports.mask=function(e,s,a,x,c){c<48?Fs(e,s,a,x,c):n.mask(e,s,a,x,c)},Bn.exports.unmask=function(e,s){e.length<32?Hs(e,s):n.unmask(e,s)}}catch{}});var Gs=oe((ph,js)=>{"use strict";var Ks=Symbol("kDone"),Nr=Symbol("kRun"),Lr=class{constructor(e){this[Ks]=()=>{this.pending--,this[Nr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Nr]()}[Nr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Ks])}}};js.exports=Lr});var pt=oe((mh,Ys)=>{"use strict";var Ut=Y("zlib"),Ws=qt(),dc=Gs(),{kStatusCode:Js}=Le(),lc=Buffer[Symbol.species],hc=Buffer.from([0,0,255,255]),zn=Symbol("permessage-deflate"),Oe=Symbol("total-length"),ht=Symbol("callback"),je=Symbol("buffers"),gt=Symbol("error"),Mn,Or=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Mn){let s=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Mn=new dc(s)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[ht];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let s=this._options,a=e.find(x=>!(s.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(s.serverMaxWindowBits===!1||typeof s.serverMaxWindowBits=="number"&&s.serverMaxWindowBits>x.server_max_window_bits)||typeof s.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return s.serverNoContextTakeover&&(a.server_no_context_takeover=!0),s.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof s.serverMaxWindowBits=="number"&&(a.server_max_window_bits=s.serverMaxWindowBits),typeof s.clientMaxWindowBits=="number"?a.client_max_window_bits=s.clientMaxWindowBits:(a.client_max_window_bits===!0||s.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(e){let s=e[0];if(this._options.clientNoContextTakeover===!1&&s.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!s.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(s.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&s.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return s}normalizeParams(e){return e.forEach(s=>{Object.keys(s).forEach(a=>{let x=s[a];if(x.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(x=x[0],a==="client_max_window_bits"){if(x!==!0){let c=+x;if(!Number.isInteger(c)||c<8||c>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=c}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let c=+x;if(!Number.isInteger(c)||c<8||c>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=c}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(x!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else throw new Error(`Unknown parameter "${a}"`);s[a]=x})}),e}decompress(e,s,a){Mn.add(x=>{this._decompress(e,s,(c,f)=>{x(),a(c,f)})})}compress(e,s,a){Mn.add(x=>{this._compress(e,s,(c,f)=>{x(),a(c,f)})})}_decompress(e,s,a){let x=this._isServer?"client":"server";if(!this._inflate){let c=`${x}_max_window_bits`,f=typeof this.params[c]!="number"?Ut.Z_DEFAULT_WINDOWBITS:this.params[c];this._inflate=Ut.createInflateRaw({...this._options.zlibInflateOptions,windowBits:f}),this._inflate[zn]=this,this._inflate[Oe]=0,this._inflate[je]=[],this._inflate.on("error",pc),this._inflate.on("data",Vs)}this._inflate[ht]=a,this._inflate.write(e),s&&this._inflate.write(hc),this._inflate.flush(()=>{let c=this._inflate[gt];if(c){this._inflate.close(),this._inflate=null,a(c);return}let f=Ws.concat(this._inflate[je],this._inflate[Oe]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Oe]=0,this._inflate[je]=[],s&&this.params[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,f)})}_compress(e,s,a){let x=this._isServer?"server":"client";if(!this._deflate){let c=`${x}_max_window_bits`,f=typeof this.params[c]!="number"?Ut.Z_DEFAULT_WINDOWBITS:this.params[c];this._deflate=Ut.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:f}),this._deflate[Oe]=0,this._deflate[je]=[],this._deflate.on("data",gc)}this._deflate[ht]=a,this._deflate.write(e),this._deflate.flush(Ut.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let c=Ws.concat(this._deflate[je],this._deflate[Oe]);s&&(c=new lc(c.buffer,c.byteOffset,c.length-4)),this._deflate[ht]=null,this._deflate[Oe]=0,this._deflate[je]=[],s&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,c)})}};Ys.exports=Or;function gc(n){this[je].push(n),this[Oe]+=n.length}function Vs(n){if(this[Oe]+=n.length,this[zn]._maxPayload<1||this[Oe]<=this[zn]._maxPayload){this[je].push(n);return}this[gt]=new RangeError("Max payload size exceeded"),this[gt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[gt][Js]=1009,this.removeListener("data",Vs),this.reset()}function pc(n){if(this[zn]._inflate=null,this[gt]){this[ht](this[gt]);return}n[Js]=1007,this[ht](n)}});var mt=oe((wh,qn)=>{"use strict";var{isUtf8:Zs}=Y("buffer"),{hasBlob:mc}=Le(),wc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function _c(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function Br(n){let e=n.length,s=0;for(;s<e;)if((n[s]&128)===0)s++;else if((n[s]&224)===192){if(s+1===e||(n[s+1]&192)!==128||(n[s]&254)===192)return!1;s+=2}else if((n[s]&240)===224){if(s+2>=e||(n[s+1]&192)!==128||(n[s+2]&192)!==128||n[s]===224&&(n[s+1]&224)===128||n[s]===237&&(n[s+1]&224)===160)return!1;s+=3}else if((n[s]&248)===240){if(s+3>=e||(n[s+1]&192)!==128||(n[s+2]&192)!==128||(n[s+3]&192)!==128||n[s]===240&&(n[s+1]&240)===128||n[s]===244&&n[s+1]>143||n[s]>244)return!1;s+=4}else return!1;return!0}function yc(n){return mc&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}qn.exports={isBlob:yc,isValidStatusCode:_c,isValidUTF8:Br,tokenChars:wc};if(Zs)qn.exports.isValidUTF8=function(n){return n.length<24?Br(n):Zs(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=Y("utf-8-validate");qn.exports.isValidUTF8=function(e){return e.length<32?Br(e):n(e)}}catch{}});var Fr=oe((_h,ro)=>{"use strict";var{Writable:vc}=Y("stream"),$s=pt(),{BINARY_TYPES:bc,EMPTY_BUFFER:Xs,kStatusCode:Sc,kWebSocket:Ec}=Le(),{concat:Mr,toArrayBuffer:Cc,unmask:Ac}=qt(),{isValidStatusCode:Dc,isValidUTF8:Qs}=mt(),Un=Buffer[Symbol.species],le=0,eo=1,to=2,no=3,zr=4,qr=5,Fn=6,Ur=class extends vc{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||bc[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Ec]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=le}_write(e,s,a){if(this._opcode===8&&this._state==le)return a();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(a)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let a=this._buffers[0];return this._buffers[0]=new Un(a.buffer,a.byteOffset+e,a.length-e),new Un(a.buffer,a.byteOffset,e)}let s=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=s.length-e;e>=a.length?s.set(this._buffers.shift(),x):(s.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new Un(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return s}startLoop(e){this._loop=!0;do switch(this._state){case le:this.getInfo(e);break;case eo:this.getPayloadLength16(e);break;case to:this.getPayloadLength64(e);break;case no:this.getMask();break;case zr:this.getData(e);break;case qr:case Fn:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let s=this.consume(2);if((s[0]&48)!==0){let x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(s[0]&64)===64;if(a&&!this._extensions[$s.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(s[0]&128)===128,this._opcode=s[0]&15,this._payloadLength=s[1]&127,this._opcode===0){if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(!this._fragmented){let x=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let x=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(x);return}if(a){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let x=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(x);return}}else{let x=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(x);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(s[1]&128)===128,this._isServer){if(!this._masked){let x=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(x);return}}else if(this._masked){let x=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(x);return}this._payloadLength===126?this._state=eo:this._payloadLength===127?this._state=to:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let s=this.consume(8),a=s.readUInt32BE(0);if(a>Math.pow(2,21)-1){let x=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(x);return}this._payloadLength=a*Math.pow(2,32)+s.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(s);return}this._masked?this._state=no:this._state=zr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=zr}getData(e){let s=Xs;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}s=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Ac(s,this._mask)}if(this._opcode>7){this.controlMessage(s,e);return}if(this._compressed){this._state=qr,this.decompress(s,e);return}s.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(s)),this.dataMessage(e)}decompress(e,s){this._extensions[$s.extensionName].decompress(e,this._fin,(x,c)=>{if(x)return s(x);if(c.length){if(this._messageLength+=c.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let f=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");s(f);return}this._fragments.push(c)}this.dataMessage(s),this._state===le&&this.startLoop(s)})}dataMessage(e){if(!this._fin){this._state=le;return}let s=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let x;this._binaryType==="nodebuffer"?x=Mr(a,s):this._binaryType==="arraybuffer"?x=Cc(Mr(a,s)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit("message",x,!0),this._state=le,this.startLoop(e)}))}else{let x=Mr(a,s);if(!this._skipUTF8Validation&&!Qs(x)){let c=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(c);return}this._state===qr||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit("message",x,!1),this._state=le,this.startLoop(e)}))}}controlMessage(e,s){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Xs),this.end();else{let a=e.readUInt16BE(0);if(!Dc(a)){let c=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");s(c);return}let x=new Un(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Qs(x)){let c=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");s(c);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=le;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=le,this.startLoop(s)}))}createError(e,s,a,x,c){this._loop=!1,this._errored=!0;let f=new e(a?`Invalid WebSocket frame: ${s}`:s);return Error.captureStackTrace(f,this.createError),f.code=c,f[Sc]=x,f}};ro.exports=Ur});var jr=oe((vh,oo)=>{"use strict";var{Duplex:yh}=Y("stream"),{randomFillSync:kc}=Y("crypto"),io=pt(),{EMPTY_BUFFER:Pc,kWebSocket:Tc,NOOP:Ic}=Le(),{isBlob:wt,isValidStatusCode:Rc}=mt(),{mask:so,toBuffer:$e}=qt(),he=Symbol("kByteLength"),Nc=Buffer.alloc(4),Hn=8*1024,Xe,_t=Hn,we=0,Lc=1,Oc=2,Hr=class n{constructor(e,s,a){this._extensions=s||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=we,this.onerror=Ic,this[Tc]=void 0}static frame(e,s){let a,x=!1,c=2,f=!1;s.mask&&(a=s.maskBuffer||Nc,s.generateMask?s.generateMask(a):(_t===Hn&&(Xe===void 0&&(Xe=Buffer.alloc(Hn)),kc(Xe,0,Hn),_t=0),a[0]=Xe[_t++],a[1]=Xe[_t++],a[2]=Xe[_t++],a[3]=Xe[_t++]),f=(a[0]|a[1]|a[2]|a[3])===0,c=6);let l;typeof e=="string"?(!s.mask||f)&&s[he]!==void 0?l=s[he]:(e=Buffer.from(e),l=e.length):(l=e.length,x=s.mask&&s.readOnly&&!f);let m=l;l>=65536?(c+=8,m=127):l>125&&(c+=2,m=126);let w=Buffer.allocUnsafe(x?l+c:c);return w[0]=s.fin?s.opcode|128:s.opcode,s.rsv1&&(w[0]|=64),w[1]=m,m===126?w.writeUInt16BE(l,2):m===127&&(w[2]=w[3]=0,w.writeUIntBE(l,4,6)),s.mask?(w[1]|=128,w[c-4]=a[0],w[c-3]=a[1],w[c-2]=a[2],w[c-1]=a[3],f?[w,e]:x?(so(e,a,w,c,l),[w]):(so(e,a,e,0,l),[w,e])):[w,e]}close(e,s,a,x){let c;if(e===void 0)c=Pc;else{if(typeof e!="number"||!Rc(e))throw new TypeError("First argument must be a valid error code number");if(s===void 0||!s.length)c=Buffer.allocUnsafe(2),c.writeUInt16BE(e,0);else{let l=Buffer.byteLength(s);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");c=Buffer.allocUnsafe(2+l),c.writeUInt16BE(e,0),typeof s=="string"?c.write(s,2):c.set(s,2)}}let f={[he]:c.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,c,!1,f,x]):this.sendFrame(n.frame(c,f),x)}ping(e,s,a){let x,c;if(typeof e=="string"?(x=Buffer.byteLength(e),c=!1):wt(e)?(x=e.size,c=!1):(e=$e(e),x=e.length,c=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let f={[he]:x,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:9,readOnly:c,rsv1:!1};wt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,f,a]):this.getBlobData(e,!1,f,a):this._state!==we?this.enqueue([this.dispatch,e,!1,f,a]):this.sendFrame(n.frame(e,f),a)}pong(e,s,a){let x,c;if(typeof e=="string"?(x=Buffer.byteLength(e),c=!1):wt(e)?(x=e.size,c=!1):(e=$e(e),x=e.length,c=$e.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let f={[he]:x,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:10,readOnly:c,rsv1:!1};wt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,f,a]):this.getBlobData(e,!1,f,a):this._state!==we?this.enqueue([this.dispatch,e,!1,f,a]):this.sendFrame(n.frame(e,f),a)}send(e,s,a){let x=this._extensions[io.extensionName],c=s.binary?2:1,f=s.compress,l,m;typeof e=="string"?(l=Buffer.byteLength(e),m=!1):wt(e)?(l=e.size,m=!1):(e=$e(e),l=e.length,m=$e.readOnly),this._firstFragment?(this._firstFragment=!1,f&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(f=l>=x._threshold),this._compress=f):(f=!1,c=0),s.fin&&(this._firstFragment=!0);let w={[he]:l,fin:s.fin,generateMask:this._generateMask,mask:s.mask,maskBuffer:this._maskBuffer,opcode:c,readOnly:m,rsv1:f};wt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,w,a]):this.getBlobData(e,this._compress,w,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,w,a]):this.dispatch(e,this._compress,w,a)}getBlobData(e,s,a,x){this._bufferedBytes+=a[he],this._state=Oc,e.arrayBuffer().then(c=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Kr,this,l,x);return}this._bufferedBytes-=a[he];let f=$e(c);s?this.dispatch(f,s,a,x):(this._state=we,this.sendFrame(n.frame(f,a),x),this.dequeue())}).catch(c=>{process.nextTick(Bc,this,c,x)})}dispatch(e,s,a,x){if(!s){this.sendFrame(n.frame(e,a),x);return}let c=this._extensions[io.extensionName];this._bufferedBytes+=a[he],this._state=Lc,c.compress(e,a.fin,(f,l)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Kr(this,m,x);return}this._bufferedBytes-=a[he],this._state=we,a.readOnly=!1,this.sendFrame(n.frame(l,a),x),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][he],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][he],this._queue.push(e)}sendFrame(e,s){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],s),this._socket.uncork()):this._socket.write(e[0],s)}};oo.exports=Hr;function Kr(n,e,s){typeof s=="function"&&s(e);for(let a=0;a<n._queue.length;a++){let x=n._queue[a],c=x[x.length-1];typeof c=="function"&&c(e)}}function Bc(n,e,s){Kr(n,e,s),n.onerror(e)}});var po=oe((bh,go)=>{"use strict";var{kForOnEventAttribute:Ft,kListener:Gr}=Le(),ao=Symbol("kCode"),xo=Symbol("kData"),co=Symbol("kError"),uo=Symbol("kMessage"),fo=Symbol("kReason"),yt=Symbol("kTarget"),lo=Symbol("kType"),ho=Symbol("kWasClean"),Be=class{constructor(e){this[yt]=null,this[lo]=e}get target(){return this[yt]}get type(){return this[lo]}};Object.defineProperty(Be.prototype,"target",{enumerable:!0});Object.defineProperty(Be.prototype,"type",{enumerable:!0});var Qe=class extends Be{constructor(e,s={}){super(e),this[ao]=s.code===void 0?0:s.code,this[fo]=s.reason===void 0?"":s.reason,this[ho]=s.wasClean===void 0?!1:s.wasClean}get code(){return this[ao]}get reason(){return this[fo]}get wasClean(){return this[ho]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var vt=class extends Be{constructor(e,s={}){super(e),this[co]=s.error===void 0?null:s.error,this[uo]=s.message===void 0?"":s.message}get error(){return this[co]}get message(){return this[uo]}};Object.defineProperty(vt.prototype,"error",{enumerable:!0});Object.defineProperty(vt.prototype,"message",{enumerable:!0});var Ht=class extends Be{constructor(e,s={}){super(e),this[xo]=s.data===void 0?null:s.data}get data(){return this[xo]}};Object.defineProperty(Ht.prototype,"data",{enumerable:!0});var Mc={addEventListener(n,e,s={}){for(let x of this.listeners(n))if(!s[Ft]&&x[Gr]===e&&!x[Ft])return;let a;if(n==="message")a=function(c,f){let l=new Ht("message",{data:f?c:c.toString()});l[yt]=this,Kn(e,this,l)};else if(n==="close")a=function(c,f){let l=new Qe("close",{code:c,reason:f.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[yt]=this,Kn(e,this,l)};else if(n==="error")a=function(c){let f=new vt("error",{error:c,message:c.message});f[yt]=this,Kn(e,this,f)};else if(n==="open")a=function(){let c=new Be("open");c[yt]=this,Kn(e,this,c)};else return;a[Ft]=!!s[Ft],a[Gr]=e,s.once?this.once(n,a):this.on(n,a)},removeEventListener(n,e){for(let s of this.listeners(n))if(s[Gr]===e&&!s[Ft]){this.removeListener(n,s);break}}};go.exports={CloseEvent:Qe,ErrorEvent:vt,Event:Be,EventTarget:Mc,MessageEvent:Ht};function Kn(n,e,s){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,s):n.call(e,s)}});var jn=oe((Sh,mo)=>{"use strict";var{tokenChars:Kt}=mt();function Ae(n,e,s){n[e]===void 0?n[e]=[s]:n[e].push(s)}function zc(n){let e=Object.create(null),s=Object.create(null),a=!1,x=!1,c=!1,f,l,m=-1,w=-1,b=-1,_=0;for(;_<n.length;_++)if(w=n.charCodeAt(_),f===void 0)if(b===-1&&Kt[w]===1)m===-1&&(m=_);else if(_!==0&&(w===32||w===9))b===-1&&m!==-1&&(b=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);b===-1&&(b=_);let k=n.slice(m,b);w===44?(Ae(e,k,s),s=Object.create(null)):f=k,m=b=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);else if(l===void 0)if(b===-1&&Kt[w]===1)m===-1&&(m=_);else if(w===32||w===9)b===-1&&m!==-1&&(b=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);b===-1&&(b=_),Ae(s,n.slice(m,b),!0),w===44&&(Ae(e,f,s),s=Object.create(null),f=void 0),m=b=-1}else if(w===61&&m!==-1&&b===-1)l=n.slice(m,_),m=b=-1;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(x){if(Kt[w]!==1)throw new SyntaxError(`Unexpected character at index ${_}`);m===-1?m=_:a||(a=!0),x=!1}else if(c)if(Kt[w]===1)m===-1&&(m=_);else if(w===34&&m!==-1)c=!1,b=_;else if(w===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(w===34&&n.charCodeAt(_-1)===61)c=!0;else if(b===-1&&Kt[w]===1)m===-1&&(m=_);else if(m!==-1&&(w===32||w===9))b===-1&&(b=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);b===-1&&(b=_);let k=n.slice(m,b);a&&(k=k.replace(/\\/g,""),a=!1),Ae(s,l,k),w===44&&(Ae(e,f,s),s=Object.create(null),f=void 0),l=void 0,m=b=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);if(m===-1||c||w===32||w===9)throw new SyntaxError("Unexpected end of input");b===-1&&(b=_);let S=n.slice(m,b);return f===void 0?Ae(e,S,s):(l===void 0?Ae(s,S,!0):a?Ae(s,l,S.replace(/\\/g,"")):Ae(s,l,S),Ae(e,f,s)),e}function qc(n){return Object.keys(n).map(e=>{let s=n[e];return Array.isArray(s)||(s=[s]),s.map(a=>[e].concat(Object.keys(a).map(x=>{let c=a[x];return Array.isArray(c)||(c=[c]),c.map(f=>f===!0?x:`${x}=${f}`).join("; ")})).join("; ")).join(", ")}).join(", ")}mo.exports={format:qc,parse:zc}});var Vn=oe((Ah,Po)=>{"use strict";var Uc=Y("events"),Fc=Y("https"),Hc=Y("http"),yo=Y("net"),Kc=Y("tls"),{randomBytes:jc,createHash:Gc}=Y("crypto"),{Duplex:Eh,Readable:Ch}=Y("stream"),{URL:Wr}=Y("url"),Ge=pt(),Wc=Fr(),Jc=jr(),{isBlob:Vc}=mt(),{BINARY_TYPES:wo,CLOSE_TIMEOUT:Yc,EMPTY_BUFFER:Gn,GUID:Zc,kForOnEventAttribute:Jr,kListener:$c,kStatusCode:Xc,kWebSocket:X,NOOP:vo}=Le(),{EventTarget:{addEventListener:Qc,removeEventListener:eu}}=po(),{format:tu,parse:nu}=jn(),{toBuffer:ru}=qt(),bo=Symbol("kAborted"),Vr=[8,13],Me=["CONNECTING","OPEN","CLOSING","CLOSED"],iu=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,H=class n extends Uc{constructor(e,s,a){super(),this._binaryType=wo[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Gn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,s===void 0?s=[]:Array.isArray(s)||(typeof s=="object"&&s!==null?(a=s,s=[]):s=[s]),So(this,e,s,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){wo.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,s,a){let x=new Wc({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),c=new Jc(e,this._extensions,a.generateMask);this._receiver=x,this._sender=c,this._socket=e,x[X]=this,c[X]=this,e[X]=this,x.on("conclude",au),x.on("drain",xu),x.on("error",cu),x.on("message",uu),x.on("ping",fu),x.on("pong",du),c.onerror=lu,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),s.length>0&&e.unshift(s),e.on("close",Ao),e.on("data",Jn),e.on("end",Do),e.on("error",ko),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ge.extensionName]&&this._extensions[Ge.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,s){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(e,s,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Co(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,s,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=s=void 0):typeof s=="function"&&(a=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==n.OPEN){Yr(this,e,a);return}s===void 0&&(s=!this._isServer),this._sender.ping(e||Gn,s,a)}pong(e,s,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=s=void 0):typeof s=="function"&&(a=s,s=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==n.OPEN){Yr(this,e,a);return}s===void 0&&(s=!this._isServer),this._sender.pong(e||Gn,s,a)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,s,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof s=="function"&&(a=s,s={}),typeof e=="number"&&(e=e.toString()),this.readyState!==n.OPEN){Yr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...s};this._extensions[Ge.extensionName]||(x.compress=!1),this._sender.send(e||Gn,x,a)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(H,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(H.prototype,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(H,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(H.prototype,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(H,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(H.prototype,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(H,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});Object.defineProperty(H.prototype,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(H.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(H.prototype,`on${n}`,{enumerable:!0,get(){for(let e of this.listeners(n))if(e[Jr])return e[$c];return null},set(e){for(let s of this.listeners(n))if(s[Jr]){this.removeListener(n,s);break}typeof e=="function"&&this.addEventListener(n,e,{[Jr]:!0})}})});H.prototype.addEventListener=Qc;H.prototype.removeEventListener=eu;Po.exports=H;function So(n,e,s,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Yc,protocolVersion:Vr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=x.autoPong,n._closeTimeout=x.closeTimeout,!Vr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Vr.join(", ")})`);let c;if(e instanceof Wr)c=e;else try{c=new Wr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}c.protocol==="http:"?c.protocol="ws:":c.protocol==="https:"&&(c.protocol="wss:"),n._url=c.href;let f=c.protocol==="wss:",l=c.protocol==="ws+unix:",m;if(c.protocol!=="ws:"&&!f&&!l?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!c.pathname?m="The URL's pathname is empty":c.hash&&(m="The URL contains a fragment identifier"),m){let I=new SyntaxError(m);if(n._redirects===0)throw I;Wn(n,I);return}let w=f?443:80,b=jc(16).toString("base64"),_=f?Fc.request:Hc.request,S=new Set,k;if(x.createConnection=x.createConnection||(f?ou:su),x.defaultPort=x.defaultPort||w,x.port=c.port||w,x.host=c.hostname.startsWith("[")?c.hostname.slice(1,-1):c.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":b,Connection:"Upgrade",Upgrade:"websocket"},x.path=c.pathname+c.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(k=new Ge({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=tu({[Ge.extensionName]:k.offer()})),s.length){for(let I of s){if(typeof I!="string"||!iu.test(I)||S.has(I))throw new SyntaxError("An invalid or duplicated subprotocol was specified");S.add(I)}x.headers["Sec-WebSocket-Protocol"]=s.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(c.username||c.password)&&(x.auth=`${c.username}:${c.password}`),l){let I=x.path.split(":");x.socketPath=I[0],x.path=I[1]}let P;if(x.followRedirects){if(n._redirects===0){n._originalIpc=l,n._originalSecure=f,n._originalHostOrSocketPath=l?x.socketPath:c.host;let I=a&&a.headers;if(a={...a,headers:{}},I)for(let[z,ie]of Object.entries(I))a.headers[z.toLowerCase()]=ie}else if(n.listenerCount("redirect")===0){let I=l?n._originalIpc?x.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:c.host===n._originalHostOrSocketPath;(!I||n._originalSecure&&!f)&&(delete x.headers.authorization,delete x.headers.cookie,I||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),P=n._req=_(x),n._redirects&&n.emit("redirect",n.url,P)}else P=n._req=_(x);x.timeout&&P.on("timeout",()=>{fe(n,P,"Opening handshake has timed out")}),P.on("error",I=>{P===null||P[bo]||(P=n._req=null,Wn(n,I))}),P.on("response",I=>{let z=I.headers.location,ie=I.statusCode;if(z&&x.followRedirects&&ie>=300&&ie<400){if(++n._redirects>x.maxRedirects){fe(n,P,"Maximum redirects exceeded");return}P.abort();let Q;try{Q=new Wr(z,e)}catch{let ae=new SyntaxError(`Invalid URL: ${z}`);Wn(n,ae);return}So(n,Q,s,a)}else n.emit("unexpected-response",P,I)||fe(n,P,`Unexpected server response: ${I.statusCode}`)}),P.on("upgrade",(I,z,ie)=>{if(n.emit("upgrade",I),n.readyState!==H.CONNECTING)return;P=n._req=null;let Q=I.headers.upgrade;if(Q===void 0||Q.toLowerCase()!=="websocket"){fe(n,z,"Invalid Upgrade header");return}let _e=Gc("sha1").update(b+Zc).digest("base64");if(I.headers["sec-websocket-accept"]!==_e){fe(n,z,"Invalid Sec-WebSocket-Accept header");return}let ae=I.headers["sec-websocket-protocol"],D;if(ae!==void 0?S.size?S.has(ae)||(D="Server sent an invalid subprotocol"):D="Server sent a subprotocol but none was requested":S.size&&(D="Server sent no subprotocol"),D){fe(n,z,D);return}ae&&(n._protocol=ae);let q=I.headers["sec-websocket-extensions"];if(q!==void 0){if(!k){fe(n,z,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let J;try{J=nu(q)}catch{fe(n,z,"Invalid Sec-WebSocket-Extensions header");return}let ee=Object.keys(J);if(ee.length!==1||ee[0]!==Ge.extensionName){fe(n,z,"Server indicated an extension that was not requested");return}try{k.accept(J[Ge.extensionName])}catch{fe(n,z,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[Ge.extensionName]=k}n.setSocket(z,ie,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(P,n):P.end()}function Wn(n,e){n._readyState=H.CLOSING,n._errorEmitted=!0,n.emit("error",e),n.emitClose()}function su(n){return n.path=n.socketPath,yo.connect(n)}function ou(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=yo.isIP(n.host)?"":n.host),Kc.connect(n)}function fe(n,e,s){n._readyState=H.CLOSING;let a=new Error(s);Error.captureStackTrace(a,fe),e.setHeader?(e[bo]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Wn,n,a)):(e.destroy(a),e.once("error",n.emit.bind(n,"error")),e.once("close",n.emitClose.bind(n)))}function Yr(n,e,s){if(e){let a=Vc(e)?e.size:ru(e).length;n._socket?n._sender._bufferedBytes+=a:n._bufferedAmount+=a}if(s){let a=new Error(`WebSocket is not open: readyState ${n.readyState} (${Me[n.readyState]})`);process.nextTick(s,a)}}function au(n,e){let s=this[X];s._closeFrameReceived=!0,s._closeMessage=e,s._closeCode=n,s._socket[X]!==void 0&&(s._socket.removeListener("data",Jn),process.nextTick(Eo,s._socket),n===1005?s.close():s.close(n,e))}function xu(){let n=this[X];n.isPaused||n._socket.resume()}function cu(n){let e=this[X];e._socket[X]!==void 0&&(e._socket.removeListener("data",Jn),process.nextTick(Eo,e._socket),e.close(n[Xc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",n))}function _o(){this[X].emitClose()}function uu(n,e){this[X].emit("message",n,e)}function fu(n){let e=this[X];e._autoPong&&e.pong(n,!this._isServer,vo),e.emit("ping",n)}function du(n){this[X].emit("pong",n)}function Eo(n){n.resume()}function lu(n){let e=this[X];e.readyState!==H.CLOSED&&(e.readyState===H.OPEN&&(e._readyState=H.CLOSING,Co(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",n)))}function Co(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function Ao(){let n=this[X];if(this.removeListener("close",Ao),this.removeListener("data",Jn),this.removeListener("end",Do),n._readyState=H.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);n._receiver.write(e)}n._receiver.end(),this[X]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",_o),n._receiver.on("finish",_o))}function Jn(n){this[X]._receiver.write(n)||this.pause()}function Do(){let n=this[X];n._readyState=H.CLOSING,n._receiver.end(),this.end()}function ko(){let n=this[X];this.removeListener("error",ko),this.on("error",vo),n&&(n._readyState=H.CLOSING,this.destroy())}});var No=oe((kh,Ro)=>{"use strict";var Dh=Vn(),{Duplex:hu}=Y("stream");function To(n){n.emit("close")}function gu(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Io(n){this.removeListener("error",Io),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function pu(n,e){let s=!0,a=new hu({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(c,f){let l=!f&&a._readableState.objectMode?c.toString():c;a.push(l)||n.pause()}),n.once("error",function(c){a.destroyed||(s=!1,a.destroy(c))}),n.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,c){if(n.readyState===n.CLOSED){c(x),process.nextTick(To,a);return}let f=!1;n.once("error",function(m){f=!0,c(m)}),n.once("close",function(){f||c(x),process.nextTick(To,a)}),s&&n.terminate()},a._final=function(x){if(n.readyState===n.CONNECTING){n.once("open",function(){a._final(x)});return}n._socket!==null&&(n._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(n._socket.once("finish",function(){x()}),n.close()))},a._read=function(){n.isPaused&&n.resume()},a._write=function(x,c,f){if(n.readyState===n.CONNECTING){n.once("open",function(){a._write(x,c,f)});return}n.send(x,f)},a.on("end",gu),a.on("error",Io),a}Ro.exports=pu});var Zr=oe((Ph,Lo)=>{"use strict";var{tokenChars:mu}=mt();function wu(n){let e=new Set,s=-1,a=-1,x=0;for(x;x<n.length;x++){let f=n.charCodeAt(x);if(a===-1&&mu[f]===1)s===-1&&(s=x);else if(x!==0&&(f===32||f===9))a===-1&&s!==-1&&(a=x);else if(f===44){if(s===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let l=n.slice(s,a);if(e.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);e.add(l),s=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(s===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let c=n.slice(s,x);if(e.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);return e.add(c),e}Lo.exports={parse:wu}});var Fo=oe((Ih,Uo)=>{"use strict";var _u=Y("events"),Yn=Y("http"),{Duplex:Th}=Y("stream"),{createHash:yu}=Y("crypto"),Oo=jn(),et=pt(),vu=Zr(),bu=Vn(),{CLOSE_TIMEOUT:Su,GUID:Eu,kWebSocket:Cu}=Le(),Au=/^[+/0-9A-Za-z]{22}==$/,Bo=0,Mo=1,qo=2,$r=class extends _u{constructor(e,s){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Su,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:bu,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Yn.createServer((a,x)=>{let c=Yn.STATUS_CODES[426];x.writeHead(426,{"Content-Length":c.length,"Content-Type":"text/plain"}),x.end(c)}),this._server.listen(e.port,e.host,e.backlog,s)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Du(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,c,f)=>{this.handleUpgrade(x,c,f,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Bo}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===qo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(jt,this);return}if(e&&this.once("close",e),this._state!==Mo)if(this._state=Mo,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(jt,this):process.nextTick(jt,this);else{let s=this._server;this._removeListeners(),this._removeListeners=this._server=null,s.close(()=>{jt(this)})}}shouldHandle(e){if(this.options.path){let s=e.url.indexOf("?");if((s!==-1?e.url.slice(0,s):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,s,a,x){s.on("error",zo);let c=e.headers["sec-websocket-key"],f=e.headers.upgrade,l=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,s,405,"Invalid HTTP method");return}if(f===void 0||f.toLowerCase()!=="websocket"){nt(this,e,s,400,"Invalid Upgrade header");return}if(c===void 0||!Au.test(c)){nt(this,e,s,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==13&&l!==8){nt(this,e,s,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Gt(s,400);return}let m=e.headers["sec-websocket-protocol"],w=new Set;if(m!==void 0)try{w=vu.parse(m)}catch{nt(this,e,s,400,"Invalid Sec-WebSocket-Protocol header");return}let b=e.headers["sec-websocket-extensions"],_={};if(this.options.perMessageDeflate&&b!==void 0){let S=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let k=Oo.parse(b);k[et.extensionName]&&(S.accept(k[et.extensionName]),_[et.extensionName]=S)}catch{nt(this,e,s,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let S={origin:e.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(S,(k,P,I,z)=>{if(!k)return Gt(s,P||401,I,z);this.completeUpgrade(_,c,w,e,s,a,x)});return}if(!this.options.verifyClient(S))return Gt(s,401)}this.completeUpgrade(_,c,w,e,s,a,x)}completeUpgrade(e,s,a,x,c,f,l){if(!c.readable||!c.writable)return c.destroy();if(c[Cu])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Bo)return Gt(c,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${yu("sha1").update(s+Eu).digest("base64")}`],b=new this.options.WebSocket(null,void 0,this.options);if(a.size){let _=this.options.handleProtocols?this.options.handleProtocols(a,x):a.values().next().value;_&&(w.push(`Sec-WebSocket-Protocol: ${_}`),b._protocol=_)}if(e[et.extensionName]){let _=e[et.extensionName].params,S=Oo.format({[et.extensionName]:[_]});w.push(`Sec-WebSocket-Extensions: ${S}`),b._extensions=e}this.emit("headers",w,x),c.write(w.concat(`\r
|
|
8
|
+
var o0=Object.create;var wr=Object.defineProperty;var a0=Object.getOwnPropertyDescriptor;var c0=Object.getOwnPropertyNames;var x0=Object.getPrototypeOf,u0=Object.prototype.hasOwnProperty;var V=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var De=(r,e)=>()=>(r&&(e=r(r=0)),e);var oe=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ns=(r,e)=>{for(var i in e)wr(r,i,{get:e[i],enumerable:!0})},f0=(r,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of c0(e))!u0.call(r,c)&&c!==i&&wr(r,c,{get:()=>e[c],enumerable:!(o=a0(e,c))||o.enumerable});return r};var Ie=(r,e,i)=>(i=r!=null?o0(x0(r)):{},f0(e||!r||!r.__esModule?wr(i,"default",{value:r,enumerable:!0}):i,r));import{chmod as d0,mkdir as l0,readFile as h0,rename as Os,writeFile as Bs}from"node:fs/promises";import{dirname as g0}from"node:path";async function at(r){try{let e=await h0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function Yt(r,e,i){await l0(g0(r),{recursive:!0});let o=`${JSON.stringify(e,null,2)}
|
|
9
|
+
`,c=`${r}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;try{i?.mode!==void 0?await Bs(c,o,{encoding:"utf8",mode:i.mode}):await Bs(c,o,"utf8"),await Os(c,r),i?.mode!==void 0&&await d0(r,i.mode)}catch(x){await Os(c,c).catch(()=>{});let{rm:f}=await import("node:fs/promises");throw await f(c,{force:!0}).catch(()=>{}),x}}var Xt=De(()=>{"use strict"});function qs(r){return Qt[Ms]<=Qt[r]}function _r(r){zs={...r}}function $t(r,e,i,o){if(Qt[r]<Qt[Ms])return;let c=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:i,...zs,...o});r==="error"||r==="warn"?m0.write(`${c}
|
|
10
|
+
`):p0.write(`${c}
|
|
11
|
+
`)}function L(r){return{debug:(e,i)=>$t("debug",r,e,i),info:(e,i)=>$t("info",r,e,i),warn:(e,i)=>$t("warn",r,e,i),error:(e,i)=>$t("error",r,e,i),child:e=>L(`${r}.${e}`)}}var Qt,Ms,p0,m0,zs,U=De(()=>{"use strict";Qt={debug:10,info:20,warn:30,error:40},Ms=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),p0=process.stdout,m0=process.stderr,zs={}});import{homedir as w0}from"node:os";import{join as ee}from"node:path";function G(r){let e=r??w0(),i=ee(e,".coze"),o=ee(i,"bridge"),c=ee(o,"lib");return{cozeRoot:i,bridgeRoot:o,libDir:c,libEntry:ee(c,"index.js"),pidFile:ee(o,"bridge.pid"),portFile:ee(o,"bridge.port"),tokenFile:ee(o,"bridge.token"),logFile:ee(o,"bridge.log"),installLock:ee(o,"install.lock"),configFile:ee(o,"config.json"),agentsRoot:ee(i,"agents")}}function Te(r,e=G()){let i=ee(e.agentsRoot,r);return{root:i,config:ee(i,"config.json"),workspace:ee(i,"workspace"),logs:ee(i,"logs")}}var xe=De(()=>{"use strict"});var tn={};Ns(tn,{AGENT_CONFIG_FILE_MODE:()=>Zt,enforceAgentConfigMode:()=>b0,loadAgentConfig:()=>ue,persistAgentSessions:()=>yr,persistAgentSkills:()=>en,saveAgentConfig:()=>me});import{chmod as _0,stat as y0}from"node:fs/promises";function ue(r,e){return at(Te(r,e).config)}function me(r,e){return Yt(Te(r.agentId,e).config,r,{mode:Zt})}async function b0(r,e){if(process.platform==="win32")return;let i=Te(r,e).config;try{let o=await y0(i);if(!o.isFile())return;let c=o.mode&511;c!==Zt&&(await _0(i,Zt),Fs.warn("agent config mode auto-corrected to 0600",{path:i,from:c.toString(8)}))}catch(o){if(o.code==="ENOENT")return;Fs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(o)})}}async function yr(r,e,i){let o=await ue(r,i);o&&(o.sessions=Object.fromEntries(e),await me(o,i))}async function en(r,e,i){let o=await ue(r,i);o&&(o.skills=e,await me(o,i))}var Fs,Zt,Ue=De(()=>{"use strict";Xt();U();xe();Fs=L("agent-config"),Zt=384});var zi=oe(X=>{"use strict";var S=k;(function(r,e){let i=k,o=r();for(;;)try{if(-parseInt(i(1445))/1+-parseInt(i(1267))/2+parseInt(i(1127))/3*(-parseInt(i(759))/4)+-parseInt(i(591))/5+-parseInt(i(328))/6+parseInt(i(980))/7*(parseInt(i(563))/8)+-parseInt(i(187))/9*(-parseInt(i(1567))/10)===e)break;o.push(o.shift())}catch{o.push(o.shift())}})(Nn,813735);var Yc=Object.defineProperty,Xc=Object["getOwnPr"+S(532)+S(1052)],Ri=(r,e)=>function(){return r&&(e=(0,r[{mmnMx:function(x,f){return x(f)}}[S(648)](Xc,r)[0]])(r=0)),e},$c=(r,e)=>{let i=S,o={AtFXw:function(x,f,d,g){return x(f,d,g)}};for(var c in e)o[i(1575)](Yc,r,c,{get:e[c],enumerable:!0})};function Qc(){return Pi||(Pi=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Zc(){let r=S;return Di||(Di=[IDBCursor[r(1148)+"e"][r(883)],IDBCursor[r(1148)+"e"][r(790)],IDBCursor[r(1148)+"e"].continuePrimaryKey])}function ex(r){let e=S,i={RZiWT:function(c,x){return c(x)},QXiUY:e(227),VHcuy:e(939),UzqyE:function(c,x){return c>>>x},ievEc:function(c,x){return c===x},lyzlo:function(c,x){return c<x},LAGaL:function(c,x,f){return c(x,f)},WhHKw:function(c,x){return c&x},fzHKW:function(c,x){return c>>>x},LCpfi:function(c,x){return c+x},hQGgE:function(c,x){return c|x},ImqYC:function(c,x){return c+x},LJvTd:function(c,x){return c!==x},bFtvl:function(c,x){return c&x},klnsU:function(c,x){return c>>>x},JSmso:function(c,x){return c+x},iATlG:function(c,x){return c!==x},xxZoC:function(c,x){return c|x},LLPEJ:function(c,x){return c>>>x},NaQal:function(c,x){return c|x},iVxWV:function(c,x){return c>>>x},DjVXE:function(c,x){return c>>>x},ZbuXt:function(c,x){return c&x},UFhkM:"JDRem",ENLoy:function(c,x){return c instanceof x}},o=new Promise((c,x)=>{let f=e,d={BEyez:i[f(1053)],VXjqL:i[f(735)],Mcudv:function(y){return y()}},g=()=>{let y=f;r[y(923)+"entListe"+y(231)](d[y(1035)],w),r[y(923)+y(1204)+"ner"](d[y(166)],b)},w=()=>{let y=f;i[y(1326)](c,i[y(1326)](Ee,r[y(585)])),g()},b=()=>{x(r[f(939)]),d.Mcudv(g)};r[f(1380)+f(934)](i.QXiUY,w),r[f(1380)+f(934)](i[f(735)],b)});return o[e(1e3)](c=>{let x=e,f={JzbFx:function(d,g){return d>>>g},YHhrO:function(d,g){return d|g},CPbam:function(d,g){return d<<g},wsQoJ:function(d,g){return i[k(600)](d,g)},zLEEE:function(d,g){return d===g},FUPst:function(d,g){return i[k(316)](d,g)},BfsVw:function(d,g){return i[k(1102)](d,g)},hgpCQ:function(d,g){return d<g},sHFGd:function(d,g){return i[k(1102)](d,g)},WcCmO:function(d,g,w){return i[k(990)](d,g,w)},HxoNE:function(d,g){return i[k(599)](d,g)},NSsIG:function(d,g){return i[k(874)](d,g)},vuCFR:function(d,g){return i.LCpfi(d,g)},DMNkq:function(d,g){return d!==g},Girpg:function(d,g){return i[k(1256)](d,g)},nnnBm:function(d,g){return i.ImqYC(d,g)},eHmFg:function(d,g){return d&g},AVLBs:function(d,g){return i[k(1260)](d,g)},BHUQi:function(d,g){return i[k(833)](d,g)},SpiUQ:function(d,g){return i[k(1260)](d,g)},ZPvUl:function(d,g){return d|g},XYsvN:function(d,g){return d>>>g},CtVuN:function(d,g){return i[k(439)](d,g)},hBfPO:function(d,g){return i.hQGgE(d,g)},uQKhw:function(d,g){return i.JSmso(d,g)},CgXam:function(d,g){return i[k(1128)](d,g)},iLGbi:function(d,g){return i[k(236)](d,g)},wNXcO:function(d,g){return i[k(907)](d,g)},FFVLL:function(d,g){return i[k(874)](d,g)},hekGm:function(d,g){return i[k(313)](d,g)},AERsB:function(d,g){return i[k(879)](d,g)},FwZUJ:function(d,g){return d&g},vylaR:function(d,g){return i[k(874)](d,g)},IvXXN:function(d,g){return i[k(1622)](d,g)},YORAI:function(d,g){return i[k(903)](d,g)},MxxHh:function(d,g){return i[k(1622)](d,g)}};if(i[x(1589)]!==i.UFhkM){let d=f[x(480)](_0x1f0f7a[x(371)],0),g=f[x(480)](f[x(850)](f.JzbFx(_0x499d54[x(371)],28),f[x(1602)](_0x324bd2[x(1075)],4)),0),w=f[x(873)](_0x9512c2.high,24),b=f[x(184)](0,w)?f[x(1086)](0,g)?f.BfsVw(d,16384)?f[x(1089)](d,128)?1:2:f.hgpCQ(d,2097152)?3:4:f[x(1585)](g,16384)?f[x(1089)](g,128)?5:6:f[x(1089)](g,2097152)?7:8:f[x(1089)](w,128)?9:10,y=f.WcCmO(_0x434caa,_0x34670b,b),C=_0x407e63[x(385)];switch(b){case 10:C[y+9]=f[x(1533)](f[x(1615)](w,7),1);case 9:C[f[x(1510)](y,8)]=f[x(455)](9,b)?f[x(411)](128,w):f[x(1533)](127,w);case 8:C[f[x(546)](y,7)]=b!==8?f[x(411)](f[x(1615)](g,21),128):f[x(1141)](f[x(873)](g,21),127);case 7:C[y+6]=f[x(1130)](7,b)?f[x(411)](g>>>14,128):f[x(1528)](f.wsQoJ(g,14),127);case 6:C[f.nnnBm(y,5)]=f.SpiUQ(6,b)?f[x(488)](f[x(935)](g,7),128):f[x(1528)](f[x(226)](g,7),127);case 5:C[y+4]=f[x(1130)](5,b)?f.hBfPO(128,g):127&g;case 4:C[f[x(302)](y,3)]=f[x(802)](4,b)?f[x(1034)](f[x(807)](d,21),128):f[x(1209)](d,21)&127;case 3:C[y+2]=f.DMNkq(3,b)?f[x(1404)](f[x(978)](d,14),128):f[x(1064)](f.vylaR(d,14),127);case 2:C[f[x(546)](y,1)]=f[x(1130)](2,b)?f[x(1119)](d,7)|128:f[x(961)](f[x(1289)](d,7),127);case 1:C[y]=b!==1?f[x(543)](128,d):127&d}}else i.ENLoy(c,IDBCursor)&&Dr[x(885)](c,r)})[e(1360)](()=>{}),Ln.set(o,r),o}function tx(r){let e=S,i={iblRm:function(c){return c()},RIUbs:e(1484),zMUxb:function(c,x){return c(x)},lmYtw:"AbortError",bcHfO:e(939),puPiv:e(889),RPERE:e(263)};if(Tn.has(r))return;let o=new Promise((c,x)=>{let f=e,d={BQNYN:f(889),GzaIG:i[f(747)]},g=()=>{let y=f;r[y(923)+y(1204)+"ner"](d[y(571)],w),r[y(923)+y(1204)+y(231)](d.GzaIG,b),r[y(923)+"entListe"+y(231)](y(263),b)},w=()=>{let y=f;i.iblRm(c),i[y(179)](g)},b=()=>{let y=f;if(i[y(474)]!==i[y(474)])return this[y(1438)][y(1110)+"te"];i[y(771)](x,r[y(939)]||new DOMException(i.lmYtw,i.lmYtw)),g()};r[f(1380)+f(934)](i[f(479)],w),r.addEventListener(i.bcHfO,b),r[f(1380)+"Listener"](i[f(1459)],b)});Tn.set(r,o)}function nx(r){Rn=r(Rn)}function rx(r){let e=S,i={HJhjH:function(o,c){return o(c)},YQlOy:function(o,c){return o(c)},uAWmQ:e(800)+e(667)};return r===IDBDatabase[e(1148)+"e"].transaction&&!(i[e(665)]in IDBTransaction[e(1148)+"e"])?function(o,...c){let x=e,f=r[x(1407)](i[x(1003)](Mt,this),o,...c);return Pr.set(f,o[x(651)]?o[x(651)]():[o]),Ee(f)}:Zc()[e(1131)](r)?function(...o){let c=e;return r.apply(Mt(this),o),i[c(1003)](Ee,Dr.get(this))}:function(...o){let c=e;return i.YQlOy(Ee,r.apply(i[c(293)](Mt,this),o))}}function sx(r){let e=S,i={PVYGI:e(1605),NFKns:function(o,c){return o(c)},bnNUb:function(o,c,x){return o(c,x)},MEavP:function(o){return o()}};return typeof r===i.PVYGI?i[e(413)](rx,r):(r instanceof IDBTransaction&&i[e(413)](tx,r),i.bnNUb(Ni,r,i[e(225)](Qc))?new Proxy(r,Rn):r)}function Ee(r){let e=S,i={mELsk:function(c,x){return c instanceof x},iTZkl:function(c,x){return c(x)},UBHuS:function(c,x){return c(x)},UiiBM:function(c,x){return c!==x}};if(i[e(1146)](r,IDBRequest))return i[e(475)](ex,r);if(Dn.has(r))return Dn[e(1621)](r);let o=i[e(1247)](sx,r);return i[e(1197)](o,r)&&(Dn[e(885)](r,o),Ln[e(885)](o,r)),o}var Ni,Pi,Di,Dr,Tn,Pr,Dn,Ln,Rn,Mt,Ii=Ri({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={pHJGD:r(1623),NdowV:function(i){return i()},LDjLl:function(i,o){return i instanceof o},VCTHN:function(i,o){return i===o},BdQmb:r(1125),Ascro:function(i,o){return i===o},hVZdB:"done",UyQJS:function(i,o){return i===o},UdCbN:"objectStoreNames",zlEcj:function(i,o){return i===o},rHNRM:r(396),hoPeB:function(i,o){return i(o)},rnYrl:function(i,o){return i instanceof o},fHOHe:function(i,o){return i in o}};Ni=(i,o)=>o[r(1409)](c=>i instanceof c),Dr=new WeakMap,Tn=new WeakMap,Pr=new WeakMap,Dn=new WeakMap,Ln=new WeakMap,Rn={get(i,o,c){let x=r,f={tVNBb:e[x(945)],nykOS:function(d){return e[x(1633)](d)}};if(e[x(462)](i,IDBTransaction))if(e[x(616)](e[x(1214)],e[x(1214)])){if(e[x(1040)](o,e[x(416)]))return Tn[x(1621)](i);if(e[x(866)](o,e[x(221)]))return i[x(800)+x(667)]||Pr[x(1621)](i);if(e[x(1016)](o,e.rHNRM))return c.objectStoreNames[1]?void 0:c[x(800)+x(1145)](c["objectSt"+x(667)][0])}else this[x(1343)](f[x(1101)],_0x507d31[x(1200)]),f.nykOS(_0x15ea62);return e.hoPeB(Ee,i[o])},set(i,o,c){return i[o]=c,!0},has(i,o){let c=r;return e[c(1636)](i,IDBTransaction)&&(e[c(1040)](o,e[c(416)])||e[c(616)](o,e[c(617)]))?!0:e[c(467)](o,i)}},Mt=i=>Ln[r(1621)](i)}}),Oi={};$c(Oi,{deleteDB:()=>ox,openDB:()=>ix,unwrap:()=>Mt,wrap:()=>Ee});function ix(r,e,{blocked:i,upgrade:o,blocking:c,terminated:x}={}){let f=S,d={uGmUO:function(b,y,C,P,I){return b(y,C,P,I)},pvHZk:function(b,y){return b(y)},yFKnc:f(1279)+f(346),heFWv:f(1548)+f(987),SkYqr:f(1461)},g=indexedDB.open(r,e),w=Ee(g);return o&&(f(1319)!==f(1319)?_0x53fe4a[f(251)](_0x1af02e):g[f(1380)+f(934)](d[f(859)],b=>{let y=f;d[y(1252)](o,d.pvHZk(Ee,g[y(585)]),b[y(465)+"on"],b[y(920)+"on"],Ee(g[y(770)+y(327)]))})),i&&g[f(1380)+f(934)](d.SkYqr,()=>i()),w[f(1e3)](b=>{let y=f;x&&b[y(1380)+y(934)](y(1403),()=>x()),c&&b[y(1380)+"Listener"](d.yFKnc,()=>c())})[f(1360)](()=>{}),w}function ox(r,{blocked:e}={}){let i=S,o={zdUtI:function(x,f){return x(f)}},c=indexedDB[i(738)+i(624)](r);return e&&c[i(1380)+i(934)](i(1461),()=>e()),o[i(902)](Ee,c)[i(1e3)](()=>{})}function Ti(r,e){let i=S,o={hHBOA:function(g,w){return g<w},IVQgq:function(g,w){return g<w},DRUrn:function(g,w){return g===w},KchkC:function(g,w){return g&w},AdrdJ:function(g,w){return g===w},Yfsjh:function(g,w){return g+w},OmxTr:function(g,w){return g!==w},fqrlj:i(1618),SRMkA:function(g,w){return g instanceof w},mGPru:function(g,w){return g in w},aECPe:"string"};if(!(o[i(1228)](r,IDBDatabase)&&!o[i(560)](e,r)&&o[i(968)](typeof e,o[i(1241)])))return;if(In[i(1621)](e))return In[i(1621)](e);let c=e[i(1317)](/FromIndex$/,""),x=e!==c,f=Mi[i(1131)](c);if(!o[i(560)](c,(x?IDBIndex:IDBObjectStore).prototype)||!(f||Bi[i(1131)](c)))return;let d=async function(g,...w){let b=i;if(o[b(996)](o[b(1639)],o[b(1639)])){let y=0,C=0;for(let P=0;P<_0x359af8[b(1620)];++P)C=_0x1a017a.charCodeAt(P),o[b(191)](C,128)?y+=1:o[b(214)](C,2048)?y+=2:o.DRUrn(o.KchkC(64512,C),55296)&&o[b(287)](64512&_0x12ab28.charCodeAt(o[b(642)](P,1)),56320)?(++P,y+=4):y+=3;return y}else{let y=this[b(770)+b(327)](g,f?"readwrite":"readonly"),C=y.store;return x&&(C=C[b(573)](w[b(1513)]())),(await Promise[b(797)]([C[c](...w),f&&y[b(1198)]]))[0]}};return In[i(885)](e,d),d}var Bi,Mi,In,ax=Ri({"node_modules/idb/build/index.js"(){let r=S,e={kOoNU:"2|0|4|5|"+r(1018),VbTfH:function(c){return c()},KwyZy:function(c,x){return c(x)},VKScH:function(c){return c()},RNAbm:r(1621),sfsKU:r(668),swatv:"getAll",vYfbA:r(701)+"ys",dHOmA:r(813),ihkpi:r(1581),knwsf:"add",fiWLO:r(1276)},i=e[r(1671)][r(460)]("|"),o=0;for(;;){switch(i[o++]){case"0":e[r(1600)](Ii);continue;case"1":e[r(549)](nx,c=>({...c,get:(x,f,d)=>Ti(x,f)||c[r(1621)](x,f,d),has:(x,f)=>!!Ti(x,f)||c[r(554)](x,f)}));continue;case"2":e[r(409)](Ii);continue;case"3":In=new Map;continue;case"4":Bi=[e[r(1046)],e[r(1002)],e[r(1275)],e[r(481)],e[r(1314)]];continue;case"5":Mi=[e[r(575)],e.knwsf,e.fiWLO,"clear"];continue}break}}}),cx={idb:function(r){let e=S;r[e(724)]=Promise.resolve()[e(1e3)](()=>(ax(),Oi)).then(function(i){return i})}},Li={};function Ce(r){let e=S,i={tlXBm:function(d,g){return d!==g}},o="4|1|0|3|2".split("|"),c=0;for(;;){switch(o[c++]){case"0":var x=Li[r]={exports:{}};continue;case"1":if(i[e(1668)](void 0,f))return f[e(724)];continue;case"2":return x[e(724)];case"3":cx[r](x,x[e(724)],Ce);continue;case"4":var f=Li[r];continue}break}}function k(r,e){r=r-156;let i=Nn(),o=i[r];if(k.TthaKT===void 0){var c=function(g){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",b="",y="";for(let C=0,P,I,T=0;I=g.charAt(T++);~I&&(P=C%4?P*64+I:I,C++%4)?b+=String.fromCharCode(255&P>>(-2*C&6)):0)I=w.indexOf(I);for(let C=0,P=b.length;C<P;C++)y+="%"+("00"+b.charCodeAt(C).toString(16)).slice(-2);return decodeURIComponent(y)};k.cfhaCy=c,k.wLlFbn={},k.TthaKT=!0}let x=i[0],f=r+x,d=k.wLlFbn[f];return d?o=d:(o=k.cfhaCy(o),k.wLlFbn[f]=o),o}function Nn(){let r=["ENDrqvu","zLDVswq","mJi4nZyWnLPeyMLpDa","Avnwy2K","y2HnyxHuCMK","DNrbCem","CNzHBa","Dvz6vNG","u2zUrMG","z2vrDwv1zuW","C3DHDhy","zgvSzxrL","werdr3u","yuLSBMS","DMvYC2LVBMm","s2rUr1m","rejhuwm","zNjVBuHHC2G","yLvJq0e","yw1LoIa","qw96txe","shvtz0S","x2vUzhbVAw4","uxvLDwu","txH4sgG","v3beD0O","z3bSBfK","CxLhs2i","wKD0s3C","yLfzy2q","B3fjt20","BgLZDgvUtMu","De12teG","A1n0yxr1C0m","x3jLBw92zvC","C2v0q3vYC28","Cgjwuhu","weP4zfa","wNz6s0O","D3nZoI8V","x2fKzfDZtgK","wNH2twm","DhLWzq","A2XMrLC","BNvTyMvY","A0foAhC","CNjVCK1LC3m","ywnRDxbfBMq","ugHctKW","zeHpBue","yNvMzMvYzwq","ueLkEMm","CMvWBgfJzq","vMjRt1G","r0HrBfe","t3Pgrvy","ihrPBwvZ","x3bPBMC","sw1xy3C","C0jf","zgv2AwnLx2K","uLPPv1q","DgLTzw91Da","AhLosNy","t1rvww4","AevYCM9Yrxy","CMvWBgfJzui","A0DqA3O","C2vUDa","BhrPCgXLihq","yw51Ce1LC3m","vufRze0","DezpzNi","ALfbzvO","DwTLzKm","AgvHzgvYCW","AxmGDw5Kzwy","B2zM","x2rLyNvN","BfH0v2e","zM9YrwfJAa","zxrxB3jRq2G","zw50zwqGDhK","v2f4vKq","yxv0BW","twLZC2LUzYa","tuzTyuW","zNjVBunOyxi","q0Xxrhq","y3r4","BNrLCG","wuLrAwG","CezOuwO","AwPVCMC","yxGGCMv0CMK","y2f0y2G","sKnmCfq","CMfTugfYyw0","AgzvB20","mtb8nxW4FdC","v2ncr0O","AK5jv1G","zNjVBujPDhm","swXdt0e","tg9JAW","uMPLshO","BerQyKW","r2TQqKO","DMvICu8","ChjVy2vZCW","zwvsCwC","EKDzwhi","zMXVB3i","C0n5Ahy","z2vtEw5J","ywrKrxzLBNq","swfpEMK","DMryqMO","wMfYywe","CNnVCL9Uyw0","wwfADui","tgzeDKW","BK1QwhG","C3vIC3rYAw4","t0XeD3G","tuPMvwu","zMX1C2HfEha","ruPyvey","uKzJqwi","CvbPEwm","rujKD2u","z1rPBwvVDxq","x2n1CNnVCK0","yvn0Afu","B25ozxr3B3i","C2fNzq","yMrFzgLK","A3DZEvC","y2XVC2u","AgvRr20","tKjfyvy","y2vZC0HHBMq","y2fSBa","tLrcuNu","C29Tzq","ywDLrxzLBNq","C3rHCNq","zw1PDa","x2HHBMrSzvi","x3jLywr5q2W","zw5KCg9PBNq","x19LC01Vzhu","Axbbtw8","x0vysvnu","y29Uy2f0","CM92AwrLihy","y3vYC29Yx24","DMfkAKe","qujMqui","BK5PCfe","y3vYCMvUDeu","ENLQu3a","qujswKq","D3jPDgvvAw4","CIb0DhDjra","ywnRtxnNswq","wxHzDfC","uK5xyKm","quHxAMe","y29UBMvJDa","C3rYAw5N","zgf0yq","zfDVCMTLCKC","x3nVy2TLDa","AwzxvNq","y3vYC29YlNm","vwjxq0y","qxnZAwK","AwXSihvZzsa","DxnLCKLW","mtu4mJqYmhv1sxLhvW","uLrlENK","qxbWBhO","D0L2s3y","q0Xpu0ve","ywrLyxe","sMP4wwW","Bg9IywXty28","CMfNzvn5BMm","wMPpywe","zKDpy0y","tfLPsee","s1rczwW","swfJv2m","uLbfuKu","y2ner0K","yMXVy2TLza","q3HrtgK","D3jPDgu","vhPLzei","DLbzvw0","BgLTAxq","whbPvxy","wwrZENG","B2vMB08","y29UBMvJDca","zw5NDgG","CujZrLy","qLPdqxG","AgHUB2K","tuvtu0fhrv8","s2rxr1a","qLbvqxK","CgLUz0LUDgu","v2LUzg93","te9MveC","EKHHsK8","yMDoBve","x2LZv29YA2u","zNf5Ceq","sfbmz1q","yLPJB1C","Ahr0Chm6","BwvKAwf0zwW","BfrPBwvVDxq","r1rqAfq","AuDsEwi","y29UBMvJDeu","wLDTsgG","x3nLBMrby2S","wvL1r1q","CLPuvhy","zMLSzw5HBwu","x3bHDgHlzxK","y2HHCKnVzgu","B2fK","mhW0Fdf8mNW","CgLUz19VBMm","zxDIuuO","yxzkyMW","x2DLBMvYyxq","CgLUz09Uy2u","D24GCMvHC28","AenJCwS","B09JrhC","DNvdrLi","q0XZyKG","AfLuwgu","C2HPzNq","AMTkDuy","yKnnt1y","x2LZtwLUAvC","y3jLyxrLq2W","y3vYDMfSDwu","Bg1oEhq","y3bOELi","AxnVqum","x3bYzwzPEa","zxmGCMvHy2G","CvrzufC","EuPvq0i","thLYv3m","AgfZt3DUuhi","qKHvuwK","x29Uq2XVC2u","BwfUDwfSihi","y3jLyxrLrxi","vw1QB0e","shHVtKu","CMvTB3zLq2G","yMfJA3vWigu","B0PAthe","wxn6uM4","wu9xCKu","z2v0q3vYCMu","zvD1wg8","z2rNswG","CxbyseO","BM5UDKq","AwHSvvu","twvZC2fNzuu","wwvsuuW","AMHsB08","DxbNCMfKzw4","BMrWB2LUDca","DNHIB0i","Ag9SD20","EvrxvLu","r05UtuW","wvvMzKu","AgXOEeG","zMzMzG","qw1VDw50","AxnmB25N","wMDKwKe","B0nPsu8","BgXsCuG","C0Xf","rNDnCe8","tejeB0u","r3ncDLq","yMfSrxzLBNq","mtbhtMfbtgC","Cw9Z","z21TA2C","AfPpAwW","vwTftgC","rKLRsfC","DKzUuvi","yvLVwwi","qxrgwhC","B0vgBue","yMLUza","BgLns24","q3vZDg9Trxi","DxrVuMvJB24","Chv0","BMvJDa","wgXdv3e","z1b3vge","C0Hgr2q","yLbwq0S","q1jzC1K","y29UBMvJDgK","vuzOA00","CNnVCL92ywW","uKHOB2u","AwDHDg9Yt24","B2nRzxrtDwm","BNnLsxy","zgrjrcWGzgu","Aw9Ul2PZB24","uKPswxC","Buv4zg4","AwXK","vMjuzKG","tgnqAeG","q1bIyw0","CMflvfC","z2vY","zNvUy3rPB24","CM9YrxzLBNq","wNjXzLi","qKPeB0S","ExvIv1K","ignVzgu6ia","rvntsNi","BNPywg8","mhWXFdn8mNW","DhjPzxm","tLnZsuC","tLzYvhq","Dg9oDw1Izxi","z014she","r0X5BKS","BgvUz3rO","z2v0","rgPwweu","CMvJzwL2zwq","zuH4weG","B3bLBIa","D3jzDKy","EMX0t2G","Ahfpt0y","qvDoyKq","v3nJDvK","su5tvefova","whnRy2K","tMrVD1y","zxjFDhrS","B3nLrxzLBNq","CM5zCMW","DxbKyxrLq3u","quTbrNu","zNfYBgO","x2HHBMrSzu8","Bg9Nsurhzw4","ywDL","zxvYr0u","CxfPuxi","BfroCNu","wLLKvKK","reiGzMfPBgu","Aw5KzxHpzG","D2TvCgK","zhf4r3i","yvv2BhO","x3bYB3rVy28","DuP3ze4","A29IuwK","tuTVv08","uw9cvMe","CMvZzxrfBMq","yuLjA0K","te9Nru4","yw1Lu3bHy2u","DhbizwfKzxi","s3LZBgK","B0jlANu","yKv4rw4","ywXntem","Dw5KzwzPBMu","DxrMofDYAxq","DgXyqM0","r2jnAKu","DMLJzuLeig8","A09VtLu","q3DkzMG","AgvHzgvY","sNnzzhi","wMfSEuq","CMrJvMy","zgLZCgf0y2G","D3HHrNi","A1zjEfC","BerLuey","lcbTyxGGCMu","u3rYyxrLz3K","thLyvMO","x29WDgLVBNm","yuLkB0m","DgvZDa","vLHQCuW","x3DZsw5ZDge","uxjdugW","x2LUAxrhBg8","DerNrxu","AxnbCNjHEq","Bg9NsurozxC","C2jlBLe","BgPdCvO","rNPnAgm","BNHVrw4","AhzlC0q","AenSB3nLrxy","AwjSuM0","ihjLy29UBMu","yNL0zu9MzNm","wNjpBMK","DMfSDwu","EKXfruu","zw5HyMXLqxu","x2rPC3bHDgm","ndy1nda4odftvgHivKi","rfbTuMi","Au9lrg8","AgPmDgS","AeHct0e","Dg9VigXHCMC","BhLSt1m","vMjNzuC","D2fZq2XLyw4","B1H2t00","Dg9tDhjPBMC","uhLjwha","Cw5ssg8","wu1Mrhy","q0TNwu0","Eujmt2u","C2v0u3rVCMe","CvfYrMu","u294BLm","Au9XDfG","ALrmAxC","s3HMueO","rNLVrvC","vw5Oyw5KBgu","DgLUzYbZzxi","CenXwuy","C2j6ANK","svzrz3e","Dxrjza","y2XVC2veqG","q0HXCNC","zgvJB2rLzey","z3vYEeG","x29UtwvZC2e","vwrdyK4","zcbLCNjVCI4","AgzgywS","C3v3sge","tuvHDLa","q3rwDu4","C3vJy2vZCW","Dwz3AwW","icSG","Cgf5Bg9Hzeu","BMvY","BM5Ly3q","uMjkt0m","t1bftL9fuLi","CYbWyxjHBxm","EhHAB0m","De5YvLO","lcbOB3n0BMe","x2rLC3rYB3K","BMDLza","ANPnBLi","DgnjthK","BerTBgG","BML0AwfSAxO","BND4BNG","seD1q2q","r0DuBLC","y29UC3rYDwm","C2vYDMLJzq","CgLUz1rPBwu","ChvZAa","D2L4qMK","q3vZDg9Tq2W","ze1NEwi","yuzksfm","yvzXveC","A2v5CW","z1rRtvu","tMzdy2C","uM1RDLG","B2zMBgLUzq","zvvYBa","ywjVCNq","ywWGy3vYC28","svLuBwW","z05Ar3m","DgLuv3a","zxjFywnRx20","BgnKEeC","x2TLEvbHDgG","y09OvNK","rfHYwue","CMvZzxrdB3u","BunzrfG","sg5OAhC","BKXPBMu","yNL0zuXLBMC","Dw5ZAwDUzwq","Aw5PDcbrB1m","B3bLBG","CgLUz0XVC3m","qKvetey","C2LUuw0","BxnNsuq","t25vCwy","BMrLEa","qwrYzeO","yxv0B21HDgK","u0zjqNq","mtb8mxWY","r1LIt1K","pxv0zI04","wvfSt3K","ign1CNnVCIa","B25tDg9Wsw0","Axbgsvy","t2jQzwn0","vuTrvM8","BM93","zw1LBNq","yvjrt2W","DvflAhC","DLrbqKm","uLHcBKm","tKfusvzfx0u","EwToA1y","CMvZB2X2zq","BgToEem","y0D5uw8","C2vUzf9Hy2S","CgXLyxnLiha","B2DzBxi","tMfrywW","x2LZsw5PDa","AMfyq3q","Awv2rwm","r2rSu1O","BwX3BMW","BNrfBMrWB2K","BMnVzgLUzW","CuPIwMu","x29UvgLTzw8","D3m6lY8","q2nlAgS","zwrPyxrLBhK","Bwf4uMv0CMK","Aw9U","ndu5mtmWogrxufLvqW","Ae9Wzw5fDMu","Efrurw52","rgncu0u","yMvkChK","q09otKvdveK","A1rdyuq","ihrVihjLDhi","AgvKtwf4uMu","yxnL","ywnR","zxjYtxnN","vxPLB0C","Dxnky3m","Bhm6ia","FdH8oxWWFdm","AwXLx25HBwu","m3W3Fdv8mhW","AgfUz2u","r3fUy2e","thblq2W","wLneufK","r3nzAK8","EKvjyvm","tg9NsurozxC","y3ruAw1LB3u","Dw5RBM93BIa","svzgAuO","z0r1r1q","CMfUzg9T","DxziBxG","BezfzKy","Cwrsrxa","u1vjsNi","A2v0ignVBNm","Dgv4Dc9Qyxy","v3vTsfC","zcWG","CMvJB25Uzwm","yvv0rwe","AMf5Duq","zxH0zw5ZAw8","Dgv4DfbHEwW","Bg93","yNfmv0u","BNrbBMrvCgq","Dg9cExrLC0i","zMzmAw5L","B25mAw5L","thrTDM8","igfYCMf5yNu","yxrLq291BNq","Dwjlv1e","DeLK","C0TfvxG","zuPRCKC","sKLLAK0","yNL0zxm","CfHjCgm","x2rPC2nVBM4","x29Ut3bLBG","yxPhC0e","yLfzzLe","tufyx1jfvfi","C0nbvum","v2XKuLi","zxjHDg9Y","zv90Aw1LB3u","C3rVCMu","EgHssMi","z0nuq2C","o2nOyxjZzxq","qNDptMq","B3jRzxjhBg8","ChjVDg9JB2W","vejLy1m","vMrsu0e","te5vD3u","sxnKteu","suvtx0vsuK8","A2zlsLm","vKTty0G","A2zeywq","r2LYCgC","BIWGAg9ZDg4","tKzlBNm","rKLAAw0","rvjst1i","AfzAzei","tg9Nsuq","ruHKEg4","BwLUzW","zu53rNi","zNjVBNrPzxi","q2nwuNG","tNnXwKO","BwLUAvbYB2C","CYbHBhjLywq","z3HLCKS","q2TjEMG","vuX2wvO","EKXOz3a","D09nsMW","x21LC3nHz2u","CYbPBNn0yw4","DcbSAw1PDa","whH6rMG","DuXnBgC","BMv4DcGPigm","q1bYvNe","zw5HyMXLuw8","A2XUC1u","ywLpBee","q25Pvwe","zufJAW","y29SBM8","yLfXCNO","AwrI","CgjICdi","zNjHBwvuExa","uerhCK0","q1v0zxi","q291BNq","t2rTqNi","DgLTzw91DcW","s2jnChe","q2fWv0K","re1oA3e","zfPRwKm","BgLUzq","yu5LBxC","u0DkzeS","C3bSAxq","svvHEgu","terQtgW","mhW1Fdj8m3W","BwXhugG","B2XKvMvYC2K","z2nMy1e","zKHpsgu","Ae1LC3nHz2u","z1vSwuS","zLHXr2e","yKnprhy","ihzHBgLKigq","ywrKq291BNq","uKLvyNm","AvrAA2W","DLLIzw4","zLrOAKW","DeLUDgvYy2u","ChvqAxy","sNPIrNG","DLLMyKe","A05kAum","l3DZl3yY","Aw50zwDLCIa","y2XVC2uSihC","zwrSrxy","q29Kzq","wLb2vwW","CKXtzK0","z2Txwgi","BK5mshu","C2vYDMvYvgK","x25HDMLNyxq","zgriu2G","vxbKyxrLq28","x2LZtwLUAvq","Dg9Y","BxnN","yNzfDvO","B3bLBKrc","sejKs0q","CwHgEem","wMXfEgC","y3jLyxrLt3a","tw9KDwXL","yNvMzMvY","EhnbAhC","qMzKqMS","wePhqw4","zMzLCG","s25rBxi","DMfS","A2vpAKe","x3bPBMDqB24","AgXysK0","mxWYFdr8nG","yMLUyxj5vhK","D1DTrvK","wLbRvNq","x2n1CNnVCK4","BwPIBvK","EffmvgC","BMvlrfq","CgfYC2u","BeHHBMrSzxi","ruzODK8","CNLSzem","EMjbqvG","EvHODha","rxfHyMu","y2HLy2TdDxi","B3bLCNr5tMe","zMLUza","u2LOzfm","ve5vvKq","y3jLyxrLtwu","y3vZDg9Tshq","mNW0Fdb8mxW","sKrLwxi","swD0z0G","ig1LC3nHz2u","Cwv0uNO","AejMue8","EhPnA0W","BgLUzw5V","BM5UqM0","ALLdExy","A2v5","s3D5wNK","AxnrB1nnzxm","Dg9cExrLC0W","B25TzxnZywC","B25LCNjVCG","AgfZ","DLzXzvK","x194x21Zz18","q09oveLovuu","rLDt","D29oExy","BuDqCNu","tMDTEM4","zLLwu1O","mJrPwK9pEuq","uMDVAw4","B25JBg9Zzq","rNjVBNrPzxi","y2XLyxi","BMfTzq","m3W0Fdz8mNW","vhrgtLq","qLfowu4","BgL6BgC","Aw5KzxG","CMfTzq","AwHRCgK","ChrVCG","tMjnAfa","uu5bDe0","Dhj1y3rVCIa","t3bLBKv2zw4","s3riq3a","lcbxzwjtB2m","yuzyqwW","yNfPrg8","CMvZDwX0","yuLowwu","igzPzwXKoIa","Ec11C2uT","D2X3u3i","C3rVCcbPBw0","ntqZmtq3mhHiAvnpvG","D0fSwvu","CNnVCKzPBgu","FdeXFdj8nNW","vu5Zv2O","C2XPy2u","zxjFAxnFywm","EvLvtMq","v2His3C","vxPXEuu","x2nSzwfYugK","ywzL","vgLTzw91Da","wgTeD0m","CMTLCKDSB2i","yK9hD0y","nhWYFdn8mhW","qw9yuwG","BgPPywu","AxnszwfKEq","C2j4v0G","ywnOzwqSihC","AhPdwNK","serhqwq","wu1bwhy","vKnuse4","CKHouK0","rxjYB3jdB2q","x21PBMLoyxy","u0PgCgG","zxrxv2G","B3vUDa","tuzWyKi","DgfIyxnL","t2zXuwW","B3nLza","twnHrxq","vw5PBxbSzw0","zwLgt1a","AKjLre8","ywfHEKm","zxj2AwnL","v3bJvue","CMLLC0nVDw4","ywnRx2LK","ANzXu0e","mNWZFdb8mxW","B25dBg9Zzq","ywffB0W","ywrKt25L","zgLZywjSzue","wwzZAMG","EvnSzg8","ALH3q3q","AxjuzfK","DvPYsMi","x2HHBMrSzva","Bw1UtxG","Chndww4","yNLL","C29YDa","DgHHBIbSB2m","CNzHBfzHBhu","igzHAwWSig0","ANnXweC","BMCGzMfPBgu","t1vzA0m","tMzoy0i","B25VCgvU","Auvru08","y3jLyxrLuMu","yxbWBhK","Dg9hzw5LCMe","q0Xpu0LorW","DufxBve","ENfOCgq","B3jLtMfTzxm","z2v0s2v5","yxKSig5LDhC","BwLZzq","q0nUseu","zw5JB2rLrNi","DwvQtM4","q1zYCK4","BwvZC2fNzv8","ze1kDgq","zNjVBuj5Dgu","B25SAw5L","DhjPzxmGCMu","EvjLy29UBMu","CMz2Buu","ug5nENa","Ag9iuMK","u1vksxK","B0jREuG","zgvIDwC","D2X3uNa","x3jLy29UBMu","CKfMquq","zM1LAwS","BKrUwuS","se9Nwgm","DgHisgm","yw5Hz2vY","rKLmrv9ot1q","rvbVsNK","z0TfC3e","BNruCMLLC0m","Dev2zw50","rwPeDxC","z2v0qwXSs2u","r2TtwLC","u2TPCcbWyxm","CMvJzxzPzwq","q29UzMLN","BNLnyuy","EeTIqxK","vgLntfC","ywDLsgLKzq","zeTcq3O","thvJBeK","zwPnyum","vwTgEKK","z2vjBMzVu3K","A25urNi","v0rJCMG","B05MDg0","B2LUDfjLywm","z2v0qwXS","DMHXy2S","DwrbEfi","AxbRDeW","rNjvEfi","zxHWB3j0CW","DfLmCvq","ueXWreO","C3rLBMvYCW","C3zSwKO","x3DHAxq","u1jLEee","ww9xvge","y2HnyxHdB3u","B2DrruK","B1PyAfe","vKHJDxK","yKLIqNe","vezZqMC","zgvSzxrLrge","AgHZEfq","yw5Nzq","qwLzB3u","DMvhthK","Dgv4Dc9WBge","BhnwA08","uKDIC0y","uerLCwi","yMnizK8","DMvUDa","rNf1Axe","rLjptLrjrvi","x2LZqNjVD3m","yK56B3C","AMvJDfn0B3i","CgLiEMe","jMPZy2fSBgi","x3bPBMDmB3m","DhDVCMTdAge","DMfSDwvZ","nfDrzKXuAa","uvvdrKm","B25nzxnZywC","nxWXmhW3Fdq","BefJueu","rwrguMm","zMLSDgvY","zM9Yy2u","q0HUB1O","FdeXFdL8mhW","ihn1y2nLC3m","DhjHBNnHy3q","EK1vEgi","y1b2sgu","zgvS","uefOuM0","Bg9N","y3jeExC","CvPmsLm","mdaWmdaWmda","ywDLu2HVDW","rxzhtum","vgTLz1m","ihzHBgLKihm","BNjqt3u","zxf1ywXZ","tMrsyvK","DNflDKq","svzev1i","DhjPBq","rfvwDgG","y29UDgLUDwu","z1vQD0q","x2LUAxrqCM8","y29Kzq","DMvYC2LVBG","q3fyyuG","rffMsuK","ywXS","ue92tuq","EK9otKu","B2jQzwn0u3q","CfLzugi","q2Dyyw0","AhrQvgC","BwvY","vxr0Cgu","rLDfsxa","D05yy08","y09Wzw4","s2rgzLi","v2TLwwS","yxbvufm","uMvHzcbWyxm","y291BNq","rvz2Cg0","t0vjq2m","v1b1tuS","x2LUDgvYDMe","rxzzyLu","EvnkvLG","ywHtvMK","D3jxwxO","C3nHz2vfDMu","sxzgv2u","ihrPBwvVDxq","rKnsBwK","ywXIz2G","ywXty29Wzq","BuD5q2O","x3vYBa","EM9UzMu","vuvbD2e","AeLir3O","yKz0DMW","Cg93","EKHKs0W","yK9vtxG","v1v6Exq","wxzvuui","ywfzt3i","sw9Rs0G","Dw50","s0XZu1C","zfjWrvq","tu9vuLC","whPyBwm","CgnKz2K","De9Kquq","ywrK","u0PbAuy","wuHOCK8","yLDftgm","tNvsseK","DNvdwwS","A0TbqLi","yM9KEq","B0PHyvG","x2rYB3bhBg8","BgXRwfG","Agvgv3y","uhHjzwS","rxvAzfe","EKrrDwi","yxKSihrYEsa","CK1Muva","EK9bque","vxLrsLm","C0XPC3rLBMu","Bwu6ia","ze9YuuC","zhznv2q","z0fdwKm","sMrUB1q","D3nrB0O","zNPis1C","yLvNrfq","vwPZqLm","BfzZrLG","uvjzCwi","Avz4v1y","ChbL","DNntzeK","B25szwnLAxy","ywr2yw5Jzq","y3jLyxrLt2i","C2v0","CfbRzLe","AvjSr3m","s2HRB0C","y29TCgXLDgu","zw5fDMvUDa","A29ZBMq","zNLpzxy","r2nPr1u","z0LxuLa","EwDIB0O","tNvst1u","uwnPvM0","x2n1CNnVCKy","DgvmB2Djre4","uLjpuG","suTQvhm","EMrvDeK","wMj1whq","B25Uzwn0Aw4","qM5ty0S","rfbowxG","teXqruO","BfLJuuu","u2vXsuq","A0jwCLa","DgfYz2v0","AxjLza","rxzLBNq","D2LSBfjLy28","yxP4weO","nNWZFdL8nhW","AxnAzxjV","CgfNzwHPzgu","t1bftG","BMv3vMvYC2K","ywnOzwq","DhHosuq","CMvTB3zLrxy","zw1YvNe","aaaaaaaaaaa","s2vzy0i","DhDRA2W","BwvZC2fNztO","BxHpzK0","vfHRDgG","EgPbvhO","Cg9PBNrbBMq","CgfNzxnOB3C","tgLZDgvUzxi","wfLZDK4","zeroAee","DMDUqNm","tfvJA24","zxjYB3i","z3zqExO","EgX1AK0","CMvHC29U","CgvYC2LZDgu","Ec1TC2CTy3u","CeHkr0q","y3vYCMvUDeK","zw5HyMXLvhi","r01IB0y","sxPtEem","sMXuAum","t0fVBe8","AK1Xsvq","q1rvwwy","z2v0u3rVCMe","Bwf4tg9ZC0m","yMLUyxj5","x1fVu01HBMe","m3W1Fdb8nhW","Exjtz2q","B25tDgfYDfi","wu9squK","DKrzEue","v0LsCLm","tKDFrvjst1i","s2XSsKu","B25pCgvU","vLDeteO","rfjvCM4","AM9PBG","DvvzB1q","CwrlzM0","y3vYC29Yx2y","C3L6wLO","tvjwue8","rfHRuMi","ywXPzcb1CMW","A2zqvKu","quvsC0i","x2zVCM1HDeu","mtK1ntK1ngPisvHkrG","zcWGDw5RBM8","uLDpr1m","B2zMC2v0","rK5Itva","rfzICNy","zwn0","zwvKzwq","uwDKuNO","x2nVBM5Ly3q","tefhyuW","BxzyA1e","C0nVDw50zxi","zw5JB2rPBMC","vLrpDNO","B3v0sw50zxi","t214vhi","Dfz1yMe","txfgAhO","DfztAe4","DgHLBG","ywnRpwzYB24","C2zZs1u","sePOAKG","DufJrKO","vLvkruW","Cgv0zLe","EfH5shq","Ahr0Ca","EgrgELG","igXHCMDLCIa","uMvJB25Uzwm","BKv5y3a","x2DLDeLUDgu","ueDWCuK","AwHgAhm","EMXfy2O","AwXLtMfTzq","m3WX","vhvQCMq","EunLreW","tNjrAwu","x2XPC3rLBMu","v2rKrwm","C2vYDMLJzs0","y3D1D3G","y3vYC29Y","DgvSrfO","yw1L","id4G","CMvUDevUzha","uNLkv08","BNf4qwK","D0DUCxO","AuXhyMK","qKv5zxO","ENvju3G","CMvHzfvjBNq","yxnZAwDU","x29UrxjYB3i","qxnJCM8","A3jzthq","sLnptLa","r0zhBuO","vgfN","DxjS","uK5byM0","C3rYAw5NAwy","CMvXDwLYzwq","EKzTu3u","wgvJq0S","EvfAB3e","BwvZ","uvHPvvK","sejfwNK","BfPpu0i","x2nSzwfYvgK","y0zsqxa","AuLprvm","uuvWs1O","zMjWBM4","BMCGDxjSoIa","EvPgAhK","sxvyDe8","rNDAvuO","EuLutMK","BezSDxnO","zgvMAw5Luhi","swvNzNm","y1DnD1a","Eufrru4","r1zewfa","zMLN","u2HHCMvKv28","BKHrCuG","AgLNAa","ru5euxy","Dg9mB3DLCKm","BgvY","ueLWqwK","B2nRzxq","C3bSAwnL","DgLLCKPtt04","Bwv0Ag9K","sM9KyMS","q3bUrhG","rLvqC3q","CuzbD2m","x2nYzwf0zvm","AgDWq1e","B2nRzxrgywK","CMvKDwnL","z29PBMCGyxC","rKL2DvG","x2jPBMfYEvq","sfLLvKO","BMnLq2XVC2u","BMDuAw1LCG","DMvY","tKPqBum","Ae14B1y","DfzoqMi","BhL6Bg8","te1gBMO","A1HfD0G","CM92AwrLihC","DhfYCwW","uxP2Egy","r09MA1i","v2fWu2G","CMvHzhLtDge","x2LUAxq","y1LPqvq","rLvwywy","ihrYEsbYzwm","EhfPsKm","CwvcrNq","De1HBMfNzxi","AvL1rMi","sxzywe4","qNLUvNO","qu9utxu","ihbYB3rVy28","u2TPDLe","Cg9PBNrdB24","C2Hluuq","z2v0sxrLBq","mtG1ndaXnvbSwfrjza","AufuBeC","z2v0q3vYC28","qvzmqNm","Aw5JBhvKzxm","C2vUza","EwvQCNy","Buzkr3G","q1rSrwS","wwHTv2G","CKThAMC","rgHyuNC","tejMwMu","EgXpEw8","zuHTrMC","zhLvr1a","Aw9UvgLTzw8","D0rwzhG","B3jL","BuvmC2S","rKHfrMK","ChjVDg90Exa","BM9Uzv9UB24","EvH1wvC","zMTXA0W","quXm","zxjYtM8","x2rItMfTzq","B3bLCNr5","v01YB2K","DunvDfG","x29UugfNzu4","rLzqvLO","s3Louuq","rK5WsK0","A2f5wu0","rgvKAwnHDgu","zNjVBu51Bwi","x3DZ","yM5yC1G","zwnVBM5Ly3q","BMrWB2LUDfq","wevXruS","r0zuvNe","B25fCNjVCG","AxnrB1nby2S","u1DotwO","tLHlu3G","wNHfB3O","y29UDgv4Da","Deflv1u","Dw5pDfe","Dwrqzei","y29UBMvJDfm","t21Lt00","tMXfA0m","swzqBKq","x3fVC0rc","veL0we4","x0rctMfTzq","zv9ZDwnJzxm","yMfSu2nVCgu","wu5ywve","nhWXFdy","quHquey","C3jJ","CMD1EuW","BuLiCKO","Cgf5Bg9Hzfq","C2v0sxrLBq","vwLPqK0","zg9Uzq","wNbyse4","BwvZC2fNzq","tuTTu3K","y2XLyxjtDg8","ywXSzwqGBxu","zw50tgLZDgu","yxbWBgLJyxq","y29SuKC","Cgf5Bg9Hza","qxj1A0S","rKzwteW","ue9PweK","whnJwwW","Cgu6ia","Aw1LCYbPBIa","qMrrBwi","y2HLy2Tszwe","ALrqDvG","tMfTzq","EKLZzNi","B3jRig9MzMW","C3vIyxjYyxK","Ew5WvuO","DNLdve8","zMvvz1q","EwzkD2e","s0jPDe4","x3nLCuLK","Ef9MCM9UDgK","u1jnA0e","zw50","uKfNB0C","tgT6tKG","ugjrsg4","q2zSwvi","qu1tDNC","mhWXFdj8m3W","BhnXsLm","ExbL","twXvu3y","BxfdtvO","wLHoBeW","yuvdugu","zLLbs2q","qNjPzgDL","C2HmEwC","B3jpBMXPBMu","wwrOCK8","vujiDvm","CgXqwue","rejoBfO","Afvgt2i","Ec1TC2CTCw8","DuDTvu8","D0fbAva","EwTgsNG","zxq9DxrMltG","Affhz0u","AK1wDxa","A1bdDwG","BwfW","teP2vgq","rhL3C2W","ENbVCwu","v2vIu29JA2u","t0XrwuC"];return Nn=function(){return r},Nn()}Ce.d=(r,e)=>{let i=k;for(var o in e)Ce.o(e,o)&&!Ce.o(r,o)&&Object[i(1067)+i(1155)](r,o,{enumerable:!0,get:e[o]})},(()=>{let r=S;Ce.o=(e,i)=>Object.prototype[r(1527)+r(1155)].call(e,i)})(),(()=>{let r=S,e={Uttpe:function(i,o){return i!=o},dOrQG:r(1666)+"d",zbAAX:r(505),gUjwD:r(1416)+"le"};Ce.r=i=>{let o=r;e[o(805)](e[o(869)],typeof Symbol)&&Symbol[o(197)+o(1044)]&&Object[o(1067)+o(1155)](i,Symbol[o(197)+o(1044)],{value:e[o(528)]}),Object[o(1067)+o(1155)](i,e[o(791)],{value:!0})}})();var Y={};(()=>{let r=S,e={wlwRp:function(s,t){return s===t},zONNE:r(948),OLDwx:r(1175),AiYou:function(s,t){return s+t},cWMwP:function(s,t){return s+t},KeYcB:function(s,t){return s+t},RGbsF:function(s,t){return s*t},LYiHA:r(627),gCTCg:function(s,t){return s(t)},HOgXc:function(s,t){return s+t},aUvlz:function(s,t){return s+t},IvFWe:function(s,t){return s(t)},SGJdK:function(s,t){return s+t},UbWCF:"0000",tOdAD:function(s,t){return s(t)},bUgDT:r(778)+"00000000"+r(778)+r(778),dMgyb:function(s,t){return s||t},lFEfF:function(s,t){return s!=t},NbMhP:r(1666)+"d",jBeDO:r(1205)+"ion/json",hyNJv:function(s,t){return s==t},oNftm:r(743)+"in;charset=utf-8",vFnQR:function(s,t){return s>t},RbJOC:function(s,t){return s!==t},LfDvL:r(1112),aSthU:function(s,t){return s<t},kosnd:r(539),krYLt:function(s,t){return s>t},lkNxC:function(s,t){return s<t},mlFmS:function(s,t){return s!==t},OdmBr:r(1019),qqiQr:function(s,t){return s!==t},SFIBt:function(s,t){return s-t},PDGrM:function(s,t){return s<t},ZgdZA:function(s,t){return s-t},IfPnD:function(s,t){return s<t},RJRYw:function(s,t){return s!==t},NfNcB:r(1561),nMjXx:function(s,t){return s===t},DBNlZ:r(162),HDGAd:function(s,t){return s!==t},QUCFC:function(s,t,n){return s(t,n)},MFmaL:function(s,t){return s(t)},RXBnC:function(s,t){return s>>>t},WddEc:function(s,t,n){return s(t,n)},ZSDPY:function(s,t){return s&t},GONtZ:r(1350)+"required"+r(587)+r(548),gkWXb:"Missing "+r(1048)+r(587)+"value",oCiIO:function(s){return s()},dMJtd:function(s,t){return s(t)},WMroi:function(s,t,n){return s(t,n)},xzMkL:r(1200),PIJzc:r(237),QiwQG:r(931),RjeHz:function(s,t){return s!==t},EZmvK:r(1074),sbKnQ:function(s,t){return s!==t},aVqTG:function(s,t,n){return s(t,n)},xdFzX:function(s,t){return s!==t},vuCYk:function(s,t,n){return s(t,n)},lDePF:function(s,t){return s(t)},BfdBk:function(s,t){return s!==t},NJPmC:function(s,t){return s!==t},mIHrJ:function(s){return s()},AKAFu:function(s,t,n){return s(t,n)},kfPVE:function(s,t,n){return s(t,n)},GciGU:function(s,t,n){return s(t,n)},fXqGa:function(s,t){return s!==t},RNWbC:function(s,t,n){return s(t,n)},bQqrz:function(s,t,n){return s(t,n)},feUgT:function(s,t,n){return s(t,n)},PIpAi:r(722),cdwXw:function(s,t,n){return s(t,n)},suwHa:function(s,t,n){return s(t,n)},GCMwy:function(s,t){return s(t)},fGOcF:function(s,t){return s===t},kANhw:r(1446),uVzVx:r(681),JsYdr:function(s,t,n){return s(t,n)},ukefC:function(s,t,n){return s(t,n)},yYUNd:function(s,t){return s(t)},veGLy:function(s,t){return s(t)},eiFOP:function(s,t,n){return s(t,n)},kGPkz:function(s,t){return s(t)},vtApC:function(s,t,n){return s(t,n)},TzedB:function(s,t){return s(t)},dRpET:function(s,t,n){return s(t,n)},thHHc:function(s,t){return s(t)},gvPyz:function(s,t){return s&t},AHWja:function(s,t){return s===t},KdWGP:r(1350)+r(1048)+" field: "+r(417),wixBi:function(s,t){return s===t},VJehl:"Missing "+r(1048)+" field: "+r(1083),pkJgn:function(s,t){return s(t)},htlrg:r(628)+r(1347)+r(1212),POvMD:function(s,t){return s>>t},bOGwF:function(s,t){return s>=t},tAKWU:function(s,t){return s===t},YoWTa:function(s,t){return s instanceof t},GTPhT:r(1205)+r(1596)+r(399)+r(292),iYuFb:r(1435),GNnML:r(1149)+"e",JIejM:function(s,t,n,a){return s(t,n,a)},ubKWQ:"oefoO",kBVrP:function(s,t){return s>t},qyGKb:r(703)+"t limit",WjQiS:function(s,t){return s*t},bCODv:r(678),gpllY:r(261),uejNn:r(918),unOtQ:r(739),yQZoq:r(812)+r(433),qZLJS:function(s,t,n){return s(t,n)},aIJoC:function(s,t){return s+t},WPuMK:function(s,t){return s||t},NTBRu:r(1530)+r(1167)+"ing",oBKju:function(s,t){return s===t},IaOzi:function(s,t){return s===t},aaazC:function(s,t){return s+t},NuROU:function(s,t){return s+t},yXuYW:function(s,t){return s&t},nyMaF:function(s,t){return s|t},hfUom:function(s,t){return s<<t},qPiyc:function(s,t){return s&t},WUzyt:function(s,t){return s<t},BJDoK:function(s,t){return s===t},TBecS:"IEtPO",nzXXo:function(s,t){return s(t)},rZTTv:function(s,t){return s+t},TItXN:"SrslY",dyUGP:function(s,t){return s+t},tyQyO:function(s,t){return s+t},FIkHW:function(s,t){return s+t},mqCMZ:function(s,t){return s|t},JjxYl:function(s,t){return s|t},POiXI:function(s,t){return s&t},IokKH:function(s,t){return s<<t},LyrWs:function(s,t){return s&t},tVShN:function(s,t){return s(t)},KyNQD:function(s,t){return s+t},kPCuh:function(s,t){return s|t},SkivQ:function(s,t){return s<<t},svlZJ:function(s,t){return s<<t},FCRmi:function(s,t){return s<<t},Ydszx:function(s,t){return s<<t},WscuY:function(s,t){return s&t},txNID:r(358),VpFbo:r(209),PLpDJ:function(s,t){return s>>t},ZrqfR:function(s,t){return s&t},RXAbU:function(s,t){return s<t},GLynK:function(s,t){return s+t},VbgeG:function(s,t){return s<t},bqiDo:function(s,t,n){return s(t,n)},aiOlA:function(s,t){return s<=t},nNLHu:function(s,t){return s<t},QEpKZ:function(s,t){return s-t},NXKSx:function(s,t){return s+t},uZrJb:function(s,t){return s<<t},FNbMP:r(454),petfQ:function(s,t){return s&t},tYLqT:function(s,t){return s|t},YrniR:r(355),qpXHJ:function(s,t){return s<t},JotkY:function(s,t,n){return s(t,n)},nrPOu:function(s,t){return s<t},WldRR:function(s,t){return s&t},hYTXe:function(s,t){return s&t},HBdKD:function(s){return s()},shLyg:r(702),liMKn:function(s,t,n){return s(t,n)},klfFW:function(s,t){return s|t},EnKdD:function(s,t,n){return s(t,n)},kFCEh:function(s,t){return s&t},CflYR:function(s,t){return s(t)},sinQm:function(s,t){return s&t},QrCPl:function(s,t){return s<<t},CTlEk:function(s,t){return s&t},sCAUC:function(s,t){return s&t},fkqkL:function(s,t){return s(t)},alMLC:function(s,t){return s<<t},tiTWp:function(s,t){return s&t},rLSfM:function(s,t){return s&t},fbpnn:function(s,t){return s(t)},Luxnm:function(s,t){return s&t},qBsFV:function(s,t){return s(t)},tFOfr:function(s,t){return s<<t},KnQmr:function(s,t){return s&t},hMxoV:function(s,t){return s&t},aINYe:function(s,t){return s<<t},QciVm:function(s,t){return s|t},kobQi:function(s,t){return s>>>t},rMfQP:function(s,t){return s<<t},dUNcv:function(s,t){return s>>>t},tMvLH:function(s,t){return s<<t},hfFak:function(s,t){return s===t},BnScK:function(s,t){return s<t},YNXYQ:function(s,t){return s<t},lmNxt:function(s,t){return s<t},kKABR:function(s,t,n){return s(t,n)},MKoWO:function(s,t){return s&t},Eqabe:function(s,t){return s+t},UvXhX:function(s,t){return s!==t},PbQHn:function(s,t){return s+t},zFmSu:function(s,t){return s!==t},RFcAb:function(s,t){return s|t},LOHLY:function(s,t){return s+t},oJaaX:function(s,t){return s!==t},BZCAx:function(s,t){return s|t},VbkOX:function(s,t){return s>>>t},ygboJ:function(s,t){return s!==t},EdFRc:function(s,t){return s+t},lpMBV:function(s,t){return s&t},jkJuF:function(s,t){return s!==t},GGTnW:function(s,t){return s>>>t},CHnoZ:function(s,t){return s>>>t},fYAKd:function(s,t){return s>>>t},hIHGz:function(s,t){return s&t},wAAiP:function(s,t){return s>>>t},gNZGs:function(s,t){return s&t},hqOOF:function(s,t){return s>>>t},yJUCB:function(s,t){return s!==t},mlwnl:function(s,t){return s|t},qdREp:function(s,t){return s&t},UjsBS:function(s,t){return s(t)},Gqnca:function(s,t){return s<<t},xlujM:function(s,t){return s|t},wlwSr:function(s,t){return s<<t},syzZZ:r(372),LBfZe:r(1611),CVrrN:function(s,t){return s|t},QgdRz:function(s,t){return s<<t},HYeVJ:function(s,t){return s|t},kVIxW:function(s,t){return s===t},wSSHu:function(s,t){return s<<t},pXIpc:function(s,t){return s|t},eNwFr:function(s,t){return s+t},cphzR:r(1036),ynpUJ:function(s,t){return s&t},TFsBg:function(s,t){return s&t},Uigis:function(s,t){return s&t},fYVSZ:function(s,t){return s>>>t},IacWc:function(s,t){return s&t},WumHW:function(s,t){return s>>>t},zDQub:function(s,t){return s(t)},OZUhm:function(s,t){return s%t},ZXNlL:function(s,t){return s*t},ewbQJ:function(s,t){return s+t},xWuVv:function(s,t){return s===t},YeRQL:function(s,t){return s===t},ABRZD:function(s,t){return s&t},YxYtW:function(s,t){return s>>>t},GbMjE:function(s,t){return s<<t},vdXBj:function(s,t){return s!==t},kTCaD:function(s,t){return s===t},JlTiC:function(s,t){return s>>>t},LOfTG:function(s,t){return s>>>t},YYuGT:function(s,t){return s===t},mlGPh:function(s,t){return s===t},aNdZY:function(s,t){return s===t},oBkyH:function(s,t){return s===t},iuJRn:function(s,t){return s+t},TNUVD:function(s,t){return s+t},SUIJr:function(s,t){return s&t},iOKDo:function(s,t){return s&t},HuSgK:function(s,t){return s&t},LSeNz:function(s,t){return s>>>t},jYCyv:function(s,t){return s>>>t},bfgSg:function(s,t){return s>>>t},psCYn:function(s,t){return s&t},XzXmc:function(s,t){return s>>>t},zGYXr:function(s,t){return s&t},gmmkg:function(s,t){return s&t},AMSvw:r(305)+r(900),VUJEL:r(333)+r(964),LcPhH:r(391)+"IES_ERROR",lAxtk:r(1475)+r(415),iRlGs:r(234)+"OR",edlEv:function(s,t){return s===t},lZOSB:r(821),kXEwH:"hAJfT",fThjL:r(463)+r(1190),avJbl:r(1235)+"4",AHPPF:function(s,t){return s===t},NVrTt:r(414),aNemw:function(s,t){return s<t},qQrFe:function(s,t){return s-t},ZPkVt:function(s,t){return s!==t},GsYjO:r(835),NjoNf:r(1392),Jldxb:r(1313),BPUAy:function(s,t){return s<t},tDgEu:function(s,t,n){return s(t,n)},Ngmzn:function(s,t,n,a){return s(t,n,a)},jTPuX:function(s,t){return s+t},ifWVt:r(1290),YvUQB:r(1231),ZYdVI:function(s,t,n){return s(t,n)},gPwTa:function(s,t){return s+t},lTNru:function(s,t){return s+t},qFAwc:function(s,t){return s&t},QqPDR:r(1364)+r(768)+r(569)+"1",nNipQ:function(s,t){return s>>>t},YUffE:function(s,t){return s|t},jMqIT:function(s,t){return s<t},nDnYK:function(s,t){return s<<t},holwm:function(s,t){return s&t},FIvuX:function(s,t){return s<t},hoHRi:function(s,t){return s|t},jTLiw:function(s,t){return s|t},XecCK:r(939),sbzjy:"eVmya",pMNKk:function(s,t){return s instanceof t},wJGue:r(210)+r(222),bJtpf:function(s,t){return s===t},UkELg:function(s,t){return s===t},dvMWd:function(s,t){return s===t},YIQih:r(331),TtFNT:function(s,t){return s===t},QvAIu:r(1246),VWDLJ:r(1403),zqhpd:r(280),zsllR:function(s,t,n){return s(t,n)},JCLpT:"utmNo",ejMaC:function(s,t){return s===t},vPYUm:r(830),ENDQv:function(s,t,n){return s(t,n)},jvqSA:function(s,t){return s instanceof t},MlUSv:function(s,t){return s===t},bZcoW:"lQMEc",SJFph:function(s,t){return s>=t},ArukK:function(s,t,n){return s(t,n)},OVCyy:r(826),jMVup:function(s,t){return s||t},lDjbL:function(s,t){return s||t},vebqO:r(1501)+"3",vhqck:function(s,t){return s||t},IzSxC:function(s,t){return s!=t},pCqYF:function(s,t){return s<t},SWNMj:function(s,t){return s===t},xqiJC:function(s,t){return s===t},yITNi:function(s,t){return s&t},QOSUq:function(s,t){return s+t},VdRSA:function(s,t){return s<t},zltOh:function(s,t){return s-t},KdFfR:function(s,t){return s>=t},rdcVf:function(s,t){return s<t},eHxXH:function(s,t){return s<<t},nnnvD:function(s,t){return s>=t},CLWDt:function(s,t){return s|t},CpnDx:function(s,t){return s|t},EjDuw:function(s,t){return s<<t},yAQEN:function(s,t){return s&t},RHhoe:function(s,t){return s<t},SUvhe:function(s,t){return s<t},IKjTs:function(s,t){return s>>t},knTFr:function(s,t){return s===t},xQLTg:function(s,t){return s===t},OLQYG:function(s,t){return s&t},Ovuhb:function(s,t){return s+t},xoNvP:function(s,t){return s|t},XxzFh:function(s,t){return s&t},oqIOm:function(s,t){return s==t},qdKfm:function(s,t){return s(t)},rRYsY:function(s,t,n,a){return s(t,n,a)},rhafF:function(s,t){return s instanceof t},CcKhk:"VUuEx",Dywsl:r(1179),irTdY:function(s,t){return s==t},xUZYu:"boe",wxaFr:r(880),iGRyb:function(s,t){return s===t},OfqQl:r(1649),ogQEI:r(354)+"reason",dDNhA:function(s,t){return s(t)},vgnBs:"script",oJZLq:r(363)+"ascript",ljCqZ:r(755)+r(1001)+r(1082)+"P",CRYsY:function(s,t){return s(t)},sZyJA:"pstVI",oZXhQ:"dFNBj",sbxWH:"rBaAX",zEIaS:function(s,t){return s!==t},cGyQo:"OEorf",sdSqZ:r(1524),vTABC:r(1021),bPVCK:function(s,t){return s|t},lylOS:function(s,t){return s<<t},NuRHI:function(s,t){return s|t},gdgIh:function(s,t){return s<<t},lQiDV:function(s,t){return s<<t},NfCcg:r(1043),hZoyn:r(1629),UNsWj:function(s,t){return s||t},ykNkV:function(s,t){return s||t},adeaq:"PcwPD",Applz:"GWLKK",crDyw:r(716),vqKvD:function(s,t){return s||t},HBEZy:function(s,t){return s(t)},neKDT:function(s,t){return s+t},hzCZy:r(499),woNyv:r(1285),EmsMa:function(s,t){return s||t},MqFhz:function(s,t){return s||t},jpmjV:r(1280),CRbRc:function(s,t){return s||t},IsdLE:r(279)+r(1647)+"d",PAhRm:function(s,t,n){return s(t,n)},yubWY:r(1568),EFhvO:r(675)+"id",yrSgd:function(s,t){return s&t},yTWVU:r(1537),XlCWq:function(s,t){return s(t)},DXkRb:function(s,t){return s(t)},UEAwa:r(227),BwONd:"ping_onc"+r(1187)+"s",uCUtX:"ping_onc"+r(395)+"t",LfxQH:r(271),LUckn:r(461),EBdwe:"x_frontier_qos",jaXCt:function(s,t,n,a){return s(t,n,a)},EVvpm:function(s,t,n,a){return s(t,n,a)},iEQSO:"x_fronti"+r(597)+"k",llkXX:r(1227)+r(268)+"sgid",DVbrv:function(s,t){return s<t},WOSWx:function(s,t){return s<t},XJxdP:function(s,t){return s&t},KLFrv:r(340),gIWRP:"need_ack",uLMlg:function(s,t,n,a){return s(t,n,a)},mvXkQ:"is_ack",eeRqg:function(s,t){return s&&t},GFTVq:r(635),cPvHe:"ack_code",ddHSh:"received",KtHCp:function(s){return s()},duisN:function(s,t){return s(t)},KllJE:function(s,t){return s(t)},aFXAl:function(s,t){return s instanceof t},yCeDL:function(s,t){return s instanceof t},rguyL:"binary",QoBVa:function(s,t){return s<t},bQYcd:function(s,t){return s>>>t},lFMoX:function(s,t){return s(t)},wrYvF:function(s,t){return s+t},ykFJx:function(s,t){return s+t},Rgoin:function(s,t){return s+t},bCMOV:"index out of range: ",GjcmJ:r(1029),UKQVo:r(202),TiMLW:function(s,t){return s>t},HPLgT:r(484)+r(192)+"e",CoMNV:function(s,t,n,a){return s(t,n,a)},YaZuB:function(s,t){return s+t},jXwCt:function(s,t){return s!==t},XxiwE:r(405),VXQCE:r(507),Assii:function(s,t,n){return s(t,n)},rQZoK:function(s,t){return s<<t},ZjOaa:r(607)+"1",eRpfV:function(s,t){return s+t},uUYoT:function(s,t,n,a){return s(t,n,a)},WapSh:function(s,t){return s+t},xJnpP:function(s,t){return s|t},TkegS:function(s,t){return s|t},oAUiR:function(s,t){return s+t},LfblZ:function(s,t){return s<<t},pFhQj:function(s,t){return s|t},FNpJM:function(s,t){return s+t},ImWcw:function(s,t){return s<<t},OEICc:function(s,t){return s===t},qhFxC:r(621),Ltmvo:function(s,t){return s&t},ihFhs:function(s,t){return s+t},vVqeY:function(s,t){return s&t},nqxAi:function(s,t){return s>>>t},bBccw:function(s,t){return s+t},jQAeZ:function(s,t){return s+t},ZZlga:function(s,t,n){return s(t,n)},ijorg:function(s,t,n,a){return s(t,n,a)},DPNYx:r(1598),esZLa:r(1662),DXrYA:function(s,t){return s&t},CwJfh:function(s,t){return s+t},wIvKv:function(s,t){return s<<t},Kemzs:function(s,t){return s<<t},lpOeB:function(s,t){return s>>>t},ogYmr:function(s,t){return s|t},kayYM:function(s,t){return s&t},Hnhhw:r(578),cwuwx:function(s,t){return s+t},ZWmHh:"8|5|7|0|"+r(916)+r(290),UibZk:function(s,t,n,a){return s(t,n,a)},LOgEN:r(1518),WIRrS:function(s,t,n,a){return s(t,n,a)},vyCTO:function(s,t,n,a){return s(t,n,a)},FUVaf:"service",xhRJb:r(1024)+r(568),EvYbU:"name",SoxnS:function(s,t){return s(t)},NsqZJ:r(972)+"ile_name",aFJHS:function(s,t){return s<t},RWOGS:function(s,t,n){return s(t,n)},lizlg:r(695)+r(1418),ljiae:function(s,t,n){return s(t,n)},kkaAO:r(1421)+"ame",RyJWO:"allCursorValues",PnMzp:r(1152),mFJGx:r(557),Iegfs:function(s){return s()},qnRHo:"setdb",xXyHt:function(s,t){return s*t},hCcqk:function(s,t){return s-t},pPkfQ:"lWeXi",KLsSW:function(s,t){return s(t)},SUJIy:"setcursor",MKmSy:function(s,t){return s!=t},wOMJl:r(1084),mUIpq:function(s,t){return s===t},MJfUe:r(242),UkFzI:function(s,t,n,a){return s(t,n,a)},YOWrE:"code",gKEsq:function(s,t,n){return s(t,n)},uAcFJ:"x_frontier_msgid",LuclI:"x_fronti"+r(1634),KzhjI:r(1251)+"s",wGnqz:function(s,t,n){return s(t,n)},IXNiD:r(944)+r(1384)+"e",IVDWR:function(s,t,n){return s(t,n)},HCwGt:r(944)+r(1590)+"ue",aIlnk:function(s,t){return s+t},vsSdI:function(s){return s()},lYcQE:function(s){return s()},fWoId:function(s){return s()},hWGZs:function(s){return s()},pbVPu:function(s,t){return s===t},lcdxG:function(s){return s()},DLDMw:function(s){return s()},srVNe:"RuRqo",bQYfQ:"kFjMe",FVPVZ:"KeKGq",GOfkR:function(s,t){return s(t)},CKgYM:function(s){return s()},ocNwd:function(s){return s()},bExEn:function(s,t){return s===t},mjbmY:function(s,t,n){return s(t,n)},PDeqb:function(s){return s()},kNJiC:function(s,t,n){return s(t,n)},lAcPE:function(s,t){return s!==t},ZxvMc:r(650),ipAMo:function(s,t,n){return s(t,n)},ZalyD:function(s,t){return s===t},NlEkC:"always",yzOuH:r(1349),JjPGb:r(446),aRQOl:function(s,t){return s/t},fnBxu:r(311)+r(1420)+r(976),AoXQh:function(s,t){return s(t)},gTkMU:r(311)+r(1105)+r(235)+r(582)+r(362)+r(579)+r(1341)+"ined",lsqJS:function(s,t){return s!==t},BEDLF:r(752),XDCGu:r(819),GYbOY:r(366)+"t",DOfma:r(590)+r(325)+r(180)+"ct",rhlZm:r(633),ZpXHN:"pageshow",BwHOv:function(s,t){return s!==t},oEFmA:r(671),zOAAA:r(1487),yfJwa:r(1304),nJPCr:r(323),ZBWzQ:r(1401),qeBFt:r(311)+"rovide b"+r(1595)+r(1670)+r(1429),gcfcQ:function(s,t){return s==t},ilsXA:"fws_1.0.0",ZlExg:r(1461),aaEoL:function(s,t){return s(t)},xKbAy:function(s,t){return s!==t},KxfPJ:"afzvP",beJpy:function(s,t,n){return s(t,n)},AOTMu:function(s,t){return s===t},YMAXv:r(1603),emrVq:function(s,t,n){return s(t,n)},CPrVq:r(1411),Zaraa:function(s,t){return s>t},PyIXp:function(s,t){return s-t},dZkZC:r(422),QRYqb:function(s,t){return s(t)},mTBNJ:function(s,t){return s*t},mOzqx:function(s,t){return s>t},iSVci:function(s,t){return s===t},RmkvX:r(1327),LBDoE:r(1092)+r(863)+r(366)+r(211)+r(1098),hlXJM:function(s,t){return s<<t},ahSVi:r(1329),GvQYd:function(s,t,n){return s(t,n)},OAolO:r(452)+r(1114)+r(904)+"g",Qzvxf:function(s,t){return s(t)},KhkoG:r(469),bnXsX:r(689),yXhtp:function(s,t){return s(t)},TQBkq:r(310),CxQLi:r(538)+"3",PGpqI:function(s,t){return s===t},XJGAn:function(s,t){return s===t},CHqrw:function(s,t,n,a){return s(t,n,a)},TXDxl:function(s,t,n){return s(t,n)},hUFOb:r(321),WcBGJ:r(200),NdRaY:function(s,t,n){return s(t,n)},rLpfX:r(1092)+r(669)+r(1219)+"ine",cFRAp:function(s,t,n){return s(t,n)},mCYDX:function(s,t){return s!==t},EeSRR:r(604),aYoYb:r(382),yMnab:function(s,t){return s>t},ivvqB:function(s,t){return s&t},Vtpdq:function(s,t){return s+t},bWELc:function(s,t){return s!==t},zyjSp:"FXVcb",vYben:r(345)+r(516),QxKxB:r(485)+r(425)+"y closed",LKQal:function(s,t){return s==t},Xskci:r(311)+"rovide a"+r(472)+"ata, data must be a string or an"+r(378)+r(510),ZGtKw:function(s,t){return s!=t},lDmlh:function(s,t){return s(t)},Krcsa:function(s,t){return s instanceof t},aIIkI:function(s,t){return s instanceof t},TJQvj:r(1333),xLbNC:function(s,t){return s<t},TXkth:"enqueue",hvKsD:r(1613)+"4",oOcDw:r(1372),YhmWh:"ToTlc",telDZ:function(s,t){return s===t},htjTg:"sGdmv",dCuRs:r(1482),BynVz:function(s,t){return s*t},sCyhv:function(s,t){return s*t},azxXJ:function(s,t){return s/t},SRexA:r(1479),ZrOni:function(s,t){return s!=t},IuXtO:function(s,t){return s===t},DBGQc:r(1163)+r(1437)+r(1452)+"pe",XscYl:function(s,t){return s!=t},apUPS:r(297),jhRoO:function(s,t){return s!=t},eJkrG:function(s,t){return s!=t},vaJjA:function(s,t){return s===t},oELFd:function(s,t){return s===t},zpoqe:"ServiceW"+r(401)+r(1188),MFpbB:function(s,t){return s!=t},OUYkC:function(s,t){return s===t},zHaJO:function(s,t){return s!=t},ZanQe:function(s,t){return s!=t}};Ce.r(Y),Ce.d(Y,{FWS:()=>n0,CustomErrorEvent:()=>ps,createCloseEvent:()=>pe,ReconnectEvent:()=>gs,createErrorEvent:()=>de,decodedFrame:()=>us,createOpenEvent:()=>vs,CustomCloseEvent:()=>ms,createReconnectEvent:()=>or,FrontierMessageEvent:()=>_s,encodeFrame:()=>ir,createMessageEvent:()=>bs,OpenEvent:()=>ys,ErrorCode:()=>qe,Event:()=>st,MessageEvent:()=>ws});let i="";function o(s=""){let t=r;if(e.wlwRp(e[t(799)],e[t(1389)]))return null;{let a=""+Date[t(299)](),u=i||(i=g(s)),p=Math[t(357)]()[t(197)](16)[t(596)](-6);return e[t(741)](e[t(1069)](e[t(926)]("02",a),u),p)}}function c(){let s=r;return e[s(745)](1e4,Date[s(299)]())+Math[s(1377)](1e4*Math[s(357)]())}function x(s){let t=r;return e[t(1456)]==="yrWHK"?_0x27cd32||(_0x39534f=[_0x4c89ff,_0x2028c4,_0xfb2cc7,_0x5333dd,_0x3d662c]):(e[t(398)](Array,8)[t(969)]("0")+parseInt(s,10).toString(2))[t(596)](-8)}function f(s){let t=r;return e[t(692)](e[t(398)](Array,4)[t(969)]("0"),parseInt(s,2)[t(197)](16)).slice(-4)}function d(s){let t=r,n=s.split(/\./)[t(1259)](p=>x(p)),a=[];return a[0]=e[t(398)](f,e[t(1651)](n[0],n[1])),a[1]=e[t(823)](f,e[t(459)](n[2],n[3])),[e.UbWCF,e[t(1441)],e[t(1441)],e[t(1441)],e[t(1441)],t(1556),a[0],a[1]][t(969)]("")}function g(s){let t=r,n=/(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/[t(165)](s),a=/(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))/[t(165)](s);return n?e.tOdAD(d,s):a?w(s):e[t(875)]}function w(s){let t=r,n={keOjA:function(_,v){return _ instanceof v},yZFhy:function(_,v){return _ instanceof v},ipFIV:e[t(630)],lVsFX:function(_,v){return e[t(1328)](_,v)},DPmRb:e[t(717)]},a="",u=[],p=0,h=0,m=!0,l=e.UbWCF;if(e.vFnQR(s.indexOf("::"),-1))if(e.RbJOC(e[t(1386)],t(849))){let _=s[t(460)]("::");for(let A=0;e[t(1398)](A,_[t(1620)]);A++)if(e[t(687)](e[t(891)],t(539))){let N=_[A];if(e.krYLt(N[t(1648)](":"),0)){let R=N[t(460)](":");m&&(p=R[t(1620)]),h+=R[t(1620)];for(let O=0;e[t(308)](O,R.length);O++)if(e.mlFmS(4,R[O].length)){let ie=l[t(1388)+"g"](0,4-R[O][t(1620)]),ce=ie[t(1419)](R[O]);u[t(251)](ce)}else u[t(251)](R[O]);m=!1}else if(e[t(687)]("Tujrd",e[t(451)])){if(e[t(1644)](4,N.length)){let R=l.substring(0,e[t(289)](4,N[t(1620)])),O=R.concat(N);u[t(251)](O)}else u[t(251)](N);m&&(p+=1),h+=1,m=!1}else this[t(1165)]&&this[t(1165)].close(_0x33bd92,_0x219745)}else{if(_0x45198d)return new _0x26c2f8(_0x169ff3[t(1045)],_0x37b2ee[t(402)]);if(_0xebb754||_0x2d4ded)return new _0x300e97(_0x436ae9.url,_0x57c396[t(402)],_0x28cb46.headers);if(e[t(254)](_0x1c3036,_0x32bae7)&&e[t(359)](e[t(577)],typeof _0x52148a)&&_0x184f2f)return new _0xfe1c7e(_0x2f22a3[t(1045)],_0x5d5496[t(402)+"s"])}let v="";for(let A=0;e.PDGrM(A,e.ZgdZA(8,h));A++)v=v.concat(l);for(let A=0;e[t(308)](A,u[t(1620)]);A++)e[t(687)](A,p)&&(a=a[t(1419)](v)),a=a[t(1419)](u[A]);return a}else return this[t(1165)]?this[t(1165)][t(402)]:"";{let _=s[t(460)](":");for(let v=0;e[t(1183)](v,_.length);v++)if(e.RJRYw(e[t(658)],t(1138))){let A=_[v];if(e[t(233)](4,_[v][t(1620)])){let N=l[t(1388)+"g"](0,e[t(289)](4,_[v][t(1620)])),R=N[t(1419)](A);a=a[t(1419)](R)}else a=a[t(1419)](A)}else try{return t(1435)!=typeof _0x4dc93b&&(n[t(513)](_0x554fd4,_0x42fa3b)||_0x5d81f7[t(506)]&&n[t(1062)](_0x1aefa7[t(506)],_0x58ac6d))||typeof _0x24779b!="string"?"":(_0x485c8e[t(524)](_0x53d091),n[t(296)])}catch{return n[t(877)](t(1435),typeof _0x832a88)?n[t(188)]:""}return a}}function b(s,t){let n=r;if(e[n(1249)]!==e[n(1249)])return _0x88c35f&&e[n(1387)](!0,_0x52d4d2.isLong);{let a=s[n(548)];e[n(614)](void 0,a)&&(J(t,10),be(t,a));let u=s[n(183)];e[n(1644)](void 0,u)&&(J(t,18),e[n(760)](be,t,u))}}function y(s){let t=r,n={};e:for(;!ke(s);){let a=e.MFmaL(K,s);switch(e[t(304)](a,3)){case 0:break e;case 1:n[t(548)]=e.WddEc(ye,s,e[t(823)](K,s));break;case 2:n[t(183)]=e[t(1023)](ye,s,K(s));break;default:e[t(760)](re,s,e[t(349)](7,a))}}if(n[t(548)]===void 0)throw new Error(e.GONtZ);if(e[t(687)](void 0,n.value))throw new Error(e[t(490)]);return n}function C(s){let t=r,n=e[t(1560)](ae);return e[t(760)](P,s,n),e.dMJtd(j,n)}function P(s,t){let n=r;if(e[n(1644)](e[n(1316)],e.QiwQG)){let a=s.SeqID;e[n(1644)](void 0,a)&&(e[n(1370)]("nHQqH",e.EZmvK)?(this[n(520)+n(1660)]=_0x49a4ae,this._cursorFileName=_0x153778,this[n(431)+n(161)]=_0x41935b,this[n(1184)]=e[n(1156)](_0xb4bee3,this[n(520)+n(1660)],n(1421)+"ame")):(J(t,8),St(t,a)));let u=s[n(417)];e[n(173)](void 0,u)&&(e[n(256)](J,t,16),e[n(256)](St,t,u));let p=s[n(249)];e.xdFzX(void 0,p)&&(e[n(1156)](J,t,24),e.vuCYk(St,t,e[n(159)](Q,p)));let h=s.method;e.BfdBk(void 0,h)&&(e[n(760)](J,t,32),e.vuCYk(St,t,e[n(847)](Q,h)));let m=s.headers;if(e[n(1099)](void 0,m))for(let ie of m){J(t,42);let ce=e[n(1194)](ae);b(ie,ce),e.AKAFu(J,t,ce[n(1466)]),e[n(977)](Jt,t,ce),e.lDePF(D,ce)}let l=s["payloadE"+n(320)];e.NJPmC(void 0,l)&&(e[n(1023)](J,t,50),e[n(977)](be,t,l));let _=s["payloadT"+n(1237)];_!==void 0&&(e[n(893)](J,t,58),e[n(256)](be,t,_));let v=s[n(1207)];e[n(470)](void 0,v)&&(e.WMroi(J,t,66),e.RNWbC(J,t,v.length),e[n(1638)](jt,t,v));let A=s[n(352)];e[n(233)](void 0,A)&&(e[n(853)](J,t,74),e[n(444)](be,t,A));let N=s[n(492)+n(419)];e[n(508)](void 0,N)&&(e[n(1223)](J,t,82),e.kfPVE(be,t,N));let R=s[n(284)];R!==void 0&&(e[n(1079)]==="ipktL"?(J(t,90),e.cdwXw(be,t,R)):(this[n(1412)](e[n(544)],_0x173996),this[n(552)+"e"]&&this[n(552)+"e"](_0x3cb98e)));let O=s[n(447)+"e"];O!==void 0&&(J(t,96),e.suwHa(St,t,Q(O)))}else return new _0xfee87(_0x240748,{code:_0xd0e5c2,reason:_0x5dcfba,wasClean:_0x346c8d,willReconnect:_0x1608b5})}function I(s){return T(e.GCMwy(q,s))}function T(s){let t=r;if(e[t(1455)](e[t(1310)],e[t(1272)]))_0x27ca1b(_0xdc3803,10),e[t(256)](_0x2bb230,_0x37b59b,_0x3606d5);else{let n={};e:for(;!e[t(1351)](ke,s);){let a=K(s);switch(a>>>3){case 0:break e;case 1:n.SeqID=e[t(1674)](Pe,s,!0);break;case 2:n[t(417)]=e[t(1339)](Pe,s,!0);break;case 3:n[t(249)]=e.gCTCg(K,s);break;case 4:n[t(1083)]=e.IvFWe(K,s);break;case 5:{let u=e[t(598)](z,s);(n[t(1340)]||(n[t(1340)]=[]))[t(251)](y(s)),s[t(1466)]=u;break}case 6:n[t(230)+t(320)]=e[t(1023)](ye,s,e[t(742)](K,s));break;case 7:n[t(1195)+t(1237)]=e[t(760)](ye,s,e.yYUNd(K,s));break;case 8:n.payload=e[t(629)](vt,s,e[t(1332)](K,s));break;case 9:n.LogIDNew=e[t(1270)](ye,s,e.TzedB(K,s));break;case 10:n[t(492)+"ming"]=ye(s,K(s));break;case 11:n[t(284)]=e[t(843)](ye,s,e[t(693)](K,s));break;case 12:n.frameType=e[t(1351)](K,s);break;default:e[t(256)](re,s,e[t(940)](7,a))}}if(e[t(687)](void 0,n[t(909)]))throw new Error(t(1350)+"required field: "+t(909));if(e[t(1433)](void 0,n.LogID))throw new Error(e[t(1476)]);if(n.service===void 0)throw new Error(t(1350)+t(1048)+t(587)+t(249));if(e[t(252)](void 0,n.method))throw new Error(e.VJehl);return n}}function z(s){let t=r,n=K(s),a=s[t(1466)];return s.limit=e[t(1069)](s[t(983)],n),a}function re(s,t){let n=r;switch(t){case 0:for(;e[n(940)](128,se(s)););break;case 2:e[n(224)](Z,s,e.pkJgn(K,s));break;case 5:e[n(760)](Z,s,4);break;case 1:e.AKAFu(Z,s,8);break;default:throw new Error(e[n(1651)](e.htlrg,t))}}function Q(s){let t=r;return s|=0,{low:s,high:e[t(798)](s,31),unsigned:e[t(606)](s,0)}}let _e=[];function ae(){let s=r,t=_e.pop();return t?(t[s(983)]=t[s(1466)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function D(s){_e.push(s)}function q(s){return{bytes:s,offset:0,limit:s[r(1620)]}}function j(s){let t=r,n=s[t(385)],a=s[t(1466)];return e.tAKWU(n.length,a)?n:n[t(1220)](0,a)}function Z(s,t){let n=r,a={KTBel:function(u,p){return e[k(731)](u,p)},HzXIQ:n(743)+"in;chars"+n(1255),piHza:e[n(1490)],HGuCd:e[n(1118)],XEqEK:e[n(1553)],oSkHn:n(956),Fquiq:function(u,p,h,m){return e[n(384)](u,p,h,m)}};if(e.nMjXx(e[n(380)],n(1469))){if(e.kBVrP(e.SGJdK(s[n(983)],t),s[n(1466)]))throw new Error(e[n(1292)]);s[n(983)]+=t}else{let u=a[n(1457)](this[n(163)][n(230)+n(320)],_0x5485a0)?{force:!!this[n(163)][n(230)+"ncoding"].force,encoding:this[n(163)]["payloadE"+n(320)][n(993)]?this[n(163)][n(230)+n(320)][n(993)].replace(/\s/g,"")["toLowerC"+n(337)]():""}:{force:!1,encoding:this._options[n(230)+"ncoding"]?this[n(163)][n(230)+n(320)][n(1317)](/\s/g,"")["toLowerC"+n(337)]():""},p=_0x91a7e6[n(230)+n(320)]?_0x4591b8[n(230)+"ncoding"][n(1317)](/\s/g,"")[n(1077)+"ase"]():"",h=a[n(1457)](this._options.payloadType,_0x4d7f44)?{force:!!this._options[n(1195)+"ype"][n(766)],type:this[n(163)][n(1195)+n(1237)][n(1307)]?this[n(163)][n(1195)+n(1237)][n(1307)].replace(/\s/g,"")[n(1077)+n(337)]():""}:{force:!1,type:this[n(163)]["payloadT"+n(1237)]?this[n(163)][n(1195)+n(1237)].replace(/\s/g,"")[n(1077)+n(337)]():""},m=_0x5ef06f[n(1195)+n(1237)]?_0x132bf2[n(1195)+n(1237)][n(1317)](/\s/g,"")[n(1077)+"ase"]():"",l=h[n(766)]?h.type:m||h[n(1307)],_=u[n(766)]?u[n(993)]:p||u[n(993)],v=[a.HzXIQ,"applicat"+n(1596),a[n(754)],a[n(246)]],A=[a[n(1169)],a.oSkHn];this._options[n(947)+"ansformTextPayload"]&&v[n(1131)](l)&&(!_||A[n(1131)](_))?_0x206145["textPayl"+n(1500)]=a[n(749)](_0x216d8f,_0x9edf5a[n(1207)],0,_0x1b805b[n(1207)].byteLength):_0x2a62b3[n(370)+n(1500)]=""}}function ke(s){let t=r;return s[t(983)]>=s[t(1466)]}function ge(s,t){let n=r,a=s[n(385)],u=s.offset,p=s[n(1466)],h=e[n(459)](u,t);if(e[n(1041)](h,a[n(1620)])){let m=new Uint8Array(e.WjQiS(2,h));m[n(885)](a),s[n(385)]=m}return s[n(983)]=h,e[n(910)](h,p)&&(s[n(1466)]=h),u}function Ve(s,t){let n=r;if(e[n(173)](e[n(1178)],e[n(1178)]))this[n(751)+"er"]&&_0x1ae108[n(923)+"entListe"+n(231)](e.bCODv,this._handleOnLine),this._isBrowser&&_0x22de46[n(923)+n(1204)+n(231)](e[n(1291)],this[n(1640)+"ffLine"]),this[n(751)+"er"]&&_0x54e73a[n(923)+n(1204)+"ner"](e[n(673)],this["_handleP"+n(709)]),this[n(751)+"er"]&&_0x37d1b2[n(923)+n(1204)+n(231)](n(933),this._handlePageShow);else{let a=s[n(983)];if(e[n(741)](a,t)>s[n(1466)])throw new Error(e[n(1051)]);return s.offset+=t,a}}function vt(s,t){let n=r,a=e[n(777)](Ve,s,t);return s.bytes[n(1220)](a,e.aIJoC(a,t))}function jt(s,t){let n=r,a=ge(s,t[n(1620)]);s[n(385)][n(885)](t,a)}function ye(s,t){let n=r,a=e[n(1270)](Ve,s,t),u=String[n(1352)+n(487)],p=s[n(385)],h="\uFFFD",m="";for(let l=0;l<t;l++){let _=p[l+a],v,A,N,R;if(e.oBKju(e[n(349)](128,_),0))m+=e[n(676)](u,_);else if(e[n(1381)](224&_,192))if(e.aaazC(l,1)>=t)m+=h;else if(v=p[e[n(896)](e[n(1069)](l,a),1)],e.yXuYW(192,v)!==128)m+=h;else if(R=e[n(706)](e.hfUom(e[n(940)](31,_),6),e[n(1394)](63,v)),e[n(837)](R,128))m+=h;else if(e[n(1608)]("IEtPO",e[n(403)]))m+=e[n(1612)](u,R),l++;else{let O=this._qosDB[n(954)+n(714)+"nc"](this[n(1522)]),ie=_0x193ff1[n(524)](e.WPuMK(O,"{}"));return _0x28cc2a[n(257)](ie)}else if((240&_)==224)if(e[n(606)](e.rZTTv(l,2),t))m+=h;else if(e[n(1433)](e[n(1185)],e[n(1185)]))v=p[e[n(741)](e[n(1142)](l,a),1)],A=p[e.tyQyO(e[n(1572)](l,a),2)],e[n(233)](e.gvPyz(e.nyMaF(v,e[n(1363)](A,8)),49344),32896)?m+=h:(R=e.mqCMZ(e[n(1451)](e.hfUom(e.POiXI(15,_),12),e[n(840)](e[n(1526)](63,v),6)),e[n(1394)](63,A)),R<2048||e.bOGwF(R,55296)&&R<=57343?m+=h:(m+=e[n(999)](u,R),l+=2));else{let{url:O}=e[n(816)](_0x44c18f,{}),ie=_0x3ba679[n(171)](O)?O:e.hyNJv(e[n(1118)],typeof O)?[O]:[];_0x5d5c96&&_0x4c8a9c[n(1038)](this[n(163)],_0x4214d0),ie&&ie[n(1620)]?this["_endpoin"+n(1117)]=new _0x33be74(ie,this._options[n(326)+"es"]):this[n(1287)+"tManager"]?.[n(1657)+n(1124)+n(1072)](),this._pingLossCounter?.[n(273)+n(1355)](this[n(163)][n(281)+"Count"]),this[n(1414)+n(626)]=!1,this[n(1165)]&&e[n(173)](this[n(1165)][n(1110)+"te"],this[n(1449)])?this[n(387)+"ect"](1e3,e[n(1408)],!0):(this[n(314)]=!0,this[n(989)]())}else e[n(940)](248,_)==240?e.bOGwF(l+3,t)?m+=h:(v=p[e[n(1160)](e[n(1069)](l,a),1)],A=p[e[n(1160)](l+a,2)],N=p[e[n(896)](e[n(1160)](l,a),3)],e[n(349)](e.kPCuh(v|e[n(1123)](A,8),e.svlZJ(N,16)),12632256)!==8421504?m+=h:(R=e.nyMaF(e.JjxYl(e.FCRmi(7&_,18),e[n(825)](e[n(1394)](63,v),12))|e[n(1468)](e[n(1630)](63,A),6),e[n(1526)](63,N)),R<65536||R>1114111?m+=h:e[n(922)]===e.VpFbo?_0x434f28[n(775)](_0x57708f):(R-=65536,m+=e[n(1674)](u,e[n(1572)](e.PLpDJ(R,10),55296),e[n(1651)](e[n(1607)](1023,R),56320)),l+=3))):m+=h}return m}function be(s,t){let n=r,a={gxerK:function(l,_){return l(_)}},u=t[n(1620)],p=0;for(let l=0;e[n(837)](l,u);l++){let _=t.charCodeAt(l);e.bOGwF(_,55296)&&_<=56319&&e.RXAbU(e[n(1619)](l,1),u)&&(_=e[n(1559)](e[n(1123)](_,10)+t[n(1499)+"At"](++l),56613888)),p+=e[n(1183)](_,128)?1:e.VbgeG(_,2048)?2:_<65536?3:4}e[n(584)](J,s,p);let h=e[n(1674)](ge,s,p),m=s.bytes;for(let l=0;e[n(194)](l,u);l++){let _=t.charCodeAt(l);e.bOGwF(_,55296)&&e[n(440)](_,56319)&&e[n(491)](e[n(1572)](l,1),u)&&(_=e[n(1059)](e[n(1174)](e[n(646)](_,10),t.charCodeAt(++l)),56613888)),e.lkNxC(_,128)?m[h++]=_:e[n(1387)](e.FNbMP,e[n(984)])?(e[n(194)](_,2048)?m[h++]=e[n(1210)](e[n(726)](_,6),31)|192:(e.nNLHu(_,65536)?m[h++]=e[n(1006)](e[n(798)](_,12),15)|224:(m[h++]=e[n(706)](_>>18&7,240),m[h++]=e[n(725)](e[n(1607)](e[n(726)](_,12),63),128)),m[h++]=e.ZSDPY(e[n(798)](_,6),63)|128),m[h++]=e[n(706)](e[n(1006)](63,_),128)):_0x3de399(ViLMfD[n(426)](_0x18bc81,_0x3f6018[n(585)]),_0x23c599[n(465)+"on"],_0x9c94ef[n(920)+"on"],_0xfd4be(_0x270c3e[n(770)+n(327)]))}}function Jt(s,t){let n=r;if(e.xdFzX(e.YrniR,n(196))){let a=ge(s,t.limit),u=s[n(385)],p=t[n(385)];for(let h=0,m=t[n(1466)];e[n(1542)](h,m);h++)u[h+a]=p[h]}else _0x34336a[n(307)]()[n(1e3)](()=>{let a=n;this[a(1305)+a(727)]()})}function se(s){return s[r(385)][e.kfPVE(Ve,s,1)]}function Vt(s,t){let n=r,a=e.JotkY(ge,s,1);s[n(385)][a]=t}function K(s){let t=r,n=0,a=0,u;do u=e[t(598)](se,s),e[t(783)](n,32)&&(a|=e[t(1468)](e[t(393)](127,u),n)),n+=7;while(e.hYTXe(128,u));return a}function J(s,t){let n=r;for(t>>>=0;t>=128;)e[n(252)]("GkSZW",e[n(1244)])?(e[n(1578)](Vt,s,e.klfFW(127&t,128)),t>>>=7):(CSsDJD[n(693)](_0x9d436,_0x431a27[n(939)]),CSsDJD[n(501)](_0x59b347));e.EnKdD(Vt,s,t)}function Pe(s,t){let n=r,a=0,u=0,p=0,h;return h=e.yYUNd(se,s),a=e.kFCEh(127,h),e[n(1512)](128,h)&&(h=e[n(1233)](se,s),a|=e[n(728)](e[n(1150)](127,h),7),e[n(283)](128,h)&&(h=e[n(598)](se,s),a|=e[n(168)](e[n(1135)](127,h),14),e.sCAUC(128,h)&&(h=e[n(1151)](se,s),a|=e[n(1665)](e[n(267)](127,h),21),e.rLSfM(128,h)&&(h=e[n(1464)](se,s),u=127&h,e.WldRR(128,h)&&(h=e[n(1060)](se,s),u|=e[n(168)](e.Luxnm(127,h),7),e[n(1630)](128,h)&&(h=e[n(742)](se,s),u|=e[n(392)](127,h)<<14,128&h&&(h=e[n(1472)](se,s),u|=e[n(1337)](e[n(511)](127,h),21),e[n(1100)](128,h)&&(h=e[n(742)](se,s),p=e[n(283)](127,h),e.rLSfM(128,h)&&(h=e[n(693)](se,s),p|=e.rLSfM(127,h)<<7))))))))),{low:a|e[n(586)](u,28),high:e[n(897)](e[n(1654)](u,4),e.rMfQP(p,24)),unsigned:t}}function St(s,t){let n=r,a=e[n(304)](t[n(371)],0),u=e.dUNcv(t[n(371)]>>>28|e[n(1297)](t[n(1075)],4),0),p=t.high>>>24,h=e.IaOzi(0,p)?e[n(223)](0,u)?e.BnScK(a,16384)?e[n(1189)](a,128)?1:2:e.IfPnD(a,2097152)?3:4:u<16384?e.nrPOu(u,128)?5:6:e[n(905)](u,2097152)?7:8:e[n(1519)](p,128)?9:10,m=e[n(854)](ge,s,h),l=s[n(385)];switch(h){case 10:l[m+9]=e[n(1655)](p>>>7,1);case 9:l[e.Eqabe(m,8)]=e.UvXhX(9,h)?e[n(725)](128,p):127&p;case 8:l[e[n(1232)](m,7)]=e[n(1049)](8,h)?e[n(1393)](e[n(304)](u,21),128):e[n(1394)](u>>>21,127);case 7:l[e.LOHLY(m,6)]=e[n(856)](7,h)?e[n(1473)](u>>>14,128):e[n(489)](e[n(1318)](u,14),127);case 6:l[e[n(1174)](m,5)]=e[n(895)](6,h)?e.dUNcv(u,7)|128:e[n(392)](u>>>7,127);case 5:l[e[n(764)](m,4)]=h!==5?128|u:e.lpMBV(127,u);case 4:l[e[n(1496)](m,3)]=e[n(1514)](4,h)?e[n(1258)](e[n(247)](a,21),128):e[n(940)](e[n(767)](a,21),127);case 3:l[e.rZTTv(m,2)]=e.RjeHz(3,h)?e.RFcAb(e[n(1242)](a,14),128):e[n(832)](e.GGTnW(a,14),127);case 2:l[e[n(164)](m,1)]=e.ygboJ(2,h)?e[n(706)](e[n(1253)](a,7),128):e[n(266)](e[n(1628)](a,7),127);case 1:l[m]=e[n(1525)](1,h)?e[n(318)](128,a):e.qdREp(127,a)}}function us(s){return e[r(876)](I,s)}function ir(s){return C(s)}let fs=65536,la=r(925),rt=e[r(1120)](fs,fs),ds=e[r(1378)](rt,rt),ls=e[r(915)](ds,2),ze=String.prototype[r(1499)+"At"];class M{constructor(t,n,a){let u=r;this[u(1558)]=!0,this[u(371)]=e[u(318)](0,t),this.high=0|n,this[u(278)]=!!a}static[r(1558)](t){return t&&t[r(1558)]===!0}static[r(1367)](t,n,a){return new M(t,n,a)}static[r(677)+"s"](t,n,a){let u=r;return a?M[u(677)+u(1562)](t,n):M[u(677)+u(1324)](t,n)}static[r(677)+r(1562)](t,n){let a=r;return new M(e[a(725)](e[a(706)](e[a(725)](t[0],e.hfUom(t[1],8)),e[a(347)](t[2],16)),e[a(347)](t[3],24)),e[a(941)](e[a(1451)](e[a(1258)](t[4],e[a(589)](t[5],8)),e[a(840)](t[6],16)),e[a(1123)](t[7],24)),n)}static["fromByte"+r(1324)](t,n){let a=r;if(e.qqiQr(e[a(973)],e[a(1139)]))return new M(e.mqCMZ(e[a(674)](t[4]<<24|e[a(988)](t[5],16),t[6]<<8),t[7]),e[a(1258)](e[a(1095)](t[0]<<24,e[a(864)](t[1],16)),e[a(1468)](t[2],8))|t[3],n);_0x219812[a(775)](_0x183c98)}static[r(1282)](t){let n=r;return e[n(158)](t,la)?hs:new M((ze.call(t,0)|e.wSSHu(ze[n(1407)](t,1),8)|ze[n(1407)](t,2)<<16|e.tFOfr(ze[n(1407)](t,3),24))>>>0,e[n(1628)](e[n(1239)](e[n(386)](ze[n(1407)](t,4),e[n(825)](ze[n(1407)](t,5),8)),e[n(1665)](ze[n(1407)](t,6),16))|e.rMfQP(ze[n(1407)](t,7),24),0),!0)}toHash(){let t=r;return e.RbJOC(e[t(1520)],t(1036))?_0x396361[t(1037)+"8"]?{value:_0x160db2.readUInt8(_0xeb44c3),offset:e[t(1174)](_0x2a0c0f,1)}:{value:e[t(393)](255,_0x296fff[_0x18e83c]),offset:e[t(420)](_0x5a48d5,1)}:String[t(1352)+t(487)](e.ynpUJ(255,this[t(371)]),e.TFsBg(e[t(1654)](this[t(371)],8),255),e.Uigis(e[t(1253)](this[t(371)],16),255),e[t(562)](this[t(371)],24),e.sCAUC(255,this[t(1075)]),e[t(1394)](e.wAAiP(this[t(1075)],8),255),e[t(1458)](this[t(1075)]>>>16,255),e[t(364)](this.high,24))}static fromNumber(t,n=!0){let a=r;if(e[a(862)](isNaN,t))return n?ha:hs;if(n){if(t>=ds)return pa}else{if(e[a(440)](t,-ls))return ma;if(e[a(606)](e[a(1651)](t,1),ls))return ga}return M.fromBits(e.OZUhm(t,rt)|0,e[a(706)](t/rt,0),n)}[r(1617)](){let t=r;return this[t(278)]?e[t(420)](e[t(1240)](this[t(1075)]>>>0,rt),this.low>>>0):e[t(1503)](e[t(745)](this[t(1075)],rt),this[t(371)]>>>0)}[r(917)](){let t=r;return e.xWuVv(0,this[t(1075)])&&e[t(1546)](0,this[t(371)])}[r(848)](t){let n=r;M.isLong(t)||(t=M[n(1164)+"er"](t));let a=e[n(562)](this[n(1075)],16),u=e[n(1427)](65535,this.high),p=e[n(1431)](this.low,16),h=e[n(1458)](65535,this[n(371)]),m=e[n(1654)](t.high,16),l=e.kFCEh(65535,t[n(1075)]),_=t.low>>>16,v=e[n(737)](65535,t[n(371)]),A=0,N=0,R=0,O=0;return O+=e[n(459)](h,v),R+=e[n(247)](O,16),O&=65535,R+=e[n(896)](p,_),N+=e[n(1654)](R,16),R&=65535,N+=e[n(1174)](u,l),A+=e[n(1242)](N,16),N&=65535,A+=a+m,A&=65535,M[n(1367)](e[n(706)](e.rMfQP(R,16),O),e.GbMjE(A,16)|N,this.unsigned)}[r(784)](t){let n=r;return M[n(1558)](t)||(t=M.fromNumber(t)),e[n(1382)](this[n(278)],t[n(278)])&&e[n(334)](e[n(950)](this[n(1075)],31),1)&&e[n(1663)](e[n(1480)](t[n(1075)],31),1)?!1:e[n(1495)](this[n(1075)],t[n(1075)])&&e[n(1495)](this[n(371)],t[n(371)])}[r(640)](){let t=r;return e.mlGPh(-1,this.low)&&e.aNdZY(-1,this[t(1075)])?M[t(1367)](0,0,this[t(278)]):e[t(685)](-1,this[t(371)])?M[t(1367)](0,e.iuJRn(this.high,1),this.unsigned):M[t(1367)](e[t(535)](this[t(371)],1),this[t(1075)],this[t(278)])}toBytes(t){let n=r;return t?this[n(551)+"E"]():this[n(374)+"E"]()}[r(551)+"E"](){let t=r,n=this[t(1075)],a=this[t(371)];return[e[t(361)](255,a),e[t(189)](a>>>8,255),a>>>16&255,a>>>24,e[t(1286)](255,n),e[t(1150)](e.fYAKd(n,8),255),e[t(767)](n,16)&255,e[t(950)](n,24)]}[r(374)+"E"](){let t=r,n=this[t(1075)],a=this[t(371)];return[e.LSeNz(n,24),e[t(1630)](n>>>16,255),e[t(511)](e[t(547)](n,8),255),e[t(1286)](255,n),e.bfgSg(a,24),e.psCYn(e[t(845)](a,16),255),e[t(1376)](a>>>8,255),e[t(1569)](255,a)]}}let hs=new M(0,0,!1),ha=new M(0,0,!0),ga=M.fromBits(-1,2147483647,!1),pa=M[r(1367)](-1,-1,!0),ma=M[r(1367)](0,-2147483648,!1);var qe=(function(s){let t=r;return s[s[e[t(1234)]]=5001]=e[t(1234)],s[s[e.VUJEL]=5002]=e[t(1005)],s[s[e.LcPhH]=5003]=e[t(1601)],s[s[e.lAxtk]=5004]=e.lAxtk,s[s[e.iRlGs]=5005]=e[t(887)],s})({});class st{constructor(t){let n=r;this[n(1307)]=t,this[n(911)]=null}}class gs extends st{constructor(t,n){let a=r;super(t),this.message=n&&n[a(1200)]||null}}class ps extends st{constructor(t,n){let a=r;if(e[a(486)](e[a(1055)],e[a(1104)]))this._listeners={};else{let u=e[a(477)].split("|"),p=0;for(;;){switch(u[p++]){case"0":super(t);continue;case"1":this[a(1200)]=n&&n[a(1200)]||"";continue;case"2":this[a(443)]=n&&n.colno||0;continue;case"3":this[a(1497)]=n&&n[a(1497)]||"";continue;case"4":this[a(545)]=n&&n[a(545)]||0;continue;case"5":this.error=n&&n[a(939)]||null;continue;case"6":this[a(793)]=n&&n[a(793)]||5001;continue}break}}}}class ms extends st{constructor(t,n){let a=r,u=e[a(1504)][a(460)]("|"),p=0;for(;;){switch(u[p++]){case"0":super(t);continue;case"1":this[a(793)]=n&&n.code||0;continue;case"2":this[a(942)]=n&&n[a(942)]||"";continue;case"3":this[a(195)]=n&&n.wasClean||!1;continue;case"4":this["willReco"+a(232)]=n&&n[a(914)+a(232)]||!1;continue}break}}}class ws extends st{constructor(t,n){let a=r;e[a(1191)](e[a(1616)],e[a(1616)])?(super(t),this[a(1436)]=n&&n[a(1436)]||null):_0x30a5d9&&this[a(1397)+a(694)][a(1637)+"rsorFile"+a(1217)](_0x11af2b)}}class _s extends ws{constructor(t,n){let a=r;super(t),this.data=n&&n[a(1436)]||null,this[a(1200)]=n&&n.message||null}}class ys extends st{constructor(t,n){let a=r;super(t),this[a(1436)]=n&&n[a(1436)]||null}}function de(s,{message:t,code:n,error:a}){let u=r;if(e[u(519)](e[u(350)],e.NjoNf))return new ps(s,{message:t,code:n,error:a});{let p=_0x4b8411[u(460)](":");_0x30616a&&(_0x1df70c=p.length),_0x50f9e9+=p[u(1620)];for(let h=0;e[u(458)](h,p[u(1620)]);h++)if(e[u(1514)](4,p[h][u(1620)])){let m=_0x57aead[u(1388)+"g"](0,e[u(204)](4,p[h][u(1620)])),l=m[u(1419)](p[h]);_0x305b3e[u(251)](l)}else _0x373c78.push(p[h]);_0x1aa6b5=!1}}function pe(s,{code:t,reason:n,wasClean:a,willReconnect:u}){return new ms(s,{code:t,reason:n,wasClean:a,willReconnect:u})}function bs(s,{data:t,message:n}){let a=r;return e.kTCaD(e.Jldxb,a(1313))?new _s(s,{data:t,message:n}):e.hyNJv(e[a(1118)],typeof _0x5a3f8a)?e.oNftm:""}function vs(s,{data:t}){return new ys(s,{data:t})}function or(s,{message:t}){return new gs(s,{message:t})}class Ss{constructor(t,n){let a=r;this[a(1415)+"s"]=t,this[a(326)+"es"]=n,this[a(946)+a(286)]=0,this[a(1425)+a(1168)+"riesCount"]=0}[r(1657)+r(1124)+r(1072)](){let t=r;this["currentI"+t(286)]=0,this[t(1425)+t(1168)+t(634)+"t"]=0}resetTries(){let t=r;this[t(1425)+t(1168)+t(634)+"t"]=0}[r(1539)+r(319)+"nt"](){let t=r;return this[t(1415)+"s"][this[t(946)+"ndex"]]}[r(1539)+r(319)+r(698)+"ount"](){let t=r;return this[t(1425)+t(1168)+t(634)+"t"]}checkReachMaxTries(){let t=r;if(e[t(519)](e[t(1439)],e[t(838)]))return!!(e.bOGwF(this[t(946)+"ndex"],this[t(1415)+"s"][t(1620)])||e.kTCaD(this["currentI"+t(286)],this[t(1415)+"s"].length-1)&&this["currentE"+t(1168)+t(634)+"t"]===this[t(326)+"es"]);{let n=0,a=[];for(;e[t(1477)](n,_0x39f8c4.byteLength);){let{offset:u}=_0xa8a7ce(_0x151849,n);n=u;let p={cursor_name:"",cursor:0,service:0},{value:h,offset:m}=e[t(170)](_0x26d27f,_0x1e74b8,n);p.service=h,n=m;let{value:l,offset:_}=e[t(629)](_0x5b7439,_0x2d96ad,n);n=_,p[t(1421)+"ame"]=e[t(561)](_0x2520b3,_0x19819b,n,e.jTPuX(n,l)),n+=l;let{value:v,offset:A}=e[t(1023)](_0x117a7e,_0x20f01e,n);p[t(1026)]=v[t(1617)](),n=A,a.push(p)}return a}}[r(531)+r(1030)+r(718)+r(336)+"tries"](){let t=r;return e[t(1328)](this[t(946)+t(286)],this.endpoints.length)?!0:this[t(1425)+"ndpointT"+t(634)+"t"]>this[t(326)+"es"]}["replaceB"+r(1312)+r(932)+r(495)+r(841)](){let t=r;if(t(449)==="CUter")return this[t(1425)+"ndpointT"+t(634)+"t"]=1,this[t(946)+"ndex"]++,this[t(1415)+"s"][this.currentIndex];_0x4c66d6-=65536,_0x23ceba+=e[t(1646)](_0x511d3e,e[t(1584)](e[t(726)](_0x1a1805,10),55296),e[t(1645)](e[t(1087)](1023,_0x49d69a),56320)),_0x3da071+=3}[r(1539)+r(319)+r(373)+"ateCount"](){let t=r;return this[t(1425)+t(1168)+t(634)+"t"]++,this[t(1539)+"ntEndpoint"]()}}let it=(e[r(577)]!=typeof globalThis&&e[r(1121)](e[r(730)],globalThis[r(248)+r(497)][r(568)])||e[r(1293)](e.NbMhP,typeof window)&&e[r(1177)](r(1479),window[r(248)+r(497)][r(568)]))&&e[r(182)](e[r(577)],typeof document),Ye=e[r(1293)](e.NbMhP,typeof globalThis)&&(e[r(1063)](r(297),globalThis[r(248)+r(497)].name)||e[r(1281)]===globalThis[r(248)+r(497)][r(568)])&&e[r(1211)](e[r(577)],typeof tt),Ct=(e[r(577)]!=typeof globalThis&&e[r(464)](e[r(811)],globalThis["construc"+r(497)][r(568)])||e[r(645)](e[r(577)],typeof globalThis)||e[r(1547)](e[r(577)],typeof globalThis)&&!!globalThis["WeixinJS"+r(1243)])&&e.IzSxC(e[r(577)],typeof wx),Et=e[r(383)](r(1666)+"d",typeof globalThis)&&(e[r(252)]("Dedicate"+r(1437)+r(1452)+"pe",globalThis[r(248)+r(497)].name)||e[r(1422)](r(1073)+r(605)+r(827),globalThis[r(248)+r(497)].name)||e.oELFd(e[r(1262)],globalThis[r(248)+"tor"].name))&&e[r(623)](e[r(577)],typeof self),wa=r(1666)+"d"!=typeof globalThis&&e[r(657)](e[r(811)],globalThis["construc"+r(497)].name)&&e[r(577)]!=typeof global&&e[r(1608)](r(297),global[r(248)+r(497)].name)&&e[r(1481)](e[r(577)],typeof process)&&!!process[r(794)];class ar{constructor(){let t=r;this[t(1022)+"rs"]={}}[r(1412)](t,...n){let a=r,u={yejrv:e.QqPDR,nseIv:function(h,m){return e[k(1424)](h,m)},GsBvT:function(h,m){return e[k(1554)](h,m)},vATKq:function(h,m){return e[k(840)](h,m)},OnUqf:function(h,m){return e[k(1041)](h,m)},lsVkO:function(h,m){return e[k(952)](h,m)},mOngq:function(h,m){return e[k(691)](h,m)},udAxR:function(h,m){return e[k(1551)](h,m)},fmeik:function(h,m){return e[k(1093)](h,m)},kkPpP:function(h,m){return h<m},JdnoT:function(h,m){return e.hoHRi(h,m)},CniUa:function(h,m){return e.alMLC(h,m)},GlBFf:function(h,m){return h&m},VyLTA:function(h,m){return e[k(491)](h,m)},TzttX:function(h,m){return h&m},plPYA:function(h,m){return e.jTLiw(h,m)},uJwdN:function(h,m){return h<<m},GdlSZ:function(h,m){return h&m}},p=this[a(1022)+"rs"][t];if(p)p[a(596)]()[a(1345)](h=>h.fn[a(662)](h[a(1354)],n));else if(e[a(486)](e[a(1050)],t)&&!this[a(553)])if(e[a(334)](e.sbzjy,e[a(213)])){let h=n.length&&n[0];if(e.pMNKk(h,Error))throw h;let m=new Error(e[a(896)](e.wJGue,h?e[a(1160)](" ("+h[a(1200)],")"):""));throw m[a(1176)]=h,h}else{let h=4294967295;return function(m,l,_=!0){let v=a,A=u[v(1133)][v(460)]("|"),N=0;for(;;){switch(A[N++]){case"0":h=u[v(1594)](u[v(1565)](h,u.vATKq(127&m[l],21)),0);continue;case"1":return{value:_?h:u[v(1565)](0,h),offset:l};case"2":if(u[v(285)](l+=5,m[v(1620)]))throw l=m[v(1620)],_0x408739(l,10,m.length);continue;case"3":if(u[v(744)](m[l++],128))return{value:_?h:u[v(1565)](0,h),offset:l};continue;case"4":h=u.nseIv(u[v(1565)](h,u.mOngq(u[v(721)](15,m[l]),28)),0);continue;case"5":if(u[v(690)](m[l++],128))return{value:_?h:0|h,offset:l};continue;case"6":if(u.kkPpP(m[l++],128))return{value:_?h:u[v(872)](0,h),offset:l};continue;case"7":if(m[l++]<128)return{value:_?h:u[v(872)](0,h),offset:l};continue;case"8":h=u[v(1594)](u[v(872)](h,u[v(441)](u.GlBFf(127,m[l]),7)),0);continue;case"9":if(u.VyLTA(m[l++],128))return{value:_?h:u[v(872)](0,h),offset:l};continue;case"10":h=u[v(1594)](u.TzttX(127,m[l]),0);continue;case"11":h=u[v(1594)](u[v(1248)](h,u[v(1653)](u[v(317)](127,m[l]),14)),0);continue}break}}}return this}[r(1342)](t,n){let a=r;if(e.bJtpf(void 0,t))this[a(1022)+"rs"]={};else if(e[a(1571)](void 0,n))this[a(1022)+"rs"][t]=null;else{let u=this[a(1022)+"rs"][t];if(u)for(let p=0;e[a(1093)](p,u[a(1620)]);)u[p].fn===n?u[a(1081)](p,1):++p}return this}on(t,n,a){return(this[r(1022)+"rs"][t]||(this._listeners[t]=[])).push({fn:n,ctx:a||this}),this}}class _a extends ar{[r(979)+"rrorMess"+r(1642)](t){let n=r,a={gurxH:function(u){return e.HBdKD(u)},wdQSp:function(u){return u()}};if(e[n(870)](e[n(1356)],e.YIQih))return t[n(339)]||t[n(1153)]?(n(928)+" "+(t[n(339)]||"")+n(1610)+(t.errNo||""))[n(788)]():JSON[n(1047)+"y"](t);xmEUpn[n(219)](_0x181ea5),xmEUpn.wdQSp(_0x228f9d)}constructor(t,n,a){let u=r;super(),this[u(1438)]=null,Ct&&wx[u(1180)+u(1080)]&&(this._socket=wx["connectS"+u(1080)]({url:t,protocols:n,header:a,fail:this[u(1088)+u(1090)+u(525)][u(1577)](this),success:this[u(1088)+u(1593)+u(1406)+u(1078)][u(1577)](this)})),Ye&&tt[u(1180)+"ocket"]&&(this[u(1438)]=tt[u(1180)+u(1080)]({url:t,protocols:n,header:a,fail:this[u(1088)+u(1090)+u(525)].bind(this),success:this[u(1088)+u(1593)+u(1406)+u(1078)].bind(this)}))}[r(1088)+r(1593)+r(1406)+r(1078)](){let t=r;Promise[t(307)]()[t(1e3)](()=>{let n=t;this[n(1305)+n(727)]()})}["_createS"+r(1090)+r(525)](t){let n=r,a={lXtWa:function(u,p){return u&p},SWwXW:function(u,p){return e[k(570)](u,p)},pznyZ:e.QvAIu,kfDad:function(u,p,h){return e[k(893)](u,p,h)},hjLtk:e[n(1050)],wWmEY:e[n(967)]};Promise[n(307)]()[n(1e3)](()=>{let u=n,p={twkkl:function(h,m,l){return h(m,l)},wzqSJ:function(h,m){return a[k(1344)](h,m)}};if(a.SWwXW(a.pznyZ,a.pznyZ)){let h=a[u(410)](de,a[u(190)],{message:this[u(979)+u(1311)+u(1642)](t)});this[u(1412)]("error",h);let m=a[u(410)](pe,a[u(518)],{reason:this[u(979)+u(1311)+u(1642)](t)});this.emit(a.wWmEY,m)}else YzZCGX[u(927)](_0xd18607,_0x47bef8,YzZCGX.wzqSJ(127,_0x179701)|128),_0x2073a0>>>=7})}[r(1305)+r(727)](){let t=r,n={dKBCz:e[t(967)],CTUYf:function(a,u,p){return e.zsllR(a,u,p)},MOURW:function(a,u){return e[t(1644)](a,u)},zIsfr:e[t(1361)],ccDGI:e[t(1050)]};this[t(1438)][t(966)](a=>{let u=t;this[u(1412)](e.zqhpd,e[u(854)](vs,e[u(666)],{...a,data:a.errMsg||""}))}),this[t(1438)][t(638)](a=>{let u=t;this[u(1412)](n[u(710)],n[u(953)](pe,u(1403),{...a}))}),this[t(1438)][t(761)+"e"](a=>{let u=t;this[u(1412)](e[u(544)],e[u(256)](bs,e[u(544)],{...a}))}),this._socket[t(1171)](a=>{let u=t;n[u(844)](u(1265),n[u(1218)])?this[u(1412)](n[u(1460)],de(u(939),{...a,message:a[u(339)]||""})):this._isMiniTT||this[u(1516)+"X"]?this[u(1158)+"etWorkCh"+u(740)]():this[u(751)+"er"]&&this[u(169)+"balEvent"+u(934)]()})}[r(1132)](t){let n=r,a={tFfXu:function(u,p,h){return e[k(256)](u,p,h)}};if(e[n(636)](t,Uint8Array))if(e[n(1238)](e[n(1486)],e.bZcoW)){let u=t[n(506)].slice(t.byteOffset,e.TNUVD(t.byteLength,t[n(181)+"et"]));this[n(1438)]&&this[n(1438)][n(1132)]({data:u,fail:p=>{let h=n;this[h(1412)](h(939),a.tFfXu(de,h(939),{message:this["_formatE"+h(1311)+h(1642)](p)}))}})}else return this[n(1425)+n(1168)+"riesCount"]++,this[n(1539)+"ntEndpoint"]();else this[n(1438)]&&this[n(1438)].send({data:t,fail:u=>{let p=n;if(e[p(712)](e[p(1465)],e[p(1465)]))this[p(1412)](e[p(1050)],e[p(1076)](de,e[p(1050)],{message:this[p(979)+p(1311)+p(1642)](u)}));else return!!this[p(1184)]}})}[r(1403)](t,n){let a=r;this._socket&&this._socket[a(1403)]({code:t,reason:n})}[r(1380)+r(934)](t,n){this.on(t,n)}[r(923)+r(1204)+r(231)](t,n){this[r(1342)](t,n)}get readyState(){let t=r;return this[t(1438)][t(1110)+"te"]}get[r(517)+"pe"](){return this[r(1438)].binaryType}set[r(517)+"pe"](t){}get[r(1045)](){let t=r;return this._socket[t(1045)]}get[r(402)](){return this[r(1438)].protocol}get extensions(){let t=r;return this[t(1438)][t(369)+"ns"]}get[r(1315)+r(1557)](){return 0}}function ya(s,t){let n=r,a={VTOvz:function(u,p){return e[k(620)](u,p)},UmjoA:function(u,p,h){return e[k(1208)](u,p,h)},IlCOA:function(u,p){return e.tYLqT(u,p)},aUtEa:function(u,p,h){return e.aVqTG(u,p,h)}};if(e[n(1597)](e.OVCyy,e.OVCyy)){for(_0x2242d8>>>=0;WnqYtD[n(994)](_0x4564e5,128);)WnqYtD[n(1532)](_0xf7cc89,_0x51658a,WnqYtD[n(1368)](127&_0x5904e7,128)),_0x2ea7d2>>>=7;WnqYtD[n(367)](_0x1d08ba,_0x5d8a7b,_0x421526)}else{if(t)return new t(s[n(1045)],s[n(402)]);if(e[n(1257)](Ct,Ye))return new _a(s.url,s[n(402)],s[n(1340)]);if(e[n(1371)](it,Et)&&e[n(359)](e[n(577)],typeof WebSocket)&&WebSocket)return new WebSocket(s.url,s[n(402)+"s"])}}function ba(s){let t=r,n=e[t(1373)][t(460)]("|"),a=0;for(;;){switch(n[a++]){case"0":if(s)return!0;continue;case"1":if(Ye&&tt["connectS"+t(1080)])return!0;continue;case"2":if(e[t(720)](it,Et)&&e[t(949)](e[t(577)],typeof WebSocket)&&WebSocket)return!0;continue;case"3":return!1;case"4":if(Ct&&wx[t(1180)+t(1080)])return!0;continue}break}}function Cs(s,t,n){let a=r,u={eWuXo:function(m,l){return m<=l},OzFEV:function(m,l){return e.aaazC(m,l)}},p=-1;async function h(m){let l=k;return u[l(1540)](m,p)?Promise.reject(new Error(l(436)+l(1203)+l(1334)+l(1213)+l(1374))):(p=m,m===n.length?Promise[l(307)]():n[m][l(1577)](s)(t,h[l(1577)](null,u[l(1320)](m,1))))}e[a(598)](h,0)}function Es(s){let t=r,n=0,a=0;for(let u=0;u<s.length;++u)a=s[t(1499)+"At"](u),e[t(212)](a,128)?n+=1:e[t(1519)](a,2048)?n+=2:e[t(1173)](e[t(940)](64512,a),55296)&&e[t(1115)](e[t(1065)](64512,s[t(1499)+"At"](e.QOSUq(u,1))),56320)?(++u,n+=4):n+=3;return n}function As(s,t,n){let a=r;if(e[a(404)](e.zltOh(n,t),1))return"";let u="";for(let p=t;e[a(404)](p,n);)if(e[a(1099)](a(427),"MuLpP")){let h=s[p++];if(h<=127)u+=String[a(1352)+a(487)](h);else if(e[a(809)](h,192)&&e[a(1676)](h,224))u+=String[a(1352)+"Code"](e[a(1308)](e[a(1624)](31&h,6),e.ZrqfR(63,s[p++])));else if(h>=224&&h<240)u+=String.fromCharCode((15&h)<<12|(63&s[p++])<<6|e[a(1100)](63,s[p++]));else if(e[a(1543)](h,240)){let m=e[a(1627)](e[a(1353)](e[a(1085)](e[a(700)](e[a(360)](7,h),18),e[a(1087)](63,s[p++])<<12),e[a(168)](e[a(1427)](63,s[p++]),6))|e[a(1512)](63,s[p++]),65536);u+=String[a(1352)+a(487)](e.jTPuX(55296,m>>10)),u+=String[a(1352)+a(487)](56320+e[a(1070)](1023,m))}}else _0x43062=e[a(676)](_0x284d93,_0x1bc8ca),_0x345945=0;return u}function cr(s,t,n){let a=r,u=n,p,h;for(let m=0;m<s[a(1620)];++m)if(p=s[a(1499)+"At"](m),e[a(1591)](p,128))t[n++]=p;else if(e.SUvhe(p,2048))t[n++]=e[a(207)](e[a(901)](p,6),192),t[n++]=e[a(1258)](63&p,128);else if(e[a(715)](e[a(1100)](64512,p),55296)&&e[a(522)](e.ynpUJ(64512,h=s[a(1499)+"At"](m+1)),56320)){let l=(a(958)+"1|2")[a(460)]("|"),_=0;for(;;){switch(l[_++]){case"0":t[n++]=e.mlwnl(e.IKjTs(p,18),240);continue;case"1":t[n++]=e[a(1308)](e.gmmkg(p>>6,63),128);continue;case"2":t[n++]=e[a(1264)](63,p)|128;continue;case"3":p=e.Ovuhb(e.jTPuX(65536,e.gvPyz(1023,p)<<10),1023&h);continue;case"4":t[n++]=p>>12&63|128;continue;case"5":++m;continue}break}}else t[n++]=e[a(386)](p>>12,224),t[n++]=e.xoNvP(e[a(434)](e.IKjTs(p,6),63),128),t[n++]=63&p|128;return n-u}async function ks(s){let t=r;if(e[t(1295)]("string",typeof s)){let n=new Uint8Array(e[t(971)](Es,s));return e.rRYsY(cr,s,n,0),n}return e.rhafF(s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s.buffer,s[t(181)+"et"],s[t(277)+"th"])}function va(s){let t=r;try{return e[t(949)](e[t(1118)],typeof s)&&(e.jvqSA(s,ArrayBuffer)||s[t(506)]&&s.buffer instanceof ArrayBuffer)||e[t(949)](e[t(1118)],typeof s)?"":(JSON[t(524)](s),t(1205)+t(1596))}catch{if(e.RjeHz(e[t(324)],e[t(1261)]))return e[t(645)](e[t(1118)],typeof s)?e[t(717)]:"";this[t(813)]++}}let Sa=(s,t)=>{let n=r;switch(s){case e.xUZYu:case e[n(157)]:return{[n(588)+s]:1,"x-tt-env":t};default:return{}}};class Ca{constructor(t){let n=r;this["maxLossC"+n(622)]=t,this[n(813)]=0}[r(473)](){let t=r;if(e[t(1491)](e[t(625)],e[t(625)]))this[t(813)]++;else return this[t(1184)]?.get(_0x148060)}[r(1215)+r(732)+"nt"](){let t=r;return this.count>=this[t(955)+t(622)]}[r(273)+"nter"](t=0){let n=r;this["maxLossC"+n(622)]=t,this[n(813)]=0}}async function Ea(s){let t=r,n={KbMpq:e[t(733)],usJcs:function(a,u){return e[t(936)](a,u)},aaYOr:e[t(937)],xXeqc:e[t(1536)],IiLbU:function(a,u){return e[t(692)](a,u)},kwsyW:e[t(174)],tVuba:function(a,u){return e[t(1587)](a,u)}};return new Promise(a=>{let u=t,p={hlhxH:n[u(453)]};if(!it)return n[u(341)](a,n[u(453)]);try{let h=document["createEl"+u(300)](n[u(839)]);window[u(421)+"JSONP"]=m=>{let l=u;document.body[l(1534)+l(1599)](h),window[l(421)+"JSONP"]=void 0,a(m&&m[l(498)]||p[l(1555)])},h[u(1307)]=n.xXeqc,h[u(1192)]=n.IiLbU(s[u(1317)](/^ws/,u(1008)),n[u(1402)]);try{document[u(855)]["appendCh"+u(1599)](h)}catch{document[u(855)]["removeCh"+u(1599)](h)}}catch{window[u(421)+u(1042)]=void 0,n[u(997)](a,n[u(453)])}})}function Fe(s,t,n){let a=r;return!!s?.[a(533)](u=>u[a(548)]===t&&u[a(183)]===n)}function ot(s,t){let n=r;return s?.[n(533)](a=>a[n(548)]===t)?.[n(183)]}let xr=null;async function Aa(){let s=r;return xr||(xr=Promise[s(307)]()[s(1e3)](Ce.bind(Ce,s(445)))),xr}class ka extends ar{constructor(t,n){let a=r;super(),this[a(1154)]=t,this[a(270)]=n,this[a(1184)]=void 0,this[a(792)+a(670)]=null}async[r(500)](){await this[r(1111)]()}async[r(1111)](){let t=r,n={Aitdh:e.sZyJA,DQfII:e[t(734)],tqrql:e[t(611)],xCCZD:function(a){return a()}};if(!this[t(1184)]){if(this[t(792)+"mise"])return this[t(792)+t(670)];try{let a=this._dbName,u=this[t(270)];this[t(792)+"mise"]=(async()=>{let p=t,h={IgtgH:n.Aitdh};if(n[p(796)]!==n[p(1106)]){let{openDB:m}=await n.xCCZD(Aa);this[p(1184)]=await m(p(421)+"_"+a,1,{upgrade(l){let _=p;_(1643)===h[_(540)]?this.on(_0x5596d6,_0x3a8ef9):l[_(884)+_(753)+"e"](a,{keyPath:u})}})}else return _0x4d9458?.[p(533)](m=>m.key===_0x6e91d4)?.[p(183)]})(),await this[t(792)+t(670)]}catch(a){console.log(a)}finally{this[t(792)+t(670)]=null}}}async get(t){let n=r;try{return await this[n(1111)](),this[n(1184)]?.[n(1621)](this[n(1154)],t)}catch(a){console[n(775)](a)}}async[r(885)](t,n){let a=r;return e[a(351)](a(265),e[a(309)])?(await this._init(),this[a(1184)]?.[a(1581)](this[a(1154)],t)):_0x2c4ae8?_0x34ffdc[a(677)+a(1562)](_0x1f4d3e,_0x538745):_0x2564e3["fromByte"+a(1324)](_0xd09f71,_0x4e98bd)}async[r(773)](t){let n=r;try{return await this[n(1111)](),this[n(1184)]?.[n(1276)](this._dbName,t)}catch(a){if(e[n(1009)]("qTYPW",e.sdSqZ))return n(421)+"_"+this[n(1186)];console[n(775)](a)}}async clear(){let t=r;try{return await this[t(1111)](),this._qosDB?.[t(567)](this[t(1154)])}catch(n){console[t(775)](n)}}async[r(257)](){let t=r;if(e[t(303)]!==e[t(303)])this[t(619)+"igatorOn"+t(457)]=_0x1b1dda,_0x42850c?this[t(1640)+"nLine"]():this[t(1640)+"ffLine"]();else return await this[t(1111)](),this[t(1184)]?.[t(701)+"ys"](this[t(1154)])}async[r(719)](){let t=r;return await this._init(),this._qosDB?.[t(719)](this._dbName)}async[r(216)](){let t=r;try{this[t(1184)]?.[t(1403)](),this[t(1184)]=void 0}catch(n){console[t(775)](n)}}get[r(610)](){let t=r;if(e[t(1571)](e[t(259)],e.hZoyn))return new _0x3e50e7(e[t(683)](e[t(1586)](_0x4de2f9[0]|e[t(988)](_0x555d82[1],8),e[t(193)](_0x387cea[2],16)),e[t(691)](_0x1d87b3[3],24)),e[t(1085)](e[t(852)](e[t(1473)](_0x1c376f[4],e[t(1541)](_0x52f5ae[5],8)),e[t(840)](_0x25f006[6],16)),e.lQiDV(_0x2991b3[7],24)),_0x51e3f3);try{return!!this._qosDB}catch(n){return console[t(775)](n),!1}}}class Pa{constructor(t,n){let a=r;this[a(1186)]=t,this[a(1498)]=n,this[a(1184)]=localStorage}async[r(500)](){}get[r(1522)](){return r(421)+"_"+this._DBName}async[r(1621)](t){let n=r,a=this[n(1184)][n(1126)](this._prefix);return JSON.parse(e.lDjbL(a,"{}"))[t]}async[r(885)](t,n){let a=r,u=this[a(1184)][a(1126)](this[a(1522)]),p=JSON.parse(e[a(595)](u,"{}"));return p[n||t[this[a(1498)]]]=t,this[a(1184)][a(1196)](this[a(1522)],JSON[a(1047)+"y"](p)),n||t[this[a(1498)]]}async del(t){let n=r,a=this._qosDB[n(1126)](this._prefix),u=JSON[n(524)](e.ykNkV(a,"{}"));return u[t]=void 0,this[n(1184)][n(1196)](this[n(1522)],JSON[n(1047)+"y"](u))}async clear(){let t=r;return this[t(1184)][t(567)]()}async[r(257)](){let t=r,n=this[t(1184)][t(1126)](this[t(1522)]),a=JSON[t(524)](n||"{}");return Object[t(257)](a)}async[r(719)](){let t=r,n=this[t(1184)][t(1126)](this[t(1522)]),a=JSON.parse(e[t(595)](n,"{}"));return Object[t(758)](a)}[r(216)](){return Promise[r(307)]()}get isReady(){return!!this[r(1184)]}}class Da{constructor(t,n){let a=r;e[a(1387)](a(861),e[a(1450)])?(_0x6db3e9(_0x4459b9,18),_0x30837f(_0x52b46a,_0x22a713)):(this._DBName=t,this._pathKey=n,this[a(1184)]=Ye?tt:Ct?wx:null)}async[r(500)](){}get _prefix(){let t=r;return t(421)+"_"+this[t(1186)]}async[r(1621)](t){let n=r;if(e[n(1049)](e[n(1447)],e[n(776)])){let a=this[n(1184)]["getStora"+n(1379)](this[n(1522)]);return JSON[n(524)](e[n(786)](a,"{}"))[t]}else this.emit(e[n(1050)],e[n(760)](_0x5a7dd3,e[n(1050)],{message:this["_formatE"+n(1311)+n(1642)](_0x27cb28)}))}async[r(885)](t,n){let a=r,u={UAkdM:function(p,h){return e[k(1054)](p,h)},ySldo:function(p,h){return e[k(523)](p,h)}};if(e[a(613)]!==e[a(559)]){let p=this[a(1184)][a(954)+a(1379)](this._prefix),h=JSON[a(524)](p||"{}");return h[n||t[this._pathKey]]=t,this[a(1184)][a(203)+a(1379)](this[a(1522)],JSON[a(1047)+"y"](h)),n||t[this[a(1498)]]}else{let p=IoeXhm[a(1336)](_0xcb240c,_0x571815),h=_0x2316be[a(1466)];return _0x21ca91[a(1466)]=IoeXhm[a(643)](_0x1e8060[a(983)],p),h}}async[r(773)](t){let n=r,a=this[n(1184)].getStorageSync(this._prefix),u=JSON[n(524)](e.EmsMa(a,"{}"));return u[t]=void 0,this._qosDB[n(203)+n(1379)](this[n(1522)],JSON[n(1047)+"y"](u))}async[r(567)](){let t=r;return this[t(1184)][t(1202)+t(1453)]()}async[r(257)](){let t=r,n=this._qosDB[t(954)+t(714)+"nc"](this._prefix),a=JSON[t(524)](n||"{}");return Object[t(257)](a)}async getAll(){let t=r,n={WaxVD:function(a,u){return e[k(998)](a,u)}};if(e[t(1009)](e.jpmjV,e.jpmjV)){let a=this[t(1184)]["getStora"+t(1379)](this._prefix);return _0x31a3b0.parse(PrQDzo[t(1348)](a,"{}"))[_0x4ed58f]}else{let a=this[t(1184)][t(954)+t(714)+"nc"](this._prefix),u=JSON.parse(e.dMgyb(a,"{}"));return Object[t(758)](u)}}[r(216)](){return Promise[r(307)]()}get isReady(){return!!this[r(1184)]}}function Ps(s,t){let n=r;if(e.ykNkV(Ye,Ye))return new Da(s,t);if(e.CRbRc(it,Et)&&e.NbMhP!=typeof indexedDB)return new ka(s,t);if((it||Et)&&e.IzSxC(e.NbMhP,typeof localStorage))return new Pa(s,t);throw new Error(e[n(406)])}class Ia{constructor(){let t=r;this[t(817)+t(1489)+"Id"]=null,this[t(817)+"l"]=36e5,this[t(1184)]=e[t(774)](Ps,e[t(1609)],e[t(526)])}async[r(817)+r(1066)](){let t=r;e[t(693)](clearInterval,this[t(817)+"lTimeoutId"]),this[t(817)+t(1489)+"Id"]=e[t(1023)](setInterval,()=>{let n=t;this[n(1391)+n(912)]()},this[t(817)+"l"])}async[r(500)](){let t=r;await this._qosDB[t(500)]()[t(1e3)](()=>{let n=t;this[n(817)+n(1066)]()})}async[r(1391)+"ired"](){let t=r;if(e[t(1663)](t(368),e[t(1552)])){let n=this[t(1075)],a=this.low;return[255&a,e.yrSgd(e[t(304)](a,8),255),e[t(361)](e[t(304)](a,16),255),a>>>24,255&n,e[t(649)](e[t(1318)](n,8),255),e.CHnoZ(n,16)&255,e.jYCyv(n,24)]}else(await this[t(1184)]?.[t(719)]()||[])[t(765)](({timestamp:u})=>u<Date[t(299)]())[t(1345)](u=>{let p=t;this._qosDB?.del(u[p(675)+"id"])})}async[r(773)](t){let n=r;return this[n(1184)]?.[n(773)](t)}async[r(885)](t,n){return this[r(1184)]?.set({message_id:t,timestamp:n})}async[r(1621)](t){let n=r;return this[n(1184)]?.[n(1621)](t)}async[r(216)](){let t=r;e[t(1583)](clearInterval,this[t(817)+"lTimeoutId"]),await this[t(1184)]?.closeDB()}get[r(610)](){let t=r;if(e.xdFzX(e.LfxQH,e[t(938)]))return this[t(1184)]?.[t(610)];e[t(975)](_0x382695,e[t(831)]),this[t(1342)](e[t(400)],_0x125e2c),this.off(e[t(1157)],_0x4e156f)}}function ur(s){let t=r,n=!!this._options[t(438)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let a=Fe(s[t(1200)][t(1340)],e[t(1395)],"2"),u=a&&e[t(315)](Fe,s[t(1200)].headers,t(1227)+"er_qos_ack","1"),p=a&&e[t(814)](Fe,s[t(1200)][t(1340)],e[t(660)],"1"),h=p?e[t(1638)](ot,s.message.headers,e[t(858)])?.split(",")[t(765)](Boolean)||[]:[];return{enabled:n,isQoSMessage:a,isQoSAck:u,isAckCleanupMessage:p,ackMsgIds:h}}async function Ds(){let s=r;return this[s(957)+s(1604)]||(this[s(957)+"ger"]=new Ia),this["_QoSMana"+s(1604)][s(610)]||await this[s(957)+"ger"][s(500)](),this[s(957)+"ger"]}async function Ta(s,t){let n=r;if(e[n(715)](e.KLFrv,e.KLFrv)){let{enableAutoAck:a}=this[n(163)],u=e[n(384)](Fe,s[n(1200)][n(1340)],e[n(894)],"1"),p=e[n(435)](Fe,s.message[n(1340)],e[n(991)],"1"),h=ur[n(1407)](this,s);if(e[n(1375)](a,u)){let{SeqID:m,LogID:l,service:_,LogIDNew:v,method:A}=s[n(1200)];this[n(1494)]({SeqID:m,LogID:l,LogIDNew:v,service:_,method:A,headers:[{key:e[n(991)],value:"1"},{key:e[n(1170)],value:v||""},{key:e[n(772)],value:"0"}]})}p&&!h[n(1172)]&&this[n(186)+"hAckMessageEvent"](s),e[n(1560)](t)}else _0x5d39de=_0x59256c[n(1499)+"At"](_0x2de0bb),e[n(985)](_0x45f925,128)?_0x407107+=1:e.WOSWx(_0x56f625,2048)?_0x1c5ef8+=2:e[n(486)](e[n(1302)](64512,_0x27d908),55296)&&e[n(1433)](64512&_0x14a9a6[n(1499)+"At"](e[n(530)](_0x53963c,1)),56320)?(++_0x2b6b4d,_0x1ec64d+=4):_0x461f88+=3}async function La(s,t){let n=r;this[n(1343)](e[n(494)],s[n(1200)]),e[n(581)](t)}async function Ra(s,t){let n=r,a=e.duisN(us,await e[n(965)](ks,s[n(1436)]));try{if(e[n(583)](a.payload,Uint8Array)){let u=e[n(1020)](this[n(163)].payloadEncoding,Object)?{force:!!this[n(163)][n(230)+n(320)][n(766)],encoding:this[n(163)]["payloadE"+n(320)].encoding?this[n(163)][n(230)+n(320)][n(993)][n(1317)](/\s/g,"")[n(1077)+n(337)]():""}:{force:!1,encoding:this[n(163)][n(230)+n(320)]?this[n(163)][n(230)+"ncoding"][n(1317)](/\s/g,"")[n(1077)+"ase"]():""},p=a.payloadEncoding?a["payloadE"+n(320)].replace(/\s/g,"")[n(1077)+n(337)]():"",h=e[n(731)](this._options[n(1195)+n(1237)],Object)?{force:!!this[n(163)][n(1195)+n(1237)][n(766)],type:this[n(163)]["payloadT"+n(1237)][n(1307)]?this[n(163)]["payloadT"+n(1237)][n(1307)][n(1317)](/\s/g,"")[n(1077)+n(337)]():""}:{force:!1,type:this._options[n(1195)+n(1237)]?this[n(163)]["payloadT"+n(1237)][n(1317)](/\s/g,"")[n(1077)+n(337)]():""},m=a[n(1195)+"ype"]?a[n(1195)+"ype"].replace(/\s/g,"")[n(1077)+n(337)]():"",l=h.force?h[n(1307)]:m||h.type,_=u[n(766)]?u[n(993)]:p||u.encoding,v=[e.oNftm,n(1205)+n(1596),n(1205)+n(1596)+n(399)+n(292),e.iYuFb],A=[e.GNnML,e[n(1193)]];this[n(163)][n(947)+"ansformTextPayload"]&&v[n(1131)](l)&&(!_||A.includes(_))?a[n(370)+n(1500)]=e.EVvpm(As,a[n(1207)],0,a[n(1207)][n(277)+"th"]):a[n(370)+n(1500)]=""}else a["textPayl"+n(1500)]=""}catch(u){a[n(370)+"oad"]="",console[n(775)](u)}s[n(1200)]=a,e[n(501)](t)}function Na(s,t,n){let a=r,u=e.vhqck(n,8192),p=e[a(1294)](u,1),h=null,m=u;return function(l){let _=a;if(e[_(1656)](l,1)||e[_(910)](l,p))return e[_(598)](s,l);m+l>u&&(h=s(u),m=0);let v=t[_(1407)](h,m,m+=l);return e[_(266)](7,m)&&(m=e.eNwFr(7|m,1)),v}}let Oa=4294967295;function Ba(s,t,n){let a=r;return e.lFMoX(RangeError,e[a(1626)](e[a(1254)](e[a(564)](e[a(1515)]+s,a(229)),e[a(306)](t,1)),e.GjcmJ)+n)}function Ma(s,t,n){let a=r;if(e.SWNMj(e[a(298)],e[a(298)])){if(e[a(708)](n,Oa))throw new Error(e[a(1485)]);let u=3;for(;u>=0;){let p=e[a(1630)](255,n);e.CoMNV(dr,p,s,e[a(420)](t,u)),n>>>=8,u--}return e[a(1385)](t,4)}else _0x51c8c2[a(884)+"jectStore"](_0x4d65ce,{keyPath:_0x2e4bf3})}function za(s,t){let n=r,a=0,u=t,p=e.Rgoin(t,4);for(;e[n(1591)](u,p);)if(e[n(644)](e.XxiwE,e.VXQCE)){let{value:h,offset:m}=e[n(1442)](fr,s,u);u=m,a=e[n(1424)](e.rQZoK(a,8),0),a+=h}else throw this[n(989)+n(1369)]=!1,_0x42c9a3;return{value:a,offset:p}}function qa(s,t,n){let a=r,u=e[a(1454)][a(460)]("|"),p=0;for(;;){switch(u[p++]){case"0":if(t.write)return e.eRpfV(t[a(1463)](s,n),n);continue;case"1":return e[a(459)](e[a(970)](cr,s,t,n),n);case"2":if(e[a(1656)](s[a(1620)],40))return e[a(814)](cr,s,t,n)+n;continue;case"3":if(t[a(1667)+"e"])return e[a(1109)](t[a(1667)+"e"](s,n),n);continue;case"4":if(!s)return n;continue}break}}function Fa(s,t){let n=r,a=new M(e.xJnpP(e[n(386)](e[n(781)](e[n(1669)](s[e.oAUiR(t,4)],24),s[e[n(1160)](t,5)]<<16),e.LfblZ(s[e.GLynK(t,6)],8)),s[e[n(1584)](t,7)]),e[n(897)](e[n(1357)](s[e[n(1161)](t,0)]<<24,e[n(1323)](s[e[n(764)](t,1)],16))|e[n(1665)](s[e[n(1142)](t,2)],8),s[e[n(164)](t,3)]),!0);return t+=8,{value:a,offset:e[n(631)](t,8)}}function Ua(s,t,n){let a=r,u={mGyCj:function(p,h){return e[k(1233)](p,h)},MvNfz:"unknown reason"};if(e[a(815)](a(621),e[a(502)])){let p=s[a(371)],h=s[a(1075)];return t[n]=e[a(1424)](h,24),t[n+1]=e[a(959)](e.wAAiP(h,16),255),t[e.FIkHW(n,2)]=e[a(377)](h>>>8,255),t[n+3]=e.Uigis(255,h),t[e[a(1254)](n,4)]=e[a(950)](p,24),t[e[a(1015)](n,5)]=e[a(555)](e[a(1032)](p,16),255),t[e.bBccw(n,6)]=e[a(1526)](e[a(1480)](p,8),255),t[e.jQAeZ(n,7)]=255&p,n+=8,n}else _0x76efa5[a(421)+"JSONP"]=void 0,bwWHkN[a(828)](_0x3fb68f,bwWHkN.MvNfz)}function fr(s,t){let n=r,a={hhnoi:function(u,p,h){return e.ZZlga(u,p,h)},ryldC:function(u,p,h,m){return e[k(1358)](u,p,h,m)},vDYyA:function(u,p){return e[k(1254)](u,p)}};if(e[n(906)]===e.esZLa){let{offset:u}=a[n(1474)](_0x34651c,_0x288817,_0x2b00c2);_0x4cb3b1=u;let p={cursor_name:"",cursor:0,service:0},{value:h,offset:m}=a.hhnoi(_0x375ae7,_0x328279,_0x485a25);p[n(249)]=h,_0x426753=m;let{value:l,offset:_}=a[n(1474)](_0x5c29b2,_0x4806b1,_0x49a4c2);_0x5d3fbf=_,p[n(1421)+"ame"]=a[n(527)](_0x5799dd,_0x490c62,_0x5031cd,a[n(962)](_0x359269,l)),_0x29fd22+=l;let{value:v,offset:A}=_0x35c7db(_0x3a4bfd,_0x3c690d);p.cursor=v[n(1617)](),_0x186325=A,_0x5a8d46[n(251)](p)}else return s[n(1037)+"8"]?{value:s[n(1037)+"8"](t),offset:t+1}:{value:255&s[t],offset:t+1}}function dr(s,t,n){let a=r;return t.writeUint8?t[a(1428)+"t8"](s,n):t[n]=e[a(272)](255,s),e[a(1672)](n,1)}let Ha=function(s){return new Uint8Array(s)},Ka=e.ZanQe("undefined",typeof Buffer)?Buffer["allocUns"+r(602)]:Na(Ha,Uint8Array[r(1148)+"e"][r(1220)]);(()=>{let s=r,t={ULvYZ:function(n,a){return e[k(562)](n,a)},zLhgp:function(n,a){return e.kPCuh(n,a)},gACZC:function(n,a){return e.Kemzs(n,a)},XpiUv:function(n,a){return n&a},pcdgi:function(n,a){return e[k(448)](n,a)},WQXfQ:function(n,a){return e.TiMLW(n,a)},cFsRL:function(n,a){return e.lpOeB(n,a)},LpKCl:function(n,a){return e[k(312)](n,a)},NBEaV:function(n,a){return e[k(1162)](n,a)}};if(e[s(856)](e[s(275)],e.Hnhhw))_0x296b34=_0x215476(_0x569b1d),_0x51bbc1=e[s(959)](127,_0x540517),e[s(1221)](128,_0x57a480)&&(_0x4ebd46=e[s(1583)](_0x293ef3,_0x48bde2),_0x220c2e|=e[s(1448)](e[s(1065)](127,_0x2b0f5e),7));else{let n=4294967295;return function(a,u,p=!0){let h=s,m=(h(762)+h(343)+h(594)+"1")[h(460)]("|"),l=0;for(;;){switch(m[l++]){case"0":n=t[h(428)](t[h(429)](n,t[h(871)](t[h(1467)](127,a[u]),21)),0);continue;case"1":return{value:p?n:0|n,offset:u};case"2":if(t.pcdgi(a[u++],128))return{value:p?n:t[h(429)](0,n),offset:u};continue;case"3":if(t.pcdgi(a[u++],128))return{value:p?n:0|n,offset:u};continue;case"4":if(t[h(846)](a[u++],128))return{value:p?n:t[h(429)](0,n),offset:u};continue;case"5":n=t.ULvYZ(t[h(1467)](127,a[u]),0);continue;case"6":if(t.WQXfQ(u+=5,a[h(1620)]))throw u=a[h(1620)],Ba(u,10,a[h(1620)]);continue;case"7":n=t[h(428)](n|t.gACZC(t[h(1467)](127,a[u]),7),0);continue;case"8":n=t.ULvYZ(n|t.gACZC(127&a[u],14),0);continue;case"9":if(a[u++]<128)return{value:p?n:t[h(429)](0,n),offset:u};continue;case"10":if(a[u++]<128)return{value:p?n:t[h(429)](0,n),offset:u};continue;case"11":n=t.cFsRL(t[h(348)](n,t[h(871)](t[h(1405)](15,a[u]),28)),0);continue}break}}}})();let Ga=16,lr=32;function Wa(s){let t=r,n=0,a={};for(let u=0;e[t(491)](u,s.length);u++)a[s[u][t(1421)+t(1028)]]=e[t(862)](Es,s[u][t(1421)+"ame"]),n+=e[t(1025)](14,a[s[u][t(1421)+"ame"]]);return[n,a]}function Is(s,t,n){let a=r,[u,p]=e[a(1472)](Wa,s),h=e[a(205)](Ka,u),m=0;return s.forEach(l=>{let _=a,v=e[_(1493)][_(460)]("|"),A=0;for(;;){switch(v[A++]){case"0":m=Ma(h,m,l[_(249)]||0);continue;case"1":m=e.UibZk(Ua,M[_(1164)+"er"](l[_(1026)]||t),h,m);continue;case"2":console[_(775)](e[_(1659)],m);continue;case"3":m=e[_(963)](dr,p[l[_(1421)+"ame"]],h,m);continue;case"4":m=e[_(1222)](qa,l[_(1421)+"ame"],h,m);continue;case"5":m=e.Ngmzn(dr,0,h,m);continue;case"6":console[_(775)](e[_(1113)],m);continue;case"7":console[_(775)](_(1673),m);continue;case"8":console.log(_(1440)+_(632),l,l[_(249)]);continue;case"9":console[_(775)](e[_(397)],m);continue;case"10":console.log(e[_(818)],m);continue}break}}),{frameType:lr,headers:[{key:e[a(423)],value:n}],payload:h}}function ja(s){let t=r,n=0,a=[];for(;e[t(255)](n,s[t(277)+"th"]);){let{offset:u}=e.bQqrz(fr,s,n);n=u;let p={cursor_name:"",cursor:0,service:0},{value:h,offset:m}=e[t(1339)](za,s,n);p[t(249)]=h,n=m;let{value:l,offset:_}=e[t(774)](fr,s,n);n=_,p[t(1421)+t(1028)]=e[t(435)](As,s,n,e[t(1254)](n,l)),n+=l;let{value:v,offset:A}=e[t(982)](Fa,s,n);p[t(1026)]=v[t(1617)](),n=A,a[t(251)](p)}return a}function Ja(){let s=r;return{frameType:lr,headers:[{key:s(972)+s(344),value:e[s(572)]}],payload:void 0}}class Va{constructor(t,n,a){let u=r;this[u(520)+u(1660)]=t,this[u(898)+"ileName"]=n,this["_message"+u(161)]=a,this[u(1184)]=e[u(609)](Ps,this[u(520)+u(1660)],e.kkaAO)}async openDB(){let t=r;await this[t(1184)][t(500)]()}async[r(1129)+"rs"](){let t=r;if(!this._qosDB[t(610)])return;let n=this["_message"+t(161)],a=await this._qosDB.getAll();switch(console[t(775)](e[t(1031)],a),n){case e[t(682)]:return a&&a[t(1620)]?Is(a,0,this[t(898)+t(1017)]):void 0;case t(1631):return;case e[t(1134)]:return a&&a[t(1620)]?e[t(963)](Is,a,0,this[t(898)+t(1017)]):e[t(1068)](Ja)}}async set(t,n,a){let u=r;return console[u(775)](e[u(199)],t,n,a),this[u(1184)][u(885)]({cursor_name:t,cursor:n,service:a})}async[r(1300)+"rs"](t){let n=r,a={sLLUS:function(u,p){return e[k(1007)](u,p)},ABfAB:function(u,p){return e[k(1508)](u,p)},wAlYU:function(u,p){return u>p}};if(e[n(334)]("Awleg",e[n(886)])){let{initReconnectInterval:u,maxReconnectInterval:p,reconnectIntervalGrowFactor:h}=this._options,m=a.sLLUS(u,_0x257ed4[n(834)](h,a[n(1423)](_0x42b2f1,1)));return a[n(592)](m,p)?p:m}else{let u=e[n(842)](ja,t);for(let p of u)console[n(775)](e[n(684)],u),await this[n(1184)][n(885)](p)}}async[r(1621)](t){let n=r;return(await this[n(1184)].get(t))?.[n(1026)]}async[r(216)](){await this[r(1184)].closeDB()}[r(1637)+r(593)+r(1217)](t){let n=r,a={nxoEn:function(u,p){return e[k(816)](u,p)},bOUMx:function(u,p){return e[k(1201)](u,p)},GVDXP:e[n(577)],DcFoj:e[n(406)]};if(e[n(430)]!==n(929))this["_cursorF"+n(1017)]=t;else{if(XJjRqp[n(176)](_0x70746,_0x7ec75d))return new _0x33947c(_0x2b5dfb,_0x58dd67);if((_0x1e7997||_0x5ee4ab)&&XJjRqp[n(836)](XJjRqp[n(1071)],typeof _0x513e06))return new _0x22f5ea(_0x510c76,_0xf499b6);if(XJjRqp[n(176)](_0x531de9,_0x3c5d07)&&XJjRqp.bOUMx(XJjRqp[n(1071)],typeof _0x522274))return new _0x413799(_0x66f1,_0x4387e9);throw new _0x4211c2(XJjRqp.DcFoj)}}get[r(610)](){let t=r;return this[t(1184)][t(610)]}}let Ya=r(556)+"qos__";async function Ts(s){let t=r;if(!this._options[t(438)+"S"])return null;let{aID:n,fpID:a,messageStrategy:u}=this._options,p=s||Ya;try{if(this[t(1397)+t(694)])if(e.mUIpq(t(242),e[t(1390)]))s&&this[t(1397)+t(694)]["updateCu"+t(593)+"Name"](s);else return e[t(1216)](e[t(823)](_0x482764,4).join("0"),_0xc680a1(_0x1b0641,2)[t(197)](16))[t(596)](-4);else this["_cursorM"+t(694)]=new Va(a+"_"+n+"_"+p,p,u);return this["_cursorM"+t(694)][t(610)]||await this[t(1397)+t(694)].openDB(),this[t(1397)+t(694)]}catch{return null}}async function Xa(s,t){let n=r,a=e[n(713)](Fe,s[n(1200)][n(1340)],e[n(1538)],"-1"),u=Fe(s[n(1200)][n(1340)],e[n(991)],"1"),p=e[n(697)](ot,s[n(1200)].headers,e[n(1004)]),h=Number(ot(s.message[n(1340)],e[n(711)]))||0,m=ur[n(1407)](this,s),l=Fe(s[n(1200)][n(1340)],e.KzhjI,"2"),_=e.wGnqz(ot,s[n(1200)][n(1340)],e.IXNiD),v=e[n(693)](Number,e[n(787)](ot,s[n(1200)].headers,e.HCwGt));if(m[n(1172)])return e[n(1194)](t);let A=m["isQoSMes"+n(1400)]?await Ds.call(this):null;if(e[n(1573)](s[n(1200)][n(249)],0)&&u&&!a||s[n(1200)][n(249)]>0){if(p&&m[n(550)+n(1400)]&&A)return!!!await A[n(1621)](p)&&(this[n(186)+n(468)+n(913)](s),await A[n(885)](p,e[n(1278)](Date[n(299)](),h))),e[n(881)](t);if(l){let N=await Ts[n(1407)](this);if(!N)return this[n(186)+n(468)+n(913)](s),e[n(1068)](t);let R=await N.get(_)??-1;if(e[n(1093)](R,v))this[n(186)+n(468)+n(913)](s),N[n(885)](_,v,s[n(1200)][n(249)]);else throw new Error(n(704)+n(541)+n(294)+v+(n(1010)+n(652)+n(264)+"r ")+R);return e[n(908)](t)}return this[n(186)+n(468)+n(913)](s),t()}}async function $a(s,t){let n=r,a=ur.call(this,s);if(!a["isQoSMes"+n(1400)])return e[n(1266)](t);let u=await Ds.call(this);if(a["isAckCle"+n(1335)+n(1642)]&&a[n(1430)+"s"].length)for(let p of a[n(1430)+"s"])await u.del(p);e.hWGZs(t)}async function Qa(s,t){let n=r,a={PxIek:function(l,_,v){return e[k(1033)](l,_,v)}},u=e.tAKWU(s[n(1200)][n(447)+"e"],Ga),p=e.pbVPu(s.message[n(447)+"e"],lr);if(!u&&!p)return e[n(269)](t);let h=e[n(1208)](ot,s[n(1200)][n(1340)],e.NsqZJ);if(!h)return e[n(501)](t);let m=await Ts.call(this,h);if(!m)return e.DLDMw(t);if(u)if(e.kTCaD(e.srVNe,e[n(390)]))_0x4d825d[n(885)](_0x2af58d,_0x3af8a0);else{let l=await m.getCursors(),_={frameType:l?.["frameType"],SeqID:M[n(1164)+"er"](this[n(1226)]++),LogID:M.fromNumber(this[n(163)][n(1641)+n(394)]()),service:9e3,method:5,headers:l?.[n(1340)],payload:l?.[n(1207)]},v=C(_);this[n(1165)]&&this[n(1165)][n(1110)+"te"]&&this[n(1165)][n(1132)](v)}if(p)if(e[n(1301)](e[n(1159)],e[n(1159)])){let l=s[n(1200)][n(1207)];l&&m[n(1300)+"rs"](l)}else _0x37a11f(_0x12a3db,66),upJnce.PxIek(_0x28e586,_0x434347,_0x137805[n(1620)]),upJnce[n(860)](_0x1ac535,_0x5482bb,_0x3e0e06)}let Za=async function(s,t){let n=r;this[n(314)]=!1,e[n(1108)](clearTimeout,this[n(989)+n(1143)+"utId"]),e[n(201)](t)},e0=async function(s,t){let n=r;if(!this[n(1165)]||e.xdFzX(this[n(1165)][n(1110)+"te"],this[n(919)]))return e.ocNwd(t);let{pingInterval:a}=this[n(163)];this["_endpoin"+n(1117)]?.[n(1657)+n(1124)+n(1072)]();for(let p=0;e.aFJHS(p,this[n(431)+n(1288)].length);p++){let h=this["_message"+n(1288)][p];if(e[n(1664)](this[n(1165)][n(1110)+"te"],this[n(919)])&&e[n(1370)](null,h))this[n(1165)]&&this[n(1165)].send(h),this[n(431)+n(1288)][p]=null;else break}this[n(431)+n(1288)]=this[n(431)+"Queue"].filter(p=>!!p),this._pingPongTimeoutId=e[n(521)](setTimeout,()=>this[n(1322)](),a),this[n(186)+n(329)+"nt"](s),this[n(751)+"er"]&&this._ws&&(this[n(1165)][n(517)+"pe"]=this._binaryType);let u=this[n(1287)+"tManager"]?.[n(1539)+"ntEndpoint"]();this._debug(n(1625)+u+n(769)),e[n(746)](t)},t0=async function(s,t){let n=r,a=this["_endpoin"+n(1117)]?.[n(1539)+n(319)+"nt"]();this[n(1343)](n(1625)+a),e.ocNwd(t)};class n0 extends ar{constructor(t){let n=r,a={nwxnx:function(m,l){return e[k(1675)](m,l)},kfKJS:e[n(1182)],jNIWX:e.yzOuH,honWh:e[n(831)],EvGMC:e[n(1050)],WYuof:function(m,l,_){return m(l,_)},nEycp:function(m,l,_){return m(l,_)}};super(),this["_miniNav"+n(1592)+n(457)]=!0,this[n(751)+"er"]=it,this._isNode=wa,this[n(496)+"T"]=Ye,this[n(1516)+"X"]=Ct,this._isWorker=Et,this._messageQueue=[],this[n(1287)+n(1117)]=null,this[n(1414)+n(626)]=!1,this["_binaryT"+n(1237)]="arraybuffer",this._connectLock=!1,this["_connect"+n(1143)+n(215)]=null,this[n(688)+"ctTimeoutId"]=null,this[n(514)+n(1396)+"Id"]=null,this[n(1226)]=0,this._isInit=!1,this[n(829)]="",this[n(957)+n(1604)]=null,this[n(1397)+n(694)]=null,this._pingLossCounter=null,this._protocols=e.JjPGb,this[n(1449)]=3,this[n(333)+"NG"]=0,this.OPEN=1,this.CLOSING=2,this[n(388)]=m=>{let l=n;try{e[l(384)](Cs,this,m,[Za,e0,t0])}catch(_){let v=e[l(482)](de,e.XecCK,{message:_[l(1200)],code:qe[l(234)+"OR"],error:_});this[l(186)+"hErrorEv"+l(1229)](v)}},this[n(220)+"ge"]=async m=>{let l=n,{pingInterval:_,pingFrequency:v}=this._options;if((a[l(245)]("hi",m.data)&&a[l(245)](a[l(408)],v)||a[l(1366)]===v)&&(this[l(601)+l(1097)](),this[l(1412)](l(1502)+l(1187)+"s",a.honWh),this[l(514)+l(1396)+"Id"]=setTimeout(this._ping[l(1577)](this),_)),!a[l(245)]("hi",m.data))try{Cs(this,m,[Ra,Ta,$a,Qa,Xa,La])}catch(A){let N=de(a[l(780)],{message:A[l(1200)],code:qe[l(1475)+l(415)],error:A});this[l(186)+"hErrorEvent"](N)}},this[n(1039)]=m=>{let l=n,_=this["_endpoin"+l(1117)]?.[l(1215)+"chMaxTries"](),v=this[l(1287)+"tManager"]?.["getCurre"+l(319)+"nt"]();if(_&&!m[l(1200)]){let A="connect "+v+(" fail, max retri"+l(1523)+"ed");this[l(186)+l(1330)+l(1229)](a.WYuof(de,a[l(780)],{message:A,code:qe[l(391)+"IES_ERROR"],error:m}));return}this[l(1165)]&&a.nwxnx(this[l(1165)].readyState,this[l(919)])&&this[l(387)+l(986)](),this["_dispatc"+l(1330)+l(1229)](a[l(1012)](de,a[l(780)],{message:m[l(1200)],code:qe[l(305)+l(900)],error:m}))},this[n(1529)]=async m=>{let l=n;this[l(1056)+"mer"](),this["_clearPi"+l(1097)](),this[l(1299)+l(867)+"rs"](),this[l(1165)]=null,this[l(989)+l(1369)]=!1;let _=this[l(1287)+l(1117)]?.[l(1215)+"chMaxTries"]();if(!_&&this[l(493)+"orOnline"]()&&!this[l(1414)+"osed"]){let v=this[l(1287)+l(1117)]?.getCurrentEndpoint(),A=this[l(163)][l(366)+l(478)+l(576)](m[l(793)],m.reason);this[l(186)+"hCloseEv"+l(1229)](e[l(1646)](pe,"close",{code:1006,reason:m[l(942)]||l(1588)+l(656)+l(981)+l(1507)+"n, hostname: "+v,willReconnect:A})),A&&this._connect();return}if(e[l(763)](1e3,m[l(793)])&&this[l(1414)+"osed"]){this[l(186)+"hCloseEv"+l(1229)](e[l(1432)](pe,l(1403),{code:1e3,reason:e[l(1306)]})),this[l(1287)+l(1117)]?.[l(1657)+"pointCon"+l(1072)](),this[l(756)+l(992)]?.[l(273)+l(1355)]();return}if(m[l(793)]!==1e3&&_){let v=this[l(1287)+"tManager"]?.[l(1539)+"ntEndpoint"](),A=m.reason;A||(A=await e[l(1060)](Ea,this[l(829)])),A=l(1588)+l(656)+l(365)+A+(l(238)+l(868))+v+(l(160)+l(679)+l(921)),this[l(186)+"hCloseEvent"](e[l(1417)](pe,e.VWDLJ,{code:m[l(793)],reason:A}));let N="connect "+v+(l(654)+l(1359)+l(1523)+"ed");this[l(186)+l(1330)+l(1229)](de(e[l(1050)],{message:N,code:qe["MAX_RETR"+l(407)+"R"]})),this[l(1287)+l(1117)]?.["resetEnd"+l(1124)+l(1072)](),this[l(756)+l(992)]?.[l(273)+l(1355)]();return}if(m[l(793)]!==1e3&&!m[l(942)]){let v=this[l(1287)+"tManager"]?.[l(1539)+l(319)+"nt"]();this[l(186)+l(178)+l(1229)](pe(e[l(967)],{code:m[l(793)],reason:l(1588)+l(656)+l(981)+"wn reaso"+l(412)+l(1284)+v})),this[l(1287)+"tManager"]?.[l(1657)+l(1124)+l(1072)](),this["_pingLos"+l(992)]?.["resetCou"+l(1355)]();return}this["_dispatc"+l(178)+l(1229)](m),this[l(1287)+"tManager"]?.["resetEnd"+l(1124)+l(1072)](),this[l(756)+l(992)]?.[l(273)+l(1355)]()},this[n(565)]=null,this[n(553)]=null,this[n(552)+"e"]=null,this[n(659)]=null,this[n(960)+"econnect"]=null,this.onReceiveAck=null,this[n(295)+"mediatel"+n(680)+"ct"]=null,this[n(1640)+n(276)]=this[n(1640)+n(276)][n(1577)](this),this[n(1640)+"ffLine"]=this[n(1640)+n(375)][n(1577)](this),this[n(647)+n(709)]=this[n(647)+"ageHide"][n(1577)](this),this._handlePageShow=this[n(647)+n(779)].bind(this),this[n(163)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:e[n(301)](1,0),service:0,logIDGenerator:c,headers:void 0,payloadEncoding:"",payloadType:"",fpID:"",deviceID:"",accessKey:"",ttwID:"",bddID:"",aID:"",disableAutoReconnect:!1,customParams:{},pingInterval:15e3,pingTimeoutInterval:4e3,pingFrequency:n(1349),pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:n(557),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:u,ws:p}=t,h=Array[n(171)](u)?u:e[n(1118)]==typeof u?[u]:[];if(!h||h.length===0)throw new Error(e.fnBxu);if(!e[n(608)](ba,p))throw new Error(e[n(258)]);Object[n(1038)](this[n(163)],t),this[n(1287)+"tManager"]=new Ss(h,this[n(163)].maxRetries),this[n(756)+n(992)]=new Ca(this[n(163)][n(281)+n(450)]),this[n(163)][n(288)+n(808)]&&(this[n(314)]=!0,this[n(989)]()),this._options[n(1296)+n(757)+"nged"]&&(this._isMiniTT||this[n(1516)+"X"]?this[n(1158)+n(1346)+n(740)]():this._isBrowser&&this[n(169)+n(1566)+n(934)]())}[r(1640)+"nLine"](){let t=r;if(!e[t(1236)](e[t(282)],"bNzow")){if(this[t(163)][t(641)+t(1580)+t(1582)]||this["_readyCl"+t(626)])return;this._handleReconnect()}}[r(1640)+r(375)](){let t=r;if(e[t(1644)](e[t(1277)],e[t(1277)])){if(!this[t(1165)])return;this["_destroy"+t(1263)+"t"](_0x59adb2,_0x39d2d0,_0x10c650)}else{this["_destroy"+t(1263)+"t"]();let n=or(e[t(291)],{message:e.DOfma});this[t(295)+t(1488)+t(680)+"ct"]&&this["onStopIm"+t(1488)+t(680)+"ct"](n)}}[r(169)+"balEvent"+r(934)](){let t=r;e.rhlZm!==t(1140)?(this[t(751)+"er"]&&window[t(1380)+t(934)](t(678),this[t(1640)+t(276)]),this[t(751)+"er"]&&window["addEvent"+t(934)](e[t(1291)],this[t(1640)+t(375)]),this[t(751)+"er"]&&window[t(1380)+t(934)]("pagehide",this[t(647)+t(709)]),this._isBrowser&&window[t(1380)+t(934)](e[t(1199)],this[t(647)+t(779)])):(this[t(955)+t(622)]=_0x2a16f3,this[t(813)]=0)}[r(857)+r(1566)+r(934)](){let t=r;this[t(751)+"er"]&&window[t(923)+t(1204)+"ner"](e[t(471)],this[t(1640)+t(276)]),this[t(751)+"er"]&&window[t(923)+"entListe"+t(231)](e.gpllY,this[t(1640)+t(375)]),this[t(751)+"er"]&&window[t(923)+t(1204)+t(231)](e[t(673)],this[t(647)+t(709)]),this[t(751)+"er"]&&window[t(923)+t(1204)+t(231)](e.ZpXHN,this[t(647)+t(779)])}["_handleP"+r(709)](t){let n=r;!t[n(943)+"d"]&&(this[n(751)+"er"]&&window[n(923)+"entListe"+n(231)](e[n(673)],this[n(647)+n(709)]),this[n(751)+"er"]&&window[n(923)+n(1204)+"ner"](n(933),this[n(647)+"ageShow"]),this[n(1403)]()),this[n(751)+"er"]&&window[n(923)+n(1204)+n(231)](e[n(471)],this[n(1640)+"nLine"]),this[n(751)+"er"]&&window[n(923)+n(1204)+n(231)](e[n(1291)],this[n(1640)+n(375)])}[r(647)+r(779)](t){let n=r;t[n(943)+"d"]&&(this._navigatorOnline()&&(!this[n(1165)]||e[n(644)](this[n(1165)][n(1110)+"te"],this[n(919)])||e.BwHOv(this._ws[n(1110)+"te"],this.CONNECTING))&&this[n(1640)+n(276)](),this[n(751)+"er"]&&window[n(1380)+"Listener"](e[n(471)],this[n(1640)+n(276)]),this[n(751)+"er"]&&window.addEventListener("offline",this[n(1640)+"ffLine"]))}async["_generat"+r(262)](t){let n=r,a={aiqft:function(u,p){return u>=p}};if(e.xQLTg(e[n(1576)],e.oEFmA)){let{fpID:u,deviceID:p,bddID:h,ttwID:m,accessKey:l,aID:_,customParams:v={},enableAutoAck:A,enableQoS:N,QoSLevel:R,env:O}=this[n(163)],ie,ce,hr;this[n(751)+"er"]||this._isMiniWX||this[n(496)+"T"]?(ie=location&&e[n(1295)](e[n(865)],location.protocol)?e[n(1224)]:e.nJPCr,ce=t[n(1317)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),hr=/^wss(.*:\/\/)/[n(165)](t)?t:""+ie+ce):(ie=n(1304),ce=t.replace(/(^http)((?:[s]*:\/\/))/,""),hr=/(^ws)((?:[s]*:\/\/))/[n(165)](ce)?ce:""+ie+ce);let Ls=h?e.ZBWzQ:m?"ttwid":n(1325)+"d",Rs=h||m||p;if(e[n(816)](!Rs,!Ls))throw new Error(e[n(1116)]);let r0=e[n(466)]("function",typeof v)?await v():v,s0=O?e[n(1156)](Sa,O.xUseEnv,O[n(330)]):{},gr=Object[n(1038)]({device_platform:"web",version_code:e.ilsXA,access_key:l,fpid:u,aid:_,[Ls]:Rs,xsack:A?1:0,xaack:A?1:0,xsqos:N?1:0,qos_level:N?R:void 0,qos_sdk_version:2,...s0},r0),i0=Object[n(257)](gr)[n(1091)]((pr,mr)=>gr[mr]!==void 0?""+pr+(pr?"&":"?")+mr+"="+gr[mr]:pr,"");return hr+n(483)+i0}else if(BDEWFG.aiqft(_0x157ec,_0x1ea6e9))return _0x487b8d}async[r(989)](){let t=r;if(!(this._connectLock||this["_readyCl"+t(626)])){this[t(989)+t(1369)]=!0;try{if(e[t(707)]("sJRsb",e[t(208)])){let n=this[t(1287)+t(1117)]?.["checkCur"+t(1030)+t(718)+t(336)+t(1614)](),{timeoutInterval:a}=this._options;if(n){let p=this[t(1287)+"tManager"]?.[t(1539)+"ntEndpoint"](),h=this[t(1287)+t(1117)]?.[t(1331)+"ackupEnd"+t(932)+t(495)+t(841)](),m=this[t(1287)+"tManager"]?.[t(1539)+t(319)+t(698)+t(622)]();if(h){let l="connect "+p+(t(824)+t(160)+t(679)+t(612)+t(1443)+t(1535)+t(1549))+h+(t(335)+"y"),_=e[t(332)](de,e[t(1050)],{message:l,code:qe["MAX_RETR"+t(407)+"R"]});this._debug(l),this[t(186)+t(1330)+t(1229)](_),this[t(829)]=await this[t(1505)+"eUrl"](h),this[t(1343)](t(1470)+h+" "+m+t(1321)),this[t(1299)+t(867)+"rs"]()}else if(e[t(1121)](e[t(615)],t(1563)))this[t(314)]=!0,this._connect();else{let l=t(1470)+p+(t(824)+t(160)+t(679)+t(921));this[t(1343)](l),this[t(186)+"hErrorEv"+t(1229)](e[t(224)](de,e.XecCK,{message:l,code:qe[t(391)+t(407)+"R"]}));return}}else{let p=this[t(1287)+t(1117)]?.[t(1539)+t(319)+t(373)+t(379)](),h=this["_endpoin"+t(1117)]?.[t(1539)+"ntEndpointTriesCount"]();this[t(829)]=await this[t(1505)+"eUrl"](p||""),this[t(1343)](t(1470)+p+" "+h+" times"),this[t(1299)+t(867)+"rs"]()}if(this[t(314)])this[t(314)]=!1;else{let p=e[t(924)](or,e[t(291)],{message:e[t(437)]});this[t(960)+t(1167)]&&this["onStartR"+t(1167)](p)}let u=this[t(1287)+t(1117)]?.[t(1539)+"ntEndpoi"+t(698)+t(622)]()||0;e[t(1383)](u,1)&&await this[t(729)](e[t(198)](u,1)),this._debug(t(1588)+t(1061)+this[t(829)]+(t(1122)+t(342))+this._protocols),this[t(1165)]=e.kNJiC(ya,{url:this[t(829)],protocols:[this[t(1652)+"ls"]],headers:this[t(163)][t(424)+t(1362)+"s"][t(537)+t(1661)]},this[t(163)].ws),(this[t(751)+"er"]||this._isWorker)&&this[t(1165)]&&(this[t(1165)][t(517)+"pe"]=this[t(1094)+t(1237)]),this[t(1305)+t(727)](),this[t(989)+t(1143)+t(215)]=e[t(924)](setTimeout,this._onTimeout[t(1577)](this),a)}else{let n=_0x16e3e5[t(738)+t(624)](_0x20235e);return _0x77943f&&n[t(1380)+t(934)](CSsDJD[t(503)],()=>_0x2dfcb1()),CSsDJD[t(639)](_0xc918d2,n).then(()=>{})}}catch(n){throw this[t(989)+t(1369)]=!1,n}}}_clearTimer(){let t=r;e.dZkZC===e[t(456)]?(e[t(878)](clearTimeout,this["_connect"+t(1143)+"utId"]),this[t(989)+t(1143)+t(215)]=null):(_0x3d3e1e[t(923)+"entListe"+t(231)](CSsDJD[t(831)],_0x2c60d4),_0x47bb2a[t(923)+"entListe"+t(231)](CSsDJD[t(1050)],_0x3d734c))}[r(601)+r(1097)](){let t=r;e[t(847)](clearTimeout,this[t(514)+t(1396)+"Id"]),clearTimeout(this["_reconne"+t(353)+"tId"]),this[t(514)+t(1396)+"Id"]=null,this[t(688)+t(353)+"tId"]=null}[r(1343)](...t){let n=r;this._options[n(686)]&&console[n(775)].apply(console,[n(750)+">",...t])}["_getInte"+r(653)+"e"](t){let n=r,{initReconnectInterval:a,maxReconnectInterval:u,reconnectIntervalGrowFactor:p}=this[n(163)],h=e.mTBNJ(a,Math.pow(p,t-1));return e.mOzqx(h,u)?u:h}[r(1322)](){let t=r;if(this[t(1165)]&&e[t(1268)](this[t(1165)][t(1110)+"te"],this[t(333)+"NG"])){this[t(601)+"ngTimer"](),this[t(514)+t(1396)+"Id"]=setTimeout(this[t(1322)][t(1577)](this),this._options[t(1478)+t(1271)]);return}if(!this._ws||e[t(508)](this[t(1165)][t(1110)+"te"],this[t(919)]))return void this[t(1413)+t(1167)]();this._ws&&this._ws[t(1132)]("hi"),this[t(688)+t(353)+t(381)]=e[t(1646)](setTimeout,this["_handleR"+t(1167)+t(603)][t(1577)](this),this[t(163)][t(250)+t(995)+t(512)])}[r(1413)+r(1167)+"Timeout"](){let t=r;this[t(756)+t(992)]?.[t(473)](),this[t(1412)](e[t(1157)],e[t(260)]),this[t(756)+"sCounter"]?.[t(1215)+"chMaxCount"]()?this[t(1413)+t(1167)]():this[t(1322)]()}[r(493)+r(1245)](){let t=r;return this._isMiniTT||this[t(1516)+"X"]?this[t(619)+t(1592)+t(457)]:(this[t(751)+"er"]||this[t(1483)+"r"])&&this[t(163)][t(1296)+"tworkCha"+t(240)]?navigator[t(376)]:!0}[r(1413)+r(1167)](){let t=r;!this[t(493)+t(1245)]()||this[t(1414)+t(626)]||(this[t(1287)+t(1117)]?.[t(1657)+t(1124)+t(1072)](),this._pingLossCounter?.[t(273)+t(1355)](),this[t(1165)]?this[t(387)+t(986)](1001,e[t(1564)],!0):this[t(989)]())}[r(1158)+r(1346)+r(740)](){let t=r,n={FrUxR:function(a,u){return e[k(212)](a,u)},jsqXG:function(a,u,p){return e[k(609)](a,u,p)},rKGjg:function(a,u){return e[k(515)](a,u)},jzMnR:e[t(820)]};this[t(496)+"T"]?tt[t(1399)+t(1298)+t(346)](({isConnected:a})=>{let u=t;this[u(619)+u(1592)+u(457)]=a,a?this[u(1640)+u(276)]():this[u(1640)+u(375)]()}):this[t(1516)+"X"]&&wx.onNetworkStatusChange(({isConnected:a})=>{let u=t;if(u(806)!==n[u(241)])this["_miniNavigatorOn"+u(457)]=a,a?this[u(1640)+"nLine"]():this["_handleO"+u(375)]();else{let p=0,h=_0x176842,m=_0x3c2432+4;for(;zkpyPM[u(723)](h,m);){let{value:l,offset:_}=zkpyPM[u(655)](_0x940466,_0x4b634f,h);h=_,p=zkpyPM[u(1137)](p,8)>>>0,p+=l}return{value:p,offset:m}}})}[r(729)](t){let n={dqxGr:function(a,u,p){return e.GvQYd(a,u,p)}};return new Promise(a=>{let u=k;n[u(1650)](setTimeout,a,this[u(1013)+u(653)+"e"](t))})}[r(387)+r(986)](t=1e3,n="",a=!1){let u=r;this[u(1165)]&&this[u(239)+u(1263)+"t"](t,n,a)}[r(322)+"ut"](){let t=r,n=this[t(1287)+t(1117)]?.[t(1539)+t(319)+"nt"]();this[t(1343)](t(1470)+n+t(824)),this[t(387)+"ect"](1001,e[t(951)],!0)}[r(1494)](t){let n=r,a={MRVPO:e.RmkvX,nsGuo:e[n(1157)],MnZQi:function(u,p,h){return u(p,h)},isoAC:function(u,p){return e[n(1107)](u,p)},wDVdx:"ping_onc"+n(1187)+"s"};if(e[n(888)]!==e[n(1166)]){let u=e[n(529)](ir,t);this[n(1165)]&&this._ws[n(1110)+"te"]===this[n(919)]&&(this[n(1165)]&&this._ws[n(1132)](u),this[n(1343)](e.TQBkq,t))}else{let u={EPoJy:function(p,h){return a[n(1521)](p,h)},colRG:"success",DxIKj:a[n(1144)],pYYPb:a.nsGuo};return new _0x841e95((p,h)=>{let m=n,l={ufwil:a[m(974)],DjCQx:m(1502)+m(1187)+"s",KBitN:a.nsGuo};this[m(601)+"ngTimer"](),this[m(514)+"gTimeoutId"]=a.MnZQi(_0x135ce8,this[m(1322)][m(1577)](this),this[m(163)][m(1478)+"rval"]);let _=()=>{let A=m;u[A(696)](p,u[A(1206)]),this.off(u.DxIKj,_),this[A(1342)](u[A(801)],v)},v=()=>{let A=m;h(l[A(228)]),this.off(l.DjCQx,_),this[A(1342)](l[A(1225)],v)};this.on(m(1502)+m(1187)+"s",_),this.on(a.nsGuo,v),this._ping()})}}[r(1299)+r(867)+"rs"](){let t=r,n=e[t(1462)].split("|"),a=0;for(;;){switch(n[a++]){case"0":this[t(1165)][t(923)+t(1204)+t(231)](t(1403),this[t(1529)]);continue;case"1":this[t(1165)]["removeEv"+t(1204)+"ner"](e[t(544)],this._onMessage);continue;case"2":if(!this._ws)return;continue;case"3":this._ws[t(923)+t(1204)+t(231)](e[t(1050)],this[t(1039)]);continue;case"4":this[t(1165)][t(923)+t(1204)+t(231)](e[t(666)],this[t(388)]);continue}break}}["_addWsLi"+r(727)](){let t=r,n=(t(637)+"4")[t(460)]("|"),a=0;for(;;){switch(n[a++]){case"0":this[t(1165)]["addEvent"+t(934)](e[t(967)],this._onClose);continue;case"1":this[t(1165)][t(1380)+t(934)](e[t(544)],this[t(220)+"ge"]);continue;case"2":if(!this[t(1165)])return;continue;case"3":this[t(1165)].addEventListener(e[t(666)],this[t(388)]);continue;case"4":this._ws[t(1380)+t(934)]("error",this._onError);continue}break}}[r(167)+"nceClose"](t=1e3,n=""){let a=r;try{this._ws&&this[a(1165)][a(1403)](t,n)}catch{}}[r(239)+r(1263)+"t"](t=1e3,n="",a=!1){let u=r;if(this["_clearPi"+u(1097)](),this[u(1056)+"mer"](),this[u(1299)+"sListeners"](),this[u(167)+u(1096)](1e3,n),this[u(989)+u(1369)]=!1,a&&this[u(493)+u(1245)]()&&!this["_readyCl"+u(626)]){if(this[u(1287)+"tManager"]?.[u(1215)+u(1269)+"es"]())if(e[u(1250)]!==e[u(1365)]){let h=this[u(1287)+"tManager"]?.[u(1539)+u(319)+"nt"]();this[u(186)+u(178)+u(1229)](pe(e[u(967)],{code:1006,reason:"connect "+h+(u(824)+u(160)+u(679)+u(921)),wasClean:!0}))}else{let{pingInterval:h,pingFrequency:m}=this._options;if((e[u(1014)]("hi",_0x437baf[u(1436)])&&m==="always"||e[u(509)](e.yzOuH,m))&&(this[u(601)+u(1097)](),this[u(1412)](e[u(400)],e[u(831)]),this[u(514)+"gTimeoutId"]=e.EnKdD(_0x35c01b,this[u(1322)][u(1577)](this),h)),_0x56f17c.data==="hi")return;try{e[u(217)](_0x401310,this,_0x49673b,[_0x2d4e1c,_0x359677,_0x48f1d6,_0x4007e5,_0x315cd7,_0x55862e])}catch(l){let _=e.TXDxl(_0x398ec7,u(939),{message:l[u(1200)],code:_0x33f08f.MESSAGE_ERROR,error:l});this[u(186)+"hErrorEv"+u(1229)](_)}}else{let h=this[u(163)][u(366)+"tInterce"+u(576)](t,n);this[u(186)+u(178)+u(1229)](e.kfPVE(pe,u(1403),{code:t,reason:n,wasClean:!0,willReconnect:h})),h&&this[u(989)]()}return}this[u(493)+"orOnline"]()||this["_readyCl"+u(626)]?this[u(186)+u(178)+u(1229)](pe(e[u(967)],{code:t,reason:e[u(1306)]})):this["_dispatchCloseEv"+u(1229)](e[u(785)](pe,e[u(967)],{code:1006,reason:e.rLpfX})),this[u(1165)]=null,this[u(1287)+"tManager"]?.["resetEnd"+u(1124)+u(1072)](),this._pingLossCounter?.[u(273)+u(1355)]()}_dispatchOpenEvent(t){let n=r;this.emit(n(280),t),this[n(659)]&&this[n(659)](t)}["_dispatc"+r(468)+r(913)](t){let n=r;this.emit(e[n(544)],t),this[n(552)+"e"]&&this.onmessage(t)}["_dispatchAckMess"+r(1410)](t){let n=r;this[n(1412)](n(338),t),this[n(882)+n(442)]&&this["onReceiv"+n(442)](t)}[r(186)+"hErrorEv"+r(1229)](t){let n=r;this[n(1412)](e[n(1050)],t),this[n(553)]&&this[n(553)](t)}[r(186)+r(178)+r(1229)](t){let n=r;this[n(1412)](e[n(967)],t),this[n(565)]&&this[n(565)](t)}get[r(517)+"pe"](){let t=r;return this[t(1165)]?this[t(1165)][t(517)+"pe"]:this[t(1094)+t(1237)]}set[r(517)+"pe"](t){let n=r,a={CqXaH:function(u,p,h){return e[k(1057)](u,p,h)}};e[n(274)](e.EeSRR,e[n(1574)])?(this[n(1094)+"ype"]=t,this._ws&&(this[n(1165)][n(517)+"pe"]=t)):(hqmkrC[n(795)](_0x5bed50,_0x270440,50),hqmkrC[n(795)](_0x1d1c06,_0x3e1755,_0x41d59a))}get retryCount(){let t=r;return this[t(1287)+t(1117)]?.[t(1539)+"ntEndpoi"+t(698)+t(622)]()||0}get bufferedAmount(){let t=r,n=this[t(431)+t(1288)].reduce((a,u)=>(a+=u&&u.byteLength||0,a),0);return e[t(1338)](n,this._ws?this[t(1165)]["buffered"+t(1557)]:0)}get extensions(){let t=r;return this[t(1165)]?this[t(1165)][t(369)+"ns"]:""}get[r(402)](){let t=r;return this[t(1165)]?this[t(1165)][t(402)]:""}get readyState(){let t=r,n={CLsbH:function(a,u){return e.yMnab(a,u)},FzMhc:e.HPLgT,HJBvD:function(a,u){return e[k(620)](a,u)},bUcCA:function(a,u){return e.ivvqB(a,u)},ihlUU:function(a,u){return e.Vtpdq(a,u)}};if(e[t(851)](e[t(1426)],t(1181)))return this[t(1165)]?this[t(1165)][t(1110)+"te"]:this._options[t(288)+"cOpen"]?this[t(333)+"NG"]:this[t(1449)];{if(EceIWY[t(1511)](_0x341f7c,_0x48d3ef))throw new _0x97fb18(EceIWY[t(175)]);let a=3;for(;EceIWY.HJBvD(a,0);){let u=EceIWY[t(1283)](255,_0x37f3fc);_0x1cf881(u,_0x10f7e2,_0x473921+a),_0x562bbd>>>=8,a--}return EceIWY[t(1544)](_0x23c66e,4)}}get url(){let t=r;return this._ws?this[t(1165)][t(1045)]:this._url}[r(1403)](t=1e3,n){let a=r,u=e[a(476)][a(460)]("|"),p=0;for(;;){switch(u[p++]){case"0":this[a(857)+"balEvent"+a(934)]();continue;case"1":this[a(957)+"ger"]?.[a(216)]();continue;case"2":if(!this[a(1165)])return void this._debug("close, w"+a(432)+"ce not i"+a(244)+"ed");continue;case"3":this[a(1414)+a(626)]=!0;continue;case"4":if(e[a(715)](this[a(1165)][a(1110)+"te"],this.CLOSED)||e.mlGPh(this._ws[a(1110)+"te"],this[a(664)]))return void this[a(1343)](e.QxKxB);continue;case"5":this._clearPingTimer();continue;case"6":this[a(239)+a(1263)+"t"](t,n);continue;case"7":this[a(1056)+a(804)]();continue}break}}async[r(1132)](t,n){let a=r;if(e.LKQal(null,t))throw new Error(e[a(1632)]);a(1309)==typeof t&&(t=JSON[a(1047)+"y"](t)),e[a(1293)](e[a(1118)],typeof t)&&!(t instanceof ArrayBuffer)&&!(t[a(506)]&&t[a(506)]instanceof ArrayBuffer)&&(t=JSON[a(1047)+"y"](t));let u=await e[a(608)](ks,t),p=e[a(243)](va,t),{method:h=0,service:m=this[a(163)][a(249)],logID:l=this[a(163)][a(1641)+a(394)](),headers:_=this._options.headers,payloadEncoding:v=this[a(163)][a(230)+a(320)],payloadType:A=this[a(163)][a(1195)+a(1237)],logIDNew:N=this._options["logIDNew"+a(705)][a(185)+a(663)+a(899)+"ew"]?e.lDmlh(o,this[a(163)][a(172)+a(705)][a(1444)]):""}=n||{};if(!m)throw new Error("please provide a"+a(782)+a(632));let R={SeqID:M[a(1164)+"er"](this._seqId++),LogID:M[a(1164)+"er"](l),service:m,method:h,headers:_,payloadEncoding:e.Krcsa(v,Object)?v[a(993)]?v[a(993)]:"":v,payloadType:e[a(1658)](A,Object)?A.type?A.type:p:A||p,payload:u,LogIDNew:N},O=ir(R);return this[a(1165)]&&e[a(1121)](this[a(1165)].readyState,this[a(919)])?(this._ws&&this[a(1165)][a(1132)](O),this[a(1343)](e.TJQvj,R)):e.xLbNC(this[a(431)+a(1288)][a(1620)],this[a(163)]["maxMessa"+a(1274)+a(1471)])?(this[a(431)+a(1288)].push(O),this[a(1343)](e[a(930)],R)):(this[a(431)+a(1288)][a(1513)](),this[a(431)+a(1288)].push(O)),{seqID:this[a(1226)],logID:l,logIDNew:N}}async reconnect(t){let n=r,{url:a}=e[n(1371)](t,{}),u=Array[n(171)](a)?a:e.iYuFb==typeof a?[a]:[];t&&Object[n(1038)](this[n(163)],t),u&&u[n(1620)]?this[n(1287)+n(1117)]=new Ss(u,this[n(163)][n(326)+"es"]):this["_endpoin"+n(1117)]?.[n(1657)+"pointCon"+n(1072)](),this[n(756)+n(992)]?.[n(273)+n(1355)](this._options["pingLoss"+n(450)]),this["_readyCl"+n(626)]=!1,this[n(1165)]&&this._ws[n(1110)+"te"]!==this.CLOSED?this[n(387)+n(986)](1e3,e[n(1408)],!0):(this[n(314)]=!0,this._connect())}async[r(1434)](){let t=r;if(!this["_connect"+t(1369)]){let n=e[t(177)][t(460)]("|"),a=0;for(;;){switch(n[a++]){case"0":this[t(1287)+t(1117)]?.[t(1657)+t(1124)+"fig"]();continue;case"1":this[t(756)+t(992)]?.resetCounter();continue;case"2":this[t(314)]=!0;continue;case"3":this[t(1414)+t(626)]=!1;continue;case"4":this._connect();continue}break}}}[r(1380)+r(934)](t,n){this.on(t,n)}[r(156)+r(913)](t){let{type:n}=t;this.emit(n,t)}removeEventListener(t,n){let a=r;e[a(1509)]===e[a(1136)]?this[a(1184)]?.del(_0x454692.message_id):this[a(1342)](t,n)}[r(1506)](){let t=r,n={gDuGT:function(a,u){return a(u)},WkeYk:e[t(400)],qetRz:e[t(1157)],EHdxn:function(a,u){return a>>u},rtgSg:function(a,u){return e[t(1543)](a,u)},fyOev:function(a,u,p){return a(u,p)},jThnq:e[t(1050)],ZvzKJ:t(1403),iIOES:function(a,u){return e[t(1027)](a,u)},FHEFi:e[t(803)],azGsA:function(a,u){return e[t(936)](a,u)},hZOil:e.RmkvX,FBUAI:e.dCuRs};return new Promise((a,u)=>{let p=t,h={iOqtX:function(m,l,_){return n[k(892)](m,l,_)},vxboB:n.jThnq,LMFnj:n[p(1303)],SihdS:function(m,l){return n[p(1058)](m,l)},bIbBq:n[p(1147)],DUVth:function(m,l){return n[p(389)](m,l)},RAgoG:n[p(1570)],SfnFh:n[p(542)]};if(n[p(1058)](n.FBUAI,"bgNmQ")){this._clearPingTimer(),this[p(514)+p(1396)+"Id"]=setTimeout(this[p(1322)][p(1577)](this),this[p(163)][p(1478)+p(1271)]);let m=()=>{let _=p;n[_(356)](a,_(227)),this.off(n[_(810)],m),this.off(n[_(542)],l)},l=()=>{let _=p;if(h[_(534)](h[_(736)],"ghlDe")){let v=IWoQLO[_(206)](_0x5793d1,IWoQLO[_(1550)],{message:this["_formatE"+_(1311)+_(1642)](_0x253b16)});this.emit(IWoQLO[_(1550)],v);let A=IWoQLO[_(206)](_0x2a35e0,IWoQLO[_(1103)],{reason:this["_formatE"+_(1311)+_(1642)](_0x29f7c3)});this[_(1412)](_(1403),A)}else h[_(789)](u,h[_(1230)]),this[_(1342)](_(1502)+_(1187)+"s",m),this[_(1342)](h[_(1273)],l)};this.on(n.WkeYk,m),this.on(n[p(542)],l),this[p(1322)]()}else return _0x59d3a6|=0,{low:_0x778678,high:BQVyvH[p(418)](_0x4788e4,31),unsigned:BQVyvH.rtgSg(_0x281f96,0)}})}}})(),X[S(253)+S(1635)]=Y[S(253)+S(1635)],X[S(1579)+S(1606)]=Y[S(1579)+"rorEvent"],X[S(618)+"e"]=Y[S(618)+"e"],X[S(913)]=Y.Event,X[S(558)]=Y[S(558)],X[S(566)+S(1545)+S(748)]=Y[S(566)+S(1545)+S(748)],X[S(1545)+S(748)]=Y[S(1545)+S(748)],X[S(580)+"t"]=Y[S(580)+"t"],X[S(1011)+S(699)]=Y[S(1011)+S(699)],X.createCloseEvent=Y[S(1517)+S(1635)],X[S(1531)+S(1606)]=Y[S(1531)+S(1606)],X[S(536)+"ssageEvent"]=Y["createMe"+S(822)+"nt"],X["createOp"+S(890)]=Y[S(504)+S(890)],X[S(661)+S(1492)+S(748)]=Y["createRe"+S(1492)+S(748)],X[S(218)+S(574)]=Y[S(218)+"rame"],X[S(672)+S(1028)]=Y[S(672)+"ame"];for(Pn in Y)[S(253)+"oseEvent",S(1579)+S(1606),S(618)+"e",S(913),S(558),"Frontier"+S(1545)+S(748),S(1545)+S(748),"OpenEvent","Reconnec"+S(699),S(1517)+"oseEvent",S(1531)+S(1606),S(536)+"ssageEvent",S(504)+S(890),"createRe"+S(1492)+S(748),S(218)+S(574),S(672)+S(1028)][S(1648)](Pn)===-1&&(X[Pn]=Y[Pn]);var Pn;Object[S(1067)+"operty"](X,"__esModule",{value:!0})});var Ne=oe((gh,Ui)=>{"use strict";var qi=["nodebuffer","arraybuffer","fragments"],Fi=typeof Blob<"u";Fi&&qi.push("blob");Ui.exports={BINARY_TYPES:qi,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Fi,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var zt=oe((ph,On)=>{"use strict";var{EMPTY_BUFFER:xx}=Ne(),Ir=Buffer[Symbol.species];function ux(r,e){if(r.length===0)return xx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(e),o=0;for(let c=0;c<r.length;c++){let x=r[c];i.set(x,o),o+=x.length}return o<e?new Ir(i.buffer,i.byteOffset,o):i}function Hi(r,e,i,o,c){for(let x=0;x<c;x++)i[o+x]=r[x]^e[x&3]}function Ki(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function fx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Tr(r){if(Tr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Ir(r):ArrayBuffer.isView(r)?e=new Ir(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Tr.readOnly=!1),e}On.exports={concat:ux,mask:Hi,toArrayBuffer:fx,toBuffer:Tr,unmask:Ki};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=V("bufferutil");On.exports.mask=function(e,i,o,c,x){x<48?Hi(e,i,o,c,x):r.mask(e,i,o,c,x)},On.exports.unmask=function(e,i){e.length<32?Ki(e,i):r.unmask(e,i)}}catch{}});var ji=oe((mh,Wi)=>{"use strict";var Gi=Symbol("kDone"),Lr=Symbol("kRun"),Rr=class{constructor(e){this[Gi]=()=>{this.pending--,this[Lr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Lr]()}[Lr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[Gi])}}};Wi.exports=Rr});var gt=oe((wh,Xi)=>{"use strict";var qt=V("zlib"),Ji=zt(),dx=ji(),{kStatusCode:Vi}=Ne(),lx=Buffer[Symbol.species],hx=Buffer.from([0,0,255,255]),Mn=Symbol("permessage-deflate"),Oe=Symbol("total-length"),lt=Symbol("callback"),We=Symbol("buffers"),ht=Symbol("error"),Bn,Nr=class{constructor(e){if(this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Bn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Bn=new dx(i)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[lt];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let i=this._options,o=e.find(c=>!(i.serverNoContextTakeover===!1&&c.server_no_context_takeover||c.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>c.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!c.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(o.server_no_context_takeover=!0),i.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(o.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?o.client_max_window_bits=i.clientMaxWindowBits:(o.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(e){let i=e[0];if(this._options.clientNoContextTakeover===!1&&i.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!i.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(i.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&i.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return i}normalizeParams(e){return e.forEach(i=>{Object.keys(i).forEach(o=>{let c=i[o];if(c.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(c=c[0],o==="client_max_window_bits"){if(c!==!0){let x=+c;if(!Number.isInteger(x)||x<8||x>15)throw new TypeError(`Invalid value for parameter "${o}": ${c}`);c=x}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${c}`)}else if(o==="server_max_window_bits"){let x=+c;if(!Number.isInteger(x)||x<8||x>15)throw new TypeError(`Invalid value for parameter "${o}": ${c}`);c=x}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(c!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${c}`)}else throw new Error(`Unknown parameter "${o}"`);i[o]=c})}),e}decompress(e,i,o){Bn.add(c=>{this._decompress(e,i,(x,f)=>{c(),o(x,f)})})}compress(e,i,o){Bn.add(c=>{this._compress(e,i,(x,f)=>{c(),o(x,f)})})}_decompress(e,i,o){let c=this._isServer?"client":"server";if(!this._inflate){let x=`${c}_max_window_bits`,f=typeof this.params[x]!="number"?qt.Z_DEFAULT_WINDOWBITS:this.params[x];this._inflate=qt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:f}),this._inflate[Mn]=this,this._inflate[Oe]=0,this._inflate[We]=[],this._inflate.on("error",px),this._inflate.on("data",Yi)}this._inflate[lt]=o,this._inflate.write(e),i&&this._inflate.write(hx),this._inflate.flush(()=>{let x=this._inflate[ht];if(x){this._inflate.close(),this._inflate=null,o(x);return}let f=Ji.concat(this._inflate[We],this._inflate[Oe]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Oe]=0,this._inflate[We]=[],i&&this.params[`${c}_no_context_takeover`]&&this._inflate.reset()),o(null,f)})}_compress(e,i,o){let c=this._isServer?"server":"client";if(!this._deflate){let x=`${c}_max_window_bits`,f=typeof this.params[x]!="number"?qt.Z_DEFAULT_WINDOWBITS:this.params[x];this._deflate=qt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:f}),this._deflate[Oe]=0,this._deflate[We]=[],this._deflate.on("data",gx)}this._deflate[lt]=o,this._deflate.write(e),this._deflate.flush(qt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let x=Ji.concat(this._deflate[We],this._deflate[Oe]);i&&(x=new lx(x.buffer,x.byteOffset,x.length-4)),this._deflate[lt]=null,this._deflate[Oe]=0,this._deflate[We]=[],i&&this.params[`${c}_no_context_takeover`]&&this._deflate.reset(),o(null,x)})}};Xi.exports=Nr;function gx(r){this[We].push(r),this[Oe]+=r.length}function Yi(r){if(this[Oe]+=r.length,this[Mn]._maxPayload<1||this[Oe]<=this[Mn]._maxPayload){this[We].push(r);return}this[ht]=new RangeError("Max payload size exceeded"),this[ht].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ht][Vi]=1009,this.removeListener("data",Yi),this.reset()}function px(r){if(this[Mn]._inflate=null,this[ht]){this[lt](this[ht]);return}r[Vi]=1007,this[lt](r)}});var pt=oe((_h,zn)=>{"use strict";var{isUtf8:$i}=V("buffer"),{hasBlob:mx}=Ne(),_x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function yx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Or(r){let e=r.length,i=0;for(;i<e;)if((r[i]&128)===0)i++;else if((r[i]&224)===192){if(i+1===e||(r[i+1]&192)!==128||(r[i]&254)===192)return!1;i+=2}else if((r[i]&240)===224){if(i+2>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||r[i]===224&&(r[i+1]&224)===128||r[i]===237&&(r[i+1]&224)===160)return!1;i+=3}else if((r[i]&248)===240){if(i+3>=e||(r[i+1]&192)!==128||(r[i+2]&192)!==128||(r[i+3]&192)!==128||r[i]===240&&(r[i+1]&240)===128||r[i]===244&&r[i+1]>143||r[i]>244)return!1;i+=4}else return!1;return!0}function bx(r){return mx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}zn.exports={isBlob:bx,isValidStatusCode:yx,isValidUTF8:Or,tokenChars:_x};if($i)zn.exports.isValidUTF8=function(r){return r.length<24?Or(r):$i(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=V("utf-8-validate");zn.exports.isValidUTF8=function(e){return e.length<32?Or(e):r(e)}}catch{}});var Fr=oe((yh,so)=>{"use strict";var{Writable:vx}=V("stream"),Qi=gt(),{BINARY_TYPES:Sx,EMPTY_BUFFER:Zi,kStatusCode:Cx,kWebSocket:Ex}=Ne(),{concat:Br,toArrayBuffer:Ax,unmask:kx}=zt(),{isValidStatusCode:Px,isValidUTF8:eo}=pt(),qn=Buffer[Symbol.species],le=0,to=1,no=2,ro=3,Mr=4,zr=5,Fn=6,qr=class extends vx{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Sx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Ex]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=le}_write(e,i,o){if(this._opcode===8&&this._state==le)return o();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(o)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let o=this._buffers[0];return this._buffers[0]=new qn(o.buffer,o.byteOffset+e,o.length-e),new qn(o.buffer,o.byteOffset,e)}let i=Buffer.allocUnsafe(e);do{let o=this._buffers[0],c=i.length-e;e>=o.length?i.set(this._buffers.shift(),c):(i.set(new Uint8Array(o.buffer,o.byteOffset,e),c),this._buffers[0]=new qn(o.buffer,o.byteOffset+e,o.length-e)),e-=o.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case le:this.getInfo(e);break;case to:this.getPayloadLength16(e);break;case no:this.getPayloadLength64(e);break;case ro:this.getMask();break;case Mr:this.getData(e);break;case zr:case Fn:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let c=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(c);return}let o=(i[0]&64)===64;if(o&&!this._extensions[Qi.extensionName]){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(o){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(!this._fragmented){let c=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}this._compressed=o}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let c=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(c);return}if(o){let c=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(c);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let c=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(c);return}}else{let c=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(c);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let c=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(c);return}}else if(this._masked){let c=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(c);return}this._payloadLength===126?this._state=to:this._payloadLength===127?this._state=no:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),o=i.readUInt32BE(0);if(o>Math.pow(2,21)-1){let c=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(c);return}this._payloadLength=o*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(i);return}this._masked?this._state=ro:this._state=Mr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Mr}getData(e){let i=Zi;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}i=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&kx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=zr,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[Qi.extensionName].decompress(e,this._fin,(c,x)=>{if(c)return i(c);if(x.length){if(this._messageLength+=x.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let f=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(f);return}this._fragments.push(x)}this.dataMessage(i),this._state===le&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=le;return}let i=this._messageLength,o=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let c;this._binaryType==="nodebuffer"?c=Br(o,i):this._binaryType==="arraybuffer"?c=Ax(Br(o,i)):this._binaryType==="blob"?c=new Blob(o):c=o,this._allowSynchronousEvents?(this.emit("message",c,!0),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit("message",c,!0),this._state=le,this.startLoop(e)}))}else{let c=Br(o,i);if(!this._skipUTF8Validation&&!eo(c)){let x=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(x);return}this._state===zr||this._allowSynchronousEvents?(this.emit("message",c,!1),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit("message",c,!1),this._state=le,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Zi),this.end();else{let o=e.readUInt16BE(0);if(!Px(o)){let x=this.createError(RangeError,`invalid status code ${o}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(x);return}let c=new qn(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!eo(c)){let x=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(x);return}this._loop=!1,this.emit("conclude",o,c),this.end()}this._state=le;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=le):(this._state=Fn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=le,this.startLoop(i)}))}createError(e,i,o,c,x){this._loop=!1,this._errored=!0;let f=new e(o?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(f,this.createError),f.code=x,f[Cx]=c,f}};so.exports=qr});var Kr=oe((vh,ao)=>{"use strict";var{Duplex:bh}=V("stream"),{randomFillSync:Dx}=V("crypto"),io=gt(),{EMPTY_BUFFER:Ix,kWebSocket:Tx,NOOP:Lx}=Ne(),{isBlob:mt,isValidStatusCode:Rx}=pt(),{mask:oo,toBuffer:$e}=zt(),he=Symbol("kByteLength"),Nx=Buffer.alloc(4),Un=8*1024,Qe,wt=Un,we=0,Ox=1,Bx=2,Ur=class r{constructor(e,i,o){this._extensions=i||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=we,this.onerror=Lx,this[Tx]=void 0}static frame(e,i){let o,c=!1,x=2,f=!1;i.mask&&(o=i.maskBuffer||Nx,i.generateMask?i.generateMask(o):(wt===Un&&(Qe===void 0&&(Qe=Buffer.alloc(Un)),Dx(Qe,0,Un),wt=0),o[0]=Qe[wt++],o[1]=Qe[wt++],o[2]=Qe[wt++],o[3]=Qe[wt++]),f=(o[0]|o[1]|o[2]|o[3])===0,x=6);let d;typeof e=="string"?(!i.mask||f)&&i[he]!==void 0?d=i[he]:(e=Buffer.from(e),d=e.length):(d=e.length,c=i.mask&&i.readOnly&&!f);let g=d;d>=65536?(x+=8,g=127):d>125&&(x+=2,g=126);let w=Buffer.allocUnsafe(c?d+x:x);return w[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(w[0]|=64),w[1]=g,g===126?w.writeUInt16BE(d,2):g===127&&(w[2]=w[3]=0,w.writeUIntBE(d,4,6)),i.mask?(w[1]|=128,w[x-4]=o[0],w[x-3]=o[1],w[x-2]=o[2],w[x-1]=o[3],f?[w,e]:c?(oo(e,o,w,x,d),[w]):(oo(e,o,e,0,d),[w,e])):[w,e]}close(e,i,o,c){let x;if(e===void 0)x=Ix;else{if(typeof e!="number"||!Rx(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)x=Buffer.allocUnsafe(2),x.writeUInt16BE(e,0);else{let d=Buffer.byteLength(i);if(d>123)throw new RangeError("The message must not be greater than 123 bytes");x=Buffer.allocUnsafe(2+d),x.writeUInt16BE(e,0),typeof i=="string"?x.write(i,2):x.set(i,2)}}let f={[he]:x.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,x,!1,f,c]):this.sendFrame(r.frame(x,f),c)}ping(e,i,o){let c,x;if(typeof e=="string"?(c=Buffer.byteLength(e),x=!1):mt(e)?(c=e.size,x=!1):(e=$e(e),c=e.length,x=$e.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let f={[he]:c,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:x,rsv1:!1};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,f,o]):this.getBlobData(e,!1,f,o):this._state!==we?this.enqueue([this.dispatch,e,!1,f,o]):this.sendFrame(r.frame(e,f),o)}pong(e,i,o){let c,x;if(typeof e=="string"?(c=Buffer.byteLength(e),x=!1):mt(e)?(c=e.size,x=!1):(e=$e(e),c=e.length,x=$e.readOnly),c>125)throw new RangeError("The data size must not be greater than 125 bytes");let f={[he]:c,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:x,rsv1:!1};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,f,o]):this.getBlobData(e,!1,f,o):this._state!==we?this.enqueue([this.dispatch,e,!1,f,o]):this.sendFrame(r.frame(e,f),o)}send(e,i,o){let c=this._extensions[io.extensionName],x=i.binary?2:1,f=i.compress,d,g;typeof e=="string"?(d=Buffer.byteLength(e),g=!1):mt(e)?(d=e.size,g=!1):(e=$e(e),d=e.length,g=$e.readOnly),this._firstFragment?(this._firstFragment=!1,f&&c&&c.params[c._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(f=d>=c._threshold),this._compress=f):(f=!1,x=0),i.fin&&(this._firstFragment=!0);let w={[he]:d,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:x,readOnly:g,rsv1:f};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,w,o]):this.getBlobData(e,this._compress,w,o):this._state!==we?this.enqueue([this.dispatch,e,this._compress,w,o]):this.dispatch(e,this._compress,w,o)}getBlobData(e,i,o,c){this._bufferedBytes+=o[he],this._state=Bx,e.arrayBuffer().then(x=>{if(this._socket.destroyed){let d=new Error("The socket was closed while the blob was being read");process.nextTick(Hr,this,d,c);return}this._bufferedBytes-=o[he];let f=$e(x);i?this.dispatch(f,i,o,c):(this._state=we,this.sendFrame(r.frame(f,o),c),this.dequeue())}).catch(x=>{process.nextTick(Mx,this,x,c)})}dispatch(e,i,o,c){if(!i){this.sendFrame(r.frame(e,o),c);return}let x=this._extensions[io.extensionName];this._bufferedBytes+=o[he],this._state=Ox,x.compress(e,o.fin,(f,d)=>{if(this._socket.destroyed){let g=new Error("The socket was closed while data was being compressed");Hr(this,g,c);return}this._bufferedBytes-=o[he],this._state=we,o.readOnly=!1,this.sendFrame(r.frame(d,o),c),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][he],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][he],this._queue.push(e)}sendFrame(e,i){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],i),this._socket.uncork()):this._socket.write(e[0],i)}};ao.exports=Ur;function Hr(r,e,i){typeof i=="function"&&i(e);for(let o=0;o<r._queue.length;o++){let c=r._queue[o],x=c[c.length-1];typeof x=="function"&&x(e)}}function Mx(r,e,i){Hr(r,e,i),r.onerror(e)}});var mo=oe((Sh,po)=>{"use strict";var{kForOnEventAttribute:Ft,kListener:Gr}=Ne(),co=Symbol("kCode"),xo=Symbol("kData"),uo=Symbol("kError"),fo=Symbol("kMessage"),lo=Symbol("kReason"),_t=Symbol("kTarget"),ho=Symbol("kType"),go=Symbol("kWasClean"),Be=class{constructor(e){this[_t]=null,this[ho]=e}get target(){return this[_t]}get type(){return this[ho]}};Object.defineProperty(Be.prototype,"target",{enumerable:!0});Object.defineProperty(Be.prototype,"type",{enumerable:!0});var Ze=class extends Be{constructor(e,i={}){super(e),this[co]=i.code===void 0?0:i.code,this[lo]=i.reason===void 0?"":i.reason,this[go]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[co]}get reason(){return this[lo]}get wasClean(){return this[go]}};Object.defineProperty(Ze.prototype,"code",{enumerable:!0});Object.defineProperty(Ze.prototype,"reason",{enumerable:!0});Object.defineProperty(Ze.prototype,"wasClean",{enumerable:!0});var yt=class extends Be{constructor(e,i={}){super(e),this[uo]=i.error===void 0?null:i.error,this[fo]=i.message===void 0?"":i.message}get error(){return this[uo]}get message(){return this[fo]}};Object.defineProperty(yt.prototype,"error",{enumerable:!0});Object.defineProperty(yt.prototype,"message",{enumerable:!0});var Ut=class extends Be{constructor(e,i={}){super(e),this[xo]=i.data===void 0?null:i.data}get data(){return this[xo]}};Object.defineProperty(Ut.prototype,"data",{enumerable:!0});var zx={addEventListener(r,e,i={}){for(let c of this.listeners(r))if(!i[Ft]&&c[Gr]===e&&!c[Ft])return;let o;if(r==="message")o=function(x,f){let d=new Ut("message",{data:f?x:x.toString()});d[_t]=this,Hn(e,this,d)};else if(r==="close")o=function(x,f){let d=new Ze("close",{code:x,reason:f.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});d[_t]=this,Hn(e,this,d)};else if(r==="error")o=function(x){let f=new yt("error",{error:x,message:x.message});f[_t]=this,Hn(e,this,f)};else if(r==="open")o=function(){let x=new Be("open");x[_t]=this,Hn(e,this,x)};else return;o[Ft]=!!i[Ft],o[Gr]=e,i.once?this.once(r,o):this.on(r,o)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Gr]===e&&!i[Ft]){this.removeListener(r,i);break}}};po.exports={CloseEvent:Ze,ErrorEvent:yt,Event:Be,EventTarget:zx,MessageEvent:Ut};function Hn(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var Kn=oe((Ch,wo)=>{"use strict";var{tokenChars:Ht}=pt();function Ae(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function qx(r){let e=Object.create(null),i=Object.create(null),o=!1,c=!1,x=!1,f,d,g=-1,w=-1,b=-1,y=0;for(;y<r.length;y++)if(w=r.charCodeAt(y),f===void 0)if(b===-1&&Ht[w]===1)g===-1&&(g=y);else if(y!==0&&(w===32||w===9))b===-1&&g!==-1&&(b=y);else if(w===59||w===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(g,b);w===44?(Ae(e,P,i),i=Object.create(null)):f=P,g=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(d===void 0)if(b===-1&&Ht[w]===1)g===-1&&(g=y);else if(w===32||w===9)b===-1&&g!==-1&&(b=y);else if(w===59||w===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y),Ae(i,r.slice(g,b),!0),w===44&&(Ae(e,f,i),i=Object.create(null),f=void 0),g=b=-1}else if(w===61&&g!==-1&&b===-1)d=r.slice(g,y),g=b=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(c){if(Ht[w]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);g===-1?g=y:o||(o=!0),c=!1}else if(x)if(Ht[w]===1)g===-1&&(g=y);else if(w===34&&g!==-1)x=!1,b=y;else if(w===92)c=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(w===34&&r.charCodeAt(y-1)===61)x=!0;else if(b===-1&&Ht[w]===1)g===-1&&(g=y);else if(g!==-1&&(w===32||w===9))b===-1&&(b=y);else if(w===59||w===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${y}`);b===-1&&(b=y);let P=r.slice(g,b);o&&(P=P.replace(/\\/g,""),o=!1),Ae(i,d,P),w===44&&(Ae(e,f,i),i=Object.create(null),f=void 0),d=void 0,g=b=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(g===-1||x||w===32||w===9)throw new SyntaxError("Unexpected end of input");b===-1&&(b=y);let C=r.slice(g,b);return f===void 0?Ae(e,C,i):(d===void 0?Ae(i,C,!0):o?Ae(i,d,C.replace(/\\/g,"")):Ae(i,d,C),Ae(e,f,i)),e}function Fx(r){return Object.keys(r).map(e=>{let i=r[e];return Array.isArray(i)||(i=[i]),i.map(o=>[e].concat(Object.keys(o).map(c=>{let x=o[c];return Array.isArray(x)||(x=[x]),x.map(f=>f===!0?c:`${c}=${f}`).join("; ")})).join("; ")).join(", ")}).join(", ")}wo.exports={format:Fx,parse:qx}});var Jn=oe((kh,Io)=>{"use strict";var Ux=V("events"),Hx=V("https"),Kx=V("http"),bo=V("net"),Gx=V("tls"),{randomBytes:Wx,createHash:jx}=V("crypto"),{Duplex:Eh,Readable:Ah}=V("stream"),{URL:Wr}=V("url"),je=gt(),Jx=Fr(),Vx=Kr(),{isBlob:Yx}=pt(),{BINARY_TYPES:_o,CLOSE_TIMEOUT:Xx,EMPTY_BUFFER:Gn,GUID:$x,kForOnEventAttribute:jr,kListener:Qx,kStatusCode:Zx,kWebSocket:$,NOOP:vo}=Ne(),{EventTarget:{addEventListener:eu,removeEventListener:tu}}=mo(),{format:nu,parse:ru}=Kn(),{toBuffer:su}=zt(),So=Symbol("kAborted"),Jr=[8,13],Me=["CONNECTING","OPEN","CLOSING","CLOSED"],iu=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,H=class r extends Ux{constructor(e,i,o){super(),this._binaryType=_o[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Gn,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,i===void 0?i=[]:Array.isArray(i)||(typeof i=="object"&&i!==null?(o=i,i=[]):i=[i]),Co(this,e,i,o)):(this._autoPong=o.autoPong,this._closeTimeout=o.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){_o.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,i,o){let c=new Jx({allowSynchronousEvents:o.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation}),x=new Vx(e,this._extensions,o.generateMask);this._receiver=c,this._sender=x,this._socket=e,c[$]=this,x[$]=this,e[$]=this,c.on("conclude",cu),c.on("drain",xu),c.on("error",uu),c.on("message",fu),c.on("ping",du),c.on("pong",lu),x.onerror=hu,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",ko),e.on("data",jn),e.on("end",Po),e.on("error",Do),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[je.extensionName]&&this._extensions[je.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,i){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,i,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Ao(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,o){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(o=e,e=i=void 0):typeof i=="function"&&(o=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Vr(this,e,o);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||Gn,i,o)}pong(e,i,o){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(o=e,e=i=void 0):typeof i=="function"&&(o=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Vr(this,e,o);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||Gn,i,o)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,o){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(o=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Vr(this,e,o);return}let c={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[je.extensionName]||(c.compress=!1),this._sender.send(e||Gn,c,o)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){fe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(H,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(H.prototype,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(H,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(H.prototype,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(H,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(H.prototype,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(H,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});Object.defineProperty(H.prototype,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(H.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(H.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[jr])return e[Qx];return null},set(e){for(let i of this.listeners(r))if(i[jr]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[jr]:!0})}})});H.prototype.addEventListener=eu;H.prototype.removeEventListener=tu;Io.exports=H;function Co(r,e,i,o){let c={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Xx,protocolVersion:Jr[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=c.autoPong,r._closeTimeout=c.closeTimeout,!Jr.includes(c.protocolVersion))throw new RangeError(`Unsupported protocol version: ${c.protocolVersion} (supported versions: ${Jr.join(", ")})`);let x;if(e instanceof Wr)x=e;else try{x=new Wr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}x.protocol==="http:"?x.protocol="ws:":x.protocol==="https:"&&(x.protocol="wss:"),r._url=x.href;let f=x.protocol==="wss:",d=x.protocol==="ws+unix:",g;if(x.protocol!=="ws:"&&!f&&!d?g=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:d&&!x.pathname?g="The URL's pathname is empty":x.hash&&(g="The URL contains a fragment identifier"),g){let T=new SyntaxError(g);if(r._redirects===0)throw T;Wn(r,T);return}let w=f?443:80,b=Wx(16).toString("base64"),y=f?Hx.request:Kx.request,C=new Set,P;if(c.createConnection=c.createConnection||(f?au:ou),c.defaultPort=c.defaultPort||w,c.port=x.port||w,c.host=x.hostname.startsWith("[")?x.hostname.slice(1,-1):x.hostname,c.headers={...c.headers,"Sec-WebSocket-Version":c.protocolVersion,"Sec-WebSocket-Key":b,Connection:"Upgrade",Upgrade:"websocket"},c.path=x.pathname+x.search,c.timeout=c.handshakeTimeout,c.perMessageDeflate&&(P=new je({...c.perMessageDeflate,isServer:!1,maxPayload:c.maxPayload}),c.headers["Sec-WebSocket-Extensions"]=nu({[je.extensionName]:P.offer()})),i.length){for(let T of i){if(typeof T!="string"||!iu.test(T)||C.has(T))throw new SyntaxError("An invalid or duplicated subprotocol was specified");C.add(T)}c.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(c.origin&&(c.protocolVersion<13?c.headers["Sec-WebSocket-Origin"]=c.origin:c.headers.Origin=c.origin),(x.username||x.password)&&(c.auth=`${x.username}:${x.password}`),d){let T=c.path.split(":");c.socketPath=T[0],c.path=T[1]}let I;if(c.followRedirects){if(r._redirects===0){r._originalIpc=d,r._originalSecure=f,r._originalHostOrSocketPath=d?c.socketPath:x.host;let T=o&&o.headers;if(o={...o,headers:{}},T)for(let[z,re]of Object.entries(T))o.headers[z.toLowerCase()]=re}else if(r.listenerCount("redirect")===0){let T=d?r._originalIpc?c.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:x.host===r._originalHostOrSocketPath;(!T||r._originalSecure&&!f)&&(delete c.headers.authorization,delete c.headers.cookie,T||delete c.headers.host,c.auth=void 0)}c.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(c.auth).toString("base64")),I=r._req=y(c),r._redirects&&r.emit("redirect",r.url,I)}else I=r._req=y(c);c.timeout&&I.on("timeout",()=>{fe(r,I,"Opening handshake has timed out")}),I.on("error",T=>{I===null||I[So]||(I=r._req=null,Wn(r,T))}),I.on("response",T=>{let z=T.headers.location,re=T.statusCode;if(z&&c.followRedirects&&re>=300&&re<400){if(++r._redirects>c.maxRedirects){fe(r,I,"Maximum redirects exceeded");return}I.abort();let Q;try{Q=new Wr(z,e)}catch{let ae=new SyntaxError(`Invalid URL: ${z}`);Wn(r,ae);return}Co(r,Q,i,o)}else r.emit("unexpected-response",I,T)||fe(r,I,`Unexpected server response: ${T.statusCode}`)}),I.on("upgrade",(T,z,re)=>{if(r.emit("upgrade",T),r.readyState!==H.CONNECTING)return;I=r._req=null;let Q=T.headers.upgrade;if(Q===void 0||Q.toLowerCase()!=="websocket"){fe(r,z,"Invalid Upgrade header");return}let _e=jx("sha1").update(b+$x).digest("base64");if(T.headers["sec-websocket-accept"]!==_e){fe(r,z,"Invalid Sec-WebSocket-Accept header");return}let ae=T.headers["sec-websocket-protocol"],D;if(ae!==void 0?C.size?C.has(ae)||(D="Server sent an invalid subprotocol"):D="Server sent a subprotocol but none was requested":C.size&&(D="Server sent no subprotocol"),D){fe(r,z,D);return}ae&&(r._protocol=ae);let q=T.headers["sec-websocket-extensions"];if(q!==void 0){if(!P){fe(r,z,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let j;try{j=ru(q)}catch{fe(r,z,"Invalid Sec-WebSocket-Extensions header");return}let Z=Object.keys(j);if(Z.length!==1||Z[0]!==je.extensionName){fe(r,z,"Server indicated an extension that was not requested");return}try{P.accept(j[je.extensionName])}catch{fe(r,z,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[je.extensionName]=P}r.setSocket(z,re,{allowSynchronousEvents:c.allowSynchronousEvents,generateMask:c.generateMask,maxPayload:c.maxPayload,skipUTF8Validation:c.skipUTF8Validation})}),c.finishRequest?c.finishRequest(I,r):I.end()}function Wn(r,e){r._readyState=H.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function ou(r){return r.path=r.socketPath,bo.connect(r)}function au(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=bo.isIP(r.host)?"":r.host),Gx.connect(r)}function fe(r,e,i){r._readyState=H.CLOSING;let o=new Error(i);Error.captureStackTrace(o,fe),e.setHeader?(e[So]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Wn,r,o)):(e.destroy(o),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Vr(r,e,i){if(e){let o=Yx(e)?e.size:su(e).length;r._socket?r._sender._bufferedBytes+=o:r._bufferedAmount+=o}if(i){let o=new Error(`WebSocket is not open: readyState ${r.readyState} (${Me[r.readyState]})`);process.nextTick(i,o)}}function cu(r,e){let i=this[$];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=r,i._socket[$]!==void 0&&(i._socket.removeListener("data",jn),process.nextTick(Eo,i._socket),r===1005?i.close():i.close(r,e))}function xu(){let r=this[$];r.isPaused||r._socket.resume()}function uu(r){let e=this[$];e._socket[$]!==void 0&&(e._socket.removeListener("data",jn),process.nextTick(Eo,e._socket),e.close(r[Zx])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function yo(){this[$].emitClose()}function fu(r,e){this[$].emit("message",r,e)}function du(r){let e=this[$];e._autoPong&&e.pong(r,!this._isServer,vo),e.emit("ping",r)}function lu(r){this[$].emit("pong",r)}function Eo(r){r.resume()}function hu(r){let e=this[$];e.readyState!==H.CLOSED&&(e.readyState===H.OPEN&&(e._readyState=H.CLOSING,Ao(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Ao(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function ko(){let r=this[$];if(this.removeListener("close",ko),this.removeListener("data",jn),this.removeListener("end",Po),r._readyState=H.CLOSING,!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);r._receiver.write(e)}r._receiver.end(),this[$]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",yo),r._receiver.on("finish",yo))}function jn(r){this[$]._receiver.write(r)||this.pause()}function Po(){let r=this[$];r._readyState=H.CLOSING,r._receiver.end(),this.end()}function Do(){let r=this[$];this.removeListener("error",Do),this.on("error",vo),r&&(r._readyState=H.CLOSING,this.destroy())}});var No=oe((Dh,Ro)=>{"use strict";var Ph=Jn(),{Duplex:gu}=V("stream");function To(r){r.emit("close")}function pu(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Lo(r){this.removeListener("error",Lo),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function mu(r,e){let i=!0,o=new gu({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(x,f){let d=!f&&o._readableState.objectMode?x.toString():x;o.push(d)||r.pause()}),r.once("error",function(x){o.destroyed||(i=!1,o.destroy(x))}),r.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(c,x){if(r.readyState===r.CLOSED){x(c),process.nextTick(To,o);return}let f=!1;r.once("error",function(g){f=!0,x(g)}),r.once("close",function(){f||x(c),process.nextTick(To,o)}),i&&r.terminate()},o._final=function(c){if(r.readyState===r.CONNECTING){r.once("open",function(){o._final(c)});return}r._socket!==null&&(r._socket._writableState.finished?(c(),o._readableState.endEmitted&&o.destroy()):(r._socket.once("finish",function(){c()}),r.close()))},o._read=function(){r.isPaused&&r.resume()},o._write=function(c,x,f){if(r.readyState===r.CONNECTING){r.once("open",function(){o._write(c,x,f)});return}r.send(c,f)},o.on("end",pu),o.on("error",Lo),o}Ro.exports=mu});var Yr=oe((Ih,Oo)=>{"use strict";var{tokenChars:wu}=pt();function _u(r){let e=new Set,i=-1,o=-1,c=0;for(c;c<r.length;c++){let f=r.charCodeAt(c);if(o===-1&&wu[f]===1)i===-1&&(i=c);else if(c!==0&&(f===32||f===9))o===-1&&i!==-1&&(o=c);else if(f===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${c}`);o===-1&&(o=c);let d=r.slice(i,o);if(e.has(d))throw new SyntaxError(`The "${d}" subprotocol is duplicated`);e.add(d),i=o=-1}else throw new SyntaxError(`Unexpected character at index ${c}`)}if(i===-1||o!==-1)throw new SyntaxError("Unexpected end of input");let x=r.slice(i,c);if(e.has(x))throw new SyntaxError(`The "${x}" subprotocol is duplicated`);return e.add(x),e}Oo.exports={parse:_u}});var Ho=oe((Lh,Uo)=>{"use strict";var yu=V("events"),Vn=V("http"),{Duplex:Th}=V("stream"),{createHash:bu}=V("crypto"),Bo=Kn(),et=gt(),vu=Yr(),Su=Jn(),{CLOSE_TIMEOUT:Cu,GUID:Eu,kWebSocket:Au}=Ne(),ku=/^[+/0-9A-Za-z]{22}==$/,Mo=0,zo=1,Fo=2,Xr=class extends yu{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Cu,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Su,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=Vn.createServer((o,c)=>{let x=Vn.STATUS_CODES[426];c.writeHead(426,{"Content-Length":x.length,"Content-Type":"text/plain"}),c.end(x)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let o=this.emit.bind(this,"connection");this._removeListeners=Pu(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(c,x,f)=>{this.handleUpgrade(c,x,f,o)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Mo}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===Fo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Kt,this);return}if(e&&this.once("close",e),this._state!==zo)if(this._state=zo,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Kt,this):process.nextTick(Kt,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Kt(this)})}}shouldHandle(e){if(this.options.path){let i=e.url.indexOf("?");if((i!==-1?e.url.slice(0,i):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,i,o,c){i.on("error",qo);let x=e.headers["sec-websocket-key"],f=e.headers.upgrade,d=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,i,405,"Invalid HTTP method");return}if(f===void 0||f.toLowerCase()!=="websocket"){nt(this,e,i,400,"Invalid Upgrade header");return}if(x===void 0||!ku.test(x)){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(d!==13&&d!==8){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Gt(i,400);return}let g=e.headers["sec-websocket-protocol"],w=new Set;if(g!==void 0)try{w=vu.parse(g)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let b=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&b!==void 0){let C=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let P=Bo.parse(b);P[et.extensionName]&&(C.accept(P[et.extensionName]),y[et.extensionName]=C)}catch{nt(this,e,i,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let C={origin:e.headers[`${d===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(C,(P,I,T,z)=>{if(!P)return Gt(i,I||401,T,z);this.completeUpgrade(y,x,w,e,i,o,c)});return}if(!this.options.verifyClient(C))return Gt(i,401)}this.completeUpgrade(y,x,w,e,i,o,c)}completeUpgrade(e,i,o,c,x,f,d){if(!x.readable||!x.writable)return x.destroy();if(x[Au])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Mo)return Gt(x,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${bu("sha1").update(i+Eu).digest("base64")}`],b=new this.options.WebSocket(null,void 0,this.options);if(o.size){let y=this.options.handleProtocols?this.options.handleProtocols(o,c):o.values().next().value;y&&(w.push(`Sec-WebSocket-Protocol: ${y}`),b._protocol=y)}if(e[et.extensionName]){let y=e[et.extensionName].params,C=Bo.format({[et.extensionName]:[y]});w.push(`Sec-WebSocket-Extensions: ${C}`),b._extensions=e}this.emit("headers",w,c),x.write(w.concat(`\r
|
|
12
12
|
`).join(`\r
|
|
13
|
-
`)),
|
|
14
|
-
`+Object.keys(
|
|
13
|
+
`)),x.removeListener("error",qo),b.setSocket(x,f,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(b),b.on("close",()=>{this.clients.delete(b),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Kt,this)})),d(b,c)}};Uo.exports=Xr;function Pu(r,e){for(let i of Object.keys(e))r.on(i,e[i]);return function(){for(let o of Object.keys(e))r.removeListener(o,e[o])}}function Kt(r){r._state=Fo,r.emit("close")}function qo(){this.destroy()}function Gt(r,e,i,o){i=i||Vn.STATUS_CODES[e],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...o},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Vn.STATUS_CODES[e]}\r
|
|
14
|
+
`+Object.keys(o).map(c=>`${c}: ${o[c]}`).join(`\r
|
|
15
15
|
`)+`\r
|
|
16
16
|
\r
|
|
17
|
-
`+
|
|
17
|
+
`+i)}function nt(r,e,i,o,c,x){if(r.listenerCount("wsClientError")){let f=new Error(c);Error.captureStackTrace(f,nt),r.emit("wsClientError",f,i,e)}else Gt(i,o,c,x)}});import{spawn as Yu}from"node:child_process";import{existsSync as Xu,openSync as $u}from"node:fs";import{mkdir as Qu}from"node:fs/promises";import{dirname as Zu}from"node:path";import{fileURLToPath as ef}from"node:url";function Zr(r=G()){return Xu(r.libEntry)?r.libEntry:ef(new URL("../index.ts",import.meta.url))}async function ta(r={}){let e=r.paths??G(),i=r.entryOverride??Zr(e);await Qu(Zu(e.logFile),{recursive:!0});let o=$u(e.logFile,"a"),x=i.endsWith(".ts")?["--import","tsx/esm",i,"--daemon"]:[i,"--daemon"],f=Yu(process.execPath,x,{detached:!0,stdio:["ignore",o,o],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(f.unref(),typeof f.pid!="number")throw new Error("failed to spawn daemon (no pid)");return tf.info("daemon spawned",{pid:f.pid,entry:i}),{pid:f.pid,entry:i}}var tf,es=De(()=>{"use strict";U();xe();tf=L("spawn-daemon")});import{spawn as uf}from"node:child_process";import{mkdir as ff,unlink as df,writeFile as lf}from"node:fs/promises";import{dirname as hf,join as gf}from"node:path";function er(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function oa(r,e){return new Promise((i,o)=>{let c=uf(r,e,{stdio:["ignore","pipe","pipe"]}),x="";c.stderr?.on("data",f=>{x+=f.toString("utf8")}),c.on("error",o),c.on("close",f=>{f===0?i():o(new Error(`${r} ${e.join(" ")} exited ${f}: ${x.trim()}`))})})}var Zn,rs,ss,aa=De(()=>{"use strict";U();Zn=L("supervisor.launchd"),rs="ai.coze.bridge",ss={platform:"darwin",renderConfig(r){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
18
18
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
19
19
|
<plist version="1.0">
|
|
20
20
|
<dict>
|
|
21
21
|
<key>Label</key>
|
|
22
|
-
<string>${
|
|
22
|
+
<string>${rs}</string>
|
|
23
23
|
<key>ProgramArguments</key>
|
|
24
24
|
<array>
|
|
25
|
-
<string>${
|
|
26
|
-
<string>${
|
|
25
|
+
<string>${er(r.nodeBin)}</string>
|
|
26
|
+
<string>${er(r.entry)}</string>
|
|
27
27
|
<string>--daemon</string>
|
|
28
28
|
</array>
|
|
29
29
|
<key>RunAtLoad</key>
|
|
@@ -33,65 +33,65 @@ var s0=Object.create;var wr=Object.defineProperty;var o0=Object.getOwnPropertyDe
|
|
|
33
33
|
<key>ThrottleInterval</key>
|
|
34
34
|
<integer>10</integer>
|
|
35
35
|
<key>StandardOutPath</key>
|
|
36
|
-
<string>${
|
|
36
|
+
<string>${er(r.logFile)}</string>
|
|
37
37
|
<key>StandardErrorPath</key>
|
|
38
|
-
<string>${
|
|
38
|
+
<string>${er(r.logFile)}</string>
|
|
39
39
|
</dict>
|
|
40
40
|
</plist>
|
|
41
|
-
`},configPath(
|
|
41
|
+
`},configPath(r){return gf(r.homeDir,"Library","LaunchAgents",`${rs}.plist`)},async install(r){let e=this.configPath(r);await ff(hf(e),{recursive:!0}),await lf(e,this.renderConfig(r),"utf8"),Zn.info("plist written",{plistPath:e}),await oa("launchctl",["load","-w",e]),Zn.info("launchd job loaded",{label:rs})},async uninstall(r){let e=this.configPath(r);await oa("launchctl",["unload","-w",e]).catch(i=>Zn.warn("launchctl unload failed (ignored)",{err:String(i)})),await df(e).catch(i=>{if(i.code!=="ENOENT")throw i}),Zn.info("launchd job removed",{plistPath:e})}}});import{spawn as pf}from"node:child_process";import{mkdir as mf,unlink as wf,writeFile as _f}from"node:fs/promises";import{dirname as yf,join as bf}from"node:path";function rr(r,e){return new Promise((i,o)=>{let c=pf(r,e,{stdio:["ignore","pipe","pipe"]}),x="";c.stderr?.on("data",f=>{x+=f.toString("utf8")}),c.on("error",o),c.on("close",f=>{f===0?i():o(new Error(`${r} ${e.join(" ")} exited ${f}: ${x.trim()}`))})})}var tr,nr,is,ca=De(()=>{"use strict";U();tr=L("supervisor.systemd"),nr="coze-bridge.service",is={platform:"linux",renderConfig(r){return`[Unit]
|
|
42
42
|
Description=Coze Bridge daemon
|
|
43
43
|
After=network.target
|
|
44
44
|
|
|
45
45
|
[Service]
|
|
46
46
|
Type=simple
|
|
47
|
-
ExecStart=${
|
|
47
|
+
ExecStart=${r.nodeBin} ${r.entry} --daemon
|
|
48
48
|
Restart=always
|
|
49
49
|
RestartSec=3
|
|
50
|
-
StandardOutput=append:${
|
|
51
|
-
StandardError=append:${
|
|
50
|
+
StandardOutput=append:${r.logFile}
|
|
51
|
+
StandardError=append:${r.logFile}
|
|
52
52
|
|
|
53
53
|
[Install]
|
|
54
54
|
WantedBy=default.target
|
|
55
|
-
`},configPath(
|
|
55
|
+
`},configPath(r){return bf(r.homeDir,".config","systemd","user",nr)},async install(r){let e=this.configPath(r);await mf(yf(e),{recursive:!0}),await _f(e,this.renderConfig(r),"utf8"),tr.info("systemd unit written",{unitPath:e}),await rr("systemctl",["--user","daemon-reload"]),await rr("systemctl",["--user","enable","--now",nr]),tr.info("systemd unit enabled",{unitName:nr})},async uninstall(r){let e=this.configPath(r);await rr("systemctl",["--user","disable","--now",nr]).catch(i=>tr.warn("systemctl disable failed (ignored)",{err:String(i)})),await wf(e).catch(i=>{if(i.code!=="ENOENT")throw i}),await rr("systemctl",["--user","daemon-reload"]).catch(()=>{}),tr.info("systemd unit removed",{unitPath:e})}}});import{spawn as vf}from"node:child_process";import{join as Sf}from"node:path";function xa(r,e){return new Promise((i,o)=>{let c=vf(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),x="";c.stderr?.on("data",f=>{x+=f.toString("utf8")}),c.on("error",o),c.on("close",f=>{f===0?i():o(new Error(`${r} ${e.join(" ")} exited ${f}: ${x.trim()}`))})})}var os,sr,as,ua=De(()=>{"use strict";U();os=L("supervisor.taskscheduler"),sr="CozeBridge",as={platform:"win32",renderConfig(r){return`<?xml version="1.0" encoding="UTF-16"?>
|
|
56
56
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
57
57
|
<RegistrationInfo>
|
|
58
58
|
<Description>Coze Bridge daemon</Description>
|
|
59
59
|
</RegistrationInfo>
|
|
60
60
|
<Triggers>
|
|
61
61
|
<LogonTrigger>
|
|
62
|
-
<UserId>${
|
|
62
|
+
<UserId>${r.userName}</UserId>
|
|
63
63
|
</LogonTrigger>
|
|
64
64
|
</Triggers>
|
|
65
65
|
<Principals>
|
|
66
66
|
<Principal>
|
|
67
|
-
<UserId>${
|
|
67
|
+
<UserId>${r.userName}</UserId>
|
|
68
68
|
<LogonType>InteractiveToken</LogonType>
|
|
69
69
|
<RunLevel>LeastPrivilege</RunLevel>
|
|
70
70
|
</Principal>
|
|
71
71
|
</Principals>
|
|
72
72
|
<Actions>
|
|
73
73
|
<Exec>
|
|
74
|
-
<Command>${
|
|
75
|
-
<Arguments>"${
|
|
74
|
+
<Command>${r.nodeBin}</Command>
|
|
75
|
+
<Arguments>"${r.entry}" --daemon</Arguments>
|
|
76
76
|
</Exec>
|
|
77
77
|
</Actions>
|
|
78
78
|
</Task>
|
|
79
|
-
`},configPath(
|
|
79
|
+
`},configPath(r){return Sf(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await xa("schtasks",["/Create","/SC","ONLOGON","/TN",sr,"/TR",e,"/RU",r.userName,"/F"]),os.info("task scheduler entry created",{task:sr})},async uninstall(r){await xa("schtasks",["/Delete","/TN",sr,"/F"]).catch(e=>os.warn("schtasks /Delete failed (ignored)",{err:String(e)})),os.info("task scheduler entry removed",{task:sr})}}});var cs={};Ns(cs,{buildContext:()=>kf,getSupervisor:()=>Af,launchdSupervisor:()=>ss,systemdSupervisor:()=>is,taskSchedulerSupervisor:()=>as});import{homedir as Cf,userInfo as Ef}from"node:os";function Af(r=process.platform){switch(r){case"darwin":return ss;case"linux":return is;case"win32":return as;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function kf(){let r=G();return{nodeBin:process.execPath,entry:Zr(r),logFile:r.logFile,homeDir:Cf(),userName:Ef().username}}var xs=De(()=>{"use strict";xe();es();aa();ca();ua()});Ue();U();import{readdir as k0}from"node:fs/promises";import{mkdir as v0,writeFile as S0}from"node:fs/promises";import{join as C0}from"node:path";var E0={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function ct(r,e,i,o){await v0(r,{recursive:!0});let c=E0[e],x=C0(r,c),f=A0(e,i,o);return await S0(x,f,"utf8"),x}function A0(r,e,i){let o=`# Coze Agent: ${e}
|
|
80
80
|
|
|
81
|
-
> framework: \`${
|
|
81
|
+
> framework: \`${r}\`
|
|
82
82
|
|
|
83
|
-
`,
|
|
84
|
-
`)?
|
|
83
|
+
`,c=i?.trim()?i.endsWith(`
|
|
84
|
+
`)?i:`${i}
|
|
85
85
|
`:`_No instructions provided._
|
|
86
|
-
`;return`${
|
|
86
|
+
`;return`${o}---
|
|
87
87
|
|
|
88
|
-
${
|
|
89
|
-
`)}}function Sr(n){return`coze-session-${n.replace(/[^A-Za-z0-9_-]+/g,"-")}`}function ts(n,e){if(!n.modelToken||Pt(n.model))return null;let s=br(e),a={baseUrl:`${vr}/v1`,api:"openai-completions",apiKey:n.modelToken,models:[{id:n.model,name:n.model,reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,api:"openai-completions"}]};return Object.keys(s).length>0&&(a.headers=s),a}function ns(n,e){if(!n.modelToken)return[];let s=br(e),a=[];for(let[x,c]of Object.entries(s))a.push("-c",`model_providers.coze.http_headers.${x}="${c}"`);return a}var ne=R("agent-handlers"),rs=5*1024*1024,M0=1,z0=6,q0=new Set(["node_modules",".git",".coze","dist","build",".next"]),cn=class{constructor(e){this.opts=e}opts;async listSkills(e){Re(e._meta,"_agent/listSkills");let s=ut(e._meta),a=await this.loadAgentCfg(s),x=a?.workspace??Ie(s).workspace,c=a?.skills??[],f=[];for(let l of c){let m=Ne(x,l.relPath,"SKILL.md");await N0(m).then(b=>b.isFile()).catch(()=>!1)&&f.push({skillId:l.skillId,skillName:l.skillName,downloadUrl:l.downloadUrl??"",...l.description?{description:l.description}:{},...l.version?{version:l.version}:{}})}return{skills:f}}async addSkills(e){Re(e._meta,"_agent/addSkills");let s=ut(e._meta),a=await this.requireAgentCfg(s),x=e.skills??[],c=[...a.skills??[]],f=new Map(c.map((m,w)=>[m.skillId,w])),l=[];for(let m of x){if(!m.skillName)throw new C("IPC_BAD_REQUEST","skill missing skillName");let w=U0(m.skillName),b=F0(a.framework),_=Ne(b,w),S=Ne(a.workspace,_);await T0(S,{recursive:!0});let k=await j0(m.downloadUrl);W0(k)?await J0(k,S):await L0(Ne(S,"SKILL.md"),k.toString("utf8"),"utf8");let P={skillId:m.skillId,skillName:m.skillName,relPath:_,installedAt:Date.now(),...m.description?{description:m.description}:{},...m.version?{version:m.version}:{},...m.downloadUrl?{downloadUrl:m.downloadUrl}:{}},I=f.get(m.skillId);I!==void 0?c[I]=P:(f.set(m.skillId,c.length),c.push(P)),l.push(m),ne.info("skill installed",{agentId:s,skillId:m.skillId,skillName:m.skillName,relPath:_})}return await tn(s,c),await this.reloadAgentSessions(s,"skills-added"),{installedSkills:l}}async removeSkills(e){Re(e._meta,"_agent/removeSkills");let s=ut(e._meta),a=await this.requireAgentCfg(s),x=new Set(e.skillIds??[]),c=a.skills??[],f=[];for(let l of c){if(!x.has(l.skillId)){f.push(l);continue}let m=Ne(a.workspace,l.relPath);await R0(m,{recursive:!0,force:!0}),ne.info("skill removed",{agentId:s,skillId:l.skillId,relPath:l.relPath})}return await tn(s,f),await this.reloadAgentSessions(s,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,s){return this.reloadAgentSessions(e,s)}async reloadAgentSessions(e,s){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex"){for(let[x,c]of a.sessions)if(!(!c.downstream||!c.acpSessionId)){c.loadingSession=!0;try{await c.downstream.sessionLoad({sessionId:c.acpSessionId,cwd:a.workspace}),ne.info("session reloaded",{reason:s,agentId:e,framework:a.framework,cloudId:x,acpId:c.acpSessionId})}catch(f){ne.warn("session reload failed",{reason:s,agentId:e,framework:a.framework,cloudId:x,acpId:c.acpSessionId,err:String(f)})}finally{c.loadingSession=!1}}}}async updateAgent(e){if(!e.cozeIdentity?.trim())return ne.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let s=e.agentId,a=await ue(s);if(!a)throw new C("AGENT_NOT_FOUND",`agent not found: ${s}`);return a.cozeIdentity===e.cozeIdentity?(ne.info("_agent/update: cozeIdentity unchanged, noop",{agentId:s}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await me(a),await ct(a.workspace,a.framework,s,e.cozeIdentity),ne.info("_agent/update: cozeIdentity rewritten",{agentId:s,framework:a.framework}),await this.reloadAgentSessions(s,"identity-changed"),{ok:!0})}async disconnectAgent(e){let s=e.agentId;if(!s)throw new C("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let a=await ue(s);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await me(a),ne.info("agent disconnected",{agentId:s,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(s,e.reason??"disconnect"),{ok:!0}):(ne.warn("_agent/disconnect: agent not found, ignoring",{agentId:s}),{ok:!0})}async switchModel(e){if(Re(e._meta,"_agent/switchModel"),!e.agentId)throw new C("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let s=e.model?.trim()?e.model:He,a=await ue(e.agentId);if(!a)throw new C("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);a.model=s,await me(a),ne.info("_agent/switchModel: model persisted",{agentId:e.agentId,model:s,reason:e.reason??""});let x=this.opts.agents.get(e.agentId);if(!x)return ne.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};x.model=s;let c=[];for(let[f,l]of x.allSessionQueues())c.push(l.enqueue(async()=>{let m=x.sessions.get(f);m?.downstream&&(await m.downstream.stop(`switchModel: ${s}`).catch(()=>{}),m.downstream=void 0)}));return await Promise.all(c),ne.info("_agent/switchModel: all session runtimes killed, next prompt will respawn",{agentId:e.agentId,model:s,cloudSessions:c.length}),{ok:!0}}async resetAgent(e){if(Re(e._meta,Se.RESET),!e.agentId)throw new C("IPC_BAD_REQUEST",`${Se.RESET}: missing agentId`);return await this.runDetailSync(e.agentId,Se.RESET,e.reason),{ok:!0}}async repairAgent(e){if(Re(e._meta,Se.REPAIR),!e.agentId)throw new C("IPC_BAD_REQUEST",`${Se.REPAIR}: missing agentId`);let s=await this.loadAgentCfg(e.agentId);if(s&&s.framework!=="openclaw")throw new C("IPC_BAD_REQUEST",`${Se.REPAIR} only allowed for openclaw, got ${s.framework}`);if(s&&this.opts.openclawRepair)try{await this.opts.openclawRepair(e.agentId,s.workspace)}catch(a){ne.warn("openclaw repair (delete+add) failed (ignored)",{agentId:e.agentId,reason:e.reason,err:String(a)})}return await this.runDetailSync(e.agentId,Se.REPAIR,e.reason),{ok:!0}}async runDetailSync(e,s,a){if(!this.opts.detailSyncer){ne.warn("detailSyncer not wired, skipping sync",{method:s,agentId:e});return}try{await this.opts.detailSyncer(e)}catch(x){ne.warn("detail sync failed (ignored)",{method:s,agentId:e,reason:a,err:String(x)})}}async getFileTree(e){Re(e._meta,"_agent/getFileTree");let s=e._meta,a=ut(s),x=await this.resolveWorkspace(a),c=e.filePath??"",f=this.safeJoin(x,c),l=await Er(f).catch(()=>null);if(!l)throw new C("IPC_BAD_REQUEST",`path not found: ${c}`);if(l.isSymbolicLink())throw new C("IPC_BAD_REQUEST",`symlink not allowed: ${c}`);let m=Y0(e.depth);return l.isDirectory()?{tree:await xs(x,f,c,m)}:{tree:[{name:Z0(c),path:cs(c||"."),isDir:!1,size:l.size,modifiedAt:Math.floor(l.mtimeMs)}]}}async getFileContent(e){Re(e._meta,"_agent/getFileContent");let s=ut(e._meta),a=await this.resolveWorkspace(s);if(!e.filePath)throw new C("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),c=await Er(x).catch(()=>null);if(!c||!c.isFile())throw new C("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(c.isSymbolicLink())throw new C("IPC_BAD_REQUEST",`symlink not allowed: ${e.filePath}`);if(c.size>rs)throw new C("IPC_BAD_REQUEST",`file too large: ${c.size} bytes (max ${rs})`);let f=await ss(x);return f.includes(0)?{content:f.toString("base64"),encoding:"base64",size:c.size}:{content:f.toString("utf8"),encoding:"utf-8",size:c.size}}async resolveWorkspace(e){let s=this.opts.agents.get(e);return s?s.workspace:(await ue(e).catch(()=>null))?.workspace??Ie(e).workspace}safeJoin(e,s){let a=B0(e,s||"."),x=os(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${as}`))throw new C("IPC_BAD_REQUEST",`path escapes workspace: ${s}`);return a}loadAgentCfg(e){return ue(e)}async requireAgentCfg(e){let s=await this.loadAgentCfg(e);if(!s)throw new C("AGENT_NOT_FOUND",`no config for agent: ${e}`);return s}};function U0(n){let e=kt(n.trim()).replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new C("IPC_BAD_REQUEST",`invalid skill name: ${n}`);return e}function F0(n){return n==="claude-code"?Ne(".claude","skills"):Ne(".agents","skills")}var H0=3e4,K0=50*1024*1024,un=3e4;async function j0(n){if(!n)throw new C("IPC_BAD_REQUEST","skill missing downloadUrl");if(n.startsWith("data:")){let e=Math.floor(n.length*3/4);xn(e);let s=G0(n);return xn(s.length),s}if(n.startsWith("file:")){let e=new URL(n).pathname,s=await ss(e);return xn(s.length),s}if(n.startsWith("http://")||n.startsWith("https://")){let e=new AbortController,s=setTimeout(()=>e.abort(),H0);try{let a=await fetch(n,{signal:e.signal});if(!a.ok)throw new C("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${n}`);let x=await a.arrayBuffer();return xn(x.byteLength),Buffer.from(x)}finally{clearTimeout(s)}}throw new C("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${n.slice(0,80)}`)}function xn(n){if(n>K0)throw new C("IPC_BAD_REQUEST",`skill too large: ${n} bytes`)}function G0(n){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(n);if(!e)throw new C("IPC_BAD_REQUEST","bad data URL");let s=!!e[2],a=e[3]??"";return s?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function W0(n){return n.length>=2&&n[0]===31&&n[1]===139}async function J0(n,e){await V0(n),await new Promise((s,a)=>{let x=is("tar",["-xzf","-","-C",e,"--strip-components=1","--no-same-owner"],{stdio:["pipe","pipe","pipe"]}),c="";x.stderr?.on("data",l=>{c+=String(l)});let f=setTimeout(()=>{x.kill("SIGKILL"),a(new C("IPC_BAD_REQUEST",`tar extract timeout (${un}ms)`))},un);x.on("error",l=>{clearTimeout(f),a(new C("IPC_BAD_REQUEST",`tar spawn failed: ${l.message}`,{cause:l}))}),x.on("exit",l=>{clearTimeout(f),l===0?s():a(new C("IPC_BAD_REQUEST",`tar exit ${l}${c?`: ${c.trim().slice(0,200)}`:""}`))}),x.stdin?.end(n)})}async function V0(n){let e=await new Promise((s,a)=>{let x=is("tar",["-tzvf","-"],{stdio:["pipe","pipe","pipe"]}),c="",f="";x.stdout?.on("data",m=>{c+=String(m)}),x.stderr?.on("data",m=>{f+=String(m)});let l=setTimeout(()=>{x.kill("SIGKILL"),a(new C("IPC_BAD_REQUEST",`tar list timeout (${un}ms)`))},un);x.on("error",m=>{clearTimeout(l),a(new C("IPC_BAD_REQUEST",`tar list spawn failed: ${m.message}`))}),x.on("exit",m=>{clearTimeout(l),m===0?s(c):a(new C("IPC_BAD_REQUEST",`tar list exit ${m}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(n)});for(let s of e.split(`
|
|
90
|
-
`)){let
|
|
91
|
-
`)[0]?.trim()||void 0}catch{return}}async function
|
|
92
|
-
`}var
|
|
93
|
-
`);this.buffer=s.pop()??"";let a=[];for(let x of s){let c=x.replace(/\r$/,"").trim();if(c)try{a.push(JSON.parse(c))}catch(f){this.onError?.({line:c,error:f})}}return a}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(s){return this.onError?.({line:e,error:s}),[]}}};var ws={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel","_agent/genModelToken":"agent.genModelToken","_agent/reset":"agent.reset","_agent/repair":"agent.repair","session/request_permission":"session.requestPermission",initialize:"initialize"},jd=Object.fromEntries(Object.entries(ws).map(([n,e])=>[e,n])),ax={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":[],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.genModelToken":["agentId","sessionId"],"agent.reset":["agentId"],"agent.repair":["agentId"],"session.requestPermission":["agentId","sessionId"],"agent.pair":[],initialize:[]},dt=class{seq=0;next(e,s){this.seq+=1;let a=ws[e]??xx(e),x=ax[a]??[],c=[a,String(this.seq)];if(x.length>0){let f=x.map(m=>ms(s?.[m]??"")),l=cx(f).join(":");l&&c.push(l)}else s&&Object.values(s).some(f=>f)&&c.push(Object.values(s).filter(Boolean).map(f=>ms(String(f))).join(":"));return c.join("_")}reset(){this.seq=0}};function xx(n){return n.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function ms(n){return n.replace(/[:_\s]+/g,"-")}function cx(n){let e=n.length;for(;e>0&&!n[e-1];)e-=1;return n.slice(0,e)}F();var fx=3e4;function _s(n,e){if(!(typeof n!="number"||n<=0))try{process.platform==="win32"?process.kill(n,e):process.kill(-n,e)}catch{}}var Ke=class{constructor(e){this.opts=e;this.log=R(`downstream.${this.constructor.name}`),this.decoder=new _n({onError:s=>this.log.warn("decode line failed",{line:s.line})})}opts;child;decoder;pending=new Map;idAllocator=new dt;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new C("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",s=ux(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=s,s.stdout?.setEncoding("utf8"),s.stdout?.on("data",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),s.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new C("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let c of this.exitHandlers)c(a,x)}),s.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new C("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),this.log.info("downstream started",{command:this.opts.command,pid:s.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let s=this.child,a=new Promise(c=>s.once("exit",()=>c()));_s(s.pid,"SIGTERM");let x=setTimeout(()=>{s.killed||_s(s.pid,"SIGKILL")},5e3);try{await a}finally{clearTimeout(x)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){!this.child||this.stopped||this.writeFrame(gn("session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,s){if(!(!this.child||this.stopped))try{this.writeFrame(ft(e,s))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,s){if(!(!this.child||this.stopped))try{this.writeFrame(Ye(e,s))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,s,a=fx){if(!this.child||this.stopped)return Promise.reject(new C("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),c=Rt(x,e,s),f=a>0&&Number.isFinite(a);return new Promise((l,m)=>{let w=f?setTimeout(()=>{this.pending.delete(x),m(new C("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:l,reject:m,timer:w,method:e});try{this.writeFrame(c)}catch(b){w&&clearTimeout(w),this.pending.delete(x),m(b)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new C("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(ps(e))}dispatch(e){if(mn(e)){let s=e.id!==null?this.pending.get(e.id):void 0;if(!s){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),s.timer&&clearTimeout(s.timer),e.error?s.reject(gs(e.error)):s.resolve(e.result);return}if(hs(e)){if(e.method==="session/update")for(let s of this.updateHandlers)Promise.resolve(s(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(ls(e)){let s=e;this.handleAgentRequest(s).catch(a=>this.log.error("agent request handler failed",{method:s.method,err:String(a)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Ye(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let s of this.agentRequestHandlers)try{await s(e)}catch(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Ye(e.id,wn(a)))}catch{}}}failAllPending(e){for(let s of this.pending.values())s.timer&&clearTimeout(s.timer),s.reject(e);this.pending.clear()}};var dx="@agentclientprotocol/claude-agent-acp@latest";function lx(n){let e={};for(let[s,a]of Object.entries(n))a!==void 0&&(s.startsWith("CLAUDE")||s==="AI_AGENT"||s==="BAGGAGE"||(e[s]=a));return e}var yn=class extends Ke{framework="claude-code";constructor(e){let s=hn("claude-code"),[a,x]=s?[s,[]]:["npx",["-y",dx]],c=e.command??a,f=e.args??x,l={command:c,args:f,cwd:e.cwd,...e.env?{env:e.env}:{}};super(l)}sanitizeEnv(e){return lx(e)}};import{mkdtempSync as hx,rmSync as gx}from"node:fs";import{tmpdir as px}from"node:os";import{join as mx}from"node:path";var _x="@zed-industries/codex-acp@latest",vn=class extends Ke{framework="codex";authMethodId;codexHomeDir;constructor(e){let s=hn("codex"),[a,x]=s?[s,[]]:["npx",["-y",_x]],c=e.command??a,f=e.args??x,l=e.extraArgs?[...f,...e.extraArgs]:f,m=e.isolateCodexHome?hx(mx(px(),"coze-bridge-codex-home-")):void 0,w=m?{...e.env??{},CODEX_HOME:m}:e.env,b={command:c,args:l,cwd:e.cwd,...w?{env:w}:{}};super(b),this.authMethodId=e.authMethodId,this.codexHomeDir=m}async initialize(e){let s=await super.initialize(e);return this.authMethodId&&await this.call("authenticate",{methodId:this.authMethodId}),s}async stop(e){if(await super.stop(e),this.codexHomeDir)try{gx(this.codexHomeDir,{recursive:!0,force:!0})}catch{}}};var Nt=class extends Ke{framework="openclaw";agentId;sessionName;slashModelOnStart;constructor(e){let s=e.sessionName??"default",a=["acp","--session",`agent:${e.agentId}:${s}`];e.gatewayToken&&a.push("--token",e.gatewayToken);let x={command:e.command,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x),this.agentId=e.agentId,this.sessionName=s,this.slashModelOnStart=e.slashModelOnStart}async afterSessionEstablished(e){this.slashModelOnStart&&(this.log.info("switching session to per-session provider via /model",{agentId:this.agentId,sessionName:this.sessionName,slash:this.slashModelOnStart}),await this.sessionPrompt({sessionId:e,prompt:[{type:"text",text:`/model ${this.slashModelOnStart}`}]}))}get acpSessionName(){return this.sessionName}};F();ce();var lt=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((s,a)=>{this.slots.push({task:e,resolve:s,reject:a}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let s=await e.task();e.resolve(s)}catch(s){e.reject(s)}}}finally{this.running=!1}}}};var bn=class{agentId;framework;workspace;deployType;sessions=new Map;sessionQueues=new Map;activeTriggers=new Map;status="ok";model;lastActiveAt=Date.now();constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this.model=e.model,this.deployType=e.deployType??"local"}getSessionQueue(e){let s=this.sessionQueues.get(e);return s||(s=new lt,this.sessionQueues.set(e,s)),s}allSessionQueues(){return this.sessionQueues.entries()}async dispose(e){this.status="stopped";let s=new Error(`AgentSession disposed${e?`: ${e}`:""}`);for(let a of this.sessionQueues.values())a.dispose(s);this.sessionQueues.clear(),await this.killAllRuntimes(e??"dispose")}async killAllRuntimes(e){let s=[];for(let[,a]of this.sessions)Lt(a),a.downstream&&(s.push(a.downstream.stop(e).catch(()=>{})),a.downstream=void 0);await Promise.all(s),this.activeTriggers.clear()}};function Lt(n){n.idleTimer&&(clearTimeout(n.idleTimer),n.idleTimer=void 0)}import{spawn as yx}from"node:child_process";import{homedir as vx}from"node:os";import{join as bx}from"node:path";$t();F();async function bs(){let n=bx(vx(),".openclaw/openclaw.json");return(await xt(n))?.gateway?.auth?.token??""}var ys=R("openclaw.config"),Sx=[0,5e3,5e3],vs="models.providers.",Sn="agents.defaults.models",En=class{command;env;retryDelaysMs;queue=new lt;constructor(e){this.command=e.command,this.env=e.env??process.env,this.retryDelaysMs=e.retryDelaysMs??Sx}async withRetry(e,s){let a;for(let x=0;x<this.retryDelaysMs.length;x++){let c=this.retryDelaysMs[x]??0;c>0&&await new Promise(f=>setTimeout(f,c));try{return await s()}catch(f){a=f,ys.warn("openclaw cli failed, will retry",{label:e,attempt:x+1,err:String(f)})}}throw new C("AGENT_SPAWN_FAILED",`openclaw cli ${e} failed after ${this.retryDelaysMs.length} attempts: ${a?.message??"unknown"}`)}runCli(e){return new Promise((s,a)=>{let x=yx(this.command,e,{stdio:["ignore","pipe","pipe"],env:this.env}),c="";x.stderr?.on("data",f=>{c+=f.toString("utf8")}),x.on("error",a),x.on("close",f=>{f===0?s():a(new Error(`exit ${f}: ${c.trim().slice(0,500)}`))})})}async runCliTolerant(e,s){try{await this.runCli(e)}catch(a){let x=String(a);if(s.some(c=>x.includes(c)))return;throw a}}async bestEffortUnset(e,s){try{await this.queue.enqueue(()=>this.withRetry(e,()=>this.runCli(["config","unset",s])))}catch(a){ys.warn(`${e} failed (best-effort)`,{configPath:s,err:String(a)})}}ensureProvider(e,s){return this.queue.enqueue(()=>this.withRetry(`config set models.providers.${e}`,()=>this.runCli(["config","set",`${vs}${e}`,JSON.stringify(s),"--strict-json","--merge"])))}removeProvider(e){return this.bestEffortUnset(`config unset models.providers.${e}`,`${vs}${e}`)}addModelToAllowlist(e,s){let a={[e]:s?{alias:s}:{}};return this.queue.enqueue(()=>this.withRetry(`config set ${Sn}[${e}]`,()=>this.runCli(["config","set",Sn,JSON.stringify(a),"--strict-json","--merge"])))}removeModelFromAllowlist(e){return this.bestEffortUnset(`config unset ${Sn}[${e}]`,`${Sn}.${e}`)}ensureAgent(e,s,a){let x=["agents","add",e,"--workspace",s,"--non-interactive"];return a&&x.push("--model",a),this.queue.enqueue(()=>this.withRetry(`agents add ${e}`,()=>this.runCliTolerant(x,["already exists","already registered"])))}deleteAgent(e){return this.queue.enqueue(()=>this.withRetry(`agents delete ${e}`,()=>this.runCliTolerant(["agents","delete",e,"--force"],["not found","does not exist"])))}};var Ze=R("agent-manager"),Cx=(n,e,s,a,x,c,f)=>{switch(n){case"claude-code":{let l=x?{...$i(x),...es(x,f)}:void 0;return new yn({cwd:s,...l&&Object.keys(l).length>0?{env:l}:{}})}case"codex":{let l=x?[...Xi(x),...ns(x,f)]:[],m=x?Qi(x):void 0,w=!!x;return new vn({cwd:s,...l.length>0?{extraArgs:l}:{},...m&&Object.keys(m).length>0?{env:m}:{},...w?{authMethodId:"openai-api-key",isolateCodexHome:!0}:{}})}case"openclaw":return new Nt({command:e,cwd:s,agentId:a,...c?{sessionName:kt(c)}:{}})}};function Dr(n){return n==="claude-code"||n==="codex"}var Ax={path:"",version:"cloud-deployed"},Dx={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},kx=6e4,Cn=class{paths;config;registry;factory;createTimeoutMs;openclawConfigCache;ensuredProviders=new Set;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Cx,this.createTimeoutMs=e.createTimeoutMs??kx}getOpenclawConfig(){if(!this.openclawConfigCache){let e=this.config.frameworksCache?.openclaw;if(!e?.path)throw new C("AGENT_SPAWN_FAILED","openclaw binary not detected on this machine");this.openclawConfigCache=new En({command:e.path})}return this.openclawConfigCache}async createAgent(e){if(!e.agentId)throw new C("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new C("IPC_BAD_REQUEST","framework required");let s=Dt(e._meta)==="cloud";this.registry.reviveIfDisconnected?.(e.agentId);let a=this.registry.get(e.agentId);if(a){if(a.framework!==e.framework)throw new C("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${a.framework})`);if(a.status==="error")Ze.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await a.dispose("rebuild after error").catch(S=>Ze.warn("dispose stale agent failed (ignored)",{err:String(S)})),this.registry.unregister(e.agentId);else return Ze.info("agent already exists, return current",{agentId:e.agentId}),{ok:!0,agentId:a.agentId,workspace:a.workspace,framework:a.framework}}if(!(s&&Dr(e.framework))&&!this.config.frameworksCache?.[e.framework])throw new C("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);s&&Dr(e.framework)&&await ds(e.framework);let c=Ie(e.agentId,this.paths),f=e.workspace??c.workspace,l=Dt(e._meta),m=new AbortController,w=setTimeout(()=>m.abort(new C("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs),b,_=!1;try{let S=()=>{if(m.signal.aborted)throw m.signal.reason instanceof Error?m.signal.reason:new C("AGENT_TIMEOUT","_agent/create aborted")};await Ar(c.root,{recursive:!0}),await Ar(f,{recursive:!0}),await Ar(c.logs,{recursive:!0}),S(),await ct(f,e.framework,e.agentId,e.cozeIdentity),S();let k=await ue(e.agentId,this.paths).catch(()=>null),P=Zi({model:e.model??k?.model});if(b=new bn({agentId:e.agentId,framework:e.framework,workspace:f,model:P.model??He,deployType:l}),b.status="ok",k?.sessions){for(let[ie,Q]of Object.entries(k.sessions))b.sessions.set(ie,{acpSessionId:Q.acpSessionId,modelToken:Q.modelToken,tokenGeneratedAt:Q.tokenGeneratedAt,lastActiveAt:Date.now(),loadingSession:!1,replySeq:0});let z=Object.keys(k.sessions).length;z>0&&Ze.info("restored persisted session records (no spawn)",{agentId:e.agentId,count:z})}this.registry.register(b),_=!0;let I={agentId:e.agentId,framework:e.framework,workspace:f,cozeIdentity:e.cozeIdentity,createdAt:k?.createdAt??Date.now(),sessions:k?.sessions??{},model:P.model};return l==="cloud"&&(I.deployType="cloud"),k?.skills&&(I.skills=k.skills),k?.agentName&&(I.agentName=k.agentName),k?.description&&(I.description=k.description),await me(I,this.paths),e.framework==="openclaw"&&await this.getOpenclawConfig().ensureAgent(e.agentId,f),Ze.info("agent created (no spawn, lazy on first prompt)",{agentId:e.agentId,framework:e.framework,deployType:l}),{ok:!0,agentId:e.agentId,workspace:f,framework:e.framework}}catch(S){throw Ze.error("agent create failed, rolling back",{agentId:e.agentId,err:String(S)}),_&&b&&(await b.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Ex(c.root,{recursive:!0,force:!0}).catch(k=>Ze.warn("rm agent dir failed (ignored)",{err:String(k)})),S instanceof C?S:new C("AGENT_SPAWN_FAILED",String(S),{cause:S})}finally{clearTimeout(w)}}async spawnSessionDownstream(e,s,a,x){let f=this.config.frameworksCache?.[e.framework];if(!f)if(e.deployType==="cloud"&&Dr(e.framework))f=Ax;else throw new C("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine`);let l=e.deployType==="cloud"?{model:e.model,modelToken:s}:void 0,m;e.framework==="openclaw"?m=await this.buildOpenclawDownstream({session:e,modelConfig:l,cloudSessionId:a,cozeEnv:x,command:f.path}):m=this.factory(e.framework,f.path,e.workspace,e.agentId,l,a,x);try{return await m.start(),await m.initialize(Dx),m}catch(w){throw await m.stop("spawnSessionDownstream failed").catch(()=>{}),w instanceof C?w:new C("AGENT_SPAWN_FAILED",w instanceof Error?w.message:String(w),{cause:w})}}async buildOpenclawDownstream(e){let{session:s,modelConfig:a,cloudSessionId:x,cozeEnv:c,command:f}=e,l=kt(x),m=await bs(),w=a?.modelToken&&!Pt(a.model)?ts(a,c):null,b;if(w){let _=Sr(x),S=`${_}/${a.model}`;if(!this.ensuredProviders.has(S)){let k=this.getOpenclawConfig();await k.ensureProvider(_,w),await k.addModelToAllowlist(S),this.ensuredProviders.add(S)}b=S}return new Nt({command:f,cwd:s.workspace,agentId:s.agentId,sessionName:l,...m?{gatewayToken:m}:{},...b?{slashModelOnStart:b}:{}})}async openclawRepair(e,s){let a=this.getOpenclawConfig();await a.deleteAgent(e),await a.ensureAgent(e,s)}async cleanupOpenclawSessionProviders(e){if(e.framework!=="openclaw"||!this.openclawConfigCache)return;let s=this.openclawConfigCache;for(let a of e.sessions.keys()){let x=Sr(a),c=`${x}/${e.model}`;this.ensuredProviders.delete(c),await s.removeProvider(x),await s.removeModelFromAllowlist(c)}}};F();import{spawn as Px}from"node:child_process";import{constants as Ss,access as Tx}from"node:fs/promises";import{delimiter as Ix,join as Rx}from"node:path";var Nx=R("framework-detector"),Es={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Lx=[".exe",".cmd",".bat",".ps1"],Ot=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Px,access:e.access??Tx}}async detect(e){let s=Es[e],a=await this.which(s);if(!a)return Nx.debug("framework binary not found",{framework:e,bin:s}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Es).map(async a=>[a,await this.detect(a)])),s={};for(let[a,x]of e)x&&(s[a]=x);return s}async which(e){let s=this.env.pathEnv.split(Ix).filter(Boolean),a=this.env.platform==="win32"?["",...Lx]:[""];for(let x of s)for(let c of a){let f=Rx(x,e+c);if(await this.isExecutable(f))return f}return null}async isExecutable(e){try{let s=this.env.platform==="win32"?Ss.F_OK:Ss.X_OK;return await this.env.access(e,s),!0}catch{return!1}}async probeVersion(e){return new Promise(s=>{let a="",x=!1,c,f=l=>{x||(x=!0,c&&clearTimeout(c),s(l.trim()||"unknown"))};try{let l=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});c=setTimeout(()=>{l.kill("SIGKILL"),f("unknown")},5e3),l.stdout?.on("data",m=>{a+=m.toString("utf8")}),l.on("error",()=>f("unknown")),l.on("close",()=>{let m=Bx(a).split(/\r?\n/)[0]??"";f(m)})}catch{f("unknown")}})}},Ox=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Bx(n){return n.replace(Ox,"")}$t();ce();var Mx=10*6e4;function Cs(n){let e=n?.sessionIdleTimeoutMs;return typeof e!="number"||!Number.isFinite(e)||e<=0?Mx:e}function An(n){return xt(n??G().configFile)}function Bt(n,e){return Zt(e??G().configFile,n)}import{randomBytes as zx}from"node:crypto";Fe();F();var U=R("core"),qx=3e4,Ux=3e4,Dn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;sessionSpawner;sessionIdleTimeoutMs;upstreamIds=new dt;pendingUpstream=new Map;pendingBridge=new Map;currentCozeEnv;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths,this.sessionSpawner=e.sessionSpawner,this.sessionIdleTimeoutMs=Cs(e.bridgeConfig)}registerExtension(e,s){this.extensions[e]=s}getCozeEnv(){return this.currentCozeEnv}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),U.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){U.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(s=>s.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),U.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let s of this.registerHandlers)try{s(e.agentId)}catch(a){U.warn("onAgentRegister handler threw (ignored)",{agentId:e.agentId,err:String(a)})}}onAgentRegister(e){return this.registerHandlers.add(e),()=>this.registerHandlers.delete(e)}registerHandlers=new Set;unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&U.info("agent revived from disconnect",{agentId:e})}attachRuntimeHooks(e,s,a){let x=a.downstream;x&&(x.onUpdate(c=>{a.loadingSession||this.forwardUpdate(e,c)}),x.onAgentRequest(c=>{this.handleAgentRequest(e,x,c)}),x.onExit((c,f)=>{U.info("session runtime exited",{agentId:e.agentId,cloudId:s,code:c,signal:f}),Lt(a),a.downstream=void 0,a.acpSessionId&&e.activeTriggers.delete(a.acpSessionId)}))}async handleFrame(e){if(mn(e)){this.handleUpstreamResponse(e);return}if(!("method"in e)||typeof e.method!="string")return;let s="id"in e&&e.id!==void 0?e.id:null,a=e.params?._meta?.cozeEnv;a&&(this.currentCozeEnv=a);try{if(e.method.startsWith("_agent/")){let x=this.extensions[e.method];if(!x){s!==null?await this.sendError(s,W.METHOD_NOT_FOUND,`extension not registered: ${e.method}`):U.warn("drop notification: extension not registered",{method:e.method});return}let c=await x(e,this);s!==null&&await this.upstream.send(ft(s,c));return}if(e.method.startsWith("session/")){let x=await this.routeSessionMethod(e);s!==null&&await this.upstream.send(ft(s,x));return}if(e.method==="initialize"){s!==null&&await this.upstream.send(ft(s,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}s!==null?await this.sendError(s,W.METHOD_NOT_FOUND,`method not implemented: ${e.method}`):U.warn("drop unknown notification",{method:e.method})}catch(x){U.error("handleFrame failed",{method:e.method,err:String(x)}),s!==null&&await this.upstream.send(Ye(s,wn(x)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new C("IPC_BAD_REQUEST",`${e.method} requires params`);let s=e.params,a=s._meta?.cozeAgentId;if(!a)throw new C("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new C("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new C("AGENT_NOT_FOUND",`agent not found: ${a}`);let c=typeof s.sessionId=="string"?s.sessionId:void 0;if(e.method==="session/cancel"||e.method==="session/new"||!c)return this.dispatchSessionCall(x,e.method,s);let f=Date.now(),l=!1;try{let m=await x.getSessionQueue(c).enqueue(()=>this.dispatchSessionCall(x,e.method,s));return l=!0,m}finally{U.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:l})}}async dispatchSessionCall(e,s,a){e.lastActiveAt=Date.now();let{stripped:x}=Fi(a);switch(s){case"session/new":{let c=Fx();return U.info("session/new ack (lazy spawn)",{agentId:e.agentId,cloudId:c}),{sessionId:c}}case"session/load":{let c=x;return U.info("session/load ack (lazy spawn)",{agentId:e.agentId,cloudId:c.sessionId}),{}}case"session/prompt":{let c=x,f=c.sessionId;if(!f)throw new C("IPC_BAD_REQUEST","session/prompt: missing sessionId");let l=await this.ensureRuntime(e,f);if(l.replySeq=0,await this.ensureDownstream(e,f,l),!l.downstream||!l.acpSessionId)throw new C("BRIDGE_INTERNAL","session runtime not ready after ensureDownstream");let m=a._meta?.cozeTriggerMsgId;m?e.activeTriggers.set(l.acpSessionId,m):e.activeTriggers.delete(l.acpSessionId);try{let w=await l.downstream.sessionPrompt({...c,sessionId:l.acpSessionId});return l.lastActiveAt=Date.now(),w}finally{e.activeTriggers.delete(l.acpSessionId),l.downstream?.isAlive()&&this.armIdleTimer(e,f,l)}}case"session/cancel":{let f=x.sessionId;if(!f)throw new C("IPC_BAD_REQUEST","session/cancel: missing sessionId");let l=e.sessions.get(f);return l?.downstream?.isAlive()&&l.acpSessionId&&await l.downstream.sessionCancel({sessionId:l.acpSessionId}),{ok:!0}}default:throw new C("IPC_BAD_REQUEST",`session method not supported: ${s}`)}}async ensureRuntime(e,s){let a=e.sessions.get(s);if(a)return a;let c={modelToken:e.deployType==="cloud"?await this.requestSessionToken(e.agentId,s):"",tokenGeneratedAt:Date.now(),lastActiveAt:Date.now(),loadingSession:!1,replySeq:0};return e.sessions.set(s,c),await this.persistSessionMapping(e),c}async requestSessionToken(e,s){let a={sessionId:s,_meta:{cozeAgentId:e}};try{let x=await this.sendRequest(Se.GEN_MODEL_TOKEN,a,Ux);if(!x?.modelToken)throw new C("MODEL_TOKEN_GEN_FAILED",`cloud returned empty modelToken (agentId=${e}, cloudSessionId=${s})`);return x.modelToken}catch(x){throw x instanceof C&&x.code==="MODEL_TOKEN_GEN_FAILED"?x:new C("MODEL_TOKEN_GEN_FAILED",x instanceof Error?x.message:String(x),{cause:x})}}async ensureDownstream(e,s,a){if(Lt(a),a.downstream?.isAlive())return;if(!this.sessionSpawner)throw new C("AGENT_SPAWN_FAILED","sessionSpawner not wired (cannot spawn per-session downstream)");let x=await this.sessionSpawner(e,a.modelToken,s,this.currentCozeEnv);if(a.downstream=x,this.attachRuntimeHooks(e,s,a),a.acpSessionId){a.loadingSession=!0;try{await x.sessionLoad({sessionId:a.acpSessionId,cwd:e.workspace}),U.info("session restored via session/load",{agentId:e.agentId,cloudId:s,acpId:a.acpSessionId})}catch(c){U.warn("session/load failed, fallback to session/new",{agentId:e.agentId,cloudId:s,acpId:a.acpSessionId,err:String(c)}),a.acpSessionId=void 0;let f=await x.sessionNew({cwd:e.workspace});a.acpSessionId=f.sessionId,await this.persistSessionMapping(e)}finally{a.loadingSession=!1}}else{let c=await x.sessionNew({cwd:e.workspace});a.acpSessionId=c.sessionId,await this.persistSessionMapping(e)}x.afterSessionEstablished&&a.acpSessionId&&await x.afterSessionEstablished(a.acpSessionId)}armIdleTimer(e,s,a){if(Lt(a),this.isRuntimeBusy(e,a)){U.debug("skip idle timer: runtime busy (in-flight turn / pending permission)",{agentId:e.agentId,cloudId:s});return}a.idleTimer=setTimeout(()=>{if(a.idleTimer=void 0,this.isRuntimeBusy(e,a)){U.info("idle reaper fired but runtime busy, re-arming",{agentId:e.agentId,cloudId:s}),this.armIdleTimer(e,s,a);return}U.info("session runtime idle timeout, killing downstream",{agentId:e.agentId,cloudId:s});let x=a.downstream;a.downstream=void 0,a.acpSessionId&&e.activeTriggers.delete(a.acpSessionId),x&&x.stop("idle timeout").catch(c=>U.warn("idle stop failed (ignored)",{agentId:e.agentId,cloudId:s,err:String(c)}))},this.sessionIdleTimeoutMs),a.idleTimer.unref?.()}isRuntimeBusy(e,s){if(s.acpSessionId&&e.activeTriggers.has(s.acpSessionId))return!0;let a=s.downstream;if(!a)return!1;for(let x of this.pendingUpstream.values())if(x.downstream===a)return!0;return!1}forwardUpdate(e,s){let a=s.sessionId,x=this.reverseSessionId(e,a);if(!x){U.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let c=e.sessions.get(x);if(!c){U.debug("drop update: runtime gone",{agentId:e.agentId,cloudId:x});return}let f={cozeAgentId:e.agentId,cozeReplySeqID:++c.replySeq},l=e.activeTriggers.get(a);l&&(f.cozeTriggerMsgId=l),this.upstream.send(gn("session/update",{...s,sessionId:x,_meta:f})).catch(m=>U.warn("forward update failed",{agentId:e.agentId,err:String(m)}))}handleAgentRequest(e,s,a){if(a.method==="session/request_permission"){this.forwardPermissionRequest(e,s,a);return}U.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:a.method}),s.respondAgentRequestError(a.id,{code:W.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${a.method}`})}forwardPermissionRequest(e,s,a){let x=this.upstreamIds.next("session/request_permission"),c=a.params??{},l=c.sessionId,m=l?e.activeTriggers.get(l):void 0,w={cozeAgentId:e.agentId};m&&(w.cozeTriggerMsgId=m);let b=l?this.reverseSessionId(e,l):void 0,_={...c,...b?{sessionId:b}:{},_meta:w};this.pendingUpstream.set(x,{agentRequestId:a.id,agentId:e.agentId,downstream:s,method:a.method}),this.upstream.send(Rt(x,"session/request_permission",_)).catch(S=>{this.pendingUpstream.delete(x),U.error("forward permission request failed",{agentId:e.agentId,err:String(S)}),s.respondAgentRequestError(a.id,{code:W.INTERNAL_ERROR,message:`upstream send failed: ${String(S)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let s=this.pendingUpstream.get(e.id);if(s){this.pendingUpstream.delete(e.id),e.error?s.downstream.respondAgentRequestError(s.agentRequestId,e.error):s.downstream.respondAgentRequest(s.agentRequestId,e.result);return}let a=this.pendingBridge.get(e.id);if(a){this.pendingBridge.delete(e.id),clearTimeout(a.timer),e.error?a.reject(new pn(e.error)):a.resolve(e.result);return}U.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,s,a=qx){let x=this.upstreamIds.next(e);return new Promise((c,f)=>{let l=setTimeout(()=>{this.pendingBridge.delete(x),f(new C("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:c,reject:f,timer:l}),this.upstream.send(Rt(x,e,s)).catch(m=>{let w=this.pendingBridge.get(x);w&&(clearTimeout(w.timer),this.pendingBridge.delete(x)),f(m)})})}async persistSessionMapping(e){if(this.paths)try{let s=new Map;for(let[a,x]of e.sessions){let c={modelToken:x.modelToken,tokenGeneratedAt:x.tokenGeneratedAt};x.acpSessionId&&(c.acpSessionId=x.acpSessionId),s.set(a,c)}await yr(e.agentId,s,this.paths)}catch(s){U.warn("persist session mapping failed",{agentId:e.agentId,err:String(s)})}}reverseSessionId(e,s){for(let[a,x]of e.sessions.entries())if(x.acpSessionId===s)return a}sendError(e,s,a){return this.upstream.send(Ye(e,{code:s,message:a}))}};function Fx(){return zx(16).toString("hex")}F();ce();import{randomBytes as Hx}from"node:crypto";import{chmod as Kx,mkdir as jx,writeFile as As}from"node:fs/promises";import{createServer as Gx}from"node:http";import{dirname as Wx}from"node:path";var Jx=1e6,kr=R("ipc"),kn=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(s=>[`${s.method} ${s.path}`,s])),this.paths=e.paths??G()}async start(){this.token=Hx(32).toString("hex");let e=Gx((a,x)=>{this.dispatch(a,x)});this.server=e,await new Promise((a,x)=>{e.once("error",x),e.listen(0,"127.0.0.1",()=>a())});let s=e.address();if(!s||typeof s!="object")throw new Error("failed to obtain IPC port");return this.port=s.port,await this.persistAuthFiles(),kr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((s,a)=>{e.close(x=>x?a(x):s())}),this.server=null)}async persistAuthFiles(){await jx(Wx(this.paths.portFile),{recursive:!0}),await As(this.paths.portFile,String(this.port),"utf8"),await As(this.paths.tokenFile,this.token,{encoding:"utf8",mode:384});try{await Kx(this.paths.tokenFile,384)}catch(e){kr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,s){if(e.headers.authorization!==`Bearer ${this.token}`){Mt(s,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,c=this.routes.get(x);if(!c){Mt(s,404,{error:"not found"});return}let f=null;if(e.method==="POST")try{f=await Vx(e)}catch(l){Mt(s,400,{error:"invalid json",detail:String(l)});return}try{let l=await c.handler(f,e);Mt(s,200,l??{ok:!0})}catch(l){kr.error("IPC handler failed",{key:x,err:String(l)}),Mt(s,500,{error:l instanceof Error?l.message:String(l)})}}};function Mt(n,e,s){n.statusCode=e,n.setHeader("content-type","application/json"),n.end(JSON.stringify(s))}async function Vx(n){let e=[],s=0;for await(let x of n){let c=x;if(s+=c.length,s>Jx)throw new Error("body too large");e.push(c)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var Jo=Te(Ms(),1);var ku=Te(No(),1),Pu=Te(jn(),1),Tu=Te(pt(),1),Iu=Te(Fr(),1),Ru=Te(jr(),1),Nu=Te(Zr(),1),Ho=Te(Vn(),1),Lu=Te(Fo(),1);var Ko=Ho.default;F();var re=R("upstream.frontier"),Go="application/json",Wo="none",Zn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){re.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:ji,...on(this.opts.ppeOverride)};class s extends Ko{constructor(l){super(l,Ki,{headers:e})}send(l,...m){if(qi("debug"))try{let w;typeof l=="string"?w=Buffer.from(l,"utf8"):l instanceof Buffer?w=l:l instanceof ArrayBuffer?w=new Uint8Array(l):ArrayBuffer.isView(l)?w=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):w=new Uint8Array(0);let b=Buffer.from(w.slice(0,128)).toString("hex");re.debug("WS raw frame out",{bytes:w.byteLength,headHex:b})}catch(w){re.warn("WS raw frame dump failed",{err:String(w)})}super.send(l,...m)}}let a=Ji(this.opts.urlOverride),x={url:a,ws:s,fpID:Hi,aID:sn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:Go,force:!0},payloadEncoding:{encoding:Wo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},c=new Jo.FWS(x);c.onopen=()=>{this.opened=!0,this.openCount+=1;let f=this.openCount===1;re.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:f,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:f})).catch(l=>re.warn("onConnect handler threw (ignored)",{err:String(l)}))},c.onclose=f=>{this.opened=!1,re.info("frontier closed",{code:f.code,reason:f.reason,willReconnect:f.willReconnect})},c.onerror=f=>{re.warn("frontier error",{code:f.code,msg:f.message})},c.onmessage=f=>this.handleMessage(f),this.fws=c,await c.connect()}async stop(e){let s=this.fws;if(s){this.fws=null,this.opened=!1;try{s.close(1e3,e??"bridge shutdown")}catch(a){re.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let s=this.fws;if(!s)throw new C("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;re.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await s.send(a,{service:33555712,method:1,payloadType:Go,payloadEncoding:Wo})}catch(c){throw new C("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(c)}`,{cause:c})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let s=e.message?.service;if(s!==33555712){re.debug("drop non-adapter frontier frame",{service:s});return}let a=Mu(e);if(!a){re.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){re.debug("frame received but no onFrame handler",{size:a.length});return}let x;try{x=JSON.parse(a)}catch(c){re.warn("frontier message JSON parse failed",{err:String(c),head:a.slice(0,80)});return}re.info("frontier frame in",{logid:Bu(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(c=>re.warn("frontier frame handler threw",{err:String(c)}))}};function Bu(n){return n?n.high===0?String(n.low>>>0):`${n.high.toString(16)}${(n.low>>>0).toString(16).padStart(8,"0")}`:""}function Mu(n){let e=n.message;if(e?.textPayload)return e.textPayload;let s=e?.payload;if(!s)return null;try{return Buffer.from(s).toString("utf8")}catch{return null}}F();var Xr=R("upstream.switchable"),$n=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,s){if(this.inner===e)return;Xr.info("swap upstream",{reason:s});let a=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(x){throw Xr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(s??"swapped").catch(x=>Xr.warn("previous upstream stop threw (ignored)",{err:String(x)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};F();var Qr=R("upstream"),Wt=class{handler=null;async start(){Qr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Qr.info("NoopUpstream stopped",{reason:e})}async send(e){Qr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};F();ce();F();ce();import{execSync as zu}from"node:child_process";import{readFileSync as Vo,unlinkSync as qu}from"node:fs";import{mkdir as Uu,readFile as Yo,unlink as Zo,writeFile as Fu}from"node:fs/promises";import{dirname as Hu}from"node:path";var Ku=R("single-instance"),Xn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??G().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&(Ku.warn("removing stale pid file",{stalePid:e}),await Zo(this.pidFile).catch(()=>{})),await Uu(Hu(this.pidFile),{recursive:!0}),await Fu(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Yo(this.pidFile,"utf8")).trim()===String(process.pid)&&await Zo(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Yo(this.pidFile,"utf8"),s=Number.parseInt(e.trim(),10);return Number.isFinite(s)&&s>0?s:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{process.kill(e,0)}catch(s){return s.code==="EPERM"}return this.matchesDaemonTitle(e)}matchesDaemonTitle(e){try{let s=Vo(`/proc/${e}/cmdline`,"utf8").replace(/\0/g," ");return!!(s.includes("coze-bridge-daemon")||s.includes("lib/index.js"))}catch{}try{let s=zu(`ps -o command= -p ${e}`,{stdio:["ignore","pipe","ignore"],timeout:1e3}).toString();return s.trim()?s.includes("coze-bridge-daemon")||s.includes("lib/index.js"):!1}catch{return!0}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Vo(this.pidFile,"utf8").trim()===String(process.pid)&&qu(this.pidFile)}catch{}})}};var B=R("daemon"),ju="coze-bridge-daemon";async function Qo(){let n=new Xn({processTitle:ju}),e=await n.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let s=await An(),a=s??{};_r({pid:process.pid}),B.info(s?"loaded bridge config":"initialized bridge config");try{let D=new Ot;a.frameworksCache=await D.detectAll(),B.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(D){B.warn("framework detection failed",{err:String(D)})}await Bt(a);let x=new $n(new Wt),c=G(),f=null,l=new Dn({upstream:x,paths:c,bridgeConfig:a,sessionSpawner:async(D,q,J,ee)=>{if(!f)throw new Error("agentManager not ready");return f.spawnSessionDownstream(D,q,J,ee)}});await Wu(c,l);let m=new Cn({paths:c,config:a,registry:l});f=m;let w,b,_=null,S=null;l.registerExtension("_agent/create",async D=>m.createAgent(D.params)),l.registerExtension("_agent/health",async()=>({ok:!0}));let k={},P=new cn({agents:l.agents,disposeAndMarkDisconnected:async(D,q)=>{let J=l.agents.get(D);J&&(await m.cleanupOpenclawSessionProviders(J).catch(ee=>B.warn("cleanup openclaw providers failed (ignored)",{agentId:D,err:String(ee)})),await J.dispose(`disconnect: ${q}`).catch(ee=>B.warn("dispose during disconnect failed (ignored)",{agentId:D,err:String(ee)})),J.status="disconnected",l.unregister(D)),l.disconnectedAgents.add(D)},detailSyncer:async D=>{if(!k.ref)throw new Error("agent-detail-sync not initialized yet");await k.ref.syncOne(D)},openclawRepair:async(D,q)=>{await m.openclawRepair(D,q)}});l.registerExtension("_agent/listSkills",D=>P.listSkills(D.params)),l.registerExtension("_agent/addSkills",D=>P.addSkills(D.params)),l.registerExtension("_agent/removeSkills",D=>P.removeSkills(D.params)),l.registerExtension("_agent/getFileTree",D=>P.getFileTree(D.params)),l.registerExtension("_agent/getFileContent",D=>P.getFileContent(D.params)),l.registerExtension("_agent/update",D=>P.updateAgent(D.params)),l.registerExtension("_agent/disconnect",D=>P.disconnectAgent(D.params)),l.registerExtension("_agent/switchModel",D=>P.switchModel(D.params)),l.registerExtension("_agent/reset",D=>P.resetAgent(D.params)),l.registerExtension("_agent/repair",D=>P.repairAgent(D.params));let I=new rn({paths:c,handlers:P,sendDetail:D=>l.sendRequest("_agent/detail",D)});k.ref=I,x.onConnect(({initial:D})=>{B.info("frontier upstream connected, triggering detail sync",{initial:D}),I.syncAll(D?"initial-connect":"reconnect").catch(q=>B.warn("detail sync top-level error (ignored)",{err:String(q)}))});let z=new kn({paths:c,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...l.agents.keys()],deviceId:_??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async D=>{let q=D,J=q?.privatecode,ee=q?.pairing_code;if(!J||!ee)throw new C("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let De=an(q.env),ge=q.handshake_url,Je=q.frontier_url,St=Gu(q.env,ge,Je),Jt=!!w&&w!==J,ye=b!==void 0&&b!==St,ve=Jt||ye;if(ve){B.warn("pair config switched, resetting agents",{pcChanged:Jt,envChanged:ye,previousPc:w?$o(w):"",nextPc:$o(J),previousEnvKey:b??"",nextEnvKey:St});for(let K of[...l.agents.values()])await K.dispose("pair config switch").catch(()=>{}),l.agents.delete(K.agentId);await x.swap(new Wt,"pair switch").catch(()=>{})}let Vt=await Yi({privatecode:J,...ge?{endpoint:ge}:{},ppeOverride:De});_=Vt.deviceId,_r({deviceId:_,pid:process.pid});let se=new Zn({handshake:Vt,privatecode:J,...Je?{urlOverride:Je}:{},ppeOverride:De});await x.swap(se,"pair");let Yt=Object.keys(a.frameworksCache??{});try{let K=await l.sendRequest("_agent/pair",{pairCode:ee,patToken:J,frameworks:Yt,_meta:{cozeDeviceId:_}});B.info("_agent/pair ok",{pairResult:K}),w=J,b=St,S||(S=new fn({core:l,getDeviceId:()=>_??""})),S.start(),ve&&Xo(c,m).catch(ke=>B.warn("post-pair-switch auto-revive error (ignored)",{err:String(ke)}));let V;return q.agent_id&&(V=await Ju(q.agent_id,c,m,ke=>l.sendRequest("_agent/detail",ke)).catch(ke=>(B.error("--agent-id ensureAgent failed",{agentId:q.agent_id,err:String(ke)}),{ok:!1,agentId:q.agent_id??"",note:String(ke)}))),{ok:!0,note:"paired with cloud",...V?{agent:V}:{}}}catch(K){return B.error("_agent/pair failed",{err:String(K)}),{ok:!1,note:`pair failed: ${String(K)}`}}}},{method:"POST",path:"/_agent/create",handler:async D=>{let q=D;return{ok:!0,result:await m.createAgent(q)}}},{method:"POST",path:"/refresh",handler:async()=>{B.info("IPC /refresh: re-detecting frameworks");let D=new Ot;return a.frameworksCache=await D.detectAll(),await Bt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(B.info("IPC /shutdown received"),setImmediate(()=>{ae.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:ie,token:Q}=await z.start();await l.start(),Xo(c,m).catch(D=>B.warn("auto-revive top-level error (ignored)",{err:String(D)}));let _e=null,ae={port:ie,token:Q,core:l,ipc:z,shutdown(D){return _e||(B.info("daemon shutdown",{reason:D}),_e=(async()=>{S?.stop(),await l.stop(D),await z.stop(),await n.release()})(),_e)}};for(let D of["SIGTERM","SIGINT"])process.on(D,()=>{ae.shutdown(D).then(()=>process.exit(0))});return B.info("daemon ready",{port:ie,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ae}function $o(n){return n.length<=8?"***":`${n.slice(0,4)}***${n.slice(-4)}`}function Gu(n,e,s){return`${n??""}|${e??""}|${s??""}`}async function Wu(n,e){let{readdir:s}=await import("node:fs/promises"),a;try{a=await s(n.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:c}=await Promise.resolve().then(()=>(Fe(),nn));for(let f of a){await c(f,n).catch(l=>B.warn("enforceAgentConfigMode failed (ignored)",{agentId:f,err:String(l)}));try{let l=await x(f,n);l?.disconnectedAt&&(e.disconnectedAgents.add(f),B.info("agent marked disconnected on startup",{agentId:f,disconnectedAt:l.disconnectedAt,reason:l.disconnectReason??""}))}catch(l){B.warn("failed to load agent config on startup, skipping",{agentId:f,err:String(l)})}}}async function Ju(n,e,s,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Fe(),nn)),c=await x(n,e);if(c){B.info("--agent-id: local config found, reconnecting",{agentId:n,framework:c.framework,hadDisconnect:!!c.disconnectedAt});let w={agentId:c.agentId,framework:c.framework,...c.cozeIdentity?{cozeIdentity:c.cozeIdentity}:{},...c.model?{model:c.model}:{}};return await s.createAgent(w),{ok:!0,agentId:n,note:c.disconnectedAt?"revived from local config":"connected from local config"}}B.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:n});let f=await a({_meta:{cozeAgentId:n}});if(!f.framework)throw new C("AGENT_NOT_FOUND",`agent ${n} \u4E0D\u5728\u672C\u5730; \u4E91\u7AEF _agent/detail \u54CD\u5E94\u7F3A framework \u5B57\u6BB5 (D36 \u534F\u8BAE\u6269\u5C55\u672A\u751F\u6548), \u65E0\u6CD5\u5728\u672C\u673A\u65B0\u5EFA`);let l={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.deployType?{_meta:{cozeDeployType:f.deployType}}:{}};await s.createAgent(l);let m=f.deployType==="cloud"&&f.framework==="openclaw";return{ok:!0,agentId:n,note:m?"cloud agent acknowledged":"created from cloud detail"}}async function Xo(n,e){let{readdir:s}=await import("node:fs/promises"),a;try{a=await s(n.agentsRoot)}catch{return{revived:0,skipped:0,total:0}}if(a.length===0)return{revived:0,skipped:0,total:0};let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Fe(),nn));B.info("auto-revive: scanning local agents on startup",{count:a.length});let c=0,f=0;for(let l of a){let m;try{m=await x(l,n)}catch(w){B.warn("auto-revive: load config failed (skipping)",{agentId:l,err:String(w)}),f+=1;continue}if(!m){f+=1;continue}if(m.disconnectedAt){B.info("auto-revive: skip disconnected agent",{agentId:l,disconnectedAt:m.disconnectedAt}),f+=1;continue}try{B.info("auto-revive: re-registering agent (D44 no spawn)",{agentId:l,framework:m.framework}),await e.createAgent({agentId:m.agentId,framework:m.framework,...m.cozeIdentity?{cozeIdentity:m.cozeIdentity}:{},...m.model?{model:m.model}:{},...m.deployType?{_meta:{cozeDeployType:m.deployType}}:{}}),c+=1}catch(w){B.warn("auto-revive: createAgent failed (skipping)",{agentId:l,framework:m.framework,err:String(w)}),f+=1}}return B.info("auto-revive: done",{revived:c,skipped:f,total:a.length}),{revived:c,skipped:f,total:a.length}}ti();ce();import{readFile as ta}from"node:fs/promises";var We=class{paths;constructor(e){this.paths=e??G()}async probe(e=1e3){let s=await this.readAuth();if(!s)return{kind:"not-running"};try{let a=await this.fetch(s,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...s}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:nf(a)}}}async request(e){let s=await this.readAuth();if(!s)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(s,e)}async readAuth(){try{let[e,s]=await Promise.all([ta(this.paths.portFile,"utf8"),ta(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=s.trim();return!Number.isFinite(a)||a<=0||!x?null:{port:a,token:x}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,s){let a=s.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let c=new AbortController,f=setTimeout(()=>c.abort(),s.timeoutMs??5e3);try{let l=await fetch(`http://127.0.0.1:${e.port}${s.path}`,{method:s.method,headers:x,body:a?JSON.stringify(s.body):void 0,signal:c.signal}),m=await l.text();return{status:l.status,body:tf(m)}}finally{clearTimeout(f)}}};function tf(n){if(!n)return null;try{return JSON.parse(n)}catch{return n}}function nf(n){return n instanceof Error?n.message:String(n)}F();ce();import{copyFile as na,mkdir as rf,readFile as ni,writeFile as sf}from"node:fs/promises";import{dirname as of,resolve as ri,sep as Qn}from"node:path";import{fileURLToPath as af}from"node:url";F();ce();var ra=R("dist-install");function xf(n){let e=af(n),s=of(e),a=`${Qn}src${Qn}`;if(s.includes(a)||s.endsWith(`${Qn}src${Qn}cli`))return null;let x=ri(s,"index.js"),c=ri(s,"..","package.json");return{dist:x,pkgJson:c}}async function ia(n={}){let e=n.paths??G(),s=xf(import.meta.url),a=n.sourceDist??s?.dist,x=n.sourcePackageJson??s?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let c;try{c=JSON.parse(await ni(x,"utf8")).version??"unknown"}catch(_){return ra.warn("cannot read source package.json,skip dist install",{err:String(_)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(_)}`}}let f=await An(e.configFile)??{},l=f.libVersion;if(l===c)try{return await ni(e.libEntry),{kind:"already-current",libVersion:c}}catch{}await rf(e.libDir,{recursive:!0}),await na(a,e.libEntry),await na(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=ri(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
|
|
94
|
-
`;return await
|
|
88
|
+
${c}`}var ve=L("agent-detail-sync"),nn=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,o;try{o=await k0(i)}catch(c){ve.info("agents dir not found, skip detail sync",{root:i,err:String(c)});return}ve.info("starting detail sync",{reason:e,count:o.length});for(let c of o)try{await this.syncOne(c)}catch(x){ve.warn("detail sync failed for agent, skipping",{agentId:c,err:String(x)})}ve.info("detail sync done",{reason:e})}async syncOne(e){let i=await ue(e,this.opts.paths);if(!i){ve.info("detail sync: agent config missing, skip",{agentId:e});return}let o;try{o=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(f){ve.warn("detail RPC failed, using local data",{agentId:e,err:String(f)});return}if(o.agentId&&o.agentId!==e){ve.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:o.agentId});return}let c=!1,x=!1;if(o.agentName&&o.agentName!==i.agentName&&(i.agentName=o.agentName,c=!0),o.description!==void 0&&o.description!==i.description&&(i.description=o.description,c=!0),o.cozeIdentity&&o.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=o.cozeIdentity,c=!0,x=!0),o.deployType&&ve.info("detail.deployType",{agentId:e,deployType:o.deployType}),!c){ve.debug("detail sync: no diff",{agentId:e});return}await me(i,this.opts.paths),ve.info("detail sync: config updated",{agentId:e,identityChanged:x,agentName:i.agentName}),x&&(await ct(i.workspace,i.framework,e,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Ue();import{spawn as si}from"node:child_process";import{lstat as Cr,mkdir as T0,readFile as ii,readdir as L0,rm as R0,stat as N0,writeFile as O0}from"node:fs/promises";import{join as Re,normalize as B0,relative as oi,resolve as M0,sep as ai}from"node:path";var Se={PAIR:"_agent/pair",CREATE:"_agent/create",HEALTH:"_agent/health",LIST_SKILLS:"_agent/listSkills",ADD_SKILLS:"_agent/addSkills",REMOVE_SKILLS:"_agent/removeSkills",GET_FILE_TREE:"_agent/getFileTree",GET_FILE_CONTENT:"_agent/getFileContent",DETAIL:"_agent/detail",UPDATE:"_agent/update",DISCONNECT:"_agent/disconnect",SWITCH_MODEL:"_agent/switchModel",GEN_MODEL_TOKEN:"_agent/genModelToken",RESET:"_agent/reset",REPAIR:"_agent/repair",DELETE:"_agent/delete"};function At(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Us(r){let{_meta:e,...i}=r;return{stripped:i,meta:e}}function xt(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var E=class extends Error{code;retriable;cause;constructor(e,i,o){super(i),this.name="BridgeError",this.code=e,this.retriable=o?.retriable??!1,o?.cause!==void 0&&(this.cause=o.cause)}};U();xe();function Le(r,e){if(At(r)!=="cloud")throw new E("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}function kt(r){return r.replace(/[^A-Za-z0-9._-]+/g,"-")}U();var rn="1008033",Hs="1289";var Ks="pbbp2",Gs="https://www.coze.cn",Ws="/api/coze_claw/resource/get_frontier_key",P0="https://www.coze.cn",D0="wss://frontier.coze.cn";function js(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??P0}function Js(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??D0}function sn(r){let e={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,o=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(e["x-tt-env"]=i),o&&(e["x-use-ppe"]=o),e}function on(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var Vs=L("handshake");async function Ys(r){let e=js(r.endpoint),i=r.timeoutMs??1e4,o=`${I0(e)}${Ws}?aid=${encodeURIComponent(rn)}`,c={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...sn(r.ppeOverride)},x=new AbortController,f=setTimeout(()=>x.abort(),i);Vs.info("frontier key handshake",{base:e});try{let d=await fetch(o,{method:"GET",headers:c,signal:x.signal}),g=d.headers.get("x-tt-logid")??"",w=d.headers.get("x-tt-trace-id")??"";if(!d.ok){let P=await d.text().catch(()=>"");throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${d.status} logid=${g}: ${P.slice(0,200)}`)}let b=await d.json();if(b.code!==void 0&&b.code!==0)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${b.code} msg=${b.msg??"-"} logid=${g}`);let y=b.data?.access_key,C=b.data?.device_id;if(!y||!C)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${g}: ${JSON.stringify(b)}`);return Vs.info("handshake ok",{remoteDeviceId:C,logid:g,traceId:w}),{accessKey:y,deviceId:C}}catch(d){throw d instanceof E?d:d.name==="AbortError"?new E("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new E("UPSTREAM_HANDSHAKE_FAILED",String(d),{cause:d})}finally{clearTimeout(f)}}function I0(r){return r.endsWith("/")?r.slice(0,-1):r}var br="https://llm-gateway.coze.cn",He="auto";function Xs(r){return{model:r.model??He,...r.modelToken?{modelToken:r.modelToken}:{}}}function Pt(r){return!r||r===He}function $s(r){let e={};return r.modelToken?(e.ANTHROPIC_BASE_URL=br,e.ANTHROPIC_AUTH_TOKEN=r.modelToken,e.ANTHROPIC_MODEL=r.model||He):Pt(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function Qs(r){let e=[];return r.modelToken?e.push("-c",`model="${r.model||He}"`):Pt(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_providers.coze.name="coze"'),e.push("-c",`model_providers.coze.base_url="${br}/v1"`),e.push("-c",'model_providers.coze.env_key="OPENAI_API_KEY"'),e.push("-c",'model_providers.coze.wire_api="responses"'),e.push("-c","model_providers.coze.requires_openai_auth=false"),e.push("-c","model_providers.coze.supports_websockets=false"),e.push("-c",'model_provider="coze"')),e}function Zs(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}function vr(r){let{ttEnv:e,usePpe:i}=on(r),o={};return e&&(o["x-tt-env"]=e),i&&(o["x-use-ppe"]=i),o}function ei(r,e){if(!r.modelToken)return{};let i=vr(e);return Object.keys(i).length===0?{}:{ANTHROPIC_CUSTOM_HEADERS:Object.entries(i).map(([c,x])=>`${c}:${x}`).join(`
|
|
89
|
+
`)}}function Sr(r){return`coze-session-${r.replace(/[^A-Za-z0-9_-]+/g,"-")}`}function ti(r,e){if(!r.modelToken||Pt(r.model))return null;let i=vr(e),o={baseUrl:`${br}/v1`,api:"openai-completions",apiKey:r.modelToken,models:[{id:r.model,name:r.model,reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192,api:"openai-completions"}]};return Object.keys(i).length>0&&(o.headers=i),o}function ni(r,e){if(!r.modelToken)return[];let i=vr(e),o=[];for(let[c,x]of Object.entries(i))o.push("-c",`model_providers.coze.http_headers.${c}="${x}"`);return o}var te=L("agent-handlers"),ri=5*1024*1024,z0=1,q0=6,F0=new Set(["node_modules",".git",".coze","dist","build",".next"]),cn=class{constructor(e){this.opts=e}opts;async listSkills(e){Le(e._meta,"_agent/listSkills");let i=xt(e._meta),o=await this.loadAgentCfg(i),c=o?.workspace??Te(i).workspace,x=o?.skills??[],f=[];for(let d of x){let g=Re(c,d.relPath,"SKILL.md");await N0(g).then(b=>b.isFile()).catch(()=>!1)&&f.push({skillId:d.skillId,skillName:d.skillName,downloadUrl:d.downloadUrl??"",...d.description?{description:d.description}:{},...d.version?{version:d.version}:{}})}return{skills:f}}async addSkills(e){Le(e._meta,"_agent/addSkills");let i=xt(e._meta),o=await this.requireAgentCfg(i),c=e.skills??[],x=[...o.skills??[]],f=new Map(x.map((g,w)=>[g.skillId,w])),d=[];for(let g of c){if(!g.skillName)throw new E("IPC_BAD_REQUEST","skill missing skillName");let w=U0(g.skillName),b=H0(o.framework),y=Re(b,w),C=Re(o.workspace,y);await T0(C,{recursive:!0});let P=await W0(g.downloadUrl);J0(P)?await V0(P,C):await O0(Re(C,"SKILL.md"),P.toString("utf8"),"utf8");let I={skillId:g.skillId,skillName:g.skillName,relPath:y,installedAt:Date.now(),...g.description?{description:g.description}:{},...g.version?{version:g.version}:{},...g.downloadUrl?{downloadUrl:g.downloadUrl}:{}},T=f.get(g.skillId);T!==void 0?x[T]=I:(f.set(g.skillId,x.length),x.push(I)),d.push(g),te.info("skill installed",{agentId:i,skillId:g.skillId,skillName:g.skillName,relPath:y})}return await en(i,x),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:d}}async removeSkills(e){Le(e._meta,"_agent/removeSkills");let i=xt(e._meta),o=await this.requireAgentCfg(i),c=new Set(e.skillIds??[]),x=o.skills??[],f=[];for(let d of x){if(!c.has(d.skillId)){f.push(d);continue}let g=Re(o.workspace,d.relPath);await R0(g,{recursive:!0,force:!0}),te.info("skill removed",{agentId:i,skillId:d.skillId,relPath:d.relPath})}return await en(i,f),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,i){return this.reloadAgentSessions(e,i)}async reloadAgentSessions(e,i){let o=this.opts.agents.get(e);if(o&&o.framework!=="codex"){for(let[c,x]of o.sessions)if(!(!x.downstream||!x.acpSessionId)){x.loadingSession=!0;try{await x.downstream.sessionLoad({sessionId:x.acpSessionId,cwd:o.workspace}),te.info("session reloaded",{reason:i,agentId:e,framework:o.framework,cloudId:c,acpId:x.acpSessionId})}catch(f){te.warn("session reload failed",{reason:i,agentId:e,framework:o.framework,cloudId:c,acpId:x.acpSessionId,err:String(f)})}finally{x.loadingSession=!1}}}}async updateAgent(e){if(!e.cozeIdentity?.trim())return te.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,o=await ue(i);if(!o)throw new E("AGENT_NOT_FOUND",`agent not found: ${i}`);return o.cozeIdentity===e.cozeIdentity?(te.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(o.cozeIdentity=e.cozeIdentity,await me(o),await ct(o.workspace,o.framework,i,e.cozeIdentity),te.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:o.framework}),await this.reloadAgentSessions(i,"identity-changed"),{ok:!0})}async disconnectAgent(e){let i=e.agentId;if(!i)throw new E("IPC_BAD_REQUEST","_agent/disconnect: missing agentId");let o=await ue(i);return o?(o.disconnectedAt=Date.now(),o.disconnectReason=e.reason??"",await me(o),te.info("agent disconnected",{agentId:i,reason:e.reason??"",force:e.force??!1}),this.opts.disposeAndMarkDisconnected&&await this.opts.disposeAndMarkDisconnected(i,e.reason??"disconnect"),{ok:!0}):(te.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Le(e._meta,"_agent/switchModel"),!e.agentId)throw new E("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=e.model?.trim()?e.model:He,o=await ue(e.agentId);if(!o)throw new E("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);o.model=i,await me(o),te.info("_agent/switchModel: model persisted",{agentId:e.agentId,model:i,reason:e.reason??""});let c=this.opts.agents.get(e.agentId);if(!c)return te.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};c.model=i;let x=[];for(let[f,d]of c.allSessionQueues())x.push(d.enqueue(async()=>{let g=c.sessions.get(f);g?.downstream&&(await g.downstream.stop(`switchModel: ${i}`).catch(()=>{}),g.downstream=void 0)}));return await Promise.all(x),te.info("_agent/switchModel: all session runtimes killed, next prompt will respawn",{agentId:e.agentId,model:i,cloudSessions:x.length}),{ok:!0}}async resetAgent(e){if(Le(e._meta,Se.RESET),!e.agentId)throw new E("IPC_BAD_REQUEST",`${Se.RESET}: missing agentId`);return await this.runDetailSync(e.agentId,Se.RESET,e.reason),{ok:!0}}async repairAgent(e){if(Le(e._meta,Se.REPAIR),!e.agentId)throw new E("IPC_BAD_REQUEST",`${Se.REPAIR}: missing agentId`);let i=await this.loadAgentCfg(e.agentId);if(i&&i.framework!=="openclaw")throw new E("IPC_BAD_REQUEST",`${Se.REPAIR} only allowed for openclaw, got ${i.framework}`);if(i&&this.opts.openclawRepair)try{await this.opts.openclawRepair(e.agentId,i.workspace)}catch(o){te.warn("openclaw repair (delete+add) failed (ignored)",{agentId:e.agentId,reason:e.reason,err:String(o)})}return await this.runDetailSync(e.agentId,Se.REPAIR,e.reason),{ok:!0}}async runDetailSync(e,i,o){if(!this.opts.detailSyncer){te.warn("detailSyncer not wired, skipping sync",{method:i,agentId:e});return}try{await this.opts.detailSyncer(e)}catch(c){te.warn("detail sync failed (ignored)",{method:i,agentId:e,reason:o,err:String(c)})}}async getFileTree(e){Le(e._meta,"_agent/getFileTree");let i=e._meta,o=xt(i),c=await this.resolveWorkspace(o),x=e.filePath??"",f=this.safeJoin(c,x),d=await Cr(f).catch(()=>null);if(!d)throw new E("IPC_BAD_REQUEST",`path not found: ${x}`);if(d.isSymbolicLink())throw new E("IPC_BAD_REQUEST",`symlink not allowed: ${x}`);let g=X0(e.depth);return d.isDirectory()?{tree:await ci(c,f,x,g)}:{tree:[{name:$0(x),path:xi(x||"."),isDir:!1,size:d.size,modifiedAt:Math.floor(d.mtimeMs)}]}}async getFileContent(e){Le(e._meta,"_agent/getFileContent");let i=xt(e._meta),o=await this.resolveWorkspace(i);if(!e.filePath)throw new E("IPC_BAD_REQUEST","filePath required");let c=this.safeJoin(o,e.filePath),x=await Cr(c).catch(()=>null);if(!x||!x.isFile())throw new E("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(x.isSymbolicLink())throw new E("IPC_BAD_REQUEST",`symlink not allowed: ${e.filePath}`);if(x.size>ri)throw new E("IPC_BAD_REQUEST",`file too large: ${x.size} bytes (max ${ri})`);let f=await ii(c);return f.includes(0)?{content:f.toString("base64"),encoding:"base64",size:x.size}:{content:f.toString("utf8"),encoding:"utf-8",size:x.size}}async resolveWorkspace(e){let i=this.opts.agents.get(e);return i?i.workspace:(await ue(e).catch(()=>null))?.workspace??Te(e).workspace}safeJoin(e,i){let o=M0(e,i||"."),c=oi(e,o);if(c.startsWith("..")||c===".."||c.startsWith(`..${ai}`))throw new E("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return o}loadAgentCfg(e){return ue(e)}async requireAgentCfg(e){let i=await this.loadAgentCfg(e);if(!i)throw new E("AGENT_NOT_FOUND",`no config for agent: ${e}`);return i}};function U0(r){let e=kt(r.trim()).replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new E("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function H0(r){return r==="claude-code"?Re(".claude","skills"):Re(".agents","skills")}var K0=3e4,G0=50*1024*1024,xn=3e4;async function W0(r){if(!r)throw new E("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:")){let e=Math.floor(r.length*3/4);an(e);let i=j0(r);return an(i.length),i}if(r.startsWith("file:")){let e=new URL(r).pathname,i=await ii(e);return an(i.length),i}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,i=setTimeout(()=>e.abort(),K0);try{let o=await fetch(r,{signal:e.signal});if(!o.ok)throw new E("IPC_BAD_REQUEST",`fetch skill failed HTTP ${o.status} ${r}`);let c=await o.arrayBuffer();return an(c.byteLength),Buffer.from(c)}finally{clearTimeout(i)}}throw new E("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function an(r){if(r>G0)throw new E("IPC_BAD_REQUEST",`skill too large: ${r} bytes`)}function j0(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new E("IPC_BAD_REQUEST","bad data URL");let i=!!e[2],o=e[3]??"";return i?Buffer.from(o,"base64"):Buffer.from(decodeURIComponent(o),"utf8")}function J0(r){return r.length>=2&&r[0]===31&&r[1]===139}async function V0(r,e){await Y0(r),await new Promise((i,o)=>{let c=si("tar",["-xzf","-","-C",e,"--strip-components=1","--no-same-owner"],{stdio:["pipe","pipe","pipe"]}),x="";c.stderr?.on("data",d=>{x+=String(d)});let f=setTimeout(()=>{c.kill("SIGKILL"),o(new E("IPC_BAD_REQUEST",`tar extract timeout (${xn}ms)`))},xn);c.on("error",d=>{clearTimeout(f),o(new E("IPC_BAD_REQUEST",`tar spawn failed: ${d.message}`,{cause:d}))}),c.on("exit",d=>{clearTimeout(f),d===0?i():o(new E("IPC_BAD_REQUEST",`tar exit ${d}${x?`: ${x.trim().slice(0,200)}`:""}`))}),c.stdin?.end(r)})}async function Y0(r){let e=await new Promise((i,o)=>{let c=si("tar",["-tzvf","-"],{stdio:["pipe","pipe","pipe"]}),x="",f="";c.stdout?.on("data",g=>{x+=String(g)}),c.stderr?.on("data",g=>{f+=String(g)});let d=setTimeout(()=>{c.kill("SIGKILL"),o(new E("IPC_BAD_REQUEST",`tar list timeout (${xn}ms)`))},xn);c.on("error",g=>{clearTimeout(d),o(new E("IPC_BAD_REQUEST",`tar list spawn failed: ${g.message}`))}),c.on("exit",g=>{clearTimeout(d),g===0?i(x):o(new E("IPC_BAD_REQUEST",`tar list exit ${g}${f?`: ${f.trim().slice(0,200)}`:""}`))}),c.stdin?.end(r)});for(let i of e.split(`
|
|
90
|
+
`)){let o=i.trim();if(!o)continue;let c=o.charCodeAt(0);if(c!==45&&c!==100)throw new E("IPC_BAD_REQUEST",`tar entry kind '${o[0]}' not allowed (symlink/hardlink/special): ${o.slice(0,100)}`);let f=(o.match(/\s(\S.*)$/)?.[1]??"").split(" -> ")[0]?.trim()??"";if(!f)continue;if(f.startsWith("/"))throw new E("IPC_BAD_REQUEST",`tar entry absolute path: ${f}`);if(f.split(/[/\\]/).some(g=>g===".."))throw new E("IPC_BAD_REQUEST",`tar entry contains '..': ${f}`)}}async function ci(r,e,i,o){if(o<=0)return[];let c;try{c=await L0(e,{withFileTypes:!0})}catch{return[]}let x=[];for(let f of c){if(F0.has(f.name)||f.isSymbolicLink())continue;let d=Re(e,f.name),g=B0(Re(i,f.name)),w=null;try{w=await Cr(d)}catch{continue}if(w.isSymbolicLink())continue;let b={name:f.name,path:xi(oi(r,d)),isDir:w.isDirectory(),size:w.size,modifiedAt:Math.floor(w.mtimeMs)};w.isDirectory()&&o>1&&(b.children=await ci(r,d,g,o-1)),x.push(b)}return x.sort((f,d)=>f.isDir!==d.isDir?f.isDir?-1:1:f.name.localeCompare(d.name)),x}function X0(r){return!r||r<=0?z0:Math.min(r,q0)}function $0(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function xi(r){return r.split(ai).join("/")}U();var Dt=L("agent-health-reporter"),Q0=1e4,un=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??Q0}opts;timer=null;inFlight=!1;unsubscribeRegister=null;intervalMs;start(){this.timer||(this.timer=setInterval(()=>{this.tick()},this.intervalMs),this.timer.unref?.(),this.unsubscribeRegister=this.opts.core.onAgentRegister(()=>{this.tick()}),Dt.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,this.unsubscribeRegister&&(this.unsubscribeRegister(),this.unsubscribeRegister=null),Dt.info("heartbeat stopped"))}async tick(){if(this.inFlight){Dt.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Dt.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let i=[];for(let c of this.opts.core.agents.values()){let x=Z0(c);x&&i.push({agentId:c.agentId,status:x})}if(i.length===0)return;let o={agents:i,_meta:{cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",o)}catch(c){Dt.warn("heartbeat batch send failed",{count:i.length,err:String(c)})}}finally{this.inFlight=!1}}};function Z0(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"?"online":null}Ue();import{mkdir as Ar,rm as Cc}from"node:fs/promises";U();import{execFile as ec}from"node:child_process";import{promisify as tc}from"node:util";var fi=tc(ec),It=L("agents.acp-installer"),nc={"claude-code":{npmPackage:"@agentclientprotocol/claude-agent-acp",binary:"claude-agent-acp"},codex:{npmPackage:"@zed-industries/codex-acp",binary:"codex-acp"}},rc=5e4,sc=5e3,ic=5*6e4,dn=new Map,fn=new Map,Er=new Map;async function ui(r){let e=process.platform==="win32"?"where":"which";try{let{stdout:i}=await fi(e,[r],{timeout:sc});return i.split(`
|
|
91
|
+
`)[0]?.trim()||void 0}catch{return}}async function oc(r){It.info("npm install -g start",{npmPackage:r}),await fi("npm",["install","-g",`${r}@latest`],{timeout:rc,maxBuffer:10*1024*1024}),It.info("npm install -g done",{npmPackage:r})}async function di(r){let e=nc[r];if(!e)return;let i=dn.get(r);if(i)return i;let o=fn.get(r);if(o&&Date.now()-o<ic)return;let c=Er.get(r);if(c)return c;let x=(async()=>{let f=await ui(e.binary);if(f)return dn.set(r,f),It.info("acp wrapper found on PATH",{binary:e.binary,path:f}),f;try{await oc(e.npmPackage)}catch(g){It.warn("acp wrapper install failed (will fallback to npx)",{npmPackage:e.npmPackage,err:String(g)}),fn.set(r,Date.now());return}let d=await ui(e.binary);if(!d){It.warn("acp wrapper installed but binary not found on PATH",{binary:e.binary}),fn.set(r,Date.now());return}return dn.set(r,d),fn.delete(r),d})().finally(()=>{Er.delete(r)});return Er.set(r,x),x}function ln(r){return dn.get(r)}import{spawn as fc}from"node:child_process";function Tt(r,e,i){return i===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:i}}function hn(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ut(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Xe(r,e){return{jsonrpc:"2.0",id:r,error:e}}var gn=class extends Error{code;data;constructor(e){super(`JSON-RPC error code=${e.code} ${e.message}`),this.name="RemoteRpcError",this.code=e.code,e.data!==void 0&&(this.data=e.data)}},W={PARSE_ERROR:-32700,INVALID_REQUEST:-32600,METHOD_NOT_FOUND:-32601,INVALID_PARAMS:-32602,INTERNAL_ERROR:-32603,AGENT_NOT_FOUND:-32001,AGENT_BUSY:-32002,AGENT_TIMEOUT:-32003,AGENT_SPAWN_FAILED:-32004,OPERATION_NOT_ALLOWED_FOR_LOCAL:-32005,AGENT_DISCONNECTED:-32006,MODEL_TOKEN_GEN_FAILED:-32009};function li(r){return"method"in r&&"id"in r&&r.id!==void 0}function hi(r){return"method"in r&&!("id"in r)}function pn(r){return!("method"in r)&&"id"in r}var ac={AGENT_NOT_FOUND:W.AGENT_NOT_FOUND,AGENT_BUSY:W.AGENT_BUSY,AGENT_DISCONNECTED:W.AGENT_DISCONNECTED,AGENT_TIMEOUT:W.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:W.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:W.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:W.INTERNAL_ERROR,BRIDGE_INTERNAL:W.INTERNAL_ERROR,IPC_AUTH_FAILED:W.INTERNAL_ERROR,IPC_BAD_REQUEST:W.INVALID_REQUEST,MODEL_TOKEN_GEN_FAILED:W.MODEL_TOKEN_GEN_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:W.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:W.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:W.INTERNAL_ERROR};function mn(r){return r instanceof E?{code:ac[r.code]??W.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:W.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function gi(r){let e=r.data,i=e?.bridgeCode??"AGENT_PROTOCOL_ERROR";return new E(i,r.message,{retriable:e?.retriable??!1,cause:r.data})}function pi(r){return`${JSON.stringify(r)}
|
|
92
|
+
`}var wn=class{buffer="";onError;constructor(e={}){this.onError=e.onError}push(e){this.buffer+=typeof e=="string"?e:e.toString("utf8");let i=this.buffer.split(`
|
|
93
|
+
`);this.buffer=i.pop()??"";let o=[];for(let c of i){let x=c.replace(/\r$/,"").trim();if(x)try{o.push(JSON.parse(x))}catch(f){this.onError?.({line:x,error:f})}}return o}flush(){if(!this.buffer)return[];let e=this.buffer.replace(/\r$/,"").trim();if(this.buffer="",!e)return[];try{return[JSON.parse(e)]}catch(i){return this.onError?.({line:e,error:i}),[]}}};var wi={"session/prompt":"session.prompt","session/cancel":"session.cancel","session/new":"session.new","session/load":"session.load","_agent/create":"agent.create","_agent/health":"agent.health","_agent/pair":"agent.pair","_agent/listSkills":"agent.listSkills","_agent/addSkills":"agent.addSkills","_agent/removeSkills":"agent.removeSkills","_agent/getFileTree":"agent.getFileTree","_agent/getFileContent":"agent.getFileContent","_agent/detail":"agent.detail","_agent/update":"agent.update","_agent/disconnect":"agent.disconnect","_agent/switchModel":"agent.switchModel","_agent/genModelToken":"agent.genModelToken","_agent/reset":"agent.reset","_agent/repair":"agent.repair","session/request_permission":"session.requestPermission",initialize:"initialize"},Wd=Object.fromEntries(Object.entries(wi).map(([r,e])=>[e,r])),cc={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":[],"agent.listSkills":["agentId"],"agent.addSkills":["agentId"],"agent.removeSkills":["agentId"],"agent.getFileTree":["agentId"],"agent.getFileContent":["agentId"],"agent.detail":["agentId"],"agent.update":["agentId"],"agent.disconnect":["agentId"],"agent.switchModel":["agentId"],"agent.genModelToken":["agentId","sessionId"],"agent.reset":["agentId"],"agent.repair":["agentId"],"session.requestPermission":["agentId","sessionId"],"agent.pair":[],initialize:[]},ft=class{seq=0;next(e,i){this.seq+=1;let o=wi[e]??xc(e),c=cc[o]??[],x=[o,String(this.seq)];if(c.length>0){let f=c.map(g=>mi(i?.[g]??"")),d=uc(f).join(":");d&&x.push(d)}else i&&Object.values(i).some(f=>f)&&x.push(Object.values(i).filter(Boolean).map(f=>mi(String(f))).join(":"));return x.join("_")}reset(){this.seq=0}};function xc(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function mi(r){return r.replace(/[:_\s]+/g,"-")}function uc(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}U();var dc=3e4;function _i(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var Ke=class{constructor(e){this.opts=e;this.log=L(`downstream.${this.constructor.name}`),this.decoder=new wn({onError:i=>this.log.warn("decode line failed",{line:i.line})})}opts;child;decoder;pending=new Map;idAllocator=new ft;updateHandlers=[];agentRequestHandlers=[];exitHandlers=[];log;stopped=!1;sanitizeEnv(e){return e}async start(){if(this.child)throw new E("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",i=fc(this.opts.command,this.opts.args,{cwd:this.opts.cwd,env:{...this.sanitizeEnv(process.env),...this.opts.env},stdio:["pipe","pipe","pipe"],detached:e});this.child=i,i.stdout?.setEncoding("utf8"),i.stdout?.on("data",o=>{for(let c of this.decoder.push(o))this.dispatch(c)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",o=>{this.log.debug("stderr",{text:o.trimEnd()})}),i.on("exit",(o,c)=>{this.stopped=!0,this.failAllPending(new E("AGENT_PROTOCOL_ERROR",`agent exited (${o}/${c})`));for(let x of this.exitHandlers)x(o,c)}),i.on("error",o=>{this.log.error("child error",{err:String(o)}),this.failAllPending(new E("AGENT_SPAWN_FAILED",String(o),{cause:o}))}),this.log.info("downstream started",{command:this.opts.command,pid:i.pid,cwd:this.opts.cwd})}async stop(e){if(!this.child||this.stopped)return;this.stopped=!0,this.log.info("downstream stopping",{reason:e});let i=this.child,o=new Promise(x=>i.once("exit",()=>x()));_i(i.pid,"SIGTERM");let c=setTimeout(()=>{i.killed||_i(i.pid,"SIGKILL")},5e3);try{await o}finally{clearTimeout(c)}}pid(){return this.child?.pid}isAlive(){return!!this.child&&!this.stopped}initialize(e){return this.call("initialize",e)}sessionNew(e){return this.call("session/new",{mcpServers:[],...e})}sessionLoad(e){return this.call("session/load",{mcpServers:[],...e})}sessionPrompt(e){return this.call("session/prompt",e,0)}async sessionCancel(e){!this.child||this.stopped||this.writeFrame(hn("session/cancel",e))}onUpdate(e){this.updateHandlers.push(e)}onAgentRequest(e){this.agentRequestHandlers.push(e)}respondAgentRequest(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(ut(e,i))}catch(o){this.log.warn("respondAgentRequest write failed",{id:e,err:String(o)})}}respondAgentRequestError(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,i))}catch(o){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(o)})}}onExit(e){this.exitHandlers.push(e)}call(e,i,o=dc){if(!this.child||this.stopped)return Promise.reject(new E("AGENT_PROTOCOL_ERROR","downstream not started"));let c=this.idAllocator.next(e),x=Tt(c,e,i),f=o>0&&Number.isFinite(o);return new Promise((d,g)=>{let w=f?setTimeout(()=>{this.pending.delete(c),g(new E("AGENT_TIMEOUT",`${e} timed out after ${o}ms`))},o):null;this.pending.set(c,{resolve:d,reject:g,timer:w,method:e});try{this.writeFrame(x)}catch(b){w&&clearTimeout(w),this.pending.delete(c),g(b)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new E("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(pi(e))}dispatch(e){if(pn(e)){let i=e.id!==null?this.pending.get(e.id):void 0;if(!i){this.log.warn("orphan response",{id:e.id});return}this.pending.delete(e.id),i.timer&&clearTimeout(i.timer),e.error?i.reject(gi(e.error)):i.resolve(e.result);return}if(hi(e)){if(e.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(e.params)).catch(o=>this.log.warn("update handler failed",{err:String(o)}));else this.log.debug("unknown notification",{method:e.method});return}if(li(e)){let i=e;this.handleAgentRequest(i).catch(o=>this.log.error("agent request handler failed",{method:i.method,err:String(o)}))}}async handleAgentRequest(e){if(this.agentRequestHandlers.length===0){this.writeFrame(Xe(e.id,{code:-32601,message:`method not handled by Bridge: ${e.method}`}));return}for(let i of this.agentRequestHandlers)try{await i(e)}catch(o){this.log.error("agentRequestHandler threw",{method:e.method,err:String(o)});try{this.writeFrame(Xe(e.id,mn(o)))}catch{}}}failAllPending(e){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(e);this.pending.clear()}};var lc="@agentclientprotocol/claude-agent-acp@latest";function hc(r){let e={};for(let[i,o]of Object.entries(r))o!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(e[i]=o));return e}var _n=class extends Ke{framework="claude-code";constructor(e){let i=ln("claude-code"),[o,c]=i?[i,[]]:["npx",["-y",lc]],x=e.command??o,f=e.args??c,d={command:x,args:f,cwd:e.cwd,...e.env?{env:e.env}:{}};super(d)}sanitizeEnv(e){return hc(e)}};import{mkdtempSync as gc,rmSync as pc}from"node:fs";import{tmpdir as mc}from"node:os";import{join as wc}from"node:path";var _c="@zed-industries/codex-acp@latest",yn=class extends Ke{framework="codex";authMethodId;codexHomeDir;constructor(e){let i=ln("codex"),[o,c]=i?[i,[]]:["npx",["-y",_c]],x=e.command??o,f=e.args??c,d=e.extraArgs?[...f,...e.extraArgs]:f,g=e.isolateCodexHome?gc(wc(mc(),"coze-bridge-codex-home-")):void 0,w=g?{...e.env??{},CODEX_HOME:g}:e.env,b={command:x,args:d,cwd:e.cwd,...w?{env:w}:{}};super(b),this.authMethodId=e.authMethodId,this.codexHomeDir=g}async initialize(e){let i=await super.initialize(e);return this.authMethodId&&await this.call("authenticate",{methodId:this.authMethodId}),i}async stop(e){if(await super.stop(e),this.codexHomeDir)try{pc(this.codexHomeDir,{recursive:!0,force:!0})}catch{}}};var Lt=class extends Ke{framework="openclaw";agentId;sessionName;slashModelOnStart;constructor(e){let i=e.sessionName??"default",o=["acp","--session",`agent:${e.agentId}:${i}`];e.gatewayToken&&o.push("--token",e.gatewayToken);let c={command:e.command,args:o,cwd:e.cwd,...e.env?{env:e.env}:{}};super(c),this.agentId=e.agentId,this.sessionName=i,this.slashModelOnStart=e.slashModelOnStart}async afterSessionEstablished(e){this.slashModelOnStart&&(this.log.info("switching session to per-session provider via /model",{agentId:this.agentId,sessionName:this.sessionName,slash:this.slashModelOnStart}),await this.sessionPrompt({sessionId:e,prompt:[{type:"text",text:`/model ${this.slashModelOnStart}`}]}))}get acpSessionName(){return this.sessionName}};U();xe();var dt=class{slots=[];running=!1;closed=!1;disposed=!1;enqueue(e){return this.disposed?Promise.reject(new Error("AsyncQueue disposed")):this.closed?Promise.reject(new Error("AsyncQueue closed")):new Promise((i,o)=>{this.slots.push({task:e,resolve:i,reject:o}),this.drain()})}close(){this.closed=!0}dispose(e=new Error("AsyncQueue disposed")){for(this.disposed=!0,this.closed=!0;this.slots.length>0;)this.slots.shift()?.reject(e)}get size(){return this.slots.length}get isRunning(){return this.running}async drain(){if(!this.running){this.running=!0;try{for(;this.slots.length>0&&!this.disposed;){let e=this.slots.shift();if(!e)break;try{let i=await e.task();e.resolve(i)}catch(i){e.reject(i)}}}finally{this.running=!1}}}};var bn=class{agentId;framework;workspace;deployType;sessions=new Map;sessionQueues=new Map;activeTriggers=new Map;status="ok";model;lastActiveAt=Date.now();constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this.model=e.model,this.deployType=e.deployType??"local"}getSessionQueue(e){let i=this.sessionQueues.get(e);return i||(i=new dt,this.sessionQueues.set(e,i)),i}allSessionQueues(){return this.sessionQueues.entries()}async dispose(e){this.status="stopped";let i=new Error(`AgentSession disposed${e?`: ${e}`:""}`);for(let o of this.sessionQueues.values())o.dispose(i);this.sessionQueues.clear(),await this.killAllRuntimes(e??"dispose")}async killAllRuntimes(e){let i=[];for(let[,o]of this.sessions)Rt(o),o.downstream&&(i.push(o.downstream.stop(e).catch(()=>{})),o.downstream=void 0);await Promise.all(i),this.activeTriggers.clear()}};function Rt(r){r.idleTimer&&(clearTimeout(r.idleTimer),r.idleTimer=void 0)}import{spawn as yc}from"node:child_process";import{homedir as bc}from"node:os";import{join as vc}from"node:path";Xt();U();async function vi(){let r=vc(bc(),".openclaw/openclaw.json");return(await at(r))?.gateway?.auth?.token??""}var yi=L("openclaw.config"),Sc=[0,5e3,5e3],bi="models.providers.",vn="agents.defaults.models",Sn=class{command;env;retryDelaysMs;queue=new dt;constructor(e){this.command=e.command,this.env=e.env??process.env,this.retryDelaysMs=e.retryDelaysMs??Sc}async withRetry(e,i){let o;for(let c=0;c<this.retryDelaysMs.length;c++){let x=this.retryDelaysMs[c]??0;x>0&&await new Promise(f=>setTimeout(f,x));try{return await i()}catch(f){o=f,yi.warn("openclaw cli failed, will retry",{label:e,attempt:c+1,err:String(f)})}}throw new E("AGENT_SPAWN_FAILED",`openclaw cli ${e} failed after ${this.retryDelaysMs.length} attempts: ${o?.message??"unknown"}`)}runCli(e){return new Promise((i,o)=>{let c=yc(this.command,e,{stdio:["ignore","pipe","pipe"],env:this.env}),x="";c.stderr?.on("data",f=>{x+=f.toString("utf8")}),c.on("error",o),c.on("close",f=>{f===0?i():o(new Error(`exit ${f}: ${x.trim().slice(0,500)}`))})})}async runCliTolerant(e,i){try{await this.runCli(e)}catch(o){let c=String(o);if(i.some(x=>c.includes(x)))return;throw o}}async bestEffortUnset(e,i){try{await this.queue.enqueue(()=>this.withRetry(e,()=>this.runCli(["config","unset",i])))}catch(o){yi.warn(`${e} failed (best-effort)`,{configPath:i,err:String(o)})}}ensureProvider(e,i){return this.queue.enqueue(()=>this.withRetry(`config set models.providers.${e}`,()=>this.runCli(["config","set",`${bi}${e}`,JSON.stringify(i),"--strict-json","--merge"])))}removeProvider(e){return this.bestEffortUnset(`config unset models.providers.${e}`,`${bi}${e}`)}addModelToAllowlist(e,i){let o={[e]:i?{alias:i}:{}};return this.queue.enqueue(()=>this.withRetry(`config set ${vn}[${e}]`,()=>this.runCli(["config","set",vn,JSON.stringify(o),"--strict-json","--merge"])))}removeModelFromAllowlist(e){return this.bestEffortUnset(`config unset ${vn}[${e}]`,`${vn}.${e}`)}ensureAgent(e,i,o){let c=["agents","add",e,"--workspace",i,"--non-interactive"];return o&&c.push("--model",o),this.queue.enqueue(()=>this.withRetry(`agents add ${e}`,()=>this.runCliTolerant(c,["already exists","already registered"])))}deleteAgent(e){return this.queue.enqueue(()=>this.withRetry(`agents delete ${e}`,()=>this.runCliTolerant(["agents","delete",e,"--force"],["not found","does not exist"])))}};var Ge=L("agent-manager"),Ec=(r,e,i,o,c,x,f)=>{switch(r){case"claude-code":{let d=c?{...$s(c),...ei(c,f)}:void 0;return new _n({cwd:i,...d&&Object.keys(d).length>0?{env:d}:{}})}case"codex":{let d=c?[...Qs(c),...ni(c,f)]:[],g=c?Zs(c):void 0,w=!!c;return new yn({cwd:i,...d.length>0?{extraArgs:d}:{},...g&&Object.keys(g).length>0?{env:g}:{},...w?{authMethodId:"openai-api-key",isolateCodexHome:!0}:{}})}case"openclaw":return new Lt({command:e,cwd:i,agentId:o,...x?{sessionName:kt(x)}:{}})}};function Si(r){return r==="claude-code"||r==="codex"}var Ac={path:"",version:"cloud-deployed"},kc={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},Pc=6e4,Cn=class{paths;config;registry;factory;createTimeoutMs;openclawConfigCache;ensuredProviders=new Set;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Ec,this.createTimeoutMs=e.createTimeoutMs??Pc}getOpenclawConfig(){if(!this.openclawConfigCache){let e=this.config.frameworksCache?.openclaw;if(!e?.path)throw new E("AGENT_SPAWN_FAILED","openclaw binary not detected on this machine");this.openclawConfigCache=new Sn({command:e.path})}return this.openclawConfigCache}async createAgent(e){if(!e.agentId)throw new E("IPC_BAD_REQUEST","agentId required");if(!e.framework)throw new E("IPC_BAD_REQUEST","framework required");let i=At(e._meta)==="cloud";this.registry.reviveIfDisconnected?.(e.agentId);let o=this.registry.get(e.agentId);if(o){if(o.framework!==e.framework)throw new E("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${o.framework})`);if(o.status==="error")Ge.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await o.dispose("rebuild after error").catch(C=>Ge.warn("dispose stale agent failed (ignored)",{err:String(C)})),this.registry.unregister(e.agentId);else return Ge.info("agent already exists, return current",{agentId:e.agentId}),{ok:!0,agentId:o.agentId,workspace:o.workspace,framework:o.framework}}if(!i&&!this.config.frameworksCache?.[e.framework])throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);i&&Si(e.framework)&&await di(e.framework);let x=Te(e.agentId,this.paths),f=e.workspace??x.workspace,d=At(e._meta),g=new AbortController,w=setTimeout(()=>g.abort(new E("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs),b,y=!1;try{let C=()=>{if(g.signal.aborted)throw g.signal.reason instanceof Error?g.signal.reason:new E("AGENT_TIMEOUT","_agent/create aborted")};await Ar(x.root,{recursive:!0}),await Ar(f,{recursive:!0}),await Ar(x.logs,{recursive:!0}),C(),await ct(f,e.framework,e.agentId,e.cozeIdentity),C();let P=await ue(e.agentId,this.paths).catch(()=>null),I=Xs({model:e.model??P?.model});if(b=new bn({agentId:e.agentId,framework:e.framework,workspace:f,model:I.model??He,deployType:d}),b.status="ok",P?.sessions){for(let[re,Q]of Object.entries(P.sessions))b.sessions.set(re,{acpSessionId:Q.acpSessionId,modelToken:Q.modelToken,tokenGeneratedAt:Q.tokenGeneratedAt,lastActiveAt:Date.now(),loadingSession:!1,replySeq:0});let z=Object.keys(P.sessions).length;z>0&&Ge.info("restored persisted session records (no spawn)",{agentId:e.agentId,count:z})}this.registry.register(b),y=!0;let T={agentId:e.agentId,framework:e.framework,workspace:f,cozeIdentity:e.cozeIdentity,createdAt:P?.createdAt??Date.now(),sessions:P?.sessions??{},model:I.model};return d==="cloud"&&(T.deployType="cloud"),P?.skills&&(T.skills=P.skills),P?.agentName&&(T.agentName=P.agentName),P?.description&&(T.description=P.description),await me(T,this.paths),e.framework==="openclaw"&&(this.config.frameworksCache?.openclaw?.path?await this.getOpenclawConfig().ensureAgent(e.agentId,f):Ge.warn("openclaw binary not on this machine, skip agents add (will fail at session/prompt)",{agentId:e.agentId})),Ge.info("agent created (no spawn, lazy on first prompt)",{agentId:e.agentId,framework:e.framework,deployType:d}),{ok:!0,agentId:e.agentId,workspace:f,framework:e.framework}}catch(C){throw Ge.error("agent create failed, rolling back",{agentId:e.agentId,err:String(C)}),y&&b&&(await b.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Cc(x.root,{recursive:!0,force:!0}).catch(P=>Ge.warn("rm agent dir failed (ignored)",{err:String(P)})),C instanceof E?C:new E("AGENT_SPAWN_FAILED",String(C),{cause:C})}finally{clearTimeout(w)}}async spawnSessionDownstream(e,i,o,c){let f=this.config.frameworksCache?.[e.framework];if(!f)if(e.deployType==="cloud"&&Si(e.framework))f=Ac;else throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine`);let d=e.deployType==="cloud"?{model:e.model,modelToken:i}:void 0,g;e.framework==="openclaw"?g=await this.buildOpenclawDownstream({session:e,modelConfig:d,cloudSessionId:o,cozeEnv:c,command:f.path}):g=this.factory(e.framework,f.path,e.workspace,e.agentId,d,o,c);try{return await g.start(),await g.initialize(kc),g}catch(w){throw await g.stop("spawnSessionDownstream failed").catch(()=>{}),w instanceof E?w:new E("AGENT_SPAWN_FAILED",w instanceof Error?w.message:String(w),{cause:w})}}async buildOpenclawDownstream(e){let{session:i,modelConfig:o,cloudSessionId:c,cozeEnv:x,command:f}=e,d=kt(c),g=await vi(),w=o?.modelToken&&!Pt(o.model)?ti(o,x):null,b;if(w){let y=Sr(c),C=`${y}/${o.model}`;if(!this.ensuredProviders.has(C)){let P=this.getOpenclawConfig();await P.ensureProvider(y,w),await P.addModelToAllowlist(C),this.ensuredProviders.add(C)}b=C}return new Lt({command:f,cwd:i.workspace,agentId:i.agentId,sessionName:d,...g?{gatewayToken:g}:{},...b?{slashModelOnStart:b}:{}})}async openclawRepair(e,i){let o=this.getOpenclawConfig();await o.deleteAgent(e),await o.ensureAgent(e,i)}async cleanupOpenclawSessionProviders(e){if(e.framework!=="openclaw"||!this.openclawConfigCache)return;let i=this.openclawConfigCache;for(let o of e.sessions.keys()){let c=Sr(o),x=`${c}/${e.model}`;this.ensuredProviders.delete(x),await i.removeProvider(c),await i.removeModelFromAllowlist(x)}}};U();import{spawn as Dc}from"node:child_process";import{constants as Ci,access as Ic}from"node:fs/promises";import{delimiter as Tc,join as Lc}from"node:path";var Rc=L("framework-detector"),Ei={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Nc=[".exe",".cmd",".bat",".ps1"],Nt=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Dc,access:e.access??Ic}}async detect(e){let i=Ei[e],o=await this.which(i);if(!o)return Rc.debug("framework binary not found",{framework:e,bin:i}),null;let c=await this.probeVersion(o);return{path:o,version:c}}async detectAll(){let e=await Promise.all(Object.keys(Ei).map(async o=>[o,await this.detect(o)])),i={};for(let[o,c]of e)c&&(i[o]=c);return i}async which(e){let i=this.env.pathEnv.split(Tc).filter(Boolean),o=this.env.platform==="win32"?["",...Nc]:[""];for(let c of i)for(let x of o){let f=Lc(c,e+x);if(await this.isExecutable(f))return f}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Ci.F_OK:Ci.X_OK;return await this.env.access(e,i),!0}catch{return!1}}async probeVersion(e){return new Promise(i=>{let o="",c=!1,x,f=d=>{c||(c=!0,x&&clearTimeout(x),i(d.trim()||"unknown"))};try{let d=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});x=setTimeout(()=>{d.kill("SIGKILL"),f("unknown")},5e3),d.stdout?.on("data",g=>{o+=g.toString("utf8")}),d.on("error",()=>f("unknown")),d.on("close",()=>{let g=Bc(o).split(/\r?\n/)[0]??"";f(g)})}catch{f("unknown")}})}},Oc=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function Bc(r){return r.replace(Oc,"")}Xt();xe();var Mc=10*6e4;function Ai(r){let e=r?.sessionIdleTimeoutMs;return typeof e!="number"||!Number.isFinite(e)||e<=0?Mc:e}function En(r){return at(r??G().configFile)}function Ot(r,e){return Yt(e??G().configFile,r)}import{randomBytes as zc}from"node:crypto";Ue();U();var F=L("core"),qc=3e4,Fc=3e4,An=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;sessionSpawner;sessionIdleTimeoutMs;upstreamIds=new ft;pendingUpstream=new Map;pendingBridge=new Map;currentCozeEnv;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths,this.sessionSpawner=e.sessionSpawner,this.sessionIdleTimeoutMs=Ai(e.bridgeConfig)}registerExtension(e,i){this.extensions[e]=i}getCozeEnv(){return this.currentCozeEnv}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),F.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){F.info("Core stopping",{reason:e}),await Promise.all([...this.agents.values()].map(i=>i.dispose(e))),this.agents.clear(),await this.upstream.stop(e)}get(e){return this.agents.get(e)}register(e){this.agents.set(e.agentId,e),F.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let i of this.registerHandlers)try{i(e.agentId)}catch(o){F.warn("onAgentRegister handler threw (ignored)",{agentId:e.agentId,err:String(o)})}}onAgentRegister(e){return this.registerHandlers.add(e),()=>this.registerHandlers.delete(e)}registerHandlers=new Set;unregister(e){this.agents.delete(e)}reviveIfDisconnected(e){this.disconnectedAgents.delete(e)&&F.info("agent revived from disconnect",{agentId:e})}attachRuntimeHooks(e,i,o){let c=o.downstream;c&&(c.onUpdate(x=>{o.loadingSession||this.forwardUpdate(e,x)}),c.onAgentRequest(x=>{this.handleAgentRequest(e,c,x)}),c.onExit((x,f)=>{F.info("session runtime exited",{agentId:e.agentId,cloudId:i,code:x,signal:f}),Rt(o),o.downstream=void 0,o.acpSessionId&&e.activeTriggers.delete(o.acpSessionId)}))}async handleFrame(e){if(pn(e)){this.handleUpstreamResponse(e);return}if(!("method"in e)||typeof e.method!="string")return;let i="id"in e&&e.id!==void 0?e.id:null,o=e.params?._meta?.cozeEnv;o&&(this.currentCozeEnv=o);try{if(e.method.startsWith("_agent/")){let c=this.extensions[e.method];if(!c){i!==null?await this.sendError(i,W.METHOD_NOT_FOUND,`extension not registered: ${e.method}`):F.warn("drop notification: extension not registered",{method:e.method});return}let x=await c(e,this);i!==null&&await this.upstream.send(ut(i,x));return}if(e.method.startsWith("session/")){let c=await this.routeSessionMethod(e);i!==null&&await this.upstream.send(ut(i,c));return}if(e.method==="initialize"){i!==null&&await this.upstream.send(ut(i,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}i!==null?await this.sendError(i,W.METHOD_NOT_FOUND,`method not implemented: ${e.method}`):F.warn("drop unknown notification",{method:e.method})}catch(c){F.error("handleFrame failed",{method:e.method,err:String(c)}),i!==null&&await this.upstream.send(Xe(i,mn(c)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new E("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,o=i._meta?.cozeAgentId;if(!o)throw new E("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let c=this.agents.get(o);if(!c)throw this.disconnectedAgents.has(o)?new E("AGENT_DISCONNECTED",`agent ${o} has been disconnected; cloud must _agent/create to revive`):new E("AGENT_NOT_FOUND",`agent not found: ${o}`);let x=typeof i.sessionId=="string"?i.sessionId:void 0;if(e.method==="session/cancel"||e.method==="session/new"||!x)return this.dispatchSessionCall(c,e.method,i);let f=Date.now(),d=!1;try{let g=await c.getSessionQueue(x).enqueue(()=>this.dispatchSessionCall(c,e.method,i));return d=!0,g}finally{F.info("session call done",{agentId:c.agentId,method:e.method,durationMs:Date.now()-f,ok:d})}}async dispatchSessionCall(e,i,o){e.lastActiveAt=Date.now();let{stripped:c}=Us(o);switch(i){case"session/new":{let x=Uc();return F.info("session/new ack (lazy spawn)",{agentId:e.agentId,cloudId:x}),{sessionId:x}}case"session/load":{let x=c;return F.info("session/load ack (lazy spawn)",{agentId:e.agentId,cloudId:x.sessionId}),{}}case"session/prompt":{let x=c,f=x.sessionId;if(!f)throw new E("IPC_BAD_REQUEST","session/prompt: missing sessionId");let d=await this.ensureRuntime(e,f);if(d.replySeq=0,await this.ensureDownstream(e,f,d),!d.downstream||!d.acpSessionId)throw new E("BRIDGE_INTERNAL","session runtime not ready after ensureDownstream");let g=o._meta?.cozeTriggerMsgId;g?e.activeTriggers.set(d.acpSessionId,g):e.activeTriggers.delete(d.acpSessionId);try{let w=await d.downstream.sessionPrompt({...x,sessionId:d.acpSessionId});return d.lastActiveAt=Date.now(),w}finally{e.activeTriggers.delete(d.acpSessionId),d.downstream?.isAlive()&&this.armIdleTimer(e,f,d)}}case"session/cancel":{let f=c.sessionId;if(!f)throw new E("IPC_BAD_REQUEST","session/cancel: missing sessionId");let d=e.sessions.get(f);return d?.downstream?.isAlive()&&d.acpSessionId&&await d.downstream.sessionCancel({sessionId:d.acpSessionId}),{ok:!0}}default:throw new E("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}async ensureRuntime(e,i){let o=e.sessions.get(i);if(o)return o;let x={modelToken:e.deployType==="cloud"?await this.requestSessionToken(e.agentId,i):"",tokenGeneratedAt:Date.now(),lastActiveAt:Date.now(),loadingSession:!1,replySeq:0};return e.sessions.set(i,x),await this.persistSessionMapping(e),x}async requestSessionToken(e,i){let o={sessionId:i,_meta:{cozeAgentId:e}};try{let c=await this.sendRequest(Se.GEN_MODEL_TOKEN,o,Fc);if(!c?.modelToken)throw new E("MODEL_TOKEN_GEN_FAILED",`cloud returned empty modelToken (agentId=${e}, cloudSessionId=${i})`);return c.modelToken}catch(c){throw c instanceof E&&c.code==="MODEL_TOKEN_GEN_FAILED"?c:new E("MODEL_TOKEN_GEN_FAILED",c instanceof Error?c.message:String(c),{cause:c})}}async ensureDownstream(e,i,o){if(Rt(o),o.downstream?.isAlive())return;if(!this.sessionSpawner)throw new E("AGENT_SPAWN_FAILED","sessionSpawner not wired (cannot spawn per-session downstream)");let c=await this.sessionSpawner(e,o.modelToken,i,this.currentCozeEnv);if(o.downstream=c,this.attachRuntimeHooks(e,i,o),o.acpSessionId){o.loadingSession=!0;try{await c.sessionLoad({sessionId:o.acpSessionId,cwd:e.workspace}),F.info("session restored via session/load",{agentId:e.agentId,cloudId:i,acpId:o.acpSessionId})}catch(x){F.warn("session/load failed, fallback to session/new",{agentId:e.agentId,cloudId:i,acpId:o.acpSessionId,err:String(x)}),o.acpSessionId=void 0;let f=await c.sessionNew({cwd:e.workspace});o.acpSessionId=f.sessionId,await this.persistSessionMapping(e)}finally{o.loadingSession=!1}}else{let x=await c.sessionNew({cwd:e.workspace});o.acpSessionId=x.sessionId,await this.persistSessionMapping(e)}c.afterSessionEstablished&&o.acpSessionId&&await c.afterSessionEstablished(o.acpSessionId)}armIdleTimer(e,i,o){if(Rt(o),this.isRuntimeBusy(e,o)){F.debug("skip idle timer: runtime busy (in-flight turn / pending permission)",{agentId:e.agentId,cloudId:i});return}o.idleTimer=setTimeout(()=>{if(o.idleTimer=void 0,this.isRuntimeBusy(e,o)){F.info("idle reaper fired but runtime busy, re-arming",{agentId:e.agentId,cloudId:i}),this.armIdleTimer(e,i,o);return}F.info("session runtime idle timeout, killing downstream",{agentId:e.agentId,cloudId:i});let c=o.downstream;o.downstream=void 0,o.acpSessionId&&e.activeTriggers.delete(o.acpSessionId),c&&c.stop("idle timeout").catch(x=>F.warn("idle stop failed (ignored)",{agentId:e.agentId,cloudId:i,err:String(x)}))},this.sessionIdleTimeoutMs),o.idleTimer.unref?.()}isRuntimeBusy(e,i){if(i.acpSessionId&&e.activeTriggers.has(i.acpSessionId))return!0;let o=i.downstream;if(!o)return!1;for(let c of this.pendingUpstream.values())if(c.downstream===o)return!0;return!1}forwardUpdate(e,i){let o=i.sessionId,c=this.reverseSessionId(e,o);if(!c){F.debug("drop update for unknown session",{agentId:e.agentId,acpId:o});return}let x=e.sessions.get(c);if(!x){F.debug("drop update: runtime gone",{agentId:e.agentId,cloudId:c});return}let f={cozeAgentId:e.agentId,cozeReplySeqID:++x.replySeq},d=e.activeTriggers.get(o);d&&(f.cozeTriggerMsgId=d),this.upstream.send(hn("session/update",{...i,sessionId:c,_meta:f})).catch(g=>F.warn("forward update failed",{agentId:e.agentId,err:String(g)}))}handleAgentRequest(e,i,o){if(o.method==="session/request_permission"){this.forwardPermissionRequest(e,i,o);return}F.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:o.method}),i.respondAgentRequestError(o.id,{code:W.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${o.method}`})}forwardPermissionRequest(e,i,o){let c=this.upstreamIds.next("session/request_permission"),x=o.params??{},d=x.sessionId,g=d?e.activeTriggers.get(d):void 0,w={cozeAgentId:e.agentId};g&&(w.cozeTriggerMsgId=g);let b=d?this.reverseSessionId(e,d):void 0,y={...x,...b?{sessionId:b}:{},_meta:w};this.pendingUpstream.set(c,{agentRequestId:o.id,agentId:e.agentId,downstream:i,method:o.method}),this.upstream.send(Tt(c,"session/request_permission",y)).catch(C=>{this.pendingUpstream.delete(c),F.error("forward permission request failed",{agentId:e.agentId,err:String(C)}),i.respondAgentRequestError(o.id,{code:W.INTERNAL_ERROR,message:`upstream send failed: ${String(C)}`})})}handleUpstreamResponse(e){if(e.id===null)return;let i=this.pendingUpstream.get(e.id);if(i){this.pendingUpstream.delete(e.id),e.error?i.downstream.respondAgentRequestError(i.agentRequestId,e.error):i.downstream.respondAgentRequest(i.agentRequestId,e.result);return}let o=this.pendingBridge.get(e.id);if(o){this.pendingBridge.delete(e.id),clearTimeout(o.timer),e.error?o.reject(new gn(e.error)):o.resolve(e.result);return}F.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,o=qc){let c=this.upstreamIds.next(e);return new Promise((x,f)=>{let d=setTimeout(()=>{this.pendingBridge.delete(c),f(new E("AGENT_TIMEOUT",`${e} timed out after ${o}ms`))},o);this.pendingBridge.set(c,{method:e,resolve:x,reject:f,timer:d}),this.upstream.send(Tt(c,e,i)).catch(g=>{let w=this.pendingBridge.get(c);w&&(clearTimeout(w.timer),this.pendingBridge.delete(c)),f(g)})})}async persistSessionMapping(e){if(this.paths)try{let i=new Map;for(let[o,c]of e.sessions){let x={modelToken:c.modelToken,tokenGeneratedAt:c.tokenGeneratedAt};c.acpSessionId&&(x.acpSessionId=c.acpSessionId),i.set(o,x)}await yr(e.agentId,i,this.paths)}catch(i){F.warn("persist session mapping failed",{agentId:e.agentId,err:String(i)})}}reverseSessionId(e,i){for(let[o,c]of e.sessions.entries())if(c.acpSessionId===i)return o}sendError(e,i,o){return this.upstream.send(Xe(e,{code:i,message:o}))}};function Uc(){return zc(16).toString("hex")}U();xe();import{randomBytes as Hc}from"node:crypto";import{chmod as Kc,mkdir as Gc,writeFile as ki}from"node:fs/promises";import{createServer as Wc}from"node:http";import{dirname as jc}from"node:path";var Jc=1e6,kr=L("ipc"),kn=class{server=null;port=0;token="";routes;paths;constructor(e){this.routes=new Map(e.routes.map(i=>[`${i.method} ${i.path}`,i])),this.paths=e.paths??G()}async start(){this.token=Hc(32).toString("hex");let e=Wc((o,c)=>{this.dispatch(o,c)});this.server=e,await new Promise((o,c)=>{e.once("error",c),e.listen(0,"127.0.0.1",()=>o())});let i=e.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),kr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((i,o)=>{e.close(c=>c?o(c):i())}),this.server=null)}async persistAuthFiles(){await Gc(jc(this.paths.portFile),{recursive:!0}),await ki(this.paths.portFile,String(this.port),"utf8"),await ki(this.paths.tokenFile,this.token,{encoding:"utf8",mode:384});try{await Kc(this.paths.tokenFile,384)}catch(e){kr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){Bt(i,401,{error:"unauthorized"});return}let c=`${e.method} ${(e.url??"").split("?")[0]}`,x=this.routes.get(c);if(!x){Bt(i,404,{error:"not found"});return}let f=null;if(e.method==="POST")try{f=await Vc(e)}catch(d){Bt(i,400,{error:"invalid json",detail:String(d)});return}try{let d=await x.handler(f,e);Bt(i,200,d??{ok:!0})}catch(d){kr.error("IPC handler failed",{key:c,err:String(d)}),Bt(i,500,{error:d instanceof Error?d.message:String(d)})}}};function Bt(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Vc(r){let e=[],i=0;for await(let c of r){let x=c;if(i+=x.length,i>Jc)throw new Error("body too large");e.push(x)}let o=Buffer.concat(e).toString("utf8");return o?JSON.parse(o):null}var Vo=Ie(zi(),1);var Du=Ie(No(),1),Iu=Ie(Kn(),1),Tu=Ie(gt(),1),Lu=Ie(Fr(),1),Ru=Ie(Kr(),1),Nu=Ie(Yr(),1),Ko=Ie(Jn(),1),Ou=Ie(Ho(),1);var Go=Ko.default;U();var ne=L("upstream.frontier"),jo="application/json",Jo="none",Yn=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){ne.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:Gs,...sn(this.opts.ppeOverride)};class i extends Go{constructor(d){super(d,Ks,{headers:e})}send(d,...g){if(qs("debug"))try{let w;typeof d=="string"?w=Buffer.from(d,"utf8"):d instanceof Buffer?w=d:d instanceof ArrayBuffer?w=new Uint8Array(d):ArrayBuffer.isView(d)?w=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):w=new Uint8Array(0);let b=Buffer.from(w.slice(0,128)).toString("hex");ne.debug("WS raw frame out",{bytes:w.byteLength,headHex:b})}catch(w){ne.warn("WS raw frame dump failed",{err:String(w)})}super.send(d,...g)}}let o=Js(this.opts.urlOverride),c={url:o,ws:i,fpID:Hs,aID:rn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:jo,force:!0},payloadEncoding:{encoding:Jo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},x=new Vo.FWS(c);x.onopen=()=>{this.opened=!0,this.openCount+=1;let f=this.openCount===1;ne.info("frontier opened",{url:o,remoteDeviceId:this.opts.handshake.deviceId,initial:f,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:f})).catch(d=>ne.warn("onConnect handler threw (ignored)",{err:String(d)}))},x.onclose=f=>{this.opened=!1,ne.info("frontier closed",{code:f.code,reason:f.reason,willReconnect:f.willReconnect})},x.onerror=f=>{ne.warn("frontier error",{code:f.code,msg:f.message})},x.onmessage=f=>this.handleMessage(f),this.fws=x,await x.connect()}async stop(e){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,e??"bridge shutdown")}catch(o){ne.warn("frontier close threw (ignored)",{err:String(o)})}}}async send(e){let i=this.fws;if(!i)throw new E("UPSTREAM_DISCONNECTED","frontier upstream not started");let o=JSON.stringify(e),c=e;ne.info("frontier frame out",{method:c.method,jsonrpcId:c.id,size:o.length});try{await i.send(o,{service:33555712,method:1,payloadType:jo,payloadEncoding:Jo})}catch(x){throw new E("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(x)}`,{cause:x})}}onFrame(e){this.handler=e}onConnect(e){this.connectHandler=e}isConnected(){return this.opened&&this.fws?.readyState===1}handleMessage(e){let i=e.message?.service;if(i!==33555712){ne.debug("drop non-adapter frontier frame",{service:i});return}let o=zu(e);if(!o){ne.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){ne.debug("frame received but no onFrame handler",{size:o.length});return}let c;try{c=JSON.parse(o)}catch(x){ne.warn("frontier message JSON parse failed",{err:String(x),head:o.slice(0,80)});return}ne.info("frontier frame in",{logid:Mu(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:c.id}),Promise.resolve(this.handler(c)).catch(x=>ne.warn("frontier frame handler threw",{err:String(x)}))}};function Mu(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function zu(r){let e=r.message;if(e?.textPayload)return e.textPayload;let i=e?.payload;if(!i)return null;try{return Buffer.from(i).toString("utf8")}catch{return null}}U();var $r=L("upstream.switchable"),Xn=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,i){if(this.inner===e)return;$r.info("swap upstream",{reason:i});let o=this.inner;this.inner=e,this.handler&&e.onFrame(this.handler),this.connectHandler&&e.onConnect&&e.onConnect(this.connectHandler);try{await e.start()}catch(c){throw $r.error("swap target start failed, reverting",{err:String(c)}),this.inner=o,c}await o.stop(i??"swapped").catch(c=>$r.warn("previous upstream stop threw (ignored)",{err:String(c)}))}current(){return this.inner}start(){return this.inner.start()}stop(e){return this.inner.stop(e)}send(e){return this.inner.send(e)}onFrame(e){this.handler=e,this.inner.onFrame(e)}onConnect(e){this.connectHandler=e,this.inner.onConnect?.(e)}isConnected(){return this.inner.isConnected()}};U();var Qr=L("upstream"),Wt=class{handler=null;async start(){Qr.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Qr.info("NoopUpstream stopped",{reason:e})}async send(e){Qr.debug("NoopUpstream.send (dropped)",{method:"method"in e?e.method:void 0})}onFrame(e){this.handler=e}isConnected(){return!1}async injectFrame(e){this.handler&&await this.handler(e)}};U();xe();U();xe();import{execSync as qu}from"node:child_process";import{readFileSync as Yo,unlinkSync as Fu}from"node:fs";import{mkdir as Uu,readFile as Xo,unlink as $o,writeFile as Hu}from"node:fs/promises";import{dirname as Ku}from"node:path";var Gu=L("single-instance"),$n=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??G().pidFile,e.processTitle&&(process.title=e.processTitle)}async acquire(){let e=await this.readExistingPid();return e!==null&&this.isAlive(e)?{kind:"already-running",pid:e}:(e!==null&&(Gu.warn("removing stale pid file",{stalePid:e}),await $o(this.pidFile).catch(()=>{})),await Uu(Ku(this.pidFile),{recursive:!0}),await Hu(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Xo(this.pidFile,"utf8")).trim()===String(process.pid)&&await $o(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Xo(this.pidFile,"utf8"),i=Number.parseInt(e.trim(),10);return Number.isFinite(i)&&i>0?i:null}catch(e){if(e.code==="ENOENT")return null;throw e}}isAlive(e){try{process.kill(e,0)}catch(i){return i.code==="EPERM"}return this.matchesDaemonTitle(e)}matchesDaemonTitle(e){try{let i=Yo(`/proc/${e}/cmdline`,"utf8").replace(/\0/g," ");return!!(i.includes("coze-bridge-daemon")||i.includes("lib/index.js"))}catch{}try{let i=qu(`ps -o command= -p ${e}`,{stdio:["ignore","pipe","ignore"],timeout:1e3}).toString();return i.trim()?i.includes("coze-bridge-daemon")||i.includes("lib/index.js"):!1}catch{return!0}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Yo(this.pidFile,"utf8").trim()===String(process.pid)&&Fu(this.pidFile)}catch{}})}};var B=L("daemon"),Wu="coze-bridge-daemon";async function ea(){let r=new $n({processTitle:Wu}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let i=await En(),o=i??{};_r({pid:process.pid}),B.info(i?"loaded bridge config":"initialized bridge config");try{let D=new Nt;o.frameworksCache=await D.detectAll(),B.info("refreshed frameworks_cache",{detected:Object.keys(o.frameworksCache)})}catch(D){B.warn("framework detection failed",{err:String(D)})}await Ot(o);let c=new Xn(new Wt),x=G(),f=null,d=new An({upstream:c,paths:x,bridgeConfig:o,sessionSpawner:async(D,q,j,Z)=>{if(!f)throw new Error("agentManager not ready");return f.spawnSessionDownstream(D,q,j,Z)}});await Ju(x,d);let g=new Cn({paths:x,config:o,registry:d});f=g;let w,b,y=null,C=null;d.registerExtension("_agent/create",async D=>g.createAgent(D.params)),d.registerExtension("_agent/health",async()=>({ok:!0}));let P={},I=new cn({agents:d.agents,disposeAndMarkDisconnected:async(D,q)=>{let j=d.agents.get(D);j&&(await g.cleanupOpenclawSessionProviders(j).catch(Z=>B.warn("cleanup openclaw providers failed (ignored)",{agentId:D,err:String(Z)})),await j.dispose(`disconnect: ${q}`).catch(Z=>B.warn("dispose during disconnect failed (ignored)",{agentId:D,err:String(Z)})),j.status="disconnected",d.unregister(D)),d.disconnectedAgents.add(D)},detailSyncer:async D=>{if(!P.ref)throw new Error("agent-detail-sync not initialized yet");await P.ref.syncOne(D)},openclawRepair:async(D,q)=>{await g.openclawRepair(D,q)}});d.registerExtension("_agent/listSkills",D=>I.listSkills(D.params)),d.registerExtension("_agent/addSkills",D=>I.addSkills(D.params)),d.registerExtension("_agent/removeSkills",D=>I.removeSkills(D.params)),d.registerExtension("_agent/getFileTree",D=>I.getFileTree(D.params)),d.registerExtension("_agent/getFileContent",D=>I.getFileContent(D.params)),d.registerExtension("_agent/update",D=>I.updateAgent(D.params)),d.registerExtension("_agent/disconnect",D=>I.disconnectAgent(D.params)),d.registerExtension("_agent/switchModel",D=>I.switchModel(D.params)),d.registerExtension("_agent/reset",D=>I.resetAgent(D.params)),d.registerExtension("_agent/repair",D=>I.repairAgent(D.params));let T=new nn({paths:x,handlers:I,sendDetail:D=>d.sendRequest("_agent/detail",D)});P.ref=T,c.onConnect(({initial:D})=>{B.info("frontier upstream connected, triggering detail sync",{initial:D}),T.syncAll(D?"initial-connect":"reconnect").catch(q=>B.warn("detail sync top-level error (ignored)",{err:String(q)}))});let z=new kn({paths:x,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...d.agents.keys()],deviceId:y??"",frameworksCache:o.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async D=>{let q=D,j=q?.privatecode,Z=q?.pairing_code;if(!j||!Z)throw new E("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let ke=on(q.env),ge=q.handshake_url,Ve=q.frontier_url,vt=ju(q.env,ge,Ve),jt=!!w&&w!==j,ye=b!==void 0&&b!==vt,be=jt||ye;if(be){B.warn("pair config switched, resetting agents",{pcChanged:jt,envChanged:ye,previousPc:w?Qo(w):"",nextPc:Qo(j),previousEnvKey:b??"",nextEnvKey:vt});for(let K of[...d.agents.values()])await K.dispose("pair config switch").catch(()=>{}),d.agents.delete(K.agentId);await c.swap(new Wt,"pair switch").catch(()=>{})}let Jt=await Ys({privatecode:j,...ge?{endpoint:ge}:{},ppeOverride:ke});y=Jt.deviceId,_r({deviceId:y,pid:process.pid});let se=new Yn({handshake:Jt,privatecode:j,...Ve?{urlOverride:Ve}:{},ppeOverride:ke});await c.swap(se,"pair");let Vt=Object.keys(o.frameworksCache??{});try{let K=await d.sendRequest("_agent/pair",{pairCode:Z,patToken:j,frameworks:Vt,_meta:{cozeDeviceId:y}});B.info("_agent/pair ok",{pairResult:K}),w=j,b=vt,C||(C=new un({core:d,getDeviceId:()=>y??""})),C.start(),be&&Zo(x,g).catch(Pe=>B.warn("post-pair-switch auto-revive error (ignored)",{err:String(Pe)}));let J;return q.agent_id&&(J=await Vu(q.agent_id,x,g,Pe=>d.sendRequest("_agent/detail",Pe)).catch(Pe=>(B.error("--agent-id ensureAgent failed",{agentId:q.agent_id,err:String(Pe)}),{ok:!1,agentId:q.agent_id??"",note:String(Pe)}))),{ok:!0,note:"paired with cloud",...J?{agent:J}:{}}}catch(K){return B.error("_agent/pair failed",{err:String(K)}),{ok:!1,note:`pair failed: ${String(K)}`}}}},{method:"POST",path:"/_agent/create",handler:async D=>{let q=D;return{ok:!0,result:await g.createAgent(q)}}},{method:"POST",path:"/refresh",handler:async()=>{B.info("IPC /refresh: re-detecting frameworks");let D=new Nt;return o.frameworksCache=await D.detectAll(),await Ot(o),{ok:!0,frameworks:o.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(B.info("IPC /shutdown received"),setImmediate(()=>{ae.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:re,token:Q}=await z.start();await d.start(),Zo(x,g).catch(D=>B.warn("auto-revive top-level error (ignored)",{err:String(D)}));let _e=null,ae={port:re,token:Q,core:d,ipc:z,shutdown(D){return _e||(B.info("daemon shutdown",{reason:D}),_e=(async()=>{C?.stop(),await d.stop(D),await z.stop(),await r.release()})(),_e)}};for(let D of["SIGTERM","SIGINT"])process.on(D,()=>{ae.shutdown(D).then(()=>process.exit(0))});return B.info("daemon ready",{port:re,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(o.frameworksCache??{}),libVersion:o.libVersion??"dev"}),ae}function Qo(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function ju(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function Ju(r,e){let{readdir:i}=await import("node:fs/promises"),o;try{o=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:c,enforceAgentConfigMode:x}=await Promise.resolve().then(()=>(Ue(),tn));for(let f of o){await x(f,r).catch(d=>B.warn("enforceAgentConfigMode failed (ignored)",{agentId:f,err:String(d)}));try{let d=await c(f,r);d?.disconnectedAt&&(e.disconnectedAgents.add(f),B.info("agent marked disconnected on startup",{agentId:f,disconnectedAt:d.disconnectedAt,reason:d.disconnectReason??""}))}catch(d){B.warn("failed to load agent config on startup, skipping",{agentId:f,err:String(d)})}}}async function Vu(r,e,i,o){let{loadAgentConfig:c}=await Promise.resolve().then(()=>(Ue(),tn)),x=await c(r,e);if(x){B.info("--agent-id: local config found, reconnecting",{agentId:r,framework:x.framework,hadDisconnect:!!x.disconnectedAt});let w={agentId:x.agentId,framework:x.framework,...x.cozeIdentity?{cozeIdentity:x.cozeIdentity}:{},...x.model?{model:x.model}:{}};return await i.createAgent(w),{ok:!0,agentId:r,note:x.disconnectedAt?"revived from local config":"connected from local config"}}B.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let f=await o({_meta:{cozeAgentId:r}});if(!f.framework)throw new E("AGENT_NOT_FOUND",`agent ${r} \u4E0D\u5728\u672C\u5730; \u4E91\u7AEF _agent/detail \u54CD\u5E94\u7F3A framework \u5B57\u6BB5 (D36 \u534F\u8BAE\u6269\u5C55\u672A\u751F\u6548), \u65E0\u6CD5\u5728\u672C\u673A\u65B0\u5EFA`);let d={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.deployType?{_meta:{cozeDeployType:f.deployType}}:{}};await i.createAgent(d);let g=f.deployType==="cloud"&&f.framework==="openclaw";return{ok:!0,agentId:r,note:g?"cloud agent acknowledged":"created from cloud detail"}}async function Zo(r,e){let{readdir:i}=await import("node:fs/promises"),o;try{o=await i(r.agentsRoot)}catch{return{revived:0,skipped:0,total:0}}if(o.length===0)return{revived:0,skipped:0,total:0};let{loadAgentConfig:c}=await Promise.resolve().then(()=>(Ue(),tn));B.info("auto-revive: scanning local agents on startup",{count:o.length});let x=0,f=0;for(let d of o){let g;try{g=await c(d,r)}catch(w){B.warn("auto-revive: load config failed (skipping)",{agentId:d,err:String(w)}),f+=1;continue}if(!g){f+=1;continue}if(g.disconnectedAt){B.info("auto-revive: skip disconnected agent",{agentId:d,disconnectedAt:g.disconnectedAt}),f+=1;continue}try{B.info("auto-revive: re-registering agent (D44 no spawn)",{agentId:d,framework:g.framework}),await e.createAgent({agentId:g.agentId,framework:g.framework,...g.cozeIdentity?{cozeIdentity:g.cozeIdentity}:{},...g.model?{model:g.model}:{},...g.deployType?{_meta:{cozeDeployType:g.deployType}}:{}}),x+=1}catch(w){B.warn("auto-revive: createAgent failed (skipping)",{agentId:d,framework:g.framework,err:String(w)}),f+=1}}return B.info("auto-revive: done",{revived:x,skipped:f,total:o.length}),{revived:x,skipped:f,total:o.length}}es();xe();import{readFile as na}from"node:fs/promises";var Je=class{paths;constructor(e){this.paths=e??G()}async probe(e=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let o=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:e});return o.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${o.status}`}}catch(o){return{kind:"stale",reason:rf(o)}}}async request(e){let i=await this.readAuth();if(!i)throw new Error("coze-bridge daemon not running (no port/token files)");return this.fetch(i,e)}async readAuth(){try{let[e,i]=await Promise.all([na(this.paths.portFile,"utf8"),na(this.paths.tokenFile,"utf8")]),o=Number.parseInt(e.trim(),10),c=i.trim();return!Number.isFinite(o)||o<=0||!c?null:{port:o,token:c}}catch(e){if(e.code==="ENOENT")return null;throw e}}async fetch(e,i){let o=i.body!==void 0,c={Authorization:`Bearer ${e.token}`};o&&(c["content-type"]="application/json");let x=new AbortController,f=setTimeout(()=>x.abort(),i.timeoutMs??5e3);try{let d=await fetch(`http://127.0.0.1:${e.port}${i.path}`,{method:i.method,headers:c,body:o?JSON.stringify(i.body):void 0,signal:x.signal}),g=await d.text();return{status:d.status,body:nf(g)}}finally{clearTimeout(f)}}};function nf(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function rf(r){return r instanceof Error?r.message:String(r)}U();xe();import{copyFile as ra,mkdir as sf,readFile as ts,writeFile as of}from"node:fs/promises";import{dirname as af,resolve as ns,sep as Qn}from"node:path";import{fileURLToPath as cf}from"node:url";U();xe();var sa=L("dist-install");function xf(r){let e=cf(r),i=af(e),o=`${Qn}src${Qn}`;if(i.includes(o)||i.endsWith(`${Qn}src${Qn}cli`))return null;let c=ns(i,"index.js"),x=ns(i,"..","package.json");return{dist:c,pkgJson:x}}async function ia(r={}){let e=r.paths??G(),i=xf(import.meta.url),o=r.sourceDist??i?.dist,c=r.sourcePackageJson??i?.pkgJson;if(!o||!c)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let x;try{x=JSON.parse(await ts(c,"utf8")).version??"unknown"}catch(y){return sa.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let f=await En(e.configFile)??{},d=f.libVersion;if(d===x)try{return await ts(e.libEntry),{kind:"already-current",libVersion:x}}catch{}await sf(e.libDir,{recursive:!0}),await ra(o,e.libEntry),await ra(`${o}.map`,`${e.libEntry}.map`).catch(()=>{});let g=ns(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
|
|
94
|
+
`;return await ts(g,"utf8").catch(()=>null)!==w&&await of(g,w),f.libVersion=x,await Ot(f,e.configFile),sa.info("dist installed",{libEntry:e.libEntry,fromVersion:d,toVersion:x}),d?{kind:"version-changed",fromVersion:d,toVersion:x,libEntry:e.libEntry}:{kind:"first-install",libVersion:x,libEntry:e.libEntry}}var Pf=L("cli");function bt(r,e){let i=[],o;for(let c=0;c<r.length;c++){let x=r[c];if(x===e){o=r[c+1],c+=1;continue}if(x.startsWith(`${e}=`)){o=x.slice(e.length+1);continue}i.push(x)}return{value:o,rest:i}}function Df(r){let e=r.slice(2);if(e.includes("--daemon"))return{mode:"daemon"};if(e.includes("--status"))return{mode:"status"};if(e.includes("--stop"))return{mode:"stop"};if(e.includes("--refresh"))return{mode:"refresh"};if(e.includes("--uninstall"))return{mode:"uninstall"};if(e.includes("--install-service"))return{mode:"install-service"};if(e.includes("--help")||e.includes("-h")||e.length===0)return{mode:"help"};let i=e,{value:o,rest:c}=bt(i,"--pat-token");i=c;let{value:x,rest:f}=bt(i,"--pair-code");i=f;let{value:d,rest:g}=bt(i,"--env");i=g;let{value:w,rest:b}=bt(i,"--handshake-url");i=b;let{value:y,rest:C}=bt(i,"--frontier-url");i=C;let{value:P}=bt(i,"--agent-id");if(!o||!x)return{mode:"help"};let I={mode:"pair",privatecode:o,pairingCode:x};return d&&(I.env=d),w&&(I.handshakeUrl=w),y&&(I.frontierUrl=y),P&&(I.agentId=P),I}var If=`
|
|
95
95
|
coze-bridge - local bridge daemon for cloud Agent Service
|
|
96
96
|
|
|
97
97
|
Usage:
|
|
@@ -118,35 +118,35 @@ Auto-connect agent (optional):
|
|
|
118
118
|
|
|
119
119
|
Internal:
|
|
120
120
|
<node> <entry> --daemon daemon mode (OS supervisor only)
|
|
121
|
-
`.trimStart();async function
|
|
122
|
-
`),1;if(
|
|
123
|
-
`),1;let
|
|
124
|
-
${JSON.stringify(
|
|
125
|
-
`),0}async function
|
|
126
|
-
`),0;if(
|
|
127
|
-
`),0;try{return await
|
|
128
|
-
`),0}catch(
|
|
129
|
-
`),1}}async function Rf(
|
|
130
|
-
`),1;try{let
|
|
131
|
-
${JSON.stringify(
|
|
132
|
-
`),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(
|
|
133
|
-
`),1)}catch(
|
|
134
|
-
`),1}}async function Nf(
|
|
135
|
-
`);try{await e.request({method:"POST",path:"/shutdown"})}catch(
|
|
136
|
-
`)}await new Promise(
|
|
137
|
-
`)}catch(
|
|
138
|
-
`)}let
|
|
139
|
-
`)}catch(
|
|
121
|
+
`.trimStart();async function fa(r=process.argv,e={}){let i=Df(r);switch(i.mode){case"help":return process.stdout.write(If),0;case"daemon":{try{await ea()}catch(o){return Pf.error("daemon start failed",{err:String(o)}),1}return new Promise(()=>{})}case"status":return Tf(e);case"stop":return Lf(e);case"refresh":return Rf(e);case"uninstall":return Nf(e);case"install-service":return Of();case"pair":{let o={};return i.env&&(o.env=i.env),i.handshakeUrl&&(o.handshakeUrl=i.handshakeUrl),i.frontierUrl&&(o.frontierUrl=i.frontierUrl),Bf(i.privatecode,i.pairingCode,e,o,i.agentId)}}}async function da(r){let{unlink:e}=await import("node:fs/promises");await Promise.all([e(r.pidFile).catch(()=>{}),e(r.portFile).catch(()=>{}),e(r.tokenFile).catch(()=>{})])}async function Tf(r){let e=r.paths??G(),i=new Je(e),o=await i.probe();if(o.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
122
|
+
`),1;if(o.kind==="stale")return await da(e),process.stdout.write(`coze-bridge: not running (cleaned stale state)
|
|
123
|
+
`),1;let c=await i.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
|
|
124
|
+
${JSON.stringify(c.body,null,2)}
|
|
125
|
+
`),0}async function Lf(r){let e=r.paths??G(),i=new Je(e),o=await i.probe();if(o.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
126
|
+
`),0;if(o.kind==="stale")return await da(e),process.stdout.write(`coze-bridge: not running (cleaned stale state)
|
|
127
|
+
`),0;try{return await i.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
|
|
128
|
+
`),0}catch(c){return process.stdout.write(`coze-bridge: stop failed: ${String(c)}
|
|
129
|
+
`),1}}async function Rf(r){let e=new Je(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
|
|
130
|
+
`),1;try{let o=await e.request({method:"POST",path:"/refresh"});return o.status===200?(process.stdout.write(`coze-bridge: refreshed
|
|
131
|
+
${JSON.stringify(o.body,null,2)}
|
|
132
|
+
`),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(o.body)}
|
|
133
|
+
`),1)}catch(o){return process.stderr.write(`coze-bridge: refresh failed: ${String(o)}
|
|
134
|
+
`),1}}async function Nf(r){let e=new Je(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
|
|
135
|
+
`);try{await e.request({method:"POST",path:"/shutdown"})}catch(x){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(x)}
|
|
136
|
+
`)}await new Promise(x=>setTimeout(x,500))}if(!r.skipSupervisor)try{let{getSupervisor:x,buildContext:f}=await Promise.resolve().then(()=>(xs(),cs)),d=x();await d.uninstall(f()),process.stdout.write(`coze-bridge: ${d.platform} supervisor unregistered
|
|
137
|
+
`)}catch(x){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(x)}
|
|
138
|
+
`)}let o=r.paths??G(),{rm:c}=await import("node:fs/promises");try{await c(o.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${o.cozeRoot}
|
|
139
|
+
`)}catch(x){return process.stderr.write(`coze-bridge: remove failed: ${String(x)}
|
|
140
140
|
`),1}return process.stdout.write(`coze-bridge: uninstalled
|
|
141
|
-
`),0}async function
|
|
142
|
-
`),await
|
|
143
|
-
`),0}catch(
|
|
144
|
-
`),1}}async function
|
|
145
|
-
`),(await
|
|
146
|
-
`)}let
|
|
147
|
-
`),await f({paths:
|
|
148
|
-
`),1;let
|
|
141
|
+
`),0}async function Of(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(xs(),cs)),i=r(),o=e();return process.stdout.write(`coze-bridge: installing ${i.platform} supervisor...
|
|
142
|
+
`),await i.install(o),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
|
|
143
|
+
`),0}catch(r){return process.stderr.write(`coze-bridge: --install-service failed: ${String(r)}
|
|
144
|
+
`),1}}async function Bf(r,e,i,o={},c){let x=new Je(i.paths),f=i.spawnDaemon??ta;if(!i.skipDistInstall){let w=await ia({paths:i.paths});w.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${w.fromVersion} \u2192 ${w.toVersion}
|
|
145
|
+
`),(await x.probe()).kind==="connected"&&(await x.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(y=>setTimeout(y,500)))):w.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${w.libVersion}
|
|
146
|
+
`)}let d=await x.probe();if(d.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
|
|
147
|
+
`),await f({paths:i.paths}),d=await Mf(x,i.waitTimeoutMs??1e4,i.sleep??zf),d.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${d.kind}
|
|
148
|
+
`),1;let g={privatecode:r,pairing_code:e};o.env&&(g.env=o.env),o.handshakeUrl&&(g.handshake_url=o.handshakeUrl),o.frontierUrl&&(g.frontier_url=o.frontierUrl),c&&(g.agent_id=c);try{let w=await x.request({method:"POST",path:"/pair",body:g,timeoutMs:35e3});return w.status===200&&w.body?.ok?(process.stdout.write(`coze-bridge: paired (${w.body.note??"ok"})
|
|
149
149
|
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(w.body)}
|
|
150
150
|
`),1)}catch(w){return process.stderr.write(`coze-bridge: pair failed: ${String(w)}
|
|
151
|
-
`),1}}async function
|
|
151
|
+
`),1}}async function Mf(r,e,i){let o=Date.now()+e;for(;Date.now()<o;){let c=await r.probe(500);if(c.kind==="connected")return c;await i(200)}return r.probe(500)}function zf(r){return new Promise(e=>setTimeout(e,r))}fa(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
152
152
|
`),process.exit(1)});
|