homebridge-config-ui-x 5.0.0-beta.71 → 5.0.0-beta.72
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/CHANGELOG.md +1 -0
- package/package.json +1 -1
- package/public/{chunk-PTJSEANH.js → chunk-2L42HGD4.js} +1 -1
- package/public/{chunk-5K7NARQK.js → chunk-36QRNMZP.js} +1 -1
- package/public/{chunk-ZXXOJAVC.js → chunk-3NFPW77O.js} +1 -1
- package/public/{chunk-JPVF3EPM.js → chunk-3SHT5QEK.js} +1 -1
- package/public/{chunk-WNGOTZ3I.js → chunk-4ES4LBZV.js} +1 -1
- package/public/{chunk-UOC65WET.js → chunk-4RE7M7JJ.js} +1 -1
- package/public/{chunk-2SXSAYFM.js → chunk-5OBBFCOZ.js} +1 -1
- package/public/chunk-5YACONVY.js +1 -0
- package/public/{chunk-ECZONFVO.js → chunk-6NHP6QQF.js} +1 -1
- package/public/{chunk-OCZ2H4UT.js → chunk-6UDBMB63.js} +1 -1
- package/public/chunk-A4S5GI6W.js +1 -0
- package/public/chunk-AGDUX3EF.js +1 -0
- package/public/{chunk-OGSVTVGE.js → chunk-CGJH6JTF.js} +1 -1
- package/public/{chunk-Q5DVL6Z6.js → chunk-COL5TBQH.js} +1 -1
- package/public/{chunk-TUHGKUZA.js → chunk-DEKT3254.js} +1 -1
- package/public/{chunk-LXATRDDS.js → chunk-DNF3F7WE.js} +1 -1
- package/public/chunk-DNOQMZ3T.js +1 -0
- package/public/{chunk-4WTLH2XC.js → chunk-DOZWR3M6.js} +1 -1
- package/public/{chunk-YRCKAGKJ.js → chunk-EMASIYF5.js} +1 -1
- package/public/{chunk-TQNPIZF3.js → chunk-EPNZKQW5.js} +1 -1
- package/public/chunk-EQHO3WBT.js +1 -0
- package/public/chunk-FZVIAS67.js +1 -0
- package/public/{chunk-752FLZDX.js → chunk-G75HECF2.js} +1 -1
- package/public/{chunk-DJ7A6WCT.js → chunk-GWNPEDCO.js} +1 -1
- package/public/{chunk-TCKHBFBN.js → chunk-GY5IU7V6.js} +1 -1
- package/public/chunk-HDSIQ3YC.js +1 -0
- package/public/{chunk-YZMZPZB3.js → chunk-HGQEJUXT.js} +1 -1
- package/public/{chunk-2OBPFCY2.js → chunk-HMLQRCI3.js} +1 -1
- package/public/{chunk-RHYCATQR.js → chunk-HU7MY4LI.js} +1 -1
- package/public/{chunk-AK4S37TG.js → chunk-JD6VVCEW.js} +1 -1
- package/public/chunk-JFIHJ3Q3.js +1 -0
- package/public/chunk-JGXXT6IR.js +1 -0
- package/public/{chunk-IEOEU3PV.js → chunk-JQXMIHEB.js} +1 -1
- package/public/{chunk-Z2BKSNSC.js → chunk-LB6V2YG4.js} +1 -1
- package/public/{chunk-EWHDFFHL.js → chunk-MJUVZJID.js} +1 -1
- package/public/{chunk-AXOQXZMS.js → chunk-MPKEEZAZ.js} +1 -1
- package/public/chunk-NBBKPNTW.js +1 -0
- package/public/{chunk-TJHYTY4K.js → chunk-OCZ7ZL4Q.js} +1 -1
- package/public/{chunk-CAAUHMGY.js → chunk-OEDNHUXO.js} +1 -1
- package/public/{chunk-M6OQT53Y.js → chunk-OLLXLIJL.js} +1 -1
- package/public/{chunk-5PQJRA5G.js → chunk-ONXAUCPC.js} +1 -1
- package/public/{chunk-GJEQY7FK.js → chunk-P7EHJMBY.js} +1 -1
- package/public/{chunk-CWBE5JGC.js → chunk-PFECLHTP.js} +1 -1
- package/public/{chunk-VISSPBAJ.js → chunk-RAMVTXDA.js} +1 -1
- package/public/{chunk-JIG56QTE.js → chunk-SALYYWC7.js} +1 -1
- package/public/chunk-SNKIKDGE.js +1 -0
- package/public/{chunk-3EHBMPWY.js → chunk-SSNGMNNA.js} +1 -1
- package/public/chunk-TBKVNDIH.js +1 -0
- package/public/{chunk-G6GTWDKY.js → chunk-U2JRPT6W.js} +1 -1
- package/public/{chunk-QELUTKQF.js → chunk-UEWO3CCO.js} +1 -1
- package/public/{chunk-A2LWX7FC.js → chunk-VI2PSWUC.js} +1 -1
- package/public/{chunk-JX3E4VFM.js → chunk-W6FUZHB3.js} +1 -1
- package/public/chunk-WDD3VBFU.js +1 -0
- package/public/{chunk-NKGM5COZ.js → chunk-XIFH4RON.js} +1 -1
- package/public/{chunk-Z4W7FR2B.js → chunk-XS2KXGME.js} +1 -1
- package/public/chunk-YE2AQ3RJ.js +1 -0
- package/public/{chunk-4CHNDLJI.js → chunk-YKNEFSIE.js} +1 -1
- package/public/{chunk-OT3IJBCR.js → chunk-Z7FCAS3S.js} +1 -1
- package/public/{chunk-VWAY3YX4.js → chunk-ZOPL7QXT.js} +1 -1
- package/public/{chunk-FPFW7VCW.js → chunk-ZPAQRBB4.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-LJS4FW2X.js → main-XRPZFGPB.js} +1 -1
- package/public/chunk-5T7JAJJE.js +0 -1
- package/public/chunk-AWX3JVVV.js +0 -1
- package/public/chunk-B4ZMGETB.js +0 -1
- package/public/chunk-EO357XL5.js +0 -1
- package/public/chunk-F6QHMWSD.js +0 -1
- package/public/chunk-J75SJ6HL.js +0 -1
- package/public/chunk-KUE46RRU.js +0 -1
- package/public/chunk-N4VWPJ6S.js +0 -1
- package/public/chunk-P3A42IW2.js +0 -1
- package/public/chunk-PKP4FSKB.js +0 -1
- package/public/chunk-QR2DRJ5Q.js +0 -1
- package/public/chunk-S4CZRO5L.js +0 -1
- package/public/chunk-TVF7CAJN.js +0 -1
- package/public/chunk-U6XLWNAV.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-OEDNHUXO.js";import"./chunk-ZPAQRBB4.js";import"./chunk-Q7VA22QV.js";import"./chunk-YXEV6KOV.js";import"./chunk-U2JRPT6W.js";import"./chunk-4RE7M7JJ.js";import"./chunk-Z7FCAS3S.js";import"./chunk-DOZWR3M6.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as TerminalComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as pe}from"./chunk-UOC65WET.js";import{j as le}from"./chunk-4WTLH2XC.js";import{f as We,ga as fe,k as he,la as ue,n as X}from"./chunk-U4V4ICSI.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=ue(pe);namespaceConnectionCache={};constructor(){}connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${le.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new he(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=fe({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
|
|
1
|
+
import{c as pe}from"./chunk-4RE7M7JJ.js";import{j as le}from"./chunk-DOZWR3M6.js";import{f as We,ga as fe,k as he,la as ue,n as X}from"./chunk-U4V4ICSI.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ye=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ge=typeof ArrayBuffer=="function",_e=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,B=({type:r,data:e},t,s)=>ye&&e instanceof Blob?t?s(e):de(e,s):ge&&(e instanceof ArrayBuffer||_e(e))?t?s(e):de(new Blob([e]),s):s(d[r]+(e||"")),de=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function me(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var $;function be(r,e){if(ye&&r.data instanceof Blob)return r.data.arrayBuffer().then(me).then(e);if(ge&&(r.data instanceof ArrayBuffer||_e(r.data)))return e(me(r.data));B(r,!1,t=>{$||($=new TextEncoder),e($.encode(t))})}var we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<we.length;r++)N[we.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,c,a;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=N[r.charCodeAt(s)],o=N[r.charCodeAt(s+1)],c=N[r.charCodeAt(s+2)],a=N[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|c>>2,p[i++]=(c&3)<<6|a&63;return m};var Ke=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:Ee(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Ye(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Ye=(r,e)=>{if(Ke){let t=ke(r);return Ee(t,e)}else return{base64:!0,data:r}},Ee=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var ve="",xe=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{B(n,!1,c=>{s[o]=c,++i===t&&e(s.join(ve))})})},Te=(r,e)=>{let t=r.split(ve),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ae(){return new TransformStream({transform(r,e){be(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Q;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){Q||(Q=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(s===0){if(U(t)<1)break;let a=V(t,1);n=(a[0]&128)===128,i=a[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let a=V(t,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let a=V(t,8),m=new DataView(a.buffer,a.byteOffset,a.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){c.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let a=V(t,i);c.enqueue(L(n?a:Q.decode(a),e)),s=0}if(i===0||i>r){c.enqueue(O);break}}}})}var j=4;function f(r){if(r)return Je(r)}function Je(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Ce="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var ze=u.setTimeout,Xe=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=ze.bind(u),r.clearTimeoutFn=Xe.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var $e=1.33;function Se(r){return typeof r=="string"?Qe(r):Math.ceil((r.byteLength||r.size)*$e)}function Qe(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Oe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Oe(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Te(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,xe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Ne=!1;try{Ne=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Le=Ne;function je(){}var G=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=je,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Pe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,Pe,!1)}}function Pe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ge=function(){let r=qe({xdomain:!1});return r&&r.responseType!==null}(),w=class extends G{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ge&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(qe,this.uri(),e)}};function qe(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Le))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var De=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",ee=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=De?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;B(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Z=u.WebSocket||u.MozWebSocket,k=class extends ee{createSocket(e,t,s){return De?new Z(e,t,s):t?new Z(e,t):new Z(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ae();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:c,value:a})=>{c||(this.onPacket(a),n())}).catch(c=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var te={websocket:k,webtransport:v,polling:w};var Ze=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,et=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=Ze.exec(r||""),n={},o=14;for(;o--;)n[et[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=tt(n,n.path),n.queryKey=st(n,n.query),n}function tt(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function st(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var se=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];se&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Ce,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),se&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=j,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Se(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),se&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=j,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let C=new Error("probe error: "+b);C.transport=t.name,n(),this.emitReserved("upgradeError",C)};function c(){o("transport closed")}function a(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",c),this.off("close",a),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",c),this.once("close",a),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>te[i]).filter(i=>!!i)),super(e,s)}};var ds=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var ae={};We(ae,{Decoder:()=>oe,Encoder:()=>ne,PacketType:()=>h,protocol:()=>He});var it=typeof ArrayBuffer=="function",nt=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ie=Object.prototype.toString,ot=typeof Blob=="function"||typeof Blob<"u"&&Ie.call(Blob)==="[object BlobConstructor]",ct=typeof File=="function"||typeof File<"u"&&Ie.call(File)==="[object FileConstructor]";function D(r){return it&&(r instanceof ArrayBuffer||nt(r))||ot&&r instanceof Blob||ct&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ue(r){let e=[],t=r.data,s=r;return s.data=re(t,e),s.attachments=e.length,{packet:s,buffers:e}}function re(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=re(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=re(r[s],e));return t}return r}function Ve(r,e){return r.data=ie(r.data,e),delete r.attachments,r}function ie(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ie(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ie(r[t],e));return r}var at=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],He=5,h=function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r}(h||{}),ne=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&q(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ue(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}};function Me(r){return Object.prototype.toString.call(r)==="[object Object]"}var oe=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===h.BINARY_EVENT;s||t.type===h.BINARY_ACK?(t.type=s?h.EVENT:h.ACK,this.reconstructor=new ce(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(h[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===h.BINARY_EVENT||s.type===h.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Me(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Me(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&at.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ce=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Ve(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var ht=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(ht.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let c=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!c||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&this.sendBuffer.splice(c,1);t.call(this,new Error("operation has timed out"))},i),o=(...c)=>{this.io.clearTimeoutFn(n),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,c)=>o?i(o):s(c);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:h.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function E(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}E.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};E.prototype.reset=function(){this.attempts=0};E.prototype.setMin=function(r){this.ms=r};E.prototype.setMax=function(r){this.max=r};E.prototype.setJitter=function(r){this.jitter=r};var R=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new E({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||ae;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=c=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let c=this._timeout,a=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},c);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var F={};function I(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=F[i]&&n in F[i].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,a;return c?a=new R(s,e):(F[i]||(F[i]=new R(s,e)),a=F[i]),t.query&&!e.query&&(e.query=t.queryKey),a.socket(t.path,e)}Object.assign(I,{Manager:R,Socket:A,io:I,connect:I});var cr=(()=>{class r{$auth=ue(pe);namespaceConnectionCache={};constructor(){}connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new X,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new X,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=I(`${le.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new he(c=>{s.emit(n,o,a=>{typeof a=="object"&&a.error?c.error(a):c.next(a),c.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=fe({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{cr as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as uu,b as Z6}from"./chunk-JIG56QTE.js";import{a as S1}from"./chunk-2FGEOEQD.js";import{a as en,b as tn}from"./chunk-3VIG5M5R.js";import{a as T1}from"./chunk-XZR7OZ6I.js";import{a as O1}from"./chunk-OGSVTVGE.js";import{a as P1}from"./chunk-FHMZVMZK.js";import{a as of}from"./chunk-JMCN2SQV.js";import{a as A1,b as k1}from"./chunk-YXEV6KOV.js";import{a as ss}from"./chunk-LTDUXFUG.js";import{a as $1}from"./chunk-RSIXVZQ5.js";import{a as Ur,b as Wr,c as Gr,d as Kr,e as Jr,f as Xr,g as Yi,m as ve,n as it,o as Zi}from"./chunk-YHABGXDF.js";import{a as E1,b as Gi,c as Ki,e as vt,f as _1,h as y1,i as v1,k as B1,l as Yu,m as x1,o as Ji,r as Xi,s as yi,t as vi,x as w1,y as tu,z as as}from"./chunk-JOBKDXBH.js";import{a as Qi}from"./chunk-G6GTWDKY.js";import{d as cu}from"./chunk-QR7L4UUP.js";import{a as I1}from"./chunk-UOC65WET.js";import{b as Ve}from"./chunk-OT3IJBCR.js";import{h as _e,j as Zu,k as he}from"./chunk-4WTLH2XC.js";import{e as b1}from"./chunk-ASBFWS7L.js";import{a as Ee,b as Be}from"./chunk-DJKI5XBW.js";import{$a as l,Ac as v,Bc as B,Ca as Hu,Cc as Ye,D as f1,Da as s1,Fa as Uu,Gb as K,Hb as w,Ib as S,Jc as gt,Kb as nt,Kc as z,Lb as ft,Lc as Xu,M as Vr,Mb as rt,Nb as b,Nc as h1,Ob as c,Pb as p,Qb as I,Rb as c1,Sb as p1,Ub as U,Xa as de,Xb as M,Yb as h,Z as ns,_a as D1,a as X,aa as rf,ac as fs,b as Se,bc as rs,bd as zt,cc as os,cd as _i,dc as Wu,dd as bt,e as F,eb as Lr,ec as Gu,fa as r1,fb as yu,g as ze,ga as Ot,gc as Qt,gd as g1,h as G,ha as Hi,hb as Ei,hc as Ku,ic as Z,ja as o1,jc as _,k as t1,ka as a1,kc as H,kd as Hr,la as x,lb as Y,lc as q,mb as Ui,mc as Bu,n as Pt,nb as vu,nc as m1,o as is,ob as l1,q as u1,qc as Te,ra as j,rb as ce,rc as Pe,sa as N,sc as Oe,tb as d1,tc as F1,ub as zr,uc as C1,v as i1,vc as Xe,w as se,wc as eu,x as n1,xc as Ju,yc as xu,za as Rr,zc as Wi}from"./chunk-U4V4ICSI.js";var Df=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var af=class{};be._CodeOrName=af;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bi=class extends af{constructor(u){if(super(),!be.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=Bi;var Ht=class extends af{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Bi&&(t[i.str]=(t[i.str]||0)+1),t),{})}};be._Code=Ht;be.nil=new Ht("");function M1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ls(t,u[i]),t.push(e[++i]);return new Ht(t)}be._=M1;var Ds=new Ht("+");function j1(e,...u){let t=[sf(e[0])],i=0;for(;i<u.length;)t.push(Ds),ls(t,u[i]),t.push(Ds,sf(e[++i]));return eb(t),new Ht(t)}be.str=j1;function ls(e,u){u instanceof Ht?e.push(...u._items):u instanceof Bi?e.push(u):e.push(ib(u))}be.addCodeArg=ls;function eb(e){let u=1;for(;u<e.length-1;){if(e[u]===Ds){let t=tb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function tb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Bi||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Bi))return`"${e}${u.slice(1)}`}function ub(e,u){return u.emptyStr()?e:e.emptyStr()?u:j1`${e}${u}`}be.strConcat=ub;function ib(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:sf(Array.isArray(e)?e.join(","):e)}function nb(e){return new Ht(sf(e))}be.stringify=nb;function sf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=sf;function fb(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Ht(`.${e}`):M1`[${e}]`}be.getProperty=fb;function rb(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=rb;function ob(e){return new Ht(e.toString())}be.regexpCode=ob});var ps=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=Df(),ds=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var ab=(0,Bt._)`\n`,cs=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=Se(X({},u),{_n:u.lines?ab:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new ds(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=cs});var ee=F(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.or=ae.and=ae.not=ae.CodeGen=ae.operators=ae.varKinds=ae.ValueScopeName=ae.ValueScope=ae.Scope=ae.Name=ae.regexpCode=ae.stringify=ae.getProperty=ae.nil=ae.strConcat=ae.str=ae._=void 0;var Fe=Df(),iu=ps(),Qu=Df();Object.defineProperty(ae,"_",{enumerable:!0,get:function(){return Qu._}});Object.defineProperty(ae,"str",{enumerable:!0,get:function(){return Qu.str}});Object.defineProperty(ae,"strConcat",{enumerable:!0,get:function(){return Qu.strConcat}});Object.defineProperty(ae,"nil",{enumerable:!0,get:function(){return Qu.nil}});Object.defineProperty(ae,"getProperty",{enumerable:!0,get:function(){return Qu.getProperty}});Object.defineProperty(ae,"stringify",{enumerable:!0,get:function(){return Qu.stringify}});Object.defineProperty(ae,"regexpCode",{enumerable:!0,get:function(){return Qu.regexpCode}});Object.defineProperty(ae,"Name",{enumerable:!0,get:function(){return Qu.Name}});var no=ps();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(ae,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(ae,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(ae,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});ae.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var wu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},ms=class extends wu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=nn(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends wu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=nn(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Fs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},Cs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},hs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},gs=class extends wu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},bs=class extends wu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=nn(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},lf=class extends wu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(sb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>xi(u,t.names),{})}},Su=class extends lf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},Es=class extends lf{},_s=(()=>{class e extends Su{}return e.kind="else",e})(),eo=(()=>{class e extends Su{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new _s(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(L1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=nn(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&xi(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends Su{}return e.kind="for",e})(),ys=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=nn(this.iteration,u,t),this}get names(){return xi(super.names,this.iteration.names)}},vs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=nn(this.iterable,u,t),this}get names(){return xi(super.names,this.iterable.names)}},N1=(()=>{class e extends Su{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),q1=(()=>{class e extends lf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Bs=class extends Su{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&xi(u,this.catch.names),this.finally&&xi(u,this.finally.names),u}},V1=(()=>{class e extends Su{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),R1=(()=>{class e extends Su{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),xs=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Se(X({},t),{_n:t.lines?`
|
|
1
|
+
import{a as uu,b as Z6}from"./chunk-SALYYWC7.js";import{a as S1}from"./chunk-2FGEOEQD.js";import{a as en,b as tn}from"./chunk-3VIG5M5R.js";import{a as T1}from"./chunk-XZR7OZ6I.js";import{a as O1}from"./chunk-CGJH6JTF.js";import{a as P1}from"./chunk-FHMZVMZK.js";import{a as of}from"./chunk-JMCN2SQV.js";import{a as A1,b as k1}from"./chunk-YXEV6KOV.js";import{a as ss}from"./chunk-LTDUXFUG.js";import{a as $1}from"./chunk-RSIXVZQ5.js";import{a as Ur,b as Wr,c as Gr,d as Kr,e as Jr,f as Xr,g as Yi,m as ve,n as it,o as Zi}from"./chunk-YHABGXDF.js";import{a as E1,b as Gi,c as Ki,e as vt,f as _1,h as y1,i as v1,k as B1,l as Yu,m as x1,o as Ji,r as Xi,s as yi,t as vi,x as w1,y as tu,z as as}from"./chunk-JOBKDXBH.js";import{a as Qi}from"./chunk-U2JRPT6W.js";import{d as cu}from"./chunk-QR7L4UUP.js";import{a as I1}from"./chunk-4RE7M7JJ.js";import{b as Ve}from"./chunk-Z7FCAS3S.js";import{h as _e,j as Zu,k as he}from"./chunk-DOZWR3M6.js";import{e as b1}from"./chunk-ASBFWS7L.js";import{a as Ee,b as Be}from"./chunk-DJKI5XBW.js";import{$a as l,Ac as v,Bc as B,Ca as Hu,Cc as Ye,D as f1,Da as s1,Fa as Uu,Gb as K,Hb as w,Ib as S,Jc as gt,Kb as nt,Kc as z,Lb as ft,Lc as Xu,M as Vr,Mb as rt,Nb as b,Nc as h1,Ob as c,Pb as p,Qb as I,Rb as c1,Sb as p1,Ub as U,Xa as de,Xb as M,Yb as h,Z as ns,_a as D1,a as X,aa as rf,ac as fs,b as Se,bc as rs,bd as zt,cc as os,cd as _i,dc as Wu,dd as bt,e as F,eb as Lr,ec as Gu,fa as r1,fb as yu,g as ze,ga as Ot,gc as Qt,gd as g1,h as G,ha as Hi,hb as Ei,hc as Ku,ic as Z,ja as o1,jc as _,k as t1,ka as a1,kc as H,kd as Hr,la as x,lb as Y,lc as q,mb as Ui,mc as Bu,n as Pt,nb as vu,nc as m1,o as is,ob as l1,q as u1,qc as Te,ra as j,rb as ce,rc as Pe,sa as N,sc as Oe,tb as d1,tc as F1,ub as zr,uc as C1,v as i1,vc as Xe,w as se,wc as eu,x as n1,xc as Ju,yc as xu,za as Rr,zc as Wi}from"./chunk-U4V4ICSI.js";var Df=F(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.regexpCode=be.getEsmExportName=be.getProperty=be.safeStringify=be.stringify=be.strConcat=be.addCodeArg=be.str=be._=be.nil=be._Code=be.Name=be.IDENTIFIER=be._CodeOrName=void 0;var af=class{};be._CodeOrName=af;be.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bi=class extends af{constructor(u){if(super(),!be.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};be.Name=Bi;var Ht=class extends af{constructor(u){super(),this._items=typeof u=="string"?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let u=this._items[0];return u===""||u==='""'}get str(){var u;return(u=this._str)!==null&&u!==void 0?u:this._str=this._items.reduce((t,i)=>`${t}${i}`,"")}get names(){var u;return(u=this._names)!==null&&u!==void 0?u:this._names=this._items.reduce((t,i)=>(i instanceof Bi&&(t[i.str]=(t[i.str]||0)+1),t),{})}};be._Code=Ht;be.nil=new Ht("");function M1(e,...u){let t=[e[0]],i=0;for(;i<u.length;)ls(t,u[i]),t.push(e[++i]);return new Ht(t)}be._=M1;var Ds=new Ht("+");function j1(e,...u){let t=[sf(e[0])],i=0;for(;i<u.length;)t.push(Ds),ls(t,u[i]),t.push(Ds,sf(e[++i]));return eb(t),new Ht(t)}be.str=j1;function ls(e,u){u instanceof Ht?e.push(...u._items):u instanceof Bi?e.push(u):e.push(ib(u))}be.addCodeArg=ls;function eb(e){let u=1;for(;u<e.length-1;){if(e[u]===Ds){let t=tb(e[u-1],e[u+1]);if(t!==void 0){e.splice(u-1,3,t);continue}e[u++]="+"}u++}}function tb(e,u){if(u==='""')return e;if(e==='""')return u;if(typeof e=="string")return u instanceof Bi||e[e.length-1]!=='"'?void 0:typeof u!="string"?`${e.slice(0,-1)}${u}"`:u[0]==='"'?e.slice(0,-1)+u.slice(1):void 0;if(typeof u=="string"&&u[0]==='"'&&!(e instanceof Bi))return`"${e}${u.slice(1)}`}function ub(e,u){return u.emptyStr()?e:e.emptyStr()?u:j1`${e}${u}`}be.strConcat=ub;function ib(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:sf(Array.isArray(e)?e.join(","):e)}function nb(e){return new Ht(sf(e))}be.stringify=nb;function sf(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}be.safeStringify=sf;function fb(e){return typeof e=="string"&&be.IDENTIFIER.test(e)?new Ht(`.${e}`):M1`[${e}]`}be.getProperty=fb;function rb(e){if(typeof e=="string"&&be.IDENTIFIER.test(e))return new Ht(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}be.getEsmExportName=rb;function ob(e){return new Ht(e.toString())}be.regexpCode=ob});var ps=F(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ValueScope=xt.ValueScopeName=xt.Scope=xt.varKinds=xt.UsedValueState=void 0;var Bt=Df(),ds=class extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}},Yr=function(e){return e[e.Started=0]="Started",e[e.Completed=1]="Completed",e}(Yr||(xt.UsedValueState=Yr={}));xt.varKinds={const:new Bt.Name("const"),let:new Bt.Name("let"),var:new Bt.Name("var")};var Zr=class{constructor({prefixes:u,parent:t}={}){this._names={},this._prefixes=u,this._parent=t}toName(u){return u instanceof Bt.Name?u:this.name(u)}name(u){return new Bt.Name(this._newName(u))}_newName(u){let t=this._names[u]||this._nameGroup(u);return`${u}${t.index++}`}_nameGroup(u){var t,i;if(!((i=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||i===void 0)&&i.has(u)||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}};xt.Scope=Zr;var Qr=class extends Bt.Name{constructor(u,t){super(t),this.prefix=u}setValue(u,{property:t,itemIndex:i}){this.value=u,this.scopePath=(0,Bt._)`.${new Bt.Name(t)}[${i}]`}};xt.ValueScopeName=Qr;var ab=(0,Bt._)`\n`,cs=class extends Zr{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts=Se(X({},u),{_n:u.lines?ab:Bt.nil})}get(){return this._scope}name(u){return new Qr(u,this._newName(u))}value(u,t){var i;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(u),{prefix:f}=n,r=(i=t.key)!==null&&i!==void 0?i:t.ref,o=this._values[f];if(o){let D=o.get(r);if(D)return D}else o=this._values[f]=new Map;o.set(r,n);let a=this._scope[f]||(this._scope[f]=[]),s=a.length;return a[s]=t.ref,n.setValue(t,{property:f,itemIndex:s}),n}getValue(u,t){let i=this._values[u];if(i)return i.get(t)}scopeRefs(u,t=this._values){return this._reduceValues(t,i=>{if(i.scopePath===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return(0,Bt._)`${u}${i.scopePath}`})}scopeCode(u=this._values,t,i){return this._reduceValues(u,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,i)}_reduceValues(u,t,i={},n){let f=Bt.nil;for(let r in u){let o=u[r];if(!o)continue;let a=i[r]=i[r]||new Map;o.forEach(s=>{if(a.has(s))return;a.set(s,Yr.Started);let D=t(s);if(D){let d=this.opts.es5?xt.varKinds.var:xt.varKinds.const;f=(0,Bt._)`${f}${d} ${s} = ${D};${this.opts._n}`}else if(D=n?.(s))f=(0,Bt._)`${f}${D}${this.opts._n}`;else throw new ds(s);a.set(s,Yr.Completed)})}return f}};xt.ValueScope=cs});var ee=F(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.or=ae.and=ae.not=ae.CodeGen=ae.operators=ae.varKinds=ae.ValueScopeName=ae.ValueScope=ae.Scope=ae.Name=ae.regexpCode=ae.stringify=ae.getProperty=ae.nil=ae.strConcat=ae.str=ae._=void 0;var Fe=Df(),iu=ps(),Qu=Df();Object.defineProperty(ae,"_",{enumerable:!0,get:function(){return Qu._}});Object.defineProperty(ae,"str",{enumerable:!0,get:function(){return Qu.str}});Object.defineProperty(ae,"strConcat",{enumerable:!0,get:function(){return Qu.strConcat}});Object.defineProperty(ae,"nil",{enumerable:!0,get:function(){return Qu.nil}});Object.defineProperty(ae,"getProperty",{enumerable:!0,get:function(){return Qu.getProperty}});Object.defineProperty(ae,"stringify",{enumerable:!0,get:function(){return Qu.stringify}});Object.defineProperty(ae,"regexpCode",{enumerable:!0,get:function(){return Qu.regexpCode}});Object.defineProperty(ae,"Name",{enumerable:!0,get:function(){return Qu.Name}});var no=ps();Object.defineProperty(ae,"Scope",{enumerable:!0,get:function(){return no.Scope}});Object.defineProperty(ae,"ValueScope",{enumerable:!0,get:function(){return no.ValueScope}});Object.defineProperty(ae,"ValueScopeName",{enumerable:!0,get:function(){return no.ValueScopeName}});Object.defineProperty(ae,"varKinds",{enumerable:!0,get:function(){return no.varKinds}});ae.operators={GT:new Fe._Code(">"),GTE:new Fe._Code(">="),LT:new Fe._Code("<"),LTE:new Fe._Code("<="),EQ:new Fe._Code("==="),NEQ:new Fe._Code("!=="),NOT:new Fe._Code("!"),OR:new Fe._Code("||"),AND:new Fe._Code("&&"),ADD:new Fe._Code("+")};var wu=class{optimizeNodes(){return this}optimizeNames(u,t){return this}},ms=class extends wu{constructor(u,t,i){super(),this.varKind=u,this.name=t,this.rhs=i}render({es5:u,_n:t}){let i=u?iu.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${i} ${this.name}${n};`+t}optimizeNames(u,t){if(u[this.name.str])return this.rhs&&(this.rhs=nn(this.rhs,u,t)),this}get names(){return this.rhs instanceof Fe._CodeOrName?this.rhs.names:{}}},to=class extends wu{constructor(u,t,i){super(),this.lhs=u,this.rhs=t,this.sideEffects=i}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,t){if(!(this.lhs instanceof Fe.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=nn(this.rhs,u,t),this}get names(){let u=this.lhs instanceof Fe.Name?{}:X({},this.lhs.names);return io(u,this.rhs)}},Fs=class extends to{constructor(u,t,i,n){super(u,i,n),this.op=t}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}},Cs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}},hs=class extends wu{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}},gs=class extends wu{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}},bs=class extends wu{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,t){return this.code=nn(this.code,u,t),this}get names(){return this.code instanceof Fe._CodeOrName?this.code.names:{}}},lf=class extends wu{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((t,i)=>t+i.render(u),"")}optimizeNodes(){let{nodes:u}=this,t=u.length;for(;t--;){let i=u[t].optimizeNodes();Array.isArray(i)?u.splice(t,1,...i):i?u[t]=i:u.splice(t,1)}return u.length>0?this:void 0}optimizeNames(u,t){let{nodes:i}=this,n=i.length;for(;n--;){let f=i[n];f.optimizeNames(u,t)||(sb(u,f.names),i.splice(n,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce((u,t)=>xi(u,t.names),{})}},Su=class extends lf{render(u){return"{"+u._n+super.render(u)+"}"+u._n}},Es=class extends lf{},_s=(()=>{class e extends Su{}return e.kind="else",e})(),eo=(()=>{class e extends Su{constructor(t,i){super(i),this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);return this.else&&(i+="else "+this.else.render(t)),i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let n=i.optimizeNodes();i=this.else=Array.isArray(n)?new _s(n):n}if(i)return t===!1?i instanceof e?i:i.nodes:this.nodes.length?this:new e(L1(t),i instanceof e?[i]:i.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,i){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,i),!!(super.optimizeNames(t,i)||this.else))return this.condition=nn(this.condition,t,i),this}get names(){let t=super.names;return io(t,this.condition),this.else&&xi(t,this.else.names),t}}return e.kind="if",e})(),fo=(()=>{class e extends Su{}return e.kind="for",e})(),ys=class extends fo{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iteration=nn(this.iteration,u,t),this}get names(){return xi(super.names,this.iteration.names)}},vs=class extends fo{constructor(u,t,i,n){super(),this.varKind=u,this.name=t,this.from=i,this.to=n}render(u){let t=u.es5?iu.varKinds.var:this.varKind,{name:i,from:n,to:f}=this;return`for(${t} ${i}=${n}; ${i}<${f}; ${i}++)`+super.render(u)}get names(){let u=io(super.names,this.from);return io(u,this.to)}},uo=class extends fo{constructor(u,t,i,n){super(),this.loop=u,this.varKind=t,this.name=i,this.iterable=n}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,t){if(super.optimizeNames(u,t))return this.iterable=nn(this.iterable,u,t),this}get names(){return xi(super.names,this.iterable.names)}},N1=(()=>{class e extends Su{constructor(t,i,n){super(),this.name=t,this.args=i,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}return e.kind="func",e})(),q1=(()=>{class e extends lf{render(t){return"return "+super.render(t)}}return e.kind="return",e})(),Bs=class extends Su{render(u){let t="try"+super.render(u);return this.catch&&(t+=this.catch.render(u)),this.finally&&(t+=this.finally.render(u)),t}optimizeNodes(){var u,t;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(u,t){var i,n;return super.optimizeNames(u,t),(i=this.catch)===null||i===void 0||i.optimizeNames(u,t),(n=this.finally)===null||n===void 0||n.optimizeNames(u,t),this}get names(){let u=super.names;return this.catch&&xi(u,this.catch.names),this.finally&&xi(u,this.finally.names),u}},V1=(()=>{class e extends Su{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}return e.kind="catch",e})(),R1=(()=>{class e extends Su{render(t){return"finally"+super.render(t)}}return e.kind="finally",e})(),xs=class{constructor(u,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts=Se(X({},t),{_n:t.lines?`
|
|
2
2
|
`:""}),this._extScope=u,this._scope=new iu.Scope({parent:u}),this._nodes=[new Es]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,t){let i=this._extScope.value(u,t);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(u,t){return this._extScope.getValue(u,t)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,t,i,n){let f=this._scope.toName(t);return i!==void 0&&n&&(this._constants[f.str]=i),this._leafNode(new ms(u,f,i)),f}const(u,t,i){return this._def(iu.varKinds.const,u,t,i)}let(u,t,i){return this._def(iu.varKinds.let,u,t,i)}var(u,t,i){return this._def(iu.varKinds.var,u,t,i)}assign(u,t,i){return this._leafNode(new to(u,t,i))}add(u,t){return this._leafNode(new Fs(u,ae.operators.ADD,t))}code(u){return typeof u=="function"?u():u!==Fe.nil&&this._leafNode(new bs(u)),this}object(...u){let t=["{"];for(let[i,n]of u)t.length>1&&t.push(","),t.push(i),(i!==n||this.opts.es5)&&(t.push(":"),(0,Fe.addCodeArg)(t,n));return t.push("}"),new Fe._Code(t)}if(u,t,i){if(this._blockNode(new eo(u)),t&&i)this.code(t).else().code(i).endIf();else if(t)this.code(t).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new eo(u))}else(){return this._elseNode(new _s)}endIf(){return this._endBlockNode(eo,_s)}_for(u,t){return this._blockNode(u),t&&this.code(t).endFor(),this}for(u,t){return this._for(new ys(u),t)}forRange(u,t,i,n,f=this.opts.es5?iu.varKinds.var:iu.varKinds.let){let r=this._scope.toName(u);return this._for(new vs(f,r,t,i),()=>n(r))}forOf(u,t,i,n=iu.varKinds.const){let f=this._scope.toName(u);if(this.opts.es5){let r=t instanceof Fe.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Fe._)`${r}.length`,o=>{this.var(f,(0,Fe._)`${r}[${o}]`),i(f)})}return this._for(new uo("of",n,f,t),()=>i(f))}forIn(u,t,i,n=this.opts.es5?iu.varKinds.var:iu.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,Fe._)`Object.keys(${t})`,i);let f=this._scope.toName(u);return this._for(new uo("in",n,f,t),()=>i(f))}endFor(){return this._endBlockNode(fo)}label(u){return this._leafNode(new Cs(u))}break(u){return this._leafNode(new hs(u))}return(u){let t=new q1;if(this._blockNode(t),this.code(u),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(q1)}try(u,t,i){if(!t&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new Bs;if(this._blockNode(n),this.code(u),t){let f=this.name("e");this._currNode=n.catch=new V1(f),t(f)}return i&&(this._currNode=n.finally=new R1,this.code(i)),this._endBlockNode(V1,R1)}throw(u){return this._leafNode(new gs(u))}block(u,t){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(t),this}endBlock(u){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-t;if(i<0||u!==void 0&&i!==u)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${u} expected`);return this._nodes.length=t,this}func(u,t=Fe.nil,i,n){return this._blockNode(new N1(u,t,i)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(N1)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,t){let i=this._currNode;if(i instanceof u||t&&i instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${u.kind}/${t.kind}`:u.kind}"`)}_elseNode(u){let t=this._currNode;if(!(t instanceof eo))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=u,this}get _root(){return this._nodes[0]}get _currNode(){let u=this._nodes;return u[u.length-1]}set _currNode(u){let t=this._nodes;t[t.length-1]=u}};ae.CodeGen=xs;function xi(e,u){for(let t in u)e[t]=(e[t]||0)+(u[t]||0);return e}function io(e,u){return u instanceof Fe._CodeOrName?xi(e,u.names):e}function nn(e,u,t){if(e instanceof Fe.Name)return i(e);if(!n(e))return e;return new Fe._Code(e._items.reduce((f,r)=>(r instanceof Fe.Name&&(r=i(r)),r instanceof Fe._Code?f.push(...r._items):f.push(r),f),[]));function i(f){let r=t[f.str];return r===void 0||u[f.str]!==1?f:(delete u[f.str],r)}function n(f){return f instanceof Fe._Code&&f._items.some(r=>r instanceof Fe.Name&&u[r.str]===1&&t[r.str]!==void 0)}}function sb(e,u){for(let t in u)e[t]=(e[t]||0)-(u[t]||0)}function L1(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,Fe._)`!${ws(e)}`}ae.not=L1;var Db=z1(ae.operators.AND);function lb(...e){return e.reduce(Db)}ae.and=lb;var db=z1(ae.operators.OR);function cb(...e){return e.reduce(db)}ae.or=cb;function z1(e){return(u,t)=>u===Fe.nil?t:t===Fe.nil?u:(0,Fe._)`${ws(u)} ${e} ${ws(t)}`}function ws(e){return e instanceof Fe.Name?e:(0,Fe._)`(${e})`}});var le=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var Ie=ee(),pb=Df();function mb(e){let u={};for(let t of e)u[t]=!0;return u}De.toHash=mb;function Fb(e,u){return typeof u=="boolean"?u:Object.keys(u).length===0?!0:(W1(e,u),!G1(u,e.self.RULES.all))}De.alwaysValidSchema=Fb;function W1(e,u=e.schema){let{opts:t,self:i}=e;if(!t.strictSchema||typeof u=="boolean")return;let n=i.RULES.keywords;for(let f in u)n[f]||X1(e,`unknown keyword: "${f}"`)}De.checkUnknownRules=W1;function G1(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(u[t])return!0;return!1}De.schemaHasRules=G1;function Cb(e,u){if(typeof e=="boolean")return!e;for(let t in e)if(t!=="$ref"&&u.all[t])return!0;return!1}De.schemaHasRulesButRef=Cb;function hb({topSchemaRef:e,schemaPath:u},t,i,n){if(!n){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,Ie._)`${t}`}return(0,Ie._)`${e}${u}${(0,Ie.getProperty)(i)}`}De.schemaRefOrVal=hb;function gb(e){return K1(decodeURIComponent(e))}De.unescapeFragment=gb;function bb(e){return encodeURIComponent(Is(e))}De.escapeFragment=bb;function Is(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Is;function K1(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=K1;function Eb(e,u){if(Array.isArray(e))for(let t of e)u(t);else u(e)}De.eachItem=Eb;function H1({mergeNames:e,mergeToName:u,mergeValues:t,resultToName:i}){return(n,f,r,o)=>{let a=r===void 0?f:r instanceof Ie.Name?(f instanceof Ie.Name?e(n,f,r):u(n,f,r),r):f instanceof Ie.Name?(u(n,r,f),f):t(f,r);return o===Ie.Name&&!(a instanceof Ie.Name)?i(n,a):a}}De.mergeEvaluated={props:H1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>{e.if((0,Ie._)`${u} === true`,()=>e.assign(t,!0),()=>e.assign(t,(0,Ie._)`${t} || {}`).code((0,Ie._)`Object.assign(${t}, ${u})`))}),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>{u===!0?e.assign(t,!0):(e.assign(t,(0,Ie._)`${t} || {}`),As(e,t,u))}),mergeValues:(e,u)=>e===!0?!0:X(X({},e),u),resultToName:J1}),items:H1({mergeNames:(e,u,t)=>e.if((0,Ie._)`${t} !== true && ${u} !== undefined`,()=>e.assign(t,(0,Ie._)`${u} === true ? true : ${t} > ${u} ? ${t} : ${u}`)),mergeToName:(e,u,t)=>e.if((0,Ie._)`${t} !== true`,()=>e.assign(t,u===!0?!0:(0,Ie._)`${t} > ${u} ? ${t} : ${u}`)),mergeValues:(e,u)=>e===!0?!0:Math.max(e,u),resultToName:(e,u)=>e.var("items",u)})};function J1(e,u){if(u===!0)return e.var("props",!0);let t=e.var("props",(0,Ie._)`{}`);return u!==void 0&&As(e,t,u),t}De.evaluatedPropsToName=J1;function As(e,u,t){Object.keys(t).forEach(i=>e.assign((0,Ie._)`${u}${(0,Ie.getProperty)(i)}`,!0))}De.setEvaluated=As;var U1={};function _b(e,u){return e.scopeValue("func",{ref:u,code:U1[u.code]||(U1[u.code]=new pb._Code(u.code))})}De.useFunc=_b;var Ss=function(e){return e[e.Num=0]="Num",e[e.Str=1]="Str",e}(Ss||(De.Type=Ss={}));function yb(e,u,t){if(e instanceof Ie.Name){let i=u===Ss.Num;return t?i?(0,Ie._)`"[" + ${e} + "]"`:(0,Ie._)`"['" + ${e} + "']"`:i?(0,Ie._)`"/" + ${e}`:(0,Ie._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,Ie.getProperty)(e).toString():"/"+Is(e)}De.getErrorPath=yb;function X1(e,u,t=e.opts.strictSchema){if(t){if(u=`strict mode: ${u}`,t===!0)throw new Error(u);e.self.logger.warn(u)}}De.checkStrictMode=X1});var Ut=F(ks=>{"use strict";Object.defineProperty(ks,"__esModule",{value:!0});var lt=ee(),vb={data:new lt.Name("data"),valCxt:new lt.Name("valCxt"),instancePath:new lt.Name("instancePath"),parentData:new lt.Name("parentData"),parentDataProperty:new lt.Name("parentDataProperty"),rootData:new lt.Name("rootData"),dynamicAnchors:new lt.Name("dynamicAnchors"),vErrors:new lt.Name("vErrors"),errors:new lt.Name("errors"),this:new lt.Name("this"),self:new lt.Name("self"),scope:new lt.Name("scope"),json:new lt.Name("json"),jsonPos:new lt.Name("jsonPos"),jsonLen:new lt.Name("jsonLen"),jsonPart:new lt.Name("jsonPart")};ks.default=vb});var df=F(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.extendErrors=dt.resetErrorsCount=dt.reportExtraError=dt.reportError=dt.keyword$DataError=dt.keywordError=void 0;var ge=ee(),ro=le(),Et=Ut();dt.keywordError={message:({keyword:e})=>(0,ge.str)`must pass "${e}" keyword validation`};dt.keyword$DataError={message:({keyword:e,schemaType:u})=>u?(0,ge.str)`"${e}" keyword must be ${u} ($data)`:(0,ge.str)`"${e}" keyword is invalid ($data)`};function Bb(e,u=dt.keywordError,t,i){let{it:n}=e,{gen:f,compositeRule:r,allErrors:o}=n,a=Q1(e,u,t);i??(r||o)?Y1(f,a):Z1(n,(0,ge._)`[${a}]`)}dt.reportError=Bb;function xb(e,u=dt.keywordError,t){let{it:i}=e,{gen:n,compositeRule:f,allErrors:r}=i,o=Q1(e,u,t);Y1(n,o),f||r||Z1(i,Et.default.vErrors)}dt.reportExtraError=xb;function wb(e,u){e.assign(Et.default.errors,u),e.if((0,ge._)`${Et.default.vErrors} !== null`,()=>e.if(u,()=>e.assign((0,ge._)`${Et.default.vErrors}.length`,u),()=>e.assign(Et.default.vErrors,null)))}dt.resetErrorsCount=wb;function Sb({gen:e,keyword:u,schemaValue:t,data:i,errsCount:n,it:f}){if(n===void 0)throw new Error("ajv implementation error");let r=e.name("err");e.forRange("i",n,Et.default.errors,o=>{e.const(r,(0,ge._)`${Et.default.vErrors}[${o}]`),e.if((0,ge._)`${r}.instancePath === undefined`,()=>e.assign((0,ge._)`${r}.instancePath`,(0,ge.strConcat)(Et.default.instancePath,f.errorPath))),e.assign((0,ge._)`${r}.schemaPath`,(0,ge.str)`${f.errSchemaPath}/${u}`),f.opts.verbose&&(e.assign((0,ge._)`${r}.schema`,t),e.assign((0,ge._)`${r}.data`,i))})}dt.extendErrors=Sb;function Y1(e,u){let t=e.const("err",u);e.if((0,ge._)`${Et.default.vErrors} === null`,()=>e.assign(Et.default.vErrors,(0,ge._)`[${t}]`),(0,ge._)`${Et.default.vErrors}.push(${t})`),e.code((0,ge._)`${Et.default.errors}++`)}function Z1(e,u){let{gen:t,validateName:i,schemaEnv:n}=e;n.$async?t.throw((0,ge._)`new ${e.ValidationError}(${u})`):(t.assign((0,ge._)`${i}.errors`,u),t.return(!1))}var wi={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function Q1(e,u,t){let{createErrors:i}=e.it;return i===!1?(0,ge._)`{}`:Ib(e,u,t)}function Ib(e,u,t={}){let{gen:i,it:n}=e,f=[Ab(n,t),kb(e,t)];return $b(e,u,f),i.object(...f)}function Ab({errorPath:e},{instancePath:u}){let t=u?(0,ge.str)`${e}${(0,ro.getErrorPath)(u,ro.Type.Str)}`:e;return[Et.default.instancePath,(0,ge.strConcat)(Et.default.instancePath,t)]}function kb({keyword:e,it:{errSchemaPath:u}},{schemaPath:t,parentSchema:i}){let n=i?u:(0,ge.str)`${u}/${e}`;return t&&(n=(0,ge.str)`${n}${(0,ro.getErrorPath)(t,ro.Type.Str)}`),[wi.schemaPath,n]}function $b(e,{params:u,message:t},i){let{keyword:n,data:f,schemaValue:r,it:o}=e,{opts:a,propertyName:s,topSchemaRef:D,schemaPath:d}=o;i.push([wi.keyword,n],[wi.params,typeof u=="function"?u(e):u||(0,ge._)`{}`]),a.messages&&i.push([wi.message,typeof t=="function"?t(e):t]),a.verbose&&i.push([wi.schema,r],[wi.parentSchema,(0,ge._)`${D}${d}`],[Et.default.data,f]),s&&i.push([wi.propertyName,s])}});var td=F(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.boolOrEmptySchema=fn.topBoolOrEmptySchema=void 0;var Tb=df(),Pb=ee(),Ob=Ut(),Mb={message:"boolean schema is false"};function jb(e){let{gen:u,schema:t,validateName:i}=e;t===!1?ed(e,!1):typeof t=="object"&&t.$async===!0?u.return(Ob.default.data):(u.assign((0,Pb._)`${i}.errors`,null),u.return(!0))}fn.topBoolOrEmptySchema=jb;function Nb(e,u){let{gen:t,schema:i}=e;i===!1?(t.var(u,!1),ed(e)):t.var(u,!0)}fn.boolOrEmptySchema=Nb;function ed(e,u){let{gen:t,data:i}=e,n={gen:t,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Tb.reportError)(n,Mb,void 0,u)}});var $s=F(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.getRules=rn.isJSONType=void 0;var qb=["string","number","integer","boolean","null","object","array"],Vb=new Set(qb);function Rb(e){return typeof e=="string"&&Vb.has(e)}rn.isJSONType=Rb;function Lb(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:Se(X({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rn.getRules=Lb});var Ts=F(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.shouldUseRule=ei.shouldUseGroup=ei.schemaHasRulesForType=void 0;function zb({schema:e,self:u},t){let i=u.RULES.types[t];return i&&i!==!0&&ud(e,i)}ei.schemaHasRulesForType=zb;function ud(e,u){return u.rules.some(t=>id(e,t))}ei.shouldUseGroup=ud;function id(e,u){var t;return e[u.keyword]!==void 0||((t=u.definition.implements)===null||t===void 0?void 0:t.some(i=>e[i]!==void 0))}ei.shouldUseRule=id});var cf=F(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.reportTypeError=ct.checkDataTypes=ct.checkDataType=ct.coerceAndCheckDataType=ct.getJSONTypes=ct.getSchemaTypes=ct.DataType=void 0;var Hb=$s(),Ub=Ts(),Wb=df(),re=ee(),nd=le(),on=function(e){return e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong",e}(on||(ct.DataType=on={}));function Gb(e){let u=fd(e.type);if(u.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!u.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&u.push("null")}return u}ct.getSchemaTypes=Gb;function fd(e){let u=Array.isArray(e)?e:e?[e]:[];if(u.every(Hb.isJSONType))return u;throw new Error("type must be JSONType or JSONType[]: "+u.join(","))}ct.getJSONTypes=fd;function Kb(e,u){let{gen:t,data:i,opts:n}=e,f=Jb(u,n.coerceTypes),r=u.length>0&&!(f.length===0&&u.length===1&&(0,Ub.schemaHasRulesForType)(e,u[0]));if(r){let o=Os(u,i,n.strictNumbers,on.Wrong);t.if(o,()=>{f.length?Xb(e,u,f):Ms(e)})}return r}ct.coerceAndCheckDataType=Kb;var rd=new Set(["string","number","integer","boolean","null"]);function Jb(e,u){return u?e.filter(t=>rd.has(t)||u==="array"&&t==="array"):[]}function Xb(e,u,t){let{gen:i,data:n,opts:f}=e,r=i.let("dataType",(0,re._)`typeof ${n}`),o=i.let("coerced",(0,re._)`undefined`);f.coerceTypes==="array"&&i.if((0,re._)`${r} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>i.assign(n,(0,re._)`${n}[0]`).assign(r,(0,re._)`typeof ${n}`).if(Os(u,n,f.strictNumbers),()=>i.assign(o,n))),i.if((0,re._)`${o} !== undefined`);for(let s of t)(rd.has(s)||s==="array"&&f.coerceTypes==="array")&&a(s);i.else(),Ms(e),i.endIf(),i.if((0,re._)`${o} !== undefined`,()=>{i.assign(n,o),Yb(e,o)});function a(s){switch(s){case"string":i.elseIf((0,re._)`${r} == "number" || ${r} == "boolean"`).assign(o,(0,re._)`"" + ${n}`).elseIf((0,re._)`${n} === null`).assign(o,(0,re._)`""`);return;case"number":i.elseIf((0,re._)`${r} == "boolean" || ${n} === null
|
|
3
3
|
|| (${r} == "string" && ${n} && ${n} == +${n})`).assign(o,(0,re._)`+${n}`);return;case"integer":i.elseIf((0,re._)`${r} === "boolean" || ${n} === null
|
|
4
4
|
|| (${r} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(o,(0,re._)`+${n}`);return;case"boolean":i.elseIf((0,re._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(o,!1).elseIf((0,re._)`${n} === "true" || ${n} === 1`).assign(o,!0);return;case"null":i.elseIf((0,re._)`${n} === "" || ${n} === 0 || ${n} === false`),i.assign(o,null);return;case"array":i.elseIf((0,re._)`${r} === "string" || ${r} === "number"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-PFECLHTP.js";import"./chunk-CGJH6JTF.js";import"./chunk-Q7VA22QV.js";import"./chunk-JMCN2SQV.js";import"./chunk-YXEV6KOV.js";import"./chunk-RSIXVZQ5.js";import{q as n}from"./chunk-YHABGXDF.js";import"./chunk-JOBKDXBH.js";import"./chunk-U2JRPT6W.js";import{g as i}from"./chunk-QR7L4UUP.js";import"./chunk-4RE7M7JJ.js";import"./chunk-Z7FCAS3S.js";import"./chunk-DOZWR3M6.js";import"./chunk-ASBFWS7L.js";import{c as s}from"./chunk-DJKI5XBW.js";import{ha as t,kd as m,mb as r}from"./chunk-U4V4ICSI.js";var f=[{path:"",loadComponent:()=>import("./chunk-JGXXT6IR.js").then(o=>o.LogsComponent)}],p=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(f),i]})}return o})();var h=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[m,p,n,s.forChild()]})}return o})();export{h as LogsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-RAMVTXDA.js";import"./chunk-DOZWR3M6.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as ShutdownLinuxComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-36QRNMZP.js";import"./chunk-WM3ZC7RY.js";import"./chunk-SALYYWC7.js";import"./chunk-2FGEOEQD.js";import"./chunk-XZR7OZ6I.js";import"./chunk-YHABGXDF.js";import"./chunk-JOBKDXBH.js";import"./chunk-QR7L4UUP.js";import"./chunk-Z7FCAS3S.js";import"./chunk-DOZWR3M6.js";import"./chunk-ASBFWS7L.js";import"./chunk-DJKI5XBW.js";import"./chunk-U4V4ICSI.js";export{a as ConfigEditorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as xi,b as wi}from"./chunk-F2OGU5FW.js";import{a as hi}from"./chunk-4XCUHCZU.js";import{n as vi,v as U}from"./chunk-QELUTKQF.js";import{a as $}from"./chunk-JIG56QTE.js";import{a as bi}from"./chunk-XZR7OZ6I.js";import{a as Ci}from"./chunk-C53ZM5K2.js";import{a as _i}from"./chunk-RSIXVZQ5.js";import{h as ri,i as si,j as di,k as pi,l as ci,m as ui,n as D,o as gi}from"./chunk-YHABGXDF.js";import{c as X,e as Y,f as Z,g as ii,j as ei,m as ni,p as ti,q as oi,y as ai,z as li}from"./chunk-JOBKDXBH.js";import{a as R}from"./chunk-G6GTWDKY.js";import{a as mi,d as fi}from"./chunk-QR7L4UUP.js";import{b as F}from"./chunk-OT3IJBCR.js";import{h as j,k as A}from"./chunk-4WTLH2XC.js";import{a as N,b as E}from"./chunk-DJKI5XBW.js";import{$a as t,Ac as u,Bc as g,Cc as H,Gb as y,Hb as s,Ib as d,Kb as L,Lb as G,Mb as W,Nb as v,Ob as a,Pb as l,Qb as p,Ub as b,Xa as q,Xb as _,Ya as I,Yb as c,bd as V,ed as K,h as S,id as Q,jc as m,kc as P,la as w,lb as T,lc as x,ra as C,sa as h,w as k,wc as M,xc as B,yc as J}from"./chunk-U4V4ICSI.js";var Ii=(n,r)=>({"orange-text":n,"grey-text":r}),z=n=>({opacity:n}),Ti=(n,r)=>({"green-text":n,"grey-text":r}),Vi=(n,r)=>({"purple-text":n,"grey-text":r}),Ei=(n,r)=>({scopedLink:n,verifiedLink:r});function $i(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l(),a(6,"p",19),m(7),u(8,"translate"),l()),n&2&&(t(),P(g(2,3,"plugins.manage.scoped_subtitle")),t(3),P(g(5,5,"plugins.manage.scoped_message")),t(3),P(g(8,7,"plugins.manage.verified_message")))}function Mi(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l()),n&2&&(t(),P(g(2,2,"plugins.manage.verified_subtitle")),t(3),P(g(5,4,"plugins.manage.verified_message")))}function Hi(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l()),n&2&&(t(),P(g(2,2,"plugins.manage.unverified_subtitle")),t(3),P(g(5,4,"plugins.manage.unverified_message")))}function Di(n,r){if(n&1){let e=b();a(0,"button",20),_("click",function(){C(e);let i=c();return h(i.$activeModal.dismiss("Dismiss"))}),m(1),u(2,"translate"),l()}n&2&&(t(),x(" ",g(2,1,"form.button_close")," "))}function Ni(n,r){if(n&1){let e=b();a(0,"button",20),_("click",function(){C(e);let i=c();return h(i.$activeModal.dismiss("Dismiss"))}),m(1),u(2,"translate"),l()}n&2&&(t(),x(" ",g(2,1,"form.button_close")," "))}function ji(n,r){if(n&1&&(a(0,"a",17),m(1),u(2,"translate"),p(3,"i",21),l()),n&2){let e=c();v("href",e.plugin.links.homepage||e.plugin.links.npm,I),t(),x(" ",g(2,2,"plugins.button_homepage")," ")}}var Si=(()=>{class n{$activeModal=w(ui);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),m(3),u(4,"translate"),l(),a(5,"button",3),u(6,"translate"),_("click",function(){return i.$activeModal.dismiss("Dismiss")}),l()(),a(7,"div",4)(8,"img",5),_("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),m(10),l(),a(11,"p",7),m(12),l(),a(13,"p",8),m(14),l(),a(15,"p",9),m(16),l(),p(17,"i",10)(18,"i",10)(19,"i",10),s(20,$i,9,9),s(21,Mi,6,6),s(22,Hi,6,6),p(23,"p",11),u(24,"translate"),l(),a(25,"div",12)(26,"div",13),s(27,Di,3,3,"button",14),l(),a(28,"div",15),s(29,Ni,3,3,"button",14),l(),a(30,"div",16),s(31,ji,4,4,"a",17),l()()()),o&2&&(t(3),P(g(4,20,"plugins.manage.information")),t(2),y("aria-label",g(6,22,"form.button_close")),t(3),v("src",i.plugin.icon,I),t(2),P(i.plugin.displayName),t(2),P(i.plugin.name),t(2),x("@",i.plugin.author),t(2),P(i.plugin.description),t(),v("ngClass",B(27,Ii,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",M(30,z,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),t(),v("ngClass",B(32,Ti,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",M(35,z,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),t(),v("ngClass",B(37,Vi,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",M(40,z,i.plugin.isHbScoped?1:.25)),t(),d(i.plugin.isHbScoped?20:-1),t(),d(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),t(),d(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),t(),v("innerHTML",H(24,24,"plugins.manage.more_info",B(42,Ei,i.linkScoped,i.linkVerified)),q),t(4),d(i.plugin.links.homepage||i.plugin.links.npm?27:-1),t(2),d(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),t(2),d(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[E,V,K],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return n})();var Ai=(n,r,e)=>({"purple-text":n,"green-text":r,"orange-text":e}),Fi=(n,r)=>({"fa-bridge-circle-exclamation orange-text":n,"fa-bridge-circle-xmark red-text":r});function Ri(n,r){n&1&&p(0,"i",25)}function Ui(n,r){n&1&&p(0,"i",26)}function zi(n,r){if(n&1){let e=b();a(0,"a",24),_("click",function(){C(e);let i=c();return h(i.openHb2InfoModal())}),s(1,Ri,1,0,"i",25),s(2,Ui,1,0,"i",26),l()}if(n&2){let e=c();v("ngbTooltip","Homebridge v2 Readiness")("placement","right"),t(),d(e.hb2Status==="supported"?1:-1),t(),d(e.hb2Status==="unknown"?2:-1)}}function Oi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.checkAndUpdatePlugin(i.plugin,i.plugin.updateTag||"latest"))}),p(3,"i",28),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.button_update")),y("aria-label",g(2,4,"plugins.button_update")))}function qi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.switchToScoped(i.plugin))}),p(3,"i",29),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.manage.scoped.switch")),y("aria-label",g(2,4,"plugins.manage.scoped.switch")))}function Li(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.settings(i.plugin))}),p(3,"i",30),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.button_set_up")),y("aria-label",g(2,4,"plugins.button_set_up")))}function Gi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.bridgeSettings(i.plugin))}),p(3,"i",31),l()}n&2&&(v("ngbTooltip",g(1,2,"child_bridge.setup")),y("aria-label",g(2,4,"child_bridge.setup")))}function Wi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.bridgeSettings(i.plugin))}),p(3,"i",32),l()}n&2&&(v("ngbTooltip",g(1,2,"child_bridge.bridge_connect")),y("aria-label",g(2,4,"child_bridge.bridge_connect")))}function Ji(n,r){if(n&1&&p(0,"i",13),n&2){let e=c();v("ngClass",B(1,Fi,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function Ki(n,r){if(n&1){let e=b();a(0,"a",15),_("click",function(){C(e);let i=c();return h(i.openFundingModal(i.plugin))}),p(1,"i",33),a(2,"span",17),m(3),l()()}if(n&2){let e=c();t(3),x("@",e.plugin.author)}}function Qi(n,r){if(n&1&&(a(0,"span",17),p(1,"i",34),m(2),l()),n&2){let e=c();t(2),x("@",e.plugin.author," ")}}function Xi(n,r){if(n&1&&(a(0,"span"),m(1),u(2,"date"),l()),n&2){let e=c(2);t(),x("(",H(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function Yi(n,r){if(n&1&&(a(0,"span"),p(1,"i",35),a(2,"span",17),m(3),s(4,Xi,3,4,"span"),l()()),n&2){let e=c();t(3),x("v",e.plugin.latestVersion," "),t(),d(e.plugin.lastUpdated?4:-1)}}function Zi(n,r){if(n&1&&(p(0,"i",36),m(1)),n&2){let e=c();t(),x("v",e.plugin.installedVersion," ")}}function ie(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),_("click",function(){C(e);let i=c();return h(i.doChildBridgeAction("restart"))}),p(2,"i",37),l()}if(n&2){let e=c();v("ngbTooltip",g(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function ee(n,r){if(n&1){let e=b();a(0,"a",38),_("click",function(){C(e);let i=c();return h(i.enablePlugin(i.plugin))}),p(1,"i",39),u(2,"translate"),l()}n&2&&(t(),v("ngbTooltip",g(2,1,"plugins.status_disabled")))}function ne(n,r){if(n&1){let e=b();a(0,"a",40),_("click",function(){C(e);let i=c();return h(i.$plugin.installAlternateVersion(i.plugin))}),p(1,"i",41),l()}}function te(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.viewPluginLog(i.plugin))}),p(1,"i",50),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.plugin_logs")," "))}function oe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.installAlternateVersion(i.plugin))}),p(1,"i",51),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.manage_version")," "))}function ae(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.jsonEditor(i.plugin))}),p(1,"i",52),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.json_config")," "))}function le(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.disablePlugin(i.plugin))}),p(1,"i",53),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.disable")," "))}function re(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.enablePlugin(i.plugin))}),p(1,"i",54),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.enable")," "))}function se(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.uninstallPlugin(i.plugin,i.setChildBridges))}),p(1,"i",55),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.button_uninstall")," "))}function de(n,r){n&1&&p(0,"div",48)}function pe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("restart"))}),p(1,"i",58),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function ce(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("stop"))}),p(1,"i",59),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function ue(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("start"))}),p(1,"i",60),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function ge(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",56),m(2),u(3,"translate"),l(),s(4,pe,4,3,"button",47),s(5,ce,4,3,"button",47),s(6,ue,4,3,"button",47),a(7,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.resetChildBridges(i.setChildBridges))}),p(8,"i",57),m(9),u(10,"translate"),l()}if(n&2){let e=c(2);t(2),x(" ",g(3,5,"child_bridge.bridge_settings")," "),t(2),d(e.childBridgeRestartInProgress?-1:4),t(),d(e.allChildBridgesStopped?-1:5),t(),d(e.allChildBridgesStopped?6:-1),t(3),x(" ",g(10,7,"child_bridge.reset_accessories")," ")}}function me(n,r){n&1&&p(0,"div",48)}function fe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",61),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"child_bridge.setup")," "))}function _e(n,r){n&1&&p(0,"div",48)}function Ce(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",61),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"child_bridge.setup")," "))}function he(n,r){n&1&&p(0,"div",48)}function be(n,r){if(n&1&&(a(0,"a",49),p(1,"i",62),m(2),u(3,"translate"),l()),n&2){let e=c(2);v("href",e.plugin.links.bugs,I),t(2),x(" ",g(3,2,"support.links.issue")," ")}}function ve(n,r){if(n&1){let e=b();a(0,"span",23)(1,"a",42),p(2,"i",43),l(),a(3,"div",44)(4,"button",45),_("click",function(){C(e);let i=c();return h(i.$plugin.settings(i.plugin))}),p(5,"i",46),m(6),u(7,"translate"),l(),s(8,te,4,3,"button",47),s(9,oe,4,3,"button",47),s(10,ae,4,3,"button",47),s(11,le,4,3,"button",47),s(12,re,4,3,"button",47),s(13,se,4,3,"button",47),s(14,de,1,0,"div",48),s(15,ge,11,9),s(16,me,1,0,"div",48),s(17,fe,4,3,"button",47),s(18,_e,1,0,"div",48),s(19,Ce,4,3,"button",47),s(20,he,1,0,"div",48),s(21,be,4,4,"a",49),l()()}if(n&2){let e=c();t(),y("aria-label","Plugin Actions Dropdown"),t(5),x(" ",g(7,16,"plugins.button_settings")," "),t(2),d(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),t(),d(e.plugin.publicPackage?9:-1),t(),d(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"?13:-1),t(),d(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),t(),d(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),t(),d(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),t(),d(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var yi=(()=>{class n{$api=w(A);$md=w(bi);$modal=w(D);$plugin=w(U);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";io;constructor(){}set childBridges(e){this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(f=>f.paired===!1).length>0,this.allChildBridgesStopped=e.filter(f=>f.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(f=>f.status==="down")?this.childBridgeStatus="down":e.some(f=>f.status==="pending")?this.childBridgeStatus="pending":e.some(f=>f.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=this.plugin.engines?.homebridge?.split("||").map(f=>f.trim())||[];this.hb2Status=o==="2"?"hide":i.some(f=>f.startsWith("^2")||f.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(wi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(Si,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(xi,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>S(this,null,function*(){try{yield k(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open($,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(_i,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>S(this,null,function*(){try{yield k(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open($,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(e){let o=this.$modal.open(vi,{size:"xl",backdrop:"static"});o.componentInstance.plugin=e}doChildBridgeAction(e){return S(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield k(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}openHb2InfoModal(){let e=this.$modal.open(Ci,{size:"lg",backdrop:"static"});e.componentInstance.title="Plugin Readiness",this.hb2Status==="supported"?(e.componentInstance.subtitle=`${this.plugin.displayName} is ready for Homebridge v2`,e.componentInstance.message="The developer has specifically marked your installed version of the plugin as compatible with Homebridge v2.",e.componentInstance.faIconClass="fa-check-circle green-text"):(e.componentInstance.subtitle=`${this.plugin.displayName} might not be ready for Homebridge v2`,e.componentInstance.message="The developer has not specifically marked your installed version of the plugin as compatible with Homebridge v2, but it may still work.",e.componentInstance.faIconClass="fa-question-circle orange-text"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.ctaButtonLink="https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0"}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:36,vars:24,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2 Readiness",3,"ngbTooltip","placement"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2 Readiness",3,"click","ngbTooltip","placement"],["aria-label","The developer has specifically marked this plugin as compatible with Homebridge v2.",1,"fas","fa-check-circle","green-text","fa-xl"],["aria-label","The developer has not specifically marked this plugin as compatible with Homebridge v2, but it may still work.",1,"fas","fa-question-circle","orange-text","fa-xl"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fas","fa-fw","fa-broom"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),_("error",function(){return i.handleIconError()}),l(),s(4,zi,3,4,"a",4),l(),a(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"h5",9),m(10),l(),a(11,"div",10),s(12,Oi,4,6,"a",11),s(13,qi,4,6,"a",11),s(14,Li,4,6,"a",11),s(15,Gi,4,6,"a",11),s(16,Wi,4,6,"a",11),p(17,"i",12),s(18,Ji,1,4,"i",13),l()(),a(19,"p",14)(20,"a",15),_("click",function(){return i.pluginInfoModal(i.plugin)}),p(21,"i",16),a(22,"span",17),m(23),l()()(),a(24,"p",18),s(25,Ki,4,1,"a",19),s(26,Qi,3,1,"span",17),l(),a(27,"div",8)(28,"p",20),s(29,Yi,5,2,"span"),s(30,Zi,2,1),l(),a(31,"div",10),s(32,ie,3,3,"a",11),s(33,ee,3,3,"a",21),s(34,ne,2,0,"a",22),s(35,ve,22,18,"span",23),l()()()()()()()),o&2&&(t(3),v("src",i.plugin.icon,I),t(),d(i.plugin.installedVersion&&i.hb2Status!=="hide"?4:-1),t(6),P(i.plugin.displayName),t(2),d(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?12:-1),t(),d(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?13:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?14:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?15:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?16:-1),t(),v("hidden",!i.childBridgeRestartInProgress),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?18:-1),t(3),v("ngClass",J(20,Ai,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),t(2),P(i.plugin.name),t(2),d((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?25:-1),t(),d((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:26),t(3),d(i.plugin.publicPackage&&!i.plugin.installedVersion?29:-1),t(),d(i.plugin.installedVersion?30:-1),t(2),d(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?32:-1),t(),d(i.plugin.installedVersion&&i.plugin.disabled?33:-1),t(),d(i.plugin.publicPackage&&!i.plugin.installedVersion?34:-1),t(),d(i.plugin.installedVersion?35:-1))},dependencies:[gi,V,ci,pi,di,si,ri,Q,E],encapsulation:2})}return n})();var xe=(n,r)=>({"fa-magnifying-glass":n,"fa-exclamation-circle":r});function we(n,r){n&1&&p(0,"app-spinner")}function Pe(n,r){if(n&1){let e=b();a(0,"a",9),_("click",function(){C(e);let i=c();return h(i.onClearSearch())}),p(1,"i",10),l()}}function Se(n,r){if(n&1&&(a(0,"div",11),p(1,"app-plugin-card",13),l()),n&2){let e=r.$implicit,o=c(2);t(),v("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function ye(n,r){if(n&1&&(a(0,"div",12),p(1,"i",14),a(2,"p"),m(3),u(4,"translate"),l()()),n&2){let e=c(2);t(),v("ngClass",B(4,xe,!e.showExitButton,e.showExitButton)),t(2),P(g(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function Be(n,r){if(n&1&&(a(0,"div",8),G(1,Se,2,2,"div",11,L),s(3,ye,5,7,"div",12),l()),n&2){let e=c();t(),W(e.installedPlugins),t(2),d(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}var vn=(()=>{class n{$api=w(A);$modal=w(D);$plugin=w(U);$router=w(fi);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);isSearchMode=!1;mainError=!1;loading=!0;installedPlugins=[];childBridges=[];showExitButton=!1;form=new ii({query:new ei("")});io;navigationSubscription;constructor(){}ngOnInit(){return S(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>S(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),this.loadInstalledPlugins().then(()=>{let e=this.$router.parseUrl(this.$router.url).queryParams.installed;if(e){let o=this.installedPlugins.find(i=>i.name===e);o&&(o.isConfigured?this.$modal.open($,{size:"lg",backdrop:"static"}):this.$plugin.settings(o)),this.$router.navigate(["/plugins"])}})})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof mi&&this.loadInstalledPlugins()})})}loadInstalledPlugins(){return S(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield k(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,f)=>i.updateAvailable!==f.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!f.newHbScope?-1:i.disabled!==f.disabled?i.disabled?1:-1:i.isConfigured!==f.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==f.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==f.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(f.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return S(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>S(this,null,function*(){try{let o=yield k(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(f=>f._bridge&&f._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(f=>!f.paired)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,f)=>{if(f.name==="homebridge-config-ui-x"||o.has(f.name))return i;if(f.newHbScope){let O=f.newHbScope.to,Bi=e.some(ki=>ki.name===O);(f.installedVersion||!Bi)&&(o.add(O),i.push(f))}else i.push(f);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}ngOnDestroy(){this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],decls:13,vars:10,consts:[[1,"row","mb-3"],[1,"col-12"],[1,"primary-text","m-0"],[1,"row"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],[1,"d-flex","flex-wrap","justify-content-between"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"]],template:function(o,i){o&1&&(s(0,we,1,0,"app-spinner"),a(1,"div",0)(2,"div",1)(3,"h3",2),m(4),u(5,"translate"),l()()(),a(6,"div",3)(7,"div",4)(8,"form",5),_("ngSubmit",function(){return i.onSubmit(i.form)}),p(9,"input",6),u(10,"translate"),s(11,Pe,2,0,"a",7),l()()(),s(12,Be,4,1,"div",8)),o&2&&(d(i.loading?0:-1),t(4),P(g(5,6,"menu.label_plugins")),t(4),v("formGroup",i.form),t(),v("placeholder",g(10,8,"plugins.placeholder_search_plugin")),t(2),d(i.showExitButton?11:-1),t(),d(i.loading?-1:12))},dependencies:[hi,ai,ni,X,Y,Z,li,ti,oi,yi,E,V],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}"]})}return n})();export{vn as a};
|
|
1
|
+
import{a as xi,b as wi}from"./chunk-F2OGU5FW.js";import{a as hi}from"./chunk-4XCUHCZU.js";import{n as vi,v as U}from"./chunk-UEWO3CCO.js";import{a as $}from"./chunk-SALYYWC7.js";import{a as bi}from"./chunk-XZR7OZ6I.js";import{a as Ci}from"./chunk-C53ZM5K2.js";import{a as _i}from"./chunk-RSIXVZQ5.js";import{h as ri,i as si,j as di,k as pi,l as ci,m as ui,n as D,o as gi}from"./chunk-YHABGXDF.js";import{c as X,e as Y,f as Z,g as ii,j as ei,m as ni,p as ti,q as oi,y as ai,z as li}from"./chunk-JOBKDXBH.js";import{a as R}from"./chunk-U2JRPT6W.js";import{a as mi,d as fi}from"./chunk-QR7L4UUP.js";import{b as F}from"./chunk-Z7FCAS3S.js";import{h as j,k as A}from"./chunk-DOZWR3M6.js";import{a as N,b as E}from"./chunk-DJKI5XBW.js";import{$a as t,Ac as u,Bc as g,Cc as H,Gb as y,Hb as s,Ib as d,Kb as L,Lb as G,Mb as W,Nb as v,Ob as a,Pb as l,Qb as p,Ub as b,Xa as q,Xb as _,Ya as I,Yb as c,bd as V,ed as K,h as S,id as Q,jc as m,kc as P,la as w,lb as T,lc as x,ra as C,sa as h,w as k,wc as M,xc as B,yc as J}from"./chunk-U4V4ICSI.js";var Ii=(n,r)=>({"orange-text":n,"grey-text":r}),z=n=>({opacity:n}),Ti=(n,r)=>({"green-text":n,"grey-text":r}),Vi=(n,r)=>({"purple-text":n,"grey-text":r}),Ei=(n,r)=>({scopedLink:n,verifiedLink:r});function $i(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l(),a(6,"p",19),m(7),u(8,"translate"),l()),n&2&&(t(),P(g(2,3,"plugins.manage.scoped_subtitle")),t(3),P(g(5,5,"plugins.manage.scoped_message")),t(3),P(g(8,7,"plugins.manage.verified_message")))}function Mi(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l()),n&2&&(t(),P(g(2,2,"plugins.manage.verified_subtitle")),t(3),P(g(5,4,"plugins.manage.verified_message")))}function Hi(n,r){n&1&&(a(0,"h6",18),m(1),u(2,"translate"),l(),a(3,"p",19),m(4),u(5,"translate"),l()),n&2&&(t(),P(g(2,2,"plugins.manage.unverified_subtitle")),t(3),P(g(5,4,"plugins.manage.unverified_message")))}function Di(n,r){if(n&1){let e=b();a(0,"button",20),_("click",function(){C(e);let i=c();return h(i.$activeModal.dismiss("Dismiss"))}),m(1),u(2,"translate"),l()}n&2&&(t(),x(" ",g(2,1,"form.button_close")," "))}function Ni(n,r){if(n&1){let e=b();a(0,"button",20),_("click",function(){C(e);let i=c();return h(i.$activeModal.dismiss("Dismiss"))}),m(1),u(2,"translate"),l()}n&2&&(t(),x(" ",g(2,1,"form.button_close")," "))}function ji(n,r){if(n&1&&(a(0,"a",17),m(1),u(2,"translate"),p(3,"i",21),l()),n&2){let e=c();v("href",e.plugin.links.homepage||e.plugin.links.npm,I),t(),x(" ",g(2,2,"plugins.button_homepage")," ")}}var Si=(()=>{class n{$activeModal=w(ui);plugin;defaultIcon="assets/hb-icon.png";linkScoped='<a href="https://github.com/homebridge/plugins/wiki/Scoped-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';linkVerified='<a href="https://github.com/homebridge/plugins/wiki/Verified-Plugins" target="_blank"><i class="fas fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.plugin.icon||(this.plugin.icon=this.defaultIcon)}handleIconError(){this.plugin.icon=this.defaultIcon}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],inputs:{plugin:"plugin"},decls:32,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],["alt","Plugin Icon",1,"mb-3","plugin-icon-card",3,"error","src"],[1,"mb-1"],[1,"grey-text","mb-0","font-monospace"],[1,"grey-text","mb-1","font-monospace"],[1,"mb-3"],[1,"fas","fa-fw","fa-shield-alt","mb-3",2,"font-size","48px",3,"ngClass","ngStyle"],[1,"mb-0","grey-text",3,"innerHTML"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[1,"mb-2"],[1,"mb-1","grey-text"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),m(3),u(4,"translate"),l(),a(5,"button",3),u(6,"translate"),_("click",function(){return i.$activeModal.dismiss("Dismiss")}),l()(),a(7,"div",4)(8,"img",5),_("error",function(){return i.handleIconError()}),l(),a(9,"h4",6),m(10),l(),a(11,"p",7),m(12),l(),a(13,"p",8),m(14),l(),a(15,"p",9),m(16),l(),p(17,"i",10)(18,"i",10)(19,"i",10),s(20,$i,9,9),s(21,Mi,6,6),s(22,Hi,6,6),p(23,"p",11),u(24,"translate"),l(),a(25,"div",12)(26,"div",13),s(27,Di,3,3,"button",14),l(),a(28,"div",15),s(29,Ni,3,3,"button",14),l(),a(30,"div",16),s(31,ji,4,4,"a",17),l()()()),o&2&&(t(3),P(g(4,20,"plugins.manage.information")),t(2),y("aria-label",g(6,22,"form.button_close")),t(3),v("src",i.plugin.icon,I),t(2),P(i.plugin.displayName),t(2),P(i.plugin.name),t(2),x("@",i.plugin.author),t(2),P(i.plugin.description),t(),v("ngClass",B(27,Ii,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin,i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin))("ngStyle",M(30,z,!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?1:.25)),t(),v("ngClass",B(32,Ti,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),i.plugin.isHbScoped||!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin))("ngStyle",M(35,z,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?1:.25)),t(),v("ngClass",B(37,Vi,i.plugin.isHbScoped,!i.plugin.isHbScoped))("ngStyle",M(40,z,i.plugin.isHbScoped?1:.25)),t(),d(i.plugin.isHbScoped?20:-1),t(),d(!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)?21:-1),t(),d(!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin?22:-1),t(),v("innerHTML",H(24,24,"plugins.manage.more_info",B(42,Ei,i.linkScoped,i.linkVerified)),q),t(4),d(i.plugin.links.homepage||i.plugin.links.npm?27:-1),t(2),d(!i.plugin.links.homepage&&!i.plugin.links.npm?29:-1),t(2),d(i.plugin.links.homepage||i.plugin.links.npm?31:-1))},dependencies:[E,V,K],styles:[".plugin-icon[_ngcontent-%COMP%]{height:75px;width:75px;border-radius:15px;border:1px solid #222222}"]})}return n})();var Ai=(n,r,e)=>({"purple-text":n,"green-text":r,"orange-text":e}),Fi=(n,r)=>({"fa-bridge-circle-exclamation orange-text":n,"fa-bridge-circle-xmark red-text":r});function Ri(n,r){n&1&&p(0,"i",25)}function Ui(n,r){n&1&&p(0,"i",26)}function zi(n,r){if(n&1){let e=b();a(0,"a",24),_("click",function(){C(e);let i=c();return h(i.openHb2InfoModal())}),s(1,Ri,1,0,"i",25),s(2,Ui,1,0,"i",26),l()}if(n&2){let e=c();v("ngbTooltip","Homebridge v2 Readiness")("placement","right"),t(),d(e.hb2Status==="supported"?1:-1),t(),d(e.hb2Status==="unknown"?2:-1)}}function Oi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.checkAndUpdatePlugin(i.plugin,i.plugin.updateTag||"latest"))}),p(3,"i",28),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.button_update")),y("aria-label",g(2,4,"plugins.button_update")))}function qi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.switchToScoped(i.plugin))}),p(3,"i",29),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.manage.scoped.switch")),y("aria-label",g(2,4,"plugins.manage.scoped.switch")))}function Li(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.settings(i.plugin))}),p(3,"i",30),l()}n&2&&(v("ngbTooltip",g(1,2,"plugins.button_set_up")),y("aria-label",g(2,4,"plugins.button_set_up")))}function Gi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.bridgeSettings(i.plugin))}),p(3,"i",31),l()}n&2&&(v("ngbTooltip",g(1,2,"child_bridge.setup")),y("aria-label",g(2,4,"child_bridge.setup")))}function Wi(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),u(2,"translate"),_("click",function(){C(e);let i=c();return h(i.$plugin.bridgeSettings(i.plugin))}),p(3,"i",32),l()}n&2&&(v("ngbTooltip",g(1,2,"child_bridge.bridge_connect")),y("aria-label",g(2,4,"child_bridge.bridge_connect")))}function Ji(n,r){if(n&1&&p(0,"i",13),n&2){let e=c();v("ngClass",B(1,Fi,e.childBridgeStatus==="pending",e.childBridgeStatus==="down"))}}function Ki(n,r){if(n&1){let e=b();a(0,"a",15),_("click",function(){C(e);let i=c();return h(i.openFundingModal(i.plugin))}),p(1,"i",33),a(2,"span",17),m(3),l()()}if(n&2){let e=c();t(3),x("@",e.plugin.author)}}function Qi(n,r){if(n&1&&(a(0,"span",17),p(1,"i",34),m(2),l()),n&2){let e=c();t(2),x("@",e.plugin.author," ")}}function Xi(n,r){if(n&1&&(a(0,"span"),m(1),u(2,"date"),l()),n&2){let e=c(2);t(),x("(",H(2,1,e.plugin.lastUpdated,"yyyy-MM-dd"),")")}}function Yi(n,r){if(n&1&&(a(0,"span"),p(1,"i",35),a(2,"span",17),m(3),s(4,Xi,3,4,"span"),l()()),n&2){let e=c();t(3),x("v",e.plugin.latestVersion," "),t(),d(e.plugin.lastUpdated?4:-1)}}function Zi(n,r){if(n&1&&(p(0,"i",36),m(1)),n&2){let e=c();t(),x("v",e.plugin.installedVersion," ")}}function ie(n,r){if(n&1){let e=b();a(0,"a",27),u(1,"translate"),_("click",function(){C(e);let i=c();return h(i.doChildBridgeAction("restart"))}),p(2,"i",37),l()}if(n&2){let e=c();v("ngbTooltip",g(1,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart"))}}function ee(n,r){if(n&1){let e=b();a(0,"a",38),_("click",function(){C(e);let i=c();return h(i.enablePlugin(i.plugin))}),p(1,"i",39),u(2,"translate"),l()}n&2&&(t(),v("ngbTooltip",g(2,1,"plugins.status_disabled")))}function ne(n,r){if(n&1){let e=b();a(0,"a",40),_("click",function(){C(e);let i=c();return h(i.$plugin.installAlternateVersion(i.plugin))}),p(1,"i",41),l()}}function te(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.viewPluginLog(i.plugin))}),p(1,"i",50),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.plugin_logs")," "))}function oe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.installAlternateVersion(i.plugin))}),p(1,"i",51),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.manage_version")," "))}function ae(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.jsonEditor(i.plugin))}),p(1,"i",52),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.json_config")," "))}function le(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.disablePlugin(i.plugin))}),p(1,"i",53),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.disable")," "))}function re(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.enablePlugin(i.plugin))}),p(1,"i",54),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.manage.enable")," "))}function se(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.uninstallPlugin(i.plugin,i.setChildBridges))}),p(1,"i",55),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"plugins.button_uninstall")," "))}function de(n,r){n&1&&p(0,"div",48)}function pe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("restart"))}),p(1,"i",58),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.restart_plural":"child_bridge.restart")," ")}}function ce(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("stop"))}),p(1,"i",59),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.stop_plural":"child_bridge.stop")," ")}}function ue(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(3);return h(i.doChildBridgeAction("start"))}),p(1,"i",60),m(2),u(3,"translate"),l()}if(n&2){let e=c(3);t(2),x(" ",g(3,1,e.setChildBridges.length>1?"child_bridge.start_plural":"child_bridge.start")," ")}}function ge(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",56),m(2),u(3,"translate"),l(),s(4,pe,4,3,"button",47),s(5,ce,4,3,"button",47),s(6,ue,4,3,"button",47),a(7,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.resetChildBridges(i.setChildBridges))}),p(8,"i",57),m(9),u(10,"translate"),l()}if(n&2){let e=c(2);t(2),x(" ",g(3,5,"child_bridge.bridge_settings")," "),t(2),d(e.childBridgeRestartInProgress?-1:4),t(),d(e.allChildBridgesStopped?-1:5),t(),d(e.allChildBridgesStopped?6:-1),t(3),x(" ",g(10,7,"child_bridge.reset_accessories")," ")}}function me(n,r){n&1&&p(0,"div",48)}function fe(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",61),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"child_bridge.setup")," "))}function _e(n,r){n&1&&p(0,"div",48)}function Ce(n,r){if(n&1){let e=b();a(0,"button",45),_("click",function(){C(e);let i=c(2);return h(i.$plugin.bridgeSettings(i.plugin))}),p(1,"i",61),m(2),u(3,"translate"),l()}n&2&&(t(2),x(" ",g(3,1,"child_bridge.setup")," "))}function he(n,r){n&1&&p(0,"div",48)}function be(n,r){if(n&1&&(a(0,"a",49),p(1,"i",62),m(2),u(3,"translate"),l()),n&2){let e=c(2);v("href",e.plugin.links.bugs,I),t(2),x(" ",g(3,2,"support.links.issue")," ")}}function ve(n,r){if(n&1){let e=b();a(0,"span",23)(1,"a",42),p(2,"i",43),l(),a(3,"div",44)(4,"button",45),_("click",function(){C(e);let i=c();return h(i.$plugin.settings(i.plugin))}),p(5,"i",46),m(6),u(7,"translate"),l(),s(8,te,4,3,"button",47),s(9,oe,4,3,"button",47),s(10,ae,4,3,"button",47),s(11,le,4,3,"button",47),s(12,re,4,3,"button",47),s(13,se,4,3,"button",47),s(14,de,1,0,"div",48),s(15,ge,11,9),s(16,me,1,0,"div",48),s(17,fe,4,3,"button",47),s(18,_e,1,0,"div",48),s(19,Ce,4,3,"button",47),s(20,he,1,0,"div",48),s(21,be,4,4,"a",49),l()()}if(n&2){let e=c();t(),y("aria-label","Plugin Actions Dropdown"),t(5),x(" ",g(7,16,"plugins.button_settings")," "),t(2),d(e.plugin.isConfigured&&!e.plugin.disabled?8:-1),t(),d(e.plugin.publicPackage?9:-1),t(),d(!e.isMobile&&e.plugin.name!=="homebridge-config-ui-x"?10:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"&&!e.plugin.disabled?11:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"&&e.plugin.disabled?12:-1),t(),d(e.plugin.name!=="homebridge-config-ui-x"?13:-1),t(),d(!e.plugin.disabled&&e.plugin.isConfigured&&e.plugin.hasChildBridges&&e.plugin.installedVersion&&e.plugin.name!=="homebridge-config-ui-x"?14:-1),t(),d(e.plugin.hasChildBridges&&!e.plugin.disabled?15:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?16:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&!e.plugin.recommendChildBridge?17:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?18:-1),t(),d(e.plugin.isConfigured&&!e.plugin.hasChildBridges&&!e.plugin.disabled&&e.plugin.recommendChildBridge&&e.plugin.updateAvailable?19:-1),t(),d(e.plugin.links!=null&&e.plugin.links.bugs?20:-1),t(),d(e.plugin.links!=null&&e.plugin.links.bugs?21:-1)}}var yi=(()=>{class n{$api=w(A);$md=w(bi);$modal=w(D);$plugin=w(U);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);plugin;hasChildBridges=!1;hasUnpairedChildBridges=!1;allChildBridgesStopped=!1;childBridgeStatus="pending";childBridgeRestartInProgress=!1;defaultIcon="assets/hb-icon.png";isMobile;setChildBridges=[];hb2Status="unknown";io;constructor(){}set childBridges(e){this.hasChildBridges=e.length>0,this.hasUnpairedChildBridges=e.filter(f=>f.paired===!1).length>0,this.allChildBridgesStopped=e.filter(f=>f.manuallyStopped===!0).length===e.length,this.hasChildBridges&&(e.some(f=>f.status==="down")?this.childBridgeStatus="down":e.some(f=>f.status==="pending")?this.childBridgeStatus="pending":e.some(f=>f.status==="ok")&&(this.childBridgeStatus="ok")),this.setChildBridges=e;let o=this.$settings.env.homebridgeVersion.split(".")[0],i=this.plugin.engines?.homebridge?.split("||").map(f=>f.trim())||[];this.hb2Status=o==="2"?"hide":i.some(f=>f.startsWith("^2")||f.startsWith(">=2"))?"supported":this.hb2Status}ngOnInit(){this.isMobile=this.$md.detect.mobile(),this.io=this.$ws.getExistingNamespace("child-bridges"),this.isMobile&&this.plugin.displayName.toLowerCase().startsWith("homebridge ")&&(this.plugin.displayName=this.plugin.displayName.replace(/^homebridge /i,"")),this.plugin.icon||(this.plugin.icon=this.defaultIcon)}openFundingModal(e){let o=this.$modal.open(wi,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}pluginInfoModal(e){let o=this.$modal.open(Si,{size:"lg",backdrop:"static"});o.componentInstance.plugin=e}disablePlugin(e){let o=this.$modal.open(xi,{size:"lg",backdrop:"static"});o.componentInstance.pluginName=e.displayName,o.componentInstance.isConfigured=e.isConfigured,o.componentInstance.isConfiguredDynamicPlatform=e.isConfiguredDynamicPlatform,o.result.then(()=>S(this,null,function*(){try{yield k(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/disable`,{})),e.disabled=!0,this.hasChildBridges&&this.doChildBridgeAction("stop"),this.$modal.open($,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.disable.error"),this.$translate.instant("toast.title_error"))}}))}enablePlugin(e){let o=this.$modal.open(_i,{size:"lg",backdrop:"static"});o.componentInstance.title=e.name,o.componentInstance.message=this.$translate.instant("plugins.manage.confirm_enable",{pluginName:e.displayName}),o.componentInstance.confirmButtonLabel=this.$translate.instant("plugins.manage.enable"),o.componentInstance.faIconClass="fa-circle-play primary-text",o.result.then(()=>S(this,null,function*(){try{yield k(this.$api.put(`/config-editor/plugin/${encodeURIComponent(e.name)}/enable`,{})),e.disabled=!1,this.hasChildBridges&&(yield this.doChildBridgeAction("start")),this.$modal.open($,{size:"lg",backdrop:"static"})}catch(i){console.error(i),this.$toastr.error(this.$translate.instant("plugins.enable.error"),this.$translate.instant("toast.title_error"))}}))}viewPluginLog(e){let o=this.$modal.open(vi,{size:"xl",backdrop:"static"});o.componentInstance.plugin=e}doChildBridgeAction(e){return S(this,null,function*(){this.childBridgeRestartInProgress=!0;try{for(let o of this.setChildBridges)yield k(this.io.request(`${e}-child-bridge`,o.username))}catch(o){console.error(o),this.$toastr.error(this.$translate.instant("plugins.bridge.action_error",{action:e}),this.$translate.instant("toast.title_error")),this.childBridgeRestartInProgress=!1}finally{setTimeout(()=>{this.childBridgeRestartInProgress=!1},e==="restart"?12e3:e==="stop"?6e3:1e3)}})}handleIconError(){this.plugin.icon=this.defaultIcon}openHb2InfoModal(){let e=this.$modal.open(Ci,{size:"lg",backdrop:"static"});e.componentInstance.title="Plugin Readiness",this.hb2Status==="supported"?(e.componentInstance.subtitle=`${this.plugin.displayName} is ready for Homebridge v2`,e.componentInstance.message="The developer has specifically marked your installed version of the plugin as compatible with Homebridge v2.",e.componentInstance.faIconClass="fa-check-circle green-text"):(e.componentInstance.subtitle=`${this.plugin.displayName} might not be ready for Homebridge v2`,e.componentInstance.message="The developer has not specifically marked your installed version of the plugin as compatible with Homebridge v2, but it may still work.",e.componentInstance.faIconClass="fa-question-circle orange-text"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.ctaButtonLink="https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0"}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["app-plugin-card"]],inputs:{plugin:"plugin",childBridges:"childBridges"},decls:36,vars:24,consts:[[1,"card","card-body","mb-3"],[1,"d-flex","flex-row","justify-content-between"],[1,"d-flex","flex-column","me-3","align-items-center","justify-content-between"],["alt","Plugin Icon",1,"plugin-icon-card","mb-3",3,"error","src"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2 Readiness",3,"ngbTooltip","placement"],[1,"d-flex","flex-column","justify-content-between",2,"min-width","calc(100% - 80px)"],[1,"d-flex","flex-row","align-items-end"],[1,"d-flex","flex-column","w-100"],[1,"d-flex","flex-row"],[1,"card-title","mb-2","text-truncate"],[1,"ms-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"ngbTooltip"],[1,"fas","fa-fw","fa-spinner","fa-pulse","fa-lg","grey-text","ms-3",3,"hidden"],[1,"fas","fa-fw","fa-lg","ms-3",3,"ngClass"],[1,"card-text","mb-2","text-truncate"],["href","javascript:void(0)",1,"card-link",3,"click"],[1,"fas","fa-fw","fa-shield-alt","fa-lg","me-1",3,"ngClass"],[1,"grey-text"],[1,"card-text","mb-2"],["href","javascript:void(0)",1,"card-link"],[1,"card-text","mb-0","grey-text"],["href","javascript:void(0)",1,"card-link","red-text"],["href","javascript:void(0)"],["ngbDropdown","","placement","left",1,"d-inline-block","ms-3","mt-auto"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover","aria-label","Homebridge v2 Readiness",3,"click","ngbTooltip","placement"],["aria-label","The developer has specifically marked this plugin as compatible with Homebridge v2.",1,"fas","fa-check-circle","green-text","fa-xl"],["aria-label","The developer has not specifically marked this plugin as compatible with Homebridge v2, but it may still work.",1,"fas","fa-question-circle","orange-text","fa-xl"],["href","javascript:void(0)","container","body","openDelay","150","triggers","hover",1,"card-link",3,"click","ngbTooltip"],[1,"far","fa-fw","fa-arrow-alt-circle-up","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-arrow-right-arrow-left","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-sliders","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-bridge","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"icon-button","fas","fa-fw","fa-qrcode","primary-text","fa-lg","fa-fade","ms-3",2,"--fa-animation-duration","2s"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1","pink-text"],[1,"fas","fa-fw","fa-heart","fa-lg","me-1",2,"opacity","0.5"],[1,"far","fa-fw","fa-circle-dot","fa-lg","me-1"],[1,"far","fa-fw","fa-circle-check","fa-lg","me-1"],[1,"fas","fa-fw","fa-lg","fa-power-off","ms-3"],["href","javascript:void(0)",1,"card-link","red-text",3,"click"],["container","body","openDelay","150","triggers","hover",1,"far","fa-fw","fa-pause-circle","fa-lg",3,"ngbTooltip"],["href","javascript:void(0)",3,"click"],[1,"far","fa-fw","fa-arrow-alt-circle-down","fa-lg"],["href","javascript:void(0)","ngbDropdownToggle","",1,"card-link","text-decoration-none","mt-auto",2,"outline","none"],[1,"fa-solid","fa-fw","fa-ellipsis-v","fa-lg"],["ngbDropdownMenu","","aria-labelledby","Plugin Actions Dropdown"],["ngbDropdownItem","",3,"click"],[1,"fas","fa-fw","fa-sliders"],["ngbDropdownItem",""],[1,"dropdown-divider"],["ngbDropdownItem","","rel","noopener noreferrer","target","_blank",3,"href"],[1,"fas","fa-fw","fa-wave-square"],[1,"fas","fa-fw","fa-code-compare"],[1,"fas","fa-fw","fa-code"],[1,"far","fa-fw","fa-circle-pause"],[1,"far","fa-fw","fa-circle-play"],[1,"fas","fa-fw","fa-trash"],[1,"fas","fa-fw","fa-bridge"],[1,"fas","fa-fw","fa-broom"],[1,"fa-fw","icon-button","fas","fa-fw","fa-power-off"],[1,"fas","fa-fw","fa-stop"],[1,"fas","fa-fw","fa-play"],[1,"icon-button","fas","fa-fw","fa-bridge"],[1,"icon-button","fa","fa-fw","fa-question-circle-o"]],template:function(o,i){o&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),_("error",function(){return i.handleIconError()}),l(),s(4,zi,3,4,"a",4),l(),a(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"h5",9),m(10),l(),a(11,"div",10),s(12,Oi,4,6,"a",11),s(13,qi,4,6,"a",11),s(14,Li,4,6,"a",11),s(15,Gi,4,6,"a",11),s(16,Wi,4,6,"a",11),p(17,"i",12),s(18,Ji,1,4,"i",13),l()(),a(19,"p",14)(20,"a",15),_("click",function(){return i.pluginInfoModal(i.plugin)}),p(21,"i",16),a(22,"span",17),m(23),l()()(),a(24,"p",18),s(25,Ki,4,1,"a",19),s(26,Qi,3,1,"span",17),l(),a(27,"div",8)(28,"p",20),s(29,Yi,5,2,"span"),s(30,Zi,2,1),l(),a(31,"div",10),s(32,ie,3,3,"a",11),s(33,ee,3,3,"a",21),s(34,ne,2,0,"a",22),s(35,ve,22,18,"span",23),l()()()()()()()),o&2&&(t(3),v("src",i.plugin.icon,I),t(),d(i.plugin.installedVersion&&i.hb2Status!=="hide"?4:-1),t(6),P(i.plugin.displayName),t(2),d(i.plugin.installedVersion&&i.plugin.updateAvailable&&!i.childBridgeRestartInProgress?12:-1),t(),d(i.plugin.installedVersion&&(i.plugin.newHbScope==null?null:i.plugin.newHbScope.switch)===i.plugin.installedVersion&&!i.childBridgeRestartInProgress?13:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&!i.plugin.isConfigured&&!i.childBridgeRestartInProgress&&!i.plugin.disabled?14:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&!i.plugin.hasChildBridges&&!i.plugin.disabled&&i.plugin.recommendChildBridge&&!i.childBridgeRestartInProgress?15:-1),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&i.hasUnpairedChildBridges&&i.childBridgeStatus==="ok"&&!i.plugin.disabled?16:-1),t(),v("hidden",!i.childBridgeRestartInProgress),t(),d(i.plugin.installedVersion&&(!i.plugin.newHbScope||i.plugin.newHbScope.switch!==i.plugin.installedVersion)&&!i.plugin.updateAvailable&&i.plugin.isConfigured&&i.plugin.hasChildBridges&&!i.childBridgeRestartInProgress&&!i.hasUnpairedChildBridges&&i.childBridgeStatus!=="ok"&&!i.plugin.disabled?18:-1),t(3),v("ngClass",J(20,Ai,i.plugin.isHbScoped,!i.plugin.isHbScoped&&(i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin),!i.plugin.isHbScoped&&!i.plugin.verifiedPlugin&&!i.plugin.verifiedPlusPlugin)),t(2),P(i.plugin.name),t(2),d((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?25:-1),t(),d((i.plugin.verifiedPlugin||i.plugin.verifiedPlusPlugin)&&i.plugin.funding?-1:26),t(3),d(i.plugin.publicPackage&&!i.plugin.installedVersion?29:-1),t(),d(i.plugin.installedVersion?30:-1),t(2),d(!i.plugin.disabled&&i.plugin.hasChildBridges&&i.childBridgeStatus==="ok"?32:-1),t(),d(i.plugin.installedVersion&&i.plugin.disabled?33:-1),t(),d(i.plugin.publicPackage&&!i.plugin.installedVersion?34:-1),t(),d(i.plugin.installedVersion?35:-1))},dependencies:[gi,V,ci,pi,di,si,ri,Q,E],encapsulation:2})}return n})();var xe=(n,r)=>({"fa-magnifying-glass":n,"fa-exclamation-circle":r});function we(n,r){n&1&&p(0,"app-spinner")}function Pe(n,r){if(n&1){let e=b();a(0,"a",9),_("click",function(){C(e);let i=c();return h(i.onClearSearch())}),p(1,"i",10),l()}}function Se(n,r){if(n&1&&(a(0,"div",11),p(1,"app-plugin-card",13),l()),n&2){let e=r.$implicit,o=c(2);t(),v("plugin",e)("childBridges",o.getPluginChildBridges(e))}}function ye(n,r){if(n&1&&(a(0,"div",12),p(1,"i",14),a(2,"p"),m(3),u(4,"translate"),l()()),n&2){let e=c(2);t(),v("ngClass",B(4,xe,!e.showExitButton,e.showExitButton)),t(2),P(g(4,2,e.showExitButton?"plugins.placeholder_search_none":"plugins.placeholder_search_first"))}}function Be(n,r){if(n&1&&(a(0,"div",8),G(1,Se,2,2,"div",11,L),s(3,ye,5,7,"div",12),l()),n&2){let e=c();t(),W(e.installedPlugins),t(2),d(e.installedPlugins.length===0&&!e.loading&&!e.mainError?3:-1)}}var vn=(()=>{class n{$api=w(A);$modal=w(D);$plugin=w(U);$router=w(fi);$settings=w(F);$toastr=w(j);$translate=w(N);$ws=w(R);isSearchMode=!1;mainError=!1;loading=!0;installedPlugins=[];childBridges=[];showExitButton=!1;form=new ii({query:new ei("")});io;navigationSubscription;constructor(){}ngOnInit(){return S(this,null,function*(){this.io=this.$ws.connectToNamespace("child-bridges"),this.io.connected.subscribe(()=>S(this,null,function*(){this.getChildBridgeMetadata(),this.io.socket.emit("monitor-child-bridge-status"),this.loadInstalledPlugins().then(()=>{let e=this.$router.parseUrl(this.$router.url).queryParams.installed;if(e){let o=this.installedPlugins.find(i=>i.name===e);o&&(o.isConfigured?this.$modal.open($,{size:"lg",backdrop:"static"}):this.$plugin.settings(o)),this.$router.navigate(["/plugins"])}})})),this.io.socket.on("child-bridge-status-update",e=>{let o=this.childBridges.find(i=>i.username===e.username);o?Object.assign(o,e):this.childBridges.push(e)}),this.navigationSubscription=this.$router.events.subscribe(e=>{e instanceof mi&&this.loadInstalledPlugins()})})}loadInstalledPlugins(){return S(this,null,function*(){this.form.setValue({query:""}),this.showExitButton=!1,this.installedPlugins=[],this.loading=!0,this.mainError=!1;try{let e=yield k(this.$api.get("/plugins"));this.installedPlugins=e.filter(i=>i.name!=="homebridge-config-ui-x"),yield this.appendMetaInfo();let o=this.installedPlugins.sort((i,f)=>i.updateAvailable!==f.updateAvailable?i.updateAvailable?-1:1:i.newHbScope&&!f.newHbScope?-1:i.disabled!==f.disabled?i.disabled?1:-1:i.isConfigured!==f.isConfigured?i.isConfigured?1:-1:i.hasChildBridgesUnpaired!==f.hasChildBridgesUnpaired?i.hasChildBridgesUnpaired?-1:1:i.hasChildBridges!==f.hasChildBridges&&this.$settings.env.recommendChildBridges?i.hasChildBridges?1:-1:i.name.localeCompare(f.name));return this.loading=!1,o}catch(e){console.error(e),this.loading=!1,this.mainError=!0,this.$toastr.error(this.$translate.instant("plugins.toast_failed_to_load_plugins"),this.$translate.instant("toast.title_error"))}})}appendMetaInfo(){return S(this,null,function*(){yield Promise.all(this.installedPlugins.filter(e=>e.installedVersion).map(e=>S(this,null,function*(){try{let o=yield k(this.$api.get(`/config-editor/plugin/${encodeURIComponent(e.name)}`));e.isConfigured=o.length>0,e.isConfiguredDynamicPlatform=e.isConfigured&&Object.prototype.hasOwnProperty.call(o[0],"platform"),e.recommendChildBridge=e.isConfiguredDynamicPlatform&&this.$settings.env.recommendChildBridges&&!["homebridge","homebridge-config-ui-x"].includes(e.name),e.hasChildBridges=e.isConfigured&&o.some(f=>f._bridge&&f._bridge.username);let i=this.getPluginChildBridges(e);e.hasChildBridgesUnpaired=i.some(f=>!f.paired)}catch{e.isConfigured=!0,e.hasChildBridges=!0}})))})}search(){this.installedPlugins=[],this.loading=!0,this.showExitButton=!0,this.$api.get(`/plugins/search/${encodeURIComponent(this.form.value.query)}`).subscribe({next:e=>{let o=new Set;this.installedPlugins=e.reduce((i,f)=>{if(f.name==="homebridge-config-ui-x"||o.has(f.name))return i;if(f.newHbScope){let O=f.newHbScope.to,Bi=e.some(ki=>ki.name===O);(f.installedVersion||!Bi)&&(o.add(O),i.push(f))}else i.push(f);return i},[]),this.appendMetaInfo(),this.loading=!1},error:e=>{this.loading=!1,this.isSearchMode=!1,console.error(e),this.$toastr.error(e.error.message||e.message,this.$translate.instant("toast.title_error")),this.loadInstalledPlugins()}})}onClearSearch(){this.loadInstalledPlugins()}onSubmit({value:e}){e.query.length?(this.isSearchMode=!0,this.search()):this.isSearchMode&&(this.isSearchMode=!1,this.loadInstalledPlugins())}getChildBridgeMetadata(){this.io.request("get-homebridge-child-bridge-status").subscribe(e=>{this.childBridges=e})}getPluginChildBridges(e){return this.childBridges.filter(o=>o.plugin===e.name)}ngOnDestroy(){this.navigationSubscription&&this.navigationSubscription.unsubscribe(),this.io.end()}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=T({type:n,selectors:[["ng-component"]],decls:13,vars:10,consts:[[1,"row","mb-3"],[1,"col-12"],[1,"primary-text","m-0"],[1,"row"],[1,"col-md-12"],["novalidate","",3,"ngSubmit","formGroup"],["type","text","formControlName","query",1,"hb-npm-search",3,"placeholder"],["href","javascript:void(0)",1,"hb-npm-search-clear"],[1,"d-flex","flex-wrap","justify-content-between"],["href","javascript:void(0)",1,"hb-npm-search-clear",3,"click"],[1,"far","fa-fw","fa-times-circle"],[1,"hb-plugin-space-between"],[1,"alert","alert-info","mt-4","text-center","w-100"],[3,"plugin","childBridges"],[1,"fas","fa-fw","primary-text","my-3",2,"font-size","75px",3,"ngClass"]],template:function(o,i){o&1&&(s(0,we,1,0,"app-spinner"),a(1,"div",0)(2,"div",1)(3,"h3",2),m(4),u(5,"translate"),l()()(),a(6,"div",3)(7,"div",4)(8,"form",5),_("ngSubmit",function(){return i.onSubmit(i.form)}),p(9,"input",6),u(10,"translate"),s(11,Pe,2,0,"a",7),l()()(),s(12,Be,4,1,"div",8)),o&2&&(d(i.loading?0:-1),t(4),P(g(5,6,"menu.label_plugins")),t(4),v("formGroup",i.form),t(),v("placeholder",g(10,8,"plugins.placeholder_search_plugin")),t(2),d(i.showExitButton?11:-1),t(),d(i.loading?-1:12))},dependencies:[hi,ai,ni,X,Y,Z,li,ti,oi,yi,E,V],styles:[".hb-npm-search[_ngcontent-%COMP%]{outline:none;box-sizing:inherit!important;background-color:inherit;height:50px!important;width:100%;border-width:.5px;padding:10px;margin-bottom:15px}@media (hover: hover){.hb-npm-search[_ngcontent-%COMP%]:hover{border:1px solid #000000}}.hb-npm-search[_ngcontent-%COMP%]:focus{border:1px solid #000000;box-shadow:0 1px #000}.hb-npm-search-clear[_ngcontent-%COMP%]{position:absolute;right:25px;font-size:35px;color:#d0d0d0;line-height:50px;cursor:pointer}.hb-plugin-space-between[_ngcontent-%COMP%]{box-sizing:border-box;width:calc(50% - 6.6666666667px)}@media only screen and (max-width: 991px){.hb-plugin-space-between[_ngcontent-%COMP%]{width:100%}}"]})}return n})();export{vn as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-5OBBFCOZ.js";import{q as p}from"./chunk-YHABGXDF.js";import{z as m}from"./chunk-JOBKDXBH.js";import{g as i}from"./chunk-QR7L4UUP.js";import"./chunk-Z7FCAS3S.js";import"./chunk-DOZWR3M6.js";import"./chunk-ASBFWS7L.js";import{c as s}from"./chunk-DJKI5XBW.js";import{ha as t,kd as n,mb as r}from"./chunk-U4V4ICSI.js";var a=[{path:"",loadComponent:()=>import("./chunk-3NFPW77O.js").then(o=>o.PowerOptionsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(a),i]})}return o})();var j=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[n,u,p,m,s]})}return o})();export{j as PowerOptionsModule};
|