coze-bridge 0.1.6 → 0.1.7
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 +31 -31
- 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
|
-
`,"utf8"),i?.mode!==void 0&&await
|
|
8
|
+
var R0=Object.create;var xr=Object.defineProperty;var O0=Object.getOwnPropertyDescriptor;var B0=Object.getOwnPropertyNames;var M0=Object.getPrototypeOf,z0=Object.prototype.hasOwnProperty;var Z=(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 Pe=(r,e)=>()=>(r&&(e=r(r=0)),e);var ae=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ys=(r,e)=>{for(var i in e)xr(r,i,{get:e[i],enumerable:!0})},q0=(r,e,i,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let x of B0(e))!z0.call(r,x)&&x!==i&&xr(r,x,{get:()=>e[x],enumerable:!(a=O0(e,x))||a.enumerable});return r};var Ie=(r,e,i)=>(i=r!=null?R0(M0(r)):{},q0(e||!r||!r.__esModule?xr(i,"default",{value:r,enumerable:!0}):i,r));import{chmod as F0,mkdir as U0,readFile as K0,writeFile as H0}from"node:fs/promises";import{dirname as W0}from"node:path";async function Wt(r){try{let e=await K0(r,"utf8");return JSON.parse(e)}catch(e){if(e.code==="ENOENT")return null;throw e}}async function jt(r,e,i){await U0(W0(r),{recursive:!0}),await H0(r,`${JSON.stringify(e,null,2)}
|
|
9
|
+
`,"utf8"),i?.mode!==void 0&&await F0(r,i.mode)}var cr=Pe(()=>{"use strict"});function Ss(r){return Jt[vs]<=Jt[r]}function fr(r){bs={...r}}function Gt(r,e,i,a){if(Jt[r]<Jt[vs])return;let x=JSON.stringify({ts:new Date().toISOString(),level:r,module:e,msg:i,...bs,...a});r==="error"||r==="warn"?G0.write(`${x}
|
|
10
10
|
`):j0.write(`${x}
|
|
11
|
-
`)}function N(r){return{debug:(e,i)=>Ut("debug",r,e,i),info:(e,i)=>Ut("info",r,e,i),warn:(e,i)=>Ut("warn",r,e,i),error:(e,i)=>Ut("error",r,e,i),child:e=>N(`${r}.${e}`)}}var Ht,_s,j0,G0,ys,F=Ae(()=>{"use strict";Ht={debug:10,info:20,warn:30,error:40},_s=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),j0=process.stdout,G0=process.stderr,ys={}});import{homedir as W0}from"node:os";import{join as te}from"node:path";function K(r){let e=r??W0(),i=te(e,".coze"),a=te(i,"bridge"),x=te(a,"lib");return{cozeRoot:i,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(i,"agents")}}function Ie(r,e=K()){let i=te(e.agentsRoot,r);return{root:i,config:te(i,"config.json"),workspace:te(i,"workspace"),logs:te(i,"logs")}}var xe=Ae(()=>{"use strict"});var Gt={};ws(Gt,{AGENT_CONFIG_FILE_MODE:()=>Kt,enforceAgentConfigMode:()=>Y0,loadAgentConfig:()=>oe,persistAgentSessions:()=>ar,persistAgentSkills:()=>jt,saveAgentConfig:()=>ue});import{chmod as J0,stat as V0}from"node:fs/promises";function oe(r,e){return qt(Ie(r,e).config)}function ue(r,e){return Ft(Ie(r.agentId,e).config,r,{mode:Kt})}async function Y0(r,e){if(process.platform==="win32")return;let i=Ie(r,e).config;try{let a=await V0(i);if(!a.isFile())return;let x=a.mode&511;x!==Kt&&(await J0(i,Kt),bs.warn("agent config mode auto-corrected to 0600",{path:i,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;bs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function ar(r,e,i){let a=await oe(r,i);a&&(a.sessions=Object.fromEntries(e),await ue(a,i))}async function jt(r,e,i){let a=await oe(r,i);a&&(a.skills=e,await ue(a,i))}var bs,Kt,Ue=Ae(()=>{"use strict";ir();F();xe();bs=N("agent-config"),Kt=384});var ii=ie(V=>{"use strict";var S=A;(function(r,e){let i=A,a=r();for(;;)try{if(-parseInt(i(915))/1*(parseInt(i(575))/2)+parseInt(i(1194))/3*(-parseInt(i(1252))/4)+parseInt(i(1007))/5*(-parseInt(i(940))/6)+-parseInt(i(1150))/7*(-parseInt(i(621))/8)+-parseInt(i(210))/9+parseInt(i(284))/10+parseInt(i(1328))/11===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(_n,797648);var ex=Object[S(1316)+S(126)],tx=Object[S(833)+S(671)+S(732)],ei=(r,e)=>function(){return r&&(e=(0,r[{GOLBE:function(f,u){return f(u)}}[S(975)](tx,r)[0]])(r=0)),e},nx=(r,e)=>{for(var i in e)ex(r,i,{get:e[i],enumerable:!0})};function rx(){return Ys||(Ys=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sx(){let r=S;return Xs||(Xs=[IDBCursor.prototype[r(1582)],IDBCursor[r(1396)+"e"][r(958)],IDBCursor[r(1396)+"e"][r(958)+"PrimaryKey"]])}function ix(r){let e=S,i={PxtNG:e(1387),czkLh:function(x){return x()},wXtHk:function(x,f){return x(f)},rmjaW:e(1523)},a=new Promise((x,f)=>{let u=e,h=()=>{let y=A;r[y(1086)+"entListe"+y(658)](i[y(687)],m),r["removeEv"+y(419)+y(658)]("error",w)},m=()=>{let y=A;x(ve(r[y(831)])),i[y(703)](h)},w=()=>{i[A(1443)](f,r.error),h()};r[u(1514)+u(735)](i[u(687)],m),r[u(1514)+u(735)](i[u(815)],w)});return a[e(839)](x=>{let f=e;x instanceof IDBCursor&&dr[f(868)](x,r)})[e(1008)](()=>{}),mn.set(a,r),a}function ox(r){let e=S,i={OkEpl:function(x,f){return x!==f},pMsWE:e(1319),uSXUn:e(902),iYDPO:function(x){return x()},Mdkps:e(889)+e(1317),iLmVh:"header",SvshW:function(x,f,u,h){return x(f,u,h)},JwAuf:e(1351)+e(695),lsySR:function(x,f){return x(f)},Idsvo:function(x,f){return x!==f},SjiIG:e(293),EEMiL:e(1384),lKHqF:e(1523),VxPyd:e(484)};if(pn.has(r))return;let a=new Promise((x,f)=>{let u=e,h={JXKkj:u(484),suEiL:i[u(1303)],BLXiH:i[u(823)],TIeWT:function(m,w,y,_){return i[u(317)](m,w,y,_)},wrndY:"service",gjHde:function(m,w,y,_){return i.SvshW(m,w,y,_)},PcoUw:i.JwAuf,WiqOM:u(1428),yJRie:function(m,w){return i[u(633)](m,w)},eEzPC:u(860)+"or",wmYFY:function(m){return m()}};if(i.Idsvo(i[u(195)],i[u(195)]))return _0x524b3d||(_0xd8f7e6=[_0x1cd670[u(1396)+"e"][u(1582)],_0x58ea9f[u(1396)+"e"].continue,_0x1731d5[u(1396)+"e"][u(958)+u(714)+"ey"]]);{let m=()=>{let _=u;r[_(1086)+_(419)+_(658)](_(1384),w),r["removeEv"+_(419)+_(658)](_(1523),y),r["removeEv"+_(419)+_(658)](h[_(297)],y)},w=()=>{let _=u;i[_(1577)](i[_(471)],i.uSXUn)?(i[_(1026)](x),i.iYDPO(m)):(_0x1d41af.log(h[_(398)],_0x1d1d50,_0x4ee207[_(1123)]),_0x1a8c22=_0x59582b(0,_0x3c2ffc,_0x4951df),_0x475f06[_(942)](h[_(1180)],_0x4456f6),_0x48fd4d=h.TIeWT(_0x5b3444,_0x810b47,_0x412895,_0x3fee59[_(1123)]||0),_0x23af84[_(942)](h.wrndY,_0x90dd89),_0x57b115=h.gjHde(_0x16e8f2,_0x874917[_0x8612a2[_(1064)+_(1394)]],_0x19e543,_0x6aa5d5),_0x469349[_(942)](h[_(604)],_0x362f0e),_0xbdf9d0=h.gjHde(_0x155d06,_0xab66b4[_(1064)+_(1394)],_0x2396c8,_0x5a7486),_0x3d1ceb[_(942)](_(695),_0x18fe11),_0x18fb09=_0x328525(_0x1d32f8[_(1224)+"er"](_0x9062ae.cursor||_0x40036e),_0x15b281,_0x1fbd08),_0x13eedf[_(942)](h.WiqOM,_0x5f0d41))},y=()=>{let _=u;h[_(252)](f,r[_(1523)]||new DOMException(h[_(763)],h[_(763)])),h[_(1119)](m)};r[u(1514)+"Listener"](i[u(348)],w),r["addEvent"+u(735)](i[u(119)],y),r[u(1514)+"Listener"](i[u(261)],y)}});pn[e(868)](r,a)}function ax(r){wn=r(wn)}function xx(r){let e=S,i={MPgtf:function(a,x){return a(x)},tLKqm:function(a,x){return a(x)},flJzI:function(a,x){return a(x)},NrUyZ:function(a,x){return a(x)},xrrDy:function(a,x){return a===x},SyKdL:e(647)+e(718),YLhWs:function(a){return a()}};return i[e(543)](r,IDBDatabase.prototype[e(110)+e(814)])&&!(i[e(1382)]in IDBTransaction[e(1396)+"e"])?function(a,...x){let f=e,u=r[f(861)](i.MPgtf(kt,this),a,...x);return ur.set(u,a.sort?a.sort():[a]),i[f(771)](ve,u)}:i.YLhWs(sx)[e(136)](r)?function(...a){let x=e;return r[x(1228)](i[x(771)](kt,this),a),i.tLKqm(ve,dr.get(this))}:function(...a){let x=e;return i[x(547)](ve,r[x(1228)](i[x(497)](kt,this),a))}}function cx(r){let e=S,i={QmyHH:function(a,x){return a===x},MCPiT:function(a,x){return a instanceof x},TKEtm:function(a,x){return a(x)},gxOVi:function(a,x,f){return a(x,f)},EGyrR:function(a){return a()}};return i[e(227)](typeof r,e(417))?xx(r):(i[e(843)](r,IDBTransaction)&&i[e(496)](ox,r),i[e(690)](ti,r,i[e(1327)](rx))?new Proxy(r,wn):r)}function ve(r){let e=S,i={ghvuV:function(x,f){return x!==f}};if(r instanceof IDBRequest)return ix(r);if(hn.has(r))return hn[e(1379)](r);let a=cx(r);return i[e(1477)](a,r)&&(hn[e(868)](r,a),mn[e(868)](a,r)),a}function A(r,e){r=r-100;let i=_n(),a=i[r];if(A.sDdmtF===void 0){var x=function(m){let w="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",y="",_="";for(let C=0,L,T,R=0;T=m.charAt(R++);~T&&(L=C%4?L*64+T:T,C++%4)?y+=String.fromCharCode(255&L>>(-2*C&6)):0)T=w.indexOf(T);for(let C=0,L=y.length;C<L;C++)_+="%"+("00"+y.charCodeAt(C).toString(16)).slice(-2);return decodeURIComponent(_)};A.Arxomu=x,A.ZJdlmF={},A.sDdmtF=!0}let f=i[0],u=r+f,h=A.ZJdlmF[u];return h?a=h:(a=A.Arxomu(a),A.ZJdlmF[u]=a),a}var ti,Ys,Xs,dr,pn,ur,hn,mn,wn,kt,Zs=ei({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={LBjAT:r(266),Pfywo:function(i,a){return i===a},NByKf:r(647)+r(718),zxpUn:function(i,a){return i===a},IXEXy:function(i,a){return i(a)},mWsyu:function(i,a){return i!==a},RJXtg:function(i,a,x){return i(a,x)},eicLy:function(i,a){return i===a}};ti=(i,a)=>a[r(607)](x=>i instanceof x),dr=new WeakMap,pn=new WeakMap,ur=new WeakMap,hn=new WeakMap,mn=new WeakMap,wn={get(i,a,x){let f=r;if(i instanceof IDBTransaction){if(a===e[f(456)])return pn[f(1379)](i);if(e.Pfywo(a,e.NByKf))return i[f(647)+"oreNames"]||ur[f(1379)](i);if(e[f(335)](a,f(525)))return x[f(647)+f(718)][1]?void 0:x["objectSt"+f(653)](x.objectStoreNames[0])}return e[f(876)](ve,i[a])},set(i,a,x){let f=r,u={dfThl:function(h,m){return e[A(997)](h,m)},oBRHn:function(h,m,w){return e[A(1405)](h,m,w)},kvsAI:function(h,m,w){return h(m,w)}};if(f(1353)===f(202)){let h=_0x27e51a[f(988)];u[f(153)](void 0,h)&&(u[f(1466)](_0x2b3c2a,_0x78389b,10),u.oBRHn(_0x211933,_0x562e6f,h));let m=_0xaabab6[f(1472)];m!==void 0&&(u.kvsAI(_0x19176f,_0x170afb,18),u[f(1431)](_0x50c0c3,_0x41b50a,m))}else return i[a]=x,!0},has(i,a){let x=r;return i instanceof IDBTransaction&&(e[x(1169)](a,e[x(456)])||e.zxpUn(a,x(525)))?!0:a in i}},kt=i=>mn[r(1379)](i)}}),ni={};nx(ni,{deleteDB:()=>ux,openDB:()=>fx,unwrap:()=>kt,wrap:()=>ve});function fx(r,e,{blocked:i,upgrade:a,blocking:x,terminated:f}={}){let u=S,h={VqWwX:function(y,_,C,L,T){return y(_,C,L,T)},vknvB:function(y,_){return y(_)},oIPVn:function(y,_){return y(_)},iZVjH:function(y,_){return y!==_},SIYvs:u(1427),gPQsD:u(514),WWUmr:u(1434)+u(1095),aCGum:function(y,_){return y(_)},JnbzE:u(1262)+u(264),siYUN:"blocked"},m=indexedDB.open(r,e),w=h[u(859)](ve,m);return a&&m[u(1514)+u(735)](h[u(1156)],y=>{let _=u;h.VqWwX(a,h[_(306)](ve,m[_(831)]),y[_(485)+"on"],y[_(1474)+"on"],h[_(581)](ve,m["transact"+_(814)]))}),i&&m[u(1514)+u(735)](h[u(204)],()=>i()),w.then(y=>{let _=u;h[_(1154)](h[_(1347)],h.SIYvs)?(this[_(441)]=!0,this[_(540)]()):(f&&y["addEvent"+_(735)](h[_(1083)],()=>f()),x&&y[_(1514)+_(735)](h.WWUmr,()=>x()))}).catch(()=>{}),w}function ux(r,{blocked:e}={}){let i=S,a={ikxrB:function(f,u){return f(u)}},x=indexedDB[i(217)+"tabase"](r);return e&&x[i(1514)+i(735)](i(413),()=>e()),a[i(1182)](ve,x)[i(839)](()=>{})}function $s(r,e){let i=S,a={IWSNV:function(m,w){return m-w},KStIY:i(460),oPErw:function(m,w){return m in w},tfpbD:function(m,w){return m===w},pMasT:"string",tesLr:function(m,w){return m!==w},vZRxx:"veNdf",FwDzS:i(599)};if(!(r instanceof IDBDatabase&&!a[i(1512)](e,r)&&a.tfpbD(typeof e,a[i(288)]))){if(a[i(1501)](a[i(1206)],a[i(563)]))return;{let m=_0x2c1812[i(572)+"g"](0,a[i(847)](4,_0x5a5226[_0x43394d][i(769)])),w=m[i(1288)](_0x6f0a1e[_0x30592c]);_0x5a7b92[i(473)](w)}}if(gn[i(1379)](e))return gn[i(1379)](e);let x=e[i(1198)](/FromIndex$/,""),f=e!==x,u=si[i(136)](x);if(!a[i(1512)](x,(f?IDBIndex:IDBObjectStore)[i(1396)+"e"])||!(u||ri[i(136)](x)))return;let h=async function(m,...w){let y=i,_=this[y(110)+"ion"](m,u?"readwrite":a[y(875)]),C=_.store;return f&&(C=C[y(438)](w[y(1207)]())),(await Promise[y(1257)]([C[x](...w),u&&_[y(266)]]))[0]};return gn[i(868)](e,h),h}var ri,si,gn,dx=ei({"node_modules/idb/build/index.js"(){let r=S,e={ObPLh:r(741)+"3|4",YwDNJ:"put",XgEIH:r(476),xQzrK:r(245),zQZEN:function(x){return x()},wRdUJ:function(x,f){return x(f)},BMaod:r(1034),CRmBm:r(1480)},i=e[r(1027)][r(970)]("|"),a=0;for(;;){switch(i[a++]){case"0":si=[e[r(1187)],e[r(359)],r(913),e[r(158)]];continue;case"1":Zs();continue;case"2":e[r(1411)](Zs);continue;case"3":gn=new Map;continue;case"4":e[r(494)](ax,x=>({...x,get:(f,u,h)=>$s(f,u)||x[r(1379)](f,u,h),has:(f,u)=>!!$s(f,u)||x.has(f,u)}));continue;case"5":ri=[r(1379),"getKey",e.BMaod,r(407)+"ys",e[r(730)]];continue}break}}}),lx={idb:function(r){let e=S,i={muAzN:function(a,x){return a!=x},NwJYV:function(a,x){return a instanceof x},rCoEP:"string",iHPOl:"applicat"+e(334),ijvYK:function(a,x){return a!==x},drQjf:e(320)};r[e(1321)]=Promise[e(1024)]()[e(839)](()=>(dx(),ni)).then(function(a){let x=e;return i[x(784)](i[x(410)],"IeGyC")?a:i[x(838)]("string",typeof _0xe8c4da)&&(i[x(773)](_0x2db00e,_0x503f84)||_0x4f6ecd[x(1464)]&&_0x57f522[x(1464)]instanceof _0x16320c)||i[x(160)]!=typeof _0x133371?"":(_0x48b726[x(1324)](_0x27ad88),i[x(1306)])})}},Qs={};function ye(r){let e=S,i={PzhnA:function(f,u){return f!==u}};var a=Qs[r];if(i[e(542)](void 0,a))return a[e(1321)];var x=Qs[r]={exports:{}};return lx[r](x,x.exports,ye),x[e(1321)]}ye.d=(r,e)=>{let i=A;for(var a in e)ye.o(e,a)&&!ye.o(r,a)&&Object["definePr"+i(126)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;ye.o=(e,i)=>Object[r(1396)+"e"]["hasOwnPr"+r(126)].call(e,i)})(),(()=>{let r=S,e={qfRAO:r(1166)+"d",wOywI:"Module"};ye.r=i=>{let a=r;e[a(1302)]!=typeof Symbol&&Symbol[a(1555)+a(1341)]&&Object[a(1316)+a(126)](i,Symbol[a(1555)+a(1341)],{value:e.wOywI}),Object[a(1316)+a(126)](i,"__esModule",{value:!0})}})();function _n(){let r=["svz3ywS","zv9ZDwnJzxm","yxbWBhK","q2LHDeq","AxnAzxjV","BuLKtNO","yxnqs28","uuPZAwi","x3bPBMC","x2rItMfTzq","Axnby2TdBgu","rLPNy3m","yuX1D1m","seT5v1u","EfrZBxO","CMLLC0nVDw4","vvnkueq","BMvJDa","zMLSDgvY","u1nZsu8","Bwv0Ag9K","uxDirgm","zw5NDgG","vgDpufi","CKXHrxq","ywDLu2HVDW","nJGWodi0s2riwLvo","zNzhEw4","q1n2z04","uM5vugm","CKXlExO","ywXS","DwHgwMC","yMfNAMS","Dgv4Dc9Qyxy","yK9JweS","DxbNCMfKzw4","EsbJBg9Zzwq","tNvZBgO","rLDTBwS","zxHTvg8","CYbPBNn0yw4","mdaWma","CNnVCL9Uyw0","qxbfu3O","Cgu6ia","yw5ZzM9YBvq","yMfSrxzLBNq","Ae5HBLO","zNjHBwvuExa","yxnIu3u","BwLZzq","Cw9Z","ExbL","sevqC1C","qw1eBg4","zM9YrwfJAa","x3vYBa","x2rLyNvN","x2rPC2nVBM4","tLv1rKS","CMvWBgfJzui","y29Uy2f0","CKjPzue","thjKzMm","ywnRDxbfBMq","Aw47y2HHCNm","vwnIy1O","Be5VqMC","tM94DhC","ELbprLi","zMLXAM0","yMfJA3vWigu","yK9Jy20","DwDKtwC","AKXQr0e","Cwzsqu8","twrRChm","rvH5wNi","DvHgsui","AuHqt2W","u3rYyxrLz3K","vvr4BNa","DuDqwwy","DLb6B2u","s0DyCLy","zKPzsK0","tM9zuwS","C2v0u3rVCMe","AK5TCu4","zgvMAw5Luhi","zxj2AwnL","tKzpsw0","veDoB3q","BM5Ly3q","zxHWB3j0CW","D2LSBfjLy28","x2LZtwLUAvq","CgfYC2u","zMfdB1i","B25tDg9Wsw0","ruD5CLi","mJi2mZy2mZzmqNDHvwS","uxDTCeq","ign1CNnVCIa","t2LoBM4","Ef9MCM9UDgK","ywXrAMu","C3PRt3a","CwjHv2C","CKvKBfu","y0TVEfO","sevhuMG","y0TpEKi","qwzAr0O","vgfN","aaaaaaaaaaa","r1bVz0K","zM9Yy2u","DhLWzq","yw5Nzq","u0LzDNm","uNLdsfK","B2nRzxq","uhzlwvG","C2vYDMLJzs0","vuTxDxy","zfrdvw8","EwHYz2q","C0XPC3rLBMu","rLbPDNe","wM51wu8","sxHmD1m","BxLyvNu","DxbSu00","rfv2EMu","Bg93","z2v0sxrLBq","zgvS","y0ziteG","tLbutva","rePXufe","x2DLBMvYyxq","B2nRzxrgywK","z1rPBwvVDxq","q3jyufK","reDcCxK","B3v0sw50zxi","yxPeAgy","yMvNr0G","AvbcqNe","Ew1qB2e","yM9KEq","z2v0","Efnjzg4","y3ruAw1LB3u","u3LlzeW","DLzLB2O","y29TCgXLDgu","EwjMugO","y3DWq0q","C3vJy2vZCW","BKHjCwK","EK9lshO","x3bYB3rVy28","yxnZAwDU","A2fUDxa","ihrPBwvZ","yw1L","CYbWyxjHBxm","ChjVDg90Exa","x2TLEvbHDgG","zw5JB2rPBMC","wLjnCwO","zMPtDvy","Cgf5Bg9Hzeu","sw1cCxe","BfrHD04","ignVzgu6ia","uKPyDgC","y3vYCMvUDeK","Dgv4DfbHEwW","Currzha","zfHAuu8","t1jjCKu","ELfAru4","CLDIyuu","z2v0q3vYC28","su5VBve","CKnlDMG","x3jLy29UBMu","DhDVCMTdAge","Evn2rgu","DMTHsNi","CgjICdi","uLvkvuC","mNW1Fdf8nhW","zKfNAxG","vKLiAg0","vgvgCxe","q09otKvdveK","shner3K","y3vYDMfSDwu","Ec11C2uT","DgvZDa","A3zZquK","zwnVBM5Ly3q","q291BNq","DMvYC2LVBMm","x29UvgLTzw8","BuL3uLu","BKnevMq","zfjNALq","y3r4","rxLNswW","vxLfA1K","Bwu6ia","D1H0sgS","wunctfy","l3DZl3yY","BM93","yxjYyxLIDwy","z0PUBKm","B2Tpvuu","vNHKBgq","AeHbrMq","BMXytxa","BMrLEa","q3LHENm","sMzXwui","zKXJBMe","tuPeC0K","Ahr0Chm6","vxbKyxrLq28","Cg1vA3a","qvfeuNC","B1Lxtfe","x2n1CNnVCK4","yNvMzMvY","uKPAwLi","B0jssg4","ve1Hvgi","tNLfAMS","EKTdB1m","A1r5ELC","z29PBMCGyxC","DMfSDwu","rhjSu0i","BMv3vMvYC2K","ELjhBe8","EMHiqLi","z2H2Dvy","yNL0zxm","v2vIu29JA2u","y291BNq","EeDSruS","AwHovLq","BxnNsuq","lcbTyxGGCMu","zgv2AwnLx2K","ExHVBNe","tvzyuLq","uNPpweG","x2nYzwf0zvm","swTNqxm","C2LWs0e","Aw1LCYbPBIa","y3jLyxrLt2i","AxnrB1nnzxm","BwLUAvbYB2C","sfnyrKy","DxrVuMvJB24","zgvxuwO","BwvY","C2rWD3K","DgvZthi","BM9Uzv9UB24","weXjBfe","q1jHBfa","ywXSq3vYC28","Aw5L","C0vOtuK","yM9L","thHKEMm","B3bLBG","z2vrDwv1zuW","B1bfCNC","y29UBMvJDa","ywrKrxzLBNq","Aw5PDcbrB1m","x3DZ","mtf8nNWXmhW","tuDjr0i","C2v0q3vYC28","Chv0","CxjmtLy","yxGGCMv0CMK","zxjYB3i","sLnptLa","CMfNzvn5BMm","tKLNChm","BgL6ENi","sKPlrNa","vhjevNC","tLvdCxe","vKX2u1C","tfPRDgy","zNjVBuHHC2G","s2nkAKG","Dw5ZAwDUzwq","BM5Ts2O","uKvRvhG","mdaWmdaWmda","qKvusuu","x2LUAxrqCM8","CxDwEfy","BNrfBMrWB2K","qNn1twe","rLHqEhG","vwHZuwK","B25JBg9Zzq","Bw1dtfi","yxv0B21HDgK","ELPUu3O","A3Dot1G","DKves1u","BwHuALq","AejAA1u","ANDlEfq","Dg9tDhjPBMC","C3rYAw5N","ugHlz3G","Bg9Nsurhzw4","AenSB3nLrxy","CgLUz0LUDgu","zxjFDhrS","AgvKtwf4uMu","C2PxvgK","tNfwyvu","shvttNC","D2vqz3u","ysbTDxn0igi","CMvZzxrfBMq","A3DxC0O","tg9Nsuq","yLjAD2y","ENDUy0W","vgnhwuC","D1bsr0i","EMnHv2q","rLveELK","t2TfCgW","x25HDMLNyxq","thrSCeq","Dg9cExrLC0i","qwLLAvu","ywr2yw5Jzq","uLbUt0G","x2HHBMrSzva","AuDfCgW","tuXkwLi","EgvrB3K","yxbWBgLJyxq","B0HhD3G","zM1xELi","Eu9zDwW","zxjFCw9Z","C3rVCcbPBw0","tNDlt1q","zw5XDwv1zq","tMfTzq","D3jPDgvvAw4","v1nbrK4","rhzUsKi","ruvkuvO","B1nAtMK","Aw5KzxGGB3u","ihrYEsbYzwm","DhjHBNnHy3q","v0rMyM4","rxzLBNq","BMzjyNm","y2XVC2uSihC","yNvMzMvYzwq","zw5fDMvUDa","CK1PtKm","swz4ufa","BeTiCuy","sxDvDfy","tg9NsurozxC","Dw50","vKHdCui","ruLIvMu","EgnuC2K","B3bLCNr5","x2LZv29YA2u","vhbZtgS","AxnszwfKEq","ChbzsvO","y01dDM8","AwDbCfC","Bvn5v1q","t0vYthO","reLZzuu","Aw5JBhvKzxm","CNj2vKW","D05gy24","zfPlExy","y29UBMvJDfm","tufyx1jfvfi","vMPcvwC","A0DuBgK","y3jLyxrLt3a","BMrWB2LUDfq","wwHZDuW","qMP4Bxe","x2HHBMrSzvi","uMrosLe","sffMshu","z1vfq1a","vLf6u1i","zgzuAgW","wKnusMy","Bg9NsurozxC","B25mAw5L","vw5Oyw5KBgu","Eff6CKS","x2vUzhbVAw4","CKnVrva","qLjvBeW","zgf0yq","CvbKuLy","BMDLza","Aw5KzxHpzG","y0nlwvO","CMvJzxzPzwq","DwzPv0O","vuHpDNG","y3jLyxrLrxi","ywWGy3vYC28","wwrmEfm","x21LC3nHz2u","zxH0zw5ZAw8","C2v0sxrLBq","EePvwwC","zgLZywjSzue","twr4Cwy","x3nVy2TLDa","svzdy04","DxrMofDYAxq","v3vkz04","vfvXuum","A0rivgO","CMvZzxruCMK","qM5zuwi","nhWW","EKTwDfy","s3bhvfG","ywXPzcb1CMW","u2vXsuq","svHxz0i","Eu1Mvhq","zKHbC0W","u2PPsuC","EMPZtNm","yw92sKe","BMCGzMfPBgu","q1j4yxq","vuDQAhC","Aw9UvgLTzw8","sxPyD2m","zLvHDNK","C2Lzvu4","DhjPzxm","zMX1C2HfEha","DvLKvLu","CNrjy2O","DgvmB2Djre4","mteXnZyXndzsvgzVqMu","zxjYtxnN","v3vREMS","BMnLq2XVC2u","BMvrzxO","vwP0sfm","DurVAuO","zgvSzxrLrge","AwXK","rgjTy1y","twvZC2fNzuu","shD0v0y","ruHLtfu","r0niDw8","sgvQtwe","vejWwLy","BuTSrxu","uw15seG","B3vNtgG","C3nHz2vfDMu","yw9uB1e","AxnbCNjHEq","zMLSzw5HBwu","q09oveLovuu","B25nzxnZywC","EuTmvgO","EeTLCvu","yxrnzNq","BLftrhq","quPoz2W","CurRrva","r2rOt3O","BvHeDxy","CK1Org4","tMr3BKu","y2XLyxi","DMLJzuLeig8","rhP2Eei","ywvgwgK","x2LZtwLUAvC","q3bswuK","tLj5rfa","EuPsAwu","ALr1v0i","uLvLD2W","v3zsDvq","B3PgvMO","C3vIyxjYyxK","AK5wr0i","BfL4zhC","C3LLvhO","vNHqEwq","DefLv3e","ANrOAfm","zwvKzwq","rw9ABK0","zg9Uzq","C0nNsKm","y3jLyxrLuMu","zxDPB2S","CgLUz1rPBwu","x2nSzwfYugK","DxbKyxrLq3u","Dxrjza","ChbL","EfvZzuvUDG","x29Uq2XVC2u","ywDLrxzLBNq","C1ziCeC","rxfTCLC","yxnL","zvvYBa","z01WqvO","AM9PBG","nZmZnJyXmhnitgr1Aq","DMvY","y09Wzw4","Ae1LC3nHz2u","Ce1HC1q","y3bUr20","zLPsugm","C1PHuva","EMLLt0i","A01Iqxu","vhHzvuC","x2fKzfDZtgK","ywDL","sLHlA2O","z2T4Duy","qNruCem","uKzgu3i","ALzQDva","EfPYywC","rgjXy1u","CgLUz19VBMm","BML0AwfSAxO","DMTUDKi","wendt1C","qMztuMG","y1zwB1y","wLvVq0O","v2PhB04","q3HfB2O","CuvVC1K","zM5yyNu","sMfeEwG","zxjYtM8","u3zZAfC","Aefkzw8","vfLmBw8","Bhn2yuS","CM92AwrLihy","mhW3FdH8mNW","B2fK","sgnNze8","C2vUzf9Hy2S","zeTMvey","qKrzqvO","y3vYCMvUDeu","t2jIrNa","CgjnAwu","zwnLzuy","x0rctMfTzq","uuDHq2i","Aw9Ul2PZB24","ENHWvw4","sMfvA3C","BfrPBwvVDxq","z2vY","o2nOyxjZzxq","tfflC0K","DeLUDgvYy2u","x3jLBw92zvC","rMLJqxq","vgn0u1a","zMLUza","tMjrB0S","AvHdtvi","ruvnAuW","weP5C1C","BwLUzW","vgLTzw91Da","DcbSAw1PDa","Au9isu8","z2DYDNq","De1HBMfNzxi","ihrVihjLDhi","B3nLrxzLBNq","B2fRwKm","wgDfsuG","y0j1tK8","z2vtEw5J","sg9hyxa","Dw5RBM93BIa","z2fxAhy","qvDSy1q","D3v3Bva","CMvHzfvjBNq","t25zvxe","r0TMzLi","CvHhDg0","CMj5sLa","DejtEMe","CgLUz0XVC3m","qvb3z28","whbXEui","sgH2uuq","swLZD0q","yxnJCMLWDa","ENHqzvC","CNzHBa","CgLUz09Uy2u","zxmGCMvHy2G","weT6B04","zgDAr1m","CM9AA1m","rNjVBNrPzxi","DhjPBq","ywnR","yMLUza","s3rjsxu","zxfAueO","qw16zvy","t3bLBKv2zw4","Dgvvtxe","x3bPBMDmB3m","sM93AK0","sgzKDhG","C3vfAuW","ALbUz20","B0jIqwO","jMPZy2fSBgi","zgHNwMC","quXm","DKrlwxa","CMv0CNLdB3u","yMLUyxj5","z2v0qwXSs2u","rMXot2S","AwXLtMfTzq","zhjrAMy","s3vLwK0","q3vZDg9Trxi","yMXVy2TLza","AwDHDg9Yt24","ywnOzwq","v2LUzg93","zNvUy3rPB24","u1jnrfm","zw50tgLZDgu","z1nwufa","y2XVC2veqG","su1rA1C","tgDhzuK","zfLzCfa","yxKSihrYEsa","DxnLCKLW","Cw5dqKq","Cw9Zx18","yw1Lu3bHy2u","DfP1qLa","senHuNq","CNnVCKzPBgu","zeHQDeC","Dg9VigXHCMC","BgvY","vu5tu0K","u0PyB3G","Aw5KzxG","zfjfENO","s3z0seS","x2LZsw5PDa","rwP1EhC","BgvvEKi","q0Xpu0LorW","yKjZAu8","u1jlvwy","AfHAqui","y2Xes1e","tMDvqMG","AwLSDMK","z2vywLO","Dgzbvxe","y3nmy2u","A3vKu20","svzpBge","tejQqvq","EMXvshy","x3nLCuLK","yw1LoIa","CMvHzg9UBhK","ANPltLe","A0TcA1C","wMDwvKe","sfrtzMi","mhWYFdr8mxW","D1DKsMS","q0X3C0W","ywrKt25L","BNPtDKy","B05Uwxi","Ce1Zv0u","Aw5Lza","ChvZAa","v2rQzLy","lcbOB3n0BMe","ywrK","yKj0z0u","r1jzAvm","BxnN","r1b6t2q","wMH3Dgi","AhvVBNq","te5qCwS","ywjVCNq","B2XKvMvYC2K","rxzJuu4","B25szwnLAxy","igzPzwXKoIa","D1nsuMS","vwvkEwi","AgvHzgvYCW","x3bYzwzPEa","x29UrxjYB3i","D1jKvuO","mNWXFdr8m3W","veTfDg0","tNjvEvO","BMnJDMK","DgLhAKq","zw5KCg9PBNq","DwLtsem","uNzOz3q","shvnveW","ufP4Due","rxbfAK4","sfHJCe0","x3DHAxq","yw51Ce1LC3m","x19LC01Vzhu","vKjWs1y","y3nVuMi","uLjpuG","thbTwxe","y2XVC2u","rxb1BuG","vgv3sMi","ugDyy20","Cgf5Bg9Hzfq","vhPZtuK","q3vZDg9Tq2W","yM5gtLC","s01YEwK","reHozwy","DhfRyM4","C3rVCMu","BMPot2G","CMfUzg9T","zgrjrcWGzgu","AwXLx25HBwu","qwfcrM0","Dg9Y","Ahj4z2G","qw1VDw50","wfndrfm","rvvnywy","z2v0q3vYCMu","uujXweK","rvrzvvi","zxf1ywXZ","x2nVBM5Ly3q","zcWG","uhPOBKe","EhjYrhK","wM55Bw0","x3bHDgHlzxK","C1nnrgq","zMXkEKK","sgzHzNC","x2n1CNnVCK0","ihn1y2nLC3m","x2XPC3rLBMu","zg9XrLC","igXHCMDLCIa","zfPHv0C","ohW1Fdj8mxW","AxPpEvy","z2XKtMi","uNngr2q","rLDt","y3vYC29Yx2y","vLrxDuK","D3jPDgu","rNDeELm","C2vYDMvYvgK","BMXyCLO","BxvyqLe","zwHosLy","ywrKq291BNq","q29UzMLN","ve10u0C","zu1ysw8","C3vIC3rYAw4","tLD5Dva","rKLoz2m","nduYmZr3AwPMCKG","tKXlzvO","BMDuAw1LCG","r2PNu00","CgfwsNy","y0TeBgq","B0LqvM4","B3nLza","x2zVCM1HDeu","r3PLs1e","BNrksxG","zunqzxy","uu1WC1i","BgLZDgvUtMu","B2zM","Dg9mB3DLCKm","vKfQsvi","DKrtu2m","EgfXv1G","txLdDeW","Bg9IywXty28","CNbPrKq","whrQALm","AMTLyuu","uxjcr3K","rLjptLrjrvi","Aw50zwDLCIa","B25Uzwn0Aw4","CYbHBhjLywq","ugnVvxC","vM1jB3a","A2v5CW","C29Tzq","twvcAfG","Dhr3Awq","B2zMC2v0","CNjVCK1LC3m","zNjVBNrPzxi","y2HLy2Tszwe","CuvZzfG","ywvRyNK","thvrChi","y2XLyxjtDg8","zgjhD3e","ugPvzMW","zNjVBunOyxi","mtm2EfrsvwHR","rK52EgS","zLLzCwO","BIWGAg9ZDg4","C2XPy2u","CgfNuei","vw5PBxbSzw0","ihrPBwvVDxq","zMLN","zw5JB2rLrNi","zwDis3i","rfbjtKi","Bhn5u1i","AevYCM9Yrxy","BezSDxnO","zNnYsKy","t0zvAeK","uMvHzcbWyxm","q29Kzq","txnlD0O","yK9ZBu0","CMTizM4","CMvJB25Uzwm","BNruCMLLC0m","DfzkEKG","yLDPAKS","B2jQzwn0u3q","DvnlBxG","rvjst1i","C3rLBMvYCW","sxL3zwK","wLnLwfK","B3jL","z2vjBMzVu3K","t1bftL9fuLi","wwD2wvK","zcWGDw5RBM8","BMvY","r1v1EMK","vKDTyvy","zxq9DxrMltG","t1PWugW","qu9fwLm","vw9xCM8","twLZC2LUzYa","x29UugfNzu4","wfrJqMu","u0zdALa","EfjlwLG","BK5crwW","B3bLCNr5tMe","B25SAw5L","zhf2wK0","DhjPzxmGCMu","ExPMAMS","sKHmy3G","D0fmsLy","tgncDKe","yunJsxC","uM1mq2K","DhbizwfKzxi","y29UDgv4Da","DcbVzIbYyw4","sNnlEvO","CMvZzxrdB3u","vK1yweO","uhH0tKC","zxfqruS","tg5xCLC","z3HpvMK","rxjYB3jdB2q","Ce9lzLy","x2LUDgvYDMe","C0Xf","BMfTzq","Dg9oDw1Izxi","CMvXDwLYzwq","BgLUzw5V","Du5uy3G","CMvHzhLtDge","zsbHihn0CMK","EuzcBuq","y3PRtgG","EvjLy29UBMu","C1PzB0S","shD4Beu","DgfYz2v0","Cg9PBNrdB24","z0HLvNu","x2LUAxq","BwvZC2fNztO","Ehr6AKK","C2LHze8","uhjPBwfYEuS","BgjTzg8","B2nhEuy","x29UtwvZC2e","B3jLtMfTzxm","uxvLDwu","zu5SsLi","C2vUDa","AwDTveK","zMD2yKu","BwvZC2fNzv8","y2HnyxHuCMK","z2z3DgO","twntD1q","AMftD3u","t1bftG","q1jTqM0","rgDyuxO","BwvZ","ChrVCG","s2XbEMC","tgLZDgvUzxi","x2rYB3bhBg8","sgjuqwq","ChjVDg9JB2W","rg5fC1O","B25LCNjVCG","mNWXFdv8mhW","Bwf4tg9ZC0m","qNvuCvK","r3bWCNK","u3jhwK4","BvzuBvG","rLzirLq","CKLqALO","wMrAtNa","x3jLywr5q2W","vMXqteW","veXLB2q","z2vNuMO","wKzRBKe","tKfusvzfx0u","tMfru0y","D2TsBhi","vhj4BLy","D2vpB3G","igzHAwWSig0","DeDgzhi","tNrlwuO","zuv6uem","x29Ut3bLBG","DMvUDa","CMvTB3zLq2G","ugHPD2C","CMvLCMG","BgvUz3rO","zNjVBuj5Dgu","tvbNDgy","sLLtrKi","tNDkwvy","mhW1Fdf8nhW","AKrlCgK","B2HJENy","uufUrxK","wwj1B2G","yw5Nu2i","Dvf0Dfu","Dg9cExrLC0W","AuHxwhe","zw50","AwP2wuS","BuTXBxG","x2LZtM9Kzq","CLr0ywS","sKrPzeq","B1fSsuy","zMzMzG","BxjxrMy","u0zgDg4","zgLZCgf0y2G","zv90Aw1LB3u","AfHSy2W","yMTYEue","A1n0yxr1C0m","id4G","x3fVC0rc","uvHQs1K","CNjjq1e","vhHcy08","zxjFBxnNAwq","uvDwv2G","C2v0y3vYC28","uMvJB25Uzwm","zwXzrKm","mhW2Fdr8mta","B3vUDa","BerUufe","BvDeDvC","C0jf","qNjPzgDL","Aw9U","CM1QyvC","CgXLyxnLiha","C3rYAw5NAwy","q0Xpu0ve","su9WtNq","y1jADgq","x1fVu01HBMe","ywXSB2nvBNm","AuXTvMG","r0zhqxq","wgvUAfu","x2LUAxrhBg8","C2DPza","BKfzvKu","yNL0zu9MzNm","CMvUDevUzha","CMvZDwX0","B25VCgvU","z2v0t3DUuhi","z0DtAwC","BMCGB3iGyw4","x2nSzwfYvgK","t2jQzwn0","BxvbEK4","DgHLBG","qNPiChO","sKDHufq","DgLTzw91DcW","tunqAvq","zMzLCG","B25pCgvU","Cfj5zuy","svDttLy","r3nxwKW","CgvYC2LZDgu","zgL2z2q","BMv4DcGPigm","BMnVzgLUzW","Dev2zw50","C0nVDw50zxi","thz6re0","wNrJAuO","y01usuq","reHmthy","yunhDw0","qwjVCNrfCNi","y2fSBa","CM9YrxzLBNq","weLrCw4","y3jLyxrLrwW","Ec1TC2CTy3u","D3nZoI8V","B2LUDfjLywm","C2v0","tw9yC1y","De9wALC","CvjIEKW","q1bKExq","r3ntsxq","yvDhzKq","s1n0svK","svHfwhK","D2vI","CMvJzwL2zwq","BgPMEg0","EMfNEwK","sKDvAhC","DK5py0W","tePotvu","AxnrB1nby2S","CM92AwrLige","zw1PDa","BLPWrfO","EvPSwKW","y3vYC29YlNm","D1beDxq","CM5xvLO","u2joqLe","sxbTD0S","zgvIDwC","tg9JAW","sfbgz0i","Ahr0Ca","y3jLyxrLtwu","vwLzDuq","y29UC3rYDwm","txLsvwe","EuzizgK","zxjFywnRx20","x2n1CNnVCKy","vKjmDLi","x2HHBMrSzu8","Dwvuy2u","sgPVD3q","x2rLC3rYB3K","ALzgBLK","wuXvCNe","ruTlsKK","zgvSzxrL","Dvz3BMi","ntnWy05lD0m","y1f4y08","B25TzxnZywC","qMfvwMW","tLfOrKy","yMn4suu","zw1LBNq","re1mu3O","B25dBg9Zzq","nNWYFdm","rujJrvG","BeHHBMrSzxi","zeXMy08","shfKuxe","wujlr2e","DMXMsMO","Cw5Arui","B094uei","C0DfCfy","zgrlt2W","x3DZsw5ZDge","zcbLCNjVCI4","sLnJsue","Dhj1y3rVCIa","DgLTzw91Da","mZb3BxnIDfe","zNjVBujPDhm","Bg9N","zvHwr1q","BwvKAwf0zwW","z0j1zge","CM5tBKO","C2fNzq","AgLNAa","q2jfuKG","uK1HrgW","twr4rLO","B3bLBIa","veXIrLu","zvvZt1K","wxfJteu","zMzmAw5L","Efrurw52","y29UDgLUDwu","y3vYC29Y","y2HnyxHdB3u","qwPqCKS","yNL0zuXLBMC","wuLiz3q","x2rPC3bHDgm","Bwf4uMv0CMK","CgfNzwHPzgu","BgLUzq","D3Djuwu","s1DStK8","C3bSAxq","DgLLCKPtt04","BwvZC2fNzq","rvLzEwe","rgHou1u","r09mqKu","twjJsK0","BNvTyMvY","AgvHzgvY","D2f4DwG","q3Lbr0y","y3jLyxrLq2W","y2vZC0HHBMq","sfHzA0e","sfH6u08","veT6sLu","uLnSAeC","BKnrz3y","A2v5","y2HHCKnVzgu","B3jpBMXPBMu","D2DgzeW","A01kt3G","qNLnr1K","zK5nv0i","FdL8n3WZ","BNrLCG","BvDZExu","zxjFAxnFywm","rwHhq3K","wLrNvLm","tMXsDei","AxPiz2y","r1rvEwq","tg1mvvy","rgnQu3u","Ae9Wzw5fDMu","mJaXnJG1Cuziqu5u","y2f0y2G","yxv0BW","zxrcCha","zwHguee","AxnmB25N","DNjzu0i","yMLJveq","qvLzEgq","y29SBM8","Ec1TC2CTCw8","CKz5tgW","tunHAgy","tKHuu2O","sMvPq3O","DgHHBIbSB2m","wMnlELC","CMvZB2X2zq","zgfkCKS","AvLeue8","t2jqtgG","uunrreK","rKjKu08","rLLMA0y","ywfREhm","BxLVD00","uKfAvLC","z2v0qwXS","tMruCuG","ywXty29Wzq","z3LQrxK","vMf5B20","DeDIvfK","DMfS","EvfUD0q","zwvvEKC","B25ozxr3B3i","ChjzDNm","z3zhte8","vKPsr2C","BuPwwei","D0rzqxe","C3vYqxe","ve9ZDw4","yvHMqLq","Bw1Yzw0","DfnyDfq","BwfUDwfSihi","tMnSBvO","B2nRzxrtDwm","ywnRx2nVzgu","C3bSAwnL","sfLLC0C","zxjHDg9Y","zw50zwqGDhK","yxKSig5LDhC","ALPqqKK","y3vYC29Yx24","zgvJB2rLzey","zfDVCMTLCKC","s3LsseC","rgvKAwnHDgu","Aw92zMO","v0XHz1C","rgPyyLO","Cg9W","yw5Hz2vY","rKjrD1i","q0jmEgO","rxLtB3u","vvnTugu","zufJAW","wKftB3u","y29UBMvJDeu","u1bzz0O","Dw5JCwO","z1brC0q","yxrLq291BNq","DMfSDwvZ","CMvTB3zLrxy","AK5Xr3G","Aw5N","y29UBMvJDgK","qMHvEeK","uhbQzvK","DNfHqKK","BNrbBMrvCgq","x29WDgLVBNm","AgfUz2u","B25tDgfYDfi","zxLdBhm","z2v0u3rVCMe","DvnIz3C","r0TJCgi","vvjwD1O","y1btuNC","rNP2vKO","C2vUza","s0zqq1q","x0vysvnu","thDWtMu","sfjKzNq","yMLUyxj5vhK","t053A3e","yurwtvu","zxrxB3jRq2G","DxjS","rvDWBui","t1DWv3K","q3juBve","x2DLDeLUDgu","x2jPBMfYEvq","D21zrLK","zxDkDMW","Bhm6ia","AwToEg4","C2vYDMLJzq","uMHAzw4","s0PtyLq","x21PBMLoyxy","B3jRig9MzMW","suvtx0vsuK8","DuDAshe","vMnisLi","EwrNBxq","C1HPCxK","DenOCMi","wwrjs3O","DfL1BLm","wLjABK4","CMfTugfYyw0","CMvQzwn0","y29Kzq","rgvLB0O","BgLTAxq","tMD0v2C","A1DKywi","B3bLBKrc","zwHStei","vKfJz3q","DwLWuha","uK1rDwm","EKP2z2S","nda3mteZB3fQD2jo","x2LZqNjVD3m","Cgzbzgy","tuvtu0fhrv8","AvPwAKG","CxbtEwm","sM5IEKu","zwn0","y2uGBM90igK","zNDZxZeUmc4","ELzsD3C","AxnFywnR","CMfTzq","x3nLBMrby2S","ywDLsgLKzq","ywzL","Dw5KzwzPBMu","C0Ljr0O","wMnvtha","zwLJthK","Avrez2G","zMvY","ywXSzwqGBxu","yNLL","C1HNveG","zhfWwfy","zgLLvMW","Cgf5Bg9Hza","BMDpBKS","t2PgAKO","qKXyAuG","rfnWzvG","AwT4CKi","BLnXyNa","D1LdvMq","yxrHlcbKyxq","Cg93","wxDetKO","icSG","AwXSihvZzsa","Cg9PBNrbBMq","D2fZq2XLyw4","Dg9cExrLCW","z2LrDge","nKv6DM1vCW","qw5xyMW","vLbjvg4","BKXPBMu","CMvWBgfJzq","zw5HyMXLqxu","AefJA01LC3m","DNnjy00","y29UBMvJDca","zw5HyMXLuw8","ChfYt1G","CMvHC29U","DLPsEhG","C2HPzNq","zKLosey","x3bPBMDqB24","CgfNzxnOB3C","s2Dus3C","uhzpCM8","B3bnwfi","B3HtuLy","EefpEMq","CM92AwrLihC","Aufcuwq","s3H1sKi","u3bHrKq","rfLVAw0","DeLK","B0vyrxe","z2u6ia","zNjVBu51Bwi","BuPszMe"];return _n=function(){return r},_n()}var J={};(()=>{let r=S,e={MGIGB:function(s,t){return s+t},URVwZ:function(s,t,n,o){return s(t,n,o)},Noxtw:function(s,t){return s+t},CbERH:r(1179),eyCls:"mUfQe",pOjMm:function(s,t){return s+t},DcjSu:function(s,t){return s*t},LmLUV:function(s,t){return s+t},pfAdf:function(s,t){return s(t)},pagPB:function(s,t,n){return s(t,n)},Znymm:function(s,t,n){return s(t,n)},wkRlr:function(s,t){return s(t)},TrDVw:"0000",fgvbE:function(s,t){return s(t)},FicAt:r(1538)+"00000000"+r(1538)+r(1538),ETYUR:function(s,t){return s||t},CRalP:function(s,t){return s<t},divgd:function(s,t){return s!==t},iGEpl:r(243),VlPLL:r(675),igApW:function(s,t){return s-t},ZUoCJ:function(s,t){return s<t},kvcnf:function(s,t){return s-t},LuQpr:function(s,t){return s===t},NUuFK:function(s,t){return s-t},bcxIE:function(s,t){return s!==t},oOxPB:r(1462),NclmZ:function(s,t){return s!==t},dREzz:function(s,t,n){return s(t,n)},DYoim:function(s,t,n){return s(t,n)},DbmcV:function(s,t){return s!==t},KwlsY:r(365),NyEjk:r(436),tYunS:function(s,t,n){return s(t,n)},qbaWg:function(s,t){return s(t)},vPzoe:function(s,t,n){return s(t,n)},pqrOX:function(s,t,n){return s(t,n)},ozFVj:function(s,t){return s&t},qMlmZ:function(s,t){return s===t},fjSuV:r(665)+r(697)+" field: "+r(1472),xSIdn:function(s){return s()},KcJjH:function(s,t){return s==t},SbNBQ:function(s,t){return s>t},UcbcZ:function(s,t,n,o){return s(t,n,o)},qEsdX:function(s,t){return s+t},uSbgw:function(s,t){return s+t},ihNVT:function(s,t){return s===t},etBpp:r(787),jNVGB:function(s,t,n){return s(t,n)},CiatD:"bOsmM",LQKsI:function(s,t,n){return s(t,n)},TKYEw:function(s,t){return s!==t},DSpeX:function(s,t){return s===t},YIfUO:function(s,t,n){return s(t,n)},IVCcN:function(s,t,n){return s(t,n)},ZCTJf:function(s,t,n){return s(t,n)},cKOzB:function(s){return s()},qRbzL:function(s,t){return s(t)},mVTmX:function(s,t){return s!==t},jwKxT:function(s,t,n){return s(t,n)},vUKwj:function(s,t,n){return s(t,n)},Hfafw:function(s,t){return s!==t},faCoR:function(s,t,n){return s(t,n)},lTawN:function(s,t){return s!==t},zExUm:function(s,t,n){return s(t,n)},QwmpD:function(s,t,n){return s(t,n)},ahhey:function(s,t,n){return s(t,n)},CRxat:function(s,t){return s===t},deWQj:r(447),VGmaV:function(s,t,n){return s(t,n)},Lrdfc:function(s,t,n){return s(t,n)},rrvVL:function(s,t){return s(t)},xeQoy:function(s,t){return s(t)},fnXbu:function(s,t,n){return s(t,n)},WSAFN:function(s,t){return s(t)},ByMGY:function(s,t,n){return s(t,n)},wWdJk:function(s,t){return s(t)},VHCqB:function(s,t){return s&t},Zhwtb:function(s,t){return s===t},ZdZNp:"Missing "+r(697)+r(488)+"LogID",RUewl:r(665)+r(697)+r(488)+r(1123),YqcLE:"Missing "+r(697)+r(488)+"method",RmLCi:function(s,t){return s&t},cPSRw:function(s,t){return s(t)},qrLNV:function(s,t,n){return s(t,n)},ntJIx:function(s,t){return s+t},moFhl:r(627)+r(1061)+r(1271),xKeqU:function(s,t){return s>>t},TcGYG:function(s,t){return s===t},NuCCO:function(s,t){return s>t},ONwkq:"Skip past limit",XJysW:function(s,t){return s+t},xJUYg:function(s,t){return s!==t},zPOFR:r(124),NnOcg:r(1242),GsSIt:function(s,t){return s>=t},XLIlQ:function(s,t){return s+t},sCgJC:function(s,t){return s>t},CxEoj:function(s,t){return s>t},fiqjm:"Read pas"+r(352),HwtWF:r(363)+r(1205),RdNJQ:r(1449),RSlhG:function(s,t){return s+t},UeJyb:"FDOIh",rFyLl:function(s,t,n){return s(t,n)},daJrK:function(s,t){return s(t)},uXFIB:function(s,t,n){return s(t,n)},MyCtL:function(s,t){return s<t},WDfbn:function(s,t){return s===t},CSvgN:function(s,t){return s===t},CyAGF:function(s,t){return s>=t},JfqYB:function(s,t){return s&t},GFGAt:function(s,t){return s<<t},jTuWB:function(s,t){return s&t},izHgf:function(s,t){return s&t},MVXRT:function(s,t){return s(t)},KpGTX:function(s,t){return s>=t},tZuBP:function(s,t){return s+t},fHAsL:function(s,t){return s+t},uGPYf:function(s,t){return s+t},ZFknA:function(s,t){return s|t},ZASou:function(s,t){return s<<t},MoXsV:function(s,t){return s<<t},cMCvo:function(s,t){return s&t},RJZZR:function(s,t){return s<=t},NdTqH:function(s,t){return s===t},NLKeZ:r(376),TKzJU:function(s,t){return s(t)},SFCjP:function(s,t){return s==t},kwWsJ:function(s,t){return s+t},xzscd:function(s,t){return s+t},elYFC:function(s,t){return s+t},IpmwK:function(s,t){return s+t},HuSNw:function(s,t){return s&t},vVeoj:function(s,t){return s<<t},RhZen:function(s,t){return s<<t},dKfTF:function(s,t){return s|t},nNBEl:function(s,t){return s|t},JScIA:function(s,t){return s&t},iHWXq:function(s,t){return s<<t},OWpWy:function(s,t,n){return s(t,n)},YdLxS:function(s,t){return s>>t},UKWuv:function(s,t){return s&t},VcHJR:function(s,t){return s|t},YBKGa:function(s,t){return s<<t},DHNef:function(s,t){return s+t},kDHTj:function(s,t){return s|t},rLaEt:function(s,t){return s<<t},LJNMU:function(s,t){return s+t},fINHF:r(1051),NwKOT:function(s,t){return s>=t},usiCy:function(s,t){return s<t},HKyWU:function(s,t){return s<t},giQta:function(s,t,n){return s(t,n)},NIgps:function(s,t){return s<t},LZktf:function(s,t){return s<t},pbMie:function(s,t){return s-t},FAiXj:r(302),xRKZX:function(s,t){return s&t},rpiFD:function(s,t){return s<t},csLce:function(s,t){return s>>t},HwxlE:function(s,t){return s|t},wYCVd:function(s,t){return s>>t},RMaDl:function(s,t){return s|t},LtlpD:function(s,t){return s&t},xHrRb:function(s,t){return s&t},yhrgd:function(s,t){return s>>t},TeFqq:function(s,t){return s|t},MLJZR:function(s,t,n){return s(t,n)},wuwmP:function(s,t){return s<t},csoRb:function(s,t,n){return s(t,n)},qjNJf:function(s,t){return s(t)},PvKYX:function(s,t){return s<<t},ewiok:r(1510),BETIE:function(s,t){return s!==t},JowjM:r(239),nlXrZ:function(s,t){return s|t},jzKNQ:function(s,t){return s&t},HejMa:function(s,t){return s>>>t},TrxnV:function(s,t){return s+t},qnZEB:function(s,t){return s|t},zlUHv:function(s,t){return s<<t},Thcml:r(242),IkgAs:r(705),wgFdL:function(s,t){return s(t)},SRKUf:function(s,t){return s&t},syeTz:function(s,t){return s<<t},angSb:function(s,t){return s&t},fvGyn:function(s,t){return s&t},FVHFT:function(s,t){return s<<t},FUDzY:"ekNpn",EoZnM:function(s,t){return s&t},PgXcm:function(s,t){return s&t},sPLyB:function(s,t){return s(t)},NqVaU:function(s,t){return s&t},gvGLO:function(s,t){return s&t},dZKyv:function(s,t){return s&t},SPYgJ:function(s,t){return s(t)},YLUrq:r(440),ovgpq:function(s,t){return s&t},jhJtZ:function(s,t){return s<<t},PjUfl:function(s,t){return s>>>t},VMXXJ:function(s,t){return s>>>t},oHGwx:function(s,t){return s===t},hObYE:function(s,t,n){return s(t,n)},AnWbl:function(s,t){return s+t},blTLd:function(s,t){return s&t},ybfPj:function(s,t){return s+t},ZgVVA:function(s,t){return s>>>t},REkTx:function(s,t){return s+t},Vxdld:function(s,t){return s>>>t},DeeoJ:function(s,t){return s+t},UiYuD:function(s,t){return s!==t},uGZHq:function(s,t){return s>>>t},TOsun:function(s,t){return s!==t},BDYAZ:function(s,t){return s|t},eceeF:function(s,t){return s&t},VAcgt:function(s,t){return s|t},FWmmk:function(s,t){return s&t},YWHoj:function(s,t){return s>>>t},ImBqq:function(s,t){return s+t},YgvYY:function(s,t){return s|t},FBQwR:function(s,t){return s>>>t},APwgo:function(s,t){return s!==t},HXYkA:function(s,t){return s===t},QAnEy:function(s,t){return s*t},ddKOl:function(s,t){return s>t},azDhf:r(301),dqpXV:function(s,t){return s<<t},fmWzR:function(s,t){return s<<t},AjPrK:function(s,t){return s|t},BtTpC:function(s,t){return s<<t},Vayom:r(467),GUuzi:function(s,t){return s|t},FzvVJ:function(s,t){return s|t},HXcpM:function(s,t){return s<<t},uVwnb:function(s,t){return s<<t},prYvs:function(s,t){return s|t},JaUkw:function(s,t){return s|t},gxbUq:function(s,t){return s|t},begGH:"cYcmi",mIdNz:r(125),GKcpb:function(s,t){return s>>>t},DIseE:function(s,t){return s|t},uDoiJ:function(s,t){return s|t},qEosY:function(s,t){return s<<t},lizzr:function(s,t){return s<<t},UhsQi:function(s,t){return s>>>t},kTyzW:function(s,t){return s|t},EpEjN:function(s,t){return s|t},uhFZg:function(s,t){return s<<t},kanup:"nXkMo",EUMaf:function(s,t){return s&t},ORIrE:function(s,t){return s>>>t},EySou:function(s,t){return s&t},TFlIQ:function(s,t){return s(t)},lbmdo:function(s,t){return s|t},MeBhX:function(s,t){return s%t},siadO:function(s,t){return s>>>t},vkaJr:function(s,t){return s*t},IfxPP:function(s,t){return s===t},sjWTi:function(s,t){return s===t},xLovA:function(s,t){return s>>>t},dRgjT:function(s,t){return s>>>t},sVHpG:function(s,t){return s+t},MdxFZ:function(s,t){return s>>>t},KkXao:function(s,t){return s+t},tOVjW:function(s,t){return s<<t},mmrem:function(s,t){return s|t},mhTjT:function(s,t){return s<<t},gyjEy:function(s,t){return s(t)},UHOvx:function(s){return s()},CBepp:"yAoXv",HCaRt:r(1041),fNMWB:function(s,t){return s===t},NaQSF:function(s,t){return s>>>t},hHAFd:function(s,t){return s===t},iilvi:function(s,t){return s+t},kwNOX:r(1001),daLhQ:function(s,t){return s|t},gegRj:function(s,t){return s|t},gGSig:function(s,t){return s&t},RUDWc:function(s,t){return s>>>t},qwVxV:function(s,t){return s!==t},EWyCq:"AGKiQ",nzSvF:function(s,t){return s>>>t},dYYpP:function(s,t){return s&t},hamIT:function(s,t){return s>>>t},FPivq:function(s,t){return s&t},qTRQU:function(s,t){return s>>>t},oSZNi:function(s,t){return s>>>t},zZnSz:function(s,t){return s&t},mJVXB:"3|5|2|1|"+r(187),RMQuc:"MESSAGE_ERROR",FZgcs:r(141)+r(1128)+"R",RGrdc:r(755)+r(512),Ybuoh:r(655)+"OR",jVFnY:r(1426)+"NG_ERROR",dXZQO:r(774)+r(924),fJYJM:function(s,t){return s>=t},JJKFp:function(s,t){return s===t},KDTPp:r(168),gldNb:r(1544),dHjtG:r(1523),avsDO:"zJlQo",dhgZg:r(987),yrtSo:"nAYVE",rbyJP:function(s,t){return s-t},uNTcx:function(s,t){return s===t},JeiCz:function(s,t){return s>t},KJSbT:function(s,t){return s instanceof t},SFFtn:r(157)+r(936),myowM:function(s,t){return s===t},GzeKQ:function(s,t){return s===t},SmaYr:function(s,t){return s===t},mrWFf:function(s,t,n){return s(t,n)},fZRPc:r(514),fsrJF:function(s,t){return s!==t},QwHDc:r(362),bkryA:r(354),KyRHG:"OEREe",UyEkY:"message",dyOQQ:"RzOXH",TMtSG:function(s,t){return s!==t},nagyH:"NkSae",HxQvH:"UOvGq",lYxdw:function(s,t,n){return s(t,n)},yJScy:function(s,t){return s<t},zRGlO:function(s,t){return s+t},oEXEq:function(s,t){return s(t)},SpaFD:function(s,t){return s!==t},bBsiO:r(731),hBZkU:function(s,t,n){return s(t,n)},Mdxqf:function(s,t){return s!==t},hGmrz:r(1299),vqaBI:function(s,t){return s!=t},aLuwS:r(1166)+"d",mJRfa:function(s,t){return s||t},cKDld:function(s,t){return s!=t},KueZM:function(s,t){return s<=t},ARkTc:r(851)+r(1172)+"ltiple t"+r(1492)+"process",JAXHQ:function(s,t){return s+t},zKVtV:function(s,t){return s(t)},zAcAt:function(s,t){return s===t},HRdft:function(s,t){return s===t},pWOGC:"reerh",ZTgVS:r(939),MyRUa:r(304)+"e_timeout",DUvze:function(s,t){return s<=t},fYYqj:function(s,t){return s<t},FBIPy:function(s,t){return s|t},pmUkp:function(s,t){return s<<t},wPRGB:function(s,t){return s&t},LcBvA:function(s,t){return s<t},ueTce:function(s,t){return s&t},AOEZS:r(1240),VLvSW:function(s,t){return s|t},TUqQC:function(s,t){return s|t},xGlEK:function(s,t){return s&t},RyCHY:function(s,t){return s<<t},OErLz:function(s,t){return s&t},dqvZM:function(s,t){return s&t},BzHpz:function(s,t){return s&t},rBieA:function(s,t){return s+t},XIQqn:function(s,t){return s&t},ZRZnN:function(s,t){return s===t},NoYQk:"NGgPs",BvBRI:function(s,t){return s<t},zOKHz:function(s,t){return s<t},gaWhv:function(s,t){return s===t},JDidD:r(1422)+"3|0",TpsLk:function(s,t){return s|t},eXVGT:function(s,t){return s+t},fAgix:function(s,t){return s&t},qpSyc:function(s,t){return s|t},JYSFB:function(s,t){return s|t},kWdab:function(s,t){return s>>t},aakxs:function(s,t){return s===t},cBuNO:r(1145),rEdlU:function(s,t){return s|t},ppYIZ:function(s,t){return s>>t},tGbTY:function(s,t){return s<t},yKLTj:function(s,t){return s+t},LnWrW:r(879),yFBmD:function(s,t){return s==t},geXZZ:r(1556),zjsNs:function(s,t){return s(t)},mIwRU:r(138),CPdyt:r(745),cCKYZ:"jthhS",gfwtj:function(s,t){return s!=t},NbQoK:r(1588)+r(334),VPITn:"text/pla"+r(1292)+r(661),GjgSM:r(1508),TefRI:r(274),Ljifb:function(s,t,n){return s(t,n)},vtQnU:function(s,t){return s(t)},qesOz:function(s,t){return s+t},vjWnc:r(401)+"ack=fron"+r(971)+"P",uiSHC:function(s,t,n,o){return s(t,n,o)},fUavy:r(101),sXgTH:r(106),SJXox:function(s,t){return s!==t},xtzjI:r(186),rnSnJ:r(1458),jNmqN:"ws://",GKffR:r(646),OnYUq:r(1491),uplSM:function(s,t,n){return s(t,n)},eeUzG:function(s,t){return s(t)},iPBBq:"YQcPf",QCQDI:function(s,t){return s||t},myXVu:function(s,t){return s||t},ougLh:function(s,t,n){return s(t,n)},oNnYr:r(454),UjtHS:function(s,t){return s||t},Lxdzc:function(s,t){return s||t},eCJTl:function(s,t){return s||t},paVJv:function(s,t){return s!=t},MCahf:r(1515)+"DB failed",GCHuo:function(s,t,n){return s(t,n)},LwpNe:r(1278),VjBUg:"message_id",ydgmt:function(s,t){return s(t)},leUzB:"abort",DzvxB:r(1384),RFFSr:r(642),zagyi:function(s,t){return s(t)},RPnOH:function(s,t,n,o){return s(t,n,o)},igmTI:r(1332)+r(1592),waxuh:function(s,t,n,o){return s(t,n,o)},bBtgE:"x_fronti"+r(998)+"k",geISi:r(1332)+r(903)+r(827),EBcEX:"need_ack",VBLvR:"ack_id",ObbFp:r(1057),uSKmx:function(s){return s()},HTSfb:r(878),TctSP:function(s,t){return s instanceof t},bagjk:function(s,t){return s instanceof t},rCKvh:function(s,t){return s instanceof t},dLfcO:function(s,t){return s!==t},nQSDt:r(1011),EygIl:function(s,t,n,o){return s(t,n,o)},uAThU:function(s,t){return s>t},kMJOx:function(s,t){return s||t},SfGRW:function(s,t){return s(t)},ohczv:r(108)+r(683)+r(1223),AfZGJ:r(1188),rMiNC:r(798),tfAUq:r(601)+r(434)+"e",tSsnP:function(s,t){return s>=t},Cyazs:r(255),alQje:function(s,t){return s+t},DHLLv:function(s,t){return s<t},iOHIO:function(s,t){return s>>>t},mSyWT:"2|1|3|4|0",neQez:function(s,t){return s<t},CDDst:function(s,t){return s+t},TxYUG:function(s,t){return s|t},JGaPT:function(s,t){return s+t},lNoBg:function(s,t){return s+t},HYesG:function(s,t){return s|t},zVRww:function(s,t){return s|t},mmCLR:function(s,t){return s<<t},MJDsI:function(s,t){return s+t},GTUyd:function(s,t){return s+t},HcgdO:r(600)+">",rPWla:function(s,t){return s!==t},CrXPY:r(504),babfT:r(1274),SpIXn:function(s,t){return s>>>t},qnCBD:function(s,t){return s+t},KtIIu:function(s,t){return s&t},CWOqs:function(s,t){return s&t},iABQd:function(s,t){return s&t},HXzSO:function(s,t){return s+t},ySvDe:function(s,t){return s>>>t},TLeod:function(s,t){return s+t},fLcna:function(s,t){return s&t},wePgu:function(s,t){return s>>>t},tkQdE:function(s,t){return s+t},RAZVW:function(s,t){return s>>>t},FpPLg:function(s,t){return s+t},dirxG:function(s,t){return s+t},WjGoN:function(s,t){return s&t},EcBqy:function(s,t){return s+t},bJrpg:function(s,t){return s|t},DnEsZ:function(s,t){return s|t},QMpsR:function(s,t){return s<<t},KgTKw:function(s,t){return s|t},LNPqk:function(s,t,n,o){return s(t,n,o)},SSsIO:function(s,t){return s(t)},KxuJB:r(1123),rbyMP:r(1428),TLbFU:r(1351)+r(695),MZNbM:r(695),AieiU:function(s,t){return s(t)},gJnnC:r(560)+r(529),GtXKt:function(s,t,n){return s(t,n)},NldmI:function(s,t){return s+t},pOKfV:function(s,t,n){return s(t,n)},JaDyh:r(1064)+r(1394),ghIPs:r(1255),jPngm:r(1505)+"rValues",hmouZ:r(403),HPFgB:function(s,t,n,o){return s(t,n,o)},qDkEP:"INSTANT",WdjfV:r(233),jkeaE:function(s,t){return s(t)},Gppry:r(805)+"r",Phiwg:function(s,t){return s||t},dbGwq:function(s,t,n,o){return s(t,n,o)},KGXrV:"code",jMMFj:"is_ack",ikNxn:r(1332)+r(803),vZgpC:function(s,t){return s(t)},GsWZL:function(s,t,n){return s(t,n)},OeNtb:r(1332)+r(1561),xaqWX:function(s,t){return s(t)},BfSRh:r(865)+"rsor_value",xAOzd:function(s,t){return s>t},meJtW:r(212),eCPev:function(s){return s()},LpmYq:function(s){return s()},FlNOk:function(s,t){return s===t},cQxcO:function(s,t){return s&&t},HEGRh:function(s,t,n){return s(t,n)},wPDut:function(s){return s()},ZcKzW:function(s){return s()},JkWFU:function(s,t){return s<t},IVOla:function(s,t){return s===t},CrTmQ:function(s,t,n){return s(t,n)},FNvxk:r(1105),cMTID:function(s,t){return s===t},CbfOc:function(s,t){return s===t},oBbAj:"always",VAjIR:r(1009),vDKYp:r(304)+r(1227)+"s",hDLaw:function(s,t,n){return s(t,n)},zcaWd:function(s,t,n,o){return s(t,n,o)},NgUBh:function(s,t,n){return s(t,n)},YIHgt:function(s,t){return s!==t},XpqyB:r(151),weOox:function(s,t,n){return s(t,n)},eUsOY:function(s,t){return s===t},hAJeo:function(s,t,n){return s(t,n)},aCcIw:r(226),BRUlL:r(973),PvOro:function(s,t){return s!==t},ewJvl:r(1173),TewJb:function(s,t){return s(t)},EqmrW:function(s,t,n){return s(t,n)},GMuYb:r(1447)+r(1171),mNFNP:r(1420),eNlJR:function(s,t){return s/t},XtjjS:function(s,t){return s===t},eqZPJ:function(s,t){return s(t)},iTDgh:"please p"+r(1216)+r(1395)+", WebSocket cons"+r(938)+"is undef"+r(472),JHLcx:function(s,t,n){return s(t,n)},RIBvg:r(643)+"t",kGTli:r(1593)+"ediately reconnect",zKCoS:"offline",DbqcU:"pagehide",sEhMI:r(1210),Bjxmq:r(262),rrICQ:r(672),KKYJx:r(499),wSRRk:r(379),aDVMU:function(s,t,n){return s(t,n)},lDnPQ:r(1387),IxLwS:r(825),OiNnn:r(478),FBdSO:function(s,t){return s!==t},muXBQ:function(s,t){return s|t},lUhTm:function(s,t){return s<<t},FYfkF:function(s,t){return s<<t},HqdQq:function(s,t){return s<<t},gbZvC:r(647)+r(718),vlfJj:r(1337),qDQdp:r(248),YRsTf:function(s,t){return s===t},atMft:"OgtdV",sIIGJ:r(748),dgZGS:function(s,t){return s==t},mWDuW:"wss://",VTWuI:function(s,t){return s!==t},PhKgx:r(383),iyHdF:"bd_did",BsuMa:r(609),uQttU:r(1485)+"d",aoToQ:"please provide b"+r(528)+r(246)+"r ttwID",ZHhgR:"function",OtdkR:function(s,t,n){return s(t,n)},gBuda:r(877),JGUhw:r(1159)+"0",NRyDP:function(s,t,n){return s(t,n)},gkxuF:function(s,t,n){return s(t,n)},nKGcv:function(s,t){return s>t},vNOcL:function(s,t){return s-t},kKBkW:function(s,t,n){return s(t,n)},wwIQe:function(s,t){return s(t)},AaBFm:function(s,t){return s(t)},fFmag:function(s,t){return s*t},JRdTF:function(s,t){return s|t},NUCqq:"DDVGc",huont:function(s,t,n){return s(t,n)},LvzDM:function(s,t){return s!==t},IwUtV:"going aw"+r(425)+r(643)+"ting ser"+r(285),QGaCb:function(s,t){return s!==t},aovJA:"aDBHD",HEPsW:function(s,t){return s(t)},mYxFG:"MMWhM",jgKBi:r(728),nHIqi:r(573),VmIop:function(s,t,n){return s(t,n)},Rvhgt:function(s,t){return s===t},YhsuL:r(1377),RUJUG:r(1046),tGFdr:r(842)+r(109)+r(602)+"g",nSqbp:r(325),izOyV:r(465)+"3",kWfku:"4|2|1|0|3",ofLnG:r(969),mhAVz:r(1412),uncqj:function(s,t,n){return s(t,n)},uYdVU:function(s,t,n){return s(t,n)},rLKyz:function(s,t,n){return s(t,n)},QKMnc:r(388),MbcJM:function(s,t){return s(t)},LgGeI:function(s,t){return s+t},NPTMP:"bicTD",ngOnK:function(s,t){return s||t},tvOPK:r(524),QBqXI:r(1476),INomQ:function(s,t){return s|t},bnFNW:function(s,t){return s&t},OAqyx:function(s,t){return s===t},DhNSU:r(667),Nuslj:r(114)+r(1267)+r(1158)+r(305)+"ed",doqFW:r(114)+r(603)+r(1263),roZkS:r(816)+r(885)+" valid d"+r(1185)+r(1567)+r(701)+r(835)+" arraybu"+r(844),XNHfl:function(s,t){return s==t},mPBXU:r(977),fRTtX:function(s,t){return s instanceof t},DrlSB:function(s,t){return s(t)},cVVoV:function(s,t){return s||t},BaUZl:r(816)+"rovide a valid s"+r(1317),rnWVZ:r(721),MfDcM:function(s,t){return s<t},hrxgh:"MuCEp",lxdHY:r(574),asbSu:function(s,t){return s||t},egHKr:function(s,t){return s==t},jZPBI:function(s,t){return s!==t},iovfj:r(1054)+r(1432)+r(1088),nnmKj:r(567),MsKwJ:r(1500),vsIcM:function(s,t){return s(t)},ecssR:r(1342),iXCMR:function(s,t){return s===t},ZSeXY:r(416),pRyeF:function(s,t){return s!=t},CpRYI:function(s,t){return s===t},cwpCD:r(837),jNqGx:function(s,t){return s!=t},qXGtm:r(1068)+"dWorkerGlobalScope",USmPe:"ServiceWorkerGlobalScope",Jgvpy:function(s,t){return s===t},VIHhm:function(s,t,n){return s(t,n)},AuHkT:"__x_msg_"+r(428)};ye.r(J),ye.d(J,{FWS:()=>I0,CustomErrorEvent:()=>es,createCloseEvent:()=>ge,ReconnectEvent:()=>Qr,createErrorEvent:()=>fe,decodedFrame:()=>Vr,createOpenEvent:()=>os,CustomCloseEvent:()=>ts,createReconnectEvent:()=>Jn,FrontierMessageEvent:()=>rs,encodeFrame:()=>Wn,createMessageEvent:()=>is,OpenEvent:()=>ss,ErrorCode:()=>Oe,Event:()=>it,MessageEvent:()=>ns});let i="";function a(s=""){let t=r,n={JsKyZ:function(o,c){return e.MGIGB(o,c)},cpnGm:t(638)+"t limit"};if(t(282)!==t(1090)){let c=""+Date.now(),d=i||(i=m(s)),p=Math.random()[t(1555)](16)[t(625)](-6);return"02"+c+d+p}else{let o=_0x24e6a5[t(610)];if(n[t(684)](o,_0x4069aa)>_0x416f9f.limit)throw new _0x11e485(n[t(289)]);return _0x22b077[t(610)]+=_0xe33e44,o}}function x(){let s=r;if(e[s(949)]===e[s(1097)]){let t=(s(495)+"0").split("|"),n=0;for(;;){switch(t[n++]){case"0":return e[s(1518)](e[s(1101)](_0x195761,_0x4e8a96,_0xa7aa53,_0x4fff06),_0x3b4bd9);case"1":if(_0x52454b.length<40)return e[s(1518)](_0x23431e(_0x227f80,_0x22c48c,_0x305bad),_0x551dba);continue;case"2":if(!_0x5a831a)return _0x2349bc;continue;case"3":if(_0x167bfd[s(562)])return e[s(1518)](_0x1f1ce3[s(562)](_0x5efe0d,_0x415633),_0x1af248);continue;case"4":if(_0x494e11.utf8Write)return e.Noxtw(_0x34fe1a[s(181)+"e"](_0x2c81d5,_0x2438a6),_0x2bd1b8);continue}break}}else return e.pOjMm(1e4*Date[s(1446)](),Math.floor(e[s(1005)](1e4,Math[s(527)]())))}function f(s){let t=r;return e[t(1004)](e.pfAdf(Array,8).join("0"),e[t(626)](parseInt,s,10)[t(1555)](2)).slice(-8)}function u(s){let t=r;return e[t(1295)](Array(4)[t(283)]("0"),e[t(544)](parseInt,s,2)[t(1555)](16))[t(625)](-4)}function h(s){let t=r,n=s[t(970)](/\./).map(d=>f(d)),o=[];return o[0]=e[t(1152)](u,e[t(1518)](n[0],n[1])),o[1]=e.wkRlr(u,e[t(1295)](n[2],n[3])),[e[t(1529)],e[t(1529)],t(1268),t(1268),e.TrDVw,t(790),o[0],o[1]].join("")}function m(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(1430)](s),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(1430)](s);return n?e.fgvbE(h,s):o?e[t(757)](w,s):e[t(343)]}function w(s){let t=r,n="",o=[],c=0,d=0,p=!0,g=e[t(1529)];if(s[t(165)]("::")>-1){let l=s.split("::");for(let b=0;e.CRalP(b,l.length);b++){let D=l[b];if(D.indexOf(":")>0)if(e[t(850)](e[t(1585)],e[t(751)])){let I=D.split(":");p&&(c=I.length),d+=I[t(769)];for(let P=0;P<I[t(769)];P++)if(e[t(850)](4,I[P][t(769)])){let q=g.substring(0,e[t(132)](4,I[P][t(769)])),se=q[t(1288)](I[P]);o.push(se)}else o[t(473)](I[P]);p=!1}else{let I=this[t(799)][t(1363)](this[t(492)]),P=_0x21b038[t(1324)](e[t(538)](I,"{}"));return _0x5e9f73.values(P)}else{if(D[t(769)]!==4){let I=g.substring(0,e[t(132)](4,D[t(769)])),P=I[t(1288)](D);o[t(473)](P)}else o[t(473)](D);p&&(c+=1),d+=1,p=!1}}let v="";for(let b=0;e[t(310)](b,e.kvcnf(8,d));b++)v=v[t(1288)](g);for(let b=0;e[t(310)](b,o[t(769)]);b++)e[t(616)](b,c)&&(n=n[t(1288)](v)),n=n[t(1288)](o[b]);return n}{let l=s[t(970)](":");for(let v=0;v<l[t(769)];v++){let b=l[v];if(l[v][t(769)]!==4){let D=g[t(572)+"g"](0,e[t(1286)](4,l[v][t(769)])),I=D[t(1288)](b);n=n[t(1288)](I)}else n=n.concat(b)}return n}}function y(s,t){let n=r;if(!e[n(920)](e[n(932)],e[n(932)])){let o=s.key;o!==void 0&&($(t,10),Ce(t,o));let c=s[n(1472)];e.NclmZ(void 0,c)&&(e[n(439)]($,t,18),e[n(1220)](Ce,t,c))}}function _(s){let t=r,n={};e:for(;!e.wkRlr(we,s);)if(e[t(219)](e.KwlsY,e[t(1468)])){let o=e[t(1152)](ee,s);switch(o>>>3){case 0:break e;case 1:n[t(988)]=e[t(1135)](Ee,s,e.qbaWg(ee,s));break;case 2:n[t(1472)]=e[t(1310)](Ee,s,ee(s));break;default:e.pqrOX(re,s,e[t(256)](7,o))}}else this[t(500)+"s"]=_0x154761,this[t(965)+"es"]=_0x13a765,this[t(1406)+t(1453)]=0,this[t(328)+t(145)+t(1241)+"t"]=0;if(e.qMlmZ(void 0,n[t(988)]))throw new Error(t(665)+t(697)+" field: "+t(988));if(n.value===void 0)throw new Error(e[t(1400)]);return n}function C(s){let t=r,n=e[t(1380)](M);return e[t(626)](L,s,n),Be(n)}function L(s,t){let n=r,o={uipPp:function(c,d,p,g){return e.UcbcZ(c,d,p,g)},sSMDd:function(c,d){return e.qEsdX(c,d)},uiIpv:function(c,d){return c>>>d},nfIbs:function(c,d){return e[A(1099)](c,d)},YCBLV:function(c,d){return e[A(1005)](c,d)},HSXFF:function(c,d){return c>>>d}};if(e[n(1482)](n(1308),e[n(1010)]))o[n(1147)](_0x178dd0,this,_0x6c619e,[_0x378cb7,_0x40c59b,_0x216322]);else{let c=s[n(191)];e[n(920)](void 0,c)&&($(t,8),e[n(258)](vt,t,c));let d=s.LogID;if(e[n(920)](void 0,d))if(e[n(1229)]===n(641))e[n(340)]($,t,16),vt(t,d);else return e[n(1534)](this[n(1406)+n(1453)],this.endpoints[n(769)])?!0:e[n(892)](this[n(328)+n(145)+"riesCount"],this.maxRetries);let p=s[n(1123)];e[n(1055)](void 0,p)&&(e.tYunS($,t,24),e[n(1220)](vt,t,ae(p)));let g=s[n(1246)];if(e.TKYEw(void 0,g)){if(e.DSpeX(n(377),n(637)))return this[n(1535)]?o[n(546)](o.uiIpv(this[n(948)],0)*_0x5df11f,o.uiIpv(this[n(1362)],0)):o[n(113)](o[n(1444)](this[n(948)],_0x3cc343),o[n(1496)](this[n(1362)],0));e.YIfUO($,t,32),e.IVCcN(vt,t,e[n(1152)](ae,g))}let l=s[n(491)];if(e[n(1055)](void 0,l))for(let qe of l){e[n(154)]($,t,42);let Fe=e.cKOzB(M);e.IVCcN(y,qe,Fe),$(t,Fe.limit),e[n(544)](De,t,Fe),e.qRbzL(G,Fe)}let v=s[n(1401)+n(852)];e[n(746)](void 0,v)&&(e[n(1554)]($,t,50),e.vUKwj(Ce,t,v));let b=s[n(518)+n(1279)];e.Hfafw(void 0,b)&&($(t,58),e.IVCcN(Ce,t,b));let D=s[n(1177)];D!==void 0&&(e[n(180)]($,t,66),e[n(1310)]($,t,D[n(769)]),e.faCoR(zt,t,D));let I=s[n(121)];e.lTawN(void 0,I)&&(e.zExUm($,t,74),Ce(t,I));let P=s[n(564)+n(350)];P!==void 0&&(e[n(1329)]($,t,82),e.ahhey(Ce,t,P));let q=s[n(1483)];if(e.lTawN(void 0,q))if(e[n(199)](e.deWQj,e[n(1498)]))$(t,90),e[n(660)](Ce,t,q);else return n(612)+"_"+this[n(332)];let se=s[n(1275)+"e"];se!==void 0&&($(t,96),e[n(1290)](vt,t,e.rrvVL(ae,se)))}}function T(s){return R(e.xeQoy(Se,s))}function R(s){let t=r,n={};e:for(;!e[t(1152)](we,s);){let o=e[t(1587)](ee,s);switch(o>>>3){case 0:break e;case 1:n.SeqID=e[t(544)](Jr,s,!0);break;case 2:n[t(1570)]=e[t(1329)](Jr,s,!0);break;case 3:n[t(1123)]=ee(s);break;case 4:n.method=e.qbaWg(ee,s);break;case 5:{let c=e[t(1335)](j,s);(n[t(491)]||(n[t(491)]=[]))[t(473)](e[t(1152)](_,s)),s[t(1141)]=c;break}case 6:n[t(1401)+t(852)]=e.fnXbu(Ee,s,e[t(1587)](ee,s));break;case 7:n[t(518)+t(1279)]=e.ZCTJf(Ee,s,e[t(137)](ee,s));break;case 8:n[t(1177)]=e[t(626)](Ot,s,e[t(757)](ee,s));break;case 9:n[t(121)]=e.vUKwj(Ee,s,e[t(104)](ee,s));break;case 10:n.serverTiming=e[t(993)](Ee,s,e[t(466)](ee,s));break;case 11:n[t(1483)]=e.YIfUO(Ee,s,e.wkRlr(ee,s));break;case 12:n[t(1275)+"e"]=ee(s);break;default:re(s,e[t(123)](7,o))}}if(e.DSpeX(void 0,n.SeqID))throw new Error(t(665)+t(697)+t(488)+t(191));if(e[t(481)](void 0,n[t(1570)]))throw new Error(e[t(749)]);if(e.ihNVT(void 0,n[t(1123)]))throw new Error(e[t(254)]);if(e[t(616)](void 0,n[t(1246)]))throw new Error(e[t(955)]);return n}function j(s){let t=r,n=ee(s),o=s[t(1141)];return s[t(1141)]=e.qEsdX(s[t(610)],n),o}function re(s,t){let n=r;switch(t){case 0:for(;e[n(680)](128,e[n(1102)](Q,s)););break;case 2:e[n(1521)](me,s,ee(s));break;case 5:me(s,4);break;case 1:e[n(314)](me,s,8);break;default:throw new Error(e[n(585)](e.moFhl,t))}}function ae(s){let t=r;return s|=0,{low:s,high:e[t(236)](s,31),unsigned:s>=0}}let k=[];function M(){let s=r,t=k[s(1072)]();return t?(t[s(610)]=t.limit=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}function G(s){k[r(473)](s)}function Se(s){return{bytes:s,offset:0,limit:s.length}}function Be(s){let t=r,n=s.bytes,o=s[t(1141)];return e[t(1573)](n[t(769)],o)?n:n[t(257)](0,o)}function me(s,t){let n=r;if(e.NuCCO(e[n(614)](s[n(610)],t),s[n(1141)]))throw new Error(e[n(1110)]);s[n(610)]+=t}function we(s){let t=r,n={GdhOz:function(o,c){return e[A(123)](o,c)},IPKlc:function(o,c){return e[A(349)](o,c)}};return e[t(176)](e[t(1296)],e.NnOcg)?e.GsSIt(s[t(610)],s[t(1141)]):(_0x1254ce[t(103)+"t8"]?_0x293739[t(103)+"t8"](_0x186d5c,_0x2c3bcf):_0x5340e6[_0xf8f68c]=n[t(241)](255,_0x240f94),n.IPKlc(_0x1be73e,1))}function he(s,t){let n=r,o=s[n(1478)],c=s[n(610)],d=s[n(1141)],p=e[n(1503)](c,t);if(e[n(267)](p,o[n(769)])){let g=new Uint8Array(2*p);g[n(868)](o),s[n(1478)]=g}return s[n(610)]=p,e[n(312)](p,d)&&(s[n(1141)]=p),c}function rt(s,t){let n=r,o=s[n(610)];if(e[n(267)](e[n(349)](o,t),s[n(1141)]))throw new Error(e[n(1297)]);return s[n(610)]+=t,o}function Ot(s,t){let n=r,o={tVJzH:function(c,d){return c(d)},AQDRw:e[n(221)]};if(e[n(149)]!==n(1213)){let c=rt(s,t);return s[n(1478)].subarray(c,e[n(986)](c,t))}else _0x3097a4[n(612)+n(1524)]=void 0,o[n(645)](_0x13ccc5,o[n(1461)])}function zt(s,t){let n=r;if(e[n(1181)](e[n(490)],e[n(490)])){let o=e[n(1018)](he,s,t[n(769)]);s.bytes.set(t,o)}else return _0x4c6099(_0xe68e07.apply(_0x34a257(this),_0x88198))}function Ee(s,t){let n=r,o=e[n(1305)](rt,s,t),c=String[n(620)+n(639)],d=s[n(1478)],p="\uFFFD",g="";for(let l=0;e[n(594)](l,t);l++){let v=d[e.qEsdX(l,o)],b,D,I,P;if(e.WDfbn(128&v,0))g+=e.pfAdf(c,v);else if(e[n(1254)](224&v,192))e.CyAGF(l+1,t)?g+=p:(b=d[e[n(1099)](e[n(986)](l,o),1)],e[n(1455)](192,b)!==128?g+=p:(P=e[n(824)](e[n(253)](31,v),6)|e[n(1002)](63,b),e.MyCtL(P,128)?g+=p:(g+=e[n(1487)](c,P),l++)));else if(e.KcJjH(e[n(1002)](240,v),224))if(e[n(189)](l+2,t))g+=p;else if(b=d[e[n(430)](l+o,1)],D=d[e[n(194)](e[n(1309)](l,o),2)],e[n(219)](e[n(680)](e[n(754)](b,e.ZASou(D,8)),49344),32896))g+=p;else if(P=e.ZFknA(e.ZFknA(e.ZASou(15&v,12),e[n(869)](e[n(131)](63,b),6)),e[n(256)](63,D)),P<2048||e[n(873)](P,55296)&&e[n(1465)](P,57343))g+=p;else if(e[n(1035)](n(376),e[n(576)]))g+=e[n(985)](c,P),l+=2;else return _0xce893b&&(_0x553cab=(0,_0x3cfebb[eujvuM[n(1025)](_0x2c6e72,_0x465ddb)[0]])(_0x58b08b=0)),_0x612ad0;else e.SFCjP(248&v,240)?e[n(1569)](l,3)>=t?g+=p:(b=d[e.xzscd(e.qEsdX(l,o),1)],D=d[e.fHAsL(e[n(807)](l,o),2)],I=d[e[n(893)](e.pOjMm(l,o),3)],e[n(1565)](e[n(754)](e.ZFknA(b,e[n(1383)](D,8)),e[n(1124)](I,16)),12632256)!==8421504?g+=p:(P=e[n(326)](e[n(670)](e[n(326)](e[n(1079)](e[n(131)](7,v),18),e[n(1124)](e[n(937)](63,b),12)),e.iHWXq(63&D,6)),e[n(1565)](63,I)),P<65536||e[n(892)](P,1114111)?g+=p:(P-=65536,g+=e[n(1115)](c,e[n(172)](P,10)+55296,e[n(1503)](e.UKWuv(1023,P),56320)),l+=3))):g+=p}return g}function Ce(s,t){let n=r;if(e[n(1573)](e[n(1208)],e[n(1208)])){let o=t[n(769)],c=0;for(let g=0;e.ZUoCJ(g,o);g++){let l=t[n(989)+"At"](g);e[n(100)](l,55296)&&e[n(1465)](l,56319)&&e.usiCy(e.xzscd(g,1),o)&&(l=e[n(132)](e[n(523)](l<<10,t[n(989)+"At"](++g)),56613888)),c+=l<128?1:l<2048?2:e[n(1239)](l,65536)?3:4}e[n(1193)]($,s,c);let d=e[n(1554)](he,s,c),p=s.bytes;for(let g=0;e.NIgps(g,o);g++){let l=t.charCodeAt(g);if(e[n(873)](l,55296)&&e[n(1465)](l,56319)&&e[n(1532)](e[n(1569)](g,1),o)&&(l=e[n(330)](e.XJysW(e.rLaEt(l,10),t.charCodeAt(++g)),56613888)),e[n(1504)](l,128))p[d++]=l;else if(e.Zhwtb(e.FAiXj,n(302)))e[n(1532)](l,2048)?p[d++]=e.VcHJR(e[n(669)](l>>6,31),192):(e[n(596)](l,65536)?p[d++]=e[n(184)](e[n(1352)](e[n(453)](l,12),15),224):(p[d++]=e[n(706)](e[n(123)](e[n(1184)](l,18),7),240),p[d++]=e[n(950)](e[n(1579)](e.csLce(l,12),63),128)),p[d++]=e.xHrRb(e[n(1354)](l,6),63)|128),p[d++]=e[n(1425)](63&l,128);else return _0x4a29aa||(_0x2d7e69=[_0x176939,_0x227237,_0x16b1fe,_0xea2636,_0x2d65ca])}}else{let o=new _0x4c8a1d(e.ZFknA(e.VcHJR(e[n(1130)](_0x2cd6e5[_0x3ff955+4]<<24,_0x5177c4[e.Noxtw(_0x3eedb2,5)]<<16),e[n(929)](_0x18fd7f[e[n(523)](_0x5ebf9d,6)],8)),_0x3258f8[e[n(986)](_0x297643,7)]),e[n(1130)](e[n(184)](e[n(1250)](_0x424818[e[n(883)](_0x103c19,0)],24)|_0xd5b0a[_0x273a40+1]<<16,e[n(782)](_0xab77e5[e[n(1295)](_0x20c010,2)],8)),_0x463535[_0x1e5e08+3]),!0);return _0x2ceffd+=8,{value:o,offset:e.pOjMm(_0x13017a,8)}}}function De(s,t){let n=r,o=e.MLJZR(he,s,t[n(1141)]),c=s[n(1478)],d=t[n(1478)];for(let p=0,g=t[n(1141)];e[n(366)](p,g);p++)c[p+o]=d[p]}function Q(s){let t=r;return s.bytes[e[t(511)](rt,s,1)]}function We(s,t){let n=he(s,1);s.bytes[n]=t}function ee(s){let t=r,n=0,o=0,c;do c=e.qjNJf(Q,s),n<32&&(o|=e[t(1350)](e[t(123)](127,c),n)),n+=7;while(e[t(131)](128,c));return o}function $(s,t){let n=r;for(t>>>=0;t>=128;)e.BETIE(e[n(396)],e[n(396)])?(this.emit(e[n(269)],_0x591613),this[n(832)]&&this[n(832)](_0x2db087)):(We(s,e[n(565)](e[n(461)](127,t),128)),t>>>=7);e[n(626)](We,s,t)}function Jr(s,t){let n=r,o={BuTqY:function(c,d){return e[A(224)](c,d)},lxOcF:function(c,d){return e[A(224)](c,d)},Nzqhe:function(c,d){return c&d},XCCOW:function(c,d){return e.cMCvo(c,d)},kXKqE:function(c,d){return e.TrxnV(c,d)},SRMDS:function(c,d){return c>>>d},cCYUF:function(c,d){return e[A(931)](c,d)},ocGyF:function(c,d){return e.zlUHv(c,d)},VBpKV:function(c,d,p,g){return e[A(1293)](c,d,p,g)},HbTAd:function(c,d){return c+d}};if(e[n(481)](e.Thcml,e[n(1490)])){_0x316c02.isLong(_0x198ca2)||(_0x187285=_0x79d8d6[n(1224)+"er"](_0x163921));let c=o.BuTqY(this[n(948)],16),d=65535&this[n(948)],p=o.lxOcF(this[n(1362)],16),g=65535&this[n(1362)],l=o.BuTqY(_0x566f8e.high,16),v=o.Nzqhe(65535,_0x2bc62f[n(948)]),b=o[n(743)](_0x14176d[n(1362)],16),D=o[n(307)](65535,_0x1c92d7.low),I=0,P=0,q=0,se=0;return se+=o.kXKqE(g,D),q+=o.BuTqY(se,16),se&=65535,q+=o.kXKqE(p,b),P+=q>>>16,q&=65535,P+=o.kXKqE(d,v),I+=o[n(418)](P,16),P&=65535,I+=o.kXKqE(c,l),I&=65535,_0x65f0a0[n(941)](o.cCYUF(o[n(716)](q,16),se),o.cCYUF(I<<16,P),this.unsigned)}else{let c=0,d=0,p=0,g;if(g=e[n(991)](Q,s),c=e[n(446)](127,g),e[n(680)](128,g)&&(g=Q(s),c|=e[n(260)](127&g,7),128&g&&(g=Q(s),c|=e.angSb(127,g)<<14,e[n(1253)](128,g)&&(g=Q(s),c|=e[n(747)](e[n(256)](127,g),21),e[n(1565)](128,g))))){if(e[n(920)](e[n(1576)],e[n(1576)]))this[n(332)]=_0x175f4c,this._pathKey=_0x24710,this._qosDB=_0x2f4781;else if(g=Q(s),d=e[n(265)](127,g),e[n(517)](128,g)&&(g=e.sPLyB(Q,s),d|=(127&g)<<7,e[n(1564)](128,g)))if(n(1300)===n(1300)){if(g=Q(s),d|=e[n(1350)](e[n(1045)](127,g),14),e[n(139)](128,g)&&(g=e[n(1081)](Q,s),d|=e[n(1565)](127,g)<<21,e.fvGyn(128,g)&&(g=Q(s),p=127&g,e[n(1565)](128,g))))if(e[n(111)](e[n(911)],"KvtHK"))g=Q(s),p|=e.ovgpq(127,g)<<7;else{let l=o[n(307)](255,_0x11203d);o[n(510)](_0x58fafe,l,_0x1b3a43,o[n(737)](_0x344102,_0x49ebe3)),_0x5679c4>>>=8,_0x597fcc--}}else return{bytes:_0x5e5c72,offset:0,limit:_0x42e78e[n(769)]}}return{low:e[n(1130)](c,e.jhJtZ(d,28)),high:e[n(224)](d,4)|p<<24,unsigned:t}}}function vt(s,t){let n=r,o=t[n(1362)]>>>0,c=e[n(619)](e[n(184)](t[n(1362)]>>>28,t[n(948)]<<4),0),d=e[n(686)](t[n(948)],24),p=e.oHGwx(0,d)?e[n(481)](0,c)?e[n(310)](o,16384)?e[n(594)](o,128)?1:2:e.ZUoCJ(o,2097152)?3:4:c<16384?e[n(310)](c,128)?5:6:c<2097152?7:8:e[n(1526)](d,128)?9:10,g=e.hObYE(he,s,p),l=s[n(1478)];switch(p){case 10:l[e[n(1195)](g,9)]=e.blTLd(d>>>7,1);case 9:l[e[n(1385)](g,8)]=e[n(746)](9,p)?e[n(184)](128,d):e[n(265)](127,d);case 8:l[e[n(1295)](g,7)]=e[n(1403)](8,p)?e.TeFqq(e[n(463)](c,21),128):c>>>21&127;case 7:l[e[n(1537)](g,6)]=e[n(219)](7,p)?e[n(565)](e[n(1450)](c,14),128):e[n(265)](e[n(1450)](c,14),127);case 6:l[e[n(1140)](g,5)]=e[n(899)](6,p)?e[n(950)](e[n(619)](c,7),128):e[n(1129)](c,7)&127;case 5:l[e[n(1518)](g,4)]=e[n(1050)](5,p)?e.BDYAZ(128,c):e[n(331)](127,c);case 4:l[e[n(883)](g,3)]=e[n(850)](4,p)?e[n(1146)](o>>>21,128):e[n(1265)](e.YWHoj(o,21),127);case 3:l[e.ImBqq(g,2)]=p!==3?e[n(1146)](o>>>14,128):e[n(1450)](o,14)&127;case 2:l[e[n(1569)](g,1)]=e[n(219)](2,p)?e.YgvYY(o>>>7,128):e[n(680)](e[n(1074)](o,7),127);case 1:l[g]=e.APwgo(1,p)?128|o:127&o}}function Vr(s){return e[r(104)](T,s)}function Wn(s){return e.fgvbE(C,s)}let Yr=65536,Fo=e.ecssR,st=e[r(777)](Yr,Yr),Xr=e.DcjSu(st,st),Zr=e[r(720)](Xr,2),Me=String[r(1396)+"e"][r(989)+"At"];class B{constructor(t,n,o){let c=r;this[c(1012)]=!0,this[c(1362)]=0|t,this[c(948)]=e[c(327)](0,n),this[c(1535)]=!!o}static isLong(t){let n=r;return t&&e.HXYkA(!0,t[n(1012)])}static[r(941)](t,n,o){return new B(t,n,o)}static[r(770)+"s"](t,n,o){let c=r;if(e[c(983)](e[c(1374)],e[c(1374)]))return o?B[c(770)+"sLE"](t,n):B.fromBytesBE(t,n);{let{initReconnectInterval:d,maxReconnectInterval:p,reconnectIntervalGrowFactor:g}=this[c(1094)],l=e[c(777)](d,_0x520834[c(1186)](g,e[c(132)](_0x258d7a,1)));return e[c(934)](l,p)?p:l}}static[r(770)+r(694)](t,n){let o=r;return new B(e[o(327)](t[0]|e[o(457)](t[1],8),e[o(1175)](t[2],16))|e[o(1590)](t[3],24),e[o(961)](t[4]|t[5]<<8,t[6]<<16)|e[o(299)](t[7],24),n)}static[r(770)+r(812)](t,n){let o=r,c={yZlZL:function(d,p,g){return d(p,g)}};if(e.TcGYG(o(467),e[o(1038)]))return new B(e[o(659)](e[o(1103)](e[o(184)](e[o(506)](t[4],24),e[o(914)](t[5],16)),t[6]<<8),t[7]),e.prYvs(e[o(336)](e.gxbUq(t[0]<<24,e[o(1350)](t[1],16)),e.HXcpM(t[2],8)),t[3]),n);_0x38ad91(_0x5a6d59,32),GOnNJF[o(888)](_0x216777,_0x597550,_0x3bfa8d(_0x2b6bc3))}static[r(1533)](t){let n=r,o={cRZtd:function(c){return c()}};if(e[n(1375)]!==e[n(1231)])return t===Fo?$r:new B(e[n(1100)](e[n(135)](e[n(326)](e[n(216)](Me[n(861)](t,0),e[n(313)](Me[n(861)](t,1),8)),e[n(1527)](Me[n(861)](t,2),16)),e[n(313)](Me.call(t,3),24)),0),e[n(1545)](e[n(1470)](e[n(505)](Me[n(861)](t,4)|e.MoXsV(Me.call(t,5),8),e[n(1258)](Me.call(t,6),16)),e.iHWXq(Me[n(861)](t,7),24)),0),!0);NmehKM.cRZtd(_0x49eca2),NmehKM[n(820)](_0x5b2c60)}toHash(){let t=r,n={RsFGd:function(o,c){return e[A(985)](o,c)}};return e[t(1254)](e[t(1392)],"nXkMo")?String[t(620)+"Code"](e[t(535)](255,this[t(1362)]),e[t(1545)](this[t(1362)],8)&255,e[t(1410)](this[t(1362)],16)&255,this[t(1362)]>>>24,255&this.high,e[t(779)](e[t(1410)](this[t(948)],8),255),e[t(1076)](e[t(1100)](this.high,16),255),e[t(619)](this[t(948)],24)):(_0x5a7629[t(1228)](HwxCuv[t(558)](_0x3e1a7b,this),_0x1696fa),HwxCuv.RsFGd(_0x1185df,_0x2101cb[t(1379)](this)))}static fromNumber(t,n=!0){let o=r;if(e.TFlIQ(isNaN,t))return n?Uo:$r;if(n){if(e[o(980)](t,Xr))return Ko}else{if(e[o(1465)](t,-Zr))return jo;if(e.CyAGF(e.ntJIx(t,1),Zr))return Ho}return B[o(941)](e[o(715)](e[o(608)](t,st),0),e[o(659)](t/st,0),n)}[r(696)](){let t=r;return this[t(1535)]?e.MGIGB(e[t(777)](e[t(713)](this[t(948)],0),st),e[t(1074)](this[t(1362)],0)):e[t(1140)](e[t(1419)](this[t(948)],st),e.ORIrE(this[t(1362)],0))}[r(1230)](){let t=r;return e.IfxPP(0,this.high)&&e[t(1563)](0,this[t(1362)])}[r(476)](t){let n=r;B[n(1012)](t)||(t=B.fromNumber(t));let o=e[n(1074)](this.high,16),c=65535&this[n(948)],d=e.xLovA(this[n(1362)],16),p=e[n(1253)](65535,this[n(1362)]),g=e.Vxdld(t[n(948)],16),l=65535&t[n(948)],v=e[n(1438)](t[n(1362)],16),b=e[n(131)](65535,t[n(1362)]),D=0,I=0,P=0,q=0;return q+=e[n(278)](p,b),P+=e[n(224)](q,16),q&=65535,P+=e.LmLUV(d,v),I+=P>>>16,P&=65535,I+=e[n(893)](c,l),D+=e[n(951)](I,16),I&=65535,D+=e.KkXao(o,g),D&=65535,B[n(941)](e[n(1044)](e[n(870)](P,16),q),e[n(1052)](e[n(1552)](D,16),I),this[n(1535)])}[r(539)](t){let n=r,o={gHeVu:function(c,d){return e[A(1037)](c,d)},qFKrd:function(c){return e.UHOvx(c)}};if(e[n(548)](e.CBepp,e[n(431)]))return B[n(1012)](t)||(t=B[n(1224)+"er"](t)),this[n(1535)]!==t[n(1535)]&&e[n(994)](e[n(1074)](this[n(948)],31),1)&&e.WDfbn(e[n(756)](t[n(948)],31),1)?!1:e[n(111)](this[n(948)],t.high)&&this.low===t[n(1362)];this[n(441)]=!1,o[n(709)](_0x10fc34,this["_connectionTimeo"+n(273)]),o.qFKrd(_0x5e932d)}[r(468)](){let t=r;return e[t(1482)](-1,this[t(1362)])&&e[t(1254)](-1,this[t(948)])?B[t(941)](0,0,this[t(1535)]):e[t(1451)](-1,this[t(1362)])?B[t(941)](0,this[t(948)]+1,this.unsigned):B[t(941)](e[t(450)](this[t(1362)],1),this[t(948)],this[t(1535)])}[r(1192)](t){let n=r;return e[n(1550)]===n(1001)?t?this[n(781)+"E"]():this[n(1580)+"E"]():!0}[r(781)+"E"](){let t=r;if(e[t(1541)](e.EWyCq,e.EWyCq)){let n={surAq:function(c,d){return c&d},QWVWh:function(c,d){return c<d},vrYSB:function(c,d){return e[t(656)](c,d)},nZpDZ:function(c,d){return e.daLhQ(c,d)},aekby:function(c,d){return e[t(312)](c,d)},ZRMqj:function(c,d){return e[t(1258)](c,d)},KMryi:function(c,d){return c<d},Hfdtx:function(c,d){return c|d},sXiqy:function(c,d){return e[t(753)](c,d)},EWpmB:function(c,d){return e[t(870)](c,d)},tSXtT:function(c,d){return e[t(834)](c,d)},zwncL:function(c,d){return e.RUDWc(c,d)},QJsib:function(c,d){return c&d}},o=4294967295;return function(c,d,p=!0){let g=t,l=(g(322)+g(1517)+"4|5|1|3|9")[g(970)]("|"),v=0;for(;;){switch(l[v++]){case"0":o=n[g(1049)](127,c[d])>>>0;continue;case"1":if(n[g(804)](c[d++],128))return{value:p?o:n[g(1013)](0,o),offset:d};continue;case"2":if(n.QWVWh(c[d++],128))return{value:p?o:n[g(887)](0,o),offset:d};continue;case"3":if(n[g(615)](d+=5,c[g(769)]))throw d=c[g(769)],_0x291945(d,10,c[g(769)]);continue;case"4":if(n[g(804)](c[d++],128))return{value:p?o:n[g(1013)](0,o),offset:d};continue;case"5":o=n[g(1013)](o,n[g(1399)](15&c[d],28))>>>0;continue;case"6":if(n[g(522)](c[d++],128))return{value:p?o:n.vrYSB(0,o),offset:d};continue;case"7":if(n[g(522)](c[d++],128))return{value:p?o:0|o,offset:d};continue;case"8":o=n[g(397)](o,n.ZRMqj(n[g(1049)](127,c[d]),7))>>>0;continue;case"9":return{value:p?o:n[g(1132)](0,o),offset:d};case"10":o=n.Hfdtx(o,n[g(1114)](n[g(1053)](127,c[d]),21))>>>0;continue;case"11":o=n[g(1572)](o|n.EWpmB(n[g(1233)](127,c[d]),14),0);continue}break}}}else{let n=this[t(948)],o=this.low;return[255&o,e[t(1564)](e[t(951)](o,8),255),e.xHrRb(e[t(1438)](o,16),255),e[t(469)](o,24),e[t(424)](255,n),e[t(1564)](e.hamIT(n,8),255),e[t(1356)](e.qTRQU(n,16),255),n>>>24]}}[r(1580)+"E"](){let t=r,n=this[t(948)],o=this[t(1362)];return[e[t(756)](n,24),e[t(461)](e[t(713)](n,16),255),e[t(107)](n,8)&255,255&n,o>>>24,e.zZnSz(o>>>16,255),e[t(1265)](e[t(463)](o,8),255),e.angSb(255,o)]}}let $r=new B(0,0,!1),Uo=new B(0,0,!0),Ho=B[r(941)](-1,2147483647,!1),Ko=B[r(941)](-1,-1,!0),jo=B[r(941)](0,-2147483648,!1);var Oe=(function(s){let t=r,n=e[t(1047)].split("|"),o=0;for(;;){switch(n[o++]){case"0":return s;case"1":s[s[e[t(1148)]]=5004]=e.RMQuc;continue;case"2":s[s[e[t(1237)]]=5003]=e[t(1237)];continue;case"3":s[s[e.RGrdc]=5001]=e.RGrdc;continue;case"4":s[s[e[t(778)]]=5005]=t(655)+"OR";continue;case"5":s[s[e[t(910)]]=5002]=e.jVFnY;continue}break}})({});class it{constructor(t){let n=r;this[n(1345)]=t,this[n(707)]=null}}class Qr extends it{constructor(t,n){let o=r;super(t),this[o(972)]=n&&n[o(972)]||null}}class es extends it{constructor(t,n){let o=r,c=e[o(1409)][o(970)]("|"),d=0;for(;;){switch(c[d++]){case"0":super(t);continue;case"1":this.colno=n&&n[o(1016)]||0;continue;case"2":this[o(972)]=n&&n[o(972)]||"";continue;case"3":this[o(1139)]=n&&n[o(1139)]||5001;continue;case"4":this[o(232)]=n&&n[o(232)]||"";continue;case"5":this[o(1523)]=n&&n[o(1523)]||null;continue;case"6":this[o(698)]=n&&n.lineno||0;continue}break}}}class ts extends it{constructor(t,n){let o=r;super(t),this[o(1139)]=n&&n[o(1139)]||0,this[o(1205)]=n&&n[o(1205)]||"",this.wasClean=n&&n[o(1191)]||!1,this["willReco"+o(1320)]=n&&n[o(1322)+o(1320)]||!1}}class ns extends it{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n[o(162)]||null}}class rs extends ns{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n.data||null,this[o(972)]=n&&n.message||null}}class ss extends it{constructor(t,n){let o=r;super(t),this[o(162)]=n&&n[o(162)]||null}}function fe(s,{message:t,code:n,error:o}){return new es(s,{message:t,code:n,error:o})}function ge(s,{code:t,reason:n,wasClean:o,willReconnect:c}){return new ts(s,{code:t,reason:n,wasClean:o,willReconnect:c})}function is(s,{data:t,message:n}){return new rs(s,{data:t,message:n})}function os(s,{data:t}){let n=r,o={KlAzg:function(c,d){return e[A(1312)](c,d)}};if(e[n(1528)](e.KDTPp,e[n(557)])){if(zkWaln[n(734)](_0x3619cb,_0x123637))return _0x1f8eeb}else return new ss(s,{data:t})}function Jn(s,{message:t}){let n=r,o={WLagW:e[n(433)]};if(e[n(1589)](e.avsDO,e[n(402)]))this[n(886)](o[n(1070)],_0x2f1129),this.onerror&&this[n(740)](_0x3fb01c);else return new Qr(s,{message:t})}class as{constructor(t,n){let o=r;this[o(500)+"s"]=t,this.maxRetries=n,this["currentI"+o(1453)]=0,this["currentEndpointT"+o(1241)+"t"]=0}["resetEndpointCon"+r(629)](){let t=r;if(e.IfxPP(e.yrtSo,t(828)))this[t(1406)+t(1453)]=0,this[t(328)+"ndpointT"+t(1241)+"t"]=0;else{let n=this["_endpoin"+t(355)]?.[t(536)+t(1542)+"nt"]();this[t(1284)](t(952)+n),_0x2c246c()}}[r(185)+"es"](){let t=r;this[t(328)+t(145)+t(1241)+"t"]=0}[r(536)+"ntEndpoint"](){let t=r;return this[t(500)+"s"][this[t(1406)+"ndex"]]}["getCurre"+r(1542)+"ntTriesC"+r(809)](){let t=r;return this[t(328)+t(145)+"riesCount"]}["checkRea"+r(725)+"es"](){let t=r;return!!(e[t(873)](this[t(1406)+t(1453)],this[t(500)+"s"][t(769)])||e[t(616)](this[t(1406)+"ndex"],e[t(371)](this[t(500)+"s"].length,1))&&e.uNTcx(this["currentE"+t(145)+t(1241)+"t"],this.maxRetries))}["checkCur"+r(830)+r(867)+r(1562)+r(205)](){let t=r;return e[t(1534)](this[t(1406)+"ndex"],this[t(500)+"s"][t(769)])?!0:e[t(1021)](this[t(328)+t(145)+"riesCount"],this[t(965)+"es"])}[r(1287)+r(1291)+"pointAnd"+r(1459)+r(122)](){let t=r;return this[t(328)+t(145)+"riesCount"]=1,this["currentI"+t(1453)]++,this.endpoints[this[t(1406)+t(1453)]]}[r(536)+r(1542)+r(1093)+r(1084)](){let t=r;return this[t(328)+t(145)+"riesCount"]++,this.getCurrentEndpoint()}}let ot=(e.aLuwS!=typeof globalThis&&e[r(347)](e[r(652)],globalThis[r(900)+"tor"].name)||e[r(846)](e[r(1238)],typeof window)&&e[r(250)](e.ZSeXY,window[r(900)+"tor"].name))&&e.aLuwS!=typeof document,Je=e[r(726)](e[r(1238)],typeof globalThis)&&(e[r(364)](e[r(1386)],globalThis[r(900)+r(531)][r(695)])||r(1068)+r(1066)+r(595)+"pe"===globalThis[r(900)+"tor"][r(695)])&&e[r(579)](e[r(1238)],typeof tt),bt=(e[r(1087)](e[r(1238)],typeof globalThis)&&e.CRxat(e[r(1386)],globalThis[r(900)+r(531)][r(695)])||e[r(1238)]==typeof globalThis||e[r(1238)]!=typeof globalThis&&!!globalThis["WeixinJS"+r(813)])&&e[r(1087)](e[r(1238)],typeof wx),St=e[r(1087)](r(1166)+"d",typeof globalThis)&&(e[r(1563)](e[r(370)],globalThis[r(900)+r(531)].name)||e[r(1451)]("SharedWorkerGlob"+r(1036),globalThis[r(900)+r(531)][r(695)])||e.JJKFp(e[r(1077)],globalThis[r(900)+r(531)][r(695)]))&&e[r(846)](e[r(1238)],typeof self),Go=r(1166)+"d"!=typeof globalThis&&e[r(1386)]===globalThis[r(900)+r(531)].name&&r(1166)+"d"!=typeof global&&e.Jgvpy(e[r(1386)],global[r(900)+r(531)][r(695)])&&e[r(580)](r(1166)+"d",typeof process)&&!!process.version;class Vn{constructor(){let t=r;this[t(551)+"rs"]={}}[r(886)](t,...n){let o=r,c=this[o(551)+"rs"][t];if(c)c[o(625)]().forEach(d=>d.fn[o(1228)](d[o(1439)],n));else if(e[o(111)](e[o(433)],t)&&!this[o(740)]){let d=n[o(769)]&&n[0];if(e[o(1125)](d,Error))throw d;let p=new Error(e[o(1295)](e[o(792)],d?e[o(194)](e[o(1385)](" (",d[o(972)]),")"):""));throw p[o(682)]=d,d}return this}[r(589)](t,n){let o=r;if(e[o(1032)](void 0,t))this[o(551)+"rs"]={};else if(e[o(584)](void 0,n))this[o(551)+"rs"][t]=null;else{let c=this[o(551)+"rs"][t];if(c)for(let d=0;d<c[o(769)];)e.SmaYr(c[d].fn,n)?c.splice(d,1):++d}return this}on(t,n,o){let c=r;return(this[c(551)+"rs"][t]||(this[c(551)+"rs"][t]=[])).push({fn:n,ctx:o||this}),this}}class Wo extends Vn{[r(583)+r(611)+r(296)](t){let n=r;return t[n(211)]||t.errNo?(n(711)+" "+(t[n(211)]||"")+n(1404)+(t[n(316)]||""))[n(387)]():JSON[n(817)+"y"](t)}constructor(t,n,o){let c=r;super(),this[c(179)]=null,bt&&wx[c(140)+c(1349)]&&(this[c(179)]=wx[c(140)+"ocket"]({url:t,protocols:n,header:o,fail:this[c(1489)+c(1369)+"lHandler"][c(389)](this),success:this["_createS"+c(1056)+c(982)+c(435)][c(389)](this)})),Je&&tt[c(140)+c(1349)]&&(this._socket=tt[c(140)+c(1349)]({url:t,protocols:n,header:o,fail:this[c(1489)+c(1369)+c(926)][c(389)](this),success:this[c(1489)+c(1056)+c(982)+c(435)].bind(this)}))}[r(1489)+"ocketSuc"+r(982)+r(435)](){let t=r;Promise[t(1024)]().then(()=>{let n=t;this[n(295)+n(650)]()})}[r(1489)+r(1369)+r(926)](t){let n=r,o={TMaTb:function(c,d,p){return e[A(791)](c,d,p)},dieVl:e.dHjtG,DJqPQ:e[n(290)]};Promise[n(1024)]().then(()=>{let c=n,d=o[c(1467)](fe,o[c(1176)],{message:this[c(583)+c(611)+c(296)](t)});this[c(886)](o[c(1176)],d);let p=o[c(1467)](ge,o[c(1367)],{reason:this[c(583)+c(611)+c(296)](t)});this[c(886)](o[c(1367)],p)})}["_addWsLi"+r(650)](){let t=r,n={EvcQN:function(o,c){return e[A(176)](o,c)},IVwak:e[t(796)],vGyWD:e[t(1067)],wDYAq:"open",EXyZr:function(o,c,d){return e[t(1204)](o,c,d)},EHeLU:e[t(290)],OZpPl:e.UyEkY};if(e[t(616)](t(1488),e.dyOQQ))this[t(179)][t(845)](o=>{let c=t;n[c(486)](n[c(1226)],n.vGyWD)?this.emit(n[c(1048)],n.EXyZr(os,n[c(1048)],{...o,data:o[c(211)]||""})):this[c(799)]?.[c(1364)](_0x355c9f.message_id)}),this[t(179)][t(923)](o=>{let c=t;this[c(886)](n[c(222)],n.EXyZr(ge,n[c(222)],{...o}))}),this[t(179)][t(234)+"e"](o=>{let c=t;this.emit(n[c(662)],n[c(1304)](is,n[c(662)],{...o}))}),this._socket.onError(o=>{let c=t;if(e[c(636)](c(775),e[c(1247)]))this[c(886)](e[c(433)],e.rFyLl(fe,e.dHjtG,{...o,message:o[c(211)]||""}));else return this[c(799)]?.[c(1364)](_0x3842ef)});else return 0}[r(1104)](t){let n=r,o={NFOIm:e[n(433)],ZcULp:function(c,d){return e.yJScy(c,d)},DvnJB:function(c,d){return e[n(699)](c,d)}};if(e[n(1125)](t,Uint8Array)){let c=t.buffer[n(625)](t[n(829)+"et"],e.zRGlO(t[n(962)+"th"],t[n(829)+"et"]));this[n(179)]&&this[n(179)][n(1104)]({data:c,fail:d=>{let p=n;this[p(886)](p(1523),fe(o[p(1318)],{message:this[p(583)+p(611)+"age"](d)}))}})}else this[n(179)]&&this._socket[n(1104)]({data:t,fail:c=>{let d=n;if(e.TMtSG(e.nagyH,e.HxQvH))this[d(886)](e[d(433)],e.lYxdw(fe,d(1523),{message:this["_formatErrorMess"+d(296)](c)}));else{let p=this[d(551)+"rs"][_0x1313f7];if(p)for(let g=0;iJhXng[d(1168)](g,p[d(769)]);)iJhXng[d(105)](p[g].fn,_0x2b1eac)?p[d(1058)](g,1):++g}}})}[r(514)](t,n){let o=r;this[o(179)]&&this._socket[o(514)]({code:t,reason:n})}[r(1514)+"Listener"](t,n){let o=r;e[o(1219)](o(731),e[o(445)])?(_0x198465[o(1378)]["removeCh"+o(218)](_0x3cd09e),_0x3192db[o(612)+o(1524)]=void 0,e[o(1222)](_0x2547af,_0x2dc254&&_0x4cd2c0.msg||e[o(221)])):this.on(t,n)}[r(1086)+r(419)+"ner"](t,n){this.off(t,n)}get[r(700)+"te"](){let t=r;return this[t(179)][t(700)+"te"]}get[r(1109)+"pe"](){let t=r;return this._socket[t(1109)+"pe"]}set[r(1109)+"pe"](t){}get[r(1113)](){let t=r,n={wALJV:function(o,c,d){return e[A(1553)](o,c,d)}};if(e[t(178)](t(1299),e.hGmrz))_0x18bd78(_0x37da3b,66),_0x418ca4(_0x153a7c,_0x748ba1[t(769)]),kmPhMY[t(677)](_0x7fc9b3,_0x5c8338,_0x51dc6a);else return this[t(179)][t(1113)]}get[r(738)](){return this[r(179)].protocol}get[r(174)+"ns"](){let t=r;return this[t(179)][t(174)+"ns"]}get["buffered"+r(533)](){return 0}}function Jo(s,t){let n=r;if(t)return new t(s[n(1113)],s[n(738)]);if(bt||Je)return new Wo(s[n(1113)],s[n(738)],s[n(491)]);if(e.ETYUR(ot,St)&&e[n(1092)](e[n(1238)],typeof WebSocket)&&WebSocket)return new WebSocket(s.url,s[n(738)+"s"])}function Vo(s){let t=r,n="1|3|4|2|0".split("|"),o=0;for(;;){switch(n[o++]){case"0":return!1;case"1":if(s)return!0;continue;case"2":if(e.mJRfa(ot,St)&&e[t(580)](e.aLuwS,typeof WebSocket)&&WebSocket)return!0;continue;case"3":if(bt&&wx[t(140)+"ocket"])return!0;continue;case"4":if(Je&&tt[t(140)+"ocket"])return!0;continue}break}}function xs(s,t,n){let o=r,c={VQzSR:function(g,l){return e[A(411)](g,l)},QXjKY:e.ARkTc,ApESz:function(g,l){return e[A(1451)](g,l)},ZnuYO:function(g,l){return e.JAXHQ(g,l)}},d=-1;async function p(g){let l=A;return c[l(152)](g,d)?Promise[l(1138)](new Error(c[l(800)])):(d=g,c[l(1270)](g,n.length)?Promise.resolve():n[g].bind(s)(t,p.bind(null,c[l(1357)](g,1))))}e[o(188)](p,0)}function cs(s){let t=r,n=0,o=0;for(let c=0;c<s[t(769)];++c)if(o=s[t(989)+"At"](c),o<128)n+=1;else if(o<2048)n+=2;else if(e.zAcAt(e[t(256)](64512,o),55296)&&e[t(1108)](e[t(253)](64512,s[t(989)+"At"](e.RSlhG(c,1))),56320))if(e[t(548)](t(768),e.pWOGC)){let d="connect "+_0x575aa2+(" timeout, max re"+t(674)+t(415));this._debug(d),this[t(964)+"hErrorEv"+t(783)](e[t(1553)](_0x206d28,e[t(433)],{message:d,code:_0x4bdc7c["MAX_RETR"+t(1128)+"R"]}));return}else++c,n+=4;else n+=3;return n}function fs(s,t,n){let o=r;if(e[o(1532)](n-t,1))return"";let c="";for(let d=t;e[o(1526)](d,n);){let p=s[d++];if(e[o(1361)](p,127))c+=String[o(620)+o(639)](p);else if(p>=192&&e[o(623)](p,224))c+=String["fromChar"+o(639)](e.FBIPy(e[o(1460)](e[o(1574)](31,p),6),e[o(1045)](63,s[d++])));else if(p>=224&&e[o(678)](p,240))c+=String[o(620)+o(639)](e[o(1146)](e.VcHJR((15&p)<<12,e[o(260)](e[o(907)](63,s[d++]),6)),e[o(1574)](63,s[d++])));else if(p>=240)if(e.qMlmZ(e[o(663)],"zNLXX"))_0x259ae3(e[o(1e3)]),this[o(589)](o(304)+o(1227)+"s",_0x2cfdbe),this.off(e[o(901)],_0x36d4bc);else{let g=e[o(1531)](e[o(183)](e[o(1250)](e[o(1481)](7,p),18),e[o(1348)](e[o(134)](63,s[d++]),12))|e.BtTpC(e[o(673)](63,s[d++]),6),e[o(840)](63,s[d++]))-65536;c+=String[o(620)+o(639)](e.REkTx(55296,g>>10)),c+=String[o(620)+o(639)](e[o(1289)](56320,e[o(863)](1023,g)))}}return c}function Yn(s,t,n){let o=r,c=n,d,p;for(let v=0;v<s[o(769)];++v)if(e[o(1136)](e[o(1313)],e.NoYQk))if(d=s[o(989)+"At"](v),e.BvBRI(d,128))t[n++]=d;else if(e[o(1389)](d,2048))t[n++]=e[o(1052)](e[o(172)](d,6),192),t[n++]=e[o(1425)](63&d,128);else if(e[o(1573)](e[o(680)](64512,d),55296)&&e[o(364)](e[o(1455)](64512,p=s[o(989)+"At"](e.DHNef(v,1))),56320)){let b=e[o(788)][o(970)]("|"),D=0;for(;;){switch(b[D++]){case"0":t[n++]=e[o(128)](63&d,128);continue;case"1":t[n++]=e[o(453)](d,18)|240;continue;case"2":d=e[o(943)](65536,e.uhFZg(1023&d,10))+e[o(1423)](1023,p);continue;case"3":t[n++]=e[o(1155)](e[o(453)](d,6)&63,128);continue;case"4":t[n++]=e[o(772)](e[o(863)](e[o(1143)](d,12),63),128);continue;case"5":++v;continue}break}}else if(e[o(1031)](o(1266),e[o(360)])){var g=_0xf8a8f[_0x424ac3];if(eujvuM.TKYEw(void 0,g))return g.exports;var l=_0x3aed19[_0x92dc04]={exports:{}};return _0x500fd1[_0x26c759](l,l[o(1321)],_0x4f4862),l[o(1321)]}else t[n++]=e[o(505)](e.wYCVd(d,12),224),t[n++]=e[o(1336)](e[o(130)](d,6)&63,128),t[n++]=e[o(184)](63&d,128);else this[o(886)](e[o(1441)],_0x566fe9),this.onmessage&&this[o(917)+"e"](_0x6ecaba);return e[o(330)](n,c)}async function us(s){let t=r;if(t(879)===e[t(689)]){if(e[t(702)](e[t(451)],typeof s)){let n=new Uint8Array(e[t(196)](cs,s));return Yn(s,n,0),n}return e.KJSbT(s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s[t(962)+"th"])}else{let n=0,o=[];for(;e[t(1039)](n,_0x2694c5.byteLength);){let{offset:c}=e[t(258)](_0x4953a0,_0x3342e2,n);n=c;let d={cursor_name:"",cursor:0,service:0},{value:p,offset:g}=e[t(439)](_0x37e20d,_0x165636,n);d[t(1123)]=p,n=g;let{value:l,offset:v}=e[t(314)](_0x2f6604,_0x3932d6,n);n=v,d[t(1064)+"ame"]=e[t(1293)](_0x1e9b22,_0x16be0a,n,e[t(235)](n,l)),n+=l;let{value:b,offset:D}=e[t(511)](_0x3dbdad,_0xc85021,n);d.cursor=b.toNumber(),n=D,o[t(473)](d)}return o}}function Yo(s){let t=r,n={IOpNt:t(514)};if(e[t(1219)](e[t(1436)],e[t(872)]))try{if(e[t(850)](t(263),e[t(166)]))this[t(886)](n[t(819)],_0xa77c34),this.onclose&&this.onclose(_0x2ad253);else return e.geXZZ!=typeof s&&(e[t(1125)](s,ArrayBuffer)||s.buffer&&e[t(1125)](s[t(1464)],ArrayBuffer))||e[t(726)](t(1556),typeof s)?"":(JSON[t(1324)](s),e[t(346)])}catch{return e[t(668)](e[t(451)],typeof s)?e[t(1196)]:""}else _0x1cd4ed.d=(o,c)=>{let d=t;for(var p in c)_0x59b9c8.o(c,p)&&!_0x3e0e9e.o(o,p)&&_0x27fdd5[d(1316)+"operty"](o,p,{enumerable:!0,get:c[p]})}}let Xo=(s,t)=>{let n=r;switch(s){case e[n(578)]:case e.TefRI:return{[n(1429)+s]:1,"x-tt-env":t};default:return{}}};class Zo{constructor(t){let n=r;this[n(742)+n(809)]=t,this[n(1480)]=0}[r(568)](){let t=r,n={tChrb:function(o,c,d){return e.Ljifb(o,c,d)},Sfmqh:function(o,c){return o>>c},tEbcP:function(o,c){return o+c},ZxKnL:function(o,c){return o&c}};t(1071)==="DjXbZ"?this.count++:(_0x28c17d-=65536,_0x8373bb+=spjHDm[t(1133)](_0x1948c8,spjHDm.Sfmqh(_0x2d1394,10)+55296,spjHDm.tEbcP(spjHDm.ZxKnL(1023,_0x128b16),56320)),_0x1b206c+=3)}[r(613)+r(960)+"nt"](){let t=r;return e[t(189)](this.count,this["maxLossC"+t(809)])}[r(685)+r(996)](t=0){let n=r;this["maxLossC"+n(809)]=t,this[n(1480)]=0}}async function $o(s){let t=r,n={NtKYJ:function(o,c){return e.vtQnU(o,c)},nccvi:e[t(221)],eqPEK:"script",NQhFF:function(o,c){return e.qesOz(o,c)},njNOh:e.vjWnc};return new Promise(o=>{let c=t,d={zJvgk:function(p,g){return n[A(762)](p,g)}};if(!ot)return o(n[c(498)]);try{let p=document[c(864)+c(921)](n[c(688)]);window[c(612)+c(1524)]=g=>{let l=c;document[l(1378)][l(766)+l(218)](p),window[l(612)+l(1524)]=void 0,d[l(1149)](o,g&&g[l(479)]||l(363)+l(1205))},p[c(1345)]=c(1260)+c(378),p.src=n[c(919)](s[c(1198)](/^ws/,c(897)),n[c(526)]);try{document[c(1378)].appendChild(p)}catch{document[c(1378)][c(766)+c(218)](p)}}catch{window[c(612)+c(1524)]=void 0,o(n[c(498)])}})}function ze(s,t,n){let o=r;return!!s?.[o(345)](c=>c[o(988)]===t&&c[o(1472)]===n)}function at(s,t){let n=r;return s?.[n(345)](o=>o[n(988)]===t)?.[n(1472)]}let Xn=null;async function Qo(){let s=r;return Xn||(Xn=Promise[s(1024)]()[s(839)](ye[s(389)](ye,"idb"))),Xn}class e0 extends Vn{constructor(t,n){let o=r;super(),this[o(1235)]=t,this[o(1397)]=n,this[o(799)]=void 0,this[o(1540)+o(1277)]=null}async[r(1144)](){await this[r(710)]()}async[r(710)](){let t=r,n={vDSSc:function(o){return o()},ZtciJ:function(o,c,d,p){return e[A(501)](o,c,d,p)},szkOp:e[t(203)],xEVpa:function(o,c){return e.CyAGF(o,c)}};if(!this[t(799)]){if(this[t(1540)+t(1277)])return this._initPromise;try{if(e[t(1174)]===t(1075))_0x1dabb9[t(942)](_0x2d6672);else{let o=this[t(1235)],c=this[t(1397)];this._initPromise=(async()=>{let d=t,{openDB:p}=await n[d(592)](Qo);this[d(799)]=await n[d(856)](p,d(612)+"_"+o,1,{upgrade(g){g[d(1493)+"jectStore"](o,{keyPath:c})}})})(),await this[t(1540)+t(1277)]}}catch(o){e[t(437)](e[t(712)],t(795))?console[t(942)](o):(this[t(173)+t(719)][t(473)](_0x2ef492),this._debug(n[t(1334)],_0x19d858))}finally{if(e[t(994)](t(192),t(420)))return UDxHxi.xEVpa(this[t(1480)],this[t(742)+t(809)]);this[t(1540)+t(1277)]=null}}}async[r(1379)](t){let n=r;try{return await this[n(710)](),this[n(799)]?.[n(1379)](this._dbName,t)}catch(o){console[n(942)](o)}}async[r(868)](t,n){let o=r;return await this._init(),this._qosDB?.[o(1520)](this[o(1235)],t)}async del(t){let n=r;try{if(n(1452)===e[n(369)])_0x32b9a2=_0x57e0cb&&e[n(946)]==_0x33d0ef[n(738)]?n(866):e.jNmqN,_0x1d19f0=_0x29b819[n(1198)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0xb20af6=/^wss(.*:\/\/)/[n(1430)](_0x59e25a)?_0x55e651:""+_0x45d426+_0x1b9274;else return await this[n(710)](),this[n(799)]?.[n(913)](this[n(1235)],t)}catch(o){console[n(942)](o)}}async[r(245)](){let t=r;try{return await this[t(710)](),this[t(799)]?.[t(245)](this[t(1235)])}catch(n){console.log(n)}}async[r(606)](){let t=r;return await this._init(),this[t(799)]?.getAllKeys(this[t(1235)])}async[r(1034)](){let t=r;return e[t(437)](e[t(368)],t(1491))?e.yFBmD(e[t(451)],typeof _0x437c5a)?e[t(1196)]:"":(await this._init(),this[t(799)]?.[t(1034)](this[t(1235)]))}async closeDB(){let t=r;try{this[t(799)]?.[t(514)](),this[t(799)]=void 0}catch(n){console[t(942)](n)}}get[r(129)](){let t=r;try{return!!this._qosDB}catch(n){return console[t(942)](n),!1}}}class t0{constructor(t,n){let o=r;e[o(1035)](e[o(1376)],e[o(1376)])?(this[o(332)]=t,this[o(545)]=n,this[o(799)]=localStorage):(e[o(1586)](_0x2f07ca,_0x51b3f5,96),e[o(1360)](_0x2901c2,_0xb5ef71,e[o(1042)](_0x61b5ef,_0x23eff3)))}async[r(1144)](){}get _prefix(){let t=r;return t(612)+"_"+this[t(332)]}async[r(1379)](t){let n=r,o=this[n(799)][n(1363)](this[n(492)]);return JSON[n(1324)](e[n(1028)](o,"{}"))[t]}async set(t,n){let o=r,c=this._qosDB[o(1363)](this[o(492)]),d=JSON[o(1324)](c||"{}");return d[n||t[this[o(545)]]]=t,this[o(799)][o(175)](this[o(492)],JSON[o(817)+"y"](d)),n||t[this[o(545)]]}async[r(1364)](t){let n=r,o=this[n(799)][n(1363)](this[n(492)]),c=JSON.parse(e.ETYUR(o,"{}"));return c[t]=void 0,this[n(799)][n(175)](this[n(492)],JSON.stringify(c))}async clear(){let t=r;return this[t(799)][t(245)]()}async keys(){let t=r,n=this[t(799)][t(1363)](this._prefix),o=JSON[t(1324)](e[t(1225)](n,"{}"));return Object[t(606)](o)}async[r(1034)](){let t=r,n=this[t(799)][t(1363)](this._prefix),o=JSON[t(1324)](e.mJRfa(n,"{}"));return Object[t(1085)](o)}closeDB(){return Promise[r(1024)]()}get[r(129)](){return!!this[r(799)]}}class n0{constructor(t,n){let o=r;this[o(332)]=t,this[o(545)]=n,this[o(799)]=Je?tt:bt?wx:null}async[r(1144)](){}get _prefix(){let t=r;return t(612)+"_"+this[t(332)]}async[r(1379)](t){let n=r,o=this._qosDB["getStora"+n(361)](this[n(492)]);return JSON[n(1324)](e[n(1359)](o,"{}"))[t]}async[r(868)](t,n){let o=r,c=this[o(799)][o(1098)+o(361)](this[o(492)]),d=JSON[o(1324)](c||"{}");return d[n||t[this._pathKey]]=t,this[o(799)][o(1314)+"geSync"](this[o(492)],JSON.stringify(d)),n||t[this[o(545)]]}async del(t){let n=r,o=this[n(799)][n(1098)+n(361)](this._prefix),c=JSON[n(1324)](o||"{}");return c[t]=void 0,this[n(799)][n(1314)+n(361)](this[n(492)],JSON[n(817)+"y"](c))}async[r(245)](){let t=r;if(e[t(920)](e[t(470)],e.oNnYr))e[t(228)](_0x42efb1,_0x3a8d7d,16),e.ougLh(_0x49b184,_0x2f159f,_0x4df6d0);else return this._qosDB[t(617)+t(1525)]()}async keys(){let t=r,n=this[t(799)][t(1098)+t(654)+"nc"](this[t(492)]),o=JSON[t(1324)](e.ETYUR(n,"{}"));return Object[t(606)](o)}async[r(1034)](){let t=r,n=this._qosDB["getStora"+t(654)+"nc"](this[t(492)]),o=JSON[t(1324)](e[t(215)](n,"{}"));return Object[t(1085)](o)}[r(421)](){return Promise[r(1024)]()}get[r(129)](){return!!this._qosDB}}function ds(s,t){let n=r;if(e[n(1359)](Je,Je))return new n0(s,t);if(e[n(1509)](ot,St)&&e[n(580)](e[n(1238)],typeof indexedDB))return new e0(s,t);if(e.eCJTl(ot,St)&&e.paVJv(n(1166)+"d",typeof localStorage))return new t0(s,t);throw new Error(e[n(1019)])}class r0{constructor(){let t=r;this[t(693)+t(337)+"Id"]=null,this[t(693)+"l"]=36e5,this._qosDB=e[t(223)](ds,e[t(1107)],e[t(142)])}async[r(693)+"lFlush"](){let t=r;e[t(1131)](clearInterval,this[t(693)+t(337)+"Id"]),this[t(693)+t(337)+"Id"]=setInterval(()=>{this[t(206)+"ired"]()},this[t(693)+"l"])}async openDB(){let t=r;await this[t(799)][t(1144)]()[t(839)](()=>{let n=t;this[n(693)+n(635)]()})}async flushExpired(){let t=r;(await this._qosDB?.getAll()||[])[t(1244)](({timestamp:c})=>c<Date[t(1446)]())[t(1282)](c=>{let d=t;this[d(799)]?.del(c[d(724)+"id"])})}async del(t){return this[r(799)]?.del(t)}async set(t,n){let o=r,c={Ejuxw:function(d){return e[A(169)](d)},DGBqy:"AbortError"};if(e[o(1032)](o(642),e[o(300)]))return this[o(799)]?.[o(868)]({message_id:t,timestamp:n});{let d={UGjhw:eujvuM.dHjtG,dZaWG:eujvuM[o(443)]},p=()=>{let v=o;_0x548672[v(1086)+v(419)+v(658)]("complete",g),_0x3a591b["removeEv"+v(419)+v(658)](d[v(200)],l),_0x38a9f9[v(1086)+v(419)+v(658)](d[v(554)],l)},g=()=>{let v=o;RwAdZG.Ejuxw(_0x18e716),RwAdZG[v(442)](p)},l=()=>{let v=o;_0x4d93b8(_0x4696b5[v(1523)]||new _0x11384c(RwAdZG.DGBqy,RwAdZG[v(1372)])),p()};_0x43777d[o(1514)+o(735)](eujvuM.DzvxB,g),_0x4bd01b[o(1514)+"Listener"](eujvuM[o(433)],l),_0x1a9e43[o(1514)+o(735)](eujvuM.leUzB,l)}}async[r(1379)](t){let n=r;return this[n(799)]?.[n(1379)](t)}async[r(421)](){let t=r;e[t(880)](clearInterval,this[t(693)+t(337)+"Id"]),await this[t(799)]?.[t(421)]()}get[r(129)](){let t=r;return this[t(799)]?.[t(129)]}}function Zn(s){let t=r,n=!!this._options[t(1203)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e[t(1583)](ze,s[t(972)][t(491)],e[t(722)],"2"),c=o&&e[t(979)](ze,s.message.headers,t(1332)+"er_qos_ack","1"),d=o&&ze(s.message[t(491)],e[t(477)],"1"),p=d?e[t(660)](at,s.message[t(491)],e.geISi)?.[t(970)](",").filter(Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:d,ackMsgIds:p}}async function ls(){let s=r;return this[s(821)+"ger"]||(this[s(821)+s(338)]=new r0),this[s(821)+"ger"][s(129)]||await this[s(821)+s(338)][s(1144)](),this[s(821)+s(338)]}async function s0(s,t){let n=r,{enableAutoAck:o}=this[n(1094)],c=ze(s[n(972)][n(491)],e[n(925)],"1"),d=e[n(979)](ze,s[n(972)].headers,n(1161),"1"),p=Zn[n(861)](this,s);if(o&&c){let{SeqID:g,LogID:l,service:v,LogIDNew:b,method:D}=s[n(972)];this[n(1163)]({SeqID:g,LogID:l,LogIDNew:b,service:v,method:D,headers:[{key:n(1161),value:"1"},{key:e[n(905)],value:b||""},{key:e[n(329)],value:"0"}]})}d&&!p.isQoSAck&&this["_dispatc"+n(1200)+n(277)](s),e[n(648)](t)}async function i0(s,t){let n=r;this[n(1284)](e[n(464)],s[n(972)]),t()}async function o0(s,t){let n=r,o=e[n(985)](Vr,await e[n(1131)](us,s.data));try{if(e.rCKvh(o[n(1177)],Uint8Array))if(e[n(927)](e.nQSDt,e[n(238)]))try{return e[n(726)](e.geXZZ,typeof _0x16b5c4)&&(e[n(344)](_0x54f7dc,_0x21dba4)||_0x161619[n(1464)]&&e[n(1259)](_0x5612ff.buffer,_0x58b713))||e[n(1092)](e[n(451)],typeof _0x40ed3d)?"":(_0x2ea840[n(1324)](_0x28ae0b),n(1588)+n(334))}catch{return e[n(668)](n(1556),typeof _0x521e51)?e[n(1196)]:""}else{let c=e[n(1415)](this._options[n(1401)+n(852)],Object)?{force:!!this[n(1094)][n(1401)+n(852)].force,encoding:this[n(1094)][n(1401)+"ncoding"][n(1398)]?this[n(1094)][n(1401)+n(852)][n(1398)][n(1198)](/\s/g,"")[n(590)+n(280)]():""}:{force:!1,encoding:this[n(1094)][n(1401)+n(852)]?this[n(1094)][n(1401)+"ncoding"][n(1198)](/\s/g,"")[n(590)+"ase"]():""},d=o[n(1401)+n(852)]?o[n(1401)+n(852)][n(1198)](/\s/g,"")[n(590)+n(280)]():"",p=e[n(1125)](this._options[n(518)+n(1279)],Object)?{force:!!this[n(1094)][n(518)+"ype"].force,type:this[n(1094)][n(518)+"ype"][n(1345)]?this._options[n(518)+"ype"][n(1345)].replace(/\s/g,"")[n(590)+n(280)]():""}:{force:!1,type:this[n(1094)][n(518)+"ype"]?this[n(1094)]["payloadT"+n(1279)].replace(/\s/g,"")[n(590)+n(280)]():""},g=o[n(518)+"ype"]?o[n(518)+n(1279)][n(1198)](/\s/g,"").toLowerCase():"",l=p[n(1344)]?p[n(1345)]:g||p.type,v=c[n(1344)]?c[n(1398)]:d||c[n(1398)],b=[e[n(1196)],e[n(346)],n(1588)+"ion/json"+n(339)+"=utf-8",e[n(451)]],D=[n(1502)+"e",n(406)];this[n(1094)]["enableTr"+n(1272)+"extPayload"]&&b[n(136)](l)&&(!v||D[n(136)](v))?o.textPayload=e[n(1440)](fs,o.payload,0,o[n(1177)][n(962)+"th"]):o["textPayl"+n(323)]=""}else o[n(1407)+n(323)]=""}catch(c){o["textPayl"+n(323)]="",console[n(942)](c)}s[n(972)]=o,t()}function a0(s,t,n){let o={AYYxd:function(l,v){return e.uAThU(l,v)},YdIKz:function(l,v){return l+v}},c=e.kMJOx(n,8192),d=c>>>1,p=null,g=c;return function(l){let v=A;if(l<1||l>d)return s(l);o[v(1015)](g+l,c)&&(p=s(c),g=0);let b=t[v(861)](p,g,g+=l);return 7&g&&(g=o[v(1134)](7|g,1)),b}}let x0=4294967295;function c0(s,t,n){let o=r;return e.SfGRW(RangeError,e[o(278)](e[o(1099)](e.eXVGT(e[o(776)],s),e[o(1340)]),e[o(538)](t,1))+e[o(117)]+n)}function f0(s,t,n){let o=r,c={GwsGN:function(p,g){return p===g}};if(e[o(934)](n,x0))throw new Error(e[o(452)]);let d=3;for(;e.tSsnP(d,0);){if(e[o(1539)](e[o(1454)],e.Cyazs))return _0x54495c&&McNcTo.GwsGN(!0,_0x5ec468[o(1012)]);{let p=255&n;e[o(1101)](Qn,p,s,e[o(1333)](t,d)),n>>>=8,d--}}return t+4}function u0(s,t){let n=r,o=0,c=t,d=t+4;for(;e[n(858)](c,d);){let{value:p,offset:g}=e[n(1135)]($n,s,c);c=g,o=e[n(353)](e[n(1175)](o,8),0),o+=p}return{value:o,offset:d}}function d0(s,t,n){let o=r,c=e[o(133)][o(970)]("|"),d=0;for(;;){switch(c[d++]){case"0":return e[o(1101)](Yn,s,t,n)+n;case"1":if(e[o(214)](s[o(769)],40))return e[o(1004)](Yn(s,t,n),n);continue;case"2":if(!s)return n;continue;case"3":if(t.utf8Write)return e.CDDst(t.utf8Write(s,n),n);continue;case"4":if(t[o(562)])return t.write(s,n)+n;continue}break}}function l0(s,t){let n=r,o=new B(e[n(294)](e[n(1103)](e[n(870)](s[e[n(841)](t,4)],24),s[e[n(450)](t,5)]<<16)|e[n(929)](s[e[n(1294)](t,6)],8),s[e[n(1289)](t,7)]),e[n(1059)](e[n(1160)](e[n(1547)](s[e[n(1457)](t,0)],24),e[n(1460)](s[t+1],16))|e[n(824)](s[e.RSlhG(t,2)],8),s[e[n(1003)](t,3)]),!0);return t+=8,{value:o,offset:e[n(758)](t,8)}}function h0(s,t,n){let o=r,c={TYLmo:e.HcgdO};if(e.rPWla(e[o(1371)],e.babfT)){let d=s[o(1362)],p=s[o(948)];return t[n]=e.SpIXn(p,24),t[e[o(427)](n,1)]=e[o(390)](e[o(1438)](p,16),255),t[e[o(278)](n,2)]=e.CWOqs(p>>>8,255),t[n+3]=e[o(1217)](255,p),t[e[o(984)](n,4)]=e[o(1418)](d,24),t[e[o(752)](n,5)]=e[o(1456)](e[o(1566)](d,16),255),t[e.tkQdE(n,6)]=e[o(1549)](e[o(1033)](d,8),255),t[e.FpPLg(n,7)]=255&d,n+=8,n}else this[o(1094)][o(894)]&&_0x5072d6[o(942)][o(1228)](_0x217449,[c[o(319)],..._0x443c9b])}function $n(s,t){let n=r;return s[n(367)+"8"]?{value:s[n(367)+"8"](t),offset:e.dirxG(t,1)}:{value:e[n(1265)](255,s[t]),offset:t+1}}function Qn(s,t,n){let o=r;return t[o(103)+"t8"]?t[o(103)+"t8"](s,n):t[n]=e[o(311)](255,s),e.EcBqy(n,1)}let g0=function(s){return new Uint8Array(s)},p0=e[r(1087)](e.aLuwS,typeof Buffer)?Buffer[r(822)+r(1165)]:e[r(1424)](a0,g0,Uint8Array.prototype[r(257)]),m0=16,er=32;function w0(s){let t=r,n=0,o={};for(let c=0;e[t(678)](c,s.length);c++)o[s[c][t(1064)+"ame"]]=e[t(1245)](cs,s[c][t(1064)+t(1394)]),n+=e[t(986)](14,o[s[c].cursor_name]);return[n,o]}function hs(s,t,n){let o=r,c={NgtWg:o(555)+o(808)+o(995),HQfHu:e[o(1218)],mKqmx:function(v,b,D,I){return e[o(1583)](v,b,D,I)},cFHLH:e.rbyMP,tBSza:e[o(953)],WuJgN:function(v,b,D,I){return e.waxuh(v,b,D,I)},Iywei:o(889)+o(1317),teUMq:e.MZNbM,nCDVd:function(v,b,D,I){return e.EygIl(v,b,D,I)}},[d,p]=e[o(1581)](w0,s),g=p0(d),l=0;return s[o(1282)](v=>{let b=o,D=c[b(1142)][b(970)]("|"),I=0;for(;;){switch(D[I++]){case"0":console[b(942)](c[b(150)],l);continue;case"1":l=c.mKqmx(f0,g,l,v[b(1123)]||0);continue;case"2":console.log(b(978),l);continue;case"3":console[b(942)](c[b(1365)],l);continue;case"4":console.log(c[b(372)],l);continue;case"5":l=c[b(182)](Qn,0,g,l);continue;case"6":l=c[b(785)](Qn,p[v[b(1064)+b(1394)]],g,l);continue;case"7":l=c[b(785)](h0,B[b(1224)+"er"](v.cursor||t),g,l);continue;case"8":console[b(942)](c[b(651)],v,v[b(1123)]);continue;case"9":console[b(942)](c[b(394)],l);continue;case"10":l=c[b(1437)](d0,v[b(1064)+b(1394)],g,l);continue}break}}),{frameType:er,headers:[{key:e.gJnnC,value:n}],payload:g}}function _0(s){let t=r,n=0,o=[];for(;e[t(623)](n,s[t(962)+"th"]);){let{offset:c}=e.GtXKt($n,s,n);n=c;let d={cursor_name:"",cursor:0,service:0},{value:p,offset:g}=e[t(1521)](u0,s,n);d[t(1123)]=p,n=g;let{value:l,offset:v}=e.mrWFf($n,s,n);n=v,d[t(1064)+"ame"]=e[t(979)](fs,s,n,e.NldmI(n,l)),n+=l;let{value:b,offset:D}=e[t(692)](l0,s,n);d[t(959)]=b[t(696)](),n=D,o[t(473)](d)}return o}function y0(){let s=r;return{frameType:er,headers:[{key:e[s(1448)],value:"FILE_NOT"+s(1106)}],payload:void 0}}class v0{constructor(t,n,o){let c=r;this[c(1463)+c(429)]=t,this["_cursorF"+c(409)]=n,this["_message"+c(1307)]=o,this[c(799)]=e[c(1329)](ds,this[c(1463)+c(429)],e[c(315)])}async[r(1144)](){let t=r;if(e.ghIPs===t(225))return this[t(328)+t(145)+"riesCount"];await this[t(799)][t(1144)]()}async[r(1413)+"rs"](){let t=r;if(!this[t(799)].isReady)return;let n=this["_message"+t(1307)],o=await this[t(799)][t(1034)]();switch(console[t(942)](e[t(399)],o),n){case e.hmouZ:return o&&o[t(769)]?e[t(896)](hs,o,0,this[t(904)+t(409)]):void 0;case e[t(240)]:return;case e[t(474)]:return o&&o[t(769)]?e[t(501)](hs,o,0,this[t(904)+t(409)]):y0()}}async[r(868)](t,n,o){let c=r;return console[c(942)]("setdb",t,n,o),this[c(799)][c(868)]({cursor_name:t,cursor:n,service:o})}async[r(1519)+"rs"](t){let n=r,o=e[n(598)](_0,t);for(let c of o)console[n(942)](e[n(744)],o),await this[n(799)].set(c)}async get(t){let n=r;return(await this._qosDB[n(1379)](t))?.[n(959)]}async[r(421)](){let t=r;await this._qosDB[t(421)]()}[r(272)+r(432)+r(102)](t){let n=r;this[n(904)+n(409)]=t}get[r(129)](){let t=r;return this[t(799)][t(129)]}}let b0=e.AuHkT;async function gs(s){let t=r;if(!this._options[t(1203)+"S"])return null;let{aID:n,fpID:o,messageStrategy:c}=this._options,d=e[t(767)](s,b0);try{return this["_cursorM"+t(1073)]?s&&this[t(549)+t(1073)][t(272)+t(432)+"Name"](s):this[t(549)+"anager"]=new v0(o+"_"+n+"_"+d,d,c),this[t(549)+t(1073)][t(129)]||await this[t(549)+t(1073)].openDB(),this["_cursorM"+t(1073)]}catch{return null}}async function S0(s,t){let n=r,o=e[n(618)](ze,s[n(972)][n(491)],e[n(1311)],"-1"),c=ze(s[n(972)].headers,e.jMMFj,"1"),d=at(s[n(972)][n(491)],e[n(1122)]),p=e.vZgpC(Number,e[n(848)](at,s[n(972)][n(491)],e.OeNtb))||0,g=Zn[n(861)](this,s),l=e[n(618)](ze,s.message[n(491)],n(1017)+"s","2"),v=at(s.message[n(491)],n(865)+n(1269)+"e"),b=e[n(593)](Number,e[n(1325)](at,s.message[n(491)],e[n(308)]));if(g[n(884)])return e.UHOvx(t);let D=g[n(1494)+n(947)]?await ls[n(861)](this):null;if(e[n(1215)](s[n(972)].service,0)&&c&&!o||e[n(312)](s[n(972)].service,0)){if(d&&g[n(1494)+n(947)]&&D)return!!!await D[n(1379)](d)&&(this[n(964)+"hMessage"+n(112)](s),await D[n(868)](d,e[n(523)](Date[n(1446)](),p))),e[n(169)](t);if(l){if(e[n(1589)](n(922),e.meJtW))return(this[n(551)+"rs"][_0x356b0d]||(this[n(551)+"rs"][_0x59e934]=[]))[n(473)]({fn:_0x137362,ctx:_0x4be23d||this}),this;{let I=await gs.call(this);if(!I)return this[n(964)+"hMessage"+n(112)](s),e[n(1339)](t);let P=await I[n(1379)](v)??-1;if(e[n(623)](P,b))this[n(964)+n(287)+n(112)](s),I[n(868)](v,b,s[n(972)][n(1123)]);else throw new Error(n(167)+" message"+n(1330)+b+(n(553)+n(1022)+n(171)+"r ")+P);return e.UHOvx(t)}}return this[n(964)+n(287)+n(112)](s),e[n(586)](t)}}async function E0(s,t){let n=r,o=Zn[n(861)](this,s);if(!o["isQoSMes"+n(947)])return e[n(513)](t);let c=await ls[n(861)](this);if(o[n(1236)+n(508)+n(296)]&&o.ackMsgIds.length)for(let d of o.ackMsgIds)await c[n(1364)](d);t()}async function C0(s,t){let n=r,o={EpumH:function(c,d){return c===d},GPogI:function(c,d){return e.KJSbT(c,d)},sGEpV:function(c,d){return e[A(1402)](c,d)},XSXLX:"Unhandle"+n(936)};if(n(1261)!==n(1261)){let c=this[n(551)+"rs"][_0x57bad0];if(c)c[n(625)]()[n(1282)](d=>d.fn.apply(d[n(1439)],_0x256954));else if(lyRNpz[n(515)](n(1523),_0x4df303)&&!this[n(740)]){let d=_0x2444d8[n(769)]&&_0x1fa18e[0];if(lyRNpz[n(1343)](d,_0x38398e))throw d;let p=new _0x2060b3(lyRNpz[n(933)](lyRNpz.XSXLX,d?lyRNpz.sGEpV(" (",d[n(972)])+")":""));throw p.context=d,d}return this}else{let c=e[n(408)](s.message.frameType,m0),d=s.message.frameType===er;if(e[n(916)](!c,!d))return t();let p=e[n(1338)](at,s[n(972)].headers,e[n(1448)]);if(!p)return e.eCPev(t);let g=await gs[n(861)](this,p);if(!g)return e[n(890)](t);if(c){let l=await g[n(1413)+"rs"](),v={frameType:l?.[n(1275)+"e"],SeqID:B.fromNumber(this._seqId++),LogID:B[n(1224)+"er"](this._options["logIDGen"+n(1060)]()),service:9e3,method:5,headers:l?.headers,payload:l?.[n(1177)]},b=e[n(1042)](C,v);this[n(1516)]&&this[n(1516)][n(700)+"te"]&&this[n(1516)][n(1104)](b)}if(d){let l=s[n(972)][n(1177)];l&&g[n(1519)+"rs"](l)}}}let D0=async function(s,t){let n=r;this[n(441)]=!1,e.daJrK(clearTimeout,this[n(540)+"ionTimeoutId"]),e[n(1023)](t)},A0=async function(s,t){let n=r;if(!this[n(1516)]||this[n(1516)].readyState!==this[n(729)])return e[n(890)](t);let{pingInterval:o}=this[n(1094)];this["_endpoin"+n(355)]?.[n(1568)+n(708)+n(629)]();for(let d=0;e.JkWFU(d,this[n(173)+n(719)][n(769)]);d++){let p=this[n(173)+n(719)][d];if(e[n(455)](this._ws.readyState,this[n(729)])&&p!==null)this[n(1516)]&&this[n(1516)][n(1104)](p),this[n(173)+n(719)][d]=null;else break}this[n(173)+n(719)]=this[n(173)+n(719)].filter(d=>!!d),this[n(1209)+"gTimeoutId"]=e[n(1116)](setTimeout,()=>this._ping(),o),this["_dispatc"+n(1006)+"nt"](s),this[n(1151)+"er"]&&this[n(1516)]&&(this[n(1516)][n(1109)+"pe"]=this["_binaryT"+n(1279)]);let c=this[n(159)+n(355)]?.["getCurre"+n(1542)+"nt"]();this[n(1284)](n(952)+c+n(550)),t()},k0=async function(s,t){let n=r,o=this._endpointManager?.["getCurre"+n(1542)+"nt"]();this._debug(n(952)+o),e[n(1023)](t)};class I0 extends Vn{constructor(t){let n=r,o={zieOB:function(g,l,v,b){return e[A(501)](g,l,v,b)},eMXIo:function(g,l,v){return e[A(692)](g,l,v)},EKKJI:e[n(433)]};super(),this[n(1126)+n(414)+"line"]=!0,this[n(1151)+"er"]=ot,this[n(786)]=Go,this._isMiniTT=Je,this[n(249)+"X"]=bt,this[n(127)+"r"]=St,this[n(173)+n(719)]=[],this[n(159)+n(355)]=null,this[n(750)+"osed"]=!1,this["_binaryT"+n(1279)]=e.GMuYb,this[n(540)+n(895)]=!1,this[n(540)+n(201)+n(273)]=null,this[n(1416)+"ctTimeou"+n(1221)]=null,this[n(1209)+n(1370)+"Id"]=null,this[n(458)]=0,this._isInit=!1,this._url="",this[n(821)+n(338)]=null,this["_cursorM"+n(1073)]=null,this[n(395)+n(854)]=null,this[n(1390)+"ls"]=e.mNFNP,this[n(818)]=3,this.CONNECTING=0,this[n(729)]=1,this[n(444)]=2,this[n(764)]=g=>{let l=n;try{o[l(292)](xs,this,g,[D0,A0,k0])}catch(v){let b=o[l(571)](fe,o[l(912)],{message:v[l(972)],code:Oe[l(655)+"OR"],error:v});this["_dispatc"+l(634)+l(783)](b)}},this[n(717)+"ge"]=async g=>{let l=n;if(e[l(850)](e[l(622)],e[l(622)]))return this[l(1516)]?this[l(1516)][l(700)+"te"]:this[l(1094)][l(1548)+l(286)]?this.CONNECTING:this.CLOSED;{let{pingInterval:v,pingFrequency:b}=this._options;if((e[l(857)]("hi",g[l(162)])&&e.CbfOc(e[l(400)],b)||e.cMTID(e.VAjIR,b))&&(this[l(271)+l(577)](),this[l(886)](e[l(404)],l(1387)),this[l(1209)+l(1370)+"Id"]=e.hDLaw(setTimeout,this._ping[l(389)](this),v)),e[l(455)]("hi",g[l(162)]))return;try{e[l(1575)](xs,this,g,[o0,s0,E0,C0,S0,i0])}catch(D){let I=e[l(449)](fe,l(1523),{message:D[l(972)],code:Oe[l(1153)+l(649)],error:D});this[l(964)+l(634)+"ent"](I)}}},this[n(493)]=g=>{let l=n,v=this[l(159)+l(355)]?.[l(613)+"chMaxTries"](),b=this[l(159)+l(355)]?.[l(536)+l(1542)+"nt"]();if(v&&!g[l(972)])if(e[l(963)]("LaCwQ",e[l(375)])){let D=l(1202)+b+(" fail, m"+l(1522)+l(382)+"ed");this[l(964)+l(634)+"ent"](e[l(759)](fe,e[l(433)],{message:D,code:Oe[l(141)+l(1128)+"R"],error:g}));return}else return this[l(1516)]?this._ws[l(1109)+"pe"]:this[l(1118)+l(1279)];this[l(1516)]&&e[l(954)](this[l(1516)].readyState,this[l(729)])&&this[l(1285)+l(1157)](),this[l(964)+l(634)+l(783)](e[l(318)](fe,l(1523),{message:g.message,code:Oe["NATIVE_E"+l(512)],error:g}))},this[n(276)]=async g=>{let l=n;this[l(836)+l(1499)](),this._clearPingTimer(),this["_removeW"+l(1355)+"rs"](),this[l(1516)]=null,this[l(540)+l(895)]=!1;let v=this[l(159)+l(355)]?.checkReachMaxTries();if(!v&&this["_navigat"+l(990)]()&&!this[l(750)+l(582)])if(e[l(679)]!==e[l(161)]){let b=this[l(159)+"tManager"]?.[l(536)+l(1542)+"nt"](),D=this[l(1094)][l(643)+"tInterceptor"](g[l(1139)],g[l(1205)]);this[l(964)+l(1559)+l(783)](ge(l(514),{code:1006,reason:g[l(1205)]||l(1089)+l(198)+l(657)+"wn reason, hostn"+l(459)+b,willReconnect:D})),D&&this[l(540)]();return}else _0xca0b91[l(1407)+l(323)]="",_0x2fbbdb[l(942)](_0x50ef22);if(e[l(1212)](1e3,g.code)&&this[l(750)+l(582)]){this[l(964)+l(1559)+l(783)](e[l(1329)](ge,e[l(290)],{code:1e3,reason:e[l(1120)]})),this[l(159)+"tManager"]?.[l(1568)+l(708)+l(629)](),this[l(395)+l(854)]?.resetCounter();return}if(e[l(570)](1e3,g[l(1139)])&&v){let b=this._endpointManager?.[l(536)+l(1542)+"nt"](),D=g[l(1205)];D||(D=await e[l(516)]($o,this[l(1283)])),D=l(1089)+l(198)+l(541)+D+(l(475)+l(1442))+b+(l(1484)+l(674)+l(415)),this[l(964)+l(1559)+l(783)](ge(e.fZRPc,{code:g[l(1139)],reason:D}));let I=l(1202)+b+(l(760)+l(1522)+l(382)+"ed");this[l(964)+l(634)+l(783)](e[l(279)](fe,l(1523),{message:I,code:Oe["MAX_RETR"+l(1128)+"R"]})),this[l(159)+l(355)]?.[l(1568)+l(708)+l(629)](),this[l(395)+l(854)]?.[l(685)+"nter"]();return}if(e[l(963)](1e3,g[l(1139)])&&!g[l(1205)]){let b=this[l(159)+l(355)]?.[l(536)+"ntEndpoint"]();this["_dispatchCloseEv"+l(783)](e[l(180)](ge,e[l(290)],{code:g[l(1139)],reason:l(1089)+l(198)+l(657)+"wn reaso"+l(624)+l(459)+b})),this["_endpoin"+l(355)]?.[l(1568)+"pointCon"+l(629)](),this[l(395)+"sCounter"]?.resetCounter();return}this[l(964)+"hCloseEv"+l(783)](g),this[l(159)+"tManager"]?.[l(1568)+l(708)+l(629)](),this["_pingLos"+l(854)]?.[l(685)+l(996)]()},this[n(1546)]=null,this[n(740)]=null,this[n(917)+"e"]=null,this[n(832)]=null,this[n(1096)+n(1432)]=null,this["onReceiv"+n(1078)]=null,this[n(1326)+n(944)+n(704)+"ct"]=null,this[n(906)+"nLine"]=this[n(906)+n(1197)].bind(this),this[n(906)+n(956)]=this[n(906)+n(956)][n(389)](this),this[n(1584)+n(1164)]=this[n(1584)+n(1164)].bind(this),this[n(1584)+n(1251)]=this[n(1584)+n(1251)][n(389)](this),this[n(1094)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength:e[n(720)](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:e[n(591)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:n(233),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:d}=t,p=Array[n(231)](c)?c:typeof c=="string"?[c]:[];if(!p||e[n(597)](0,p[n(769)]))throw new Error(n(816)+n(321)+n(190));if(!e[n(391)](Vo,d))throw new Error(e[n(1170)]);Object[n(1391)](this._options,t),this[n(159)+n(355)]=new as(p,this[n(1094)][n(965)+"es"]),this["_pingLos"+n(854)]=new Zo(this[n(1094)][n(373)+n(1433)]),this[n(1094)][n(1548)+n(286)]&&(this[n(441)]=!0,this[n(540)]()),this[n(1094)][n(588)+"tworkCha"+n(164)]&&(this[n(1323)+"T"]||this._isMiniWX?this[n(666)+n(1112)+n(1346)]():this[n(1151)+"er"]&&this[n(826)+"balEvent"+n(735)]())}_handleOnLine(){let t=r;this[t(1094)][t(177)+t(1497)+t(1243)]||this[t(750)+t(582)]||this[t(148)+t(1432)]()}[r(906)+r(956)](){let t=r;this[t(909)+t(1479)+"t"]();let n=e[t(676)](Jn,e.RIBvg,{message:e[t(143)]});this[t(1326)+"mediatel"+t(704)+"ct"]&&this[t(1326)+t(944)+t(704)+"ct"](n)}[r(826)+r(1273)+r(735)](){let t=r;this[t(1151)+"er"]&&window["addEvent"+t(735)]("online",this[t(906)+t(1197)]),this._isBrowser&&window[t(1514)+t(735)](e[t(1469)],this[t(906)+"ffLine"]),this[t(1151)+"er"]&&window[t(1514)+t(735)](e[t(303)],this[t(1584)+t(1164)]),this[t(1151)+"er"]&&window[t(1514)+t(735)](e[t(1507)],this["_handleP"+t(1251)])}["_dropGlobalEvent"+r(735)](){let t=r;e[t(1254)](t(802),e[t(147)])?this._isMiniTT||this[t(249)+"X"]?this[t(666)+t(1112)+t(1346)]():this[t(1151)+"er"]&&this[t(826)+t(1273)+t(735)]():(this[t(1151)+"er"]&&window["removeEv"+t(419)+t(658)](e[t(801)],this[t(906)+"nLine"]),this[t(1151)+"er"]&&window[t(1086)+t(419)+t(658)](e[t(1469)],this[t(906)+t(956)]),this[t(1151)+"er"]&&window[t(1086)+t(419)+t(658)]("pagehide",this[t(1584)+"ageHide"]),this[t(1151)+"er"]&&window[t(1086)+"entListe"+t(658)]("pageshow",this[t(1584)+"ageShow"]))}["_handleP"+r(1164)](t){let n=r;if(e.KKYJx===e[n(489)])return this[n(799)]?.[n(129)];!t[n(849)+"d"]&&(this[n(1151)+"er"]&&window[n(1086)+"entListe"+n(658)](n(966),this[n(1584)+n(1164)]),this[n(1151)+"er"]&&window[n(1086)+n(419)+n(658)](e[n(1507)],this[n(1584)+"ageShow"]),this.close()),this[n(1151)+"er"]&&window[n(1086)+"entListe"+n(658)]("online",this[n(906)+n(1197)]),this[n(1151)+"er"]&&window["removeEv"+n(419)+n(658)](e[n(1469)],this[n(906)+"ffLine"])}[r(1584)+r(1251)](t){let n=r,o={AmDln:e[n(810)],gGLBE:e[n(404)],rtIcj:e[n(901)]};if(e[n(374)](e[n(1358)],"KNfHX")){if(t[n(849)+"d"])if(e[n(437)](n(478),e[n(1331)])){let c={OxJgi:e[n(1e3)],tzYeF:n(304)+"e_success",UoWro:e[n(901)]};this[n(271)+n(577)](),this[n(1209)+"gTimeoutId"]=e[n(1111)](_0x5bb125,this[n(1234)][n(389)](this),this[n(1094)]["pingInte"+n(380)]);let d=()=>{let g=n;_0x1edbd8(o[g(1281)]),this[g(589)](o.gGLBE,d),this[g(589)](o[g(208)],p)},p=()=>{let g=n;_0x2ed22b(c.OxJgi),this.off(c.tzYeF,d),this[g(589)](c[g(664)],p)};this.on(e[n(404)],d),this.on(n(304)+n(794)+"t",p),this[n(1234)]()}else this[n(1578)+n(990)]()&&(!this[n(1516)]||e[n(1029)](this[n(1516)].readyState,this[n(729)])||e[n(219)](this[n(1516)][n(700)+"te"],this[n(1426)+"NG"]))&&this[n(906)+n(1197)](),this[n(1151)+"er"]&&window[n(1514)+"Listener"](e[n(801)],this[n(906)+n(1197)]),this._isBrowser&&window[n(1514)+n(735)](e.zKCoS,this[n(906)+n(956)])}else this[n(964)+"hMessage"+n(112)](_0x1c79a4),_0x5a84f4[n(868)](_0x3185fb,_0x5705fc,_0x986fcb[n(972)][n(1123)])}async[r(1368)+r(281)](t){let n=r,o={qPdRV:function(c,d){return e[A(597)](c,d)},GPzOd:e.gbZvC};if(e[n(930)]===e[n(1408)]){if(dIqpoC[n(163)](_0x44be88,n(266)))return _0x3f6972[n(1379)](_0x4570c8);if(_0x588938===dIqpoC[n(480)])return _0x4a72bc[n(647)+n(718)]||_0x44c81a[n(1379)](_0x441f0f);if(_0xe7f696===n(525))return _0x170214[n(647)+"oreNames"][1]?void 0:_0x4d7cd8[n(647)+n(653)](_0x58e1b1[n(647)+"oreNames"][0])}else{let{fpID:c,deviceID:d,bddID:p,ttwID:g,accessKey:l,aID:v,customParams:b={},enableAutoAck:D,enableQoS:I,QoSLevel:P,env:q}=this[n(1094)],se,qe,Fe;if(this._isBrowser||this._isMiniWX||this[n(1323)+"T"]){if(e.YRsTf(e[n(237)],e[n(1167)]))return _0x49a761===_0x2efbd1?_0x7d3bf5:new _0x3da6ac(e[n(739)](e[n(566)](_0xe4b04b[n(861)](_0x2d8b0e,0),e.PvKYX(_0x482f70.call(_0x2144d5,1),8))|e.lUhTm(_0xe8357f[n(861)](_0x312307,2),16),e[n(1030)](_0x2f4f9f[n(861)](_0x4430a3,3),24))>>>0,e[n(1438)](e[n(753)](e[n(326)](e[n(1531)](_0x4801e2[n(861)](_0x888fcc,4),_0x7fa8c5[n(861)](_0x5681ec,5)<<8),e.pmUkp(_0x3a8720[n(861)](_0x1ec477,6),16)),e[n(928)](_0x15ae24.call(_0x6e858e,7),24)),0),!0);se=location&&e[n(384)](n(1458),location[n(738)])?e[n(811)]:e[n(1315)],qe=t[n(1198)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),Fe=/^wss(.*:\/\/)/.test(t)?t:""+se+qe}else{if(e[n(561)](e[n(1557)],e.PhKgx))return _0x196bbb[n(647)+"oreNames"]||_0x2bf4ee[n(1379)](_0x5304bb);se=e.mWDuW,qe=t[n(1198)](/(^http)((?:[s]*:\/\/))/,""),Fe=/(^ws)((?:[s]*:\/\/))/.test(qe)?qe:""+se+qe}let ps=p?e.iyHdF:g?e[n(1543)]:e[n(780)],ms=p||g||d;if(e[n(538)](!ms,!ps))throw new Error(e[n(230)]);let P0=e.dgZGS(e.ZHhgR,typeof b)?await e[n(513)](b):b,T0=q?e.OtdkR(Xo,q[n(275)],q[n(957)]):{},tr=Object[n(1391)]({device_platform:e[n(945)],version_code:e[n(881)],access_key:l,fpid:c,aid:v,[ps]:ms,xsack:D?1:0,xaack:D?1:0,xsqos:I?1:0,qos_level:I?P:void 0,qos_sdk_version:2,...T0},P0),L0=Object[n(606)](tr).reduce((nr,rr)=>tr[rr]!==void 0?""+nr+(nr?"&":"?")+rr+"="+tr[rr]:nr,"");return Fe+n(1445)+L0}}async[r(540)](){let t=r;if(!(this[t(540)+t(895)]||this[t(750)+t(582)])){this[t(540)+t(895)]=!0;try{let n=this[t(159)+"tManager"]?.["checkCur"+t(830)+"ointReac"+t(1562)+t(205)](),{timeoutInterval:o}=this[t(1094)];if(n){let d=this[t(159)+t(355)]?.["getCurre"+t(1542)+"nt"](),p=this[t(159)+"tManager"]?.["replaceB"+t(1291)+t(1190)+t(1459)+t(122)](),g=this[t(159)+t(355)]?.["getCurre"+t(1542)+t(644)+t(809)]();if(p){let l="connect "+d+(t(628)+t(1484)+t(674)+"ached, w"+t(1189)+t(1298)+"ndpoint ")+p+(t(356)+"y"),v=e[t(251)](fe,t(1523),{message:l,code:Oe[t(141)+t(1128)+"R"]});this[t(1284)](l),this["_dispatchErrorEv"+t(783)](v),this[t(1283)]=await this[t(1368)+t(281)](p),this._debug(t(1202)+p+" "+g+t(1393)),this[t(342)+t(1355)+"rs"]()}else{let l=t(1202)+d+(t(628)+", max retries re"+t(415));this._debug(l),this[t(964)+"hErrorEv"+t(783)](e[t(298)](fe,e[t(433)],{message:l,code:Oe[t(141)+t(1128)+"R"]}));return}}else{let d=this[t(159)+t(355)]?.[t(536)+t(1542)+t(1093)+"ateCount"](),p=this["_endpoin"+t(355)]?.[t(536)+"ntEndpoi"+t(644)+t(809)]();this[t(1283)]=await this[t(1368)+t(281)](e[t(992)](d,"")),this._debug("connect "+d+" "+p+" times"),this[t(342)+t(1355)+"rs"]()}if(this[t(441)])this[t(441)]=!1;else{let d=Jn(t(643)+"t",{message:"start"});this["onStartR"+t(1432)]&&this[t(1096)+t(1432)](d)}let c=this[t(159)+t(355)]?.[t(536)+t(1542)+t(644)+t(809)]()||0;e.nKGcv(c,1)&&await this[t(507)](e[t(882)](c,1)),this[t(1284)](t(1089)+"ng url: "+this._url+(" protoco"+t(1121))+this[t(1390)+"ls"]),this[t(1516)]=Jo({url:this[t(1283)],protocols:[this[t(1390)+"ls"]],headers:this[t(1094)][t(1495)+t(1137)+"s"]["customHt"+t(681)]},this[t(1094)].ws),(this[t(1151)+"er"]||this[t(127)+"r"])&&this[t(1516)]&&(this[t(1516)][t(1109)+"pe"]=this[t(1118)+t(1279)]),this[t(295)+t(650)](),this[t(540)+t(201)+"utId"]=e[t(462)](setTimeout,this[t(1435)+"ut"].bind(this),o)}catch(n){throw this[t(540)+"Lock"]=!1,n}}}["_clearTi"+r(1499)](){let t=r;e[t(968)](clearTimeout,this._connectionTimeoutId),this[t(540)+"ionTimeoutId"]=null}[r(271)+r(577)](){let t=r;e[t(530)](clearTimeout,this["_pingPon"+t(1370)+"Id"]),clearTimeout(this["_reconne"+t(1381)+t(1221)]),this[t(1209)+t(1370)+"Id"]=null,this[t(1416)+"ctTimeou"+t(1221)]=null}_debug(...t){let n=r;this[n(1094)][n(894)]&&console[n(942)][n(1228)](console,[e[n(324)],...t])}[r(1117)+"rvalValue"](t){let n=r,{initReconnectInterval:o,maxReconnectInterval:c,reconnectIntervalGrowFactor:d}=this[n(1094)],p=e.fFmag(o,Math[n(1186)](d,e[n(1286)](t,1)));return e[n(892)](p,c)?c:p}_ping(){let t=r,n={NHTSj:function(o,c){return e.JRdTF(o,c)}};if(e[t(1530)]===e[t(1530)]){if(this[t(1516)]&&this._ws[t(700)+"te"]===this[t(1426)+"NG"]){this[t(271)+t(577)](),this[t(1209)+"gTimeoutId"]=e[t(482)](setTimeout,this[t(1234)].bind(this),this._options["pingInte"+t(380)]);return}if(!this[t(1516)]||e[t(855)](this[t(1516)][t(700)+"te"],this[t(729)]))return void this[t(148)+"econnect"]();this._ws&&this[t(1516)][t(1104)]("hi"),this[t(1416)+t(1381)+t(1221)]=e[t(1553)](setTimeout,this[t(148)+"econnect"+t(351)][t(389)](this),this[t(1094)][t(270)+t(1373)+t(1040)])}else this[t(1012)]=!0,this.low=eUOejb[t(1020)](0,_0x1bf554),this.high=0|_0x2d9182,this[t(1535)]=!!_0x48520a}[r(148)+r(1432)+r(351)](){let t=r;this[t(395)+t(854)]?.[t(568)](),this[t(886)](t(304)+t(794)+"t",e[t(1e3)]),this[t(395)+t(854)]?.[t(613)+"chMaxCount"]()?this[t(148)+t(1432)]():this[t(1234)]()}[r(1578)+r(990)](){let t=r;return this[t(1323)+"T"]||this._isMiniWX?this["_miniNavigatorOn"+t(967)]:(this[t(1151)+"er"]||this[t(127)+"r"])&&this[t(1094)][t(588)+t(1417)+"nged"]?navigator[t(156)]:!0}[r(148)+r(1432)](){let t=r;!this["_navigat"+t(990)]()||this[t(750)+t(582)]||(this[t(159)+"tManager"]?.[t(1568)+t(708)+t(629)](),this["_pingLos"+t(854)]?.[t(685)+t(996)](),this[t(1516)]?this[t(1285)+"ect"](1001,e[t(120)],!0):this[t(540)]())}["_onPageN"+r(1112)+r(1346)](){let t=r,n={asPKo:function(o,c){return e[A(1280)](o,c)}};if(e[t(481)](e.mYxFG,e.jgKBi))return this[t(159)+t(355)]?.[t(536)+t(1542)+t(644)+"ount"]()||0;this[t(1323)+"T"]?tt[t(1043)+t(797)+t(1095)](({isConnected:o})=>{let c=t;this["_miniNav"+c(414)+c(967)]=o,o?this["_handleO"+c(1197)]():this[c(906)+c(956)]()}):this[t(249)+"X"]&&wx[t(1043)+t(797)+"hange"](({isConnected:o})=>{let c=t;e[c(333)](e[c(197)],e.aovJA)?(DJperS[c(1232)](_0x314af6,_0x132048[c(1523)]),_0x24ec73()):(this[c(1126)+c(414)+c(967)]=o,o?this[c(906)+c(1197)]():this[c(906)+c(956)]())})}[r(507)](t){let n=r,o={HuMTL:function(c,d){return c!==d},XSCDS:e[n(1388)],AmzeV:n(519),Hjowt:function(c,d,p){return e[n(605)](c,d,p)}};return new Promise(c=>{let d=n;o[d(503)](o[d(534)],o[d(392)])?o[d(908)](setTimeout,c,this[d(1117)+"rvalValue"](t)):this[d(328)+"ndpointT"+d(1241)+"t"]=0})}_disconnect(t=1e3,n="",o=!1){let c=r;this[c(1516)]&&this["_destroy"+c(1479)+"t"](t,n,o)}[r(1435)+"ut"](){let t=r;if(e[t(502)](e[t(146)],e[t(1421)]))_0x5b2705[t(1086)+t(419)+t(658)](eujvuM[t(247)],_0x5578e7),_0x5bf42d[t(1086)+"entListe"+t(658)]("error",_0x970f28),_0x1bc4aa[t(1086)+t(419)+t(658)](eujvuM.leUzB,_0x3a5849);else{let n=this[t(159)+t(355)]?.[t(536)+t(1542)+"nt"]();this[t(1284)](t(1202)+n+t(628)),this[t(1285)+t(1157)](1001,e[t(761)],!0)}}[r(1163)](t){let n=r,o=Wn(t);this[n(1516)]&&e[n(857)](this[n(1516)][n(700)+"te"],this[n(729)])&&(this._ws&&this[n(1516)][n(1104)](o),this[n(1284)](e[n(1183)],t))}[r(342)+r(1355)+"rs"](){let t=r,n=e[t(556)][t(970)]("|"),o=0;for(;;){switch(n[o++]){case"0":if(!this[t(1516)])return;continue;case"1":this[t(1516)][t(1086)+"entListe"+t(658)](e[t(1441)],this._onMessage);continue;case"2":this[t(1516)][t(1086)+"entListener"](e[t(269)],this[t(764)]);continue;case"3":this._ws[t(1086)+"entListener"](e.dHjtG,this[t(493)]);continue;case"4":this[t(1516)][t(1086)+t(419)+"ner"](e[t(290)],this._onClose);continue}break}}[r(295)+r(650)](){let t=r,n=e.kWfku[t(970)]("|"),o=0;for(;;){switch(n[o++]){case"0":this[t(1516)][t(1514)+"Listener"](t(972),this[t(717)+"ge"]);continue;case"1":this._ws[t(1514)+t(735)]("close",this._onClose);continue;case"2":this[t(1516)][t(1514)+t(735)](e[t(269)],this[t(764)]);continue;case"3":this._ws[t(1514)+t(735)](e[t(433)],this._onError);continue;case"4":if(!this._ws)return;continue}break}}["_wsInsta"+r(213)](t=1e3,n=""){let o=r;try{this[o(1516)]&&this[o(1516)][o(514)](t,n)}catch{}}[r(909)+r(1479)+"t"](t=1e3,n="",o=!1){let c=r;if(this[c(271)+c(577)](),this["_clearTi"+c(1499)](),this["_removeW"+c(1355)+"rs"](),this[c(935)+c(213)](1e3,n),this[c(540)+"Lock"]=!1,o&&this[c(1578)+"orOnline"]()&&!this._readyClosed){if(this[c(159)+c(355)]?.[c(613)+c(725)+"es"]()){if(e.ofLnG===e.mhAVz)return null;{let p=this["_endpoin"+c(355)]?.["getCurre"+c(1542)+"nt"]();this[c(964)+c(1559)+c(783)](e[c(1082)](ge,e[c(290)],{code:1006,reason:c(1202)+p+(" timeout"+c(1484)+c(674)+c(415)),wasClean:!0}))}}else{let p=this._options["reconnec"+c(341)+c(733)](t,n);this[c(964)+c(1559)+c(783)](e[c(207)](ge,e[c(290)],{code:t,reason:n,wasClean:!0,willReconnect:p})),p&&this._connect()}return}this[c(1578)+c(990)]()||this[c(750)+c(582)]?this[c(964)+c(1559)+c(783)](ge(e[c(290)],{code:t,reason:e[c(1120)]})):this[c(964)+"hCloseEv"+c(783)](e[c(1256)](ge,e[c(290)],{code:1006,reason:c(1471)+c(1062)+c(1127)+c(1506)})),this._ws=null,this["_endpoin"+c(355)]?.[c(1568)+c(708)+c(629)](),this[c(395)+c(854)]?.[c(685)+c(996)]()}_dispatchOpenEvent(t){let n=r;this[n(886)](n(1510),t),this[n(832)]&&this[n(832)](t)}[r(964)+r(287)+r(112)](t){let n=r;this.emit(e.UyEkY,t),this[n(917)+"e"]&&this.onmessage(t)}["_dispatc"+r(1200)+"ageEvent"](t){let n=r;this.emit(e.QKMnc,t),this[n(487)+n(1078)]&&this[n(487)+n(1078)](t)}[r(964)+r(634)+"ent"](t){let n=r;this[n(886)](e[n(433)],t),this.onerror&&this[n(740)](t)}[r(964)+r(1559)+"ent"](t){let n=r;this[n(886)](n(514),t),this.onclose&&this[n(1546)](t)}get[r(1109)+"pe"](){let t=r;return this._ws?this[t(1516)].binaryType:this._binaryType}set[r(1109)+"pe"](t){let n=r;this[n(1118)+n(1279)]=t,this[n(1516)]&&(this[n(1516)].binaryType=t)}get[r(405)+"nt"](){let t=r;return this["_endpoin"+t(355)]?.[t(536)+"ntEndpoi"+t(644)+t(809)]()||0}get["buffered"+r(533)](){let t=r,n=this[t(173)+t(719)].reduce((o,c)=>(o+=c&&c[t(962)+"th"]||0,o),0);return e[t(1475)](n,this[t(1516)]?this[t(1516)][t(115)+t(533)]:0)}get[r(174)+"ns"](){let t=r,n={zURMR:function(o,c){return e[A(976)](o,c)},yMfTt:function(o,c){return e[A(423)](o,c)}};if(e[t(1366)]===t(1014))return this[t(1516)]?this[t(1516)].extensions:"";{let o=CapvyG.zURMR(_0x2fb87d,_0x49f5af),c=_0x5ba0a8[t(1141)];return _0x4f455b[t(1141)]=CapvyG[t(193)](_0x39c863.offset,o),c}}get[r(738)](){let t=r,n={PpjeY:function(o,c){return e[A(1178)](o,c)}};if(e.CbfOc(e.tvOPK,e[t(537)])){let o=this[t(799)][t(1363)](this[t(492)]),c=_0x165fae.parse(MxQDSF[t(1091)](o,"{}"));return c[_0x490591]=void 0,this[t(799)][t(175)](this._prefix,_0x34cfd7[t(817)+"y"](c))}else return this._ws?this[t(1516)][t(738)]:""}get[r(700)+"te"](){let t=r;return this._ws?this[t(1516)].readyState:this[t(1094)]["automati"+t(286)]?this[t(1426)+"NG"]:this[t(818)]}get[r(1113)](){let t=r;return this[t(1516)]?this[t(1516)].url:this[t(1283)]}close(t=1e3,n){let o=r,c={oxSRV:function(d,p){return e[A(1414)](d,p)},gTOkV:function(d,p){return d>>p},bRZwf:function(d,p){return e[A(521)](d,p)}};if(e.OAqyx(e.DhNSU,e[o(974)])){if(this["_readyCl"+o(582)]=!0,this[o(836)+"mer"](),this[o(271)+o(577)](),this[o(736)+o(1273)+o(735)](),this["_QoSMana"+o(338)]?.[o(421)](),!this._ws)return void this[o(1284)](e[o(1264)]);if(this[o(1516)][o(700)+"te"]===this[o(818)]||this[o(1516)].readyState===this[o(444)])return void this[o(1284)](e[o(552)]);this[o(909)+o(1479)+"t"](t,n)}else _0x5d8307[_0x540915++]=crUnSM[o(1214)](crUnSM.gTOkV(_0x14b4b3,6),192),_0x54ce49[_0x1243bf++]=crUnSM.oxSRV(crUnSM[o(1571)](63,_0x12d7b7),128)}async send(t,n){let o=r;if(t==null)throw new Error(e[o(385)]);e.XNHfl(e.mPBXU,typeof t)&&(t=JSON[o(817)+"y"](t)),e[o(579)](e.geXZZ,typeof t)&&!e.fRTtX(t,ArrayBuffer)&&!(t[o(1464)]&&e[o(1259)](t[o(1464)],ArrayBuffer))&&(t=JSON[o(817)+"y"](t));let c=await e[o(1037)](us,t),d=e[o(871)](Yo,t),{method:p=0,service:g=this._options[o(1123)],logID:l=this._options[o(1558)+o(1060)](),headers:v=this[o(1094)][o(491)],payloadEncoding:b=this[o(1094)][o(1401)+o(852)],payloadType:D=this[o(1094)][o(518)+o(1279)],logIDNew:I=this[o(1094)][o(155)+o(569)][o(1199)+"toGenera"+o(209)+"ew"]?e[o(1473)](a,this[o(1094)][o(155)+o(569)][o(426)]):""}=e[o(309)](n,{});if(!g)throw new Error(e[o(918)]);let P={SeqID:B[o(1224)+"er"](this[o(458)]++),LogID:B[o(1224)+"er"](l),service:g,method:p,headers:v,payloadEncoding:e.TctSP(b,Object)?b[o(1398)]?b[o(1398)]:"":b,payloadType:D instanceof Object?D[o(1345)]?D[o(1345)]:d:D||d,payload:c,LogIDNew:I},q=e[o(723)](Wn,P);return this[o(1516)]&&e.zAcAt(this[o(1516)].readyState,this.OPEN)?(this._ws&&this[o(1516)].send(q),this[o(1284)](e[o(891)],P)):e.MfDcM(this["_message"+o(719)][o(769)],this._options["maxMessa"+o(1511)+o(1248)])?(this["_message"+o(719)][o(473)](q),this[o(1284)](e[o(203)],P)):e.dLfcO(e[o(532)],e.lxdHY)?(this[o(173)+o(719)][o(1207)](),this["_message"+o(719)][o(473)](q)):(_0x4abff6=o(866),_0x363060=_0x433535[o(1198)](/(^http)((?:[s]*:\/\/))/,""),_0x3c675a=/(^ws)((?:[s]*:\/\/))/[o(1430)](_0x39112f)?_0x19daca:""+_0x1579f4+_0x958d11),{seqID:this._seqId,logID:l,logIDNew:I}}async[r(643)+"t"](t){let n=r,o={Hbmra:function(p,g,l){return e[A(259)](p,g,l)}},{url:c}=e[n(1276)](t,{}),d=Array.isArray(c)?c:e[n(631)](e.geXZZ,typeof c)?[c]:[];if(t&&Object[n(1391)](this[n(1094)],t),d&&d.length?this[n(159)+"tManager"]=new as(d,this[n(1094)][n(965)+"es"]):this[n(159)+"tManager"]?.[n(1568)+n(708)+n(629)](),this[n(395)+n(854)]?.[n(685)+n(996)](this[n(1094)]["pingLoss"+n(1433)]),this[n(750)+n(582)]=!1,this[n(1516)]&&e[n(1063)](this[n(1516)][n(700)+"te"],this[n(818)]))this[n(1285)+n(1157)](1e3,e[n(1069)],!0);else if(e[n(1254)](e[n(1536)],e[n(1536)]))this[n(441)]=!0,this[n(540)]();else{let p=VZLtxn.Hbmra(_0x121a8f,_0x40d7f3,_0x26650b.length);_0x2902f1[n(1478)][n(868)](_0x1c7184,p)}}async[r(1513)](){let t=r;!this._connectLock&&(this["_endpoin"+t(355)]?.[t(1568)+t(708)+t(629)](),this[t(395)+t(854)]?.[t(685)+t(996)](),this[t(750)+"osed"]=!1,this[t(441)]=!0,this[t(540)]())}[r(1514)+r(735)](t,n){this.on(t,n)}[r(793)+r(112)](t){let n=r;if(e[n(118)]("ZUqLs",e[n(640)]))return this[n(1516)]?this[n(1516)][n(1113)]:this._url;{let{type:o}=t;this.emit(o,t)}}[r(1086)+"entListener"](t,n){this[r(589)](t,n)}[r(381)](){return new Promise((t,n)=>{let o=A,c={clDKQ:function(g,l){return e[A(1201)](g,l)},HqsgO:e[o(810)],DPINB:e[o(404)],yOYul:e[o(1e3)],vEDKU:e.MyRUa};this["_clearPi"+o(577)](),this[o(1209)+o(1370)+"Id"]=setTimeout(this[o(1234)][o(389)](this),this._options[o(1560)+o(380)]);let d=()=>{let g=o;c[g(448)](t,c.HqsgO),this[g(589)](c[g(632)],d),this[g(589)]("ping_onc"+g(794)+"t",p)},p=()=>{let g=o;n(c[g(1591)]),this[g(589)](c.DPINB,d),this[g(589)](c[g(1551)],p)};this.on(e.vDKYp,d),this.on(e[o(901)],p),this._ping()})}}})(),V[S(520)+S(357)]=J[S(520)+S(357)],V[S(412)+S(862)]=J[S(412)+S(862)],V[S(691)+"e"]=J.ErrorCode,V[S(112)]=J[S(112)],V.FWS=J[S(559)],V["Frontier"+S(220)+S(765)]=J[S(386)+S(220)+"vent"],V[S(220)+S(765)]=J[S(220)+"vent"],V[S(393)+"t"]=J[S(393)+"t"],V[S(806)+"tEvent"]=J["Reconnec"+S(853)],V[S(981)+S(357)]=J["createCl"+S(357)],V[S(170)+"rorEvent"]=J["createEr"+S(862)],V[S(898)+S(229)+"nt"]=J[S(898)+"ssageEvent"],V[S(144)+"enEvent"]=J[S(144)+S(116)],V[S(268)+S(1080)+S(765)]=J["createReconnectE"+S(765)],V[S(1065)+"rame"]=J[S(1065)+S(1162)],V[S(630)+"ame"]=J["encodeFr"+S(1394)];for(ln in J)["CustomCl"+S(357),"CustomErrorEvent",S(691)+"e",S(112),S(559),"FrontierMessageE"+S(765),"MessageE"+S(765),S(393)+"t",S(806)+S(853),S(981)+S(357),"createErrorEvent",S(898)+S(229)+"nt","createOpenEvent",S(268)+"connectEvent","decodedF"+S(1162),S(630)+S(1394)].indexOf(ln)===-1&&(V[ln]=J[ln]);var ln;Object[S(1316)+S(126)](V,S(509)+"le",{value:!0})});var Te=ie((Xd,xi)=>{"use strict";var oi=["nodebuffer","arraybuffer","fragments"],ai=typeof Blob<"u";ai&&oi.push("blob");xi.exports={BINARY_TYPES:oi,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ai,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var It=ie((Zd,yn)=>{"use strict";var{EMPTY_BUFFER:hx}=Te(),lr=Buffer[Symbol.species];function gx(r,e){if(r.length===0)return hx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(e),a=0;for(let x=0;x<r.length;x++){let f=r[x];i.set(f,a),a+=f.length}return a<e?new lr(i.buffer,i.byteOffset,a):i}function ci(r,e,i,a,x){for(let f=0;f<x;f++)i[a+f]=r[f]^e[f&3]}function fi(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function px(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function hr(r){if(hr.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new lr(r):ArrayBuffer.isView(r)?e=new lr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),hr.readOnly=!1),e}yn.exports={concat:gx,mask:ci,toArrayBuffer:px,toBuffer:hr,unmask:fi};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=W("bufferutil");yn.exports.mask=function(e,i,a,x,f){f<48?ci(e,i,a,x,f):r.mask(e,i,a,x,f)},yn.exports.unmask=function(e,i){e.length<32?fi(e,i):r.unmask(e,i)}}catch{}});var li=ie(($d,di)=>{"use strict";var ui=Symbol("kDone"),gr=Symbol("kRun"),pr=class{constructor(e){this[ui]=()=>{this.pending--,this[gr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[gr]()}[gr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[ui])}}};di.exports=pr});var ht=ie((Qd,mi)=>{"use strict";var Pt=W("zlib"),hi=It(),mx=li(),{kStatusCode:gi}=Te(),_x=Buffer[Symbol.species],yx=Buffer.from([0,0,255,255]),bn=Symbol("permessage-deflate"),Le=Symbol("total-length"),dt=Symbol("callback"),Ke=Symbol("buffers"),lt=Symbol("error"),vn,mr=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,!vn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;vn=new mx(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[dt];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,a=e.find(x=>!(i.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>x.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(a.server_no_context_takeover=!0),i.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(a.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?a.client_max_window_bits=i.clientMaxWindowBits:(a.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}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(a=>{let x=i[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 f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}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}"`);i[a]=x})}),e}decompress(e,i,a){vn.add(x=>{this._decompress(e,i,(f,u)=>{x(),a(f,u)})})}compress(e,i,a){vn.add(x=>{this._compress(e,i,(f,u)=>{x(),a(f,u)})})}_decompress(e,i,a){let x=this._isServer?"client":"server";if(!this._inflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=Pt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[bn]=this,this._inflate[Le]=0,this._inflate[Ke]=[],this._inflate.on("error",bx),this._inflate.on("data",pi)}this._inflate[dt]=a,this._inflate.write(e),i&&this._inflate.write(yx),this._inflate.flush(()=>{let f=this._inflate[lt];if(f){this._inflate.close(),this._inflate=null,a(f);return}let u=hi.concat(this._inflate[Ke],this._inflate[Le]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Le]=0,this._inflate[Ke]=[],i&&this.params[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,u)})}_compress(e,i,a){let x=this._isServer?"server":"client";if(!this._deflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Pt.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=Pt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Le]=0,this._deflate[Ke]=[],this._deflate.on("data",vx)}this._deflate[dt]=a,this._deflate.write(e),this._deflate.flush(Pt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=hi.concat(this._deflate[Ke],this._deflate[Le]);i&&(f=new _x(f.buffer,f.byteOffset,f.length-4)),this._deflate[dt]=null,this._deflate[Le]=0,this._deflate[Ke]=[],i&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};mi.exports=mr;function vx(r){this[Ke].push(r),this[Le]+=r.length}function pi(r){if(this[Le]+=r.length,this[bn]._maxPayload<1||this[Le]<=this[bn]._maxPayload){this[Ke].push(r);return}this[lt]=new RangeError("Max payload size exceeded"),this[lt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[lt][gi]=1009,this.removeListener("data",pi),this.reset()}function bx(r){if(this[bn]._inflate=null,this[lt]){this[dt](this[lt]);return}r[gi]=1007,this[dt](r)}});var gt=ie((el,Sn)=>{"use strict";var{isUtf8:wi}=W("buffer"),{hasBlob:Sx}=Te(),Ex=[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 Cx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function wr(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 Dx(r){return Sx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Sn.exports={isBlob:Dx,isValidStatusCode:Cx,isValidUTF8:wr,tokenChars:Ex};if(wi)Sn.exports.isValidUTF8=function(r){return r.length<24?wr(r):wi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=W("utf-8-validate");Sn.exports.isValidUTF8=function(e){return e.length<32?wr(e):r(e)}}catch{}});var Sr=ie((tl,Ci)=>{"use strict";var{Writable:Ax}=W("stream"),_i=ht(),{BINARY_TYPES:kx,EMPTY_BUFFER:yi,kStatusCode:Ix,kWebSocket:Px}=Te(),{concat:_r,toArrayBuffer:Tx,unmask:Lx}=It(),{isValidStatusCode:Nx,isValidUTF8:vi}=gt(),En=Buffer[Symbol.species],de=0,bi=1,Si=2,Ei=3,yr=4,vr=5,Cn=6,br=class extends Ax{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||kx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Px]=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=de}_write(e,i,a){if(this._opcode===8&&this._state==de)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 En(a.buffer,a.byteOffset+e,a.length-e),new En(a.buffer,a.byteOffset,e)}let i=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=i.length-e;e>=a.length?i.set(this._buffers.shift(),x):(i.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new En(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case de:this.getInfo(e);break;case bi:this.getPayloadLength16(e);break;case Si:this.getPayloadLength64(e);break;case Ei:this.getMask();break;case yr:this.getData(e);break;case vr:case Cn: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 x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(i[0]&64)===64;if(a&&!this._extensions[_i.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[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=(i[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=bi:this._payloadLength===127?this._state=Si: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),a=i.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)+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=Ei:this._state=yr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=yr}getData(e){let i=yi;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&&Lx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=vr,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[_i.extensionName].decompress(e,this._fin,(x,f)=>{if(x)return i(x);if(f.length){if(this._messageLength+=f.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(u);return}this._fragments.push(f)}this.dataMessage(i),this._state===de&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=de;return}let i=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=_r(a,i):this._binaryType==="arraybuffer"?x=Tx(_r(a,i)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!0),this._state=de,this.startLoop(e)}))}else{let x=_r(a,i);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(f);return}this._state===vr||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit("message",x,!1),this._state=de,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,yi),this.end();else{let a=e.readUInt16BE(0);if(!Nx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let x=new En(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!vi(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(f);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=de;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=de):(this._state=Cn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=de,this.startLoop(i)}))}createError(e,i,a,x,f){this._loop=!1,this._errored=!0;let u=new e(a?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(u,this.createError),u.code=f,u[Ix]=x,u}};Ci.exports=br});var Dr=ie((rl,ki)=>{"use strict";var{Duplex:nl}=W("stream"),{randomFillSync:Rx}=W("crypto"),Di=ht(),{EMPTY_BUFFER:Bx,kWebSocket:Mx,NOOP:Ox}=Te(),{isBlob:pt,isValidStatusCode:zx}=gt(),{mask:Ai,toBuffer:Ze}=It(),le=Symbol("kByteLength"),qx=Buffer.alloc(4),Dn=8*1024,$e,mt=Dn,pe=0,Fx=1,Ux=2,Er=class r{constructor(e,i,a){this._extensions=i||{},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=pe,this.onerror=Ox,this[Mx]=void 0}static frame(e,i){let a,x=!1,f=2,u=!1;i.mask&&(a=i.maskBuffer||qx,i.generateMask?i.generateMask(a):(mt===Dn&&($e===void 0&&($e=Buffer.alloc(Dn)),Rx($e,0,Dn),mt=0),a[0]=$e[mt++],a[1]=$e[mt++],a[2]=$e[mt++],a[3]=$e[mt++]),u=(a[0]|a[1]|a[2]|a[3])===0,f=6);let h;typeof e=="string"?(!i.mask||u)&&i[le]!==void 0?h=i[le]:(e=Buffer.from(e),h=e.length):(h=e.length,x=i.mask&&i.readOnly&&!u);let m=h;h>=65536?(f+=8,m=127):h>125&&(f+=2,m=126);let w=Buffer.allocUnsafe(x?h+f:f);return w[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(w[0]|=64),w[1]=m,m===126?w.writeUInt16BE(h,2):m===127&&(w[2]=w[3]=0,w.writeUIntBE(h,4,6)),i.mask?(w[1]|=128,w[f-4]=a[0],w[f-3]=a[1],w[f-2]=a[2],w[f-1]=a[3],u?[w,e]:x?(Ai(e,a,w,f,h),[w]):(Ai(e,a,e,0,h),[w,e])):[w,e]}close(e,i,a,x){let f;if(e===void 0)f=Bx;else{if(typeof e!="number"||!zx(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(e,0);else{let h=Buffer.byteLength(i);if(h>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+h),f.writeUInt16BE(e,0),typeof i=="string"?f.write(i,2):f.set(i,2)}}let u={[le]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==pe?this.enqueue([this.dispatch,f,!1,u,x]):this.sendFrame(r.frame(f,u),x)}ping(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[le]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==pe?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}pong(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):pt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[le]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==pe?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}send(e,i,a){let x=this._extensions[Di.extensionName],f=i.binary?2:1,u=i.compress,h,m;typeof e=="string"?(h=Buffer.byteLength(e),m=!1):pt(e)?(h=e.size,m=!1):(e=Ze(e),h=e.length,m=Ze.readOnly),this._firstFragment?(this._firstFragment=!1,u&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=h>=x._threshold),this._compress=u):(u=!1,f=0),i.fin&&(this._firstFragment=!0);let w={[le]:h,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:m,rsv1:u};pt(e)?this._state!==pe?this.enqueue([this.getBlobData,e,this._compress,w,a]):this.getBlobData(e,this._compress,w,a):this._state!==pe?this.enqueue([this.dispatch,e,this._compress,w,a]):this.dispatch(e,this._compress,w,a)}getBlobData(e,i,a,x){this._bufferedBytes+=a[le],this._state=Ux,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let h=new Error("The socket was closed while the blob was being read");process.nextTick(Cr,this,h,x);return}this._bufferedBytes-=a[le];let u=Ze(f);i?this.dispatch(u,i,a,x):(this._state=pe,this.sendFrame(r.frame(u,a),x),this.dequeue())}).catch(f=>{process.nextTick(Hx,this,f,x)})}dispatch(e,i,a,x){if(!i){this.sendFrame(r.frame(e,a),x);return}let f=this._extensions[Di.extensionName];this._bufferedBytes+=a[le],this._state=Fx,f.compress(e,a.fin,(u,h)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Cr(this,m,x);return}this._bufferedBytes-=a[le],this._state=pe,a.readOnly=!1,this.sendFrame(r.frame(h,a),x),this.dequeue()})}dequeue(){for(;this._state===pe&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][le],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][le],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)}};ki.exports=Er;function Cr(r,e,i){typeof i=="function"&&i(e);for(let a=0;a<r._queue.length;a++){let x=r._queue[a],f=x[x.length-1];typeof f=="function"&&f(e)}}function Hx(r,e,i){Cr(r,e,i),r.onerror(e)}});var Oi=ie((sl,Mi)=>{"use strict";var{kForOnEventAttribute:Tt,kListener:Ar}=Te(),Ii=Symbol("kCode"),Pi=Symbol("kData"),Ti=Symbol("kError"),Li=Symbol("kMessage"),Ni=Symbol("kReason"),wt=Symbol("kTarget"),Ri=Symbol("kType"),Bi=Symbol("kWasClean"),Ne=class{constructor(e){this[wt]=null,this[Ri]=e}get target(){return this[wt]}get type(){return this[Ri]}};Object.defineProperty(Ne.prototype,"target",{enumerable:!0});Object.defineProperty(Ne.prototype,"type",{enumerable:!0});var Qe=class extends Ne{constructor(e,i={}){super(e),this[Ii]=i.code===void 0?0:i.code,this[Ni]=i.reason===void 0?"":i.reason,this[Bi]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Ii]}get reason(){return this[Ni]}get wasClean(){return this[Bi]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var _t=class extends Ne{constructor(e,i={}){super(e),this[Ti]=i.error===void 0?null:i.error,this[Li]=i.message===void 0?"":i.message}get error(){return this[Ti]}get message(){return this[Li]}};Object.defineProperty(_t.prototype,"error",{enumerable:!0});Object.defineProperty(_t.prototype,"message",{enumerable:!0});var Lt=class extends Ne{constructor(e,i={}){super(e),this[Pi]=i.data===void 0?null:i.data}get data(){return this[Pi]}};Object.defineProperty(Lt.prototype,"data",{enumerable:!0});var Kx={addEventListener(r,e,i={}){for(let x of this.listeners(r))if(!i[Tt]&&x[Ar]===e&&!x[Tt])return;let a;if(r==="message")a=function(f,u){let h=new Lt("message",{data:u?f:f.toString()});h[wt]=this,An(e,this,h)};else if(r==="close")a=function(f,u){let h=new Qe("close",{code:f,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});h[wt]=this,An(e,this,h)};else if(r==="error")a=function(f){let u=new _t("error",{error:f,message:f.message});u[wt]=this,An(e,this,u)};else if(r==="open")a=function(){let f=new Ne("open");f[wt]=this,An(e,this,f)};else return;a[Tt]=!!i[Tt],a[Ar]=e,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Ar]===e&&!i[Tt]){this.removeListener(r,i);break}}};Mi.exports={CloseEvent:Qe,ErrorEvent:_t,Event:Ne,EventTarget:Kx,MessageEvent:Lt};function An(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var kn=ie((il,zi)=>{"use strict";var{tokenChars:Nt}=gt();function be(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function jx(r){let e=Object.create(null),i=Object.create(null),a=!1,x=!1,f=!1,u,h,m=-1,w=-1,y=-1,_=0;for(;_<r.length;_++)if(w=r.charCodeAt(_),u===void 0)if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(_!==0&&(w===32||w===9))y===-1&&m!==-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_);let L=r.slice(m,y);w===44?(be(e,L,i),i=Object.create(null)):u=L,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);else if(h===void 0)if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(w===32||w===9)y===-1&&m!==-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_),be(i,r.slice(m,y),!0),w===44&&(be(e,u,i),i=Object.create(null),u=void 0),m=y=-1}else if(w===61&&m!==-1&&y===-1)h=r.slice(m,_),m=y=-1;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(x){if(Nt[w]!==1)throw new SyntaxError(`Unexpected character at index ${_}`);m===-1?m=_:a||(a=!0),x=!1}else if(f)if(Nt[w]===1)m===-1&&(m=_);else if(w===34&&m!==-1)f=!1,y=_;else if(w===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${_}`);else if(w===34&&r.charCodeAt(_-1)===61)f=!0;else if(y===-1&&Nt[w]===1)m===-1&&(m=_);else if(m!==-1&&(w===32||w===9))y===-1&&(y=_);else if(w===59||w===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${_}`);y===-1&&(y=_);let L=r.slice(m,y);a&&(L=L.replace(/\\/g,""),a=!1),be(i,h,L),w===44&&(be(e,u,i),i=Object.create(null),u=void 0),h=void 0,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${_}`);if(m===-1||f||w===32||w===9)throw new SyntaxError("Unexpected end of input");y===-1&&(y=_);let C=r.slice(m,y);return u===void 0?be(e,C,i):(h===void 0?be(i,C,!0):a?be(i,h,C.replace(/\\/g,"")):be(i,h,C),be(e,u,i)),e}function Gx(r){return Object.keys(r).map(e=>{let i=r[e];return Array.isArray(i)||(i=[i]),i.map(a=>[e].concat(Object.keys(a).map(x=>{let f=a[x];return Array.isArray(f)||(f=[f]),f.map(u=>u===!0?x:`${x}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}zi.exports={format:Gx,parse:jx}});var Ln=ie((xl,Xi)=>{"use strict";var Wx=W("events"),Jx=W("https"),Vx=W("http"),Ui=W("net"),Yx=W("tls"),{randomBytes:Xx,createHash:Zx}=W("crypto"),{Duplex:ol,Readable:al}=W("stream"),{URL:kr}=W("url"),je=ht(),$x=Sr(),Qx=Dr(),{isBlob:ec}=gt(),{BINARY_TYPES:qi,CLOSE_TIMEOUT:tc,EMPTY_BUFFER:In,GUID:nc,kForOnEventAttribute:Ir,kListener:rc,kStatusCode:sc,kWebSocket:Z,NOOP:Hi}=Te(),{EventTarget:{addEventListener:ic,removeEventListener:oc}}=Oi(),{format:ac,parse:xc}=kn(),{toBuffer:cc}=It(),Ki=Symbol("kAborted"),Pr=[8,13],Re=["CONNECTING","OPEN","CLOSING","CLOSED"],fc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,z=class r extends Wx{constructor(e,i,a){super(),this._binaryType=qi[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=In,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?(a=i,i=[]):i=[i]),ji(this,e,i,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){qi.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,a){let x=new $x({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new Qx(e,this._extensions,a.generateMask);this._receiver=x,this._sender=f,this._socket=e,x[Z]=this,f[Z]=this,e[Z]=this,x.on("conclude",lc),x.on("drain",hc),x.on("error",gc),x.on("message",pc),x.on("ping",mc),x.on("pong",wc),f.onerror=_c,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",Ji),e.on("data",Tn),e.on("end",Vi),e.on("error",Yi),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){ce(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,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Wi(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||In,i,a)}pong(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||In,i,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(a=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Tr(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[je.extensionName]||(x.compress=!1),this._sender.send(e||In,x,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ce(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(z,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(z.prototype,"CONNECTING",{enumerable:!0,value:Re.indexOf("CONNECTING")});Object.defineProperty(z,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(z.prototype,"OPEN",{enumerable:!0,value:Re.indexOf("OPEN")});Object.defineProperty(z,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(z.prototype,"CLOSING",{enumerable:!0,value:Re.indexOf("CLOSING")});Object.defineProperty(z,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});Object.defineProperty(z.prototype,"CLOSED",{enumerable:!0,value:Re.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(z.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(z.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Ir])return e[rc];return null},set(e){for(let i of this.listeners(r))if(i[Ir]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[Ir]:!0})}})});z.prototype.addEventListener=ic;z.prototype.removeEventListener=oc;Xi.exports=z;function ji(r,e,i,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:tc,protocolVersion:Pr[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(r._autoPong=x.autoPong,r._closeTimeout=x.closeTimeout,!Pr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Pr.join(", ")})`);let f;if(e instanceof kr)f=e;else try{f=new kr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let u=f.protocol==="wss:",h=f.protocol==="ws+unix:",m;if(f.protocol!=="ws:"&&!u&&!h?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:h&&!f.pathname?m="The URL's pathname is empty":f.hash&&(m="The URL contains a fragment identifier"),m){let R=new SyntaxError(m);if(r._redirects===0)throw R;Pn(r,R);return}let w=u?443:80,y=Xx(16).toString("base64"),_=u?Jx.request:Vx.request,C=new Set,L;if(x.createConnection=x.createConnection||(u?dc:uc),x.defaultPort=x.defaultPort||w,x.port=f.port||w,x.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":y,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(L=new je({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=ac({[je.extensionName]:L.offer()})),i.length){for(let R of i){if(typeof R!="string"||!fc.test(R)||C.has(R))throw new SyntaxError("An invalid or duplicated subprotocol was specified");C.add(R)}x.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(f.username||f.password)&&(x.auth=`${f.username}:${f.password}`),h){let R=x.path.split(":");x.socketPath=R[0],x.path=R[1]}let T;if(x.followRedirects){if(r._redirects===0){r._originalIpc=h,r._originalSecure=u,r._originalHostOrSocketPath=h?x.socketPath:f.host;let R=a&&a.headers;if(a={...a,headers:{}},R)for(let[j,re]of Object.entries(R))a.headers[j.toLowerCase()]=re}else if(r.listenerCount("redirect")===0){let R=h?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!R||r._originalSecure&&!u)&&(delete x.headers.authorization,delete x.headers.cookie,R||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),T=r._req=_(x),r._redirects&&r.emit("redirect",r.url,T)}else T=r._req=_(x);x.timeout&&T.on("timeout",()=>{ce(r,T,"Opening handshake has timed out")}),T.on("error",R=>{T===null||T[Ki]||(T=r._req=null,Pn(r,R))}),T.on("response",R=>{let j=R.headers.location,re=R.statusCode;if(j&&x.followRedirects&&re>=300&&re<400){if(++r._redirects>x.maxRedirects){ce(r,T,"Maximum redirects exceeded");return}T.abort();let ae;try{ae=new kr(j,e)}catch{let M=new SyntaxError(`Invalid URL: ${j}`);Pn(r,M);return}ji(r,ae,i,a)}else r.emit("unexpected-response",T,R)||ce(r,T,`Unexpected server response: ${R.statusCode}`)}),T.on("upgrade",(R,j,re)=>{if(r.emit("upgrade",R),r.readyState!==z.CONNECTING)return;T=r._req=null;let ae=R.headers.upgrade;if(ae===void 0||ae.toLowerCase()!=="websocket"){ce(r,j,"Invalid Upgrade header");return}let k=Zx("sha1").update(y+nc).digest("base64");if(R.headers["sec-websocket-accept"]!==k){ce(r,j,"Invalid Sec-WebSocket-Accept header");return}let M=R.headers["sec-websocket-protocol"],G;if(M!==void 0?C.size?C.has(M)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":C.size&&(G="Server sent no subprotocol"),G){ce(r,j,G);return}M&&(r._protocol=M);let Se=R.headers["sec-websocket-extensions"];if(Se!==void 0){if(!L){ce(r,j,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Be;try{Be=xc(Se)}catch{ce(r,j,"Invalid Sec-WebSocket-Extensions header");return}let me=Object.keys(Be);if(me.length!==1||me[0]!==je.extensionName){ce(r,j,"Server indicated an extension that was not requested");return}try{L.accept(Be[je.extensionName])}catch{ce(r,j,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[je.extensionName]=L}r.setSocket(j,re,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(T,r):T.end()}function Pn(r,e){r._readyState=z.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function uc(r){return r.path=r.socketPath,Ui.connect(r)}function dc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Ui.isIP(r.host)?"":r.host),Yx.connect(r)}function ce(r,e,i){r._readyState=z.CLOSING;let a=new Error(i);Error.captureStackTrace(a,ce),e.setHeader?(e[Ki]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Pn,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Tr(r,e,i){if(e){let a=ec(e)?e.size:cc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(i){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Re[r.readyState]})`);process.nextTick(i,a)}}function lc(r,e){let i=this[Z];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=r,i._socket[Z]!==void 0&&(i._socket.removeListener("data",Tn),process.nextTick(Gi,i._socket),r===1005?i.close():i.close(r,e))}function hc(){let r=this[Z];r.isPaused||r._socket.resume()}function gc(r){let e=this[Z];e._socket[Z]!==void 0&&(e._socket.removeListener("data",Tn),process.nextTick(Gi,e._socket),e.close(r[sc])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Fi(){this[Z].emitClose()}function pc(r,e){this[Z].emit("message",r,e)}function mc(r){let e=this[Z];e._autoPong&&e.pong(r,!this._isServer,Hi),e.emit("ping",r)}function wc(r){this[Z].emit("pong",r)}function Gi(r){r.resume()}function _c(r){let e=this[Z];e.readyState!==z.CLOSED&&(e.readyState===z.OPEN&&(e._readyState=z.CLOSING,Wi(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Wi(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Ji(){let r=this[Z];if(this.removeListener("close",Ji),this.removeListener("data",Tn),this.removeListener("end",Vi),r._readyState=z.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[Z]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Fi),r._receiver.on("finish",Fi))}function Tn(r){this[Z]._receiver.write(r)||this.pause()}function Vi(){let r=this[Z];r._readyState=z.CLOSING,r._receiver.end(),this.end()}function Yi(){let r=this[Z];this.removeListener("error",Yi),this.on("error",Hi),r&&(r._readyState=z.CLOSING,this.destroy())}});var eo=ie((fl,Qi)=>{"use strict";var cl=Ln(),{Duplex:yc}=W("stream");function Zi(r){r.emit("close")}function vc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function $i(r){this.removeListener("error",$i),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function bc(r,e){let i=!0,a=new yc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,u){let h=!u&&a._readableState.objectMode?f.toString():f;a.push(h)||r.pause()}),r.once("error",function(f){a.destroyed||(i=!1,a.destroy(f))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,f){if(r.readyState===r.CLOSED){f(x),process.nextTick(Zi,a);return}let u=!1;r.once("error",function(m){u=!0,f(m)}),r.once("close",function(){u||f(x),process.nextTick(Zi,a)}),i&&r.terminate()},a._final=function(x){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(x)});return}r._socket!==null&&(r._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){x()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(x,f,u){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(x,f,u)});return}r.send(x,u)},a.on("end",vc),a.on("error",$i),a}Qi.exports=bc});var Lr=ie((ul,to)=>{"use strict";var{tokenChars:Sc}=gt();function Ec(r){let e=new Set,i=-1,a=-1,x=0;for(x;x<r.length;x++){let u=r.charCodeAt(x);if(a===-1&&Sc[u]===1)i===-1&&(i=x);else if(x!==0&&(u===32||u===9))a===-1&&i!==-1&&(a=x);else if(u===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let h=r.slice(i,a);if(e.has(h))throw new SyntaxError(`The "${h}" subprotocol is duplicated`);e.add(h),i=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(i===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(i,x);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return e.add(f),e}to.exports={parse:Ec}});var xo=ie((ll,ao)=>{"use strict";var Cc=W("events"),Nn=W("http"),{Duplex:dl}=W("stream"),{createHash:Dc}=W("crypto"),no=kn(),et=ht(),Ac=Lr(),kc=Ln(),{CLOSE_TIMEOUT:Ic,GUID:Pc,kWebSocket:Tc}=Te(),Lc=/^[+/0-9A-Za-z]{22}==$/,ro=0,so=1,oo=2,Nr=class extends Cc{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Ic,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:kc,...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=Nn.createServer((a,x)=>{let f=Nn.STATUS_CODES[426];x.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),x.end(f)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Nc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,f,u)=>{this.handleUpgrade(x,f,u,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ro}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===oo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Rt,this);return}if(e&&this.once("close",e),this._state!==so)if(this._state=so,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(Rt,this):process.nextTick(Rt,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{Rt(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,a,x){i.on("error",io);let f=e.headers["sec-websocket-key"],u=e.headers.upgrade,h=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,i,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){nt(this,e,i,400,"Invalid Upgrade header");return}if(f===void 0||!Lc.test(f)){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(h!==13&&h!==8){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Bt(i,400);return}let m=e.headers["sec-websocket-protocol"],w=new Set;if(m!==void 0)try{w=Ac.parse(m)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let y=e.headers["sec-websocket-extensions"],_={};if(this.options.perMessageDeflate&&y!==void 0){let C=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let L=no.parse(y);L[et.extensionName]&&(C.accept(L[et.extensionName]),_[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[`${h===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(C,(L,T,R,j)=>{if(!L)return Bt(i,T||401,R,j);this.completeUpgrade(_,f,w,e,i,a,x)});return}if(!this.options.verifyClient(C))return Bt(i,401)}this.completeUpgrade(_,f,w,e,i,a,x)}completeUpgrade(e,i,a,x,f,u,h){if(!f.readable||!f.writable)return f.destroy();if(f[Tc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ro)return Bt(f,503);let w=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Dc("sha1").update(i+Pc).digest("base64")}`],y=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: ${_}`),y._protocol=_)}if(e[et.extensionName]){let _=e[et.extensionName].params,C=no.format({[et.extensionName]:[_]});w.push(`Sec-WebSocket-Extensions: ${C}`),y._extensions=e}this.emit("headers",w,x),f.write(w.concat(`\r
|
|
11
|
+
`)}function O(r){return{debug:(e,i)=>Gt("debug",r,e,i),info:(e,i)=>Gt("info",r,e,i),warn:(e,i)=>Gt("warn",r,e,i),error:(e,i)=>Gt("error",r,e,i),child:e=>O(`${r}.${e}`)}}var Jt,vs,j0,G0,bs,K=Pe(()=>{"use strict";Jt={debug:10,info:20,warn:30,error:40},vs=(()=>{let r=process.env.COZE_BRIDGE_LOG_LEVEL;return r==="debug"||r==="info"||r==="warn"||r==="error"?r:"info"})(),j0=process.stdout,G0=process.stderr,bs={}});import{homedir as J0}from"node:os";import{join as se}from"node:path";function V(r){let e=r??J0(),i=se(e,".coze"),a=se(i,"bridge"),x=se(a,"lib");return{cozeRoot:i,bridgeRoot:a,libDir:x,libEntry:se(x,"index.js"),pidFile:se(a,"bridge.pid"),portFile:se(a,"bridge.port"),tokenFile:se(a,"bridge.token"),logFile:se(a,"bridge.log"),installLock:se(a,"install.lock"),configFile:se(a,"config.json"),agentsRoot:se(i,"agents")}}function Le(r,e=V()){let i=se(e.agentsRoot,r);return{root:i,config:se(i,"config.json"),workspace:se(i,"workspace"),logs:se(i,"logs")}}var fe=Pe(()=>{"use strict"});var Xt={};ys(Xt,{AGENT_CONFIG_FILE_MODE:()=>Vt,enforceAgentConfigMode:()=>X0,loadAgentConfig:()=>xe,persistAgentSessions:()=>ur,persistAgentSkills:()=>Yt,saveAgentConfig:()=>he});import{chmod as V0,stat as Y0}from"node:fs/promises";function xe(r,e){return Wt(Le(r,e).config)}function he(r,e){return jt(Le(r.agentId,e).config,r,{mode:Vt})}async function X0(r,e){if(process.platform==="win32")return;let i=Le(r,e).config;try{let a=await Y0(i);if(!a.isFile())return;let x=a.mode&511;x!==Vt&&(await V0(i,Vt),Cs.warn("agent config mode auto-corrected to 0600",{path:i,from:x.toString(8)}))}catch(a){if(a.code==="ENOENT")return;Cs.warn("enforceAgentConfigMode: chmod failed (ignored)",{path:i,err:String(a)})}}async function ur(r,e,i){let a=await xe(r,i);a&&(a.sessions=Object.fromEntries(e),await he(a,i))}async function Yt(r,e,i){let a=await xe(r,i);a&&(a.skills=e,await he(a,i))}var Cs,Vt,Ke=Pe(()=>{"use strict";cr();K();fe();Cs=O("agent-config"),Vt=384});var ai=ae(Q=>{"use strict";function D(r,e){r=r-331;let i=Cn(),a=i[r];if(D.NuNDVN===void 0){var x=function(m){let _="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=",v="",y="";for(let C=0,T,P,R=0;P=m.charAt(R++);~P&&(T=C%4?T*64+P:P,C++%4)?v+=String.fromCharCode(255&T>>(-2*C&6)):0)P=_.indexOf(P);for(let C=0,T=v.length;C<T;C++)y+="%"+("00"+v.charCodeAt(C).toString(16)).slice(-2);return decodeURIComponent(y)};D.jChnHz=x,D.BcrqPJ={},D.NuNDVN=!0}let f=i[0],u=r+f,g=D.BcrqPJ[u];return g?a=g:(a=D.jChnHz(a),D.BcrqPJ[u]=a),a}var S=D;(function(r,e){let i=D,a=r();for(;;)try{if(parseInt(i(1017))/1+parseInt(i(1532))/2+-parseInt(i(1479))/3*(parseInt(i(1039))/4)+-parseInt(i(721))/5+-parseInt(i(899))/6+parseInt(i(435))/7+parseInt(i(1190))/8*(-parseInt(i(735))/9)===e)break;a.push(a.shift())}catch{a.push(a.shift())}})(Cn,512940);var tx=Object[S(983)+S(1754)],nx=Object[S(1415)+S(1831)+"mes"],ni=(r,e)=>function(){return r&&(e=(0,r[{ZmMXB:function(f,u){return f(u)}}[S(1711)](nx,r)[0]])(r=0)),e},rx=(r,e)=>{let i={ZVNAO:function(x,f,u,g){return x(f,u,g)}};for(var a in e)i.ZVNAO(tx,r,a,{get:e[a],enumerable:!0})};function sx(){return Zs||(Zs=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ix(){let r=S;return $s||($s=[IDBCursor[r(1522)+"e"].advance,IDBCursor.prototype[r(1752)],IDBCursor[r(1522)+"e"][r(1752)+"PrimaryKey"]])}function ox(r){let e=S,i={Gmfoa:e(404),aSzRZ:"error",YfOgm:function(x,f){return x(f)},ctLkU:function(x,f){return x instanceof f}},a=new Promise((x,f)=>{let u=e,g={vkUfy:function(y,C){return i.YfOgm(y,C)}},m=()=>{let y=D;r[y(1072)+"entListe"+y(1083)](i.Gmfoa,_),r[y(1072)+y(826)+y(1083)](i.aSzRZ,v)},_=()=>{x(g[D(849)](ke,r.result)),m()},v=()=>{f(r.error),m()};r[u(719)+u(1382)](u(404),_),r[u(719)+u(1382)](i[u(953)],v)});return a.then(x=>{let f=e;i[f(887)](x,IDBCursor)&&pr[f(563)](x,r)})[e(470)](()=>{}),bn[e(563)](a,r),a}function ax(r){let e=S,i={FGTwN:e(532),MJBkb:e(1600),abUbF:e(1604),fFwec:function(x,f,u){return x(f,u)},fmLAK:function(x,f){return x>>>f},OpxkJ:function(x,f){return x<<f},WMQRG:function(x,f){return x!==f},KkxYz:"Lrypu",GYrjp:e(493),lylgm:function(x){return x()},SYpmY:function(x){return x()},MObtK:e(593)+"or",iwEJU:function(x){return x()},Taysd:function(x,f){return x===f}};if(vn[e(1238)](r))return;let a=new Promise((x,f)=>{let u=e,g={uVrWv:function(y,C){return i[D(1255)](y,C)}},m=()=>{let y=D;if(y(743)!=="MGafe")r[y(1072)+y(826)+y(1083)](i[y(954)],_),r["removeEv"+y(826)+"ner"](i.MJBkb,v),r[y(1072)+y(826)+y(1083)](i[y(1661)],v);else return g[y(1596)](0,this[y(443)])&&g[y(1596)](0,this[y(757)])},_=()=>{let y=D,C={zDPrU:function(T,P,R){return i[D(1509)](T,P,R)},KPxel:function(T,P){return i[D(382)](T,P)},iWZOk:function(T,P){return i[D(1644)](T,P)}};if(i[y(828)](i[y(727)],i.GYrjp))i.lylgm(x),i[y(550)](m);else{let{value:T,offset:P}=C[y(500)](_0x30e9e6,_0xbffeb7,_0x33668a);_0x59755a=P,_0x55ff75=C[y(1186)](C.iWZOk(_0x23cbd9,8),0),_0x258028+=T}},v=()=>{let y=D;f(r[y(1600)]||new DOMException(i[y(1106)],"AbortError")),i[y(979)](m)};r[u(719)+u(1382)](u(532),_),r.addEventListener(i[u(723)],v),r["addEvent"+u(1382)](u(1604),v)});vn.set(r,a)}function xx(r){Sn=r(Sn)}function cx(r){let e=S,i={fXsnW:function(a,x){return a(x)},FKEYk:function(a,x){return a(x)},EsPIk:function(a,x){return a===x},rYwgn:function(a,x){return a in x},bLHjc:e(1228)+"oreNames",jQabR:function(a){return a()}};return i[e(427)](r,IDBDatabase.prototype["transact"+e(1568)])&&!i[e(1381)](i[e(580)],IDBTransaction[e(1522)+"e"])?function(a,...x){let f=e,u=r[f(656)](i[f(1371)](Lt,this),a,...x);return gr[f(563)](u,a[f(749)]?a[f(749)]():[a]),i.FKEYk(ke,u)}:i.jQabR(ix).includes(r)?function(...a){let x=e;return r[x(1295)](i[x(1297)](Lt,this),a),i[x(1297)](ke,pr[x(1508)](this))}:function(...a){return ke(r[e(1295)](i.FKEYk(Lt,this),a))}}function fx(r){let e=S,i={qWSSp:function(a,x){return a===x},gXoTp:function(a,x){return a(x)},iEbfU:function(a,x,f){return a(x,f)},mbCkz:function(a){return a()}};return i[e(1610)](typeof r,"function")?i[e(838)](cx,r):(r instanceof IDBTransaction&&ax(r),i.iEbfU(ri,r,i[e(703)](sx))?new Proxy(r,Sn):r)}function ke(r){let e=S,i={NQfCk:function(x,f){return x instanceof f},mnWFQ:function(x,f){return x(f)},kPLmx:function(x,f){return x!==f}};if(i[e(1302)](r,IDBRequest))return i.mnWFQ(ox,r);if(wn[e(1238)](r))return wn[e(1508)](r);let a=fx(r);return i[e(1402)](a,r)&&(wn[e(563)](r,a),bn.set(a,r)),a}var ri,Zs,$s,pr,vn,gr,wn,bn,Sn,Lt,Qs=ni({"node_modules/idb/build/wrap-idb-value.js"(){let r=S,e={zFRXE:function(i,a){return i instanceof a},MJvTP:function(i,a){return i===a},sTfQz:r(1515),FUWnD:"objectSt"+r(1620),bSHRM:function(i,a){return i!==a},HNNwN:"yupXb",vcqaT:function(i,a){return i===a},lwSAv:function(i,a){return i(a)},BvPNL:function(i,a){return i<a},pZilD:function(i,a){return i|a},CsJQJ:function(i,a){return i&a},GRkmz:function(i,a){return i&a},WBbYY:function(i,a){return i>=a},xwZLh:function(i,a){return i|a},KcNOq:function(i,a){return i<<a},BThoS:function(i,a){return i>=a},hbMKj:function(i,a){return i-a},ypAFg:function(i,a){return i|a},JrjQD:function(i,a){return i|a},FokyY:function(i,a){return i|a},qQmSW:function(i,a){return i<<a},TSJlh:function(i,a){return i>>a},UnNqG:function(i,a){return i+a},cZVKD:function(i,a){return i!==a},CNDCk:r(1805),OSgNl:function(i,a){return i===a},gvzcr:r(1679),rNPyF:function(i,a){return i in a}};ri=(i,a)=>a.some(x=>i instanceof x),pr=new WeakMap,vn=new WeakMap,gr=new WeakMap,wn=new WeakMap,bn=new WeakMap,Sn={get(i,a,x){let f=r;if(e[f(1621)](i,IDBTransaction)){if(e[f(956)](a,e[f(1283)]))return vn[f(1508)](i);if(a===e[f(816)])if(e[f(670)](e[f(931)],e[f(931)]))this._debug(f(1260),_0x573115.message),_0x1f9cbc();else return i[f(1228)+f(1620)]||gr.get(i);if(e[f(1005)](a,f(1679)))return x[f(1228)+f(1620)][1]?void 0:x[f(1228)+f(883)](x[f(1228)+f(1620)][0])}return e.lwSAv(ke,i[a])},set(i,a,x){return i[a]=x,!0},has(i,a){let x=r;if(e[x(444)](e.CNDCk,e[x(1296)])){let f=_0x41b119[_0x1e10f0++];if(f<=127)_0xa570c3+=_0x1e7621[x(1483)+x(1162)](f);else if(f>=192&&e[x(1099)](f,224))_0x5b2d4b+=_0x214365[x(1483)+x(1162)](e[x(934)](e.CsJQJ(31,f)<<6,e[x(1023)](63,_0x4a1032[_0x444e36++])));else if(e[x(801)](f,224)&&f<240)_0x3e6e39+=_0x3c39f6[x(1483)+x(1162)](e[x(934)](e[x(889)](e[x(1174)](e.CsJQJ(15,f),12),e[x(1023)](63,_0x55b447[_0x32f249++])<<6),63&_0x4d0e59[_0x2517d5++]));else if(e[x(1541)](f,240)){let u=e[x(465)](e[x(428)](e[x(972)](e[x(1113)](e.GRkmz(7,f)<<18,e[x(1734)](63&_0x15ab1c[_0x1f9681++],12)),e.qQmSW(e[x(1514)](63,_0x18ea74[_0x183fb5++]),6)),63&_0x1722b7[_0x38aa9e++]),65536);_0x339ffa+=_0x54e9b1[x(1483)+x(1162)](55296+e[x(378)](u,10)),_0x1c706f+=_0x117f49.fromCharCode(e[x(1488)](56320,e[x(1514)](1023,u)))}}else return e[x(1621)](i,IDBTransaction)&&(e[x(652)](a,e[x(1283)])||a===e[x(1399)])?!0:e.rNPyF(a,i)}},Lt=i=>bn.get(i)}}),si={};rx(si,{deleteDB:()=>dx,openDB:()=>ux,unwrap:()=>Lt,wrap:()=>ke});function Cn(){let r=["q1njAKO","B3n1DxG","v0DkAK0","qM5YzhO","CwzQBeK","sxbwq0e","zuPitMe","yxnJCMLWDa","DwLoEuO","qLjmt0W","BNrbBMrvCgq","C3nHz2vfDMu","u215BK8","DM9otK8","sg1Izfy","CM92AwrLihC","AxnbCNjHEq","z0Plwxi","Aw9U","wNPtCMe","AwXSihvZzsa","uNb0v2C","vfLVuey","CMvHzhLtDge","yxGGCMv0CMK","CeHlt1m","D2fZq2XLyw4","DLrPsw4","DhnoBMi","tfvpvve","vxbKyxrLq28","z09Ltfq","y0jjtfi","y3jLyxrLq2W","A0zxuvy","vg55AKy","zhzowNy","r2TOyKC","FdL8mhWY","rfLttwS","BMrWB2LUDca","A0DPCva","vLH0wxO","ywnRtxnNswq","CgfNzxnOB3C","AuHgtNi","DvzYv3y","x2HHBMrSzu8","r2PNBgq","B2nRzxq","zxjYB3i","BNruCMLLC0m","Aw5N","Bwf4tg9ZC0m","ywjVCNq","CgD3ELu","u0L2tNa","ALfQzfK","DeTUCe4","veDyC0q","CvDtu3a","yxDvA3C","y3vYC29Y","DKngyMq","t2r0rLa","mNW1","wKDWzuS","AK12tfm","sfnlChq","y3jLyxrLt3a","B3jLtMfTzxm","EKzsweu","wLnLu2S","CNnVCL9Uyw0","BhHyv3q","x2nVBM5Ly3q","AfL6D1e","wLPqB0K","CM9YrxzLBNq","Dxvfq2m","AKLqseG","z2v0sxrLBq","A3blzLG","Dg9cExrLC0i","x2LUAxrhBg8","zgv2AwnLx2K","zgnnwwK","x2LZv29YA2u","u21lBhe","AxmGDw5Kzwy","BgLZDgvUtMu","nNW0FdD8mhW","twPMD0O","DNHzquK","t3b4A0O","y291BNq","D3nZoI8V","zLPNse8","DxnLCKLW","CMfTugfYyw0","l3DZl3yY","zgDnv0K","zw50zwqGDhK","zMLSDgvY","zeXdBgq","B25ozxr3B3i","BLbwtLa","vgfWB0O","uKzzu2m","ugHvyKS","C1DMqwC","ywjvyKy","vLjQwNi","zwnmDw8","sMrcue0","x29WDgLVBNm","AxnrB1nby2S","suvRC1a","zereCeO","vejvr3y","BwLZzq","BMv2tfq","twfyEeC","rxzLBNq","y2HHCKnVzgu","s09AsuW","CgfNzwHPzgu","z2vY","EvjLy29UBMu","C3rVCMu","BwvKAwf0zwW","Dxrjza","AxnmB25N","C2nYAxb0","BM5Ly3q","v1jiCwK","yM1PsKO","C2vUza","wgv5z0q","CxbWDgy","C2jAvKi","DgvZDa","B3fkwNi","zMLN","q2n5r0i","AgfZt3DUuhi","uNfPq3y","z2LKALq","CM92AwrLige","DNnJuxu","C3bSAxq","DuXYDfi","A0HttwW","rgnMEw8","BezSDxnO","nhWXmhW2Fdm","CM9TEvi","ihrVihjLDhi","sLzIse0","tMjsqxq","Agfvr2S","wM1nwei","EgnSv3q","t0TiqMG","Bwf4uMv0CMK","sg9uCKS","ChLIsM0","Bw51wKC","zMzMzG","x2LZtM9Kzq","u3zPsfy","CNzHBa","uw9SzgK","B3vUDa","CMvHzg9UBhK","CNzHBfzHBhu","vu5Itei","B2zMC2v0","Dw5RBM93BIa","BwXMv2i","CKTZrNG","ELzcr0u","CMvHzhDYAxq","C3vIyxjYyxK","CvfTu1C","yNvMzMvY","lcbOB3n0BMe","x3DHAxq","Bgj1A0q","v3Przhi","wvDuuw4","tvbQrxy","vNHJENm","yM9L","vLrTAhK","su9zAu0","z1rPBwvVDxq","CgfYC2u","s0DLC1O","x2rPC2nVBM4","nhWXFdb8m3W","vxDmveC","y29UDgLUDwu","v2jcs0e","B3bLCNr5","x3vYBa","Ae1LC3nHz2u","B3jpBMXPBMu","AwXLtMfTzq","BgvUz3rO","CMvZzxrdB3u","x2LZtwLUAvC","DKvkqMS","CMfUzg9T","zw50","uNr2q1O","DLDrCfa","AxjLza","yvnIAeq","zMzmAw5L","Aw47y2HHCNm","AgnqBxK","CvH1z0e","zvvYBa","wxfxCu4","DKXcC3q","ywrKq291BNq","y29UBMvJDgK","BgLUzq","BMvJDa","wgPNELC","sNbbvgC","r2vOt3q","B2Twuee","C3rYAw5N","ANLyCeK","s3bzugC","quH0Egu","rfvpsNm","tKPrueO","EwjTshu","AgP2uNK","BwfW","rvH6ueW","zw5XDwv1zq","yLnlz3O","ig1LC3nHz2u","zwnhBxq","y2HnyxHdB3u","zeDZCg8","DKzUDfy","x194x21Zz18","BM93","Dur5y2y","ChjVDg9JB2W","tfvwsee","B3bLBG","D1v3BKe","EKLXv28","Cg9PBNrbBMq","u2j6zui","Cg9W","vhzyy1m","uMvJB25Uzwm","tvDJEfe","uhvyueS","CMTnEeu","A2rtD1a","t2DYDhe","wNrkEva","x2LUDgvYDMe","sgDArfm","D0njAfG","rgjlDxK","CLDWzxC","mhWXFdr8mNW","yw5Hz2vY","yM9ruw4","vvPrCLm","y3D4Bu4","sMz3Cfm","B3bLCNr5tMe","yuvZCwO","zw5HyMXLuw8","zMvY","ywDLsgLKzq","C0nVDw50zxi","uhb0zKK","zM9YrwfJAa","yNvMzMvYzwq","DLD6ufe","CMvZB2X2zq","CNnVCL92ywW","y29Kzq","BwvZC2fNztO","DgvmB2Djre4","x2jPBMfYEvq","x2nSzwfYvgK","rKLJCNy","B3fZt2G","s2zlAM4","yxnZAwDU","BMCGB3iGyw4","whrOweu","BKTQyMW","zxrxB3jRq2G","DgfIyxnL","tgjuquq","y3vZDg9Tshq","C2DvCKO","Cfrcvxu","zv9ZDwnJzxm","wfrdCfi","z0zRtvC","t2rtCwW","teDhCfu","wKLuC2K","DxPKqKm","AKD2BLK","EMvNz1y","z2v0q3vYCMu","Cg93","yLngy0q","B2LUDfjLywm","zMjmsLi","Cw9Zx18","x3bPBMDmB3m","wxfbEMq","rLr3Cwm","uKXpr3u","DMvUDa","zNjHBwvuExa","CNbrwgG","DxrVuMvJB24","vvn4DLK","y29UBMvJDca","x0vysvnu","D3jPDgvvAw4","vffxBwq","rvfxuLq","vfnkBgG","C2v0q3vYC28","Bgv2Dwu","zNDZxZeUmc4","zM1mquS","yxzSueq","EwHuDeC","EK5AENi","vePRsuK","teLKuMy","y1zrqLi","zfDVCMTLCKC","z3jxAe8","yKTAwfi","y3DvD1q","B3v0sw50zxi","DgLUzYbZzxi","ENjhDfm","Aw5jB1G","C3vIC3rYAw4","yxbWBgLJyxq","wxDjtfy","q3riD3m","wg92BxK","wujetee","C2v0sxrLBq","C3vJy2vZCW","EKjpwM4","v0zOy1C","DLzWs1K","EuLzyMy","zu5yDfq","BhvfzgC","t3DYAfG","tLj1wvm","twvZC2fNzuu","vw5PBxbSzw0","BhjuwKi","C3vSt1C","re1RBfK","q1n2z28","Chv0","uMvHzcbWyxm","zMnWAxa","C2vUzf9Hy2S","B25tDgfYDfi","Bwf4twvZC2e","ywnRx2nVzgu","Ec1TC2CTy3u","rxnqswS","ExbbrMC","DgzPu0S","q1vNyuW","B1LSy1O","AgjXs1G","Ec11C2uT","AujJALq","mZyWmdiXoujVDgTYqG","Bg9Nsurhzw4","sMPtz2y","terHDLq","t3zJvLu","zxjYtxnN","x2LUAxrqCM8","Bw9WwMK","AgLNAa","y1Pws0q","v2jwyu4","sxruCLu","Cgz4uMy","zNjVBNrPzxi","u0rXq0e","y0Dgrwy","z2jUqNu","DhjPzxm","ExfRu20","v2vPEgLUsLm","x2rLyNvN","rNjVBNrPzxi","Dg9oDw1Izxi","qK5grfm","AxnszwfKEq","nNWWFdj8mxW","zhnXu1a","x3nLBMrby2S","D3PuvM0","ihrPBwvZ","Agjns2O","sfPWvfC","yxrHlcbKyxq","thL6B20","x3bHDgHlzxK","y2f0y2G","y3ruAw1LB3u","BKXPBMu","tgrAA1e","qKr0EuS","vhfRreq","qLnYyvO","uvPQzM8","ExDNtNi","vgLTzw91Da","x2rItMfTzq","y254sNe","DxvlBfC","D3nkqMm","AKTlzKm","Dg9VigXHCMC","DxbKyxrLq3u","t0zcBMq","B25nzxnZywC","yxv0B21HDgK","ANb4DvC","C1L4qwi","tg9JAW","rezZAeK","Ahvcr1i","D3jPDgu","qLD3Agm","zMLUza","z2u6ia","vhbhrKe","EKrqCLu","AenSB3nLrxy","C0Xf","A3nRvNa","vu1KvNK","yLjmvgy","zgvSzxrLrge","su5wChy","y2HLy2TdDxi","B2nRzxrtDwm","vK50yuy","CMvHzfvjBNq","AxnrB1nnzxm","rezMuwi","zgvSzxrL","zvLYCxu","rfjoELi","DNbuAMW","B3bLBIa","vhzNuMy","CufPtvu","t1PMq3G","x2n1CNnVCK4","CYbWyxjHBxm","x2rPC3bHDgm","z2v0qwXSs2u","txz0A2i","ywDLu2HVDW","Evbevgu","yNDgqM8","BMfLz2m","yxj4qKS","y29TCgXLDgu","whD2wLa","twLZC2LUzYa","tu5evwG","Dg9tDhjPBMC","BKXds2y","DvLlELK","yMfJA3vWigu","BfDNz0W","AeDywNK","CxHxqxu","Cgf5Bg9Hza","z05Zrgy","rKDKueC","aaaaaaaaaaa","x29UvgLTzw8","uM9QrvO","x25HDMLNyxq","u1LWBvK","ihrPBwvVDxq","vxvvBeC","B3nLrxzLBNq","Agfxqxq","u1Lwt3y","t29Nu2S","z2vtEw5J","y29UC3rYDwm","CMztseC","B3bLBKrc","lcbxzwjtB2m","weTRr3K","C2v0","uuPbvM0","D24GCMvHC28","x2XPC3rLBMu","yMXVy2TLza","rNfnq3m","CMvZzxrfBMq","AwvyAvm","x29Uq2XVC2u","AwDHDg9Yt24","rhnWsLG","C2v0u3rVCMe","CMfNzvn5BMm","y3r4","B25tDg9Wsw0","ugHRtMG","DK1fwg8","yKXiAMm","C2vUDa","yxv0BW","vNvnvgW","vMvctxO","AgfUz2u","Cxn3ufq","v01gAwK","z2vfCNu","C3jJ","x0rctMfTzq","shziAva","AM5xtLq","qwjVCNrfCNi","ywWGy3vYC28","r2zYwvu","z1Ptu3O","CNjVCK1LC3m","zgvIDwC","sKrXEKO","s0f0wem","Dhr3Awq","AgvHzgvYCW","zgjss2O","uuThwNe","BgXdvhK","CgjWEKO","DuvWBM0","D3zywe4","mdaWma","we1nyNO","zMzLCG","wvPNEKW","ELb3BK0","ug5LAem","q0f0s2m","x3bPBMC","Efrurw52","CgLUz09Uy2u","wMfjB2K","C2XPy2u","ywnR","tMzwC0K","CMvHC29U","ANDXuKu","weTHwhi","qKvzqMO","zfnRww8","x29UrxjYB3i","uNHjCfi","uuLLAuC","DgLTzw91Da","u2vXsuq","x3nVy2TLDa","BML0AwfSAxO","ywrK","rK1tvLq","Cw9Z","C3rYAw5NAwy","x3jLBw92zvC","t2DKwfK","ChrVCG","uNDlAee","vhfYqLa","DxrMofDYAxq","zgH1r0O","mNWXFdn8nq","rxjeBNK","D2PYCxK","u0HXCMi","EM9tBMG","vLP4vxm","t1nNtMW","zwn0","zgfitKS","CM92AwrLihy","y2fSBa","x2TLEvbHDgG","x29UugfNzu4","uKPwEu4","zMXVB3i","wwzQyuu","EuLpquy","CMTLCKDSB2i","AMzSC3a","rgvZz2q","zu5Sruy","mdaWmdaWmda","y29UBMvJDfm","BgHjtMe","yLniuK0","sxjsvLq","y3vYC29Yx24","DcbSAw1PDa","Dwr2qMy","CxLZuwS","yNL0zxm","DfLmv0u","CMLLC0nVDw4","zKDvt1G","qwLdAeS","wLHotuq","icSG","v0zrAgC","rvLxwvq","wfPNu1u","sxzOAuy","CePXq0y","B2zMBgLUzq","sKfWDKu","zNf6EwS","D0PrtKy","y2uGBM90igK","vMzRsfC","vw5Oyw5KBgu","DuDpwgy","CgXLyxnLiha","CfzZz2W","tg9NsurozxC","CIb0DhDjra","tMfJteC","rhvQwhO","DMvYC2LVBG","BwjdA3O","vNvtCNe","DhjPBq","reiGzMfPBgu","zxj2AwnL","AwXLx25HBwu","q2T1ruO","Curfr0y","nhWZFdu","t3P1De8","DeLK","A21vEeC","D3D5C0W","Bezgugi","AgLHtNi","yMrFzgLK","ywrKrxzLBNq","DNrXrfq","mJa3mZCYmgXkrgvnEG","x2HHBMrSzvi","tuPcA2i","qwnoq1u","Eg9xAvy","AffbyMe","s2T4wxO","Ew5IDNu","m3WYFdr8mxW","tMHPDKW","y09Wzw4","rMTywu8","uvr1u24","BgLTAxq","mJDIr0LvEue","AMvdAfi","s09wzuS","q0HJCxG","Dgv4Dc9Qyxy","AwXPtK4","EeDtALy","uLjpuG","rLjey3y","qLDgvgy","zKnIEu4","zgvS","te9pCuy","sxzAu1q","C29YDa","tfbRuxi","ChvZAa","yNL0zu9MzNm","yMLUza","rwrPreS","rKLmrv9ot1q","CxvQEve","Bg93","rMrerwG","zu1zDhi","ywXSB2nvBNm","q0XkAgC","DgLLCKPtt04","D1Dxwva","Ahr0Chm6","EgTtweq","DMn6zxG","Eg9Qtw0","DeLUDgvYy2u","Dg9iyxnO","EvPfwfm","uevQEuO","yNL0zuXLBMC","tK9uyve","B25fCNjVCG","B1PMv2O","DMfSDwvZ","C2v0y3vYC28","Bwu6ia","EK5TyLy","DxjS","qwT4Eve","whjKt2e","C1PqqMm","BMj3tMy","q0Xmvgy","sMrVELO","zsbHihn0CMK","y3jLyxrLuMu","zw5JB2rLrNi","qwn0sg0","zufJAW","A2v5","yLbNqLG","AKD5uw0","CMv0CNLdB3u","v0XjrLG","BMnVzgLUzW","BgvY","rxfUA0m","t2jVEKK","v0jIwvK","DhDjqMi","wwTiB2K","z2jRy0W","zxjHDg9Y","AMT2uNO","D1zJwfi","se1rzfK","y3jLyxrLtwu","yxjYyxLIDwy","v2PmCeq","txnztKi","rhLUv3e","Ae9Wzw5fDMu","reTpvg8","rLvxBKq","sxbzDMm","x1fVu01HBMe","yNvyuuW","x2nYzwf0zvm","uMPxt3K","Dgv4DfbHEwW","uhbTAgW","y3vYDMfSDwu","r25ls2u","zw50tgLZDgu","igzHAwWSig0","v01ruKC","Bg9IywXty28","wvvXueu","wLfVAMC","ywnRpwzYB24","y2XVC2u","EgTQDKS","qwXYvLK","CMvWBgfJzui","zK1itum","z1HVvha","AwPlvwO","t1z2AuG","txDyz2q","r0DWBfG","tg9Nsuq","zNryCey","BNDMzvO","z3n4t1e","EhfPBK0","zu1Atxu","DMTvzNK","lcbTyxGGCMu","qKzqt1e","rhnvy2m","B25pCgvU","vKHbAg0","B3jRig9MzMW","EvDdAgK","yuvlEwK","vMvRv0y","A25fsfe","zgvJB2rLzey","wKvTEfu","sfv0vwG","AwrI","v25SBhO","t3bLBKv2zw4","Egrdr04","tKfusvzfx0u","CgLUz19VBMm","zxjFAxnFywm","z2v0u3rVCMe","uvPpyLK","t1bftL9fuLi","Bhm6ia","r3jKEve","x2LZsw5PDa","ihbYB3rVy28","wNrxAgW","C1j4svu","teP6q04","yw5ZzM9YBvq","s3zoDei","CgvYC2LZDgu","B3jL","ELfTvM8","tuPbC1m","uMfwAMO","y3rmA1u","z29yEfu","EhDAtgG","DLH2ANG","Dev2zw50","uxvLDwu","q2Dls2e","EujKqxC","t0zSA1a","s2n5uLa","AK5zCLe","Aff6EK8","ndqWodi2u0f4vw5H","ywnOzwqSihC","weTHqNu","y29UDgv4Da","zgf0yq","Bff4q3i","y0vQDg8","x2rLC3rYB3K","Bgzbwee","t0jPyxG","BufQzNu","ywXSzwqGBxu","A1rSvee","BMDuAw1LCG","t1bftG","DcbVzIbYyw4","Ahr0Ca","B25JBg9Zzq","uhnfDvi","rMjNq0C","BMv4DcGPigm","Cg9PBNrdB24","ANPYAue","y2HLy2Tszwe","q1f3Cwi","DeroDvO","x2HHBMrSzva","y29SBM8","CgjICdi","BejZv0C","Egr4suO","re9cv0W","se5oD04","u1LiwLi","qw9dqxy","CfPPBeq","qw1pq2y","AeDfBwS","zgLZywjSzue","uNHKwwW","zxHWB3j0CW","rufrCxy","zwrPyxrLBhK","tenPAvK","AfrQq2e","zMXZAMG","t2rbyMO","suvtx0vsuK8","vNzcDLq","AuPKBxi","BNrLCG","DMfS","y29UBMvJDeu","Aw9WvwS","yvn6uLO","rKDuD04","uxfIrgC","tuP2vfa","rg1tChm","BMCGDxjSoIa","Aw5KzxHpzG","qw56quO","D2LSBfjLy28","uvnvC3C","DxHhDwi","AxLAv0u","r29JtLy","BMz0AuC","yvvhrNm","uvnszeS","CxPwzfe","BfzQCxC","tuvtu0fhrv8","sNjQuuq","swPtzK0","zM9Yy2u","r25KBuq","Aw50zwDLCIa","DvLcu0i","DgfYz2v0","AxDfsLu","zxnezKm","BxnNsuq","q3vZDg9Tq2W","zgvMAw5Luhi","BKHKyLO","rgjWy3i","uhjXBw0","BMv3vMvYC2K","zNjVBuj5Dgu","uwvws0C","q3PJB0m","EhvewNm","werwz0y","ywDLrxzLBNq","rg1ksKG","z0Ttv1u","ywnOzwq","x3fVC0rc","BwfUDwfSihi","y3vYCMvUDeu","x29UtwvZC2e","CMnoBKu","yw5Nzq","C0n1BwC","yMvHqM8","DMnXyvq","s2XpCuG","CYbPBNn0yw4","A294EgW","y2vZC0HHBMq","DKHtA0W","zw5HyMXLqxu","vgnxrNy","s2zmt3G","y0jPqLO","Dw50","wuDLrvi","mtC0ntqWCMXKse5c","zcbLCNjVCI4","zfPhy2q","wgLTqve","shzNA0G","B2nRzxrgywK","r1jRBxO","uuv6teS","quDkr1C","vMvxzLK","Cgf5Bg9Hzeu","ywXPzcb1CMW","wKDyEgy","rNDhD0O","sMvpvui","C2jWuxq","tePpDLq","y2LryvK","ihn1y2nLC3m","q291BNq","wgP0z3q","shnmrwm","odyYndy4CMXkr2DR","z29PBMCGyxC","CxfHsu8","x19LC01Vzhu","uuT4Du0","A21LqK0","zwnVBM5Ly3q","BwLUzW","ihzHBgLKigq","DMLJzuLeig8","CgLUz0LUDgu","zxjFywnRx20","vNHLt0y","DhjHBNnHy3q","uhH5zgK","AejzqKS","yxKSihrYEsa","B2zM","BwvZC2fNzv8","y3fHtLa","y2XcAeu","zw1PDa","r0jWD0G","CMvXDwLYzwq","x21PBMLoyxy","rfr6Cgy","vgX5C2G","x3bYzwzPEa","q0Xpu0ve","vejjuwy","Cffsrwe","x3jLywr5q2W","zMXVrhq","CMvTB3zLrxy","AwXK","zNjVBujPDhm","yvj2D2S","z2nKsNq","C2L0su0","DhvkEMy","vezVzKO","Dg9Ys3a","C2HQtvm","x29Ut3bLBG","BMvY","igfYCMf5yNu","wxb1z0K","C3rLBMvYCW","CMvZDwX0","ru9lwxy","EvbPrva","ihjLy29UBMu","v0Lns2e","tufyx1jfvfi","B3nLza","ELL2qNe","BMrLEa","D1vxrhu","zw5JB2rPBMC","zNjVBu51Bwi","qNzqtKW","Ef9MCM9UDgK","u0vuCu8","zvLWs2u","vxfSEee","shj5A0i","AhDgu1e","tu9IDeS","x3DZsw5ZDge","z0HovMy","zvvNEem","rxDwzLu","D0HvsNq","wgPuBe4","rM9REvK","Au9wsK4","CLzHBhvLCW","u253seK","AM9PBG","zhHPrfK","rvDRB0q","sNL0qLC","C2HPzNq","BMnLq2XVC2u","uu1XAfC","vxjwDLK","zvjfvKu","qwzHwKy","vMDoBgK","D3m6lY8","BMnRr3C","CNnVCKzPBgu","rKjZwvC","x2vUzhbVAw4","mxW4FdD8nxW","yw1LoIa","CMvTB3zLq2G","wvj1y2K","vwzkuhi","ExvsvLq","y3vYCMvUDeK","AvLSyLa","q0nUzhu","A05ls1O","whHQzuW","q0Xpu0LorW","EezZCe0","A1vuzLG","Dw5KzwzPBMu","qLfhqxi","v2LUzg93","BgLUzw5V","yM9KEq","x2n1CNnVCK0","q09otKvdveK","AxnFywnR","y29YvvC","teHAtLq","zKL3s2C","vgfN","rePAqNK","y29Uy2f0","ywfkDfa","q29Kzq","BwvY","tvbqB0K","DMfSDwu","wxfXsNe","vgXeEgy","C3jRq3u","DgLTzw91DcW","jMPZy2fSBgi","B25szwnLAxy","DgHLBG","Eev2Dgq","s2not3e","t0LQsgS","zgHVz08","vwLlshi","mNWXFdn8nhW","C2vYDMLJzs0","zePMrum","t3HusKC","q1vXze4","sKzIrhi","wwPQsxi","v21Ht0S","s1b4zwW","y2zotM4","rgXNuMW","ywX3yxLZ","mtqWmJaWyw9yyuXy","AMHZzfa","vgHptMm","uLHxwey","AenzA2W","BKfmzxG","mxWWFdn8nhW","zxf1ywXZ","yMLUyxj5vhK","t3bLAuq","y0ngCvu","qNvZDKq","B2jZELO","ugrAqNq","vxHvBvK","y0nWruW","DxfhCKO","x2DLBMvYyxq","EwTRz2C","AMvJDfn0B3i","AhLqr3q","yw1L","y2XVC2uSihC","wfvdsuK","vuf6BwK","C2fNzq","yxnL","CMvQzwn0","DLDpzuC","BMvLzf9Hy2S","q1fTs1a","rxjYB3jdB2q","DhbizwfKzxi","AevYCM9Yrxy","zNvHsue","Dg9mB3DLCKm","x21LC3nHz2u","u0fuvfm","B2jQzwn0u3q","C3zbDvG","D3HQqKW","ANzVrvK","x2fKzfDZtgK","DfrWuuC","AeDhwNG","B2fK","BfrPBwvVDxq","BMfTzq","AgfZ","Bg9N","wfLWrgy","yNDPAwC","zuHgz3q","DePPv24","tu53ELa","wgfxrg0","igzPzwXKoIa","B2XKvMvYC2K","DxbNCMfKzw4","pxv0zI04","C29cruG","quvvre8","BMCGzMfPBgu","CMfTzq","EvLxvhi","vgf5C2q","zNjVBuHHC2G","sLnptLa","uxHmtxK","y213wha","CMvJzwL2zwq","EeDqq2C","zhH2u28","z2n2BeK","q3nJyva","C2vYDMLJzq","q2Xiy2m","tfrHuK0","CwPcEM0","v2X6seq","AefJA01LC3m","ExbL","u2TPCcbWyxm","ywnRx2LK","rxzjwuu","zw5NDgG","tLH1twO","B25TzxnZywC","BMDLza","q21jA1a","BIWGAg9ZDg4","Aw5KzxG","CMvWBgfJzq","C1rMuxO","wxbeDM0","C1P5u2S","tgrbv0S","rLnrtKK","x3bPBMDqB24","sfrSsKK","yvrYuxi","rMv3t1C","uMT4BgS","x3bYB3rVy28","rfjitKu","yxbWBhK","q05eq2S","rKTfwwS","ihzHBgLKihm","C3rXtuG","y3vYC29Yx2y","B09vD0S","tLfMq2S","ywneBwi","tvDgC2C","B2vbAu4","tMfZv2C","yMfSrxzLBNq","CMLSAhC","qw1VDw50","D0HbzLi","t1fftue","DhbOtMG","zw1LBNq","CeTxEe0","CMvUDevUzha","zcWGDw5RBM8","CKDND3a","q3vZDg9Trxi","C0zitKq","uMHwuha","DePAExe","y2HnyxHuCMK","EMjKAfy","r0HbsfG","zwvKzwq","DhDVCMTdAge","BvncEem","uunrCvC","nhWYFdf8mhW","De1HBMfNzxi","y09rrwW","z21tANK","vvHorvC","v3jwqKu","s3nzC1u","rLDt","o2nOyxjZzxq","ruPfvuq","CgLUz0XVC3m","vxLhvwW","swTptuC","z0frAM4","v1zwsNi","tw9KDwXL","C3rHCNq","EMnVwvO","zxq9DxrMltG","u3rYyxrLz3K","Duj2Agq","y3vYC29YlNm","zMX1C2HfEha","D3bTveO","mhWXFdn8nhW","rML3ugq","zw5HyMXLvhi","zvzfDuy","uvzsB3K","BMrWB2LUDfq","ChrTyK4","zgLsC1C","A1n0yxr1C0m","x3nLCuLK","rxHqDfG","x2nSzwfYugK","CeDTEKO","r0nhDwK","x2LUAxq","BNrfBMrWB2K","zNbzDNa","AMr0s2O","zLHZBLC","veHsEwS","y29UBMvJDa","x2n1CNnVCKy","BwvZC2fNzq","BwXcrum","wNjjtwK","Ce5zEw0","A3DOC1e","Aw9UvgLTzw8","CLL3z24","tgLZDgvUzxi","t2LLBei","teT5ywK","t2jQzwn0","sgjqqK4","C2ruuMC","rLbJvNO","BeHHBMrSzxi","u2HHCMvKv28","rLr1wxK","tNL2u2y","z2D3CvO","x2rYB3bhBg8","Dg9Y","B25LCNjVCG","yMfSu2nVCgu","x3DZ","z3z6y3i","DhjPzxmGCMu","u2TxyNC","A1bmBxG","AwrvAxe","rwjoCLi","u3rUwwu","z2vMu2G","z2vjBMzVu3K","AMDqtfi","C0PVsMm","tMrcrfu","DvHzuvq","r01wEge","vK11yLa","quXSzfi","z2v0t3DUuhi","t2HSthu","qxPZDMy","q09oveLovuu","BNDHv2m","q29UzMLN","AwrtC1O","uKvcEwG","z2v0qwXS","ywXty29Wzq","C0vlENy","y2v4s3y","C1jpveu","Au1Ntw4","y2XVC2veqG","zxjYtM8","z2v0s2v5","B25Uzwn0Aw4","tfDwzvy","C2DPza","D3bYBeG","x2LZtwLUAvq","z0z6qxm","EuXWvvG","zcWG","u2vYDMLJzvC","y2XLyxi","zg5TqKK","A21Hqve","C0XPC3rLBMu","vfvZBxe","v2vIu29JA2u","rLjptLrjrvi","t05xq3m","qwnXEwi","C2v0zgi","Bwv0Ag9K","CgnMEwq","B25VCgvU","tMfTzq","BxnzyK4","A2v5CW","r05uBxK","CMvJB25Uzwm","r0fhyLy","ywDL","BxjqAwu","rvPprwy","z1ftvuK","zxjFCw9Z","we55wM4","CMfRANO","C1z4rwi","CMvZzxruCMK","zw5fDMvUDa","u3DcBfu","q0j1yuW","AvvWrMS","Cgf5Bg9Hzfq","z2vrDwv1zuW","Aw9Ul2PZB24","EMv6CfC","rfjQB28","Dgv4Dc9WBge","oxruvwzxwa","uNLhzuq","ww5Kwvy","C2vYDMvYvgK","zNjVBunOyxi","AK5rweS","zw5KCg9PBNq","wur3tfm","BwLUAvbYB2C","vw5oCuC","igXHCMDLCIa","swLVEMm","qxjzwMW","sMjrqvu","s3zzywq","x3jLy29UBMu","EhnIAfq","wwv2yNe","DhLWzq","vvPTyvu","AwfYvwy","t1jdB0i","ywrKt25L","x2LZqNjVD3m","AvLXz08","BLDXA1u","quzezg4","CMvJzxzPzwq","tg9YrMW","z2v0","zKz3zwm","CuT2sNK","CNDdsuu","Aw5JBhvKzxm","CM92AwrLigi","q3nkuuO","zg9Uzq","x2DLDeLUDgu","shfzywC","rKnqv3u","zuXtD3a","zxjFBxnNAwq","tuLPAeG","ChjVDg90Exa","t3jiCvK","uMHRtuO","zxjFCw9Zx2e","x2zVCM1HDeu","sw1nwKy","uwvOChO","y3jLyxrLrxi","BeXTz2W","C0jf","mJaYmZq0ogfpy2PqBW","AvvjDuC","q1nSDwG","uxnvuhK","yvvIsfy","Bg9NsurozxC","r3zLBwK","zuTAqwi","ufzgwxq","qLrOB1m","zv90Aw1LB3u","sgnuA00","vezICw8","EhzpDgS","yw51Ce1LC3m","Dw5ZAwDUzwq","rgvKAwnHDgu","zxH0zw5ZAw8"];return Cn=function(){return r},Cn()}function ux(r,e,{blocked:i,upgrade:a,blocking:x,terminated:f}={}){let u=S,g={aZgTd:function(v,y,C,T,P){return v(y,C,T,P)},ArYZl:function(v,y){return v(y)},LUOUQ:"versionc"+u(585),naegc:function(v,y){return v(y)},FTwqc:u(567)},m=indexedDB[u(1806)](r,e),_=g[u(530)](ke,m);return a&&m.addEventListener("upgraden"+u(1325),v=>{let y=u;g.aZgTd(a,g[y(1491)](ke,m[y(1087)]),v[y(1247)+"on"],v[y(987)+"on"],g[y(1491)](ke,m["transact"+y(1568)]))}),i&&m[u(719)+u(1382)](g[u(366)],()=>i()),_[u(1172)](v=>{let y=u;f&&v[y(719)+y(1382)](y(833),()=>f()),x&&v["addEvent"+y(1382)](g[y(1579)],()=>x())})[u(470)](()=>{}),_}function dx(r,{blocked:e}={}){let i=S,a={corUW:i(567),mrPie:function(f,u){return f(u)}},x=indexedDB[i(506)+i(344)](r);return e&&x.addEventListener(a[i(1155)],()=>e()),a[i(1461)](ke,x)[i(1172)](()=>{})}function ei(r,e){let i=S,a={xlEAM:function(m,_){return m(_)},wWWYP:"AbortError",MJAsS:function(m){return m()},gcdJt:i(1724),ogzIM:function(m,_){return m instanceof _},cCpEL:function(m,_){return m in _},YndYV:function(m,_){return m===_},cnxJq:"string",JeOUB:i(544),gbnBu:function(m,_){return m!==_},nLCKf:function(m,_){return m in _}};if(!(a.ogzIM(r,IDBDatabase)&&!a[i(1205)](e,r)&&a[i(1481)](typeof e,a[i(481)]))){if(a[i(1031)]===a[i(1031)])return;KgyaRC.xlEAM(_0xa30aa0,_0x19fb78.error||new _0x1ea195(KgyaRC.wWWYP,KgyaRC[i(763)])),KgyaRC[i(885)](_0x4ecc70)}if(yn[i(1508)](e))return yn[i(1508)](e);let x=e.replace(/FromIndex$/,""),f=a[i(451)](e,x),u=oi[i(1512)](x);if(!a[i(537)](x,(f?IDBIndex:IDBObjectStore).prototype)||!(u||ii[i(1512)](x)))return;let g=async function(m,..._){let v=i,y=this[v(1052)+v(1568)](m,u?v(1732)+"e":a[v(1076)]),C=y[v(1679)];return f&&(C=C[v(1281)](_[v(1121)]())),(await Promise.all([C[x](..._),u&&y.done]))[0]};return yn[i(563)](e,g),g}var ii,oi,yn,lx=ni({"node_modules/idb/build/index.js"(){let r=S,e={xGSjV:r(1750)+r(1615),AcNCU:r(1508),DUOJs:r(1431),gUpPv:r(1423),LHZNT:"getAllKeys",uLrtR:r(1645),ijKUj:r(635),zNZzr:r(514),zCOGX:"clear",djHwI:function(x){return x()},yPDTe:function(x,f){return x(f)}},i=e[r(741)][r(1700)]("|"),a=0;for(;;){switch(i[a++]){case"0":ii=[e[r(724)],e[r(1788)],e.gUpPv,e[r(1156)],e[r(1701)]];continue;case"1":Qs();continue;case"2":yn=new Map;continue;case"3":oi=[r(419),e[r(839)],e[r(385)],e.zCOGX];continue;case"4":e.djHwI(Qs);continue;case"5":e[r(528)](xx,x=>({...x,get:(f,u,g)=>ei(f,u)||x[r(1508)](f,u,g),has:(f,u)=>!!ei(f,u)||x.has(f,u)}));continue}break}}}),hx={idb:function(r){let e=S;r.exports=Promise[e(1841)]()[e(1172)](()=>(lx(),si))[e(1172)](function(i){return i})}},ti={};function Ee(r){let e=S,i={WSSTj:function(f,u){return f!==u}};var a=ti[r];if(i.WSSTj(void 0,a))return a[e(939)];var x=ti[r]={exports:{}};return hx[r](x,x[e(939)],Ee),x[e(939)]}Ee.d=(r,e)=>{let i=D;for(var a in e)Ee.o(e,a)&&!Ee.o(r,a)&&Object[i(983)+i(1754)](r,a,{enumerable:!0,get:e[a]})},(()=>{let r=S;Ee.o=(e,i)=>Object[r(1522)+"e"][r(1695)+r(1754)][r(656)](e,i)})(),(()=>{let r=S,e={gOeLT:function(i,a){return i!=a},VvBvT:r(1344)};Ee.r=i=>{let a=r;e[a(1581)](a(1147)+"d",typeof Symbol)&&Symbol[a(536)+a(1158)]&&Object[a(983)+a(1754)](i,Symbol[a(536)+a(1158)],{value:e[a(947)]}),Object[a(983)+a(1754)](i,"__esModule",{value:!0})}})();var $={};(()=>{let r=S,e={XUCII:function(s,t,n){return s(t,n)},WLIFX:function(s,t){return s===t},UfJPr:r(1642),UqlxA:function(s,t){return s(t)},Acqyb:function(s,t){return s+t},yIYbf:function(s,t){return s+t},ZITsi:function(s,t,n){return s(t,n)},vHSkL:function(s,t){return s instanceof t},uDVBR:r(1228)+"oreNames",aUbHV:function(s,t){return s===t},knEHQ:r(1679),yIOAF:r(1476),zeggV:function(s,t){return s(t)},iyZWE:function(s,t){return s+t},qswPT:r(609),tphNh:r(1718),jJYYx:r(667)+"00000000"+r(667)+r(667),TYoPF:function(s,t){return s-t},MaXxG:function(s,t){return s|t},ynbvu:function(s,t){return s|t},MwXgd:function(s,t){return s&t},llCTy:function(s,t){return s<<t},YqWqN:function(s,t){return s<<t},VekWF:function(s,t){return s&t},xqinM:function(s,t){return s&t},fbLJR:function(s,t){return s+t},OIjHk:function(s,t){return s>>t},dVQcD:function(s,t,n,o,c){return s(t,n,o,c)},WrVBE:function(s,t){return s(t)},sgUrJ:function(s,t){return s>t},bKZXR:function(s,t){return s<t},vxYAI:function(s,t){return s>t},pcfyd:function(s,t){return s!==t},Prqmm:r(1267),lrTZB:r(510),aEKyi:function(s,t){return s-t},rWpew:function(s,t){return s<t},WFQhg:function(s,t){return s-t},YZgzL:function(s,t){return s!==t},srkCu:function(s,t,n){return s(t,n)},HgZDS:function(s,t){return s!==t},WbVaN:function(s,t){return s(t)},Bnrdz:function(s,t){return s(t)},esDfC:function(s,t,n){return s(t,n)},BRLOL:r(534)+r(1062)+r(1246)+r(792),RxIpR:function(s,t){return s===t},CQmKP:r(534)+"required field: "+r(1165),qjBzm:function(s){return s()},LCiiY:function(s,t){return s(t)},jhsdP:function(s,t){return s(t)},okVPA:r(404),Mvtkb:"ping_onc"+r(1542)+"t",nbwNf:function(s,t,n){return s(t,n)},qysQk:function(s,t){return s!==t},XjgzW:function(s,t){return s!==t},FwGwJ:"VbsME",obszZ:function(s,t,n){return s(t,n)},IOYiM:function(s,t){return s!==t},TpGFA:r(466),ZtJyP:function(s,t,n){return s(t,n)},QZjfo:function(s,t,n){return s(t,n)},CscaP:function(s,t){return s!==t},QTgZJ:function(s,t,n){return s(t,n)},EEKSq:function(s,t,n){return s(t,n)},kTlTA:function(s,t,n){return s(t,n)},iOVJN:function(s,t){return s!==t},FbgCG:function(s,t){return s===t},OFlkP:"QbYGK",QyLUS:r(1667),vVpKY:function(s,t,n){return s(t,n)},gHNVf:function(s,t){return s!==t},QZObY:function(s,t,n){return s(t,n)},GndmD:function(s,t,n){return s(t,n)},CBuaL:function(s,t,n){return s(t,n)},WMFii:function(s,t){return s(t)},PsEuR:function(s,t){return s(t)},msYbN:function(s,t){return s(t)},CtHws:function(s,t){return s(t)},uBvhd:function(s,t){return s>>>t},MWcxQ:function(s,t){return s(t)},Ppmhl:function(s,t){return s(t)},haWAt:function(s,t){return s(t)},WFhcW:function(s,t,n){return s(t,n)},jpxuW:function(s,t,n){return s(t,n)},ZtWhl:function(s,t){return s(t)},CUgaL:function(s,t,n){return s(t,n)},VfkHW:r(534)+"required field: "+r(632),SDqCA:r(534)+r(1062)+r(1246)+r(843),DmSps:function(s,t){return s===t},lLmgl:function(s,t){return s===t},Ogrtq:r(534)+r(1062)+r(1246)+r(1451),tHkoK:function(s,t){return s(t)},Jhwlh:function(s,t,n){return s(t,n)},WKueF:function(s,t){return s(t)},dJfEC:function(s,t,n){return s(t,n)},nwaWc:r(414)+r(1652)+"pe: ",gPkEt:function(s,t){return s>=t},CHcqx:"pKWxM",TapoJ:function(s,t){return s+t},FIcrv:r(1272)+"t limit",fCbyN:"pagehide",idUiq:r(1594),SmKlq:r(1545),dhuGJ:function(s,t,n){return s(t,n)},ZEJVU:r(661),Hkexk:r(1123),daHNK:function(s,t){return s>t},JfwpS:function(s,t){return s!==t},zsjmK:r(351),TFbqo:function(s,t){return s*t},CCndu:function(s,t){return s>t},wzTVm:r(420)+r(673),NacLG:r(437),SYVOv:function(s,t,n){return s(t,n)},NasWg:function(s,t){return s==t},pbpzJ:r(1784),hjvRy:r(998)+r(1045)+r(1602),JVbHM:function(s,t){return s<t},uYKzY:function(s,t){return s===t},CLLTf:function(s,t){return s&t},jKKfC:function(s,t){return s>=t},eREVE:function(s,t){return s+t},fGUOX:function(s,t){return s+t},YwILV:function(s,t){return s+t},XNyZn:function(s,t){return s!==t},ZSeSk:function(s,t){return s&t},INVpv:function(s,t){return s&t},sWfAg:function(s,t){return s<t},AfaZF:function(s,t){return s==t},qzVdQ:function(s,t){return s&t},jdtKj:function(s,t){return s+t},awUkw:function(s,t){return s+t},UiKHr:function(s,t){return s!==t},Gvemi:function(s,t){return s&t},UuUlG:function(s,t){return s<<t},RptWg:r(1807),wpmTJ:function(s,t){return s|t},KAtXC:function(s,t){return s|t},jNQXK:function(s,t){return s&t},yWChi:function(s,t){return s>=t},ybmHu:function(s,t){return s>=t},fuaIA:r(1664),QJAVm:function(s,t){return s!==t},NXuMj:function(s,t){return s|t},Desgd:function(s,t){return s&t},stqMH:function(s,t){return s<t},ecGmt:function(s,t){return s>t},GMVxa:function(s,t){return s&t},qxWAu:function(s,t){return s+t},nHdbZ:function(s,t){return s<t},Lyzom:function(s,t){return s>=t},SmynO:function(s,t){return s+t},soBEH:function(s,t){return s<<t},eNXtT:function(s,t){return s<t},gJKYr:function(s,t){return s<t},JFbDr:function(s,t){return s<t},OpeiD:function(s,t){return s|t},CrJbO:function(s,t){return s&t},OrHqY:function(s,t){return s>>t},yPiEP:function(s,t){return s|t},ExPtX:function(s,t){return s&t},eJHNa:function(s,t){return s&t},OVviH:function(s,t){return s|t},ZzSra:r(1598),oZfWj:function(s,t){return s<t},PhkNh:function(s,t){return s+t},ClHcc:function(s,t){return s!==t},EvIYE:r(1104),WVVJr:r(496),QCQqW:function(s,t,n){return s(t,n)},EWkoD:function(s,t){return s(t)},Iiozc:function(s,t){return s&t},mWSXs:function(s,t){return s&t},hBYBK:function(s,t){return s&t},TBUGv:function(s,t){return s(t)},EXzPL:function(s,t){return s&t},PuXPK:function(s,t){return s&t},rKsFx:function(s,t){return s&t},qAiMU:function(s,t){return s(t)},UlLvl:r(1511),fZgHO:function(s,t){return s<<t},yHYKm:function(s,t){return s&t},KpYPg:function(s,t){return s&t},OKHBh:function(s,t){return s(t)},PnehC:function(s,t){return s(t)},haUGk:function(s,t){return s<<t},fRjuR:function(s,t){return s(t)},WRHqi:function(s,t){return s<<t},hGEmk:function(s,t){return s&t},fBlHp:"HZQAh",WbBKA:function(s,t){return s(t)},TcWFv:function(s,t){return s(t)},nPVNP:function(s,t){return s<<t},xsbhT:function(s,t){return s|t},OFBnd:function(s,t){return s|t},TQWmd:function(s,t){return s>>>t},XeygD:function(s,t){return s<t},QqbDg:function(s,t){return s<t},gKSWU:function(s,t,n){return s(t,n)},VeWfY:function(s,t){return s+t},rpUcR:function(s,t){return s+t},SwBlU:function(s,t){return s!==t},dxiDY:function(s,t){return s>>>t},CSIjJ:function(s,t){return s>>>t},rcNnE:function(s,t){return s|t},XrdOa:function(s,t){return s>>>t},kYtMo:function(s,t){return s!==t},vTaOv:function(s,t){return s!==t},EZOEf:function(s,t){return s>>>t},KOVeK:function(s,t){return s|t},HvgkH:function(s,t){return s&t},bLtJF:function(s,t){return s>>>t},LQkUi:function(s,t){return s>>>t},XthXE:function(s,t){return s!==t},inIoX:function(s,t){return s(t)},gFzAs:r(1600),cqaNP:function(s,t,n){return s(t,n)},SHqrb:"close",HvHiP:function(s,t){return s===t},OhlLu:r(759),kHSMl:function(s,t){return s|t},lbukD:function(s,t){return s|t},CSvgo:function(s,t){return s|t},hTjCa:function(s,t){return s|t},jwqRE:function(s,t){return s<<t},FCPWu:function(s,t){return s===t},torKp:function(s,t){return s>>>t},RqiCv:function(s,t){return s|t},StnYe:function(s,t){return s|t},ACwWm:function(s,t){return s<<t},EqnkC:function(s,t){return s<<t},sbZVB:function(s,t){return s<<t},cBiBZ:function(s,t){return s<<t},QeVKG:function(s,t){return s&t},sfBme:function(s,t){return s>>>t},XaWDm:function(s,t){return s>>>t},tuJzf:function(s,t){return s>>>t},oeAiN:function(s,t){return s&t},REByh:function(s,t){return s>>>t},UwLTG:function(s,t){return s(t)},wxjBL:function(s,t){return s<=t},zIqWo:function(s,t){return s+t},mlfWb:function(s,t){return s%t},bRLTf:function(s,t){return s>>>t},acDmb:function(s,t){return s===t},MNDUh:r(1717),bwiig:function(s,t){return s&t},TFMDw:function(s,t){return s&t},EbNrR:function(s,t){return s+t},xclWt:function(s,t){return s>>>t},fdpVF:function(s,t){return s>>>t},gZSSz:function(s,t){return s>>>t},qgqQF:function(s,t){return s===t},JDqzJ:function(s,t){return s+t},tybCm:function(s,t){return s&t},sdTRg:function(s,t){return s>>>t},ecLuo:function(s,t){return s&t},hGGZx:function(s,t){return s>>>t},tYLWE:function(s,t){return s&t},LdAWK:function(s,t,n,o){return s(t,n,o)},LwkMS:r(1100)+"er_qos",CSluh:function(s,t,n,o){return s(t,n,o)},AlrVY:r(1100)+r(1525)+"ck",eYpKe:function(s,t,n,o){return s(t,n,o)},BQGAr:r(1100)+r(869)+"k",xuDZs:"x_fronti"+r(1050)+r(1434),DOBWL:function(s,t){return s===t},WIMKa:r(893),jMvLS:function(s,t){return s>>>t},LwGgX:function(s,t){return s&t},xkSXD:function(s,t){return s&t},huBGR:function(s,t){return s>>>t},koxxl:r(1321),hGXZy:"4|5|0|3|1|2",YWTQn:r(1092)+"IES_ERROR",rpQXh:r(872)+"OR",IvhiF:"MESSAGE_ERROR",LDavT:r(867)+r(742),GehOt:"CONNECTING_ERROR",xkjvK:r(460)+r(711),cfNNn:r(1825)+"3",kmUxG:function(s,t,n){return s(t,n)},eKZAb:function(s,t){return s!==t},gefSh:r(1630),BrmpL:r(1210),OBiax:"BImDu",FGdPG:r(1450),RJVyN:function(s,t){return s===t},YGeER:r(1694),sVxEb:r(687),TvXcS:r(613),uxxmr:function(s,t){return s===t},TCfbN:r(1340),NOTaQ:r(712),ZQojg:function(s,t){return s>=t},dGspo:function(s,t){return s===t},vWzPQ:function(s,t){return s>t},vczex:function(s,t){return s&t},GgwlN:function(s,t){return s!==t},QCvrk:"UNMFO",HsLEc:function(s,t){return s===t},TElNw:function(s,t){return s instanceof t},DRNzR:r(694)+r(1018),wHUJt:function(s,t){return s+t},nygpZ:function(s,t){return s===t},zbdhV:r(348),YUqPE:r(1519),AoCAv:r(1408),udvBf:function(s,t){return s===t},OdtFP:r(1375),vscQu:r(1231),OgTBO:r(1376),oqJZr:function(s,t){return s instanceof t},avlPD:function(s,t){return s+t},fKiBz:function(s,t){return s!==t},vWQpP:r(1837),GnKKe:function(s,t){return s|t},vEJBk:function(s,t){return s<<t},hwFSQ:function(s,t){return s&t},ALldR:function(s,t){return s<<t},dIgKM:function(s,t){return s&t},wsJBc:function(s,t){return s&t},RaVjj:function(s,t){return s<t},gcvlI:function(s,t){return s>=t},DRjoo:function(s,t){return s!==t},OwrhX:r(529),fcpip:function(s,t){return s||t},AmOCf:function(s,t){return s||t},kNKKZ:function(s,t){return s!=t},CQwqb:"undefined",xGPCg:r(1329)+"3",QSRdK:function(s,t){return s+t},EJEUD:function(s,t){return s<t},dLCld:function(s,t){return s&t},syUxB:function(s,t){return s&t},XTCpR:function(s,t){return s!==t},IkOMG:function(s,t){return s-t},vXvjx:r(681),xrgga:r(1720),qujyQ:function(s,t){return s|t},dAdtU:function(s,t){return s|t},jzriA:function(s,t){return s<<t},HSKpt:function(s,t){return s&t},DujXz:function(s,t){return s&t},uDycf:function(s,t){return s+t},aUGFs:function(s,t){return s>t},SIvNp:function(s,t){return s<t},knzZy:function(s,t){return s&t},sYxAb:function(s,t){return s&t},CvCpo:function(s,t){return s!==t},nzBGz:r(1037),zoSnh:function(s,t){return s&t},QKxuM:function(s,t){return s|t},FjSPt:function(s,t){return s&t},tfJZm:function(s,t){return s|t},FdDEh:function(s,t){return s>>t},pgwzU:function(s,t){return s>>t},HqYag:function(s,t){return s-t},eUgxC:r(1428),SYHZR:function(s,t,n,o){return s(t,n,o)},sRxIU:function(s,t){return s instanceof t},zBOZn:function(s,t){return s instanceof t},KfLOx:"applicat"+r(1475),LWVeV:r(1478)+r(1770)+r(1347),grWhO:"ppe",ORCoB:function(s,t){return s!==t},tsNnb:r(1391),wVcXR:function(s,t){return s(t)},VTvRI:r(1728)+r(623),cmwXp:r(1170)+r(832)+r(762)+"P",XKaBu:function(s,t){return s!==t},DYSMk:r(898),cEjto:"wWjLo",VZxUs:function(s,t,n,o){return s(t,n,o)},beaBo:r(1131),MIihH:function(s,t){return s===t},BDtyK:r(1463),oqsOh:r(1173),OogSk:function(s,t){return s-t},eYrqu:r(1176),KlOqH:"AiChK",fqzyk:function(s,t){return s!==t},DynWq:r(909),wCIhX:function(s,t){return s||t},AGJGW:r(1146),JApvE:"online",FMSVT:r(688),XZgSU:function(s,t){return s!==t},kmaAQ:"YjOfK",VEDlH:r(1709),TqrBP:function(s,t){return s||t},ActHm:function(s,t){return s||t},gmSjy:function(s,t){return s||t},DRHNE:r(1094),TlDxf:function(s,t){return s||t},wjrqy:r(384),LorFO:r(770),XMMbz:function(s,t){return s===t},AEUDO:r(1112),luEdg:function(s,t){return s||t},UMdVy:function(s,t){return s||t},tHRzX:"init QoS"+r(706)+"d",fIwKg:function(s,t,n){return s(t,n)},yBdAw:r(637),DSQdG:r(1057)+"id",XYpDf:function(s,t){return s===t},PbjYt:"GRPLF",FewOW:r(647),HUtUh:function(s,t){return s(t)},DlgRl:function(s,t){return s===t},JbQAU:r(821),IvZST:function(s,t){return s!==t},vTiIn:r(1019),neTuu:r(1829),VeBMz:function(s,t){return s!==t},jkvRz:r(1079),kFWQV:function(s,t,n,o){return s(t,n,o)},LPkQr:function(s,t,n,o){return s(t,n,o)},Xovmy:r(1154),RhkMJ:r(1273),MNwzP:"received",aTrQr:function(s){return s()},QEzLK:function(s,t){return s(t)},aaJtP:function(s,t){return s(t)},kjxqf:function(s,t){return s instanceof t},PEjyJ:function(s,t){return s instanceof t},yuRVT:r(398)+r(1475)+r(1337)+r(1249),Okasl:"none_none",jNYrQ:"binary",hnBDa:function(s,t,n,o){return s(t,n,o)},CzcoC:function(s){return s()},uovJg:function(s,t){return s(t)},Tlysh:function(s,t){return s||t},KcyRP:function(s,t){return s===t},uoetm:"MSJGk",XKaXr:function(s,t){return s+t},Wnllz:"index ou"+r(914)+r(498),NdBDU:r(682),VgNli:r(976)+r(485)+"e",RpvaF:function(s,t){return s>=t},czzSB:function(s,t){return s&t},lQxCr:function(s,t,n,o){return s(t,n,o)},DsUcc:function(s,t){return s+t},ykkgg:function(s,t){return s+t},Gamjk:r(729)+"0",LNESK:function(s,t){return s+t},hcPmy:function(s,t){return s+t},dSkYo:r(1178)+"0",Qehpz:function(s,t){return s===t},LGGpU:r(815),GGplX:function(s,t){return s|t},dsqSP:function(s,t){return s<<t},QsUPy:function(s,t){return s+t},VRlPk:function(s,t){return s|t},YpugI:function(s,t){return s|t},sbpQt:function(s,t){return s<<t},YDwLS:function(s,t){return s+t},ZEmxU:function(s,t){return s&t},wJFsh:function(s,t){return s+t},hqrWL:function(s,t){return s+t},mSBxC:function(s,t){return s+t},uYBSB:function(s,t){return s>>>t},Dcfyo:function(s,t){return s+t},IYHLE:function(s,t){return s&t},SFHKE:function(s,t){return s+t},FkXYO:function(s,t){return s&t},ggwqZ:function(s,t){return s|t},qDEGF:function(s,t){return s+t},jRwyZ:function(s,t){return s+t},GAGbV:function(s,t){return s|t},RodfH:function(s,t){return s|t},TnyjF:function(s,t){return s|t},levue:function(s,t){return s+t},diRsW:function(s,t){return s+t},YqqJq:function(s,t){return s<<t},dCUht:function(s,t){return s===t},nmNSG:function(s,t){return s===t},iHFNr:function(s,t){return s>>>t},lfAXA:function(s,t){return s|t},pHPcm:function(s,t){return s&t},XimAQ:function(s,t){return s===t},TvgRf:r(929),dvdxp:r(1350)+r(707),pHKOS:"service",xHtMd:r(1179)+r(1237),RFYSc:r(1237),buXQL:"WLWnl",eHFgt:r(1300)+r(708),lBsWG:function(s,t,n){return s(t,n)},FOwFP:function(s,t,n){return s(t,n)},IrRVT:function(s,t){return s===t},gAQjn:r(1189),TJkII:r(868)+"e_success",NfVsI:function(s,t,n){return s(t,n)},xCWUe:function(s,t){return s!==t},NRPrZ:"dbRKj",NyvSf:r(755)+r(374),jflsp:r(863),nwfeZ:"allCurso"+r(1115),GTEaO:"ALL",iuXji:"INSTANT",TqkDD:r(1418),XVeiG:r(446),vpTjl:"NAugF",MJoLW:r(777)+"r",uiNyJ:r(1563),lVjqw:function(s,t){return s!==t},DJZBy:r(1722),VTmhy:function(s,t){return s===t},goXxU:function(s,t){return s-t},AHtxe:function(s,t){return s===t},osuux:function(s,t){return s|t},uXYQT:function(s,t){return s&t},kmeBM:r(811),Ieqem:function(s,t,n,o){return s(t,n,o)},FqMCs:function(s,t,n){return s(t,n)},PVFYt:function(s,t,n){return s(t,n)},ZZPoI:function(s,t,n,o){return s(t,n,o)},GWDwt:"x-msg-qos",UZmaU:r(426)+r(1623)+"e",yqkSm:function(s,t,n){return s(t,n)},YkHoi:"x-msg-cu"+r(1842)+"ue",AkxyQ:function(s,t){return s===t},BSraZ:r(1041),LYdfU:function(s,t){return s+t},CUqdN:function(s,t){return s===t},Bedjt:"WgkLY",dcMYi:r(669),OQEMA:function(s){return s()},udTsK:function(s){return s()},dxvSo:function(s,t){return s-t},QTuSn:function(s,t,n){return s(t,n)},iBcjT:function(s,t){return s===t},vWOeG:function(s,t){return s===t},EwVfU:function(s,t){return s&&t},SbzeB:function(s){return s()},KvYad:function(s){return s()},jQjdY:r(837),YEhWx:r(1409),WmaOK:r(365),HbPBN:"nOdjj",RyGeD:function(s,t){return s(t)},VrbXy:r(666),iliNN:"iogly",iarUf:function(s){return s()},RXWXF:function(s,t,n){return s(t,n)},uqGrJ:"bye",ONWCs:function(s,t,n){return s(t,n)},vEEhC:function(s,t){return s===t},ciQaY:r(1064),Rkxlk:r(631),EOKYv:function(s,t){return s!==t},GfrYU:r(1366),pvSXH:r(1624),rfSHG:function(s,t,n){return s(t,n)},gbkcL:function(s,t,n){return s(t,n)},qKvJy:r(810)+r(1834),iWNEg:r(927),xFspM:r(582),MPPoI:r(696)+r(655)+r(1028),sgrYf:r(696)+r(1565)+r(523)+r(561)+"ket constructor "+r(1639)+"ined",GNTmy:r(1816),CXgFm:function(s,t,n){return s(t,n)},HHpkM:"stop imm"+r(941)+r(1090)+"ct",vLBst:r(764),CAVUD:r(1646),wHAfR:r(1128),WGJjM:function(s,t){return s!==t},XBKbT:r(1591),RxdYl:"KXpLy",HoTrK:function(s,t){return s!==t},LJOvT:r(601),xojMm:r(696)+r(1513)+"ddID, de"+r(1048)+r(699),BlHnh:function(s,t){return s==t},LorFl:"web",hCYkl:r(381)+"0",tTpQG:function(s,t){return s!==t},FPcVz:r(1651),fuWqF:function(s,t){return s===t},EYWYT:r(1059),XDVgF:r(642),KOZIL:function(s,t,n){return s(t,n)},RojEZ:r(1458)+"t",zNmbV:function(s,t){return s>t},cVQBR:function(s,t){return s-t},jGyQm:function(s,t){return s!==t},MWFsg:r(345),PhUbK:r(817),ieXiS:function(s,t){return s(t)},ptmbN:r(1447)+">",VuSrq:function(s,t){return s*t},jeChR:function(s,t){return s>t},iopUk:function(s,t){return s===t},wJQNF:function(s,t,n){return s(t,n)},SkWbw:function(s,t){return s!==t},aEsqj:function(s,t,n){return s(t,n)},AFDdn:function(s,t){return s!==t},QsOgI:r(744),cOQEl:r(1204),iJdmr:"oEFnO",vMEXo:function(s,t,n){return s(t,n)},USxvY:function(s,t){return s===t},hiaNr:r(1626),lFFPb:r(1169)+" try rec"+r(1432)+"g",wprlH:r(960),yaLpp:function(s,t){return s(t)},VuMTl:function(s,t){return s(t)},fpYvp:r(1800),rilhw:"hGCiH",XwvZP:r(1353)+"2",sitIM:r(1806),VXtYz:function(s,t,n){return s(t,n)},KfKjn:function(s,t){return s===t},SETqO:r(879),UNbLB:r(621),ylpcV:function(s,t){return s<t},BHseK:function(s,t){return s-t},xoWiV:r(1258),wUWDu:r(812),LKyai:function(s,t){return s+t},kpKfX:r(425),qpptf:function(s,t){return s!==t},Dbpcr:r(503),ZJpBb:function(s,t){return s+t},XKkGy:function(s,t){return s===t},FaomK:"VMubP",NJQPJ:r(1641)+r(646),GocNV:"close, w"+r(1007)+r(692)+r(634)+"ed",zVBGE:function(s,t){return s===t},twIBb:r(1212)+"s already closed",uGOXf:function(s,t){return s==t},NRuYS:r(696)+r(1698)+r(1047)+r(467)+"a must b"+r(787)+r(340)+r(1084)+r(611),flsjh:function(s,t){return s==t},rfFoD:"number",XvBFs:function(s,t){return s(t)},VRjZr:function(s,t){return s||t},cgUyE:r(696)+r(1698)+r(1298)+r(707),svAuX:function(s,t){return s instanceof t},UZQrS:r(581),BNqIA:function(s,t){return s<t},bmiJJ:function(s,t){return s||t},jGvnY:function(s,t,n){return s(t,n)},TfrYu:"VkMKa",ZaIoi:r(1196)+"2",FiwPd:r(1346),vgqOZ:function(s,t,n){return s(t,n)},YpDvm:function(s,t){return s*t},EqpDe:function(s,t){return s*t},KsYsU:function(s,t){return s/t},fGsKU:function(s,t){return s===t},ThONc:r(1149),NhivL:function(s,t){return s!=t},nevLT:function(s,t){return s!=t},yYWTr:"Object",OZfCx:r(1548)+r(389)+r(829)+"pe",CLJhg:function(s,t){return s!=t},BFPOQ:function(s,t){return s!=t},DmJJH:function(s,t){return s===t},tKnpN:function(s,t){return s!=t},tJiWn:function(s,t,n){return s(t,n)}};Ee.r($),Ee.d($,{FWS:()=>L0,CustomErrorEvent:()=>ss,createCloseEvent:()=>_e,ReconnectEvent:()=>rs,createErrorEvent:()=>de,decodedFrame:()=>$r,createOpenEvent:()=>fs,CustomCloseEvent:()=>is,createReconnectEvent:()=>Qn,FrontierMessageEvent:()=>as,encodeFrame:()=>$n,createMessageEvent:()=>cs,OpenEvent:()=>xs,ErrorCode:()=>Fe,Event:()=>ot,MessageEvent:()=>os});let i="";function a(s=""){let t=r,n={uEOXW:function(o,c,l){return e[D(1213)](o,c,l)},cexKv:function(o,c,l){return e.XUCII(o,c,l)}};if(e[t(796)](e[t(1137)],t(962)))n.uEOXW(_0x7660fc,_0x1f81a4,18),n[t(1426)](_0x332a76,_0x4932a8,_0xcca45d);else{let c=""+Date[t(1802)](),l=i||(i=e[t(1103)](m,s)),h=Math[t(1763)]()[t(536)](16)[t(620)](-6);return e[t(1449)](e[t(1449)]("02"+c,l),h)}}function x(){let s=r;return e[s(1449)](1e4*Date[s(1802)](),Math[s(660)](1e4*Math[s(1763)]()))}function f(s){let t=r;return(Array(8)[t(1117)]("0")+e[t(1213)](parseInt,s,10)[t(536)](2))[t(620)](-8)}function u(s){let t=r;return e.yIYbf(e[t(1103)](Array,4)[t(1117)]("0"),e[t(354)](parseInt,s,2).toString(16))[t(620)](-4)}function g(s){let t=r,n={vCTae:function(o,c){return e[D(1010)](o,c)},ZrIMi:t(1515),TUsmq:e.uDVBR,rGgwp:function(o,c){return e[t(1536)](o,c)},pKuuP:e[t(859)],uEpnm:function(o,c){return e[t(1103)](o,c)}};if(e[t(1536)](e.yIOAF,e[t(662)])){let o=s.split(/\./)[t(1792)](h=>f(h)),c=[];return c[0]=e[t(357)](u,e[t(964)](o[0],o[1])),c[1]=u(e[t(408)](o[2],o[3])),[e[t(586)],e.qswPT,e.qswPT,e.qswPT,e[t(586)],e[t(1312)],c[0],c[1]].join("")}else{if(ZRZhfN.vCTae(_0x36732c,_0x5d87d3)){if(_0x26fc67===ZRZhfN[t(1377)])return _0xc8a5fe[t(1508)](_0x10e113);if(_0x4dc518===ZRZhfN[t(1445)])return _0x5e89a0[t(1228)+t(1620)]||_0x26688e[t(1508)](_0x1d6d3a);if(ZRZhfN[t(1317)](_0x4b5ada,ZRZhfN.pKuuP))return _0x529481["objectSt"+t(1620)][1]?void 0:_0x226552[t(1228)+t(883)](_0x238526[t(1228)+t(1620)][0])}return ZRZhfN[t(607)](_0x3480c6,_0x4926a7[_0x2d458a])}}function m(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(1691)](s),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(1691)](s);return n?e[t(357)](g,s):o?e[t(1103)](_,s):e.jJYYx}function _(s){let t=r,n={OxTJG:function(w,b,k,N,L){return e.dVQcD(w,b,k,N,L)},wwysL:function(w,b){return e[D(1334)](w,b)},yLpUX:t(1248)+"eeded"},o="",c=[],l=0,h=0,p=!0,d=e[t(586)];if(e[t(347)](s[t(959)]("::"),-1)){let w=s.split("::");for(let k=0;e.bKZXR(k,w[t(1759)]);k++){let N=w[k];if(e.vxYAI(N.indexOf(":"),0)){let L=N[t(1700)](":");p&&(l=L[t(1759)]),h+=L[t(1759)];for(let A=0;e.bKZXR(A,L[t(1759)]);A++)if(L[A][t(1759)]!==4)if(t(478)!=="ywgNr"){let M=e[t(1572)](e[t(1672)](e[t(728)](e[t(841)](7,_0x1a2a47)<<18|e[t(605)](e[t(841)](63,_0x260a0a[_0x50747e++]),12),e[t(1774)](e[t(858)](63,_0x3f1293[_0x3f2cd9++]),6)),e[t(847)](63,_0x368957[_0x33f444++])),65536);_0x398b5b+=_0x2ec8a0[t(1483)+t(1162)](e[t(362)](55296,e.OIjHk(M,10))),_0x26c91e+=_0x12c003["fromChar"+t(1162)](56320+e[t(841)](1023,M))}else{let M=d[t(397)+"g"](0,e[t(1572)](4,L[A][t(1759)])),B=M[t(1160)](L[A]);c[t(751)](B)}else c[t(751)](L[A]);p=!1}else{if(e[t(1452)](e[t(986)],e[t(986)]))return _0x9108a2.offset>=_0x31c640[t(734)];if(e.pcfyd(4,N[t(1759)]))if(t(510)===e[t(415)]){let L=d[t(397)+"g"](0,4-N.length),A=L.concat(N);c[t(751)](A)}else{let L={HmbdV:function(A,M,B,j,le){let Se=t;return oTloou[Se(1181)](A,M,B,j,le)},RFgtl:function(A,M){let B=t;return oTloou[B(715)](A,M)}};_0x4e4585[t(719)+"Listener"](oTloou[t(1438)],A=>{let M=t;L[M(1564)](_0x3bfee8,_0xc6363f(_0x56e158[M(1087)]),A[M(1247)+"on"],A[M(987)+"on"],L.RFgtl(_0x5ced19,_0x34152c[M(1052)+M(1568)]))})}else c[t(751)](N);p&&(l+=1),h+=1,p=!1}}let b="";for(let k=0;k<e[t(857)](8,h);k++)b=b[t(1160)](d);for(let k=0;e[t(1824)](k,c[t(1759)]);k++)k===l&&(o=o.concat(b)),o=o[t(1160)](c[k]);return o}{let w=s[t(1700)](":");for(let b=0;b<w[t(1759)];b++){let k=w[b];if(e[t(1452)](4,w[b][t(1759)])){let N=d[t(397)+"g"](0,e[t(683)](4,w[b][t(1759)])),L=N[t(1160)](k);o=o[t(1160)](L)}else o=o.concat(k)}return o}}function v(s,t){let n=r,o=s[n(792)];e[n(612)](void 0,o)&&(e.srkCu(re,t,10),e[n(1213)](Te,t,o));let c=s[n(1165)];e[n(1821)](void 0,c)&&(e[n(1213)](re,t,18),Te(t,c))}function y(s){let t=r,n={};e:for(;!e[t(445)](ve,s);){let o=e.WbVaN(W,s);switch(o>>>3){case 0:break e;case 1:n[t(792)]=be(s,e.Bnrdz(W,s));break;case 2:n[t(1165)]=e.esDfC(be,s,e[t(1103)](W,s));break;default:oe(s,e.xqinM(7,o))}}if(n[t(792)]===void 0)throw new Error(e[t(1559)]);if(e[t(629)](void 0,n.value))throw new Error(e[t(1220)]);return n}function C(s){let t=r,n=e[t(1268)](F);return T(s,n),e[t(942)](ze,n)}function T(s,t){let n=r,o={GHAHX:function(B,j){return e.bKZXR(B,j)},floDt:function(B,j,le){return e.XUCII(B,j,le)},pVsgl:function(B,j,le,Se){return B(j,le,Se)},iUIuG:function(B,j){return e[D(964)](B,j)},nALex:function(B,j){return e[D(1553)](B,j)}},c=s.SeqID;e.pcfyd(void 0,c)&&(re(t,8),e.nbwNf(bt,t,c));let l=s[n(843)];e[n(675)](void 0,l)&&(e[n(1213)](re,t,16),e.srkCu(bt,t,l));let h=s[n(1265)];e[n(1780)](void 0,h)&&(re(t,24),e.nbwNf(bt,t,ce(h)));let p=s[n(1451)];if(e.HgZDS(void 0,p))if(e[n(796)](e[n(1030)],e[n(1030)]))re(t,32),bt(t,e[n(357)](ce,p));else{let B=0,j=[];for(;o[n(1324)](B,_0xc48cd9[n(772)+"th"]);){let{offset:le}=o[n(1071)](_0x9c6619,_0x156c35,B);B=le;let Se={cursor_name:"",cursor:0,service:0},{value:ar,offset:Et}=_0x213091(_0x2c508f,B);Se[n(1265)]=ar,B=Et;let{value:Ht,offset:kt}=o[n(1071)](_0x11e713,_0x461534,B);B=kt,Se["cursor_n"+n(1211)]=o[n(697)](_0x370222,_0x1d29e7,B,o[n(1533)](B,Ht)),B+=Ht;let{value:At,offset:N0}=o[n(1071)](_0x54f009,_0xf14233,B);Se[n(1612)]=At[n(457)](),B=N0,j[n(751)](Se)}return j}let d=s.headers;if(e.qysQk(void 0,d))for(let B of d){e[n(980)](re,t,42);let j=F();e[n(784)](v,B,j),re(t,j[n(734)]),e[n(1213)](Zn,t,j),e[n(942)](Y,j)}let w=s[n(1027)+n(797)];e[n(612)](void 0,w)&&(re(t,50),e[n(1202)](Te,t,w));let b=s[n(1473)+"ype"];e[n(1452)](void 0,b)&&(e.IOYiM(e[n(499)],e[n(499)])?(e[n(1191)](_0x4f3737,e.okVPA),this[n(1056)](n(868)+n(349)+"s",_0x1e091c),this.off(e.Mvtkb,_0x3fc76f)):(e[n(1819)](re,t,58),e[n(477)](Te,t,b)));let k=s[n(543)];e.CscaP(void 0,k)&&(e[n(1168)](re,t,66),e.QTgZJ(re,t,k[n(1759)]),e.EEKSq(Kt,t,k));let N=s[n(698)];e[n(1745)](void 0,N)&&(re(t,74),e[n(911)](Te,t,N));let L=s[n(1482)+n(1046)];if(e[n(1114)](void 0,L)){if(e[n(918)](e[n(895)],e.QyLUS))return _0x1fac1a.apply(HCMZES[n(1195)](_0x21eb8b,this),_0x386fde),HCMZES[n(1195)](_0x7e588c,_0xb2667.get(this));e.XUCII(re,t,82),e[n(407)](Te,t,L)}let A=s[n(981)];e[n(1108)](void 0,A)&&(e[n(1168)](re,t,90),e[n(871)](Te,t,A));let M=s[n(369)+"e"];M!==void 0&&(e.GndmD(re,t,96),e[n(1471)](bt,t,e[n(587)](ce,M)))}function P(s){let t=r;return e[t(917)](R,e[t(1455)](De,s))}function R(s){let t=r,n={};e:for(;!e.CtHws(ve,s);){let o=e[t(1103)](W,s);switch(e[t(1349)](o,3)){case 0:break e;case 1:n[t(632)]=e[t(354)](Zr,s,!0);break;case 2:n[t(843)]=e[t(1213)](Zr,s,!0);break;case 3:n.service=e[t(1814)](W,s);break;case 4:n[t(1451)]=e.Ppmhl(W,s);break;case 5:{let c=e.WMFii(J,s);(n[t(602)]||(n[t(602)]=[]))[t(751)](e[t(554)](y,s)),s[t(734)]=c;break}case 6:n[t(1027)+t(797)]=e[t(1471)](be,s,e[t(823)](W,s));break;case 7:n[t(1473)+t(1271)]=e.WFhcW(be,s,e[t(400)](W,s));break;case 8:n[t(543)]=Ut(s,e[t(1334)](W,s));break;case 9:n[t(698)]=e[t(490)](be,s,W(s));break;case 10:n[t(1482)+t(1046)]=e.EEKSq(be,s,e[t(877)](W,s));break;case 11:n.msgID=e[t(430)](be,s,e.haWAt(W,s));break;case 12:n[t(369)+"e"]=W(s);break;default:e[t(975)](oe,s,e[t(847)](7,o))}}if(e[t(1536)](void 0,n[t(632)]))throw new Error(e[t(693)]);if(e[t(796)](void 0,n[t(843)]))throw new Error(e[t(449)]);if(e.DmSps(void 0,n[t(1265)]))throw new Error(t(534)+"required"+t(1246)+t(1265));if(e[t(1530)](void 0,n[t(1451)]))throw new Error(e[t(1818)]);return n}function J(s){let t=r,n=e.tHkoK(W,s),o=s.limit;return s[t(734)]=s[t(1727)]+n,o}function oe(s,t){let n=r;switch(t){case 0:for(;e[n(841)](128,e[n(1334)](X,s)););break;case 2:e.Jhwlh(ye,s,e.WKueF(W,s));break;case 5:e[n(1180)](ye,s,4);break;case 1:e[n(911)](ye,s,8);break;default:throw new Error(e[n(1419)]+t)}}function ce(s){return s|=0,{low:s,high:e.OIjHk(s,31),unsigned:e.gPkEt(s,0)}}let I=[];function F(){let s=r;if(s(1314)===e[s(738)]){let t=I[s(1811)]();return t?(t[s(1727)]=t[s(734)]=0,t):{bytes:new Uint8Array(64),offset:0,limit:0}}else try{this[s(997)]?.[s(833)](),this[s(997)]=void 0}catch(t){_0x320215[s(1239)](t)}}function Y(s){I[r(751)](s)}function De(s){return{bytes:s,offset:0,limit:s[r(1759)]}}function ze(s){let t=r,n=s[t(676)],o=s[t(734)];return n[t(1759)]===o?n:n[t(1733)](0,o)}function ye(s,t){let n=r;if(e.TapoJ(s[n(1727)],t)>s[n(734)])throw new Error(e[n(336)]);s[n(1727)]+=t}function ve(s){let t=r,n={eMZMu:e[t(745)],cBILR:e.idUiq};if(e[t(1638)]===e.SmKlq)return s[t(1727)]>=s.limit;this[t(1502)+"er"]&&_0x24b245[t(1072)+t(826)+t(1083)](n[t(848)],this[t(925)+t(1835)]),this[t(1502)+"er"]&&_0xa588b1[t(1072)+t(826)+t(1083)](n[t(1582)],this[t(925)+t(527)]),this[t(833)]()}function me(s,t){let n=r,o={KvNtB:function(c,l,h){return e[D(645)](c,l,h)}};if(e[n(1745)](e.ZEJVU,e.Hkexk)){let c=s[n(676)],l=s.offset,h=s.limit,p=e[n(964)](l,t);if(e[n(654)](p,c.length))if(e[n(1830)]("wzVKy",e.zsjmK)){let d=new Uint8Array(e[n(1544)](2,p));d[n(563)](c),s.bytes=d}else _0x2b033b&&this[n(1152)+n(1826)][n(486)+n(1130)+n(1454)](_0x1b942f);return s[n(1727)]=p,e[n(1643)](p,h)&&(s.limit=p),l}else return new _0x3a738e(c=>{let l=n;o[l(881)](_0x29c28b,c,this[l(1516)+"rvalValue"](_0x278067))})}function rt(s,t){let n=r,o=s[n(1727)];if(e.CCndu(e.TapoJ(o,t),s.limit))throw new Error(e[n(463)]);return s.offset+=t,o}function Ut(s,t){let n=r,o=e[n(784)](rt,s,t);return s[n(676)].subarray(o,o+t)}function Kt(s,t){let n=r;if(e[n(1821)](e[n(700)],"Bnzjz")){let o=e.SYVOv(me,s,t[n(1759)]);s[n(676)][n(563)](t,o)}else{if(this._options["disableA"+n(371)+n(1779)]||this[n(1070)+n(1093)])return;this["_handleR"+n(1045)]()}}function be(s,t){let n=r,o={bSFcD:function(w,b){return w&b},uuECc:function(w,b){return e[D(1306)](w,b)},OgdXY:e[n(606)],Vxczs:e[n(1791)]},c=rt(s,t),l=String[n(1483)+"Code"],h=s[n(676)],p="\uFFFD",d="";for(let w=0;e[n(1708)](w,t);w++){let b=h[e[n(1657)](w,c)],k,N,L,A;if((128&b)===0)d+=e[n(1103)](l,b);else if(e[n(538)](e[n(785)](224,b),192))e[n(484)](e[n(1125)](w,1),t)?d+=p:(k=h[e.fGUOX(e[n(399)](w,c),1)],e[n(1465)](e[n(1622)](192,k),128)?d+=p:(A=e.INVpv(31,b)<<6|e.INVpv(63,k),e[n(1660)](A,128)?d+=p:(d+=l(A),w++)));else if(e[n(1126)](e[n(969)](240,b),224))if(e[n(484)](e[n(1370)](w,2),t))d+=p;else if(k=h[e[n(362)](w+c,1)],N=h[e.awUkw(e[n(399)](w,c),2)],e[n(1177)](e[n(1538)](e[n(1672)](k,e[n(552)](N,8)),49344),32896))d+=p;else if(e.aUbHV(e[n(1571)],n(1781))){let M=o[n(360)](255,_0x17dfc3);_0x20a8c8(M,_0x35df04,_0x16955a+_0x4f6139),_0x343fb6>>>=8,_0x447285--}else A=e[n(1352)](e[n(600)](e[n(1484)](15,b)<<12,e[n(507)](63,k)<<6),63&N),e[n(1660)](A,2048)||e[n(856)](A,55296)&&A<=57343?d+=p:(d+=e[n(1191)](l,A),w+=2);else if(e[n(507)](248,b)==240)if(e[n(1790)](e[n(408)](w,3),t))d+=p;else if(e.uYKzY(n(573),e[n(1224)])){let{url:M}=_0x275f2e||{},B=_0x4c4b9d[n(1566)](M)?M:o[n(1629)](o[n(640)],typeof M)?[M]:[];_0x543966&&_0x53277a[n(339)](this[n(1665)],_0x312955),B&&B[n(1759)]?this[n(1132)+n(1330)]=new _0x3e0fc5(B,this._options.maxRetries):this["_endpoin"+n(1330)]?.[n(569)+n(920)+n(1693)](),this[n(364)+"sCounter"]?.["resetCou"+n(949)](this._options["pingLoss"+n(1036)]),this[n(1070)+n(1093)]=!1,this[n(1398)]&&this[n(1398)][n(1573)+"te"]!==this.CLOSED?this[n(1749)+n(653)](1e3,o[n(1742)],!0):(this[n(875)]=!0,this._connect())}else k=h[e[n(1611)](w,c)+1],N=h[e[n(1611)](w+c,2)],L=h[e[n(362)](e[n(408)](w,c),3)],e[n(564)](e.wpmTJ(e.MaXxG(k,N<<8),L<<16)&12632256,8421504)?d+=p:(A=e[n(1276)](e[n(728)](e.NXuMj((7&b)<<18,e[n(552)](e[n(1538)](63,k),12)),e[n(1774)](e[n(785)](63,N),6)),e[n(665)](63,L)),e[n(1299)](A,65536)||e[n(1797)](A,1114111)?d+=p:(A-=65536,d+=e[n(871)](l,(A>>10)+55296,e.fbLJR(e[n(1412)](1023,A),56320)),w+=3));else d+=p}return d}function Te(s,t){let n=r,o=t[n(1759)],c=0;for(let p=0;e[n(391)](p,o);p++){let d=t[n(1674)+"At"](p);d>=55296&&d<=56319&&e[n(1708)](e[n(1370)](p,1),o)&&(d=e[n(542)](e[n(552)](d,10),t[n(1674)+"At"](++p))-56613888),c+=e[n(984)](d,128)?1:e[n(1708)](d,2048)?2:d<65536?3:4}re(s,c);let l=e[n(645)](me,s,c),h=s[n(676)];for(let p=0;p<o;p++){let d=t[n(1674)+"At"](p);e[n(468)](d,55296)&&d<=56319&&e.SmynO(p,1)<o&&(d=e.soBEH(d,10)+t[n(1674)+"At"](++p)-56613888),e.eNXtT(d,128)?h[l++]=d:(e[n(1567)](d,2048)?h[l++]=e[n(1276)](e[n(507)](d>>6,31),192):(e[n(1183)](d,65536)?h[l++]=e[n(1199)](e.CrJbO(e.OrHqY(d,12),15),224):(h[l++]=e[n(1089)](e[n(1363)](e.OrHqY(d,18),7),240),h[l++]=e[n(1556)](e[n(1523)](d,12),63)|128),h[l++]=e.OVviH(e[n(1175)](d,6)&63,128)),h[l++]=e[n(1276)](63&d,128))}}function Zn(s,t){let n=r,o={Saezs:function(c,l,h){return e[D(1471)](c,l,h)},ImMZF:function(c,l){return c|l},EyHXT:function(c,l){return e[D(507)](c,l)}};if(e[n(612)](e[n(1569)],e.ZzSra))o.Saezs(_0x2a6dcf,_0x4d8897,o[n(1527)](o.EyHXT(127,_0x39a91d),128)),_0x111b0f>>>=7;else{let c=e[n(911)](me,s,t[n(734)]),l=s[n(676)],h=t[n(676)];for(let p=0,d=t.limit;e.oZfWj(p,d);p++)l[e[n(578)](p,c)]=h[p]}}function X(s){let t=r,n={OdSql:function(o,c){return e[D(1266)](o,c)},gsxOQ:function(o,c){return e[D(957)](o,c)},CkuEJ:function(o,c){return e[D(1349)](o,c)},zUOkJ:function(o,c){return e.WLIFX(o,c)}};return e[t(1274)]===e[t(1343)]?(_0x3c20c7[t(1682)](_0x3c1630)||(_0x585707=_0x65b08b[t(1098)+"er"](_0x51b4f6)),n[t(352)](this.unsigned,_0x5ee2f8.unsigned)&&n[t(846)](n.CkuEJ(this[t(443)],31),1)&&n[t(846)](n[t(709)](_0xec6d1d[t(443)],31),1)?!1:n.zUOkJ(this.high,_0x30a8fa[t(443)])&&n.gsxOQ(this[t(757)],_0x2354e8[t(757)])):s[t(676)][rt(s,1)]}function st(s,t){let n=r,o=e[n(1328)](me,s,1);s.bytes[o]=t}function W(s){let t=r,n=0,o=0,c;do c=e[t(1119)](X,s),n<32&&(o|=e[t(1490)](127,c)<<n),n+=7;while(e.mWSXs(128,c));return o}function re(s,t){let n=r;for(t>>>=0;e[n(484)](t,128);)e[n(784)](st,s,e[n(728)](e[n(1054)](127,t),128)),t>>>=7;e[n(1471)](st,s,t)}function Zr(s,t){let n=r,o=0,c=0,l=0,h;if(h=e[n(520)](X,s),o=127&h,128&h)if(e.UlLvl!==n(1269)){if(h=e[n(823)](X,s),o|=e.fZgHO(e.Desgd(127,h),7),e.yHYKm(128,h)&&(h=X(s),o|=(127&h)<<14,128&h&&(h=X(s),o|=e.YqWqN(e.rKsFx(127,h),21),e[n(847)](128,h)&&(h=e.jhsdP(X,s),c=127&h,e[n(1786)](128,h)&&(h=e[n(1713)](X,s),c|=e[n(552)](127&h,7),e.qzVdQ(128,h)&&(h=e[n(614)](X,s),c|=e.haUGk(127&h,14),128&h&&(h=e.fRjuR(X,s),c|=e[n(1685)](127&h,21),e[n(936)](128,h))))))))if(e[n(629)](e.fBlHp,"HZQAh"))h=e[n(1753)](X,s),l=e.ZSeSk(127,h),e[n(665)](128,h)&&(h=e[n(1012)](X,s),l|=e[n(1656)](e[n(785)](127,h),7));else return this[n(1398)]?this._ws[n(1549)+"ns"]:""}else _0x5ac942=e[n(1669)](_0x1edc75,_0x443c37),_0x1f90af|=e[n(552)](e[n(1793)](127,_0xb198cb),21),e.PuXPK(128,_0x5637f5)&&(_0x2a6d11=_0xae9780(_0x3d9f7e),_0x190abf=127&_0x4ccef5,e.MwXgd(128,_0x1bafd0)&&(_0x2600f7=e.UqlxA(_0x37a627,_0x2468cb),_0x3082fa|=e[n(1774)](e[n(1730)](127,_0x178f1d),7)));return{low:e[n(1495)](o,c<<28),high:e[n(487)](c>>>4,l<<24),unsigned:t}}function bt(s,t){let n=r,o=t.low>>>0,c=e[n(1349)](e[n(1089)](e.TQWmd(t[n(757)],28),t.high<<4),0),l=e[n(1349)](t.high,24),h=e[n(538)](0,l)?c===0?e[n(1688)](o,16384)?e[n(984)](o,128)?1:2:e.oZfWj(o,2097152)?3:4:e[n(955)](c,16384)?c<128?5:6:e[n(1183)](c,2097152)?7:8:e[n(409)](l,128)?9:10,p=e[n(995)](me,s,h),d=s[n(676)];switch(h){case 10:d[e[n(1026)](p,9)]=e[n(1815)](e[n(376)](l,7),1);case 9:d[e.rpUcR(p,8)]=h!==9?128|l:e[n(507)](127,l);case 8:d[p+7]=e[n(1470)](8,h)?e[n(1495)](e.dxiDY(c,21),128):e[n(1550)](c,21)&127;case 7:d[e.iyZWE(p,6)]=e[n(1114)](7,h)?e[n(728)](c>>>14,128):e[n(665)](e[n(1349)](c,14),127);case 6:d[e[n(1026)](p,5)]=e.iOVJN(6,h)?e[n(1001)](e[n(782)](c,7),128):c>>>7&127;case 5:d[p+4]=e.kYtMo(5,h)?e.yPiEP(128,c):127&c;case 4:d[p+3]=e.vTaOv(4,h)?o>>>21|128:e[n(785)](e[n(1462)](o,21),127);case 3:d[p+2]=h!==3?e[n(737)](e[n(1349)](o,14),128):e[n(1021)](e.bLtJF(o,14),127);case 2:d[p+1]=e[n(1108)](2,h)?e[n(487)](e.LQkUi(o,7),128):e.CLLTf(o>>>7,127);case 1:d[p]=e[n(341)](1,h)?128|o:127&o}}function $r(s){return e.MWcxQ(P,s)}function $n(s){return e[r(396)](C,s)}let Qr=65536,Ho=r(546),it=e[r(1284)](Qr,Qr),es=e.EqpDe(it,it),ts=e[r(1335)](es,2),qe=String[r(1522)+"e"][r(1674)+"At"];class z{constructor(t,n,o){let c=r;this[c(1682)]=!0,this[c(757)]=e[c(1495)](0,t),this[c(443)]=e.wpmTJ(0,n),this[c(1547)]=!!o}static[r(1682)](t){let n=r;return t&&e[n(1530)](!0,t[n(1682)])}static[r(1074)](t,n,o){return new z(t,n,o)}static[r(988)+"s"](t,n,o){let c=r;return o?z[c(988)+c(502)](t,n):z["fromByte"+c(1531)](t,n)}static[r(988)+r(502)](t,n){let o=r,c={gjwNl:e[o(1437)],gidjT:function(l,h,p){return e[o(1058)](l,h,p)},nftiG:e[o(649)]};if(e.HvHiP(e[o(1416)],e[o(1416)]))return new z(e[o(840)](e[o(1702)](t[0],e[o(1710)](t[1],8))|e[o(1656)](t[2],16),e[o(1685)](t[3],24)),e[o(1276)](e[o(487)](t[4]|e[o(1647)](t[5],8),t[6]<<16),e[o(552)](t[7],24)),n);{let l=_0x380e3d("error",{message:this[o(1526)+"rrorMess"+o(1460)](_0x2564d9)});this.emit(c.gjwNl,l);let h=c[o(1697)](_0x29942d,c.nftiG,{reason:this[o(1526)+"rrorMess"+o(1460)](_0x17d9e5)});this.emit(c[o(966)],h)}}static fromBytesBE(t,n){let o=r;return new z(e.lbukD(e[o(1352)](e[o(418)](e[o(1250)](t[4],24),t[5]<<16),t[6]<<8),t[7]),e[o(943)](e[o(1702)](t[0]<<24,e.jwqRE(t[1],16)),e.soBEH(t[2],8))|t[3],n)}static[r(1256)](t){let n=r;return e[n(1518)](t,Ho)?ns:new z(e[n(1080)](e[n(1696)](e[n(737)](e.StnYe(qe[n(656)](t,0),e[n(1685)](qe.call(t,1),8)),qe.call(t,2)<<16),e.ACwWm(qe.call(t,3),24)),0),(e[n(943)](qe[n(656)](t,4),e[n(799)](qe[n(656)](t,5),8))|e[n(1690)](qe[n(656)](t,6),16)|e[n(1014)](qe.call(t,7),24))>>>0,!0)}[r(769)](){let t=r;return String["fromChar"+t(1162)](e[t(989)](255,this[t(757)]),e[t(665)](e.sfBme(this.low,8),255),e.TQWmd(this[t(757)],16)&255,e[t(1245)](this[t(757)],24),e[t(1484)](255,this[t(443)]),e[t(1622)](e[t(1078)](this[t(443)],8),255),e[t(1305)](e[t(1422)](this[t(443)],16),255),e[t(1462)](this[t(443)],24))}static[r(1098)+"er"](t,n=!0){let o=r;if(e[o(1751)](isNaN,t))return n?Wo:ns;if(n){if(e[o(468)](t,es))return Go}else{if(e[o(1230)](t,-ts))return Jo;if(e[o(1808)](t,1)>=ts)return jo}return z[o(1074)](e[o(418)](e[o(1729)](t,it),0),e[o(728)](t/it,0),n)}[r(457)](){let t=r;return this[t(1547)]?e[t(1544)](e[t(1118)](this[t(443)],0),it)+(this[t(757)]>>>0):e[t(542)](e[t(1544)](this[t(443)],it),e[t(505)](this.low,0))}isZero(){let t=r;return e[t(1303)](0,this[t(443)])&&e[t(591)](0,this[t(757)])}[r(635)](t){let n=r;if(e[n(535)]!==n(1717)){let o=this[n(997)].getItem(this._prefix),c=_0x23a32a[n(1747)](o||"{}");return c[_0x276436]=void 0,this[n(997)][n(403)](this[n(1066)],_0x3fbfe6[n(638)+"y"](c))}else{z[n(1682)](t)||(t=z[n(1098)+"er"](t));let o=this[n(443)]>>>16,c=e[n(1556)](65535,this[n(443)]),l=this[n(757)]>>>16,h=65535&this[n(757)],p=t.high>>>16,d=e[n(1241)](65535,t[n(443)]),w=t[n(757)]>>>16,b=e.TFMDw(65535,t[n(757)]),k=0,N=0,L=0,A=0;return A+=e[n(1404)](h,b),L+=A>>>16,A&=65535,L+=l+w,N+=e.xclWt(L,16),L&=65535,N+=e[n(1657)](c,d),k+=e.fdpVF(N,16),N&=65535,k+=e[n(964)](o,p),k&=65535,z[n(1074)](e.xsbhT(e[n(624)](L,16),A),e[n(605)](k,16)|N,this[n(1547)])}}[r(1197)](t){let n=r;return z[n(1682)](t)||(t=z.fromNumber(t)),e.QJAVm(this[n(1547)],t.unsigned)&&e[n(957)](e[n(596)](this.high,31),1)&&e.qgqQF(t[n(443)]>>>31,1)?!1:e[n(629)](this.high,t[n(443)])&&e[n(1530)](this[n(757)],t[n(757)])}[r(1501)](){let t=r;return this[t(757)]===-1&&this[t(443)]===-1?z[t(1074)](0,0,this.unsigned):e.FbgCG(-1,this[t(757)])?z[t(1074)](0,e[t(1370)](this.high,1),this.unsigned):z[t(1074)](e.JDqzJ(this[t(757)],1),this[t(443)],this[t(1547)])}toBytes(t){return t?this.toBytesLE():this[r(1633)+"E"]()}toBytesLE(){let t=r,n=this.high,o=this.low;return[e.tybCm(255,o),e.INVpv(e[t(782)](o,8),255),e[t(1241)](e[t(1387)](o,16),255),e[t(1078)](o,24),255&n,e[t(1663)](e[t(1234)](n,8),255),e[t(677)](e[t(1078)](n,16),255),e[t(596)](n,24)]}toBytesBE(){let t=r;if(e.DOBWL(t(1795),e[t(1091)])){let n=!!this._options.enableQoS;if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=e[t(1286)](_0x1ec6c7,_0x3c2a9d.message[t(602)],e.LwkMS,"2"),c=o&&e[t(1534)](_0x23b612,_0x31817e[t(1375)][t(602)],e[t(835)],"1"),l=o&&e[t(1102)](_0x236c72,_0xcd8163[t(1375)][t(602)],e[t(1148)],"1"),h=l?e[t(1168)](_0x53e2ed,_0x4ead29[t(1375)].headers,e[t(991)])?.split(",").filter(_0x1105ce)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:l,ackMsgIds:h}}else{let n=this[t(443)],o=this.low;return[n>>>24,e[t(1021)](e[t(1617)](n,16),255),e.LwGgX(e[t(1349)](n,8),255),e[t(765)](255,n),e[t(1349)](o,24),e[t(494)](o,16)&255,e[t(1663)](o>>>8,255),255&o]}}}let ns=new z(0,0,!1),Wo=new z(0,0,!0),jo=z[r(1074)](-1,2147483647,!1),Go=z.fromBits(-1,-1,!0),Jo=z.fromBits(0,-2147483648,!1);var Fe=(function(s){let t=r;if(e[t(1530)](t(1068),e[t(1008)]))return this[t(999)+"ndpointT"+t(678)+"t"]=1,this[t(1139)+"ndex"]++,this[t(1485)+"s"][this[t(1139)+t(1095)]];{let n=e[t(541)][t(1700)]("|"),o=0;for(;;){switch(n[o++]){case"0":s[s[e[t(1740)]]=5003]=e[t(1740)];continue;case"1":s[s[e.rpQXh]=5005]=e[t(370)];continue;case"2":return s;case"3":s[s[e[t(686)]]=5004]=e[t(686)];continue;case"4":s[s[e[t(438)]]=5001]=e.LDavT;continue;case"5":s[s[e[t(1782)]]=5002]=e[t(1782)];continue}break}}})({});class ot{constructor(t){let n=r;this[n(1497)]=t,this[n(978)]=null}}class rs extends ot{constructor(t,n){let o=r;super(t),this[o(1375)]=n&&n[o(1375)]||null}}class ss extends ot{constructor(t,n){let o=r,c=e[o(834)][o(1700)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(1600)]=n&&n[o(1600)]||null;continue;case"1":this.filename=n&&n.filename||"";continue;case"2":this[o(926)]=n&&n[o(926)]||0;continue;case"3":this[o(1375)]=n&&n.message||"";continue;case"4":this[o(1150)]=n&&n[o(1150)]||0;continue;case"5":this[o(331)]=n&&n[o(331)]||5001;continue;case"6":super(t);continue}break}}}class is extends ot{constructor(t,n){let o=r,c=e[o(1187)][o(1700)]("|"),l=0;for(;;){switch(c[l++]){case"0":super(t);continue;case"1":this.code=n&&n[o(331)]||0;continue;case"2":this.wasClean=n&&n[o(1576)]||!1;continue;case"3":this[o(961)+"nnect"]=n&&n[o(961)+o(1684)]||!1;continue;case"4":this[o(623)]=n&&n[o(623)]||"";continue}break}}}class os extends ot{constructor(t,n){let o=r;e[o(1539)](e[o(1406)],e[o(1406)])?(_0x4974c4(_0x269ed0,32),e[o(714)](_0x3f20e4,_0x274de1,e.PnehC(_0x589f26,_0x3dd37b))):(super(t),this[o(903)]=n&&n.data||null)}}class as extends os{constructor(t,n){let o=r;e[o(1177)](e.BrmpL,e[o(908)])?(super(t),this[o(903)]=n&&n.data||null,this[o(1375)]=n&&n[o(1375)]||null):this[o(1056)](_0x237214,_0x31cb7c)}}class xs extends ot{constructor(t,n){let o=r,c={qfjlI:e[o(545)]};if(e[o(659)](e[o(1016)],e[o(1467)]))return _0x3bb81d[o(1239)](c[o(1554)],_0x5b4c8c,_0x2804ef,_0x2ba356),this[o(997)][o(563)]({cursor_name:_0x34c500,cursor:_0x1e8823,service:_0x5f5163});super(t),this[o(903)]=n&&n.data||null}}function de(s,{message:t,code:n,error:o}){return new ss(s,{message:t,code:n,error:o})}function _e(s,{code:t,reason:n,wasClean:o,willReconnect:c}){return new is(s,{code:t,reason:n,wasClean:o,willReconnect:c})}function cs(s,{data:t,message:n}){return new as(s,{data:t,message:n})}function fs(s,{data:t}){let n=r,o={shjMS:function(c){return c()},uzdBC:function(c){return e[D(1268)](c)}};if(e[n(1821)](e[n(1812)],e[n(1812)]))rikTvk[n(1081)](_0x5db2e0),rikTvk[n(355)](_0x9daf9a);else return new xs(s,{data:t})}function Qn(s,{message:t}){return new rs(s,{message:t})}class us{constructor(t,n){let o=r;this[o(1485)+"s"]=t,this[o(1714)+"es"]=n,this[o(1139)+o(1095)]=0,this["currentE"+o(1358)+o(678)+"t"]=0}[r(569)+"pointConfig"](){let t=r;this[t(1139)+t(1095)]=0,this.currentEndpointTriesCount=0}[r(1468)+"es"](){let t=r,n={QVRoy:function(o,c,l){return e[D(430)](o,c,l)}};e.uxxmr(e.TCfbN,e[t(773)])?(axavaS.QVRoy(_0x4817ca,_0x4adc8a,50),axavaS[t(1357)](_0x187d81,_0x22aa9c,_0x4eda83)):this[t(999)+t(1358)+t(678)+"t"]=0}getCurrentEndpoint(){let t=r;return this[t(1485)+"s"][this["currentI"+t(1095)]]}[r(358)+"ntEndpoi"+r(1601)+r(1723)](){let t=r;return this["currentE"+t(1358)+t(678)+"t"]}[r(922)+r(1322)+"es"](){let t=r;return!!(e[t(831)](this[t(1139)+t(1095)],this[t(1485)+"s"][t(1759)])||e.HvHiP(this[t(1139)+t(1095)],e[t(1572)](this[t(1485)+"s"][t(1759)],1))&&e[t(1799)](this["currentE"+t(1358)+t(678)+"t"],this.maxRetries))}[r(508)+r(1315)+r(361)+"hedMaxRe"+r(452)](){let t=r;return e.AfaZF(this.currentIndex,this.endpoints[t(1759)])?!0:e[t(1840)](this[t(999)+t(1358)+"riesCount"],this[t(1714)+"es"])}[r(836)+"ackupEnd"+r(1809)+r(1580)+r(1015)](){let t=r;return this[t(999)+t(1358)+t(678)+"t"]=1,this.currentIndex++,this[t(1485)+"s"][this[t(1139)+"ndex"]]}[r(358)+r(1368)+r(1560)+"ateCount"](){let t=r;return e.GgwlN(e.QCvrk,e.QCvrk)?(_0x18ee18[t(375)+"t8"]?_0x241519[t(375)+"t8"](_0x245df6,_0x4a20ec):_0x4ee4b3[_0x790ee6]=e[t(766)](255,_0x3d25a9),_0xc2da0c+1):(this[t(999)+"ndpointTriesCount"]++,this.getCurrentEndpoint())}}let at=(e.kNKKZ(e[r(923)],typeof globalThis)&&e.fGsKU(e[r(1192)],globalThis.constructor.name)||e[r(730)](e[r(923)],typeof window)&&e[r(562)](r(1149),window[r(558)+"tor"][r(1237)]))&&e[r(923)]!=typeof document,Je=e.nevLT(e[r(923)],typeof globalThis)&&(e.XYpDf(e[r(1254)],globalThis[r(558)+r(1395)][r(1237)])||e[r(1731)](e.OZfCx,globalThis[r(558)+r(1395)].name))&&e[r(730)](e[r(923)],typeof tt),St=(e.nevLT(e[r(923)],typeof globalThis)&&e[r(372)](e[r(1254)],globalThis[r(558)+r(1395)].name)||e[r(1126)](e[r(923)],typeof globalThis)||e[r(761)](e[r(923)],typeof globalThis)&&!!globalThis[r(454)+"Bridge"])&&e.nevLT(e[r(923)],typeof wx),Ct=e[r(851)](r(1147)+"d",typeof globalThis)&&(e[r(521)]===globalThis[r(558)+r(1395)].name||e[r(674)](r(1390)+r(663)+r(1424),globalThis["construc"+r(1395)].name)||e[r(994)](r(1440)+"orkerGlo"+r(1397),globalThis[r(558)+"tor"][r(1237)]))&&e[r(730)](e[r(923)],typeof self),Vo=e[r(1608)](e[r(923)],typeof globalThis)&&e[r(1038)](r(1385),globalThis[r(558)+r(1395)].name)&&e[r(1671)](r(1147)+"d",typeof global)&&e[r(1787)](e[r(1254)],global[r(558)+r(1395)].name)&&e[r(851)](e[r(923)],typeof process)&&!!process[r(702)];class er{constructor(){this._listeners={}}emit(t,...n){let o=r,c=this[o(566)+"rs"][t];if(c)c[o(620)]()[o(1838)](l=>l.fn.apply(l[o(576)],n));else if(e[o(1038)](e[o(1437)],t)&&!this[o(1396)]){let l=n[o(1759)]&&n[0];if(e.TElNw(l,Error))throw l;let h=new Error(e[o(516)]+(l?e[o(1111)](" (",l[o(1375)])+")":""));throw h[o(902)]=l,l}return this}[r(1056)](t,n){let o=r;if(t===void 0)this[o(566)+"rs"]={};else if(e.nygpZ(void 0,n))this[o(566)+"rs"][t]=null;else{let c=this._listeners[t];if(c)for(let l=0;e[o(409)](l,c.length);)e.uxxmr(c[l].fn,n)?c.splice(l,1):++l}return this}on(t,n,o){let c=r;return(this[c(566)+"rs"][t]||(this._listeners[t]=[]))[c(751)]({fn:n,ctx:o||this}),this}}class Yo extends er{[r(1526)+r(597)+r(1460)](t){let n=r;if(n(348)!==e[n(1323)])this[n(566)+"rs"]={};else return t[n(440)]||t[n(1430)]?(n(332)+" "+(t[n(440)]||"")+" code: "+(t[n(1430)]||""))[n(705)]():JSON[n(638)+"y"](t)}constructor(t,n,o){let c=r;super(),this._socket=null,St&&wx["connectS"+c(1599)]&&(this._socket=wx[c(668)+c(1599)]({url:t,protocols:n,header:o,fail:this["_createS"+c(1022)+c(1389)][c(753)](this),success:this["_createSocketSuc"+c(1009)+c(798)][c(753)](this)})),Je&&tt[c(668)+c(1599)]&&(this[c(633)]=tt[c(668)+"ocket"]({url:t,protocols:n,header:o,fail:this[c(820)+c(1022)+"lHandler"][c(753)](this),success:this["_createS"+c(509)+c(1009)+"ler"].bind(this)}))}[r(820)+"ocketSuc"+r(1009)+"ler"](){let t=r,n={QIeiG:function(o,c){return o(c)},DbKuy:function(o){return e.qjBzm(o)},sulOW:function(o,c){return e.HsLEc(o,c)},romyR:e[t(830)],nWqkU:e[t(933)]};e[t(674)]("KOkrp",t(866))?(this[t(875)]=!1,n[t(630)](_0x2e8eed,this[t(1625)+"ionTimeo"+t(1681)]),n[t(1823)](_0x3e9c74)):Promise[t(1841)]()[t(1172)](()=>{let o=t,c={MPjEv:function(l,h){return n[D(630)](l,h)}};if(n[o(416)](n[o(1706)],n[o(1504)]))return function(...l){let h=o;return _0x57f61d[h(1295)](lAWnbx[h(1741)](_0x164893,this),l),lAWnbx.MPjEv(_0x3101c0,_0x372023[h(1508)](this))};this._addWsListeners()})}[r(820)+r(1022)+r(1389)](t){let n=r,o={ftXpF:function(c,l,h){return e.kTlTA(c,l,h)},pNYym:e.gFzAs,YjjIr:n(833)};Promise[n(1841)]()[n(1172)](()=>{let c=n,l=o[c(844)](de,o[c(1378)],{message:this[c(1526)+"rrorMessage"](t)});this[c(1060)](c(1600),l);let h=_e(o[c(1184)],{reason:this["_formatE"+c(597)+"age"](t)});this.emit(c(833),h)})}["_addWsLi"+r(1086)](){let t=r,n={jnWNT:function(o,c,l){return o(c,l)},RLOGu:e[t(1614)],cwUwT:e.gFzAs};this[t(633)][t(853)](o=>{let c=t;this[c(1060)](c(1806),n.jnWNT(fs,"open",{...o,data:o[c(440)]||""}))}),this._socket.onClose(o=>{let c=t;this[c(1060)](e[c(649)],e.Jhwlh(_e,e[c(649)],{...o}))}),this[t(633)][t(488)+"e"](o=>{let c=t;this[c(1060)](n[c(367)],n[c(592)](cs,n[c(367)],{...o}))}),this[t(633)][t(774)](o=>{let c=t;this[c(1060)](n.cwUwT,de(n[c(392)],{...o,message:o[c(440)]||""}))})}[r(1687)](t){let n=r,o={TGXsD:e[n(1437)],tDNuZ:function(c,l,h){return e[n(995)](c,l,h)}};if(e[n(1699)]!==e.OgTBO)if(e.oqJZr(t,Uint8Array)){let c=t[n(1735)][n(620)](t[n(752)+"et"],t[n(772)+"th"]+t[n(752)+"et"]);this[n(633)]&&this._socket.send({data:c,fail:l=>{let h=n;this.emit(o[h(1609)],o[h(924)](de,h(1600),{message:this[h(1526)+h(597)+h(1460)](l)}))}})}else this[n(633)]&&this[n(633)][n(1687)]({data:t,fail:c=>{let l=n;this[l(1060)](o[l(1609)],de(o[l(1609)],{message:this[l(1526)+"rrorMess"+l(1460)](c)}))}});else this[n(1364)+n(912)](),this[n(1060)](n(868)+n(349)+"s",n(404)),this[n(1288)+"gTimeoutId"]=o[n(924)](_0x155b9c,this[n(616)].bind(this),_0x200fe1)}close(t,n){let o=r;this[o(633)]&&this[o(633)][o(833)]({code:t,reason:n})}[r(719)+r(1382)](t,n){let o=r;if(e.fKiBz("PptfI",e[o(1766)])){let c=_0x5e47cf[o(1759)]&&_0x8069c7[0];if(e[o(1010)](c,_0x411959))throw c;let l=new _0x127c00(e[o(383)](e.DRNzR,c?e[o(1370)](" ("+c.message,")"):""));throw l[o(902)]=c,c}else this.on(t,n)}removeEventListener(t,n){this[r(1056)](t,n)}get[r(1573)+"te"](){let t=r;return this[t(633)][t(1573)+"te"]}get binaryType(){let t=r;return this._socket[t(1198)+"pe"]}set binaryType(t){}get[r(780)](){return this._socket.url}get[r(1804)](){let t=r;return this[t(633)][t(1804)]}get extensions(){let t=r;return this[t(633)][t(1549)+"ns"]}get["buffered"+r(1309)](){let t=r;if(e[t(1477)](e[t(411)],e[t(411)]))_0x5d5d68=e[t(825)](e[t(1762)](e.hwFSQ(15,_0x29e715),12),e.ALldR(e.dIgKM(63,_0x568584),6))|e.wsJBc(63,_0x14edde),e.RaVjj(_0x55f614,2048)||e[t(1263)](_0x416bb3,55296)&&_0x1f7e9d<=57343?_0x267fbb+=_0x3ce8de:(_0x50d6d7+=e[t(917)](_0x17d22a,_0x3b0922),_0x191383+=2);else return 0}}function Xo(s,t){let n=r;if(t)return new t(s[n(780)],s[n(1804)]);if(e[n(421)](St,Je))return new Yo(s.url,s[n(1804)],s[n(602)]);if(e.AmOCf(at,Ct)&&e.kNKKZ(e[n(923)],typeof WebSocket)&&WebSocket)return new WebSocket(s[n(780)],s.protocols)}function Zo(s){let t=r,n=e[t(1261)][t(1700)]("|"),o=0;for(;;){switch(n[o++]){case"0":if(e[t(421)](at,Ct)&&e[t(1142)](e[t(923)],typeof WebSocket)&&WebSocket)return!0;continue;case"1":if(Je&&tt["connectS"+t(1599)])return!0;continue;case"2":if(St&&wx[t(668)+"ocket"])return!0;continue;case"3":return!1;case"4":if(s)return!0;continue}break}}function ds(s,t,n){let o=r,c=-1;async function l(h){let p=D;return e[p(1230)](h,c)?Promise[p(1217)](new Error(p(919)+p(910)+"ltiple times in process")):(c=h,e[p(796)](h,n.length)?Promise[p(1841)]():n[h].bind(s)(t,l.bind(null,e[p(968)](h,1))))}e[o(1669)](l,0)}function ls(s){let t=r,n=0,o=0;for(let c=0;e[t(984)](c,s[t(1759)]);++c)o=s.charCodeAt(c),e[t(1338)](o,128)?n+=1:o<2048?n+=2:e[t(930)](e[t(1654)](64512,o),55296)&&e[t(674)](e.syUxB(64512,s[t(1674)+"At"](c+1)),56320)?(++c,n+=4):n+=3;return n}function hs(s,t,n){let o=r;if(e[o(886)](e[o(1341)](n,t),1))return"";let c="";for(let l=t;l<n;)if(e[o(890)]===e.xrgga){if(e[o(350)](4,_0x561224[o(1759)])){let h=_0x706f4d[o(397)+"g"](0,4-_0x1daab1[o(1759)]),p=h[o(1160)](_0x41f963);_0x468939[o(751)](p)}else _0x32afd1[o(751)](_0x286271);_0x4d63d3&&(_0x373523+=1),_0x65245+=1,_0x466eac=!1}else{let h=s[l++];if(e.wxjBL(h,127))c+=String[o(1483)+o(1162)](h);else if(e[o(856)](h,192)&&e.sWfAg(h,224))c+=String[o(1483)+o(1162)](e[o(1774)](31&h,6)|63&s[l++]);else if(e[o(1790)](h,224)&&h<240)c+=String["fromChar"+o(1162)](e[o(756)](e.dAdtU(e[o(921)](e[o(1021)](15,h),12),e[o(1556)](63,s[l++])<<6),e[o(1490)](63,s[l++])));else if(e[o(1263)](h,240)){let p=e[o(487)](e[o(1001)](e[o(1618)](7,h)<<18,e[o(1414)](63&s[l++],12))|e[o(921)](e[o(1105)](63,s[l++]),6),e.DujXz(63,s[l++]))-65536;c+=String["fromChar"+o(1162)](55296+e[o(1523)](p,10)),c+=String[o(1483)+o(1162)](e[o(1803)](56320,e[o(936)](1023,p)))}}return c}function tr(s,t,n){let o=r,c={bPgBX:function(d,w){return e[D(967)](d,w)},dvNZv:function(d,w){return d+w},wvXXN:o(1272)+o(673)},l=n,h,p;for(let d=0;e[o(1688)](d,s[o(1759)]);++d)if(h=s[o(1674)+"At"](d),e[o(1606)](h,128))t[n++]=h;else if(e[o(1708)](h,2048))t[n++]=e[o(1738)](h>>6,192),t[n++]=e.lbukD(e.knzZy(63,h),128);else if(e.acDmb(e[o(491)](64512,h),55296)&&e.udvBf(e[o(701)](64512,p=s[o(1674)+"At"](d+1)),56320))if(e.CvCpo("ymQEC",e.nzBGz))h=e.YwILV(65536+(e[o(483)](1023,h)<<10),e.ZSeSk(1023,p)),++d,t[n++]=e[o(1696)](e[o(1175)](h,18),240),t[n++]=e[o(650)](h>>12,63)|128,t[n++]=e[o(1043)](e.FjSPt(h>>6,63),128),t[n++]=e.tfJZm(63&h,128);else{if(uWtszP[o(793)](uWtszP[o(1586)](_0x1eae80.offset,_0x2e5fcf),_0x38dfe2.limit))throw new _0x417c30(uWtszP[o(608)]);_0xeae87f[o(1727)]+=_0x1461cc}else t[n++]=e[o(1043)](e[o(758)](h,12),224),t[n++]=e[o(1001)](e[o(1538)](e.pgwzU(h,6),63),128),t[n++]=63&h|128;return e[o(1517)](n,l)}async function gs(s){let t=r;if(e.eUgxC!==e[t(1109)]){let n=this[t(997)][t(1631)](this[t(1066)]),o=_0x2b5f82[t(1747)](e[t(421)](n,"{}"));return _0x3b9c85[t(776)](o)}else{if(e.AfaZF(e[t(606)],typeof s)){let n=new Uint8Array(e.zeggV(ls,s));return e[t(932)](tr,s,n,0),n}return e[t(1692)](s,ArrayBuffer)?new Uint8Array(s):new Uint8Array(s[t(1735)],s[t(752)+"et"],s[t(772)+"th"])}}function $o(s){let t=r;try{return e.kNKKZ(e.pbpzJ,typeof s)&&(e[t(878)](s,ArrayBuffer)||s.buffer&&e[t(405)](s[t(1735)],ArrayBuffer))||e[t(606)]!=typeof s?"":(JSON.parse(s),e.KfLOx)}catch{return e.pbpzJ==typeof s?e[t(1433)]:""}}let Qo=(s,t)=>{let n=r;switch(s){case n(1743):case e[n(390)]:return{[n(433)+s]:1,"x-tt-env":t};default:return{}}};class e0{constructor(t){let n=r;this[n(1603)+n(1723)]=t,this.count=0}[r(1776)](){let t=r;this[t(1645)]++}[r(922)+"chMaxCount"](){let t=r;return this[t(1645)]>=this[t(1603)+t(1723)]}[r(1760)+"nter"](t=0){let n=r;this[n(1603)+"ount"]=t,this.count=0}}async function t0(s){let t=r,n={ICqQf:function(o,c){return e.ORCoB(o,c)},HwHGj:e[t(1578)],uxGub:function(o,c){return e.wVcXR(o,c)},sFHND:e.VTvRI,HMQdY:function(o,c){return e[t(1012)](o,c)},qXugA:t(1683),UXNEW:function(o,c){return e[t(408)](o,c)},VHAhm:t(915),iUpFk:e[t(1259)]};return new Promise(o=>{let c=t;if(!at)return n.HMQdY(o,n[c(1319)]);try{let l=document["createEl"+c(1313)](n[c(1772)]);window[c(448)+c(1257)]=h=>{let p=c;if(n.ICqQf(n.HwHGj,n.HwHGj))for(var d in _0x5f571b)_0x24a171.o(_0x87e225,d)&&!_0xf8cf48.o(_0x5879ed,d)&&_0x30a499.defineProperty(_0x5730c7,d,{enumerable:!0,get:_0x4b5499[d]});else document[p(1151)][p(1135)+p(1073)](l),window[p(448)+"JSONP"]=void 0,n[p(963)](o,h&&h.msg||n[p(1319)])},l[c(1497)]=c(739)+c(1557),l[c(589)]=n[c(1333)](s[c(1282)](/^ws/,n[c(854)]),n[c(1472)]);try{document[c(1151)].appendChild(l)}catch{document[c(1151)][c(1135)+c(1073)](l)}}catch{window[c(448)+c(1257)]=void 0,n[c(808)](o,n[c(1319)])}})}function Ue(s,t,n){let o=r;return!!s?.[o(497)](c=>c[o(792)]===t&&c[o(1165)]===n)}function xt(s,t){let n=r;return s?.[n(497)](o=>o[n(792)]===t)?.[n(1165)]}let nr=null;async function n0(){let s=r;return nr||(nr=Promise[s(1841)]()[s(1172)](Ee[s(753)](Ee,"idb"))),nr}class r0 extends er{constructor(t,n){let o=r;super(),this[o(480)]=t,this[o(657)]=n,this[o(997)]=void 0,this[o(441)+o(1670)]=null}async[r(560)](){await this._init()}async[r(1367)](){let t=r,n={uZlMC:function(o,c){return e[D(901)](o,c)},GrdyQ:e[t(1589)],Bxgyi:e[t(905)],oOUwK:function(o,c,l,h){return e[t(651)](o,c,l,h)}};if(e[t(1518)](e[t(1004)],e[t(1004)])){if(this[t(997)])return;if(this[t(441)+"mise"])return this[t(441)+t(1670)];try{if(e[t(1521)](e[t(474)],e[t(474)])){let o=this[t(480)],c=this[t(657)];this[t(441)+t(1670)]=(async()=>{let l=t,{openDB:h}=await n0();this._qosDB=await n[l(1301)](h,l(448)+"_"+o,1,{upgrade(p){let d=l;n.uZlMC(n[d(874)],n.Bxgyi)?p["createOb"+d(1209)+"e"](o,{keyPath:c}):_0x94940c[d(1239)](_0x40b6d0)}})})(),await this[t(441)+"mise"]}else{let o=this[t(997)][t(870)+t(1407)+"nc"](this._prefix),c=_0x71d92b[t(1747)](e[t(935)](o,"{}"));return _0x4960ae[t(776)](c)}}catch(o){console.log(o)}finally{this[t(441)+t(1670)]=null}}else throw this[t(1625)+t(492)]=!1,_0x46091a}async[r(1508)](t){let n=r;if(n(726)!==e[n(337)])try{return await this[n(1367)](),this[n(997)]?.[n(1508)](this[n(480)],t)}catch(o){console[n(1239)](o)}else return this["_endpoin"+n(1330)]?.[n(358)+n(1368)+n(1601)+n(1723)]()||0}async[r(563)](t,n){let o=r;return await this._init(),this[o(997)]?.[o(419)](this[o(480)],t)}async[r(746)](t){let n=r,o={ktxBZ:function(c,l){return e[D(556)](c,l)}};try{if(e.eYrqu===e[n(515)])return await this._init(),this._qosDB?.[n(514)](this[n(480)],t);{let c=_0x5e18a2[n(397)+"g"](0,yvmDYv.ktxBZ(4,_0x51f2d6[_0x43b7a1][n(1759)])),l=c[n(1160)](_0x43aa6b);_0x9fc45f=_0x5220cf[n(1160)](l)}}catch(c){e[n(1539)](e[n(1006)],n(680))?(++_0x3ca3fc,_0x32690f+=4):console.log(c)}}async[r(1441)](){let t=r;try{return await this._init(),this[t(997)]?.clear(this[t(480)])}catch(n){console[t(1239)](n)}}async[r(1456)](){let t=r;return await this[t(1367)](),this[t(997)]?.[t(525)+"ys"](this[t(480)])}async[r(1423)](){let t=r;return await this[t(1367)](),this[t(997)]?.[t(1423)](this[t(480)])}async closeDB(){let t=r;if(e[t(690)](e[t(813)],e[t(813)]))return t(448)+"_"+this[t(590)];try{this._qosDB?.[t(833)](),this[t(997)]=void 0}catch(n){console[t(1239)](n)}}get[r(459)](){let t=r;try{return!!this._qosDB}catch(n){if(e[t(1500)](e[t(1025)],t(1427)))return console[t(1239)](n),!1;{let o=this[t(997)][t(870)+"geInfoSync"](this[t(1066)]),c=_0x19a415[t(1747)](e.wCIhX(o,"{}"));return _0x1a5dc8[t(1456)](c)}}}}class s0{constructor(t,n){let o=r;e[o(685)](o(1668),e[o(1443)])?(this[o(590)]=t,this[o(469)]=n,this[o(997)]=localStorage):(this[o(1502)+"er"]&&_0x17efc3[o(1072)+"entListe"+o(1083)](e.JApvE,this["_handleO"+o(472)]),this._isBrowser&&_0x1f11d0[o(1072)+o(826)+o(1083)](e[o(636)],this[o(1597)+o(1769)]),this[o(1502)+"er"]&&_0x27ee80[o(1072)+o(826)+o(1083)]("pagehide",this[o(925)+"ageHide"]),this._isBrowser&&_0xc3b85e[o(1072)+o(826)+o(1083)](e[o(1403)],this[o(925)+o(527)]))}async[r(560)](){}get[r(1066)](){let t=r;if(e.VEDlH===t(1709))return"frontier_"+this[t(590)];this[t(1374)+t(1758)]=_0x132e16}async[r(1508)](t){let n=r,o=this[n(997)][n(1631)](this[n(1066)]);return JSON.parse(e.TqrBP(o,"{}"))[t]}async[r(563)](t,n){let o=r,c=this[o(997)][o(1631)](this[o(1066)]),l=JSON[o(1747)](e[o(790)](c,"{}"));return l[n||t[this[o(469)]]]=t,this[o(997)][o(403)](this[o(1066)],JSON[o(638)+"y"](l)),n||t[this[o(469)]]}async[r(746)](t){let n=r,o=this[n(997)][n(1631)](this[n(1066)]),c=JSON[n(1747)](e[n(421)](o,"{}"));return c[t]=void 0,this[n(997)].setItem(this[n(1066)],JSON[n(638)+"y"](c))}async[r(1441)](){let t=r;return this[t(997)][t(1441)]()}async[r(1456)](){let t=r,n=this[t(997)][t(1631)](this._prefix),o=JSON[t(1747)](e[t(1332)](n,"{}"));return Object.keys(o)}async[r(1423)](){let t=r,n=this[t(997)][t(1631)](this[t(1066)]),o=JSON[t(1747)](e[t(643)](n,"{}"));return Object.values(o)}[r(1429)](){return Promise[r(1841)]()}get[r(459)](){return!!this[r(997)]}}class i0{constructor(t,n){let o=r;this[o(590)]=t,this[o(469)]=n,this[o(997)]=Je?tt:St?wx:null}async[r(560)](){}get[r(1066)](){let t=r;return e.DOBWL(e.DRHNE,e[t(1294)])?"frontier_"+this[t(590)]:_0x38930a[t(676)][_0x228837(_0x5c2a03,1)]}async[r(1508)](t){let n=r,o=this._qosDB[n(870)+n(557)](this[n(1066)]);return JSON.parse(e[n(790)](o,"{}"))[t]}async[r(563)](t,n){let o=r,c=this[o(997)][o(870)+o(557)](this[o(1066)]),l=JSON.parse(e[o(1167)](c,"{}"));return l[n||t[this[o(469)]]]=t,this[o(997)][o(574)+o(557)](this[o(1066)],JSON[o(638)+"y"](l)),n||t[this[o(469)]]}async[r(746)](t){let n=r;if(e[n(648)]===e.LorFO)e[n(932)](_0x36e987,this,_0x1e0ce1,[_0x375f90,_0xbbbaa5,_0x2c20d5]);else{let o=this._qosDB[n(870)+n(557)](this[n(1066)]),c=JSON[n(1747)](o||"{}");return c[t]=void 0,this[n(997)][n(574)+n(557)](this[n(1066)],JSON[n(638)+"y"](c))}}async[r(1441)](){let t=r;return this[t(997)]["clearSto"+t(575)]()}async[r(1456)](){let t=r,n=this[t(997)][t(870)+"geInfoSync"](this[t(1066)]),o=JSON[t(1747)](e[t(1167)](n,"{}"));return Object.keys(o)}async[r(1423)](){let t=r,n=this._qosDB[t(870)+"geInfoSync"](this[t(1066)]),o=JSON[t(1747)](n||"{}");return Object[t(776)](o)}closeDB(){return Promise.resolve()}get isReady(){return!!this[r(997)]}}function ps(s,t){let n=r;if(e[n(610)](e.AEUDO,e[n(1251)])){if(Je||Je)return new i0(s,t);if(e[n(410)](at,Ct)&&e.kNKKZ(e[n(923)],typeof indexedDB))return new r0(s,t);if(e[n(504)](at,Ct)&&e[n(1142)](n(1147)+"d",typeof localStorage))return new s0(s,t);throw new Error(e.tHRzX)}else this[n(1665)][n(598)]&&_0x79261a[n(1239)][n(1295)](_0x380f0e,["FRONTIER>",..._0x2a1474])}class o0{constructor(){let t=r;this._intervalTimeoutId=null,this._interval=36e5,this[t(997)]=e[t(1157)](ps,e[t(894)],e.DSQdG)}async[r(1820)+r(1704)](){let t=r;if(e[t(1240)](e.PbjYt,e[t(1291)])){let n=e.qjBzm(_0x1f8a95);return e.esDfC(_0x25a84c,_0x1083d5,n),e.UwLTG(_0x2d7fbf,n)}else e[t(862)](clearInterval,this[t(1820)+"lTimeoutId"]),this[t(1820)+t(1236)+"Id"]=e[t(1058)](setInterval,()=>{this["flushExp"+t(1767)]()},this[t(1820)+"l"])}async[r(560)](){let t=r;await this._qosDB.openDB()[t(1172)](()=>{this[t(1820)+"lFlush"]()})}async[r(1351)+r(1767)](){let t=r;(await this[t(997)]?.[t(1423)]()||[]).filter(({timestamp:c})=>c<Date.now())[t(1838)](c=>{let l=t;this[l(997)]?.del(c[l(1057)+"id"])})}async[r(746)](t){let n=r,o={WzQdr:function(c,l){return c(l)}};if(e[n(1188)](e[n(1492)],"RjWOy"))return this._qosDB?.[n(746)](t);{let c=/(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}/[n(1691)](_0x211c6c),l=/(([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]))/[n(1691)](_0x39aad1);return c?_0x4a2f87(_0x1b8613):l?fgxXEj[n(1739)](_0x549c16,_0x4ccec4):n(667)+"0000000000000000"+n(667)}}async[r(563)](t,n){let o=r;if(e[o(748)](e[o(1577)],e.neTuu))return this._qosDB?.[o(563)]({message_id:t,timestamp:n});this[o(1060)](e[o(1437)],_0x151e69("error",{message:this["_formatE"+o(597)+o(1460)](_0x1825b9)}))}async[r(1508)](t){let n=r;return this[n(997)]?.[n(1508)](t)}async[r(1429)](){let t=r;e[t(396)](clearInterval,this[t(1820)+"lTimeoutId"]),await this[t(997)]?.[t(1429)]()}get[r(459)](){let t=r;if(e[t(584)](e[t(806)],"lXPoo"))return this._qosDB?.[t(459)];{let n=_0x17c33c[t(1375)][t(543)];n&&_0x13cc0e[t(379)+"rs"](n)}}}function rr(s){let t=r,n=!!this[t(1665)][t(1833)+"S"];if(!n)return{enabled:n,isQoSMessage:!1,isQoSAck:!1,isAckCleanupMessage:!1,ackMsgIds:[]};let o=Ue(s[t(1375)][t(602)],t(1100)+t(1464),"2"),c=o&&Ue(s[t(1375)].headers,e.AlrVY,"1"),l=o&&e[t(1584)](Ue,s[t(1375)][t(602)],t(1100)+t(869)+"k","1"),h=l?xt(s[t(1375)].headers,t(1100)+"er_ack_m"+t(1434))?.[t(1700)](",")[t(1653)](Boolean)||[]:[];return{enabled:n,isQoSMessage:o,isQoSAck:c,isAckCleanupMessage:l,ackMsgIds:h}}async function ms(){let s=r;return this[s(818)+s(1677)]||(this[s(818)+s(1677)]=new o0),this[s(818)+s(1677)][s(459)]||await this[s(818)+s(1677)][s(560)](),this[s(818)+"ger"]}async function a0(s,t){let n=r,{enableAutoAck:o}=this[n(1665)],c=Ue(s[n(1375)][n(602)],n(1219),"1"),l=e[n(750)](Ue,s[n(1375)].headers,"is_ack","1"),h=rr[n(656)](this,s);if(o&&c){let{SeqID:p,LogID:d,service:w,LogIDNew:b,method:k}=s.message;this._sendAck({SeqID:p,LogID:d,LogIDNew:b,service:w,method:k,headers:[{key:e[n(401)],value:"1"},{key:e.RhkMJ,value:e[n(1822)](b,"")},{key:n(425),value:"0"}]})}l&&!h.isQoSAck&&this[n(524)+n(1270)+n(993)](s),t()}async function x0(s,t){let n=r;this[n(455)](e[n(1244)],s[n(1375)]),e[n(1290)](t)}async function c0(s,t){let n=r,o=e[n(1024)]($r,await e[n(1161)](gs,s[n(903)]));try{if(e.kjxqf(o[n(543)],Uint8Array)){let c=this[n(1665)][n(1027)+n(797)]instanceof Object?{force:!!this._options[n(1027)+"ncoding"][n(974)],encoding:this[n(1665)][n(1027)+"ncoding"][n(1097)]?this[n(1665)][n(1027)+n(797)][n(1097)].replace(/\s/g,"")[n(1225)+n(1216)]():""}:{force:!1,encoding:this[n(1665)][n(1027)+n(797)]?this._options.payloadEncoding[n(1282)](/\s/g,"")["toLowerC"+n(1216)]():""},l=o[n(1027)+"ncoding"]?o[n(1027)+"ncoding"][n(1282)](/\s/g,"")[n(1225)+n(1216)]():"",h=e[n(771)](this._options[n(1473)+n(1271)],Object)?{force:!!this._options[n(1473)+n(1271)][n(974)],type:this[n(1665)]["payloadT"+n(1271)][n(1497)]?this[n(1665)][n(1473)+n(1271)][n(1497)].replace(/\s/g,"")[n(1225)+n(1216)]():""}:{force:!1,type:this._options.payloadType?this[n(1665)][n(1473)+n(1271)][n(1282)](/\s/g,"")["toLowerC"+n(1216)]():""},p=o["payloadT"+n(1271)]?o[n(1473)+"ype"].replace(/\s/g,"")[n(1225)+"ase"]():"",d=h[n(974)]?h[n(1497)]:p||h[n(1497)],w=c.force?c[n(1097)]:l||c[n(1097)],b=[n(1478)+n(1770)+n(1347),e[n(1013)],e[n(1138)],e[n(606)]],k=[e.Okasl,e[n(897)]];this._options[n(1355)+n(880)+"extPayload"]&&b[n(1512)](d)&&(!w||k[n(1512)](w))?o[n(822)+n(1235)]=e.hnBDa(hs,o[n(543)],0,o[n(543)][n(772)+"th"]):o[n(822)+"oad"]=""}else o[n(822)+n(1235)]=""}catch(c){o[n(822)+n(1235)]="",console[n(1239)](c)}s[n(1375)]=o,e[n(990)](t)}function f0(s,t,n){let o=r,c=e[o(1065)](n,8192),l=c>>>1,h=null,p=c;return function(d){let w=o;if(e[w(409)](d,1)||d>l)return e.PsEuR(s,d);p+d>c&&(h=e.uovJg(s,c),p=0);let b=t.call(h,p,p+=d);return 7&p&&(p=e[w(542)](e.ynbvu(7,p),1)),b}}let u0=4294967295;function d0(s,t,n){let o=r;return e[o(896)](e.uoetm,e.uoetm)?RangeError(e[o(1449)](e[o(625)](e[o(864)]+s,e[o(1410)]),e[o(643)](t,1))+" > "+n):((this[o(566)+"rs"][_0x1a4c90]||(this[o(566)+"rs"][_0x87ac0b]=[])).push({fn:_0x11682d,ctx:_0xa5c858||this}),this)}function l0(s,t,n){let o=r;if(e[o(1643)](n,u0))throw new Error(e[o(1127)]);let c=3;for(;e.RpvaF(c,0);){let l=e.czzSB(255,n);e[o(904)](ir,l,s,e[o(852)](t,c)),n>>>=8,c--}return e[o(968)](t,4)}function h0(s,t){let n=r,o=0,c=t,l=e[n(1208)](t,4);for(;e[n(1299)](c,l);){let{value:h,offset:p}=sr(s,c);c=p,o=o<<8>>>0,o+=h}return{value:o,offset:l}}function g0(s,t,n){let o=r,c=e.Gamjk[o(1700)]("|"),l=0;for(;;){switch(c[l++]){case"0":return e.LNESK(e[o(904)](tr,s,t,n),n);case"1":if(t[o(495)])return e[o(1370)](t.write(s,n),n);continue;case"2":if(s.length<40)return e[o(1657)](e[o(904)](tr,s,t,n),n);continue;case"3":if(!s)return n;continue;case"4":if(t[o(644)+"e"])return e.hcPmy(t[o(644)+"e"](s,n),n);continue}break}}function p0(s,t){let n=r,o={sCumg:e[n(627)]};if(e[n(1528)](e[n(353)],e[n(353)])){let c=new z(e[n(1405)](e[n(418)](e[n(842)](e[n(461)](s[t+4],24),e[n(461)](s[t+5],16)),e.YqWqN(s[e[n(1370)](t,6)],8)),s[e[n(1535)](t,7)]),e[n(1702)](e.VRlPk(e[n(1085)](e.EqnkC(s[t+0],24),e[n(1032)](s[e[n(599)](t,1)],16)),e.soBEH(s[e.DsUcc(t,2)],8)),s[e[n(599)](t,3)]),!0);return t+=8,{value:c,offset:t+8}}else{let c=o[n(1003)].split("|"),l=0;for(;;){switch(c[l++]){case"0":this[n(1625)]();continue;case"1":this[n(364)+n(1836)]?.[n(1760)+"nter"]();continue;case"2":this["_endpoin"+n(1330)]?.[n(569)+"pointCon"+n(1693)]();continue;case"3":this[n(1070)+n(1093)]=!1;continue;case"4":this[n(875)]=!0;continue}break}}}function m0(s,t,n){let o=r,c=s[o(757)],l=s[o(443)];return t[n]=e[o(1234)](l,24),t[e[o(1486)](n,1)]=e[o(861)](e.XrdOa(l,16),255),t[e.wJFsh(n,2)]=e[o(858)](l>>>8,255),t[e.hqrWL(n,3)]=255&l,t[e[o(1327)](n,4)]=e[o(1712)](c,24),t[e.LNESK(n,5)]=e[o(507)](e[o(977)](c,16),255),t[e[o(1703)](n,6)]=e.IYHLE(e[o(1712)](c,8),255),t[n+7]=e.IYHLE(255,c),n+=8,n}function sr(s,t){let n=r;return s[n(511)+"8"]?{value:s[n(511)+"8"](t),offset:e[n(964)](t,1)}:{value:e[n(650)](255,s[t]),offset:e.SFHKE(t,1)}}function ir(s,t,n){let o=r;return t.writeUint8?t[o(375)+"t8"](s,n):t[n]=e[o(732)](255,s),e[o(1562)](n,1)}let _0=function(s){return new Uint8Array(s)},w0=e[r(923)]!=typeof Buffer?Buffer[r(760)+"afe"]:e[r(1243)](f0,_0,Uint8Array[r(1522)+"e"][r(1733)]);(()=>{let s=r,t={rWTaK:function(n,o){return e.dCUht(n,o)},cCFqU:function(n,o){return e[D(1338)](n,o)},CAtKc:function(n,o){return e.nmNSG(n,o)},lWggL:function(n,o){return e[D(1595)](n,o)},UAzmi:function(n,o){return n|o},rRJwC:function(n,o){return e[D(842)](n,o)},vCFbd:function(n,o){return e[D(1032)](n,o)},ZGpeK:function(n,o){return e[D(1305)](n,o)},capFU:function(n,o){return e[D(1338)](n,o)},XxjeL:function(n,o){return e[D(907)](n,o)},EdiDK:function(n,o){return n&o},PdZBt:function(n,o){return e[D(1660)](n,o)},boQQn:function(n,o){return e.ExPtX(n,o)},QKGZq:function(n,o){return n|o},JdozZ:function(n,o){return e.pHPcm(n,o)},nKjbl:function(n,o){return e[D(1643)](n,o)},zrGtS:function(n,o){return n!==o},CmIkP:s(1425),mJgvB:function(n,o,c,l){return n(o,c,l)}};if(e[s(1020)](e[s(519)],e[s(519)])){let n=4294967295;return function(o,c,l=!0){let h=s;if(n=t.lWggL(127&o[c],0),t[h(1200)](o[c++],128))return{value:l?n:t[h(1214)](0,n),offset:c};if(n=t.rRJwC(n,t[h(1613)](t[h(1616)](127,o[c]),7))>>>0,t.capFU(o[c++],128))return{value:l?n:t[h(1143)](0,n),offset:c};if(n=t.rRJwC(n,t[h(754)](127,o[c])<<14)>>>0,t[h(1203)](o[c++],128))return{value:l?n:t[h(1143)](0,n),offset:c};if(n=t[h(540)](t.rRJwC(n,t[h(1827)](127,o[c])<<21),0),t[h(1203)](o[c++],128))return{value:l?n:t[h(604)](0,n),offset:c};if(n=t.lWggL(t.QKGZq(n,t[h(786)](15,o[c])<<28),0),o[c++]<128)return{value:l?n:t[h(604)](0,n),offset:c};if(t[h(342)](c+=5,o[h(1759)]))if(t[h(395)](t[h(1279)],t[h(1279)])){if(_0xf50b94===void 0)this[h(566)+"rs"]={};else if(itgpHJ.rWTaK(void 0,_0x2fc5cd))this[h(566)+"rs"][_0x538f95]=null;else{let p=this[h(566)+"rs"][_0x63af28];if(p)for(let d=0;itgpHJ.cCFqU(d,p[h(1759)]);)itgpHJ[h(615)](p[d].fn,_0x2099e8)?p.splice(d,1):++d}return this}else throw c=o[h(1759)],t.mJgvB(d0,c,10,o[h(1759)]);return{value:l?n:t[h(1143)](0,n),offset:c}}}else{let n=new _0x4e13cf(e[s(1393)](e[s(1696)](_0x1d48ea[e[s(710)](_0x1643e1,4)]<<24,e[s(1656)](_0x454e3f[e.fbLJR(_0x56fca4,5)],16))|e[s(799)](_0x320001[_0x1e6375+6],8),_0x162493[e.jRwyZ(_0x36dc86,7)]),e[s(1459)](e.RodfH(e[s(1585)](e[s(1762)](_0x5b36ad[e[s(380)](_0x41b7aa,0)],24),_0x5e7ab5[e[s(1360)](_0x3c1bb3,1)]<<16),e[s(1166)](_0x10a3d3[e[s(1771)](_0x2f5180,2)],8)),_0x2d7252[_0x3332fc+3]),!0);return _0x344746+=8,{value:n,offset:_0x816473+8}}})();let y0=16,or=32;function v0(s){let t=r,n=0,o={};for(let c=0;e[t(775)](c,s[t(1759)]);c++)o[s[c][t(672)+t(1211)]]=ls(s[c][t(672)+t(1211)]),n+=e[t(679)](14,o[s[c][t(672)+t(1211)]]);return[n,o]}function _s(s,t,n){let o=r,c={OielB:function(l,h,p,d){return l(h,p,d)},wDfsi:e.dvdxp,iYlbP:function(l,h,p,d){return e[D(1286)](l,h,p,d)},SnwHI:e[o(1575)],eVEuF:e.xHtMd,kdSwP:e[o(1658)],pzEld:function(l,h,p,d){return e[o(750)](l,h,p,d)}};if(e[o(819)]===o(431))return(e[o(807)](_0x49cb6f,4).join("0")+e[o(980)](_0x5c358c,_0x260b61,2)[o(536)](16)).slice(-4);{let[l,h]=e[o(1334)](v0,s),p=e[o(1119)](w0,l),d=0;return s[o(1838)](w=>{let b=o,k=(b(1133)+b(1705)+b(1588))[b(1700)]("|"),N=0;for(;;){switch(k[N++]){case"0":d=c[b(1383)](m0,z[b(1098)+"er"](w.cursor||t),p,d);continue;case"1":console[b(1239)](c.wDfsi,w,w.service);continue;case"2":console[b(1239)](b(824),d);continue;case"3":d=c[b(1140)](g0,w[b(672)+b(1211)],p,d);continue;case"4":console[b(1239)](c[b(1116)],d);continue;case"5":d=c.OielB(l0,p,d,w.service||0);continue;case"6":console.log(c[b(1356)],d);continue;case"7":console[b(1239)]("header",d);continue;case"8":d=c[b(1383)](ir,0,p,d);continue;case"9":console[b(1239)](c[b(1817)],d);continue;case"10":d=c.pzEld(ir,h[w[b(672)+b(1211)]],p,d);continue}break}}),{frameType:or,headers:[{key:e[o(1242)],value:n}],payload:p}}}function b0(s){let t=r,n=0,o=[];for(;e[t(409)](n,s[t(772)+"th"]);){let{offset:c}=e[t(928)](sr,s,n);n=c;let l={cursor_name:"",cursor:0,service:0},{value:h,offset:p}=e[t(406)](h0,s,n);l[t(1265)]=h,n=p;let{value:d,offset:w}=e[t(645)](sr,s,n);n=w,l[t(672)+t(1211)]=e.LPkQr(hs,s,n,n+d),n+=d;let{value:b,offset:k}=e.FOwFP(p0,s,n);l.cursor=b.toNumber(),n=k,o[t(751)](l)}return o}function S0(){let s=r;if(e.xCWUe(s(603),e.NRPrZ)){let{pingInterval:t,pingFrequency:n}=this[s(1665)];if((e[s(671)]("hi",_0x3d852d[s(903)])&&e[s(1342)]===n||s(582)===n)&&(this._clearPingTimer(),this[s(1060)](e[s(386)],e[s(1783)]),this[s(1288)+"gTimeoutId"]=e[s(622)](_0x16d6f3,this._ping[s(753)](this),t)),e[s(659)]("hi",_0x446d47[s(903)]))return;try{_0x5b6a88(this,_0x5c4bb2,[_0x4eb69,_0x3d743c,_0x105ccf,_0x2b858f,_0x2e0249,_0x1cbe5a])}catch(o){let c=e[s(911)](_0x28be6d,e.gFzAs,{message:o[s(1375)],code:_0x2d7397[s(971)+"ERROR"],error:o});this[s(524)+s(1223)+"ent"](c)}}else return{frameType:or,headers:[{key:e[s(1242)],value:e[s(1392)]}],payload:void 0}}class C0{constructor(t,n,o){let c=r;this[c(522)+"ameSpace"]=t,this[c(1374)+c(1758)]=n,this[c(1226)+c(1348)]=o,this[c(997)]=e[c(645)](ps,this[c(522)+"ameSpace"],c(672)+"ame")}async[r(560)](){await this._qosDB.openDB()}async getCursors(){let t=r,n={pfxRf:e[t(664)]};if(e[t(1264)](t(402),t(402)))return _0x1c3d23||(_0x183345=_0x1dc887[t(1841)]().then(_0x52b0d6[t(753)](_0x33868b,aCuyJm[t(447)]))),_0x3d0bfd;{if(!this[t(997)][t(459)])return;let o=this[t(1226)+"Strategy"],c=await this[t(997)][t(1423)]();switch(console[t(1239)](e[t(845)],c),o){case e.GTEaO:return c&&c.length?_s(c,0,this[t(1374)+t(1758)]):void 0;case e.iuXji:return;case e[t(475)]:return c&&c[t(1759)]?e[t(1584)](_s,c,0,this["_cursorF"+t(1758)]):S0()}}}async[r(563)](t,n,o){let c=r;return console[c(1239)](e[c(545)],t,n,o),this[c(997)].set({cursor_name:t,cursor:n,service:o})}async[r(379)+"rs"](t){let n=r,o={aSbhD:e[n(1437)]},c=e[n(862)](b0,t);for(let l of c)e[n(1188)](e.XVeiG,e[n(517)])?(this[n(1060)](o[n(1768)],_0x53980a),this[n(1396)]&&this[n(1396)](_0x47441a)):(console[n(1239)](e.MJoLW,c),await this[n(997)][n(563)](l))}async[r(1508)](t){let n=r;return(await this[n(997)][n(1508)](t))?.[n(1612)]}async[r(1429)](){let t=r;e.XKaBu(e[t(1558)],e[t(1558)])?(this[t(1603)+t(1723)]=_0x353d17,this[t(1645)]=0):await this[t(997)][t(1429)]()}[r(486)+r(1130)+r(1454)](t){let n=r;this[n(1374)+n(1758)]=t}get[r(459)](){let t=r;return this[t(997)][t(459)]}}let E0=r(1801)+r(363);async function ws(s){let t=r;if(!this[t(1665)].enableQoS)return null;let{aID:n,fpID:o,messageStrategy:c}=this[t(1665)],l=e[t(643)](s,E0);try{return e[t(970)](e[t(1159)],"jXNUU")?(this[t(1152)+t(1826)]?s&&this[t(1152)+t(1826)][t(486)+t(1130)+t(1454)](s):this[t(1152)+t(1826)]=new C0(o+"_"+n+"_"+l,l,c),this[t(1152)+"anager"][t(459)]||await this._cursorManager[t(560)](),this[t(1152)+t(1826)]):{bytes:_0x1c9728,offset:0,limit:_0x2dc26a[t(1759)]}}catch{return null}}async function k0(s,t){let n=r,o={EQWRT:function(c,l){return e[D(1744)](c,l)},DMklY:function(c,l){return e[D(888)](c,l)},KKYCp:function(c,l){return e.AHtxe(c,l)},OdAbj:function(c,l){return e[D(1605)](c,l)},UxjNc:function(c,l){return e[D(1551)](c,l)},EAQqv:function(c,l){return e[D(1411)](c,l)},RhVPp:function(c,l){return c>>l},CHeRI:function(c,l){return c|l}};if(e.kmeBM!==e[n(1044)])return!!(this.currentIndex>=this[n(1485)+"s"].length||uZTRku.EQWRT(this[n(1139)+n(1095)],uZTRku[n(417)](this[n(1485)+"s"][n(1759)],1))&&uZTRku[n(377)](this[n(999)+n(1358)+n(678)+"t"],this.maxRetries));{let c=Ue(s[n(1375)][n(602)],n(331),"-1"),l=e.Ieqem(Ue,s[n(1375)][n(602)],e.Xovmy,"1"),h=e[n(568)](xt,s.message[n(602)],n(1100)+n(1520)),p=e[n(807)](Number,e[n(1540)](xt,s[n(1375)].headers,"x_frontier_ttl"))||0,d=rr[n(656)](this,s),w=e[n(1627)](Ue,s.message[n(602)],e.GWDwt,"2"),b=xt(s[n(1375)][n(602)],e[n(1498)]),k=Number(e[n(453)](xt,s.message[n(602)],e[n(803)]));if(d[n(1666)])return t();let N=d[n(512)+n(1215)]?await ms.call(this):null;if(e[n(1141)](s[n(1375)][n(1265)],0)&&l&&!c||e[n(1840)](s[n(1375)].service,0)){if(h&&d[n(512)+n(1215)]&&N){if(!!!await N[n(1508)](h))if(e[n(781)](e[n(476)],e[n(476)]))this[n(524)+n(1756)+n(1673)](s),await N[n(563)](h,e.LYdfU(Date[n(1802)](),p));else return _0x550fe1&&uZTRku.KKYCp(!0,_0x2e5562[n(1682)]);return t()}if(w)if(e[n(1182)](e.Bedjt,e[n(1636)]))_0x4d32f4[_0x51c800++]=uZTRku[n(945)](_0x5b692b,12)|224,_0x44fc2c[_0x1461dd++]=uZTRku.UxjNc(uZTRku[n(940)](uZTRku[n(1320)](_0x3349d8,6),63),128),_0x3e7ae1[_0x471c35++]=uZTRku.CHeRI(uZTRku[n(940)](63,_0x6e467f),128);else{let L=await ws.call(this);if(!L)return this[n(524)+"hMessage"+n(1673)](s),e[n(1311)](t);let A=await L[n(1508)](b)??-1;if(A<k)this["_dispatc"+n(1756)+n(1673)](s),L[n(563)](b,k,s[n(1375)].service);else throw new Error(n(1506)+n(1796)+" cursor "+k+(n(1489)+"than loc"+n(594)+"r ")+A);return e[n(1311)](t)}return this[n(524)+n(1756)+n(1673)](s),t()}}}async function A0(s,t){let n=r,o=rr.call(this,s);if(!o[n(512)+n(1215)])return e[n(1311)](t);let c=await ms.call(this);if(o["isAckCle"+n(1546)+n(1460)]&&o[n(1593)+"s"].length)for(let l of o[n(1593)+"s"])await c[n(746)](l);e.udTsK(t)}async function D0(s,t){let n=r,o=e[n(434)](s[n(1375)][n(369)+"e"],y0),c=e[n(1218)](s[n(1375)].frameType,or);if(e[n(1110)](!o,!c))return e[n(1810)](t);let l=e.kTlTA(xt,s[n(1375)][n(602)],e.eHFgt);if(!l)return e[n(1493)](t);let h=await ws[n(656)](this,l);if(!h)return t();if(o)if(e[n(591)](e[n(1607)],e.YEhWx)){let p=_0x20dd0a.substring(0,e[n(1262)](4,_0x4e6c5c[_0x438cdf][n(1759)])),d=p[n(1160)](_0x4e833e[_0x388fa9]);_0x5b3b34.push(d)}else{let p=await h.getCursors(),d={frameType:p?.["frameType"],SeqID:z.fromNumber(this[n(1362)]++),LogID:z.fromNumber(this[n(1665)][n(436)+n(805)]()),service:9e3,method:5,headers:p?.headers,payload:p?.[n(543)]},w=e.zeggV(C,d);this[n(1398)]&&this[n(1398)].readyState&&this[n(1398)][n(1687)](w)}if(c)if(e[n(930)](e[n(1185)],e[n(1386)])){this[n(1364)+n(912)](),this["_pingPon"+n(1746)+"Id"]=e[n(733)](_0x267f9f,this[n(616)][n(753)](this),this[n(1665)][n(1049)+n(1721)]);return}else{let p=s[n(1375)][n(543)];p&&h[n(379)+"rs"](p)}}let T0=async function(s,t){let n=r;this._isInit=!1,e[n(1480)](clearTimeout,this[n(1625)+"ionTimeo"+n(1681)]),e[n(1268)](t)},P0=async function(s,t){let n=r;if(e[n(1452)](e.VrbXy,e[n(740)])){if(!this[n(1398)]||this._ws.readyState!==this[n(913)])return e[n(1499)](t);let{pingInterval:o}=this[n(1665)];this[n(1132)+n(1330)]?.["resetEnd"+n(920)+"fig"]();for(let l=0;e[n(1299)](l,this[n(1226)+n(892)][n(1759)]);l++){let h=this[n(1226)+n(892)][l];if(this[n(1398)][n(1573)+"te"]===this[n(913)]&&e[n(341)](null,h))this._ws&&this[n(1398)].send(h),this["_message"+n(892)][l]=null;else break}this[n(1226)+n(892)]=this[n(1226)+n(892)][n(1653)](l=>!!l),this[n(1288)+n(1746)+"Id"]=e[n(1193)](setTimeout,()=>this[n(616)](),o),this[n(524)+n(814)+"nt"](s),this[n(1502)+"er"]&&this[n(1398)]&&(this[n(1398)][n(1198)+"pe"]=this[n(334)+n(1271)]);let c=this[n(1132)+"tManager"]?.[n(358)+n(1368)+"nt"]();this[n(455)](n(518)+c+n(1035)),e[n(1499)](t)}else _0x1ee0cc.set(_0x5177c9,_0x4b52ea)},I0=async function(s,t){let n=r,o=this[n(1132)+n(1330)]?.getCurrentEndpoint();this[n(455)](n(518)+o),t()};class L0 extends er{constructor(t){let n=r,o={GBpwH:function(p,d,w,b){return p(d,w,b)},uuKlW:function(p,d,w){return p(d,w)},KGesZ:function(p,d){return e[D(445)](p,d)},YRuci:n(868)+n(349)+"s",UrVvY:e[n(526)],LOOqF:e[n(1292)],dEYRN:function(p,d){return e[n(434)](p,d)},geEru:e.gAQjn,kwhsQ:"auto",sZySk:e.okVPA,LdZkQ:function(p,d){return e[n(1088)](p,d)},dnmBI:e[n(595)],JytBW:e.pvSXH,xCFSI:function(p,d,w){return e[n(559)](p,d,w)},pQREa:e.gFzAs,NpEhX:function(p,d,w){return e[n(555)](p,d,w)},kIdNT:function(p,d,w){return e[n(804)](p,d,w)},IpVCA:function(p,d,w){return p(d,w)}};super(),this["_miniNav"+n(572)+n(1778)]=!0,this[n(1502)+"er"]=at,this[n(1719)]=Vo,this[n(1436)+"T"]=Je,this[n(1761)+"X"]=St,this[n(1637)+"r"]=Ct,this[n(1226)+n(892)]=[],this[n(1132)+"tManager"]=null,this[n(1070)+n(1093)]=!1,this[n(334)+n(1271)]=e[n(1510)],this[n(1625)+n(492)]=!1,this[n(1625)+n(1380)+n(1681)]=null,this[n(1494)+n(471)+n(713)]=null,this[n(1288)+n(1746)+"Id"]=null,this._seqId=0,this[n(875)]=!1,this._url="",this["_QoSMana"+n(1677)]=null,this[n(1152)+n(1826)]=null,this[n(364)+n(1836)]=null,this[n(1293)+"ls"]=e.iWNEg,this[n(1067)]=3,this[n(1153)+"NG"]=0,this[n(913)]=1,this[n(1144)]=2,this[n(1082)]=p=>{let d=n;try{o.GBpwH(ds,this,p,[T0,P0,I0])}catch(w){let b=o[d(482)](de,d(1600),{message:w[d(1375)],code:Fe[d(872)+"OR"],error:w});this[d(524)+d(1223)+d(1764)](b)}},this[n(1e3)+"ge"]=async p=>{let d=n,w={TTXhT:function(N,L){return o[D(1748)](N,L)},vtqDT:d(404),RtvCZ:o[d(1136)],pybJm:o[d(1124)],ZGXxf:o[d(747)],aRvwk:function(N,L,A){return o[d(482)](N,L,A)}},{pingInterval:b,pingFrequency:k}=this._options;if((p[d(903)]==="hi"&&o.dEYRN(o[d(588)],k)||o[d(1379)]===k)&&(this[d(1364)+d(912)](),this[d(1060)](d(868)+d(349)+"s",o[d(1285)]),this["_pingPon"+d(1746)+"Id"]=setTimeout(this[d(616)][d(753)](this),b)),p[d(903)]!=="hi")try{if(o[d(473)](o[d(1442)],o[d(1120)]))o[d(1061)](ds,this,p,[c0,a0,A0,D0,k0,x0]);else{this._clearPingTimer(),this[d(1288)+d(1746)+"Id"]=w[d(1075)](_0x20b10e,this[d(616)][d(753)](this),this[d(1665)]["pingInte"+d(1721)]);let N=()=>{let A=d;w.TTXhT(_0x566700,w[A(720)]),this[A(1056)](w.RtvCZ,N),this[A(1056)](w[A(1716)],L)},L=()=>{let A=d;w.TTXhT(_0x6ffff7,w[A(1029)]),this[A(1056)](w[A(1765)],N),this[A(1056)](w[A(1716)],L)};this.on(w[d(1765)],N),this.on("ping_onc"+d(1542)+"t",L),this[d(616)]()}}catch(N){let L=o.xCFSI(de,o[d(1069)],{message:N[d(1375)],code:Fe[d(971)+"ERROR"],error:N});this["_dispatc"+d(1223)+d(1764)](L)}},this[n(628)]=p=>{let d=n,w=this[d(1132)+d(1330)]?.[d(922)+"chMaxTries"](),b=this[d(1132)+d(1330)]?.[d(358)+d(1368)+"nt"]();if(w&&!p.message){let k=d(373)+b+(d(827)+d(1574)+"es reached");this[d(524)+d(1223)+d(1764)](o.NpEhX(de,d(1600),{message:k,code:Fe[d(1092)+"IES_ERROR"],error:p}));return}this[d(1398)]&&this[d(1398)][d(1573)+"te"]===this.OPEN&&this["_disconn"+d(653)](),this[d(524)+"hErrorEvent"](o.kIdNT(de,o[d(1069)],{message:p[d(1375)],code:Fe[d(867)+"RROR"],error:p}))},this[n(571)]=async p=>{let d=n;this[d(335)+"mer"](),this["_clearPi"+d(912)](),this[d(639)+d(1444)+"rs"](),this[d(1398)]=null,this[d(1625)+d(492)]=!1;let w=this[d(1132)+"tManager"]?.[d(922)+"chMaxTries"]();if(!w&&this["_navigat"+d(1757)]()&&!this["_readyCl"+d(1093)]){let b=this[d(1132)+d(1330)]?.["getCurre"+d(1368)+"nt"](),k=this[d(1665)][d(1458)+d(768)+d(641)](p.code,p[d(623)]);this[d(524)+"hCloseEv"+d(1764)](_e(d(833),{code:1006,reason:p[d(623)]||"connecti"+d(1252)+"d, unkno"+d(565)+d(1280)+d(1134)+b,willReconnect:k})),k&&this[d(1625)]();return}if(e.HgZDS(1e3,p[d(331)])&&this[d(1070)+"osed"]){this[d(524)+d(501)+d(1764)](_e(e[d(649)],{code:1e3,reason:e[d(1206)]})),this._endpointManager?.[d(569)+d(920)+d(1693)](),this._pingLossCounter?.[d(1760)+d(949)]();return}if(p[d(331)]!==1e3&&w){let b=this[d(1132)+"tManager"]?.[d(358)+"ntEndpoint"](),k=p[d(623)];k||(k=await e.WbBKA(t0,this._url)),k="connecti"+d(1252)+d(1439)+k+(d(1736)+d(778))+b+(d(850)+d(1400)+d(996)),this[d(524)+"hCloseEv"+d(1764)](_e(e[d(649)],{code:p[d(331)],reason:k}));let N=d(373)+b+(" fail, m"+d(1574)+"es reached");this[d(524)+d(1223)+d(1764)](e[d(1448)](de,d(1600),{message:N,code:Fe[d(1092)+d(946)+"R"]})),this[d(1132)+d(1330)]?.[d(569)+d(920)+d(1693)](),this[d(364)+d(1836)]?.[d(1760)+d(949)]();return}if(p[d(331)]!==1e3&&!p.reason)if(e.vEEhC(e[d(1034)],e[d(1034)])){let b=this["_endpoin"+d(1330)]?.[d(358)+d(1368)+"nt"]();this[d(524)+d(501)+d(1764)](_e(e[d(649)],{code:p[d(331)],reason:d(1777)+d(1252)+d(1316)+"wn reaso"+d(1280)+d(1134)+b})),this[d(1132)+d(1330)]?.[d(569)+d(920)+d(1693)](),this["_pingLos"+d(1836)]?.resetCounter();return}else{let b=o[d(1555)](_0x513b96,o[d(1069)],{message:_0x330a31[d(1375)],code:_0x34a3f9[d(872)+"OR"],error:_0x122020});this[d(524)+d(1223)+"ent"](b)}this["_dispatc"+d(501)+d(1764)](p),this[d(1132)+"tManager"]?.[d(569)+"pointConfig"](),this[d(364)+d(1836)]?.[d(1760)+"nter"]()},this.onclose=null,this[n(1396)]=null,this[n(1277)+"e"]=null,this[n(1453)]=null,this["onStartR"+n(1045)]=null,this[n(1171)+"eAck"]=null,this["onStopIm"+n(1680)+n(1678)+"ct"]=null,this[n(1597)+"nLine"]=this[n(1597)+n(472)][n(753)](this),this[n(1597)+"ffLine"]=this["_handleO"+n(1769)][n(753)](this),this[n(925)+n(1835)]=this[n(925)+n(1835)].bind(this),this["_handleP"+n(527)]=this[n(925)+n(527)][n(753)](this),this[n(1665)]={url:"",automaticOpen:!0,initReconnectInterval:1e3,maxReconnectInterval:1e4,reconnectIntervalGrowFactor:2,timeoutInterval:5e3,maxRetries:5,debug:!1,maxMessageQueueLength: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:e[n(1145)],pingLossCount:2,enableTransformTextPayload:!1,logIDNewConfig:{enableAutoGenerateLogIDNew:!1,userIp:""},miniProgramParams:{customHttpHeader:{}},enableAutoAck:!1,reconnectInterceptor:()=>!0,enableQoS:!1,QoSLevel:2,messageStrategy:n(1418),env:{xTTEnv:"",xUseEnv:""},listenNetworkChanged:!0};let{url:c,ws:l}=t,h=Array[n(1566)](c)?c:e[n(606)]==typeof c?[c]:[];if(!h||h.length===0)throw new Error(e[n(1164)]);if(!e[n(396)](Zo,l))throw new Error(e.sgrYf);Object[n(339)](this[n(1665)],t),this[n(1132)+n(1330)]=new us(h,this[n(1665)][n(1714)+"es"]),this[n(364)+n(1836)]=new e0(this._options[n(1339)+n(1036)]),this[n(1665)][n(489)+"cOpen"]&&(this[n(875)]=!0,this._connect()),this[n(1665)][n(1640)+"tworkCha"+n(1278)]&&(this[n(1436)+"T"]||this[n(1761)+"X"]?this[n(658)+n(343)+"ange"]():this._isBrowser&&this[n(1634)+n(1307)+"Listener"]())}["_handleO"+r(472)](){let t=r,n={sZPBc:function(o,c,l){return e[D(1328)](o,c,l)}};if(e.GgwlN(e.GNTmy,e[t(1457)]))UqYTXm[t(783)](_0x1ee79c,_0x529e9b,58),_0x2937dd(_0x51fbd3,_0x77507c);else{if(this._options[t(937)+"utoReconnect"]||this[t(1070)+t(1093)])return;this[t(722)+"econnect"]()}}[r(1597)+r(1769)](){let t=r;this[t(906)+t(1446)+"t"]();let n=e.CXgFm(Qn,"reconnect",{message:e.HHpkM});this[t(577)+t(1680)+"yReconnect"]&&this[t(577)+"mediatel"+t(1678)+"ct"](n)}[r(1634)+r(1307)+"Listener"](){let t=r;this._isBrowser&&window[t(719)+t(1382)](e[t(689)],this[t(1597)+t(472)]),this[t(1502)+"er"]&&window[t(719)+t(1382)](e[t(636)],this[t(1597)+t(1769)]),this[t(1502)+"er"]&&window["addEvent"+t(1382)](e[t(745)],this["_handleP"+t(1835)]),this[t(1502)+"er"]&&window["addEvent"+t(1382)](e[t(1403)],this[t(925)+"ageShow"])}[r(1394)+r(1307)+"Listener"](){let t=r;this[t(1502)+"er"]&&window[t(1072)+t(826)+t(1083)](e[t(689)],this[t(1597)+"nLine"]),this[t(1502)+"er"]&&window[t(1072)+"entListe"+t(1083)](e[t(636)],this[t(1597)+t(1769)]),this[t(1502)+"er"]&&window[t(1072)+t(826)+t(1083)](t(1676),this[t(925)+t(1835)]),this[t(1502)+"er"]&&window["removeEventListe"+t(1083)](e[t(1403)],this[t(925)+"ageShow"])}[r(925)+"ageHide"](t){let n=r;!t[n(882)+"d"]&&(e[n(1552)](e.XBKbT,e[n(938)])?(this._isBrowser&&window[n(1072)+n(826)+n(1083)]("pagehide",this[n(925)+n(1835)]),this[n(1502)+"er"]&&window[n(1072)+n(826)+n(1083)](n(1594),this[n(925)+n(527)]),this[n(833)]()):(_0x57d556=_0x841352&&e[n(1775)]==_0x14dff1[n(1804)]?e.CAVUD:e.wHAfR,_0x21b578=_0xdab78e[n(1282)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),_0x53ced0=/^wss(.*:\/\/)/[n(1691)](_0x127cce)?_0x407c6e:""+_0x4df08b+_0x579c47)),this[n(1502)+"er"]&&window[n(1072)+n(826)+n(1083)](e[n(689)],this[n(1597)+n(472)]),this[n(1502)+"er"]&&window[n(1072)+n(826)+"ner"](e[n(636)],this[n(1597)+n(1769)])}_handlePageShow(t){let n=r;t.persisted&&(this[n(549)+n(1757)]()&&(!this[n(1398)]||this[n(1398)][n(1573)+"te"]!==this[n(913)]||e[n(1715)](this._ws[n(1573)+"te"],this[n(1153)+"NG"]))&&this["_handleO"+n(472)](),this[n(1502)+"er"]&&window[n(719)+n(1382)](e[n(689)],this[n(1597)+n(472)]),this._isBrowser&&window[n(719)+"Listener"](e[n(636)],this[n(1597)+"ffLine"]))}async[r(1207)+r(1773)](t){let n=r,{fpID:o,deviceID:c,bddID:l,ttwID:h,accessKey:p,aID:d,customParams:w={},enableAutoAck:b,enableQoS:k,QoSLevel:N,env:L}=this[n(1665)],A,M,B;this[n(1502)+"er"]||this[n(1761)+"X"]||this._isMiniTT?(A=location&&e[n(1306)](e[n(1775)],location.protocol)?n(1646):e[n(1310)],M=t[n(1282)](/((^ws)|(^http))((?:[s]*:\/\/))/,""),B=/^wss(.*:\/\/)/[n(1691)](t)?t:""+A+M):(A=e.CAVUD,M=t[n(1282)](/(^http)((?:[s]*:\/\/))/,""),B=/(^ws)((?:[s]*:\/\/))/.test(M)?M:""+A+M);let j=l?n(718):h?e[n(1033)]:n(1635)+"d",le=l||h||c;if(!le||!j)throw new Error(e[n(767)]);let Se=e.BlHnh("function",typeof w)?await w():w,ar=L?e[n(1202)](Qo,L.xUseEnv,L[n(617)]):{},Et=Object[n(339)]({device_platform:e[n(1507)],version_code:e[n(1194)],access_key:p,fpid:o,aid:d,[j]:le,xsack:b?1:0,xaack:b?1:0,xsqos:k?1:0,qos_level:k?N:void 0,qos_sdk_version:2,...ar},Se),Ht=Object[n(1456)](Et).reduce((kt,At)=>Et[At]!==void 0?""+kt+(kt?"&":"?")+At+"="+Et[At]:kt,"");return B+n(1650)+Ht}async[r(1625)](){let t=r,n={hbqKX:function(o,c){return e[D(504)](o,c)}};if(e[t(1233)](e[t(1388)],t(1785))){if(this[t(1625)+t(492)]||this[t(1070)+t(1093)])return;this["_connect"+t(492)]=!0;try{if(e.fuWqF(e[t(684)],e[t(992)]))_0x5441dc[t(1239)](_0x416fb2);else{let o=this[t(1132)+t(1330)]?.[t(508)+t(1315)+t(361)+"hedMaxRetries"](),{timeoutInterval:c}=this[t(1665)];if(o){let h=this[t(1132)+t(1330)]?.[t(358)+t(1368)+"nt"](),p=this[t(1132)+t(1330)]?.[t(836)+"ackupEnd"+t(1809)+t(1580)+t(1015)](),d=this[t(1132)+t(1330)]?.[t(358)+t(1368)+t(1601)+t(1723)]();if(p){let w=t(373)+h+(t(551)+t(850)+t(1400)+t(900)+t(1570)+t(539)+t(1590))+p+(t(1707)+"y"),b=e[t(1675)](de,e[t(1437)],{message:w,code:Fe[t(1092)+t(946)+"R"]});this[t(455)](w),this[t(524)+t(1223)+t(1764)](b),this._url=await this[t(1207)+t(1773)](p),this._debug(t(373)+p+" "+d+" times"),this[t(639)+t(1444)+"rs"]()}else{let w=t(373)+h+(t(551)+t(850)+t(1400)+t(996));this._debug(w),this[t(524)+t(1223)+t(1764)](e[t(453)](de,t(1600),{message:w,code:Fe[t(1092)+t(946)+"R"]}));return}}else{let h=this[t(1132)+t(1330)]?.[t(358)+"ntEndpointAndUpdateCount"](),p=this._endpointManager?.[t(358)+t(1368)+t(1601)+"ount"]();this[t(1755)]=await this[t(1207)+t(1773)](e.AmOCf(h,"")),this[t(455)](t(373)+h+" "+p+t(464)),this[t(639)+"sListeners"]()}if(this[t(875)])this._isInit=!1;else{let h=Qn(e[t(548)],{message:t(1345)});this[t(423)+t(1045)]&&this[t(423)+t(1045)](h)}let l=this[t(1132)+t(1330)]?.["getCurre"+t(1368)+t(1601)+t(1723)]()||0;e[t(779)](l,1)&&await this._wait(e[t(388)](l,1)),this._debug(t(1777)+t(958)+this[t(1755)]+(t(876)+t(873))+this[t(1293)+"ls"]),this[t(1398)]=e[t(1213)](Xo,{url:this[t(1755)],protocols:[this[t(1293)+"ls"]],headers:this[t(1665)][t(1487)+t(1649)+"s"][t(346)+t(1222)]},this[t(1665)].ws),(this[t(1502)+"er"]||this._isWorker)&&this[t(1398)]&&(this[t(1398)][t(1198)+"pe"]=this[t(334)+t(1271)]),this["_addWsLi"+t(1086)](),this[t(1625)+t(1380)+t(1681)]=setTimeout(this[t(547)+"ut"][t(753)](this),c)}}catch(o){if(e[t(794)](e[t(1304)],t(345)))return _0xc9ffcc[_0x50f0aa]=_0x5b7068,!0;throw this[t(1625)+t(492)]=!1,o}}else{if(_0x50d2fd)return new _0x3be1d1(_0x1da702[t(780)],_0x23cbda.protocol);if(_0x1a9b78||_0x57f8b5)return new _0x1cbb2c(_0x40667b[t(780)],_0xb234ba[t(1804)],_0x96597a[t(602)]);if(mzumaJ[t(432)](_0x5a28e6,_0x2e0b30)&&t(1147)+"d"!=typeof _0x45cd41&&_0x15bcb6)return new _0x53ce3c(_0x27c72d[t(780)],_0x21280f[t(1804)+"s"])}}[r(335)+r(1163)](){let t=r;clearTimeout(this["_connect"+t(1380)+t(1681)]),this[t(1625)+t(1380)+t(1681)]=null}["_clearPi"+r(912)](){let t=r;if(t(439)!==e[t(1659)])e[t(570)](clearTimeout,this["_pingPon"+t(1746)+"Id"]),e[t(1455)](clearTimeout,this["_reconne"+t(471)+"tId"]),this["_pingPon"+t(1746)+"Id"]=null,this[t(1494)+"ctTimeoutId"]=null;else return t(448)+"_"+this._DBName}[r(455)](...t){let n=r;this[n(1665)][n(598)]&&console.log[n(1295)](console,[e[n(1359)],...t])}[r(1516)+"rvalValue"](t){let n=r,{initReconnectInterval:o,maxReconnectInterval:c,reconnectIntervalGrowFactor:l}=this[n(1665)],h=e[n(704)](o,Math[n(359)](l,t-1));return e[n(736)](h,c)?c:h}[r(616)](){let t=r;if(this[t(1398)]&&e[t(952)](this._ws.readyState,this.CONNECTING)){this[t(1364)+t(912)](),this[t(1288)+t(1746)+"Id"]=e[t(691)](setTimeout,this._ping[t(753)](this),this[t(1665)][t(1049)+"rval"]);return}if(!this[t(1398)]||e[t(1401)](this._ws[t(1573)+"te"],this.OPEN))return void this[t(722)+t(1045)]();this[t(1398)]&&this[t(1398)][t(1687)]("hi"),this[t(1494)+t(471)+t(713)]=e[t(1832)](setTimeout,this["_handleR"+t(1045)+t(479)][t(753)](this),this[t(1665)]["pingTime"+t(393)+t(950)])}[r(722)+"econnect"+r(479)](){let t=r;this[t(364)+t(1836)]?.[t(1776)](),this.emit(e[t(526)],e[t(1292)]),this[t(364)+t(1836)]?.[t(922)+t(1798)+"nt"]()?this[t(722)+t(1045)]():this[t(616)]()}[r(549)+r(1757)](){let t=r;return this[t(1436)+"T"]||this[t(1761)+"X"]?this[t(1063)+t(572)+t(1778)]:(this[t(1502)+"er"]||this[t(1637)+"r"])&&this._options[t(1640)+t(1326)+t(1278)]?navigator.onLine:!0}[r(722)+r(1045)](){let t=r;!this[t(549)+t(1757)]()||this["_readyCl"+t(1093)]||(this[t(1132)+t(1330)]?.["resetEnd"+t(920)+t(1693)](),this[t(364)+t(1836)]?.[t(1760)+"nter"](),this[t(1398)]?this[t(1749)+"ect"](1001,t(1040)+t(1055)+"reconnec"+t(394)+"ver",!0):this[t(1625)]())}[r(658)+r(343)+r(1002)](){let t=r;this[t(1436)+"T"]?tt[t(1655)+t(1361)+t(585)](({isConnected:n})=>{let o=t;if(e[o(1505)](e.QsOgI,e[o(1331)]))this[o(1063)+"igatorOnline"]=n,n?this[o(1597)+"nLine"]():this["_handleO"+o(1769)]();else return _0x3a4ef5.objectStoreNames||_0x3791ee.get(_0x5464b9)}):this[t(1761)+"X"]&&wx[t(1655)+t(1361)+"hange"](({isConnected:n})=>{let o=t;this[o(1063)+o(572)+o(1778)]=n,n?this[o(1597)+"nLine"]():this._handleOffLine()})}[r(1737)](t){let n=r;if(e[n(372)](e[n(717)],e[n(717)]))return new Promise(o=>{let c=n;e[c(901)](e[c(948)],"mGUol")?e[c(579)](setTimeout,o,this[c(1516)+c(1725)+"e"](t)):_0x2e2cfd.body["appendCh"+c(1073)](_0x10b108)});this[n(1232)+n(1086)]()}[r(1749)+r(653)](t=1e3,n="",o=!1){let c=r;this[c(1398)]&&this[c(906)+"WebSocket"](t,n,o)}[r(547)+"ut"](){let t=r,n=this[t(1132)+t(1330)]?.[t(358)+"ntEndpoint"]();this[t(455)](t(373)+n+t(551)),this[t(1749)+"ect"](1001,e[t(716)],!0)}_sendAck(t){let n=r;if(e[n(796)](e[n(1435)],"AnzAJ")){let o=e.yaLpp($n,t);this[n(1398)]&&this[n(1398)][n(1573)+"te"]===this[n(913)]&&(this._ws&&this._ws[n(1687)](o),this._debug(n(422),t))}else return _0x2612bf?this.toBytesLE():this.toBytesBE()}["_removeW"+r(1444)+"rs"](){let t=r,n={GkhbG:function(o,c){return e[D(583)](o,c)}};if(e[t(1369)]===e[t(1308)])return _0x48fe8d(NlKQLt[t(1587)](_0x31e2cd,_0x3c0f67));{let o=e[t(533)].split("|"),c=0;for(;;){switch(o[c++]){case"0":if(!this[t(1398)])return;continue;case"1":this[t(1398)][t(1072)+t(826)+t(1083)](e[t(1077)],this[t(1082)]);continue;case"2":this[t(1398)][t(1072)+t(826)+t(1083)](e[t(1437)],this[t(628)]);continue;case"3":this[t(1398)][t(1072)+t(826)+t(1083)](e[t(649)],this[t(571)]);continue;case"4":this._ws[t(1072)+"entListener"](e[t(1614)],this._onMessage);continue}break}}}["_addWsLi"+r(1086)](){let t=r;this[t(1398)]&&(this._ws.addEventListener("open",this[t(1082)]),this._ws[t(719)+t(1382)](e[t(649)],this[t(571)]),this._ws[t(719)+t(1382)](t(1375),this[t(1e3)+"ge"]),this[t(1398)][t(719)+"Listener"](t(1600),this[t(628)]))}[r(1107)+r(1122)](t=1e3,n=""){let o=r;try{this[o(1398)]&&this[o(1398)][o(833)](t,n)}catch{}}["_destroy"+r(1446)+"t"](t=1e3,n="",o=!1){let c=r,l={Yevbq:function(h,p){return h(p)},qVvfs:function(h,p){return e[D(1360)](h,p)}};if(this[c(1364)+c(912)](),this[c(335)+"mer"](),this[c(639)+c(1444)+"rs"](),this["_wsInsta"+c(1122)](1e3,n),this[c(1625)+"Lock"]=!1,o&&this[c(549)+c(1757)]()&&!this[c(1070)+c(1093)]){if(this[c(1132)+"tManager"]?.[c(922)+c(1322)+"es"]()){let p=this[c(1132)+"tManager"]?.[c(358)+"ntEndpoint"]();this[c(524)+c(501)+c(1764)](e[c(1592)](_e,e[c(649)],{code:1006,reason:"connect "+p+(c(551)+c(850)+c(1400)+c(996)),wasClean:!0}))}else if(e[c(338)](e[c(1101)],e[c(1101)])){let p=this[c(1665)][c(1458)+c(768)+"ptor"](t,n);this[c(524)+"hCloseEv"+c(1764)](e.dhuGJ(_e,e.SHqrb,{code:t,reason:n,wasClean:!0,willReconnect:p})),p&&this[c(1625)]()}else{let p=yndzmJ[c(1496)](_0x446344,_0xf95d4e),d=_0x383c41[c(734)];return _0x46b28f[c(734)]=yndzmJ.qVvfs(_0x5be52b[c(1727)],p),d}return}this[c(549)+"orOnline"]()||this[c(1070)+c(1093)]?this["_dispatchCloseEv"+c(1764)](_e(e[c(649)],{code:t,reason:e.uqGrJ})):this["_dispatc"+c(501)+c(1764)](e[c(568)](_e,e[c(649)],{code:1006,reason:c(1040)+"ay, netw"+c(855)+"ine"})),this[c(1398)]=null,this[c(1132)+c(1330)]?.["resetEnd"+c(920)+"fig"](),this[c(364)+c(1836)]?.resetCounter()}[r(524)+r(814)+"nt"](t){let n=r;this.emit(n(1806),t),this.onopen&&this[n(1453)](t)}[r(524)+r(1756)+"Event"](t){let n=r;this[n(1060)](e.OdtFP,t),this[n(1277)+"e"]&&this[n(1277)+"e"](t)}["_dispatc"+r(1270)+r(993)](t){let n=r;this[n(1060)](e[n(1726)],t),this[n(1171)+n(791)]&&this[n(1171)+n(791)](t)}["_dispatc"+r(1223)+"ent"](t){let n=r;this.emit(e[n(1437)],t),this.onerror&&this[n(1396)](t)}[r(524)+r(501)+"ent"](t){let n=r;this[n(1060)](e[n(649)],t),this[n(916)]&&this[n(916)](t)}get[r(1198)+"pe"](){let t=r;return this[t(1398)]?this._ws[t(1198)+"pe"]:this[t(334)+t(1271)]}set[r(1198)+"pe"](t){let n=r;this._binaryType=t,this[n(1398)]&&(this[n(1398)][n(1198)+"pe"]=t)}get[r(795)+"nt"](){let t=r;return this[t(1132)+t(1330)]?.[t(358)+"ntEndpoi"+t(1601)+t(1723)]()||0}get bufferedAmount(){let t=r;if(e.IrRVT(e[t(725)],e[t(1096)])){let n=_0x4b9e4c.split(":");for(let o=0;e.ylpcV(o,n.length);o++){let c=n[o];if(n[o][t(1759)]!==4){let l=_0x139558.substring(0,e.BHseK(4,n[o][t(1759)])),h=l[t(1160)](c);_0x450be7=_0x38eece[t(1160)](h)}else _0x437f7b=_0x2e8d2d.concat(c)}return _0x1872d2}else{let n=this[t(1226)+t(892)].reduce((o,c)=>(o+=c&&c[t(772)+"th"]||0,o),0);return e[t(1384)](n,this[t(1398)]?this[t(1398)][t(1839)+t(1309)]:0)}}get extensions(){let t=r;return this[t(1398)]?this._ws[t(1549)+"ns"]:""}get[r(1804)](){let t=r,n={rakjz:t(1154),tfiSK:e[t(1524)],arxBK:function(o,c){return e.TlDxf(o,c)},BusvD:e[t(1632)]};if(e[t(1689)](e[t(985)],"kskVp")){let{SeqID:o,LogID:c,service:l,LogIDNew:h,method:p}=_0x40ccd4[t(1375)];this[t(462)]({SeqID:o,LogID:c,LogIDNew:h,service:l,method:p,headers:[{key:GoaIRc[t(1466)],value:"1"},{key:GoaIRc[t(429)],value:GoaIRc[t(531)](h,"")},{key:GoaIRc[t(1201)],value:"0"}]})}else return this[t(1398)]?this[t(1398)][t(1804)]:""}get[r(1573)+"te"](){let t=r;return this[t(1398)]?this[t(1398)][t(1573)+"te"]:this[t(1665)][t(489)+t(731)]?this[t(1153)+"NG"]:this[t(1067)]}get[r(780)](){let t=r;return this._ws?this._ws[t(780)]:this[t(1755)]}[r(833)](t=1e3,n){let o=r;if(e[o(562)](e.FaomK,o(1413))){let c=e[o(1789)][o(1700)]("|"),l=0;for(;;){switch(c[l++]){case"0":this[o(1394)+o(1307)+o(1382)]();continue;case"1":if(!this._ws)return void this._debug(e[o(965)]);continue;case"2":this._QoSManager?.closeDB();continue;case"3":if(e[o(930)](this[o(1398)][o(1573)+"te"],this.CLOSED)||e[o(1731)](this._ws.readyState,this[o(1144)]))return void this[o(455)](e[o(802)]);continue;case"4":this[o(335)+o(1163)]();continue;case"5":this[o(906)+o(1446)+"t"](t,n);continue;case"6":this[o(1070)+o(1093)]=!0;continue;case"7":this["_clearPi"+o(912)]();continue}break}}else{let c={Pxydi:e[o(1437)],HcTkM:function(h,p,d){return e[o(804)](h,p,d)}},l=_0x3331f4[o(1735)][o(620)](_0x17ac89[o(752)+"et"],e.ZJpBb(_0x3bf8bd[o(772)+"th"],_0x11bf6b[o(752)+"et"]));this[o(633)]&&this[o(633)][o(1687)]({data:l,fail:h=>{let p=o;this[p(1060)](c[p(1053)],c[p(1543)](_0x16ca6b,c[p(1053)],{message:this[p(1526)+p(597)+p(1460)](h)}))}})}}async[r(1687)](t,n){let o=r;if(e[o(695)](null,t))throw new Error(e[o(412)]);e[o(944)](e.rfFoD,typeof t)&&(t=JSON.stringify(t)),e[o(1142)](e[o(606)],typeof t)&&!e[o(405)](t,ArrayBuffer)&&!(t.buffer&&e[o(405)](t[o(1735)],ArrayBuffer))&&(t=JSON.stringify(t));let c=await gs(t),l=e.XvBFs($o,t),{method:h=0,service:p=this._options[o(1265)],logID:d=this[o(1665)][o(436)+o(805)](),headers:w=this[o(1665)][o(602)],payloadEncoding:b=this._options[o(1027)+"ncoding"],payloadType:k=this[o(1665)][o(1473)+o(1271)],logIDNew:N=this[o(1665)][o(1537)+"Config"][o(1011)+"toGenera"+o(333)+"ew"]?a(this._options["logIDNew"+o(1420)][o(1648)]):""}=e[o(1662)](n,{});if(!p)throw new Error(e.cgUyE);let L={SeqID:z[o(1098)+"er"](this[o(1362)]++),LogID:z.fromNumber(d),service:p,method:h,headers:w,payloadEncoding:e.vHSkL(b,Object)?b.encoding?b[o(1097)]:"":b,payloadType:e[o(1229)](k,Object)?k[o(1497)]?k[o(1497)]:l:k||l,payload:c,LogIDNew:N},A=$n(L);return this[o(1398)]&&e.lLmgl(this._ws[o(1573)+"te"],this[o(913)])?(this[o(1398)]&&this[o(1398)][o(1687)](A),this[o(455)](e[o(1828)],L)):e.BNqIA(this[o(1226)+"Queue"][o(1759)],this[o(1665)][o(424)+o(1474)+o(1275)])?(this[o(1226)+o(892)][o(751)](A),this._debug(o(1794),L)):(this[o(1226)+o(892)].shift(),this[o(1226)+o(892)][o(751)](A)),{seqID:this[o(1362)],logID:d,logIDNew:N}}async reconnect(t){let n=r,{url:o}=e[n(1686)](t,{}),c=Array[n(1566)](o)?o:e[n(695)](e[n(606)],typeof o)?[o]:[];t&&Object[n(339)](this[n(1665)],t),c&&c[n(1759)]?this[n(1132)+"tManager"]=new us(c,this[n(1665)].maxRetries):this[n(1132)+n(1330)]?.["resetEndpointCon"+n(1693)](),this[n(364)+"sCounter"]?.["resetCou"+n(949)](this[n(1665)][n(1339)+"Count"]),this["_readyCl"+n(1093)]=!1,this._ws&&e[n(1233)](this[n(1398)][n(1573)+"te"],this[n(1067)])?this[n(1749)+n(653)](1e3,e[n(1791)],!0):(this[n(875)]=!0,this[n(1625)]())}async[r(1373)](){let t=r,n={VxeOF:function(o,c,l){return e[D(356)](o,c,l)},ObozI:"ping_onc"+t(349)+"s",idSsZ:e.Mvtkb};if(!this["_connect"+t(492)])if(t(884)===e.TfrYu){let o={HTlJI:function(c,l){return c(l)},iYqgO:n[t(800)],Azsvf:n[t(1421)]};return new _0xbd8bd((c,l)=>{let h=t;this[h(1364)+h(912)](),this[h(1288)+h(1746)+"Id"]=n[h(1051)](_0xca1ca8,this[h(616)].bind(this),this[h(1665)][h(1049)+"rval"]);let p=()=>{let w=h;o[w(1289)](c,w(404)),this[w(1056)](o[w(1503)],p),this[w(1056)](o[w(1417)],d)},d=()=>{let w=h;o[w(1289)](l,w(631)),this.off(o.iYqgO,p),this[w(1056)]("ping_onc"+w(1542)+"t",d)};this.on(n[h(800)],p),this.on(h(868)+h(1542)+"t",d),this[h(616)]()})}else{let o=e[t(619)][t(1700)]("|"),c=0;for(;;){switch(o[c++]){case"0":this[t(364)+"sCounter"]?.[t(1760)+t(949)]();continue;case"1":this["_endpoin"+t(1330)]?.resetEndpointConfig();continue;case"2":this._connect();continue;case"3":this[t(1070)+t(1093)]=!1;continue;case"4":this[t(875)]=!0;continue}break}}}[r(719)+"Listener"](t,n){this.on(t,n)}["dispatch"+r(1673)](t){let n=r,{type:o}=t;this[n(1060)](o,t)}[r(1072)+r(826)+r(1083)](t,n){this.off(t,n)}[r(618)](){let t=r,n={LIdRf:function(o,c){return e[D(1103)](o,c)},IjSfM:e.Rkxlk,FSQNI:t(868)+"e_timeout",SATTS:e[t(1354)],nckGw:e.okVPA,BNFDS:t(868)+"e_success",LVtSN:function(o,c,l){return e.vgqOZ(o,c,l)}};return new Promise((o,c)=>{let l=t,h={DFfQb:function(w,b){return w(b)},BEYBj:n[l(1227)],mopZi:function(w,b){return n[l(387)](w,b)},THRyk:n[l(1129)],pGmzJ:n[l(458)],cGFEf:n[l(1287)]};this["_clearPi"+l(912)](),this._pingPongTimeoutId=n.LVtSN(setTimeout,this[l(616)].bind(this),this[l(1665)][l(1049)+l(1721)]);let p=()=>{let w=l;h[w(626)]!==h[w(626)]?(_0x478874+=CvEcIn[w(513)](_0x587c8c,_0x12d025),_0xc382f4+=2):(h[w(442)](o,h[w(1372)]),this[w(1056)](h[w(1365)],p),this[w(1056)](h[w(450)],d))},d=()=>{let w=l;n[w(387)](c,n[w(973)]),this[w(1056)]("ping_once_success",p),this[w(1056)](n[w(1287)],d)};this.on(n.BNFDS,p),this.on(n[l(1287)],d),this._ping()})}}})(),Q.CustomCloseEvent=$[S(982)+S(553)],Q[S(1318)+"rorEvent"]=$["CustomEr"+S(1628)],Q[S(1221)+"e"]=$.ErrorCode,Q[S(1673)]=$[S(1673)],Q.FWS=$[S(1336)],Q[S(456)+S(413)+S(368)]=$[S(456)+S(413)+S(368)],Q[S(413)+S(368)]=$["MessageE"+S(368)],Q[S(865)+"t"]=$[S(865)+"t"],Q["Reconnec"+S(891)]=$[S(1813)+"tEvent"],Q[S(1583)+S(553)]=$[S(1583)+"oseEvent"],Q[S(1529)+S(1628)]=$["createEr"+S(1628)],Q[S(809)+S(1561)+"nt"]=$[S(809)+S(1561)+"nt"],Q[S(1619)+S(1469)]=$[S(1619)+S(1469)],Q[S(788)+S(951)+"vent"]=$["createRe"+S(951)+S(368)],Q[S(860)+S(1253)]=$[S(860)+S(1253)],Q["encodeFr"+S(1211)]=$[S(789)+S(1211)];for(_n in $)[S(982)+S(553),S(1318)+S(1628),"ErrorCode",S(1673),S(1336),S(456)+"MessageE"+S(368),S(413)+S(368),S(865)+"t",S(1813)+"tEvent",S(1583)+S(553),S(1529)+S(1628),S(809)+S(1561)+"nt",S(1619)+S(1469),S(788)+"connectE"+S(368),S(860)+S(1253),S(789)+S(1211)].indexOf(_n)===-1&&(Q[_n]=$[_n]);var _n;Object["definePr"+S(1754)](Q,S(1042)+"le",{value:!0})});var Re=ae((Xd,fi)=>{"use strict";var xi=["nodebuffer","arraybuffer","fragments"],ci=typeof Blob<"u";ci&&xi.push("blob");fi.exports={BINARY_TYPES:xi,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:ci,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Nt=ae((Zd,En)=>{"use strict";var{EMPTY_BUFFER:gx}=Re(),mr=Buffer[Symbol.species];function px(r,e){if(r.length===0)return gx;if(r.length===1)return r[0];let i=Buffer.allocUnsafe(e),a=0;for(let x=0;x<r.length;x++){let f=r[x];i.set(f,a),a+=f.length}return a<e?new mr(i.buffer,i.byteOffset,a):i}function ui(r,e,i,a,x){for(let f=0;f<x;f++)i[a+f]=r[f]^e[f&3]}function di(r,e){for(let i=0;i<r.length;i++)r[i]^=e[i&3]}function mx(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function _r(r){if(_r.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new mr(r):ArrayBuffer.isView(r)?e=new mr(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),_r.readOnly=!1),e}En.exports={concat:px,mask:ui,toArrayBuffer:mx,toBuffer:_r,unmask:di};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Z("bufferutil");En.exports.mask=function(e,i,a,x,f){f<48?ui(e,i,a,x,f):r.mask(e,i,a,x,f)},En.exports.unmask=function(e,i){e.length<32?di(e,i):r.unmask(e,i)}}catch{}});var gi=ae(($d,hi)=>{"use strict";var li=Symbol("kDone"),wr=Symbol("kRun"),yr=class{constructor(e){this[li]=()=>{this.pending--,this[wr]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[wr]()}[wr](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[li])}}};hi.exports=yr});var gt=ae((Qd,wi)=>{"use strict";var Rt=Z("zlib"),pi=Nt(),_x=gi(),{kStatusCode:mi}=Re(),yx=Buffer[Symbol.species],vx=Buffer.from([0,0,255,255]),An=Symbol("permessage-deflate"),Oe=Symbol("total-length"),lt=Symbol("callback"),We=Symbol("buffers"),ht=Symbol("error"),kn,vr=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,!kn){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;kn=new _x(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,a=e.find(x=>!(i.serverNoContextTakeover===!1&&x.server_no_context_takeover||x.server_max_window_bits&&(i.serverMaxWindowBits===!1||typeof i.serverMaxWindowBits=="number"&&i.serverMaxWindowBits>x.server_max_window_bits)||typeof i.clientMaxWindowBits=="number"&&!x.client_max_window_bits));if(!a)throw new Error("None of the extension offers can be accepted");return i.serverNoContextTakeover&&(a.server_no_context_takeover=!0),i.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof i.serverMaxWindowBits=="number"&&(a.server_max_window_bits=i.serverMaxWindowBits),typeof i.clientMaxWindowBits=="number"?a.client_max_window_bits=i.clientMaxWindowBits:(a.client_max_window_bits===!0||i.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}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(a=>{let x=i[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 f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${x}`)}else if(a==="server_max_window_bits"){let f=+x;if(!Number.isInteger(f)||f<8||f>15)throw new TypeError(`Invalid value for parameter "${a}": ${x}`);x=f}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}"`);i[a]=x})}),e}decompress(e,i,a){kn.add(x=>{this._decompress(e,i,(f,u)=>{x(),a(f,u)})})}compress(e,i,a){kn.add(x=>{this._compress(e,i,(f,u)=>{x(),a(f,u)})})}_decompress(e,i,a){let x=this._isServer?"client":"server";if(!this._inflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Rt.Z_DEFAULT_WINDOWBITS:this.params[f];this._inflate=Rt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[An]=this,this._inflate[Oe]=0,this._inflate[We]=[],this._inflate.on("error",Sx),this._inflate.on("data",_i)}this._inflate[lt]=a,this._inflate.write(e),i&&this._inflate.write(vx),this._inflate.flush(()=>{let f=this._inflate[ht];if(f){this._inflate.close(),this._inflate=null,a(f);return}let u=pi.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[`${x}_no_context_takeover`]&&this._inflate.reset()),a(null,u)})}_compress(e,i,a){let x=this._isServer?"server":"client";if(!this._deflate){let f=`${x}_max_window_bits`,u=typeof this.params[f]!="number"?Rt.Z_DEFAULT_WINDOWBITS:this.params[f];this._deflate=Rt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Oe]=0,this._deflate[We]=[],this._deflate.on("data",bx)}this._deflate[lt]=a,this._deflate.write(e),this._deflate.flush(Rt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let f=pi.concat(this._deflate[We],this._deflate[Oe]);i&&(f=new yx(f.buffer,f.byteOffset,f.length-4)),this._deflate[lt]=null,this._deflate[Oe]=0,this._deflate[We]=[],i&&this.params[`${x}_no_context_takeover`]&&this._deflate.reset(),a(null,f)})}};wi.exports=vr;function bx(r){this[We].push(r),this[Oe]+=r.length}function _i(r){if(this[Oe]+=r.length,this[An]._maxPayload<1||this[Oe]<=this[An]._maxPayload){this[We].push(r);return}this[ht]=new RangeError("Max payload size exceeded"),this[ht].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ht][mi]=1009,this.removeListener("data",_i),this.reset()}function Sx(r){if(this[An]._inflate=null,this[ht]){this[lt](this[ht]);return}r[mi]=1007,this[lt](r)}});var pt=ae((el,Dn)=>{"use strict";var{isUtf8:yi}=Z("buffer"),{hasBlob:Cx}=Re(),Ex=[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 kx(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function br(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 Ax(r){return Cx&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Dn.exports={isBlob:Ax,isValidStatusCode:kx,isValidUTF8:br,tokenChars:Ex};if(yi)Dn.exports.isValidUTF8=function(r){return r.length<24?br(r):yi(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Z("utf-8-validate");Dn.exports.isValidUTF8=function(e){return e.length<32?br(e):r(e)}}catch{}});var Ar=ae((tl,Ai)=>{"use strict";var{Writable:Dx}=Z("stream"),vi=gt(),{BINARY_TYPES:Tx,EMPTY_BUFFER:bi,kStatusCode:Px,kWebSocket:Ix}=Re(),{concat:Sr,toArrayBuffer:Lx,unmask:Nx}=Nt(),{isValidStatusCode:Rx,isValidUTF8:Si}=pt(),Tn=Buffer[Symbol.species],ge=0,Ci=1,Ei=2,ki=3,Cr=4,Er=5,Pn=6,kr=class extends Dx{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Tx[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[Ix]=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=ge}_write(e,i,a){if(this._opcode===8&&this._state==ge)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 Tn(a.buffer,a.byteOffset+e,a.length-e),new Tn(a.buffer,a.byteOffset,e)}let i=Buffer.allocUnsafe(e);do{let a=this._buffers[0],x=i.length-e;e>=a.length?i.set(this._buffers.shift(),x):(i.set(new Uint8Array(a.buffer,a.byteOffset,e),x),this._buffers[0]=new Tn(a.buffer,a.byteOffset+e,a.length-e)),e-=a.length}while(e>0);return i}startLoop(e){this._loop=!0;do switch(this._state){case ge:this.getInfo(e);break;case Ci:this.getPayloadLength16(e);break;case Ei:this.getPayloadLength64(e);break;case ki:this.getMask();break;case Cr:this.getData(e);break;case Er:case Pn: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 x=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(x);return}let a=(i[0]&64)===64;if(a&&!this._extensions[vi.extensionName]){let x=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(x);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[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=(i[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=Ci:this._payloadLength===127?this._state=Ei: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),a=i.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)+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=ki:this._state=Cr}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Cr}getData(e){let i=bi;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&&Nx(i,this._mask)}if(this._opcode>7){this.controlMessage(i,e);return}if(this._compressed){this._state=Er,this.decompress(i,e);return}i.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(i)),this.dataMessage(e)}decompress(e,i){this._extensions[vi.extensionName].decompress(e,this._fin,(x,f)=>{if(x)return i(x);if(f.length){if(this._messageLength+=f.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(u);return}this._fragments.push(f)}this.dataMessage(i),this._state===ge&&this.startLoop(i)})}dataMessage(e){if(!this._fin){this._state=ge;return}let i=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=Sr(a,i):this._binaryType==="arraybuffer"?x=Lx(Sr(a,i)):this._binaryType==="blob"?x=new Blob(a):x=a,this._allowSynchronousEvents?(this.emit("message",x,!0),this._state=ge):(this._state=Pn,setImmediate(()=>{this.emit("message",x,!0),this._state=ge,this.startLoop(e)}))}else{let x=Sr(a,i);if(!this._skipUTF8Validation&&!Si(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(f);return}this._state===Er||this._allowSynchronousEvents?(this.emit("message",x,!1),this._state=ge):(this._state=Pn,setImmediate(()=>{this.emit("message",x,!1),this._state=ge,this.startLoop(e)}))}}controlMessage(e,i){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,bi),this.end();else{let a=e.readUInt16BE(0);if(!Rx(a)){let f=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(f);return}let x=new Tn(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!Si(x)){let f=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(f);return}this._loop=!1,this.emit("conclude",a,x),this.end()}this._state=ge;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ge):(this._state=Pn,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ge,this.startLoop(i)}))}createError(e,i,a,x,f){this._loop=!1,this._errored=!0;let u=new e(a?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(u,this.createError),u.code=f,u[Px]=x,u}};Ai.exports=kr});var Pr=ae((rl,Pi)=>{"use strict";var{Duplex:nl}=Z("stream"),{randomFillSync:Ox}=Z("crypto"),Di=gt(),{EMPTY_BUFFER:Bx,kWebSocket:Mx,NOOP:zx}=Re(),{isBlob:mt,isValidStatusCode:qx}=pt(),{mask:Ti,toBuffer:Ze}=Nt(),pe=Symbol("kByteLength"),Fx=Buffer.alloc(4),In=8*1024,$e,_t=In,we=0,Ux=1,Kx=2,Dr=class r{constructor(e,i,a){this._extensions=i||{},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=zx,this[Mx]=void 0}static frame(e,i){let a,x=!1,f=2,u=!1;i.mask&&(a=i.maskBuffer||Fx,i.generateMask?i.generateMask(a):(_t===In&&($e===void 0&&($e=Buffer.alloc(In)),Ox($e,0,In),_t=0),a[0]=$e[_t++],a[1]=$e[_t++],a[2]=$e[_t++],a[3]=$e[_t++]),u=(a[0]|a[1]|a[2]|a[3])===0,f=6);let g;typeof e=="string"?(!i.mask||u)&&i[pe]!==void 0?g=i[pe]:(e=Buffer.from(e),g=e.length):(g=e.length,x=i.mask&&i.readOnly&&!u);let m=g;g>=65536?(f+=8,m=127):g>125&&(f+=2,m=126);let _=Buffer.allocUnsafe(x?g+f:f);return _[0]=i.fin?i.opcode|128:i.opcode,i.rsv1&&(_[0]|=64),_[1]=m,m===126?_.writeUInt16BE(g,2):m===127&&(_[2]=_[3]=0,_.writeUIntBE(g,4,6)),i.mask?(_[1]|=128,_[f-4]=a[0],_[f-3]=a[1],_[f-2]=a[2],_[f-1]=a[3],u?[_,e]:x?(Ti(e,a,_,f,g),[_]):(Ti(e,a,e,0,g),[_,e])):[_,e]}close(e,i,a,x){let f;if(e===void 0)f=Bx;else{if(typeof e!="number"||!qx(e))throw new TypeError("First argument must be a valid error code number");if(i===void 0||!i.length)f=Buffer.allocUnsafe(2),f.writeUInt16BE(e,0);else{let g=Buffer.byteLength(i);if(g>123)throw new RangeError("The message must not be greater than 123 bytes");f=Buffer.allocUnsafe(2+g),f.writeUInt16BE(e,0),typeof i=="string"?f.write(i,2):f.set(i,2)}}let u={[pe]:f.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==we?this.enqueue([this.dispatch,f,!1,u,x]):this.sendFrame(r.frame(f,u),x)}ping(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):mt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[pe]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:9,readOnly:f,rsv1:!1};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}pong(e,i,a){let x,f;if(typeof e=="string"?(x=Buffer.byteLength(e),f=!1):mt(e)?(x=e.size,f=!1):(e=Ze(e),x=e.length,f=Ze.readOnly),x>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[pe]:x,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:10,readOnly:f,rsv1:!1};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,!1,u,a]):this.getBlobData(e,!1,u,a):this._state!==we?this.enqueue([this.dispatch,e,!1,u,a]):this.sendFrame(r.frame(e,u),a)}send(e,i,a){let x=this._extensions[Di.extensionName],f=i.binary?2:1,u=i.compress,g,m;typeof e=="string"?(g=Buffer.byteLength(e),m=!1):mt(e)?(g=e.size,m=!1):(e=Ze(e),g=e.length,m=Ze.readOnly),this._firstFragment?(this._firstFragment=!1,u&&x&&x.params[x._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=g>=x._threshold),this._compress=u):(u=!1,f=0),i.fin&&(this._firstFragment=!0);let _={[pe]:g,fin:i.fin,generateMask:this._generateMask,mask:i.mask,maskBuffer:this._maskBuffer,opcode:f,readOnly:m,rsv1:u};mt(e)?this._state!==we?this.enqueue([this.getBlobData,e,this._compress,_,a]):this.getBlobData(e,this._compress,_,a):this._state!==we?this.enqueue([this.dispatch,e,this._compress,_,a]):this.dispatch(e,this._compress,_,a)}getBlobData(e,i,a,x){this._bufferedBytes+=a[pe],this._state=Kx,e.arrayBuffer().then(f=>{if(this._socket.destroyed){let g=new Error("The socket was closed while the blob was being read");process.nextTick(Tr,this,g,x);return}this._bufferedBytes-=a[pe];let u=Ze(f);i?this.dispatch(u,i,a,x):(this._state=we,this.sendFrame(r.frame(u,a),x),this.dequeue())}).catch(f=>{process.nextTick(Hx,this,f,x)})}dispatch(e,i,a,x){if(!i){this.sendFrame(r.frame(e,a),x);return}let f=this._extensions[Di.extensionName];this._bufferedBytes+=a[pe],this._state=Ux,f.compress(e,a.fin,(u,g)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Tr(this,m,x);return}this._bufferedBytes-=a[pe],this._state=we,a.readOnly=!1,this.sendFrame(r.frame(g,a),x),this.dequeue()})}dequeue(){for(;this._state===we&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][pe],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][pe],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)}};Pi.exports=Dr;function Tr(r,e,i){typeof i=="function"&&i(e);for(let a=0;a<r._queue.length;a++){let x=r._queue[a],f=x[x.length-1];typeof f=="function"&&f(e)}}function Hx(r,e,i){Tr(r,e,i),r.onerror(e)}});var qi=ae((sl,zi)=>{"use strict";var{kForOnEventAttribute:Ot,kListener:Ir}=Re(),Ii=Symbol("kCode"),Li=Symbol("kData"),Ni=Symbol("kError"),Ri=Symbol("kMessage"),Oi=Symbol("kReason"),wt=Symbol("kTarget"),Bi=Symbol("kType"),Mi=Symbol("kWasClean"),Be=class{constructor(e){this[wt]=null,this[Bi]=e}get target(){return this[wt]}get type(){return this[Bi]}};Object.defineProperty(Be.prototype,"target",{enumerable:!0});Object.defineProperty(Be.prototype,"type",{enumerable:!0});var Qe=class extends Be{constructor(e,i={}){super(e),this[Ii]=i.code===void 0?0:i.code,this[Oi]=i.reason===void 0?"":i.reason,this[Mi]=i.wasClean===void 0?!1:i.wasClean}get code(){return this[Ii]}get reason(){return this[Oi]}get wasClean(){return this[Mi]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var yt=class extends Be{constructor(e,i={}){super(e),this[Ni]=i.error===void 0?null:i.error,this[Ri]=i.message===void 0?"":i.message}get error(){return this[Ni]}get message(){return this[Ri]}};Object.defineProperty(yt.prototype,"error",{enumerable:!0});Object.defineProperty(yt.prototype,"message",{enumerable:!0});var Bt=class extends Be{constructor(e,i={}){super(e),this[Li]=i.data===void 0?null:i.data}get data(){return this[Li]}};Object.defineProperty(Bt.prototype,"data",{enumerable:!0});var Wx={addEventListener(r,e,i={}){for(let x of this.listeners(r))if(!i[Ot]&&x[Ir]===e&&!x[Ot])return;let a;if(r==="message")a=function(f,u){let g=new Bt("message",{data:u?f:f.toString()});g[wt]=this,Ln(e,this,g)};else if(r==="close")a=function(f,u){let g=new Qe("close",{code:f,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});g[wt]=this,Ln(e,this,g)};else if(r==="error")a=function(f){let u=new yt("error",{error:f,message:f.message});u[wt]=this,Ln(e,this,u)};else if(r==="open")a=function(){let f=new Be("open");f[wt]=this,Ln(e,this,f)};else return;a[Ot]=!!i[Ot],a[Ir]=e,i.once?this.once(r,a):this.on(r,a)},removeEventListener(r,e){for(let i of this.listeners(r))if(i[Ir]===e&&!i[Ot]){this.removeListener(r,i);break}}};zi.exports={CloseEvent:Qe,ErrorEvent:yt,Event:Be,EventTarget:Wx,MessageEvent:Bt};function Ln(r,e,i){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,i):r.call(e,i)}});var Nn=ae((il,Fi)=>{"use strict";var{tokenChars:Mt}=pt();function Ae(r,e,i){r[e]===void 0?r[e]=[i]:r[e].push(i)}function jx(r){let e=Object.create(null),i=Object.create(null),a=!1,x=!1,f=!1,u,g,m=-1,_=-1,v=-1,y=0;for(;y<r.length;y++)if(_=r.charCodeAt(y),u===void 0)if(v===-1&&Mt[_]===1)m===-1&&(m=y);else if(y!==0&&(_===32||_===9))v===-1&&m!==-1&&(v=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);v===-1&&(v=y);let T=r.slice(m,v);_===44?(Ae(e,T,i),i=Object.create(null)):u=T,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);else if(g===void 0)if(v===-1&&Mt[_]===1)m===-1&&(m=y);else if(_===32||_===9)v===-1&&m!==-1&&(v=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);v===-1&&(v=y),Ae(i,r.slice(m,v),!0),_===44&&(Ae(e,u,i),i=Object.create(null),u=void 0),m=v=-1}else if(_===61&&m!==-1&&v===-1)g=r.slice(m,y),m=v=-1;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(x){if(Mt[_]!==1)throw new SyntaxError(`Unexpected character at index ${y}`);m===-1?m=y:a||(a=!0),x=!1}else if(f)if(Mt[_]===1)m===-1&&(m=y);else if(_===34&&m!==-1)f=!1,v=y;else if(_===92)x=!0;else throw new SyntaxError(`Unexpected character at index ${y}`);else if(_===34&&r.charCodeAt(y-1)===61)f=!0;else if(v===-1&&Mt[_]===1)m===-1&&(m=y);else if(m!==-1&&(_===32||_===9))v===-1&&(v=y);else if(_===59||_===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${y}`);v===-1&&(v=y);let T=r.slice(m,v);a&&(T=T.replace(/\\/g,""),a=!1),Ae(i,g,T),_===44&&(Ae(e,u,i),i=Object.create(null),u=void 0),g=void 0,m=v=-1}else throw new SyntaxError(`Unexpected character at index ${y}`);if(m===-1||f||_===32||_===9)throw new SyntaxError("Unexpected end of input");v===-1&&(v=y);let C=r.slice(m,v);return u===void 0?Ae(e,C,i):(g===void 0?Ae(i,C,!0):a?Ae(i,g,C.replace(/\\/g,"")):Ae(i,g,C),Ae(e,u,i)),e}function Gx(r){return Object.keys(r).map(e=>{let i=r[e];return Array.isArray(i)||(i=[i]),i.map(a=>[e].concat(Object.keys(a).map(x=>{let f=a[x];return Array.isArray(f)||(f=[f]),f.map(u=>u===!0?x:`${x}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Fi.exports={format:Gx,parse:jx}});var Mn=ae((xl,$i)=>{"use strict";var Jx=Z("events"),Vx=Z("https"),Yx=Z("http"),Hi=Z("net"),Xx=Z("tls"),{randomBytes:Zx,createHash:$x}=Z("crypto"),{Duplex:ol,Readable:al}=Z("stream"),{URL:Lr}=Z("url"),je=gt(),Qx=Ar(),ec=Pr(),{isBlob:tc}=pt(),{BINARY_TYPES:Ui,CLOSE_TIMEOUT:nc,EMPTY_BUFFER:Rn,GUID:rc,kForOnEventAttribute:Nr,kListener:sc,kStatusCode:ic,kWebSocket:ne,NOOP:Wi}=Re(),{EventTarget:{addEventListener:oc,removeEventListener:ac}}=qi(),{format:xc,parse:cc}=Nn(),{toBuffer:fc}=Nt(),ji=Symbol("kAborted"),Rr=[8,13],Me=["CONNECTING","OPEN","CLOSING","CLOSED"],uc=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,U=class r extends Jx{constructor(e,i,a){super(),this._binaryType=Ui[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Rn,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?(a=i,i=[]):i=[i]),Gi(this,e,i,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ui.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,a){let x=new Qx({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),f=new ec(e,this._extensions,a.generateMask);this._receiver=x,this._sender=f,this._socket=e,x[ne]=this,f[ne]=this,e[ne]=this,x.on("conclude",hc),x.on("drain",gc),x.on("error",pc),x.on("message",mc),x.on("ping",_c),x.on("pong",wc),f.onerror=yc,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),i.length>0&&e.unshift(i),e.on("close",Yi),e.on("data",Bn),e.on("end",Xi),e.on("error",Zi),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){ue(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,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Vi(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Or(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.ping(e||Rn,i,a)}pong(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(a=e,e=i=void 0):typeof i=="function"&&(a=i,i=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Or(this,e,a);return}i===void 0&&(i=!this._isServer),this._sender.pong(e||Rn,i,a)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,i,a){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof i=="function"&&(a=i,i={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Or(this,e,a);return}let x={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...i};this._extensions[je.extensionName]||(x.compress=!1),this._sender.send(e||Rn,x,a)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){ue(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(U,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(U.prototype,"CONNECTING",{enumerable:!0,value:Me.indexOf("CONNECTING")});Object.defineProperty(U,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(U.prototype,"OPEN",{enumerable:!0,value:Me.indexOf("OPEN")});Object.defineProperty(U,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(U.prototype,"CLOSING",{enumerable:!0,value:Me.indexOf("CLOSING")});Object.defineProperty(U,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});Object.defineProperty(U.prototype,"CLOSED",{enumerable:!0,value:Me.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(U.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(U.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Nr])return e[sc];return null},set(e){for(let i of this.listeners(r))if(i[Nr]){this.removeListener(r,i);break}typeof e=="function"&&this.addEventListener(r,e,{[Nr]:!0})}})});U.prototype.addEventListener=oc;U.prototype.removeEventListener=ac;$i.exports=U;function Gi(r,e,i,a){let x={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:nc,protocolVersion:Rr[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(r._autoPong=x.autoPong,r._closeTimeout=x.closeTimeout,!Rr.includes(x.protocolVersion))throw new RangeError(`Unsupported protocol version: ${x.protocolVersion} (supported versions: ${Rr.join(", ")})`);let f;if(e instanceof Lr)f=e;else try{f=new Lr(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}f.protocol==="http:"?f.protocol="ws:":f.protocol==="https:"&&(f.protocol="wss:"),r._url=f.href;let u=f.protocol==="wss:",g=f.protocol==="ws+unix:",m;if(f.protocol!=="ws:"&&!u&&!g?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:g&&!f.pathname?m="The URL's pathname is empty":f.hash&&(m="The URL contains a fragment identifier"),m){let R=new SyntaxError(m);if(r._redirects===0)throw R;On(r,R);return}let _=u?443:80,v=Zx(16).toString("base64"),y=u?Vx.request:Yx.request,C=new Set,T;if(x.createConnection=x.createConnection||(u?lc:dc),x.defaultPort=x.defaultPort||_,x.port=f.port||_,x.host=f.hostname.startsWith("[")?f.hostname.slice(1,-1):f.hostname,x.headers={...x.headers,"Sec-WebSocket-Version":x.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"},x.path=f.pathname+f.search,x.timeout=x.handshakeTimeout,x.perMessageDeflate&&(T=new je({...x.perMessageDeflate,isServer:!1,maxPayload:x.maxPayload}),x.headers["Sec-WebSocket-Extensions"]=xc({[je.extensionName]:T.offer()})),i.length){for(let R of i){if(typeof R!="string"||!uc.test(R)||C.has(R))throw new SyntaxError("An invalid or duplicated subprotocol was specified");C.add(R)}x.headers["Sec-WebSocket-Protocol"]=i.join(",")}if(x.origin&&(x.protocolVersion<13?x.headers["Sec-WebSocket-Origin"]=x.origin:x.headers.Origin=x.origin),(f.username||f.password)&&(x.auth=`${f.username}:${f.password}`),g){let R=x.path.split(":");x.socketPath=R[0],x.path=R[1]}let P;if(x.followRedirects){if(r._redirects===0){r._originalIpc=g,r._originalSecure=u,r._originalHostOrSocketPath=g?x.socketPath:f.host;let R=a&&a.headers;if(a={...a,headers:{}},R)for(let[J,oe]of Object.entries(R))a.headers[J.toLowerCase()]=oe}else if(r.listenerCount("redirect")===0){let R=g?r._originalIpc?x.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:f.host===r._originalHostOrSocketPath;(!R||r._originalSecure&&!u)&&(delete x.headers.authorization,delete x.headers.cookie,R||delete x.headers.host,x.auth=void 0)}x.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(x.auth).toString("base64")),P=r._req=y(x),r._redirects&&r.emit("redirect",r.url,P)}else P=r._req=y(x);x.timeout&&P.on("timeout",()=>{ue(r,P,"Opening handshake has timed out")}),P.on("error",R=>{P===null||P[ji]||(P=r._req=null,On(r,R))}),P.on("response",R=>{let J=R.headers.location,oe=R.statusCode;if(J&&x.followRedirects&&oe>=300&&oe<400){if(++r._redirects>x.maxRedirects){ue(r,P,"Maximum redirects exceeded");return}P.abort();let ce;try{ce=new Lr(J,e)}catch{let F=new SyntaxError(`Invalid URL: ${J}`);On(r,F);return}Gi(r,ce,i,a)}else r.emit("unexpected-response",P,R)||ue(r,P,`Unexpected server response: ${R.statusCode}`)}),P.on("upgrade",(R,J,oe)=>{if(r.emit("upgrade",R),r.readyState!==U.CONNECTING)return;P=r._req=null;let ce=R.headers.upgrade;if(ce===void 0||ce.toLowerCase()!=="websocket"){ue(r,J,"Invalid Upgrade header");return}let I=$x("sha1").update(v+rc).digest("base64");if(R.headers["sec-websocket-accept"]!==I){ue(r,J,"Invalid Sec-WebSocket-Accept header");return}let F=R.headers["sec-websocket-protocol"],Y;if(F!==void 0?C.size?C.has(F)||(Y="Server sent an invalid subprotocol"):Y="Server sent a subprotocol but none was requested":C.size&&(Y="Server sent no subprotocol"),Y){ue(r,J,Y);return}F&&(r._protocol=F);let De=R.headers["sec-websocket-extensions"];if(De!==void 0){if(!T){ue(r,J,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ze;try{ze=cc(De)}catch{ue(r,J,"Invalid Sec-WebSocket-Extensions header");return}let ye=Object.keys(ze);if(ye.length!==1||ye[0]!==je.extensionName){ue(r,J,"Server indicated an extension that was not requested");return}try{T.accept(ze[je.extensionName])}catch{ue(r,J,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[je.extensionName]=T}r.setSocket(J,oe,{allowSynchronousEvents:x.allowSynchronousEvents,generateMask:x.generateMask,maxPayload:x.maxPayload,skipUTF8Validation:x.skipUTF8Validation})}),x.finishRequest?x.finishRequest(P,r):P.end()}function On(r,e){r._readyState=U.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function dc(r){return r.path=r.socketPath,Hi.connect(r)}function lc(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Hi.isIP(r.host)?"":r.host),Xx.connect(r)}function ue(r,e,i){r._readyState=U.CLOSING;let a=new Error(i);Error.captureStackTrace(a,ue),e.setHeader?(e[ji]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(On,r,a)):(e.destroy(a),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Or(r,e,i){if(e){let a=tc(e)?e.size:fc(e).length;r._socket?r._sender._bufferedBytes+=a:r._bufferedAmount+=a}if(i){let a=new Error(`WebSocket is not open: readyState ${r.readyState} (${Me[r.readyState]})`);process.nextTick(i,a)}}function hc(r,e){let i=this[ne];i._closeFrameReceived=!0,i._closeMessage=e,i._closeCode=r,i._socket[ne]!==void 0&&(i._socket.removeListener("data",Bn),process.nextTick(Ji,i._socket),r===1005?i.close():i.close(r,e))}function gc(){let r=this[ne];r.isPaused||r._socket.resume()}function pc(r){let e=this[ne];e._socket[ne]!==void 0&&(e._socket.removeListener("data",Bn),process.nextTick(Ji,e._socket),e.close(r[ic])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Ki(){this[ne].emitClose()}function mc(r,e){this[ne].emit("message",r,e)}function _c(r){let e=this[ne];e._autoPong&&e.pong(r,!this._isServer,Wi),e.emit("ping",r)}function wc(r){this[ne].emit("pong",r)}function Ji(r){r.resume()}function yc(r){let e=this[ne];e.readyState!==U.CLOSED&&(e.readyState===U.OPEN&&(e._readyState=U.CLOSING,Vi(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Vi(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),r._closeTimeout)}function Yi(){let r=this[ne];if(this.removeListener("close",Yi),this.removeListener("data",Bn),this.removeListener("end",Xi),r._readyState=U.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[ne]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Ki),r._receiver.on("finish",Ki))}function Bn(r){this[ne]._receiver.write(r)||this.pause()}function Xi(){let r=this[ne];r._readyState=U.CLOSING,r._receiver.end(),this.end()}function Zi(){let r=this[ne];this.removeListener("error",Zi),this.on("error",Wi),r&&(r._readyState=U.CLOSING,this.destroy())}});var no=ae((fl,to)=>{"use strict";var cl=Mn(),{Duplex:vc}=Z("stream");function Qi(r){r.emit("close")}function bc(){!this.destroyed&&this._writableState.finished&&this.destroy()}function eo(r){this.removeListener("error",eo),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function Sc(r,e){let i=!0,a=new vc({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(f,u){let g=!u&&a._readableState.objectMode?f.toString():f;a.push(g)||r.pause()}),r.once("error",function(f){a.destroyed||(i=!1,a.destroy(f))}),r.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(x,f){if(r.readyState===r.CLOSED){f(x),process.nextTick(Qi,a);return}let u=!1;r.once("error",function(m){u=!0,f(m)}),r.once("close",function(){u||f(x),process.nextTick(Qi,a)}),i&&r.terminate()},a._final=function(x){if(r.readyState===r.CONNECTING){r.once("open",function(){a._final(x)});return}r._socket!==null&&(r._socket._writableState.finished?(x(),a._readableState.endEmitted&&a.destroy()):(r._socket.once("finish",function(){x()}),r.close()))},a._read=function(){r.isPaused&&r.resume()},a._write=function(x,f,u){if(r.readyState===r.CONNECTING){r.once("open",function(){a._write(x,f,u)});return}r.send(x,u)},a.on("end",bc),a.on("error",eo),a}to.exports=Sc});var Br=ae((ul,ro)=>{"use strict";var{tokenChars:Cc}=pt();function Ec(r){let e=new Set,i=-1,a=-1,x=0;for(x;x<r.length;x++){let u=r.charCodeAt(x);if(a===-1&&Cc[u]===1)i===-1&&(i=x);else if(x!==0&&(u===32||u===9))a===-1&&i!==-1&&(a=x);else if(u===44){if(i===-1)throw new SyntaxError(`Unexpected character at index ${x}`);a===-1&&(a=x);let g=r.slice(i,a);if(e.has(g))throw new SyntaxError(`The "${g}" subprotocol is duplicated`);e.add(g),i=a=-1}else throw new SyntaxError(`Unexpected character at index ${x}`)}if(i===-1||a!==-1)throw new SyntaxError("Unexpected end of input");let f=r.slice(i,x);if(e.has(f))throw new SyntaxError(`The "${f}" subprotocol is duplicated`);return e.add(f),e}ro.exports={parse:Ec}});var fo=ae((ll,co)=>{"use strict";var kc=Z("events"),zn=Z("http"),{Duplex:dl}=Z("stream"),{createHash:Ac}=Z("crypto"),so=Nn(),et=gt(),Dc=Br(),Tc=Mn(),{CLOSE_TIMEOUT:Pc,GUID:Ic,kWebSocket:Lc}=Re(),Nc=/^[+/0-9A-Za-z]{22}==$/,io=0,oo=1,xo=2,Mr=class extends kc{constructor(e,i){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Pc,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Tc,...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=zn.createServer((a,x)=>{let f=zn.STATUS_CODES[426];x.writeHead(426,{"Content-Length":f.length,"Content-Type":"text/plain"}),x.end(f)}),this._server.listen(e.port,e.host,e.backlog,i)):e.server&&(this._server=e.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=Rc(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(x,f,u)=>{this.handleUpgrade(x,f,u,a)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=io}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===xo){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(zt,this);return}if(e&&this.once("close",e),this._state!==oo)if(this._state=oo,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(zt,this):process.nextTick(zt,this);else{let i=this._server;this._removeListeners(),this._removeListeners=this._server=null,i.close(()=>{zt(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,a,x){i.on("error",ao);let f=e.headers["sec-websocket-key"],u=e.headers.upgrade,g=+e.headers["sec-websocket-version"];if(e.method!=="GET"){nt(this,e,i,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){nt(this,e,i,400,"Invalid Upgrade header");return}if(f===void 0||!Nc.test(f)){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Key header");return}if(g!==13&&g!==8){nt(this,e,i,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){qt(i,400);return}let m=e.headers["sec-websocket-protocol"],_=new Set;if(m!==void 0)try{_=Dc.parse(m)}catch{nt(this,e,i,400,"Invalid Sec-WebSocket-Protocol header");return}let v=e.headers["sec-websocket-extensions"],y={};if(this.options.perMessageDeflate&&v!==void 0){let C=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let T=so.parse(v);T[et.extensionName]&&(C.accept(T[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[`${g===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(C,(T,P,R,J)=>{if(!T)return qt(i,P||401,R,J);this.completeUpgrade(y,f,_,e,i,a,x)});return}if(!this.options.verifyClient(C))return qt(i,401)}this.completeUpgrade(y,f,_,e,i,a,x)}completeUpgrade(e,i,a,x,f,u,g){if(!f.readable||!f.writable)return f.destroy();if(f[Lc])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>io)return qt(f,503);let _=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ac("sha1").update(i+Ic).digest("base64")}`],v=new this.options.WebSocket(null,void 0,this.options);if(a.size){let y=this.options.handleProtocols?this.options.handleProtocols(a,x):a.values().next().value;y&&(_.push(`Sec-WebSocket-Protocol: ${y}`),v._protocol=y)}if(e[et.extensionName]){let y=e[et.extensionName].params,C=so.format({[et.extensionName]:[y]});_.push(`Sec-WebSocket-Extensions: ${C}`),v._extensions=e}this.emit("headers",_,x),f.write(_.concat(`\r
|
|
12
12
|
`).join(`\r
|
|
13
|
-
`)),f.removeListener("error",
|
|
13
|
+
`)),f.removeListener("error",ao),v.setSocket(f,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(v),v.on("close",()=>{this.clients.delete(v),this._shouldEmitClose&&!this.clients.size&&process.nextTick(zt,this)})),g(v,x)}};co.exports=Mr;function Rc(r,e){for(let i of Object.keys(e))r.on(i,e[i]);return function(){for(let a of Object.keys(e))r.removeListener(a,e[a])}}function zt(r){r._state=xo,r.emit("close")}function ao(){this.destroy()}function qt(r,e,i,a){i=i||zn.STATUS_CODES[e],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...a},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${zn.STATUS_CODES[e]}\r
|
|
14
14
|
`+Object.keys(a).map(x=>`${x}: ${a[x]}`).join(`\r
|
|
15
15
|
`)+`\r
|
|
16
16
|
\r
|
|
17
|
-
`+i)}function nt(r,e,i,a,x,f){if(r.listenerCount("wsClientError")){let u=new Error(x);Error.captureStackTrace(u,nt),r.emit("wsClientError",u,i,e)}else
|
|
17
|
+
`+i)}function nt(r,e,i,a,x,f){if(r.listenerCount("wsClientError")){let u=new Error(x);Error.captureStackTrace(u,nt),r.emit("wsClientError",u,i,e)}else qt(i,a,x,f)}});import{spawn as sf}from"node:child_process";import{existsSync as of,openSync as af}from"node:fs";import{mkdir as xf}from"node:fs/promises";import{dirname as cf}from"node:path";import{fileURLToPath as ff}from"node:url";function Fr(r=V()){return of(r.libEntry)?r.libEntry:ff(new URL("../index.ts",import.meta.url))}async function Lo(r={}){let e=r.paths??V(),i=r.entryOverride??Fr(e);await xf(cf(e.logFile),{recursive:!0});let a=af(e.logFile,"a"),f=i.endsWith(".ts")?["--import","tsx/esm",i,"--daemon"]:[i,"--daemon"],u=sf(process.execPath,f,{detached:!0,stdio:["ignore",a,a],env:{...process.env,COZE_BRIDGE_DAEMON:"1"}});if(u.unref(),typeof u.pid!="number")throw new Error("failed to spawn daemon (no pid)");return uf.info("daemon spawned",{pid:u.pid,entry:i}),{pid:u.pid,entry:i}}var uf,Ur=Pe(()=>{"use strict";K();fe();uf=O("spawn-daemon")});import{spawn as wf}from"node:child_process";import{mkdir as yf,unlink as vf,writeFile as bf}from"node:fs/promises";import{dirname as Sf,join as Cf}from"node:path";function Gn(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Mo(r,e){return new Promise((i,a)=>{let x=wf(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var jn,Wr,jr,zo=Pe(()=>{"use strict";K();jn=O("supervisor.launchd"),Wr="ai.coze.bridge",jr={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>${Wr}</string>
|
|
23
23
|
<key>ProgramArguments</key>
|
|
24
24
|
<array>
|
|
25
|
-
<string>${
|
|
26
|
-
<string>${
|
|
25
|
+
<string>${Gn(r.nodeBin)}</string>
|
|
26
|
+
<string>${Gn(r.entry)}</string>
|
|
27
27
|
<string>--daemon</string>
|
|
28
28
|
</array>
|
|
29
29
|
<key>RunAtLoad</key>
|
|
@@ -33,12 +33,12 @@ var N0=Object.create;var sr=Object.defineProperty;var R0=Object.getOwnPropertyDe
|
|
|
33
33
|
<key>ThrottleInterval</key>
|
|
34
34
|
<integer>10</integer>
|
|
35
35
|
<key>StandardOutPath</key>
|
|
36
|
-
<string>${
|
|
36
|
+
<string>${Gn(r.logFile)}</string>
|
|
37
37
|
<key>StandardErrorPath</key>
|
|
38
|
-
<string>${
|
|
38
|
+
<string>${Gn(r.logFile)}</string>
|
|
39
39
|
</dict>
|
|
40
40
|
</plist>
|
|
41
|
-
`},configPath(r){return
|
|
41
|
+
`},configPath(r){return Cf(r.homeDir,"Library","LaunchAgents",`${Wr}.plist`)},async install(r){let e=this.configPath(r);await yf(Sf(e),{recursive:!0}),await bf(e,this.renderConfig(r),"utf8"),jn.info("plist written",{plistPath:e}),await Mo("launchctl",["load","-w",e]),jn.info("launchd job loaded",{label:Wr})},async uninstall(r){let e=this.configPath(r);await Mo("launchctl",["unload","-w",e]).catch(i=>jn.warn("launchctl unload failed (ignored)",{err:String(i)})),await vf(e).catch(i=>{if(i.code!=="ENOENT")throw i}),jn.info("launchd job removed",{plistPath:e})}}});import{spawn as Ef}from"node:child_process";import{mkdir as kf,unlink as Af,writeFile as Df}from"node:fs/promises";import{dirname as Tf,join as Pf}from"node:path";function Yn(r,e){return new Promise((i,a)=>{let x=Ef(r,e,{stdio:["ignore","pipe","pipe"]}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var Jn,Vn,Gr,qo=Pe(()=>{"use strict";K();Jn=O("supervisor.systemd"),Vn="coze-bridge.service",Gr={platform:"linux",renderConfig(r){return`[Unit]
|
|
42
42
|
Description=Coze Bridge daemon
|
|
43
43
|
After=network.target
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ StandardError=append:${r.logFile}
|
|
|
52
52
|
|
|
53
53
|
[Install]
|
|
54
54
|
WantedBy=default.target
|
|
55
|
-
`},configPath(r){return Pf(r.homeDir,".config","systemd","user",
|
|
55
|
+
`},configPath(r){return Pf(r.homeDir,".config","systemd","user",Vn)},async install(r){let e=this.configPath(r);await kf(Tf(e),{recursive:!0}),await Df(e,this.renderConfig(r),"utf8"),Jn.info("systemd unit written",{unitPath:e}),await Yn("systemctl",["--user","daemon-reload"]),await Yn("systemctl",["--user","enable","--now",Vn]),Jn.info("systemd unit enabled",{unitName:Vn})},async uninstall(r){let e=this.configPath(r);await Yn("systemctl",["--user","disable","--now",Vn]).catch(i=>Jn.warn("systemctl disable failed (ignored)",{err:String(i)})),await Af(e).catch(i=>{if(i.code!=="ENOENT")throw i}),await Yn("systemctl",["--user","daemon-reload"]).catch(()=>{}),Jn.info("systemd unit removed",{unitPath:e})}}});import{spawn as If}from"node:child_process";import{join as Lf}from"node:path";function Fo(r,e){return new Promise((i,a)=>{let x=If(r,e,{stdio:["ignore","pipe","pipe"],shell:!1}),f="";x.stderr?.on("data",u=>{f+=u.toString("utf8")}),x.on("error",a),x.on("close",u=>{u===0?i():a(new Error(`${r} ${e.join(" ")} exited ${u}: ${f.trim()}`))})})}var Jr,Xn,Vr,Uo=Pe(()=>{"use strict";K();Jr=O("supervisor.taskscheduler"),Xn="CozeBridge",Vr={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>
|
|
@@ -76,7 +76,7 @@ WantedBy=default.target
|
|
|
76
76
|
</Exec>
|
|
77
77
|
</Actions>
|
|
78
78
|
</Task>
|
|
79
|
-
`},configPath(r){return Lf(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await
|
|
79
|
+
`},configPath(r){return Lf(r.homeDir,".coze","bridge","task.xml")},async install(r){let e=`"${r.nodeBin}" "${r.entry}" --daemon`;await Fo("schtasks",["/Create","/SC","ONLOGON","/TN",Xn,"/TR",e,"/RU",r.userName,"/F"]),Jr.info("task scheduler entry created",{task:Xn})},async uninstall(r){await Fo("schtasks",["/Delete","/TN",Xn,"/F"]).catch(e=>Jr.warn("schtasks /Delete failed (ignored)",{err:String(e)})),Jr.info("task scheduler entry removed",{task:Xn})}}});var Yr={};ys(Yr,{buildContext:()=>Bf,getSupervisor:()=>Of,launchdSupervisor:()=>jr,systemdSupervisor:()=>Gr,taskSchedulerSupervisor:()=>Vr});import{homedir as Nf,userInfo as Rf}from"node:os";function Of(r=process.platform){switch(r){case"darwin":return jr;case"linux":return Gr;case"win32":return Vr;default:throw new Error(`unsupported platform for OS supervisor: ${r}`)}}function Bf(){let r=V();return{nodeBin:process.execPath,entry:Fr(r),logFile:r.logFile,homeDir:Nf(),userName:Rf().username}}var Xr=Pe(()=>{"use strict";fe();Ur();zo();qo();Uo()});Ke();K();import{readdir as na}from"node:fs/promises";import{mkdir as Z0,writeFile as $0}from"node:fs/promises";import{join as Q0}from"node:path";var ea={"claude-code":"CLAUDE.md",codex:"AGENTS.md",openclaw:"SOUL.md"};async function Ve(r,e,i,a){await Z0(r,{recursive:!0});let x=ea[e],f=Q0(r,x),u=ta(e,i,a);return await $0(f,u,"utf8"),f}function ta(r,e,i){let a=`# Coze Agent: ${e}
|
|
80
80
|
|
|
81
81
|
> framework: \`${r}\`
|
|
82
82
|
|
|
@@ -85,10 +85,10 @@ WantedBy=default.target
|
|
|
85
85
|
`:`_No instructions provided._
|
|
86
86
|
`;return`${a}---
|
|
87
87
|
|
|
88
|
-
${x}`}var _e=N("agent-detail-sync"),Wt=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,a;try{a=await ta(i)}catch(x){_e.info("agents dir not found, skip detail sync",{root:i,err:String(x)});return}_e.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){_e.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}_e.info("detail sync done",{reason:e})}async syncOne(e){let i=await oe(e,this.opts.paths);if(!i){_e.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(u){_e.warn("detail RPC failed, using local data",{agentId:e,err:String(u)});return}if(a.agentId&&a.agentId!==e){_e.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let x=!1,f=!1;if(a.agentName&&a.agentName!==i.agentName&&(i.agentName=a.agentName,x=!0),a.description!==void 0&&a.description!==i.description&&(i.description=a.description,x=!0),a.cozeIdentity&&a.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=a.cozeIdentity,x=!0,f=!0),a.deployType&&_e.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){_e.debug("detail sync: no diff",{agentId:e});return}await ue(i,this.opts.paths),_e.info("detail sync: config updated",{agentId:e,identityChanged:f,agentName:i.agentName}),f&&(await Ve(i.workspace,i.framework,e,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Ue();import{spawn as na}from"node:child_process";import{mkdir as ra,readFile as Ls,readdir as sa,rm as ia,stat as Yt,writeFile as oa}from"node:fs/promises";import{join as Pe,normalize as aa,relative as Ns,resolve as xa,sep as Rs}from"node:path";function Jt(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Ss(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,a){super(i),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};F();xe();function Ye(r,e){if(Jt(r)!=="cloud")throw new E("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var Es="https://llm-gateway.coze.cn",Vt="auto";function xr(r){return{model:r.model??Vt,...r.modelToken?{modelToken:r.modelToken}:{}}}function Cs(r){return!r||r===Vt}function Ds(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=Es,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),Cs(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function As(r){let e=[];return Cs(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${Es}/v1"`)),e}function ks(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var Y=N("agent-handlers"),Is=5*1024*1024,ca=1,fa=6,ua=new Set(["node_modules",".git",".coze","dist","build",".next"]),da=3e4,Xt=class{constructor(e){this.opts=e}opts;async listSkills(e){Ye(e._meta,"_agent/listSkills");let i=xt(e._meta),a=await this.loadAgentCfg(i),x=a?.workspace??Ie(i).workspace,f=a?.skills??[],u=[];for(let h of f){let m=Pe(x,h.relPath,"SKILL.md");await Yt(m).then(y=>y.isFile()).catch(()=>!1)&&u.push({skillId:h.skillId,skillName:h.skillName,downloadUrl:h.downloadUrl??"",...h.description?{description:h.description}:{},...h.version?{version:h.version}:{}})}return{skills:u}}async addSkills(e){Ye(e._meta,"_agent/addSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=e.skills??[],f=[...a.skills??[]],u=new Map(f.map((m,w)=>[m.skillId,w])),h=[];for(let m of x){if(!m.skillName)throw new E("IPC_BAD_REQUEST","skill missing skillName");let w=la(m.skillName),y=ha(a.framework),_=Pe(y,w),C=Pe(a.workspace,_);await ra(C,{recursive:!0});let L=await pa(m.downloadUrl);wa(L)?await _a(L,C):await oa(Pe(C,"SKILL.md"),L.toString("utf8"),"utf8");let T={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}:{}},R=u.get(m.skillId);R!==void 0?f[R]=T:(u.set(m.skillId,f.length),f.push(T)),h.push(m),Y.info("skill installed",{agentId:i,skillId:m.skillId,skillName:m.skillName,relPath:_})}return await jt(i,f),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:h}}async removeSkills(e){Ye(e._meta,"_agent/removeSkills");let i=xt(e._meta),a=await this.requireAgentCfg(i),x=new Set(e.skillIds??[]),f=a.skills??[],u=[];for(let h of f){if(!x.has(h.skillId)){u.push(h);continue}let m=Pe(a.workspace,h.relPath);await ia(m,{recursive:!0,force:!0}),Y.info("skill removed",{agentId:i,skillId:h.skillId,relPath:h.relPath})}return await jt(i,u),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,i){return this.reloadAgentSessions(e,i)}async reloadAgentSessions(e,i){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[x,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),Y.info("session reloaded",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(u){Y.warn("session reload failed",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f,err:String(u)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return Y.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,a=await oe(i);if(!a)throw new E("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===e.cozeIdentity?(Y.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await ue(a),await Ve(a.workspace,a.framework,i,e.cozeIdentity),Y.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:a.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 a=await oe(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await ue(a),Y.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}):(Y.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Ye(e._meta,"_agent/switchModel"),!e.agentId)throw new E("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=e.model&&e.model.trim()?e.model:Vt,a=e.modelToken?.trim()||void 0,x=await oe(e.agentId);if(!x)throw new E("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=i,a!==void 0?x.modelToken=a:delete x.modelToken,await ue(x),Y.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:i,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let f=this.opts.agents.get(e.agentId);if(!f)return Y.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return Y.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new E("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let u=f.msgQueue.enqueue(async()=>{}),h=setTimeout(()=>{Y.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(m=>Y.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(m)}))},da);try{return await u.catch(m=>Y.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(m)})),clearTimeout(h),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(m){clearTimeout(h),Y.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(m)});let w=await oe(e.agentId).catch(()=>null);throw w&&(w.disconnectedAt=Date.now(),w.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await ue(w).catch(y=>Y.warn("write disconnect marker failed (ignored)",{err:String(y)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(y=>Y.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(y)})):f.status="disconnected",m instanceof E&&(m.code==="MODEL_SWITCH_FAILED"||m.code==="AGENT_NOT_FOUND")?m:new E("MODEL_SWITCH_FAILED",m instanceof Error?m.message:String(m),{cause:m})}}async getFileTree(e){Ye(e._meta,"_agent/getFileTree");let i=e._meta,a=xt(i),x=this.resolveWorkspace(a),f=e.filePath??"",u=this.safeJoin(x,f),h=await Yt(u).catch(()=>null);if(!h)throw new E("IPC_BAD_REQUEST",`path not found: ${f}`);let m=ya(e.depth);return h.isDirectory()?{tree:await Bs(x,u,f,m)}:{tree:[{name:va(f),path:Ms(f||"."),isDir:!1,size:h.size,modifiedAt:Math.floor(h.mtimeMs)}]}}async getFileContent(e){Ye(e._meta,"_agent/getFileContent");let i=xt(e._meta),a=this.resolveWorkspace(i);if(!e.filePath)throw new E("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await Yt(x).catch(()=>null);if(!f||!f.isFile())throw new E("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Is)throw new E("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Is})`);let u=await Ls(x);return u.includes(0)?{content:u.toString("base64"),encoding:"base64",size:f.size}:{content:u.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(e){let i=this.opts.agents.get(e);return i?i.workspace:Ie(e).workspace}safeJoin(e,i){let a=xa(e,i||"."),x=Ns(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Rs}`))throw new E("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(e){return oe(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 la(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new E("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function ha(r){return r==="claude-code"?Pe(".claude","skills"):Pe(".agents","skills")}var ga=3e4,Ps=50*1024*1024,Ts=3e4;async function pa(r){if(!r)throw new E("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return ma(r);if(r.startsWith("file:")){let e=new URL(r).pathname,i=await Ls(e);if(i.length>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${i.length} bytes`);return i}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,i=setTimeout(()=>e.abort(),ga);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new E("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ps)throw new E("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(i)}}throw new E("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function ma(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new E("IPC_BAD_REQUEST","bad data URL");let i=!!e[2],a=e[3]??"";return i?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function wa(r){return r.length>=2&&r[0]===31&&r[1]===139}async function _a(r,e){await new Promise((i,a)=>{let x=na("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";x.stderr?.on("data",h=>{f+=String(h)});let u=setTimeout(()=>{x.kill("SIGKILL"),a(new E("IPC_BAD_REQUEST",`tar extract timeout (${Ts}ms)`))},Ts);x.on("error",h=>{clearTimeout(u),a(new E("IPC_BAD_REQUEST",`tar spawn failed: ${h.message}`,{cause:h}))}),x.on("exit",h=>{clearTimeout(u),h===0?i():a(new E("IPC_BAD_REQUEST",`tar exit ${h}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Bs(r,e,i,a){if(a<=0)return[];let x;try{x=await sa(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let u of x){if(ua.has(u.name))continue;let h=Pe(e,u.name),m=aa(Pe(i,u.name)),w=null;try{w=await Yt(h)}catch{continue}let y={name:u.name,path:Ms(Ns(r,h)),isDir:w.isDirectory(),size:w.size,modifiedAt:Math.floor(w.mtimeMs)};w.isDirectory()&&a>1&&(y.children=await Bs(r,h,m,a-1)),f.push(y)}return f.sort((u,h)=>u.isDir!==h.isDir?u.isDir?-1:1:u.name.localeCompare(h.name)),f}function ya(r){return!r||r<=0?ca:Math.min(r,fa)}function va(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function Ms(r){return r.split(Rs).join("/")}F();var Et=N("agent-health-reporter"),ba=3e4,Zt=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??ba}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()}),Et.info("heartbeat started",{intervalMs:this.intervalMs}),this.tick())}stop(){this.timer&&(clearInterval(this.timer),this.timer=null,this.unsubscribeRegister&&(this.unsubscribeRegister(),this.unsubscribeRegister=null),Et.info("heartbeat stopped"))}async tick(){if(this.inFlight){Et.debug("previous tick still in-flight, skip");return}let e=this.opts.getDeviceId();if(!e){Et.debug("deviceId not available, skip tick (\u5C1A\u672A pair)");return}this.inFlight=!0;try{let i=[...this.opts.core.agents.values()];for(let a of i){let x=Sa(a);if(!x)continue;let f={status:x,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(u){Et.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(u)})}}}finally{this.inFlight=!1}}};function Sa(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Ue();import{mkdir as cr,rm as Na}from"node:fs/promises";import{spawn as ka}from"node:child_process";function ct(r,e,i){return i===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:i}}function Os(r,e){return e===void 0?{jsonrpc:"2.0",method:r}:{jsonrpc:"2.0",method:r,params:e}}function ft(r,e){return{jsonrpc:"2.0",id:r,result:e}}function Xe(r,e){return{jsonrpc:"2.0",id:r,error:e}}var $t=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)}},U={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_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function Qt(r){return"method"in r&&"id"in r&&r.id!==void 0}function zs(r){return"method"in r&&!("id"in r)}function en(r){return!("method"in r)&&"id"in r}var Ea={AGENT_NOT_FOUND:U.AGENT_NOT_FOUND,AGENT_BUSY:U.AGENT_BUSY,AGENT_DISCONNECTED:U.AGENT_DISCONNECTED,AGENT_TIMEOUT:U.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:U.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:U.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:U.INTERNAL_ERROR,BRIDGE_INTERNAL:U.INTERNAL_ERROR,IPC_AUTH_FAILED:U.INTERNAL_ERROR,IPC_BAD_REQUEST:U.INVALID_REQUEST,MODEL_SWITCHING:U.MODEL_SWITCHING,MODEL_SWITCH_FAILED:U.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:U.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:U.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:U.INTERNAL_ERROR};function tn(r){return r instanceof E?{code:Ea[r.code]??U.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:U.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function qs(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 Fs(r){return`${JSON.stringify(r)}
|
|
89
|
-
`}var
|
|
90
|
-
`);this.buffer=i.pop()??"";let a=[];for(let x of i){let f=x.replace(/\r$/,"").trim();if(f)try{a.push(JSON.parse(f))}catch(u){this.onError?.({line:f,error:u})}}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(i){return this.onError?.({line:e,error:i}),[]}}};var Hs={"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",initialize:"initialize"},Fu=Object.fromEntries(Object.entries(Hs).map(([r,e])=>[e,r])),Ca={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"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.pair":[],initialize:[]},ut=class{seq=0;next(e,i){this.seq+=1;let a=Hs[e]??Da(e),x=Ca[a]??[],f=[a,String(this.seq)];if(x.length>0){let u=x.map(m=>Us(i?.[m]??"")),h=Aa(u).join(":");h&&f.push(h)}else i&&Object.values(i).some(u=>u)&&f.push(Object.values(i).filter(Boolean).map(u=>Us(String(u))).join(":"));return f.join("_")}reset(){this.seq=0}};function Da(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Us(r){return r.replace(/[:_\s]+/g,"-")}function Aa(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}F();var Ia=3e4;function Ks(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var He=class{constructor(e){this.opts=e;this.log=N(`downstream.${this.constructor.name}`),this.decoder=new nn({onError:i=>this.log.warn("decode line failed",{line:i.line})})}opts;child;decoder;pending=new Map;idAllocator=new ut;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=ka(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",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),i.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new E("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let f of this.exitHandlers)f(a,x)}),i.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new E("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),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,a=new Promise(f=>i.once("exit",()=>f()));Ks(i.pid,"SIGTERM");let x=setTimeout(()=>{i.killed||Ks(i.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){if(!this.child||this.stopped)return;let i=this.idAllocator.next("session/cancel");this.writeFrame(ct(i,"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(ft(e,i))}catch(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,i))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,i,a=Ia){if(!this.child||this.stopped)return Promise.reject(new E("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),f=ct(x,e,i),u=a>0&&Number.isFinite(a);return new Promise((h,m)=>{let w=u?setTimeout(()=>{this.pending.delete(x),m(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:h,reject:m,timer:w,method:e});try{this.writeFrame(f)}catch(y){w&&clearTimeout(w),this.pending.delete(x),m(y)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new E("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Fs(e))}dispatch(e){if(en(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(qs(e.error)):i.resolve(e.result);return}if(zs(e)){if(e.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(Qt(e)){let i=e;this.handleAgentRequest(i).catch(a=>this.log.error("agent request handler failed",{method:i.method,err:String(a)}))}}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(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Xe(e.id,tn(a)))}catch{}}}failAllPending(e){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(e);this.pending.clear()}};var Pa="@zed-industries/claude-code-acp@latest";function Ta(r){let e={};for(let[i,a]of Object.entries(r))a!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(e[i]=a));return e}var rn=class extends He{framework="claude-code";constructor(e){let i=e.command??"npx",a=e.args??["-y",Pa],x={command:i,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x)}sanitizeEnv(e){return Ta(e)}};var La="@zed-industries/codex-acp@latest",sn=class extends He{framework="codex";constructor(e){let i=e.command??"npx",a=e.args??["-y",La],x=e.extraArgs?[...a,...e.extraArgs]:a,f={command:i,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f)}};import{spawn as js}from"node:child_process";F();var on=class extends He{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let i=e.profile??"coze",a=e.sessionName??"default",x=["--profile",i,"acp","--session",`agent:${e.agentId}:${a}`],f={command:e.command,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f),this.profile=i,this.agentId=e.agentId,this.sessionName=a,this.registerLog=N("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,i)=>{let a=js(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",i),a.on("close",f=>{f===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):i(new E("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${x.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(i=>{let a=js(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",f=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(f)}),i()}),a.on("close",f=>{f===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:f,stderr:x.trim()}),this.registered=!1,i()})})}get acpSessionName(){return this.sessionName}};F();xe();var an=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,a)=>{this.slots.push({task:e,resolve:i,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 i=await e.task();e.resolve(i)}catch(i){e.reject(i)}}}finally{this.running=!1}}}};var xn=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this._downstream=e.downstream,this.msgQueue=new an}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var H=N("agent-manager"),Ra=(r,e,i,a,x)=>{switch(r){case"claude-code":{let f=x?Ds(x):void 0;return new rn({cwd:i,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=x?As(x):[],u=x?ks(x):void 0;return new sn({cwd:i,...f.length>0?{extraArgs:f}:{},...u&&Object.keys(u).length>0?{env:u}:{}})}case"openclaw":return new on({command:e,cwd:i,agentId:a})}},Ba=[0,5e3,5e3],Ma=2e4,Gs={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},cn=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Ra,this.restartDelaysMs=e.restartDelaysMs??Ba,this.createTimeoutMs=e.createTimeoutMs??Ma,this.healthReporter=e.healthReporter}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");if(Jt(e._meta)==="cloud")return H.info("cloud-deployed agent, ack without local spawn",{agentId:e.agentId,framework:e.framework}),{ok:!0,agentId:e.agentId,framework:e.framework};this.registry.reviveIfDisconnected?.(e.agentId);let i=this.registry.get(e.agentId);if(i){if(i.framework!==e.framework)throw new E("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${i.framework})`);if(i.status==="error")H.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await i.dispose("rebuild after error").catch(m=>H.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(e.agentId);else return H.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:i.agentId,workspace:i.workspace,pid:i.downstream.pid()??0,framework:i.framework}}let a=this.config.frameworksCache?.[e.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let x=Ie(e.agentId,this.paths),f=e.workspace??x.workspace,u=new AbortController,h=setTimeout(()=>u.abort(new E("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,x,f,a,u.signal)}finally{clearTimeout(h)}}async createAgentInner(e,i,a,x,f){let u=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new E("AGENT_TIMEOUT","_agent/create aborted")},h,m,w=!1;try{await cr(i.root,{recursive:!0}),await cr(a,{recursive:!0}),await cr(i.logs,{recursive:!0}),u(),e.framework!=="openclaw"&&await Ve(a,e.framework,e.agentId,e.cozeIdentity),u();let y=await oe(e.agentId,this.paths).catch(()=>null),_=xr({model:e.model??y?.model,modelToken:e.modelToken??y?.modelToken});if(h=this.factory(e.framework,x.path,a,e.agentId,_),await h.start(),u(),await h.initialize(Gs),u(),e.framework==="openclaw"&&await Ve(a,"openclaw",e.agentId,e.cozeIdentity),m=new xn({agentId:e.agentId,framework:e.framework,workspace:a,downstream:h}),m.status="ok",y?.sessions){for(let[T,R]of Object.entries(y.sessions))m.sessions.set(T,R);Object.keys(y.sessions).length>0&&H.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(y.sessions).length})}this.registry.register(m),w=!0;let C={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:y?.createdAt??Date.now(),sessions:y?.sessions??{},model:_.model};_.modelToken&&(C.modelToken=_.modelToken),y?.skills&&(C.skills=y.skills),y?.agentName&&(C.agentName=y.agentName),y?.description&&(C.description=y.description),await ue(C,this.paths);let L=h.pid()??0;return H.info("agent created",{agentId:e.agentId,framework:e.framework,pid:L}),this.installRestartHook(m),{ok:!0,agentId:e.agentId,workspace:a,pid:L,framework:e.framework}}catch(y){throw H.error("agent create failed,rolling back",{agentId:e.agentId,err:String(y)}),h?.cleanup&&await h.cleanup("rollback").catch(_=>H.warn("downstream cleanup failed (ignored)",{err:String(_)})),h&&await h.stop("rollback").catch(()=>{}),w&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Na(i.root,{recursive:!0,force:!0}).catch(_=>H.warn("rm agent dir failed (ignored)",{err:String(_)})),y instanceof E?y:new E("AGENT_SPAWN_FAILED",String(y),{cause:y})}}async reportHealth(e,i,a){if(!this.healthReporter){H.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:e.agentId}}),H.info("_agent/health reported",{agentId:e.agentId,status:i,cause:a})}catch(x){H.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:i,err:String(x)})}}installRestartHook(e){let i=0,a=x=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(i>=this.restartDelaysMs.length){H.error("agent restart exhausted",{agentId:e.agentId,attempts:i,...x}),e.status="error",this.reportHealth(e,"error",x);return}let f=this.restartDelaysMs[i]??5e3;i+=1,e.status="degraded",H.warn("agent restart scheduled",{agentId:e.agentId,attempt:i,delayMs:f,...x}),setTimeout(()=>{this.doRestart(e,i).then(u=>{u?(i=0,e.status="ok"):a(null)})},f)};e.downstream.onExit((x,f)=>a({code:x,signal:f}))}async spawnAndInitialize(e,i){let a=await oe(e.agentId,this.paths).catch(()=>null),x=a?xr(a):void 0,f=this.factory(e.framework,i,e.workspace,e.agentId,x);try{return await f.start(),await f.initialize(Gs),f}catch(u){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),u}}rewireSession(e,i){e.swap(i),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,i){let a=this.config.frameworksCache?.[e.framework];if(!a)return H.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;H.info("agent restart attempt",{agentId:e.agentId,attempt:i});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),H.info("agent restart succeeded",{agentId:e.agentId,attempt:i}),!0}catch(x){return H.warn("agent restart attempt failed",{agentId:e.agentId,attempt:i,err:String(x)}),!1}}async executeModelSwitch(e){let i=this.registry.get(e);if(!i)throw new E("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);H.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:i.framework}),await i.downstream.stop("switchModel").catch(u=>{H.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(u)})});let x;try{x=await this.spawnAndInitialize(i,a.path)}catch(u){throw new E("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${u instanceof Error?u.message:String(u)}`,{cause:u})}this.rewireSession(i,x);let f=[...i.sessions.entries()];for(let[u,h]of f)try{await x.sessionLoad({sessionId:h,cwd:i.workspace}),i.verifiedSessions.add(h)}catch(m){throw new E("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${u} (acp=${h}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}f.length>0&&H.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),i.status="ok",H.info("executeModelSwitch: success",{agentId:e,framework:i.framework})}};F();import{spawn as Oa}from"node:child_process";import{constants as Ws,access as za}from"node:fs/promises";import{delimiter as qa,join as Fa}from"node:path";var Ua=N("framework-detector"),Js={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ha=[".exe",".cmd",".bat",".ps1"],Ct=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??Oa,access:e.access??za}}async detect(e){let i=Js[e],a=await this.which(i);if(!a)return Ua.debug("framework binary not found",{framework:e,bin:i}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Js).map(async a=>[a,await this.detect(a)])),i={};for(let[a,x]of e)x&&(i[a]=x);return i}async which(e){let i=this.env.pathEnv.split(qa).filter(Boolean),a=this.env.platform==="win32"?["",...Ha]:[""];for(let x of i)for(let f of a){let u=Fa(x,e+f);if(await this.isExecutable(u))return u}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Ws.F_OK:Ws.X_OK;return await this.env.access(e,i),!0}catch{return!1}}async probeVersion(e){return new Promise(i=>{let a="",x=!1,f,u=h=>{x||(x=!0,f&&clearTimeout(f),i(h.trim()||"unknown"))};try{let h=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{h.kill("SIGKILL"),u("unknown")},5e3),h.stdout?.on("data",m=>{a+=m.toString("utf8")}),h.on("error",()=>u("unknown")),h.on("close",()=>{let m=ja(a).split(/\r?\n/)[0]??"";u(m)})}catch{u("unknown")}})}},Ka=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function ja(r){return r.replace(Ka,"")}ir();xe();function fn(r){return qt(r??K().configFile)}function Dt(r,e){return Ft(e??K().configFile,r)}Ue();F();var X=N("core"),Ga=5*6e4,Wa=3e4,un=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new ut;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,i){this.extensions[e]=i}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),X.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){X.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),this.attachDownstreamHooks(e),X.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let i of this.registerHandlers)try{i(e.agentId)}catch(a){X.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)&&X.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(i=>{this.forwardUpdate(e,i)}),e.downstream.onAgentRequest(i=>{this.handleAgentRequest(e,i)}),e.downstream.onExit((i,a)=>{X.warn("agent downstream exited",{agentId:e.agentId,code:i,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(en(e)){this.handleUpstreamResponse(e);return}if(Qt(e))try{if(e.method.startsWith("_agent/")){let i=this.extensions[e.method];if(!i){await this.sendError(e.id,U.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await i(e,this);await this.upstream.send(ft(e.id,a));return}if(e.method.startsWith("session/")){let i=await this.routeSessionMethod(e);await this.upstream.send(ft(e.id,i));return}if(e.method==="initialize"){await this.upstream.send(ft(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,U.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(i){X.error("handleFrame failed",{method:e.method,err:String(i)}),await this.upstream.send(Xe(e.id,tn(i)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new E("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,a=i._meta?.cozeAgentId;if(!a)throw new E("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new E("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new E("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new E("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),u=!1;try{let h=await x.msgQueue.enqueue(()=>this.dispatchSessionCall(x,e.method,i));return u=!0,h}finally{X.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:u})}}async dispatchSessionCall(e,i,a){e.lastActiveAt=Date.now();let{stripped:x}=Ss(a);switch(i){case"session/new":{let f=x;return await e.downstream.sessionNew({...f,cwd:f.cwd||e.workspace})}case"session/load":{let f=x,u=f.sessionId,h=e.sessions.get(u);try{let m=h??u,w=await e.downstream.sessionLoad({...f,sessionId:m,cwd:f.cwd||e.workspace});return h||e.sessions.set(u,m),w}catch(m){X.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,err:String(m)});let w=await e.downstream.sessionNew({cwd:f.cwd||e.workspace});return e.sessions.set(u,w.sessionId),{}}}case"session/prompt":{let f=x,u=f.sessionId,h=e.sessions.get(u),m=!1;if(h&&!e.verifiedSessions.has(h))try{await e.downstream.sessionLoad({sessionId:h,cwd:e.workspace}),e.verifiedSessions.add(h),X.info("session restored via session/load",{agentId:e.agentId,cloudId:u,acpId:h})}catch(_){X.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,acpId:h,err:String(_)}),e.sessions.delete(u),h=void 0}h||(h=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(u,h),e.verifiedSessions.add(h),m=!0);let w=a._meta?.cozeTriggerMsgId;w?e.activeTriggers.set(h,w):e.activeTriggers.delete(h);let y=await e.downstream.sessionPrompt({...f,sessionId:h});return m&&this.persistSessionMapping(e),y}case"session/cancel":{let u=x.sessionId;if(!u)throw new E("IPC_BAD_REQUEST","session/cancel: missing sessionId");let h=e.sessions.get(u);return h&&await e.downstream.sessionCancel({sessionId:h}),{ok:!0}}default:throw new E("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(e,i){let a=i.sessionId,x=this.reverseSessionId(e,a);if(!x){X.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let f={cozeAgentId:e.agentId},u=e.activeTriggers.get(a);u&&(f.cozeTriggerMsgId=u),this.upstream.send(Os("session/update",{...i,sessionId:x,_meta:f})).catch(h=>X.warn("forward update failed",{agentId:e.agentId,err:String(h)}))}handleAgentRequest(e,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(e,i);return}X.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:i.method}),e.downstream.respondAgentRequestError(i.id,{code:U.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${i.method}`})}forwardPermissionRequest(e,i){let a=this.upstreamIds.next("session/request_permission"),x=i.params??{},u=x.sessionId,h=u?e.activeTriggers.get(u):void 0,m={cozeAgentId:e.agentId};h&&(m.cozeTriggerMsgId=h);let w=u?this.reverseSessionId(e,u):void 0,y={...x,...w?{sessionId:w}:{},_meta:m},_=setTimeout(()=>{let C=this.pendingUpstream.get(a);C&&(this.pendingUpstream.delete(a),X.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(C.agentRequestId,{outcome:{kind:"cancelled"}}))},Ga);this.pendingUpstream.set(a,{agentRequestId:i.id,session:e,method:i.method,timer:_}),this.upstream.send(ct(a,"session/request_permission",y)).catch(C=>{let L=this.pendingUpstream.get(a);L&&(clearTimeout(L.timer),this.pendingUpstream.delete(a)),X.error("forward permission request failed",{agentId:e.agentId,err:String(C)}),e.downstream.respondAgentRequestError(i.id,{code:U.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),clearTimeout(i.timer),e.error?i.session.downstream.respondAgentRequestError(i.agentRequestId,e.error):i.session.downstream.respondAgentRequest(i.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 $t(e.error)):a.resolve(e.result);return}X.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,a=Wa){let x=this.upstreamIds.next(e);return new Promise((f,u)=>{let h=setTimeout(()=>{this.pendingBridge.delete(x),u(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:f,reject:u,timer:h}),this.upstream.send(ct(x,e,i)).catch(m=>{let w=this.pendingBridge.get(x);w&&(clearTimeout(w.timer),this.pendingBridge.delete(x)),u(m)})})}async persistSessionMapping(e){if(this.paths)try{await ar(e.agentId,e.sessions,this.paths)}catch(i){X.warn("persist session mapping failed",{agentId:e.agentId,err:String(i)})}}reverseSessionId(e,i){for(let[a,x]of e.sessions.entries())if(x===i)return a}sendError(e,i,a){return this.upstream.send(Xe(e,{code:i,message:a}))}};F();xe();import{randomBytes as Ja}from"node:crypto";import{chmod as Va,mkdir as Ya,writeFile as Vs}from"node:fs/promises";import{createServer as Xa}from"node:http";import{dirname as Za}from"node:path";var $a=1e6,fr=N("ipc"),dn=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??K()}async start(){this.token=Ja(32).toString("hex");let e=Xa((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 i=e.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),fr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((i,a)=>{e.close(x=>x?a(x):i())}),this.server=null)}async persistAuthFiles(){await Ya(Za(this.paths.portFile),{recursive:!0}),await Vs(this.paths.portFile,String(this.port),"utf8"),await Vs(this.paths.tokenFile,this.token,"utf8");try{await Va(this.paths.tokenFile,384)}catch(e){fr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){At(i,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){At(i,404,{error:"not found"});return}let u=null;if(e.method==="POST")try{u=await Qa(e)}catch(h){At(i,400,{error:"invalid json",detail:String(h)});return}try{let h=await f.handler(u,e);At(i,200,h??{ok:!0})}catch(h){fr.error("IPC handler failed",{key:x,err:String(h)}),At(i,500,{error:h instanceof Error?h.message:String(h)})}}};function At(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function Qa(r){let e=[],i=0;for await(let x of r){let f=x;if(i+=f.length,i>$a)throw new Error("body too large");e.push(f)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var vo=ke(ii(),1);var Rc=ke(eo(),1),Bc=ke(kn(),1),Mc=ke(ht(),1),Oc=ke(Sr(),1),zc=ke(Dr(),1),qc=ke(Lr(),1),co=ke(Ln(),1),Fc=ke(xo(),1);var fo=co.default;F();var Rn="1008033",uo="1289";var lo="pbbp2",ho="https://www.coze.cn",go="/api/coze_claw/resource/get_frontier_key",Uc="https://www.coze.cn",Hc="wss://frontier.coze.cn";function po(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Uc}function mo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Hc}function Bn(r){let e={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(e["x-tt-env"]=i),a&&(e["x-use-ppe"]=a),e}var ne=N("upstream.frontier"),_o="application/json",yo="none",Mn=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:ho,...Bn(this.opts.ppeOverride)};class i extends fo{constructor(h){super(h,lo,{headers:e})}send(h,...m){if(vs("debug"))try{let w;typeof h=="string"?w=Buffer.from(h,"utf8"):h instanceof Buffer?w=h:h instanceof ArrayBuffer?w=new Uint8Array(h):ArrayBuffer.isView(h)?w=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):w=new Uint8Array(0);let y=Buffer.from(w.slice(0,128)).toString("hex");ne.debug("WS raw frame out",{bytes:w.byteLength,headHex:y})}catch(w){ne.warn("WS raw frame dump failed",{err:String(w)})}super.send(h,...m)}}let a=mo(this.opts.urlOverride),x={url:a,ws:i,fpID:uo,aID:Rn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:_o,force:!0},payloadEncoding:{encoding:yo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new vo.FWS(x);f.onopen=()=>{this.opened=!0,this.openCount+=1;let u=this.openCount===1;ne.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:u,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:u})).catch(h=>ne.warn("onConnect handler threw (ignored)",{err:String(h)}))},f.onclose=u=>{this.opened=!1,ne.info("frontier closed",{code:u.code,reason:u.reason,willReconnect:u.willReconnect})},f.onerror=u=>{ne.warn("frontier error",{code:u.code,msg:u.message})},f.onmessage=u=>this.handleMessage(u),this.fws=f,await f.connect()}async stop(e){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,e??"bridge shutdown")}catch(a){ne.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let i=this.fws;if(!i)throw new E("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;ne.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await i.send(a,{service:33555712,method:1,payloadType:_o,payloadEncoding:yo})}catch(f){throw new E("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}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 a=Gc(e);if(!a){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:a.length});return}let x;try{x=JSON.parse(a)}catch(f){ne.warn("frontier message JSON parse failed",{err:String(f),head:a.slice(0,80)});return}ne.info("frontier frame in",{logid:jc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(f=>ne.warn("frontier frame handler threw",{err:String(f)}))}};function jc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Gc(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}}F();function So(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var bo=N("handshake");async function Eo(r){let e=po(r.endpoint),i=r.timeoutMs??1e4,a=`${Wc(e)}${go}?aid=${encodeURIComponent(Rn)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Bn(r.ppeOverride)},f=new AbortController,u=setTimeout(()=>f.abort(),i);bo.info("frontier key handshake",{base:e});try{let h=await fetch(a,{method:"GET",headers:x,signal:f.signal}),m=h.headers.get("x-tt-logid")??"",w=h.headers.get("x-tt-trace-id")??"";if(!h.ok){let L=await h.text().catch(()=>"");throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${h.status} logid=${m}: ${L.slice(0,200)}`)}let y=await h.json();if(y.code!==void 0&&y.code!==0)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${y.code} msg=${y.msg??"-"} logid=${m}`);let _=y.data?.access_key,C=y.data?.device_id;if(!_||!C)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(y)}`);return bo.info("handshake ok",{remoteDeviceId:C,logid:m,traceId:w}),{accessKey:_,deviceId:C}}catch(h){throw h instanceof E?h:h.name==="AbortError"?new E("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new E("UPSTREAM_HANDSHAKE_FAILED",String(h),{cause:h})}finally{clearTimeout(u)}}function Wc(r){return r.endsWith("/")?r.slice(0,-1):r}F();var Rr=N("upstream.switchable"),On=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,i){if(this.inner===e)return;Rr.info("swap upstream",{reason:i});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 Rr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(i??"swapped").catch(x=>Rr.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 Br=N("upstream"),Mt=class{handler=null;async start(){Br.info("NoopUpstream started (M1 skeleton; real Frontier wired in M4)")}async stop(e){Br.info("NoopUpstream stopped",{reason:e})}async send(e){Br.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();xe();F();xe();import{readFileSync as Jc,unlinkSync as Vc}from"node:fs";import{mkdir as Yc,readFile as Co,unlink as Do,writeFile as Xc}from"node:fs/promises";import{dirname as Zc}from"node:path";var $c=N("single-instance"),zn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??K().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&&($c.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Yc(Zc(this.pidFile),{recursive:!0}),await Xc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Co(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Co(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{return process.kill(e,0),!0}catch(i){return i.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Jc(this.pidFile,"utf8").trim()===String(process.pid)&&Vc(this.pidFile)}catch{}})}};var O=N("daemon"),Qc="coze-bridge-daemon";async function ko(){let r=new zn({processTitle:Qc}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let i=await fn(),a=i??{};or({pid:process.pid}),O.info(i?"loaded bridge config":"initialized bridge config");try{let k=new Ct;a.frameworksCache=await k.detectAll(),O.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(k){O.warn("framework detection failed",{err:String(k)})}await Dt(a);let x=new On(new Mt),f=K(),u=new un({upstream:x,paths:f});await tf(f,u);let h=new cn({paths:f,config:a,registry:u,healthReporter:async k=>{await u.sendRequest("_agent/health",k)}}),m,w,y=null,_=null;u.registerExtension("_agent/create",async k=>h.createAgent(k.params)),u.registerExtension("_agent/health",async()=>({ok:!0}));let C=new Xt({agents:u.agents,disposeAndMarkDisconnected:async(k,M)=>{let G=u.agents.get(k);G&&(await G.dispose(`disconnect: ${M}`).catch(Se=>O.warn("dispose during disconnect failed (ignored)",{agentId:k,err:String(Se)})),G.status="disconnected",u.unregister(k)),u.disconnectedAgents.add(k)},executeModelSwitch:k=>h.executeModelSwitch(k)});u.registerExtension("_agent/listSkills",k=>C.listSkills(k.params)),u.registerExtension("_agent/addSkills",k=>C.addSkills(k.params)),u.registerExtension("_agent/removeSkills",k=>C.removeSkills(k.params)),u.registerExtension("_agent/getFileTree",k=>C.getFileTree(k.params)),u.registerExtension("_agent/getFileContent",k=>C.getFileContent(k.params)),u.registerExtension("_agent/update",k=>C.updateAgent(k.params)),u.registerExtension("_agent/disconnect",k=>C.disconnectAgent(k.params)),u.registerExtension("_agent/switchModel",k=>C.switchModel(k.params));let L=new Wt({paths:f,handlers:C,sendDetail:k=>u.sendRequest("_agent/detail",k)});x.onConnect(({initial:k})=>{O.info("frontier upstream connected, triggering detail sync",{initial:k}),L.syncAll(k?"initial-connect":"reconnect").catch(M=>O.warn("detail sync top-level error (ignored)",{err:String(M)}))});let T=new dn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...u.agents.keys()],deviceId:y??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async k=>{let M=k,G=M?.privatecode,Se=M?.pairing_code;if(!G||!Se)throw new E("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let Be=So(M.env),me=M.handshake_url,we=M.frontier_url,he=ef(M.env,me,we),rt=!!m&&m!==G,Ot=w!==void 0&&w!==he;if(rt||Ot){O.warn("pair config switched, resetting agents",{pcChanged:rt,envChanged:Ot,previousPc:m?Ao(m):"",nextPc:Ao(G),previousEnvKey:w??"",nextEnvKey:he});for(let De of[...u.agents.values()])await De.dispose("pair config switch").catch(()=>{}),u.agents.delete(De.agentId);await x.swap(new Mt,"pair switch").catch(()=>{})}let zt=await Eo({privatecode:G,...me?{endpoint:me}:{},ppeOverride:Be});y=zt.deviceId,or({deviceId:y,pid:process.pid});let Ee=new Mn({handshake:zt,privatecode:G,...we?{urlOverride:we}:{},ppeOverride:Be});await x.swap(Ee,"pair"),m=G,w=he;let Ce=Object.keys(a.frameworksCache??{});try{let De=await u.sendRequest("_agent/pair",{pairCode:Se,patToken:G,frameworks:Ce,_meta:{cozeDeviceId:y}});O.info("_agent/pair ok",{pairResult:De}),_||(_=new Zt({core:u,getDeviceId:()=>y??""})),_.start();let Q;return M.agent_id&&(Q=await nf(M.agent_id,f,h,We=>u.sendRequest("_agent/detail",We)).catch(We=>(O.error("--agent-id ensureAgent failed",{agentId:M.agent_id,err:String(We)}),{ok:!1,agentId:M.agent_id??"",note:String(We)}))),{ok:!0,note:"paired with cloud",...Q?{agent:Q}:{}}}catch(De){return O.error("_agent/pair failed",{err:String(De)}),{ok:!1,note:`pair failed: ${String(De)}`}}}},{method:"POST",path:"/_agent/create",handler:async k=>{let M=k;return{ok:!0,result:await h.createAgent(M)}}},{method:"POST",path:"/refresh",handler:async()=>{O.info("IPC /refresh: re-detecting frameworks");let k=new Ct;return a.frameworksCache=await k.detectAll(),await Dt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(O.info("IPC /shutdown received"),setImmediate(()=>{ae.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:R,token:j}=await T.start();await u.start(),rf(f,h).catch(k=>O.warn("auto-revive top-level error (ignored)",{err:String(k)}));let re=null,ae={port:R,token:j,core:u,ipc:T,shutdown(k){return re||(O.info("daemon shutdown",{reason:k}),re=(async()=>{_?.stop(),await u.stop(k),await T.stop(),await r.release()})(),re)}};for(let k of["SIGTERM","SIGINT"])process.on(k,()=>{ae.shutdown(k).then(()=>process.exit(0))});return O.info("daemon ready",{port:R,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ae}function Ao(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function ef(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function tf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Ue(),Gt));for(let u of a){await f(u,r).catch(h=>O.warn("enforceAgentConfigMode failed (ignored)",{agentId:u,err:String(h)}));try{let h=await x(u,r);h?.disconnectedAt&&(e.disconnectedAgents.add(u),O.info("agent marked disconnected on startup",{agentId:u,disconnectedAt:h.disconnectedAt,reason:h.disconnectReason??""}))}catch(h){O.warn("failed to load agent config on startup, skipping",{agentId:u,err:String(h)})}}}async function nf(r,e,i,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ue(),Gt)),f=await x(r,e);if(f){O.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let m={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.modelToken?{modelToken:f.modelToken}:{}};return await i.createAgent(m),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}O.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let u=await a({_meta:{cozeAgentId:r}});if(!u.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 h={agentId:u.agentId,framework:u.framework,...u.cozeIdentity?{cozeIdentity:u.cozeIdentity}:{},...u.model?{model:u.model}:{},...u.modelToken?{modelToken:u.modelToken}:{},...u.deployType?{_meta:{cozeDeployType:u.deployType}}:{}};return await i.createAgent(h),{ok:!0,agentId:r,note:u.deployType==="cloud"?"cloud agent acknowledged":"created from cloud detail"}}async function rf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.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(()=>(Ue(),Gt));O.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,u=0;for(let h of a){let m;try{m=await x(h,r)}catch(w){O.warn("auto-revive: load config failed (skipping)",{agentId:h,err:String(w)}),u+=1;continue}if(!m){u+=1;continue}if(m.disconnectedAt){O.info("auto-revive: skip disconnected agent",{agentId:h,disconnectedAt:m.disconnectedAt}),u+=1;continue}try{O.info("auto-revive: spawning",{agentId:h,framework:m.framework}),await e.createAgent({agentId:m.agentId,framework:m.framework,...m.cozeIdentity?{cozeIdentity:m.cozeIdentity}:{},...m.model?{model:m.model}:{},...m.modelToken?{modelToken:m.modelToken}:{}}),f+=1}catch(w){O.warn("auto-revive: createAgent failed (skipping)",{agentId:h,framework:m.framework,err:String(w)}),u+=1}}return O.info("auto-revive: done",{revived:f,skipped:u,total:a.length}),{revived:f,skipped:u,total:a.length}}Or();xe();import{readFile as Po}from"node:fs/promises";var Ge=class{paths;constructor(e){this.paths=e??K()}async probe(e=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let a=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:lf(a)}}}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([Po(this.paths.portFile,"utf8"),Po(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=i.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,i){let a=i.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let f=new AbortController,u=setTimeout(()=>f.abort(),i.timeoutMs??5e3);try{let h=await fetch(`http://127.0.0.1:${e.port}${i.path}`,{method:i.method,headers:x,body:a?JSON.stringify(i.body):void 0,signal:f.signal}),m=await h.text();return{status:h.status,body:df(m)}}finally{clearTimeout(u)}}};function df(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function lf(r){return r instanceof Error?r.message:String(r)}F();xe();import{copyFile as To,mkdir as hf,readFile as zr,writeFile as gf}from"node:fs/promises";import{dirname as pf,resolve as qr,sep as qn}from"node:path";import{fileURLToPath as mf}from"node:url";F();xe();var Lo=N("dist-install");function wf(r){let e=mf(r),i=pf(e),a=`${qn}src${qn}`;if(i.includes(a)||i.endsWith(`${qn}src${qn}cli`))return null;let x=qr(i,"index.js"),f=qr(i,"..","package.json");return{dist:x,pkgJson:f}}async function No(r={}){let e=r.paths??K(),i=wf(import.meta.url),a=r.sourceDist??i?.dist,x=r.sourcePackageJson??i?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await zr(x,"utf8")).version??"unknown"}catch(_){return Lo.warn("cannot read source package.json,skip dist install",{err:String(_)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(_)}`}}let u=await fn(e.configFile)??{},h=u.libVersion;if(h===f)try{return await zr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await hf(e.libDir,{recursive:!0}),await To(a,e.libEntry),await To(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=qr(e.libDir,"package.json"),w=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
-
`;return await
|
|
88
|
+
${x}`}var Ce=O("agent-detail-sync"),Zt=class{constructor(e){this.opts=e}opts;async syncAll(e){let i=this.opts.paths.agentsRoot,a;try{a=await na(i)}catch(x){Ce.info("agents dir not found, skip detail sync",{root:i,err:String(x)});return}Ce.info("starting detail sync",{reason:e,count:a.length});for(let x of a)try{await this.syncOne(x)}catch(f){Ce.warn("detail sync failed for agent, skipping",{agentId:x,err:String(f)})}Ce.info("detail sync done",{reason:e})}async syncOne(e){let i=await xe(e,this.opts.paths);if(!i){Ce.info("detail sync: agent config missing, skip",{agentId:e});return}let a;try{a=await this.opts.sendDetail({_meta:{cozeAgentId:e}})}catch(u){Ce.warn("detail RPC failed, using local data",{agentId:e,err:String(u)});return}if(a.agentId&&a.agentId!==e){Ce.warn("detail response agentId mismatch, ignoring",{agentId:e,responseAgentId:a.agentId});return}let x=!1,f=!1;if(a.agentName&&a.agentName!==i.agentName&&(i.agentName=a.agentName,x=!0),a.description!==void 0&&a.description!==i.description&&(i.description=a.description,x=!0),a.cozeIdentity&&a.cozeIdentity!==i.cozeIdentity&&(i.cozeIdentity=a.cozeIdentity,x=!0,f=!0),a.deployType&&Ce.info("detail.deployType",{agentId:e,deployType:a.deployType}),!x){Ce.debug("detail sync: no diff",{agentId:e});return}await he(i,this.opts.paths),Ce.info("detail sync: config updated",{agentId:e,identityChanged:f,agentName:i.agentName}),f&&(await Ve(i.workspace,i.framework,e,i.cozeIdentity),await this.opts.handlers.reloadAgentSessionsPublic(e,"detail-sync"))}};Ke();import{spawn as ra}from"node:child_process";import{mkdir as sa,readFile as Rs,readdir as ia,rm as oa,stat as en,writeFile as aa}from"node:fs/promises";import{join as Ne,normalize as xa,relative as Os,resolve as ca,sep as Bs}from"node:path";function $t(r){return r?.cozeDeployType==="cloud"?"cloud":"local"}function Es(r){let{_meta:e,...i}=r;return{stripped:i,meta:e}}function ct(r){if(!r?.cozeAgentId)throw new Error("missing _meta.cozeAgentId");return r.cozeAgentId}var E=class extends Error{code;retriable;cause;constructor(e,i,a){super(i),this.name="BridgeError",this.code=e,this.retriable=a?.retriable??!1,a?.cause!==void 0&&(this.cause=a.cause)}};K();fe();function Ye(r,e){if($t(r)!=="cloud")throw new E("OPERATION_NOT_ALLOWED_FOR_LOCAL",`${e} is not allowed for local agent`)}var ks="https://llm-gateway.coze.cn",Qt="auto";function dr(r){return{model:r.model??Qt,...r.modelToken?{modelToken:r.modelToken}:{}}}function As(r){return!r||r===Qt}function Ds(r){let e={};return r.modelToken&&(e.ANTHROPIC_BASE_URL=ks,e.ANTHROPIC_AUTH_TOKEN=r.modelToken),As(r.model)||(e.ANTHROPIC_MODEL=r.model),e}function Ts(r){let e=[];return As(r.model)||e.push("-c",`model="${r.model}"`),r.modelToken&&(e.push("-c",'model_provider="openai"'),e.push("-c",`model_provider_overrides.openai.base_url="${ks}/v1"`)),e}function Ps(r){return r.modelToken?{OPENAI_API_KEY:r.modelToken}:{}}var ee=O("agent-handlers"),Is=5*1024*1024,fa=1,ua=6,da=new Set(["node_modules",".git",".coze","dist","build",".next"]),la=3e4,tn=class{constructor(e){this.opts=e}opts;async listSkills(e){Ye(e._meta,"_agent/listSkills");let i=ct(e._meta),a=await this.loadAgentCfg(i),x=a?.workspace??Le(i).workspace,f=a?.skills??[],u=[];for(let g of f){let m=Ne(x,g.relPath,"SKILL.md");await en(m).then(v=>v.isFile()).catch(()=>!1)&&u.push({skillId:g.skillId,skillName:g.skillName,downloadUrl:g.downloadUrl??"",...g.description?{description:g.description}:{},...g.version?{version:g.version}:{}})}return{skills:u}}async addSkills(e){Ye(e._meta,"_agent/addSkills");let i=ct(e._meta),a=await this.requireAgentCfg(i),x=e.skills??[],f=[...a.skills??[]],u=new Map(f.map((m,_)=>[m.skillId,_])),g=[];for(let m of x){if(!m.skillName)throw new E("IPC_BAD_REQUEST","skill missing skillName");let _=ha(m.skillName),v=ga(a.framework),y=Ne(v,_),C=Ne(a.workspace,y);await sa(C,{recursive:!0});let T=await ma(m.downloadUrl);wa(T)?await ya(T,C):await aa(Ne(C,"SKILL.md"),T.toString("utf8"),"utf8");let P={skillId:m.skillId,skillName:m.skillName,relPath:y,installedAt:Date.now(),...m.description?{description:m.description}:{},...m.version?{version:m.version}:{},...m.downloadUrl?{downloadUrl:m.downloadUrl}:{}},R=u.get(m.skillId);R!==void 0?f[R]=P:(u.set(m.skillId,f.length),f.push(P)),g.push(m),ee.info("skill installed",{agentId:i,skillId:m.skillId,skillName:m.skillName,relPath:y})}return await Yt(i,f),await this.reloadAgentSessions(i,"skills-added"),{installedSkills:g}}async removeSkills(e){Ye(e._meta,"_agent/removeSkills");let i=ct(e._meta),a=await this.requireAgentCfg(i),x=new Set(e.skillIds??[]),f=a.skills??[],u=[];for(let g of f){if(!x.has(g.skillId)){u.push(g);continue}let m=Ne(a.workspace,g.relPath);await oa(m,{recursive:!0,force:!0}),ee.info("skill removed",{agentId:i,skillId:g.skillId,relPath:g.relPath})}return await Yt(i,u),await this.reloadAgentSessions(i,"skills-removed"),{ok:!0}}reloadAgentSessionsPublic(e,i){return this.reloadAgentSessions(e,i)}async reloadAgentSessions(e,i){let a=this.opts.agents.get(e);if(a&&a.framework!=="codex")for(let[x,f]of a.sessions)try{await a.downstream.sessionLoad({sessionId:f,cwd:a.workspace}),ee.info("session reloaded",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f})}catch(u){ee.warn("session reload failed",{reason:i,agentId:e,framework:a.framework,cloudId:x,acpId:f,err:String(u)})}}async updateAgent(e){if(!e.cozeIdentity?.trim())return ee.info("_agent/update: empty cozeIdentity, noop",{agentId:e.agentId}),{ok:!0};let i=e.agentId,a=await xe(i);if(!a)throw new E("AGENT_NOT_FOUND",`agent not found: ${i}`);return a.cozeIdentity===e.cozeIdentity?(ee.info("_agent/update: cozeIdentity unchanged, noop",{agentId:i}),{ok:!0}):(a.cozeIdentity=e.cozeIdentity,await he(a),await Ve(a.workspace,a.framework,i,e.cozeIdentity),ee.info("_agent/update: cozeIdentity rewritten",{agentId:i,framework:a.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 a=await xe(i);return a?(a.disconnectedAt=Date.now(),a.disconnectReason=e.reason??"",await he(a),ee.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}):(ee.warn("_agent/disconnect: agent not found, ignoring",{agentId:i}),{ok:!0})}async switchModel(e){if(Ye(e._meta,"_agent/switchModel"),!e.agentId)throw new E("IPC_BAD_REQUEST","_agent/switchModel: missing agentId");let i=e.model&&e.model.trim()?e.model:Qt,a=e.modelToken?.trim()||void 0,x=await xe(e.agentId);if(!x)throw new E("AGENT_NOT_FOUND",`agent not found: ${e.agentId}`);x.model=i,a!==void 0?x.modelToken=a:delete x.modelToken,await he(x),ee.info("_agent/switchModel: model/modelToken persisted",{agentId:e.agentId,model:i,hasToken:!!a,reason:e.reason??"",force:e.force??!1});let f=this.opts.agents.get(e.agentId);if(!f)return ee.info("_agent/switchModel: agent not running, config persisted only",{agentId:e.agentId}),{ok:!0};if(f.status==="switching")return ee.info("_agent/switchModel: already switching, params updated via config",{agentId:e.agentId}),{ok:!0};if(!this.opts.executeModelSwitch)throw new E("BRIDGE_INTERNAL","_agent/switchModel: executeModelSwitch callback not wired");f.status="switching";let u=f.msgQueue.enqueue(async()=>{}),g=setTimeout(()=>{ee.warn("_agent/switchModel: 30s idle timeout, forcing downstream stop",{agentId:e.agentId}),f.downstream.stop("switchModel idle timeout").catch(m=>ee.warn("force stop failed (ignored)",{agentId:e.agentId,err:String(m)}))},la);try{return await u.catch(m=>ee.warn("_agent/switchModel: msgQueue idle wait rejected (continuing)",{agentId:e.agentId,err:String(m)})),clearTimeout(g),await this.opts.executeModelSwitch(e.agentId),{ok:!0}}catch(m){clearTimeout(g),ee.error("_agent/switchModel: failed, marking disconnected",{agentId:e.agentId,err:String(m)});let _=await xe(e.agentId).catch(()=>null);throw _&&(_.disconnectedAt=Date.now(),_.disconnectReason=`model switch failed: ${m instanceof Error?m.message:String(m)}`,await he(_).catch(v=>ee.warn("write disconnect marker failed (ignored)",{err:String(v)}))),this.opts.disposeAndMarkDisconnected?await this.opts.disposeAndMarkDisconnected(e.agentId,`model switch failed: ${m instanceof Error?m.message:String(m)}`).catch(v=>ee.warn("disposeAndMarkDisconnected failed (ignored)",{err:String(v)})):f.status="disconnected",m instanceof E&&(m.code==="MODEL_SWITCH_FAILED"||m.code==="AGENT_NOT_FOUND")?m:new E("MODEL_SWITCH_FAILED",m instanceof Error?m.message:String(m),{cause:m})}}async getFileTree(e){Ye(e._meta,"_agent/getFileTree");let i=e._meta,a=ct(i),x=this.resolveWorkspace(a),f=e.filePath??"",u=this.safeJoin(x,f),g=await en(u).catch(()=>null);if(!g)throw new E("IPC_BAD_REQUEST",`path not found: ${f}`);let m=va(e.depth);return g.isDirectory()?{tree:await Ms(x,u,f,m)}:{tree:[{name:ba(f),path:zs(f||"."),isDir:!1,size:g.size,modifiedAt:Math.floor(g.mtimeMs)}]}}async getFileContent(e){Ye(e._meta,"_agent/getFileContent");let i=ct(e._meta),a=this.resolveWorkspace(i);if(!e.filePath)throw new E("IPC_BAD_REQUEST","filePath required");let x=this.safeJoin(a,e.filePath),f=await en(x).catch(()=>null);if(!f||!f.isFile())throw new E("IPC_BAD_REQUEST",`not a file: ${e.filePath}`);if(f.size>Is)throw new E("IPC_BAD_REQUEST",`file too large: ${f.size} bytes (max ${Is})`);let u=await Rs(x);return u.includes(0)?{content:u.toString("base64"),encoding:"base64",size:f.size}:{content:u.toString("utf8"),encoding:"utf-8",size:f.size}}resolveWorkspace(e){let i=this.opts.agents.get(e);return i?i.workspace:Le(e).workspace}safeJoin(e,i){let a=ca(e,i||"."),x=Os(e,a);if(x.startsWith("..")||x===".."||x.startsWith(`..${Bs}`))throw new E("IPC_BAD_REQUEST",`path escapes workspace: ${i}`);return a}loadAgentCfg(e){return xe(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 ha(r){let e=r.trim().replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64);if(!e||e==="."||e==="..")throw new E("IPC_BAD_REQUEST",`invalid skill name: ${r}`);return e}function ga(r){return r==="claude-code"?Ne(".claude","skills"):Ne(".agents","skills")}var pa=3e4,Ls=50*1024*1024,Ns=3e4;async function ma(r){if(!r)throw new E("IPC_BAD_REQUEST","skill missing downloadUrl");if(r.startsWith("data:"))return _a(r);if(r.startsWith("file:")){let e=new URL(r).pathname,i=await Rs(e);if(i.length>Ls)throw new E("IPC_BAD_REQUEST",`skill too large: ${i.length} bytes`);return i}if(r.startsWith("http://")||r.startsWith("https://")){let e=new AbortController,i=setTimeout(()=>e.abort(),pa);try{let a=await fetch(r,{signal:e.signal});if(!a.ok)throw new E("IPC_BAD_REQUEST",`fetch skill failed HTTP ${a.status} ${r}`);let x=await a.arrayBuffer();if(x.byteLength>Ls)throw new E("IPC_BAD_REQUEST",`skill too large: ${x.byteLength} bytes`);return Buffer.from(x)}finally{clearTimeout(i)}}throw new E("IPC_BAD_REQUEST",`unsupported downloadUrl scheme (\u8981 https/data/file): ${r.slice(0,80)}`)}function _a(r){let e=/^data:([^,;]*)(;base64)?,(.*)$/s.exec(r);if(!e)throw new E("IPC_BAD_REQUEST","bad data URL");let i=!!e[2],a=e[3]??"";return i?Buffer.from(a,"base64"):Buffer.from(decodeURIComponent(a),"utf8")}function wa(r){return r.length>=2&&r[0]===31&&r[1]===139}async function ya(r,e){await new Promise((i,a)=>{let x=ra("tar",["-xzf","-","-C",e,"--strip-components=1"],{stdio:["pipe","pipe","pipe"]}),f="";x.stderr?.on("data",g=>{f+=String(g)});let u=setTimeout(()=>{x.kill("SIGKILL"),a(new E("IPC_BAD_REQUEST",`tar extract timeout (${Ns}ms)`))},Ns);x.on("error",g=>{clearTimeout(u),a(new E("IPC_BAD_REQUEST",`tar spawn failed: ${g.message}`,{cause:g}))}),x.on("exit",g=>{clearTimeout(u),g===0?i():a(new E("IPC_BAD_REQUEST",`tar exit ${g}${f?`: ${f.trim().slice(0,200)}`:""}`))}),x.stdin?.end(r)})}async function Ms(r,e,i,a){if(a<=0)return[];let x;try{x=await ia(e,{withFileTypes:!0})}catch{return[]}let f=[];for(let u of x){if(da.has(u.name))continue;let g=Ne(e,u.name),m=xa(Ne(i,u.name)),_=null;try{_=await en(g)}catch{continue}let v={name:u.name,path:zs(Os(r,g)),isDir:_.isDirectory(),size:_.size,modifiedAt:Math.floor(_.mtimeMs)};_.isDirectory()&&a>1&&(v.children=await Ms(r,g,m,a-1)),f.push(v)}return f.sort((u,g)=>u.isDir!==g.isDir?u.isDir?-1:1:u.name.localeCompare(g.name)),f}function va(r){return!r||r<=0?fa:Math.min(r,ua)}function ba(r){if(!r||r==="."||r==="/")return".";let e=r.split(/[/\\]/);return e[e.length-1]||"."}function zs(r){return r.split(Bs).join("/")}K();var Dt=O("agent-health-reporter"),Sa=3e4,nn=class{constructor(e){this.opts=e;this.intervalMs=e.intervalMs??Sa}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=[...this.opts.core.agents.values()];for(let a of i){let x=Ca(a);if(!x)continue;let f={status:x,_meta:{cozeAgentId:a.agentId,cozeDeviceId:e}};try{await this.opts.core.sendRequest("_agent/health",f)}catch(u){Dt.warn("heartbeat send failed",{agentId:a.agentId,status:x,err:String(u)})}}}finally{this.inFlight=!1}}};function Ca(r){return r.status==="error"?"error":r.activeTriggers.size>0?"busy":r.status==="ok"||r.status==="degraded"?"online":null}Ke();import{mkdir as lr,rm as Ra}from"node:fs/promises";import{spawn as Ta}from"node:child_process";function ft(r,e,i){return i===void 0?{jsonrpc:"2.0",id:r,method:e}:{jsonrpc:"2.0",id:r,method:e,params:i}}function qs(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 rn=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)}},H={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_SWITCHING:-32007,MODEL_SWITCH_FAILED:-32008};function sn(r){return"method"in r&&"id"in r&&r.id!==void 0}function Fs(r){return"method"in r&&!("id"in r)}function on(r){return!("method"in r)&&"id"in r}var Ea={AGENT_NOT_FOUND:H.AGENT_NOT_FOUND,AGENT_BUSY:H.AGENT_BUSY,AGENT_DISCONNECTED:H.AGENT_DISCONNECTED,AGENT_TIMEOUT:H.AGENT_TIMEOUT,AGENT_SPAWN_FAILED:H.AGENT_SPAWN_FAILED,AGENT_PROTOCOL_ERROR:H.INTERNAL_ERROR,BRIDGE_CONFIG_INVALID:H.INTERNAL_ERROR,BRIDGE_INTERNAL:H.INTERNAL_ERROR,IPC_AUTH_FAILED:H.INTERNAL_ERROR,IPC_BAD_REQUEST:H.INVALID_REQUEST,MODEL_SWITCHING:H.MODEL_SWITCHING,MODEL_SWITCH_FAILED:H.MODEL_SWITCH_FAILED,OPERATION_NOT_ALLOWED_FOR_LOCAL:H.OPERATION_NOT_ALLOWED_FOR_LOCAL,UPSTREAM_DISCONNECTED:H.INTERNAL_ERROR,UPSTREAM_HANDSHAKE_FAILED:H.INTERNAL_ERROR};function an(r){return r instanceof E?{code:Ea[r.code]??H.INTERNAL_ERROR,message:r.message,data:{bridgeCode:r.code,retriable:r.retriable}}:{code:H.INTERNAL_ERROR,message:r instanceof Error?r.message:String(r)}}function Us(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 Ks(r){return`${JSON.stringify(r)}
|
|
89
|
+
`}var xn=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(`
|
|
90
|
+
`);this.buffer=i.pop()??"";let a=[];for(let x of i){let f=x.replace(/\r$/,"").trim();if(f)try{a.push(JSON.parse(f))}catch(u){this.onError?.({line:f,error:u})}}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(i){return this.onError?.({line:e,error:i}),[]}}};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",initialize:"initialize"},Fu=Object.fromEntries(Object.entries(Ws).map(([r,e])=>[e,r])),ka={"session.prompt":["agentId","triggerMsgId","sessionId"],"session.cancel":["agentId","triggerMsgId","sessionId"],"session.new":["agentId"],"session.load":["agentId"],"agent.create":["agentId"],"agent.health":["agentId"],"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.pair":[],initialize:[]},dt=class{seq=0;next(e,i){this.seq+=1;let a=Ws[e]??Aa(e),x=ka[a]??[],f=[a,String(this.seq)];if(x.length>0){let u=x.map(m=>Hs(i?.[m]??"")),g=Da(u).join(":");g&&f.push(g)}else i&&Object.values(i).some(u=>u)&&f.push(Object.values(i).filter(Boolean).map(u=>Hs(String(u))).join(":"));return f.join("_")}reset(){this.seq=0}};function Aa(r){return r.replace(/[\s/]+/g,".").replace(/_+/g,"-")}function Hs(r){return r.replace(/[:_\s]+/g,"-")}function Da(r){let e=r.length;for(;e>0&&!r[e-1];)e-=1;return r.slice(0,e)}K();var Pa=3e4;function js(r,e){if(!(typeof r!="number"||r<=0))try{process.platform==="win32"?process.kill(r,e):process.kill(-r,e)}catch{}}var He=class{constructor(e){this.opts=e;this.log=O(`downstream.${this.constructor.name}`),this.decoder=new xn({onError:i=>this.log.warn("decode line failed",{line:i.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 E("BRIDGE_INTERNAL","Downstream already started");let e=process.platform!=="win32",i=Ta(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",a=>{for(let x of this.decoder.push(a))this.dispatch(x)}),i.stderr?.setEncoding("utf8"),i.stderr?.on("data",a=>{this.log.debug("stderr",{text:a.trimEnd()})}),i.on("exit",(a,x)=>{this.stopped=!0,this.failAllPending(new E("AGENT_PROTOCOL_ERROR",`agent exited (${a}/${x})`));for(let f of this.exitHandlers)f(a,x)}),i.on("error",a=>{this.log.error("child error",{err:String(a)}),this.failAllPending(new E("AGENT_SPAWN_FAILED",String(a),{cause:a}))}),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,a=new Promise(f=>i.once("exit",()=>f()));js(i.pid,"SIGTERM");let x=setTimeout(()=>{i.killed||js(i.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){if(!this.child||this.stopped)return;let i=this.idAllocator.next("session/cancel");this.writeFrame(ft(i,"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(a){this.log.warn("respondAgentRequest write failed",{id:e,err:String(a)})}}respondAgentRequestError(e,i){if(!(!this.child||this.stopped))try{this.writeFrame(Xe(e,i))}catch(a){this.log.warn("respondAgentRequestError write failed",{id:e,err:String(a)})}}onExit(e){this.exitHandlers.push(e)}call(e,i,a=Pa){if(!this.child||this.stopped)return Promise.reject(new E("AGENT_PROTOCOL_ERROR","downstream not started"));let x=this.idAllocator.next(e),f=ft(x,e,i),u=a>0&&Number.isFinite(a);return new Promise((g,m)=>{let _=u?setTimeout(()=>{this.pending.delete(x),m(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a):null;this.pending.set(x,{resolve:g,reject:m,timer:_,method:e});try{this.writeFrame(f)}catch(v){_&&clearTimeout(_),this.pending.delete(x),m(v)}})}writeFrame(e){if(!this.child?.stdin||this.child.stdin.destroyed)throw new E("AGENT_PROTOCOL_ERROR","downstream stdin not writable");this.child.stdin.write(Ks(e))}dispatch(e){if(on(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(Us(e.error)):i.resolve(e.result);return}if(Fs(e)){if(e.method==="session/update")for(let i of this.updateHandlers)Promise.resolve(i(e.params)).catch(a=>this.log.warn("update handler failed",{err:String(a)}));else this.log.debug("unknown notification",{method:e.method});return}if(sn(e)){let i=e;this.handleAgentRequest(i).catch(a=>this.log.error("agent request handler failed",{method:i.method,err:String(a)}))}}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(a){this.log.error("agentRequestHandler threw",{method:e.method,err:String(a)});try{this.writeFrame(Xe(e.id,an(a)))}catch{}}}failAllPending(e){for(let i of this.pending.values())i.timer&&clearTimeout(i.timer),i.reject(e);this.pending.clear()}};var Ia="@zed-industries/claude-code-acp@latest";function La(r){let e={};for(let[i,a]of Object.entries(r))a!==void 0&&(i.startsWith("CLAUDE")||i==="AI_AGENT"||i==="BAGGAGE"||(e[i]=a));return e}var cn=class extends He{framework="claude-code";constructor(e){let i=e.command??"npx",a=e.args??["-y",Ia],x={command:i,args:a,cwd:e.cwd,...e.env?{env:e.env}:{}};super(x)}sanitizeEnv(e){return La(e)}};var Na="@zed-industries/codex-acp@latest",fn=class extends He{framework="codex";constructor(e){let i=e.command??"npx",a=e.args??["-y",Na],x=e.extraArgs?[...a,...e.extraArgs]:a,f={command:i,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f)}};import{spawn as Gs}from"node:child_process";K();var un=class extends He{framework="openclaw";registerLog;profile;agentId;sessionName;registered=!1;constructor(e){let i=e.profile??"coze",a=e.sessionName??"default",x=["--profile",i,"acp","--session",`agent:${e.agentId}:${a}`],f={command:e.command,args:x,cwd:e.cwd,...e.env?{env:e.env}:{}};super(f),this.profile=i,this.agentId=e.agentId,this.sessionName=a,this.registerLog=O("downstream.openclaw.register")}async start(){await this.registerAgent().catch(e=>{this.registerLog.warn("openclaw agents add failed (will continue to acp anyway)",{agentId:this.agentId,err:String(e)})}),await super.start()}registerAgent(){return new Promise((e,i)=>{let a=Gs(this.opts.command,["--profile",this.profile,"agents","add",this.agentId,"--workspace",this.opts.cwd,"--non-interactive"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",i),a.on("close",f=>{f===0?(this.registered=!0,this.registerLog.info("agent registered",{agentId:this.agentId,profile:this.profile}),e()):i(new E("AGENT_SPAWN_FAILED",`openclaw agents add ${this.agentId} exited ${f}: ${x.trim()}`))})})}async cleanup(e){this.registered&&await new Promise(i=>{let a=Gs(this.opts.command,["--profile",this.profile,"agents","delete",this.agentId,"--force"],{stdio:["ignore","pipe","pipe"],env:{...process.env,...this.opts.env}}),x="";a.stderr?.on("data",f=>{x+=f.toString("utf8")}),a.on("error",f=>{this.registerLog.warn("openclaw agents delete failed (best-effort)",{agentId:this.agentId,err:String(f)}),i()}),a.on("close",f=>{f===0?this.registerLog.info("agent unregistered",{agentId:this.agentId}):this.registerLog.warn("openclaw agents delete non-zero exit",{agentId:this.agentId,code:f,stderr:x.trim()}),this.registered=!1,i()})})}get acpSessionName(){return this.sessionName}};K();fe();var dn=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,a)=>{this.slots.push({task:e,resolve:i,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 i=await e.task();e.resolve(i)}catch(i){e.reject(i)}}}finally{this.running=!1}}}};var ln=class{agentId;framework;workspace;msgQueue;sessions=new Map;verifiedSessions=new Set;activeTriggers=new Map;status="starting";lastActiveAt=Date.now();_downstream;constructor(e){this.agentId=e.agentId,this.framework=e.framework,this.workspace=e.workspace,this._downstream=e.downstream,this.msgQueue=new dn}get downstream(){return this._downstream}swap(e){this._downstream=e,this.verifiedSessions.clear(),this.activeTriggers.clear()}async dispose(e){this.status="stopped",this.msgQueue.dispose(new Error(`AgentSession disposed${e?`: ${e}`:""}`)),await this._downstream.stop(e)}};var G=O("agent-manager"),Oa=(r,e,i,a,x)=>{switch(r){case"claude-code":{let f=x?Ds(x):void 0;return new cn({cwd:i,...f&&Object.keys(f).length>0?{env:f}:{}})}case"codex":{let f=x?Ts(x):[],u=x?Ps(x):void 0;return new fn({cwd:i,...f.length>0?{extraArgs:f}:{},...u&&Object.keys(u).length>0?{env:u}:{}})}case"openclaw":return new un({command:e,cwd:i,agentId:a})}},Ba=[0,5e3,5e3],Ma=2e4,Js={protocolVersion:1,clientCapabilities:{fs:{readTextFile:!0,writeTextFile:!0}}},hn=class{paths;config;registry;factory;restartDelaysMs;createTimeoutMs;healthReporter;constructor(e){this.paths=e.paths,this.config=e.config,this.registry=e.registry,this.factory=e.downstreamFactory??Oa,this.restartDelaysMs=e.restartDelaysMs??Ba,this.createTimeoutMs=e.createTimeoutMs??Ma,this.healthReporter=e.healthReporter}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");if($t(e._meta)==="cloud")return G.info("cloud-deployed agent, ack without local spawn",{agentId:e.agentId,framework:e.framework}),{ok:!0,agentId:e.agentId,framework:e.framework};this.registry.reviveIfDisconnected?.(e.agentId);let i=this.registry.get(e.agentId);if(i){if(i.framework!==e.framework)throw new E("AGENT_BUSY",`agent ${e.agentId} exists with different framework (${i.framework})`);if(i.status==="error")G.warn("existing agent in error state, rebuilding",{agentId:e.agentId}),await i.dispose("rebuild after error").catch(m=>G.warn("dispose stale agent failed (ignored)",{err:String(m)})),this.registry.unregister(e.agentId);else return G.info("agent already exists,return current",{agentId:e.agentId}),{ok:!0,agentId:i.agentId,workspace:i.workspace,pid:i.downstream.pid()??0,framework:i.framework}}let a=this.config.frameworksCache?.[e.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${e.framework} not detected on this machine; rerun daemon to refresh frameworks_cache`);let x=Le(e.agentId,this.paths),f=e.workspace??x.workspace,u=new AbortController,g=setTimeout(()=>u.abort(new E("AGENT_TIMEOUT",`_agent/create timed out after ${this.createTimeoutMs}ms`)),this.createTimeoutMs);try{return await this.createAgentInner(e,x,f,a,u.signal)}finally{clearTimeout(g)}}async createAgentInner(e,i,a,x,f){let u=()=>{if(f.aborted)throw f.reason instanceof Error?f.reason:new E("AGENT_TIMEOUT","_agent/create aborted")},g,m,_=!1;try{await lr(i.root,{recursive:!0}),await lr(a,{recursive:!0}),await lr(i.logs,{recursive:!0}),u(),e.framework!=="openclaw"&&await Ve(a,e.framework,e.agentId,e.cozeIdentity),u();let v=await xe(e.agentId,this.paths).catch(()=>null),y=dr({model:e.model??v?.model,modelToken:e.modelToken??v?.modelToken});if(g=this.factory(e.framework,x.path,a,e.agentId,y),await g.start(),u(),await g.initialize(Js),u(),e.framework==="openclaw"&&await Ve(a,"openclaw",e.agentId,e.cozeIdentity),m=new ln({agentId:e.agentId,framework:e.framework,workspace:a,downstream:g}),m.status="ok",v?.sessions){for(let[P,R]of Object.entries(v.sessions))m.sessions.set(P,R);Object.keys(v.sessions).length>0&&G.info("restored persisted sessions for agent",{agentId:e.agentId,count:Object.keys(v.sessions).length})}this.registry.register(m),_=!0;let C={agentId:e.agentId,framework:e.framework,workspace:a,cozeIdentity:e.cozeIdentity,createdAt:v?.createdAt??Date.now(),sessions:v?.sessions??{},model:y.model};y.modelToken&&(C.modelToken=y.modelToken),v?.skills&&(C.skills=v.skills),v?.agentName&&(C.agentName=v.agentName),v?.description&&(C.description=v.description),await he(C,this.paths);let T=g.pid()??0;return G.info("agent created",{agentId:e.agentId,framework:e.framework,pid:T}),this.installRestartHook(m),{ok:!0,agentId:e.agentId,workspace:a,pid:T,framework:e.framework}}catch(v){throw G.error("agent create failed,rolling back",{agentId:e.agentId,err:String(v)}),g?.cleanup&&await g.cleanup("rollback").catch(y=>G.warn("downstream cleanup failed (ignored)",{err:String(y)})),g&&await g.stop("rollback").catch(()=>{}),_&&m&&(await m.dispose("rollback").catch(()=>{}),this.registry.unregister(e.agentId)),await Ra(i.root,{recursive:!0,force:!0}).catch(y=>G.warn("rm agent dir failed (ignored)",{err:String(y)})),v instanceof E?v:new E("AGENT_SPAWN_FAILED",String(v),{cause:v})}}async reportHealth(e,i,a){if(!this.healthReporter){G.info("healthReporter not wired, skip _agent/health upstream",{agentId:e.agentId,status:i});return}try{await this.healthReporter({status:i,_meta:{cozeAgentId:e.agentId}}),G.info("_agent/health reported",{agentId:e.agentId,status:i,cause:a})}catch(x){G.warn("_agent/health upstream failed (ignored)",{agentId:e.agentId,status:i,err:String(x)})}}installRestartHook(e){let i=0,a=x=>{if(e.status==="stopped"||e.status==="disconnected"||e.status==="switching")return;if(i>=this.restartDelaysMs.length){G.error("agent restart exhausted",{agentId:e.agentId,attempts:i,...x}),e.status="error",this.reportHealth(e,"error",x);return}let f=this.restartDelaysMs[i]??5e3;i+=1,e.status="degraded",G.warn("agent restart scheduled",{agentId:e.agentId,attempt:i,delayMs:f,...x}),setTimeout(()=>{this.doRestart(e,i).then(u=>{u?(i=0,e.status="ok"):a(null)})},f)};e.downstream.onExit((x,f)=>a({code:x,signal:f}))}async spawnAndInitialize(e,i){let a=await xe(e.agentId,this.paths).catch(()=>null),x=a?dr(a):void 0,f=this.factory(e.framework,i,e.workspace,e.agentId,x);try{return await f.start(),await f.initialize(Js),f}catch(u){throw await f.stop("spawnAndInitialize failed").catch(()=>{}),u}}rewireSession(e,i){e.swap(i),this.registry.attachHooks?.(e),this.installRestartHook(e)}async doRestart(e,i){let a=this.config.frameworksCache?.[e.framework];if(!a)return G.error("framework cache missing during restart",{agentId:e.agentId,framework:e.framework}),e.status="error",!1;G.info("agent restart attempt",{agentId:e.agentId,attempt:i});try{let x=await this.spawnAndInitialize(e,a.path);return this.rewireSession(e,x),G.info("agent restart succeeded",{agentId:e.agentId,attempt:i}),!0}catch(x){return G.warn("agent restart attempt failed",{agentId:e.agentId,attempt:i,err:String(x)}),!1}}async executeModelSwitch(e){let i=this.registry.get(e);if(!i)throw new E("AGENT_NOT_FOUND",`agent not found: ${e}`);let a=this.config.frameworksCache?.[i.framework];if(!a)throw new E("AGENT_SPAWN_FAILED",`framework ${i.framework} not detected; cannot respawn for switchModel`);G.info("executeModelSwitch: stopping old downstream",{agentId:e,framework:i.framework}),await i.downstream.stop("switchModel").catch(u=>{G.warn("stop old downstream failed (ignored, continuing)",{agentId:e,err:String(u)})});let x;try{x=await this.spawnAndInitialize(i,a.path)}catch(u){throw new E("MODEL_SWITCH_FAILED",`failed to spawn new downstream after switchModel: ${u instanceof Error?u.message:String(u)}`,{cause:u})}this.rewireSession(i,x);let f=[...i.sessions.entries()];for(let[u,g]of f)try{await x.sessionLoad({sessionId:g,cwd:i.workspace}),i.verifiedSessions.add(g)}catch(m){throw new E("MODEL_SWITCH_FAILED",`sessionLoad failed after switchModel for cloud session ${u} (acp=${g}): ${m instanceof Error?m.message:String(m)}`,{cause:m})}f.length>0&&G.info("executeModelSwitch: session/load reloaded",{agentId:e,count:f.length}),i.status="ok",G.info("executeModelSwitch: success",{agentId:e,framework:i.framework})}};K();import{spawn as za}from"node:child_process";import{constants as Vs,access as qa}from"node:fs/promises";import{delimiter as Fa,join as Ua}from"node:path";var Ka=O("framework-detector"),Ys={"claude-code":"claude",codex:"codex",openclaw:"openclaw"},Ha=[".exe",".cmd",".bat",".ps1"],Tt=class{env;constructor(e={}){this.env={pathEnv:e.pathEnv??process.env.PATH??"",platform:e.platform??process.platform,spawn:e.spawn??za,access:e.access??qa}}async detect(e){let i=Ys[e],a=await this.which(i);if(!a)return Ka.debug("framework binary not found",{framework:e,bin:i}),null;let x=await this.probeVersion(a);return{path:a,version:x}}async detectAll(){let e=await Promise.all(Object.keys(Ys).map(async a=>[a,await this.detect(a)])),i={};for(let[a,x]of e)x&&(i[a]=x);return i}async which(e){let i=this.env.pathEnv.split(Fa).filter(Boolean),a=this.env.platform==="win32"?["",...Ha]:[""];for(let x of i)for(let f of a){let u=Ua(x,e+f);if(await this.isExecutable(u))return u}return null}async isExecutable(e){try{let i=this.env.platform==="win32"?Vs.F_OK:Vs.X_OK;return await this.env.access(e,i),!0}catch{return!1}}async probeVersion(e){return new Promise(i=>{let a="",x=!1,f,u=g=>{x||(x=!0,f&&clearTimeout(f),i(g.trim()||"unknown"))};try{let g=this.env.spawn(e,["--version"],{stdio:["ignore","pipe","pipe"]});f=setTimeout(()=>{g.kill("SIGKILL"),u("unknown")},5e3),g.stdout?.on("data",m=>{a+=m.toString("utf8")}),g.on("error",()=>u("unknown")),g.on("close",()=>{let m=ja(a).split(/\r?\n/)[0]??"";u(m)})}catch{u("unknown")}})}},Wa=new RegExp("\x1B\\[[0-9;]*[A-Za-z]","g");function ja(r){return r.replace(Wa,"")}cr();fe();function gn(r){return Wt(r??V().configFile)}function Pt(r,e){return jt(e??V().configFile,r)}Ke();K();var te=O("core"),Ga=5*6e4,Ja=3e4,pn=class{upstream;agents=new Map;disconnectedAgents=new Set;extensions;paths;upstreamIds=new dt;pendingUpstream=new Map;pendingBridge=new Map;constructor(e){this.upstream=e.upstream,this.extensions=e.extensions??{},this.paths=e.paths}registerExtension(e,i){this.extensions[e]=i}async start(){this.upstream.onFrame(e=>this.handleFrame(e)),await this.upstream.start(),te.info("Core started",{extensions:Object.keys(this.extensions)})}async stop(e){te.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),this.attachDownstreamHooks(e),te.info("agent registered",{agentId:e.agentId,framework:e.framework});for(let i of this.registerHandlers)try{i(e.agentId)}catch(a){te.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)&&te.info("agent revived from disconnect",{agentId:e})}attachDownstreamHooks(e){e.downstream.onUpdate(i=>{this.forwardUpdate(e,i)}),e.downstream.onAgentRequest(i=>{this.handleAgentRequest(e,i)}),e.downstream.onExit((i,a)=>{te.warn("agent downstream exited",{agentId:e.agentId,code:i,signal:a})})}attachHooks(e){this.attachDownstreamHooks(e)}async handleFrame(e){if(on(e)){this.handleUpstreamResponse(e);return}if(sn(e))try{if(e.method.startsWith("_agent/")){let i=this.extensions[e.method];if(!i){await this.sendError(e.id,H.METHOD_NOT_FOUND,`extension not registered: ${e.method}`);return}let a=await i(e,this);await this.upstream.send(ut(e.id,a));return}if(e.method.startsWith("session/")){let i=await this.routeSessionMethod(e);await this.upstream.send(ut(e.id,i));return}if(e.method==="initialize"){await this.upstream.send(ut(e.id,{protocolVersion:1,agentCapabilities:{loadSession:!0}}));return}await this.sendError(e.id,H.METHOD_NOT_FOUND,`method not implemented: ${e.method}`)}catch(i){te.error("handleFrame failed",{method:e.method,err:String(i)}),await this.upstream.send(Xe(e.id,an(i)))}}async routeSessionMethod(e){if(!e.params||typeof e.params!="object")throw new E("IPC_BAD_REQUEST",`${e.method} requires params`);let i=e.params,a=i._meta?.cozeAgentId;if(!a)throw new E("IPC_BAD_REQUEST",`${e.method}: missing _meta.cozeAgentId`);let x=this.agents.get(a);if(!x)throw this.disconnectedAgents.has(a)?new E("AGENT_DISCONNECTED",`agent ${a} has been disconnected; cloud must _agent/create to revive`):new E("AGENT_NOT_FOUND",`agent not found: ${a}`);if(x.status==="switching")throw new E("MODEL_SWITCHING",`agent ${a} is switching model; retry later`,{retriable:!0});let f=Date.now(),u=!1;try{let g=await x.msgQueue.enqueue(()=>this.dispatchSessionCall(x,e.method,i));return u=!0,g}finally{te.info("session call done",{agentId:x.agentId,method:e.method,durationMs:Date.now()-f,ok:u})}}async dispatchSessionCall(e,i,a){e.lastActiveAt=Date.now();let{stripped:x}=Es(a);switch(i){case"session/new":{let f=x;return await e.downstream.sessionNew({...f,cwd:f.cwd||e.workspace})}case"session/load":{let f=x,u=f.sessionId,g=e.sessions.get(u);try{let m=g??u,_=await e.downstream.sessionLoad({...f,sessionId:m,cwd:f.cwd||e.workspace});return g||e.sessions.set(u,m),_}catch(m){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,err:String(m)});let _=await e.downstream.sessionNew({cwd:f.cwd||e.workspace});return e.sessions.set(u,_.sessionId),{}}}case"session/prompt":{let f=x,u=f.sessionId,g=e.sessions.get(u),m=!1;if(g&&!e.verifiedSessions.has(g))try{await e.downstream.sessionLoad({sessionId:g,cwd:e.workspace}),e.verifiedSessions.add(g),te.info("session restored via session/load",{agentId:e.agentId,cloudId:u,acpId:g})}catch(y){te.warn("session/load failed,fallback to session/new",{agentId:e.agentId,cloudId:u,acpId:g,err:String(y)}),e.sessions.delete(u),g=void 0}g||(g=(await e.downstream.sessionNew({cwd:e.workspace})).sessionId,e.sessions.set(u,g),e.verifiedSessions.add(g),m=!0);let _=a._meta?.cozeTriggerMsgId;_?e.activeTriggers.set(g,_):e.activeTriggers.delete(g);let v=await e.downstream.sessionPrompt({...f,sessionId:g});return m&&this.persistSessionMapping(e),v}case"session/cancel":{let u=x.sessionId;if(!u)throw new E("IPC_BAD_REQUEST","session/cancel: missing sessionId");let g=e.sessions.get(u);return g&&await e.downstream.sessionCancel({sessionId:g}),{ok:!0}}default:throw new E("IPC_BAD_REQUEST",`session method not supported: ${i}`)}}forwardUpdate(e,i){let a=i.sessionId,x=this.reverseSessionId(e,a);if(!x){te.debug("drop update for unknown session",{agentId:e.agentId,acpId:a});return}let f={cozeAgentId:e.agentId},u=e.activeTriggers.get(a);u&&(f.cozeTriggerMsgId=u),this.upstream.send(qs("session/update",{...i,sessionId:x,_meta:f})).catch(g=>te.warn("forward update failed",{agentId:e.agentId,err:String(g)}))}handleAgentRequest(e,i){if(i.method==="session/request_permission"){this.forwardPermissionRequest(e,i);return}te.warn("unhandled agent request,returning method_not_found",{agentId:e.agentId,method:i.method}),e.downstream.respondAgentRequestError(i.id,{code:H.METHOD_NOT_FOUND,message:`method not handled by Bridge: ${i.method}`})}forwardPermissionRequest(e,i){let a=this.upstreamIds.next("session/request_permission"),x=i.params??{},u=x.sessionId,g=u?e.activeTriggers.get(u):void 0,m={cozeAgentId:e.agentId};g&&(m.cozeTriggerMsgId=g);let _=u?this.reverseSessionId(e,u):void 0,v={...x,..._?{sessionId:_}:{},_meta:m},y=setTimeout(()=>{let C=this.pendingUpstream.get(a);C&&(this.pendingUpstream.delete(a),te.warn("upstream permission request timed out,replying cancelled to agent",{agentId:e.agentId,upstreamId:a}),e.downstream.respondAgentRequest(C.agentRequestId,{outcome:{kind:"cancelled"}}))},Ga);this.pendingUpstream.set(a,{agentRequestId:i.id,session:e,method:i.method,timer:y}),this.upstream.send(ft(a,"session/request_permission",v)).catch(C=>{let T=this.pendingUpstream.get(a);T&&(clearTimeout(T.timer),this.pendingUpstream.delete(a)),te.error("forward permission request failed",{agentId:e.agentId,err:String(C)}),e.downstream.respondAgentRequestError(i.id,{code:H.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),clearTimeout(i.timer),e.error?i.session.downstream.respondAgentRequestError(i.agentRequestId,e.error):i.session.downstream.respondAgentRequest(i.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 rn(e.error)):a.resolve(e.result);return}te.debug("orphan upstream response (no pending)",{id:e.id})}sendRequest(e,i,a=Ja){let x=this.upstreamIds.next(e);return new Promise((f,u)=>{let g=setTimeout(()=>{this.pendingBridge.delete(x),u(new E("AGENT_TIMEOUT",`${e} timed out after ${a}ms`))},a);this.pendingBridge.set(x,{method:e,resolve:f,reject:u,timer:g}),this.upstream.send(ft(x,e,i)).catch(m=>{let _=this.pendingBridge.get(x);_&&(clearTimeout(_.timer),this.pendingBridge.delete(x)),u(m)})})}async persistSessionMapping(e){if(this.paths)try{await ur(e.agentId,e.sessions,this.paths)}catch(i){te.warn("persist session mapping failed",{agentId:e.agentId,err:String(i)})}}reverseSessionId(e,i){for(let[a,x]of e.sessions.entries())if(x===i)return a}sendError(e,i,a){return this.upstream.send(Xe(e,{code:i,message:a}))}};K();fe();import{randomBytes as Va}from"node:crypto";import{chmod as Ya,mkdir as Xa,writeFile as Xs}from"node:fs/promises";import{createServer as Za}from"node:http";import{dirname as $a}from"node:path";var Qa=1e6,hr=O("ipc"),mn=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??V()}async start(){this.token=Va(32).toString("hex");let e=Za((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 i=e.address();if(!i||typeof i!="object")throw new Error("failed to obtain IPC port");return this.port=i.port,await this.persistAuthFiles(),hr.info("IPC listening",{port:this.port}),{port:this.port,token:this.token}}async stop(){let e=this.server;e&&(await new Promise((i,a)=>{e.close(x=>x?a(x):i())}),this.server=null)}async persistAuthFiles(){await Xa($a(this.paths.portFile),{recursive:!0}),await Xs(this.paths.portFile,String(this.port),"utf8"),await Xs(this.paths.tokenFile,this.token,"utf8");try{await Ya(this.paths.tokenFile,384)}catch(e){hr.warn("chmod token file failed (non-POSIX?)",{err:String(e)})}}async dispatch(e,i){if(e.headers.authorization!==`Bearer ${this.token}`){It(i,401,{error:"unauthorized"});return}let x=`${e.method} ${(e.url??"").split("?")[0]}`,f=this.routes.get(x);if(!f){It(i,404,{error:"not found"});return}let u=null;if(e.method==="POST")try{u=await ex(e)}catch(g){It(i,400,{error:"invalid json",detail:String(g)});return}try{let g=await f.handler(u,e);It(i,200,g??{ok:!0})}catch(g){hr.error("IPC handler failed",{key:x,err:String(g)}),It(i,500,{error:g instanceof Error?g.message:String(g)})}}};function It(r,e,i){r.statusCode=e,r.setHeader("content-type","application/json"),r.end(JSON.stringify(i))}async function ex(r){let e=[],i=0;for await(let x of r){let f=x;if(i+=f.length,i>Qa)throw new Error("body too large");e.push(f)}let a=Buffer.concat(e).toString("utf8");return a?JSON.parse(a):null}var So=Ie(ai(),1);var Oc=Ie(no(),1),Bc=Ie(Nn(),1),Mc=Ie(gt(),1),zc=Ie(Ar(),1),qc=Ie(Pr(),1),Fc=Ie(Br(),1),uo=Ie(Mn(),1),Uc=Ie(fo(),1);var lo=uo.default;K();var qn="1008033",ho="1289";var go="pbbp2",po="https://www.coze.cn",mo="/api/coze_claw/resource/get_frontier_key",Kc="https://www.coze.cn",Hc="wss://frontier.coze.cn";function _o(r){return r??process.env.COZE_BRIDGE_HANDSHAKE_URL??Kc}function wo(r){return r??process.env.COZE_BRIDGE_FRONTIER_URL??Hc}function Fn(r){let e={},i=r?.ttEnv??process.env.COZE_BRIDGE_TT_ENV,a=r?.usePpe??process.env.COZE_BRIDGE_USE_PPE;return i&&(e["x-tt-env"]=i),a&&(e["x-use-ppe"]=a),e}var ie=O("upstream.frontier"),vo="application/json",bo="none",Un=class{constructor(e){this.opts=e}opts;fws=null;handler=null;connectHandler=null;opened=!1;openCount=0;async start(){if(this.fws){ie.warn("start called on already-started FrontierUpstream; noop");return}let e={Authorization:`Bearer ${this.opts.privatecode}`,Origin:po,...Fn(this.opts.ppeOverride)};class i extends lo{constructor(g){super(g,go,{headers:e})}send(g,...m){if(Ss("debug"))try{let _;typeof g=="string"?_=Buffer.from(g,"utf8"):g instanceof Buffer?_=g:g instanceof ArrayBuffer?_=new Uint8Array(g):ArrayBuffer.isView(g)?_=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):_=new Uint8Array(0);let v=Buffer.from(_.slice(0,128)).toString("hex");ie.debug("WS raw frame out",{bytes:_.byteLength,headHex:v})}catch(_){ie.warn("WS raw frame dump failed",{err:String(_)})}super.send(g,...m)}}let a=wo(this.opts.urlOverride),x={url:a,ws:i,fpID:ho,aID:qn,accessKey:this.opts.handshake.accessKey,deviceID:this.opts.handshake.deviceId,payloadType:{type:vo,force:!0},payloadEncoding:{encoding:bo,force:!0},enableTransformTextPayload:!0,enableQoS:!1,enableAutoAck:!1,automaticOpen:!1,debug:this.opts.debug??!1},f=new So.FWS(x);f.onopen=()=>{this.opened=!0,this.openCount+=1;let u=this.openCount===1;ie.info("frontier opened",{url:a,remoteDeviceId:this.opts.handshake.deviceId,initial:u,openCount:this.openCount}),this.connectHandler&&Promise.resolve(this.connectHandler({initial:u})).catch(g=>ie.warn("onConnect handler threw (ignored)",{err:String(g)}))},f.onclose=u=>{this.opened=!1,ie.info("frontier closed",{code:u.code,reason:u.reason,willReconnect:u.willReconnect})},f.onerror=u=>{ie.warn("frontier error",{code:u.code,msg:u.message})},f.onmessage=u=>this.handleMessage(u),this.fws=f,await f.connect()}async stop(e){let i=this.fws;if(i){this.fws=null,this.opened=!1;try{i.close(1e3,e??"bridge shutdown")}catch(a){ie.warn("frontier close threw (ignored)",{err:String(a)})}}}async send(e){let i=this.fws;if(!i)throw new E("UPSTREAM_DISCONNECTED","frontier upstream not started");let a=JSON.stringify(e),x=e;ie.info("frontier frame out",{method:x.method,jsonrpcId:x.id,size:a.length});try{await i.send(a,{service:33555712,method:1,payloadType:vo,payloadEncoding:bo})}catch(f){throw new E("UPSTREAM_DISCONNECTED",`frontier send failed: ${String(f)}`,{cause:f})}}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){ie.debug("drop non-adapter frontier frame",{service:i});return}let a=Gc(e);if(!a){ie.debug("frontier message without text payload, drop",{payloadType:e.message?.payloadType});return}if(!this.handler){ie.debug("frame received but no onFrame handler",{size:a.length});return}let x;try{x=JSON.parse(a)}catch(f){ie.warn("frontier message JSON parse failed",{err:String(f),head:a.slice(0,80)});return}ie.info("frontier frame in",{logid:jc(e.message?.LogID),logidNew:e.message?.LogIDNew,msgId:e.message?.msgID,jsonrpcId:x.id}),Promise.resolve(this.handler(x)).catch(f=>ie.warn("frontier frame handler threw",{err:String(f)}))}};function jc(r){return r?r.high===0?String(r.low>>>0):`${r.high.toString(16)}${(r.low>>>0).toString(16).padStart(8,"0")}`:""}function Gc(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}}K();function Eo(r){return r?r.startsWith("boe_")?{ttEnv:r}:{ttEnv:r,usePpe:"1"}:{}}var Co=O("handshake");async function ko(r){let e=_o(r.endpoint),i=r.timeoutMs??1e4,a=`${Jc(e)}${mo}?aid=${encodeURIComponent(qn)}`,x={Authorization:`Bearer ${r.privatecode}`,Accept:"application/json",...Fn(r.ppeOverride)},f=new AbortController,u=setTimeout(()=>f.abort(),i);Co.info("frontier key handshake",{base:e});try{let g=await fetch(a,{method:"GET",headers:x,signal:f.signal}),m=g.headers.get("x-tt-logid")??"",_=g.headers.get("x-tt-trace-id")??"";if(!g.ok){let T=await g.text().catch(()=>"");throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake HTTP ${g.status} logid=${m}: ${T.slice(0,200)}`)}let v=await g.json();if(v.code!==void 0&&v.code!==0)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake code=${v.code} msg=${v.msg??"-"} logid=${m}`);let y=v.data?.access_key,C=v.data?.device_id;if(!y||!C)throw new E("UPSTREAM_HANDSHAKE_FAILED",`handshake response missing access_key/device_id logid=${m}: ${JSON.stringify(v)}`);return Co.info("handshake ok",{remoteDeviceId:C,logid:m,traceId:_}),{accessKey:y,deviceId:C}}catch(g){throw g instanceof E?g:g.name==="AbortError"?new E("UPSTREAM_HANDSHAKE_FAILED",`handshake timeout (${i}ms)`):new E("UPSTREAM_HANDSHAKE_FAILED",String(g),{cause:g})}finally{clearTimeout(u)}}function Jc(r){return r.endsWith("/")?r.slice(0,-1):r}K();var zr=O("upstream.switchable"),Kn=class{inner;handler=null;connectHandler=null;constructor(e){this.inner=e}async swap(e,i){if(this.inner===e)return;zr.info("swap upstream",{reason:i});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 zr.error("swap target start failed, reverting",{err:String(x)}),this.inner=a,x}await a.stop(i??"swapped").catch(x=>zr.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()}};K();var qr=O("upstream"),Ft=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)}};K();fe();K();fe();import{readFileSync as Vc,unlinkSync as Yc}from"node:fs";import{mkdir as Xc,readFile as Ao,unlink as Do,writeFile as Zc}from"node:fs/promises";import{dirname as $c}from"node:path";var Qc=O("single-instance"),Hn=class{pidFile;acquired=!1;constructor(e={}){this.pidFile=e.pidFile??V().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&&(Qc.warn("removing stale pid file",{stalePid:e}),await Do(this.pidFile).catch(()=>{})),await Xc($c(this.pidFile),{recursive:!0}),await Zc(this.pidFile,String(process.pid),"utf8"),this.acquired=!0,this.installCleanupHooks(),{kind:"acquired"})}async release(){if(this.acquired){try{(await Ao(this.pidFile,"utf8")).trim()===String(process.pid)&&await Do(this.pidFile)}catch{}this.acquired=!1}}async readExistingPid(){try{let e=await Ao(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{return process.kill(e,0),!0}catch(i){return i.code==="EPERM"}}installCleanupHooks(){process.once("exit",()=>{if(this.acquired)try{Vc(this.pidFile,"utf8").trim()===String(process.pid)&&Yc(this.pidFile)}catch{}})}};var q=O("daemon"),ef="coze-bridge-daemon";async function Io(){let r=new Hn({processTitle:ef}),e=await r.acquire();if(e.kind==="already-running")throw new Error(`coze-bridge daemon already running (pid=${e.pid})`);let i=await gn(),a=i??{};fr({pid:process.pid}),q.info(i?"loaded bridge config":"initialized bridge config");try{let I=new Tt;a.frameworksCache=await I.detectAll(),q.info("refreshed frameworks_cache",{detected:Object.keys(a.frameworksCache)})}catch(I){q.warn("framework detection failed",{err:String(I)})}await Pt(a);let x=new Kn(new Ft),f=V(),u=new pn({upstream:x,paths:f});await nf(f,u);let g=new hn({paths:f,config:a,registry:u,healthReporter:async I=>{await u.sendRequest("_agent/health",I)}}),m,_,v=null,y=null;u.registerExtension("_agent/create",async I=>g.createAgent(I.params)),u.registerExtension("_agent/health",async()=>({ok:!0}));let C=new tn({agents:u.agents,disposeAndMarkDisconnected:async(I,F)=>{let Y=u.agents.get(I);Y&&(await Y.dispose(`disconnect: ${F}`).catch(De=>q.warn("dispose during disconnect failed (ignored)",{agentId:I,err:String(De)})),Y.status="disconnected",u.unregister(I)),u.disconnectedAgents.add(I)},executeModelSwitch:I=>g.executeModelSwitch(I)});u.registerExtension("_agent/listSkills",I=>C.listSkills(I.params)),u.registerExtension("_agent/addSkills",I=>C.addSkills(I.params)),u.registerExtension("_agent/removeSkills",I=>C.removeSkills(I.params)),u.registerExtension("_agent/getFileTree",I=>C.getFileTree(I.params)),u.registerExtension("_agent/getFileContent",I=>C.getFileContent(I.params)),u.registerExtension("_agent/update",I=>C.updateAgent(I.params)),u.registerExtension("_agent/disconnect",I=>C.disconnectAgent(I.params)),u.registerExtension("_agent/switchModel",I=>C.switchModel(I.params));let T=new Zt({paths:f,handlers:C,sendDetail:I=>u.sendRequest("_agent/detail",I)});x.onConnect(({initial:I})=>{q.info("frontier upstream connected, triggering detail sync",{initial:I}),T.syncAll(I?"initial-connect":"reconnect").catch(F=>q.warn("detail sync top-level error (ignored)",{err:String(F)}))});let P=new mn({paths:f,routes:[{method:"GET",path:"/status",handler:async()=>({running:!0,pid:process.pid,agents:[...u.agents.keys()],deviceId:v??"",frameworksCache:a.frameworksCache??{}})},{method:"POST",path:"/pair",handler:async I=>{let F=I,Y=F?.privatecode,De=F?.pairing_code;if(!Y||!De)throw new E("IPC_BAD_REQUEST","/pair requires privatecode + pairing_code");let ze=Eo(F.env),ye=F.handshake_url,ve=F.frontier_url,me=tf(F.env,ye,ve),rt=!!m&&m!==Y,Ut=_!==void 0&&_!==me,Kt=rt||Ut;if(Kt){q.warn("pair config switched, resetting agents",{pcChanged:rt,envChanged:Ut,previousPc:m?To(m):"",nextPc:To(Y),previousEnvKey:_??"",nextEnvKey:me});for(let X of[...u.agents.values()])await X.dispose("pair config switch").catch(()=>{}),u.agents.delete(X.agentId);await x.swap(new Ft,"pair switch").catch(()=>{})}let be=await ko({privatecode:Y,...ye?{endpoint:ye}:{},ppeOverride:ze});v=be.deviceId,fr({deviceId:v,pid:process.pid});let Te=new Un({handshake:be,privatecode:Y,...ve?{urlOverride:ve}:{},ppeOverride:ze});await x.swap(Te,"pair"),m=Y,_=me;let Zn=Object.keys(a.frameworksCache??{});try{let X=await u.sendRequest("_agent/pair",{pairCode:De,patToken:Y,frameworks:Zn,_meta:{cozeDeviceId:v}});q.info("_agent/pair ok",{pairResult:X}),y||(y=new nn({core:u,getDeviceId:()=>v??""})),y.start(),Kt&&Po(f,g).catch(W=>q.warn("post-pair-switch auto-revive error (ignored)",{err:String(W)}));let st;return F.agent_id&&(st=await rf(F.agent_id,f,g,W=>u.sendRequest("_agent/detail",W)).catch(W=>(q.error("--agent-id ensureAgent failed",{agentId:F.agent_id,err:String(W)}),{ok:!1,agentId:F.agent_id??"",note:String(W)}))),{ok:!0,note:"paired with cloud",...st?{agent:st}:{}}}catch(X){return q.error("_agent/pair failed",{err:String(X)}),{ok:!1,note:`pair failed: ${String(X)}`}}}},{method:"POST",path:"/_agent/create",handler:async I=>{let F=I;return{ok:!0,result:await g.createAgent(F)}}},{method:"POST",path:"/refresh",handler:async()=>{q.info("IPC /refresh: re-detecting frameworks");let I=new Tt;return a.frameworksCache=await I.detectAll(),await Pt(a),{ok:!0,frameworks:a.frameworksCache}}},{method:"POST",path:"/shutdown",handler:async()=>(q.info("IPC /shutdown received"),setImmediate(()=>{ce.shutdown("ipc /shutdown")}),{ok:!0})}]}),{port:R,token:J}=await P.start();await u.start(),Po(f,g).catch(I=>q.warn("auto-revive top-level error (ignored)",{err:String(I)}));let oe=null,ce={port:R,token:J,core:u,ipc:P,shutdown(I){return oe||(q.info("daemon shutdown",{reason:I}),oe=(async()=>{y?.stop(),await u.stop(I),await P.stop(),await r.release()})(),oe)}};for(let I of["SIGTERM","SIGINT"])process.on(I,()=>{ce.shutdown(I).then(()=>process.exit(0))});return q.info("daemon ready",{port:R,pid:process.pid,nodeVersion:process.version,platform:process.platform,frameworks:Object.keys(a.frameworksCache??{}),libVersion:a.libVersion??"dev"}),ce}function To(r){return r.length<=8?"***":`${r.slice(0,4)}***${r.slice(-4)}`}function tf(r,e,i){return`${r??""}|${e??""}|${i??""}`}async function nf(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.agentsRoot)}catch{return}let{loadAgentConfig:x,enforceAgentConfigMode:f}=await Promise.resolve().then(()=>(Ke(),Xt));for(let u of a){await f(u,r).catch(g=>q.warn("enforceAgentConfigMode failed (ignored)",{agentId:u,err:String(g)}));try{let g=await x(u,r);g?.disconnectedAt&&(e.disconnectedAgents.add(u),q.info("agent marked disconnected on startup",{agentId:u,disconnectedAt:g.disconnectedAt,reason:g.disconnectReason??""}))}catch(g){q.warn("failed to load agent config on startup, skipping",{agentId:u,err:String(g)})}}}async function rf(r,e,i,a){let{loadAgentConfig:x}=await Promise.resolve().then(()=>(Ke(),Xt)),f=await x(r,e);if(f){q.info("--agent-id: local config found, reconnecting",{agentId:r,framework:f.framework,hadDisconnect:!!f.disconnectedAt});let m={agentId:f.agentId,framework:f.framework,...f.cozeIdentity?{cozeIdentity:f.cozeIdentity}:{},...f.model?{model:f.model}:{},...f.modelToken?{modelToken:f.modelToken}:{}};return await i.createAgent(m),{ok:!0,agentId:r,note:f.disconnectedAt?"revived from local config":"connected from local config"}}q.info("--agent-id: local config missing, pulling _agent/detail from cloud",{agentId:r});let u=await a({_meta:{cozeAgentId:r}});if(!u.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 g={agentId:u.agentId,framework:u.framework,...u.cozeIdentity?{cozeIdentity:u.cozeIdentity}:{},...u.model?{model:u.model}:{},...u.modelToken?{modelToken:u.modelToken}:{},...u.deployType?{_meta:{cozeDeployType:u.deployType}}:{}};return await i.createAgent(g),{ok:!0,agentId:r,note:u.deployType==="cloud"?"cloud agent acknowledged":"created from cloud detail"}}async function Po(r,e){let{readdir:i}=await import("node:fs/promises"),a;try{a=await i(r.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(()=>(Ke(),Xt));q.info("auto-revive: scanning local agents on startup",{count:a.length});let f=0,u=0;for(let g of a){let m;try{m=await x(g,r)}catch(_){q.warn("auto-revive: load config failed (skipping)",{agentId:g,err:String(_)}),u+=1;continue}if(!m){u+=1;continue}if(m.disconnectedAt){q.info("auto-revive: skip disconnected agent",{agentId:g,disconnectedAt:m.disconnectedAt}),u+=1;continue}try{q.info("auto-revive: spawning",{agentId:g,framework:m.framework}),await e.createAgent({agentId:m.agentId,framework:m.framework,...m.cozeIdentity?{cozeIdentity:m.cozeIdentity}:{},...m.model?{model:m.model}:{},...m.modelToken?{modelToken:m.modelToken}:{}}),f+=1}catch(_){q.warn("auto-revive: createAgent failed (skipping)",{agentId:g,framework:m.framework,err:String(_)}),u+=1}}return q.info("auto-revive: done",{revived:f,skipped:u,total:a.length}),{revived:f,skipped:u,total:a.length}}Ur();fe();import{readFile as No}from"node:fs/promises";var Ge=class{paths;constructor(e){this.paths=e??V()}async probe(e=1e3){let i=await this.readAuth();if(!i)return{kind:"not-running"};try{let a=await this.fetch(i,{method:"GET",path:"/status",timeoutMs:e});return a.status===200?{kind:"connected",...i}:{kind:"stale",reason:`unexpected status ${a.status}`}}catch(a){return{kind:"stale",reason:lf(a)}}}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([No(this.paths.portFile,"utf8"),No(this.paths.tokenFile,"utf8")]),a=Number.parseInt(e.trim(),10),x=i.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,i){let a=i.body!==void 0,x={Authorization:`Bearer ${e.token}`};a&&(x["content-type"]="application/json");let f=new AbortController,u=setTimeout(()=>f.abort(),i.timeoutMs??5e3);try{let g=await fetch(`http://127.0.0.1:${e.port}${i.path}`,{method:i.method,headers:x,body:a?JSON.stringify(i.body):void 0,signal:f.signal}),m=await g.text();return{status:g.status,body:df(m)}}finally{clearTimeout(u)}}};function df(r){if(!r)return null;try{return JSON.parse(r)}catch{return r}}function lf(r){return r instanceof Error?r.message:String(r)}K();fe();import{copyFile as Ro,mkdir as hf,readFile as Kr,writeFile as gf}from"node:fs/promises";import{dirname as pf,resolve as Hr,sep as Wn}from"node:path";import{fileURLToPath as mf}from"node:url";K();fe();var Oo=O("dist-install");function _f(r){let e=mf(r),i=pf(e),a=`${Wn}src${Wn}`;if(i.includes(a)||i.endsWith(`${Wn}src${Wn}cli`))return null;let x=Hr(i,"index.js"),f=Hr(i,"..","package.json");return{dist:x,pkgJson:f}}async function Bo(r={}){let e=r.paths??V(),i=_f(import.meta.url),a=r.sourceDist??i?.dist,x=r.sourcePackageJson??i?.pkgJson;if(!a||!x)return{kind:"dev-mode-skip",reason:"running from src/(tsx loader);no dist/ to install"};let f;try{f=JSON.parse(await Kr(x,"utf8")).version??"unknown"}catch(y){return Oo.warn("cannot read source package.json,skip dist install",{err:String(y)}),{kind:"dev-mode-skip",reason:`package.json read failed: ${String(y)}`}}let u=await gn(e.configFile)??{},g=u.libVersion;if(g===f)try{return await Kr(e.libEntry),{kind:"already-current",libVersion:f}}catch{}await hf(e.libDir,{recursive:!0}),await Ro(a,e.libEntry),await Ro(`${a}.map`,`${e.libEntry}.map`).catch(()=>{});let m=Hr(e.libDir,"package.json"),_=`${JSON.stringify({type:"module"},null,2)}
|
|
91
|
+
`;return await Kr(m,"utf8").catch(()=>null)!==_&&await gf(m,_),u.libVersion=f,await Pt(u,e.configFile),Oo.info("dist installed",{libEntry:e.libEntry,fromVersion:g,toVersion:f}),g?{kind:"version-changed",fromVersion:g,toVersion:f,libEntry:e.libEntry}:{kind:"first-install",libVersion:f,libEntry:e.libEntry}}var Mf=O("cli");function vt(r,e){let i=[],a;for(let x=0;x<r.length;x++){let f=r[x];if(f===e){a=r[x+1],x+=1;continue}if(f.startsWith(`${e}=`)){a=f.slice(e.length+1);continue}i.push(f)}return{value:a,rest:i}}function zf(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:a,rest:x}=vt(i,"--pat-token");i=x;let{value:f,rest:u}=vt(i,"--pair-code");i=u;let{value:g,rest:m}=vt(i,"--env");i=m;let{value:_,rest:v}=vt(i,"--handshake-url");i=v;let{value:y,rest:C}=vt(i,"--frontier-url");i=C;let{value:T}=vt(i,"--agent-id");if(!a||!f)return{mode:"help"};let P={mode:"pair",privatecode:a,pairingCode:f};return g&&(P.env=g),_&&(P.handshakeUrl=_),y&&(P.frontierUrl=y),T&&(P.agentId=T),P}var qf=`
|
|
92
92
|
coze-bridge - local bridge daemon for cloud Agent Service
|
|
93
93
|
|
|
94
94
|
Usage:
|
|
@@ -115,34 +115,34 @@ Auto-connect agent (optional):
|
|
|
115
115
|
|
|
116
116
|
Internal:
|
|
117
117
|
<node> <entry> --daemon daemon mode (OS supervisor only)
|
|
118
|
-
`.trimStart();async function
|
|
118
|
+
`.trimStart();async function Ko(r=process.argv,e={}){let i=zf(r);switch(i.mode){case"help":return process.stdout.write(qf),0;case"daemon":{try{await Io()}catch(a){return Mf.error("daemon start failed",{err:String(a)}),1}return new Promise(()=>{})}case"status":return Ff(e);case"stop":return Uf(e);case"refresh":return Kf(e);case"uninstall":return Hf(e);case"install-service":return Wf();case"pair":{let a={};return i.env&&(a.env=i.env),i.handshakeUrl&&(a.handshakeUrl=i.handshakeUrl),i.frontierUrl&&(a.frontierUrl=i.frontierUrl),jf(i.privatecode,i.pairingCode,e,a,i.agentId)}}}async function Ff(r){let e=new Ge(r.paths),i=await e.probe();if(i.kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
119
119
|
`),1;if(i.kind==="stale")return process.stdout.write(`coze-bridge: stale (${i.reason})
|
|
120
120
|
`),1;let a=await e.request({method:"GET",path:"/status"});return process.stdout.write(`coze-bridge: running
|
|
121
121
|
${JSON.stringify(a.body,null,2)}
|
|
122
122
|
`),0}async function Uf(r){let e=new Ge(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running
|
|
123
123
|
`),0;try{return await e.request({method:"POST",path:"/shutdown"}),process.stdout.write(`coze-bridge: stopped
|
|
124
124
|
`),0}catch(a){return process.stdout.write(`coze-bridge: stop failed: ${String(a)}
|
|
125
|
-
`),1}}async function
|
|
125
|
+
`),1}}async function Kf(r){let e=new Ge(r.paths);if((await e.probe()).kind==="not-running")return process.stdout.write(`coze-bridge: not running (start daemon first)
|
|
126
126
|
`),1;try{let a=await e.request({method:"POST",path:"/refresh"});return a.status===200?(process.stdout.write(`coze-bridge: refreshed
|
|
127
127
|
${JSON.stringify(a.body,null,2)}
|
|
128
128
|
`),0):(process.stderr.write(`coze-bridge: refresh failed: ${JSON.stringify(a.body)}
|
|
129
129
|
`),1)}catch(a){return process.stderr.write(`coze-bridge: refresh failed: ${String(a)}
|
|
130
|
-
`),1}}async function
|
|
130
|
+
`),1}}async function Hf(r){let e=new Ge(r.paths);if((await e.probe()).kind==="connected"){process.stdout.write(`coze-bridge: stopping daemon...
|
|
131
131
|
`);try{await e.request({method:"POST",path:"/shutdown"})}catch(f){process.stderr.write(`coze-bridge: stop failed (continuing): ${String(f)}
|
|
132
|
-
`)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:u}=await Promise.resolve().then(()=>(
|
|
132
|
+
`)}await new Promise(f=>setTimeout(f,500))}if(!r.skipSupervisor)try{let{getSupervisor:f,buildContext:u}=await Promise.resolve().then(()=>(Xr(),Yr)),g=f();await g.uninstall(u()),process.stdout.write(`coze-bridge: ${g.platform} supervisor unregistered
|
|
133
133
|
`)}catch(f){process.stderr.write(`coze-bridge: supervisor uninstall failed (continuing): ${String(f)}
|
|
134
|
-
`)}let a=r.paths??
|
|
134
|
+
`)}let a=r.paths??V(),{rm:x}=await import("node:fs/promises");try{await x(a.cozeRoot,{recursive:!0,force:!0}),process.stdout.write(`coze-bridge: removed ${a.cozeRoot}
|
|
135
135
|
`)}catch(f){return process.stderr.write(`coze-bridge: remove failed: ${String(f)}
|
|
136
136
|
`),1}return process.stdout.write(`coze-bridge: uninstalled
|
|
137
|
-
`),0}async function
|
|
137
|
+
`),0}async function Wf(){try{let{getSupervisor:r,buildContext:e}=await Promise.resolve().then(()=>(Xr(),Yr)),i=r(),a=e();return process.stdout.write(`coze-bridge: installing ${i.platform} supervisor...
|
|
138
138
|
`),await i.install(a),process.stdout.write(`coze-bridge: supervisor installed (daemon will auto-start on login)
|
|
139
139
|
`),0}catch(r){return process.stderr.write(`coze-bridge: --install-service failed: ${String(r)}
|
|
140
|
-
`),1}}async function
|
|
141
|
-
`),(await f.probe()).kind==="connected"&&(await f.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(
|
|
142
|
-
`)}let
|
|
143
|
-
`),await u({paths:i.paths}),
|
|
144
|
-
`),1;let m={privatecode:r,pairing_code:e};a.env&&(m.env=a.env),a.handshakeUrl&&(m.handshake_url=a.handshakeUrl),a.frontierUrl&&(m.frontier_url=a.frontierUrl),x&&(m.agent_id=x);try{let
|
|
145
|
-
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(
|
|
146
|
-
`),1)}catch(
|
|
147
|
-
`),1}}async function
|
|
140
|
+
`),1}}async function jf(r,e,i,a={},x){let f=new Ge(i.paths),u=i.spawnDaemon??Lo;if(!i.skipDistInstall){let _=await Bo({paths:i.paths});_.kind==="version-changed"?(process.stdout.write(`coze-bridge: upgraded ${_.fromVersion} \u2192 ${_.toVersion}
|
|
141
|
+
`),(await f.probe()).kind==="connected"&&(await f.request({method:"POST",path:"/shutdown"}).catch(()=>{}),await new Promise(y=>setTimeout(y,500)))):_.kind==="first-install"&&process.stdout.write(`coze-bridge: installed ${_.libVersion}
|
|
142
|
+
`)}let g=await f.probe();if(g.kind!=="connected"&&(process.stdout.write(`coze-bridge: starting daemon...
|
|
143
|
+
`),await u({paths:i.paths}),g=await Gf(f,i.waitTimeoutMs??1e4,i.sleep??Jf),g.kind!=="connected"))return process.stderr.write(`coze-bridge: daemon did not come up: ${g.kind}
|
|
144
|
+
`),1;let m={privatecode:r,pairing_code:e};a.env&&(m.env=a.env),a.handshakeUrl&&(m.handshake_url=a.handshakeUrl),a.frontierUrl&&(m.frontier_url=a.frontierUrl),x&&(m.agent_id=x);try{let _=await f.request({method:"POST",path:"/pair",body:m});return _.status===200&&_.body?.ok?(process.stdout.write(`coze-bridge: paired (${_.body.note??"ok"})
|
|
145
|
+
`),0):(process.stderr.write(`coze-bridge: pair failed: ${JSON.stringify(_.body)}
|
|
146
|
+
`),1)}catch(_){return process.stderr.write(`coze-bridge: pair failed: ${String(_)}
|
|
147
|
+
`),1}}async function Gf(r,e,i){let a=Date.now()+e;for(;Date.now()<a;){let x=await r.probe(500);if(x.kind==="connected")return x;await i(200)}return r.probe(500)}function Jf(r){return new Promise(e=>setTimeout(e,r))}Ko(process.argv).then(r=>process.exit(r),r=>{process.stderr.write(`fatal: ${r instanceof Error?r.stack??r.message:String(r)}
|
|
148
148
|
`),process.exit(1)});
|