System.register(["./index-legacy.js","./global-legacy.js"],(function(e,t){"use strict";var n,o;return{setters:[e=>{n=e.u},e=>{o=e.u}],execute:function(){var t=1,r=2,a=3,i=4,c=5,s=6,_=7,p=8,d=9,l=10,f=function(e,n){if("object"==typeof e&&"function"==typeof e.send){var o=this;this.transport=e,this.send=function(e){"string"!=typeof e&&(e=JSON.stringify(e)),o.transport.send(e)},this.transport.onmessage=function(e){var n=e.data;switch("string"==typeof n&&(n=JSON.parse(n)),n.type){case t:o.handleSignal(n);break;case l:o.handleResponse(n);break;case r:o.handlePropertyUpdate(n);break;default:console.error("invalid message received:",e.data)}},this.execCallbacks={},this.execId=0,this.exec=function(e,t){t?(o.execId===Number.MAX_VALUE&&(o.execId=Number.MIN_VALUE),e.hasOwnProperty("id")?console.error("Cannot exec message with property id: "+JSON.stringify(e)):(e.id=o.execId++,o.execCallbacks[e.id]=t,o.send(e))):o.send(e)},this.objects={},this.handleSignal=function(e){var t=o.objects[e.object];t?t.signalEmitted(e.signal,e.args):console.warn("Unhandled signal: "+e.object+"::"+e.signal)},this.handleResponse=function(e){e.hasOwnProperty("id")?(o.execCallbacks[e.id](e.data),delete o.execCallbacks[e.id]):console.error("Invalid response message received: ",JSON.stringify(e))},this.handlePropertyUpdate=function(e){for(var t in e.data){var n=e.data[t],r=o.objects[n.object];r?r.propertyUpdate(n.signals,n.properties):console.warn("Unhandled property update: "+n.object+"::"+n.signal)}o.exec({type:i})},this.debug=function(e){o.send({type:c,data:e})},o.exec({type:a},(function(e){for(var t in e)new u(t,e[t],o);for(const n in o.objects)o.objects[n].unwrapProperties();n&&n(o),o.exec({type:i})}))}else console.error("The QWebChannel expects a transport object with a send function and onmessage callback property. Given is: transport: "+typeof e+", transport.send: "+typeof e.send)};function u(e,t,n){this.__id__=e,n.objects[e]=this,this.__objectSignals__={},this.__propertyCache__={};var o=this;function r(e,t){var r=e[0],a=e[1];o[r]={connect:function(e){"function"==typeof e?(o.__objectSignals__[a]=o.__objectSignals__[a]||[],o.__objectSignals__[a].push(e),t||"destroyed"===r||n.exec({type:_,object:o.__id__,signal:a})):console.error("Bad callback given to connect to signal "+r)},disconnect:function(e){if("function"==typeof e){o.__objectSignals__[a]=o.__objectSignals__[a]||[];var i=o.__objectSignals__[a].indexOf(e);-1!==i?(o.__objectSignals__[a].splice(i,1),t||0!==o.__objectSignals__[a].length||n.exec({type:p,object:o.__id__,signal:a})):console.error("Cannot find connection of signal "+r+" to "+e.name)}else console.error("Bad callback given to disconnect from signal "+r)}}}function a(e,t){var n=o.__objectSignals__[e];n&&n.forEach((function(e){e.apply(e,t)}))}for(var i in this.unwrapQObject=function(e){if(e instanceof Array){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=o.unwrapQObject(e[r]);return t}if(!e||!e["__QObject*__"]||void 0===e.id)return e;var a=e.id;if(n.objects[a])return n.objects[a];if(e.data){var i=new u(a,e.data,n);return i.destroyed.connect((function(){if(n.objects[a]===i){delete n.objects[a];var e=[];for(var t in i)e.push(t);for(var o in e)delete i[e[o]]}})),i.unwrapProperties(),i}console.error("Cannot unwrap unknown QObject "+a+" without data.")},this.unwrapProperties=function(){for(var e in o.__propertyCache__)o.__propertyCache__[e]=o.unwrapQObject(o.__propertyCache__[e])},this.propertyUpdate=function(e,t){for(var n in t){var r=t[n];o.__propertyCache__[n]=r}for(var i in e)a(i,e[i])},this.signalEmitted=function(e,t){a(e,t)},t.methods.forEach((function(e){var t=e[0],r=e[1];o[t]=function(){for(var e,t=[],a=0;a<arguments.length;++a)"function"==typeof arguments[a]?e=arguments[a]:t.push(arguments[a]);n.exec({type:s,object:o.__id__,method:r,args:t},(function(t){if(void 0!==t){var n=o.unwrapQObject(t);e&&e(n)}}))}})),t.properties.forEach((function(e){var t=e[0],a=e[1],i=e[2];o.__propertyCache__[t]=e[3],i&&(1===i[0]&&(i[0]=a+"Changed"),r(i,!0)),Object.defineProperty(o,a,{configurable:!0,get:function(){var e=o.__propertyCache__[t];return void 0===e&&console.warn('Undefined value in property cache for property "'+a+'" in object '+o.__id__),e},set:function(e){void 0!==e?(o.__propertyCache__[t]=e,n.exec({type:d,object:o.__id__,property:t,value:e})):console.warn("Property setter for "+a+" called with undefined value!")}})})),t.signals.forEach((function(e){r(e,!1)})),t.enums)o[i]=t.enums[i]}e("default",{__name:"index",setup(e){const t=n(),r=o();return new f(qt.webChannelTransport,(function(e){r.chatQWeb=e.objects.chatObject,r.updateActivityColor(r.chatQWeb.activeColor),r.updateTheme(r.chatQWeb.themeType),t.replace({name:"Chat"})})),(e,t)=>null}})}}}));
