(self["webpackChunk_mf_support"]=self["webpackChunk_mf_support"]||[]).push([[832],{479:function(e,t,i){(function(t,i,o){e.exports=o()})(0,0,(function(){"undefined"===typeof i.g||i.g.window||(i.g.window=i.g,i.g.document={cookie:""}),"undefined"===typeof i.g||i.g.navigator||(i.g.navigator={userAgent:" "}),"undefined"===typeof window||window.fm||(window.fm={}),function(e){(function(e){var t=function(){function e(){}return e.prototype.getTypeString=function(){return"[fm.liveswitch.ArrayExtensions]"},e.getCount=function(e){return e.length},e.add=function(e,t){e.push(t)},e.remove=function(e,t){for(var i=0;i64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e.decodeIt=function(t,i){if("undefined"===typeof Uint8Array)return null;for(var o=t.replace(/[^A-Za-z0-9\+\/]/g,""),n=o.length,s=i?Math.ceil((3*n+1>>2)/i)*i:3*n+1>>2,r=new Uint8Array(s),a=0,l=0,c=0;c>>(16>>>p&24)&255,p++,l++;a=0}}return r},e.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e.encodeIt=function(t,i,o){if("undefined"===typeof Uint8Array)return null;for(var n="",s=o,r=0,a=0;a>>l&24),2!==l&&o-a!==1||(n+=String.fromCharCode(e.uint6ToB64(r>>>18&63),e.uint6ToB64(r>>>12&63),e.uint6ToB64(r>>>6&63),e.uint6ToB64(63&r)),r=0)}return n.replace(/A(?=A$|$)/g,"=")},e._base64Regex=/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]*)?$/,e}();e.Base64=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){}return e.prototype.getTypeString=function(){return"[fm.liveswitch.BitAssistant]"},e.castByte=function(e){return e},e.castInteger=function(e){return e},e.castLong=function(e){return e},e.leftShift=function(e,t){return e<>t},e.rightShiftShort=function(e,t){return e>>t},e.rightShiftInteger=function(e,t){return e>>t},e.rightShiftLong=function(e,t){return e>>t},e.sequencesAreEqual=function(){if(2==arguments.length){var e=arguments[0],t=arguments[1];if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!=t.length)return!1;for(var i=0;i=this.getLevel())try{var i=!0;e.liveswitch.Global.equals(this.getFilter(),null)||(i=this.getFilter()(t)),i&&this.doLog(t)}catch(o){}},t.prototype.setFilter=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._filter=t},t.prototype.setLevel=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._level=t},t.prototype.setProcessId=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._processId=e.liveswitch.Global.toInt(t)},t}();t.LogProvider=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e){var o=i.call(this)||this;return"undefined"===typeof e&&(e=t.liveswitch.Log.getDefaultLogLevel()),o.setLevel(e),o}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.ConsoleLogProvider],"+i.prototype.getTypeString.call(this)},o.prototype.writeLine=function(e){window.console&&window.console.log&&window.console.log(e)},o.prototype.doLog=function(e){if(window.console){var o=i.prototype.generateLogLine.call(this,e);switch(e.getLevel()){case t.liveswitch.LogLevel.Fatal:case t.liveswitch.LogLevel.Error:if(window.console.error)return void window.console.error(o);break;case t.liveswitch.LogLevel.Warn:if(window.console.warn)return void window.console.warn(o);break;case t.liveswitch.LogLevel.Info:if(window.console.info)return void window.console.info(o);break;case t.liveswitch.LogLevel.Debug:case t.liveswitch.LogLevel.Verbose:if(window.console.debug)return void window.console.debug(o);break}window.console.log(o)}},o}(t.liveswitch.LogProvider);i.ConsoleLogProvider=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){}return e.prototype.getTypeString=function(){return"[fm.liveswitch.Convert]"},e.toInt32=function(e,t){return parseInt(e,t)},e}();e.Convert=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){}return e.getInvariantCulture=function(){return new e},e.getCurrentCulture=function(){return new e},e}();e.CultureInfo=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){if(1==arguments.length)if(e.liveswitch.Util.isDate(arguments[0]))this._date=arguments[0];else{var t=arguments[0];this._date=new Date((t-621355968e9)/e.liveswitch.Constants.getTicksPerMillisecond())}else if(arguments.length>=6){var i=arguments[0],o=arguments[1],n=arguments[2],s=arguments[3],r=arguments[4],a=arguments[5],l=0;arguments.length>=7&&(l=arguments[6]),this._date=new Date(Date.UTC(i,o-1,n,s,r,a,l))}}return t.prototype.getTypeString=function(){return"[fm.liveswitch.DateTime]"},t.getNow=function(){return new t(new Date)},t.getUtcNow=function(){return new t(new Date)},t.prototype.getDate=function(){return this._date},t.prototype.getTicks=function(){return 621355968e9+this._date.getTime()*e.liveswitch.Constants.getTicksPerMillisecond()},t.prototype.toUniversalTime=function(){return new t(this._date)},t.prototype.getYear=function(){return this._date.getUTCFullYear()},t.prototype.getMonth=function(){return this._date.getUTCMonth()+1},t.prototype.getDay=function(){return this._date.getUTCDate()},t.prototype.getHour=function(){return this._date.getUTCHours()},t.prototype.getMinute=function(){return this._date.getUTCMinutes()},t.prototype.getSecond=function(){return this._date.getUTCSeconds()},t.prototype.getMillisecond=function(){return this._date.getUTCMilliseconds()},t.prototype.addHours=function(i){return new t(this.getTicks()+i*e.liveswitch.Constants.getTicksPerHour())},t.prototype.addMinutes=function(i){return new t(this.getTicks()+i*e.liveswitch.Constants.getTicksPerMinute())},t.prototype.addSeconds=function(i){return new t(this.getTicks()+i*e.liveswitch.Constants.getTicksPerSecond())},t.prototype.addMilliseconds=function(i){return new t(this.getTicks()+i*e.liveswitch.Constants.getTicksPerMillisecond())},t}();t.DateTime=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){}return e.prototype.getTypeString=function(){return"[fm.liveswitch.DateTimeFormatInfo]"},e.getInvariantInfo=function(){return new e},e}();e.DateTimeFormatInfo=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["AssumeUniversal"]=1]="AssumeUniversal",e[e["AdjustToUniversal"]=2]="AdjustToUniversal"})(e.DateTimeStyles||(e.DateTimeStyles={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o"),this._container.appendChild(t)},o.prototype.doLog=function(e){var t=i.prototype.generateLogLine.call(this,e);this.writeLine(t)},o}(t.liveswitch.LogProvider);i.DomLogProvider=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){}return e.prototype.getTypeString=function(){return"[fm.liveswitch.Encoding]"},e.getAscii=function(){return new e},e.getUtf8=function(){return new e},e.prototype.getString=function(e,t,i){"undefined"===typeof t&&(t=0),"undefined"===typeof i&&(i=e.length);var o="",n=t;while(n>5===6)s=(31&e[n])<<6|63&e[++n];else if(e[n]>>4===14)s=(15&e[n])<<12|(63&e[++n])<<6|63&e[++n];else{var r=1;while(e[n]&32>>>r)r++;s=e[n]&31>>>r;while(r-- >=0)s=s<<6^63&e[++n]}o+=String.fromCharCode(s),n++}return o},e.prototype.getBytes=function(e){if(!e)return null;var t=e.length,i=0,o=new Uint8Array(new ArrayBuffer(4*t)),n=0;while(n>>6,o[i++]=128|63&s;else if(s<=65535)o[i++]=224|s>>>12,o[i++]=128|s>>>6&63,o[i++]=128|63&s;else{var r=4;while(s>>6*r)r++;o[i++]=65280>>>r&255|s>>>6*--r;while(r--)o[i++]=128|s>>>6*r&63}n++}return o.subarray(0,i)},e.prototype.getByteCount=function(e){return this.getBytes(e).length},e}();e.Encoding=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={}));var t=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i}(Error);(function(i){(function(i){var o=function(t){function i(e){var i=t.call(this,e)||this;return i.message=e,i.name="Exception",i}return e(i,t),i}(t);i.Exception=o})(i.liveswitch||(i.liveswitch={}))})(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;ithis.blockSize)(new e.liveswitch.Sha256).update(t).finish(i).clean();else for(var o=0;o-1},t.isArrayType=function(e,i){return t.isArray(e)&&(0==e.length||t.isNullOrUndefined(e[0])||t.isObjectType(e[0],i))},t.isPlainObject=function(e){if(!e||"[object Object]"!==Object.prototype.toString.call(e)||e.nodeType||e===e.window)return!1;try{if(e.constructor&&!Object.prototype.hasOwnProperty.call(e,"constructor")&&!Object.prototype.hasOwnProperty.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(i){return!1}var t;for(t in e);return void 0===t||Object.prototype.hasOwnProperty.call(e,t)},t.canAttachProperties=function(e,t){for(var i in t){t[i];var o="set"+i.charAt(0).toUpperCase()+i.substring(1),n=e[o];if(!n||"[object Function]"!==Object.prototype.toString.call(n))return!1}return!0},t.attachProperties=function(t,i){for(var o in i){var n=i[o],s="set"+o.charAt(0).toUpperCase()+o.substring(1),r=t[s];r&&"[object Function]"===Object.prototype.toString.call(r)?r.call(t,n):(r=t["setExtensionValue"],r&&"[object Function]"===Object.prototype.toString.call(r)?"[object Function]"===Object.prototype.toString.call(n)?e.liveswitch.Log.warn('Property "'+o+'" did not match any known setter and has a function as its value. Please verify your callback names are correct.'):(r.call(t,o,n),e.liveswitch.Log.debug('Property "'+o+'" did not match any known setter and is assumed to be an extension value.')):e.liveswitch.Log.debug('Property "'+o+'" did not match any known setter and was ignored.'))}return t},t.isIE=function(){return!!document.protocol},t.isIE6=function(){return t.isIE()&&!window.XMLHttpRequest},t.isIE7=function(){return t.isIE()&&window.XMLHttpRequest&&!document.implementation},t.isIE8=function(){return t.isIE()&&document.implementation&&document.implementation.hasFeature&&!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")},t.isIE9=function(){return t.isIE()&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")},t.isEdge=function(){return null!=navigator.userAgent.match(/edge\//i)},t.isChrome=function(){return null!=navigator.userAgent.match(/chrome/i)},t.isFirefox=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},t.isSafari9=function(){return t.isSafari()&&null!=navigator.userAgent.match(/version\/9\.\d(\.\d+)*(mobile\/[a-zA-Z0-9]+)? safari/i)},t.isSafari10=function(){return t.isSafari()&&null!=navigator.userAgent.match(/version\/10\.\d(\.\d+)*(mobile\/[a-zA-Z0-9]+)? safari/i)},t.isSafari11=function(){return t.isSafari()&&null!=navigator.userAgent.match(/version\/11\.\d(\.\d+)*(mobile\/[a-zA-Z0-9]+)? safari/i)},t.isSafari12=function(){return t.isSafari()&&null!=navigator.userAgent.match(/version\/12\.\d(\.\d+)*(mobile\/[a-zA-Z0-9]+)? safari/i)},t.isSafari12_1=function(){return t.isSafari()&&null!=navigator.userAgent.match(/version\/12\.1(\.\d+)*(mobile\/[a-zA-Z0-9]+)? safari/i)},t.isSafari=function(){return!t.isChrome()&&!t.isEdge()&&null!=navigator.userAgent.match(/version\/[^\s]+( mobile\/[^\s]+)? safari\/[^\s]+/i)},t.isOpera=function(){return null!=navigator.userAgent.match(/Opera Mini/i)},t.isWindows=function(){return null!=navigator.userAgent.match(/IEMobile/i)},t.isAndroid=function(){return null!=navigator.userAgent.match(/Android/i)},t.isBlackBerry=function(){return null!=navigator.userAgent.match(/BlackBerry/i)},t.isiOS=function(){return null!=navigator.userAgent.match(/iPhone|iPad|iPod/i)||0!=navigator.maxTouchPoints&&t.isSafari()},t.isMobile=function(){return t.isAndroid()||t.isBlackBerry()||t.isiOS()||t.isOpera()||t.isWindows()},t.hasActiveX=function(t){var i=void 0!==window.ActiveXObject;return t&&i&&"undefined"!==typeof window.external.msActiveXFilteringEnabled&&window.external.msActiveXFilteringEnabled()&&(i=!1,e.liveswitch.Log.debug("ActiveX is filtered and cannot be used.")),i},t.getBrowserVersion=function(){var e,t,i=navigator.userAgent;return null!=(e=i.match(/version\/(\d+)/i))?t=e[1]:null!=(e=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i))&&(t=e[2]),t||(t="-1"),parseFloat(t)},t.hasJava=function(){return null!=t.getJavaVersion()},t.getJavaVersion=function(){if(t.isIE()&&t.hasActiveX())return t.isJavaWebStartInstalledActiveX("1.9.0")?"1.9.0":t.isJavaWebStartInstalledActiveX("1.8.0")?"1.8.0":t.isJavaWebStartInstalledActiveX("1.7.0")?"1.7.0":t.isJavaWebStartInstalledActiveX("1.6.0")?"1.6.0":t.isJavaWebStartInstalledActiveX("1.5.0")?"1.5.0":t.isJavaWebStartInstalledActiveX("1.4.2")?"1.4.2":null;var e=null,i=window.navigator.mimeTypes;if(i)for(var o=0;o0&&s.indexOf("jpi")>0&&s.indexOf("applet")>0){var r=s.split("=");e=r[r.length-1]}}return e},t.isJavaWebStartInstalledActiveX=function(e){try{return t.hasActiveX()&&null!==new ActiveXObject("JavaWebStart.isInstalled."+e+".0")}catch(i){return!1}},t.isXD=function(e,i){try{if("undefined"!==typeof i){var o=t.getHost(e),n=t.getHost(i);return t.compareHost(o,n)}if(!t._xdCache[e]){var s=t.getHost(e),r=t.getHost();t._xdCache[e]=t.compareHost(s,r)?"y":"n"}return"y"===t._xdCache[e]}catch(a){return!1}},t.getHost=function(e){if(!e)return t.getCurrentHost();var i=t.parseUrl(e);return i.protocol?i:t.getCurrentHost()},t.compareHost=function(e,t){return e.server!==t.server||(e.port||t.port)&&e.port!==t.port},t.getCurrentHost=function(){var e=document.location;return{protocol:e.protocol,server:e.hostname,port:e.port}},t.parseUrl=function(t){var i=/(((http|ws)s?:)\/\/)?([\-\w\.\*]+)+(:(\d+))?(\/([^\?]*(\?\S+)?)?)?/i.exec(t);if(i.length<6)throw new e.liveswitch.Exception("Invalid URL ("+t+").");return{prefix:i[1],protocol:i[2],server:i[4],postfix:i[5],port:i[6],path:i[7]}},t.absolutizeUrl=function(e){if(!e)return e;var i=t.parseUrl(e);if(i.protocol)return-1===i.server.indexOf("*")||(e=i.prefix+t.wildcard(i.server),i.postfix&&(e+=i.postfix),i.path&&(e+=i.path)),e;var o=document.location,n=o.protocol+"//"+o.host;return"/"===e.charAt(0)?n+e:n+o.pathname.substring(0,o.pathname.lastIndexOf("/")+1)+e},t.wildcard=function(e){return e.replace("*",t.getWildcard())},t.getWildcard=function(){return null===t._wildcard&&(t._wildcard=t.randomChar(t._chars)),t._wildcard},t.randomChar=function(e){return e?e.charAt(Math.floor(Math.random()*e.length)):e},t.observe=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent?e.attachEvent("on"+t,i):e["on"+t]=i},t.unobserve=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent("on"+t,i)},t.observeAttr=function(e,i){var o=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,n=function(){var e=document.createElement("p"),t=!1;if(e.addEventListener)e.addEventListener("DOMAttrModified",(function(){return t=!0}),!1);else{if(!e.attachEvent)return!1;e.attachEvent("onDOMAttrModified",(function(){return t=!0}))}return e.setAttribute("id","target"),t};if(o){var s={subtree:!1,attributes:!0},r=new o((function(e,t){for(var o=0,n=e;o-1?"-":"+",s=o.split(n),r=parseInt(s[0],10);return new Date(r)}return i},t._buildReviver=function(e){var t=this;return this.useMicrosoftDateFormat?null!=e?function(i,o){return e(i,t._reviver(i,o))}:this._reviver:e},t.deserialize=function(){var e=Array.prototype.slice.call(arguments);return 0===e.length||null===e[0]||""===e[0]?null:(e[1]=t._buildReviver(e[1]),JSON.parse.apply(t,e))},t.serialize=function(){if(t.useMicrosoftDateFormat){var i=Date.prototype.toJSON;Date.prototype.toJSON=function(e){return isFinite(this.valueOf())?"/Date("+this.getTime()+"-0000)/":null};try{var o=JSON.stringify.apply(t,arguments);if("undefined"===o)throw new e.liveswitch.Exception("Cannot serialize undefined to JSON. Try using null instead.");return o.replace(/\//g,"\\/")}finally{Date.prototype.toJSON=i}}return JSON.stringify.apply(t,arguments)},t.useMicrosoftDateFormat=!0,t._dateRegex=/^\/Date\((\d+[\-|\+]?\d{0,4})\)\/$/,t}();t.Json=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){}return t.prototype.getTypeString=function(){return"[fm.liveswitch.Jsonp]"},t.getNextCallback=function(i){var o="cb"+t._callbackCount++,n="fm.liveswitch.Jsonp._cb.";return t._cb[o]=function(s){try{if(i.onResponseReceived&&i.onResponseReceived(null),i.onSuccess)if(i.robustResponse){var r=s[i.contentParameterName];r?"string"!==typeof r&&(r=e.liveswitch.Json.serialize(r)):r="",i.onSuccess({content:r,contentBinary:null,statusCode:s[i.statusCodeParameterName]||200,headers:s[i.headersParameterName]||{}})}else{r=s;r?"string"!==typeof r&&(r=e.liveswitch.Json.serialize(r)):r="",i.onSuccess({content:r,contentBinary:null,statusCode:200,headers:{}})}}catch(a){throw a}finally{t.cleanup((i.useFrame?"parent.":"")+n+o,i.useFrame)}},(i.useFrame?"parent.":"")+n+o},t.failureHandler=function(e,i,o){e.onFailure&&e.onFailure({message:o,local:!1}),t.cleanup(i,e.useFrame)},t.send=function(i){i=e.liveswitch.Util.extend({url:"",method:"POST",content:null,headers:{},timeout:15e3,canSegmentJsonArray:!1,robustResponse:!1,callbackParameterName:"jsonp",contentParameterName:"content",methodParameterName:"method",headersParameterName:"headers",statusCodeParameterName:"statusCode",cacheBusterParameterName:"_cb",onRequestCreated:null,onResponseReceived:null,onFailure:null,onSuccess:null},i||{}),i.useFrame=!0;var o=t.getNextCallback(i);try{i.useFrame&&(t._scriptFrameDestroyer||(t._scriptFrameDestroyer=window.setInterval((function(){if(null!==t._scriptFrame&&(t._pastScriptFrames.push(t._scriptFrame),t._scriptFrame=null,t._scriptFrameLoaded=!1,2===t._pastScriptFrames.length)){var e=t._pastScriptFrames[0];for(var i in e)delete e[i];document.body.removeChild(e),t._pastScriptFrames.splice(0,1)}}),3e5)));var n,s=document.getElementsByTagName("head")[0];if(i.useFrame){t._scriptFrame||(t._scriptFrame=document.createElement("iframe"),t._scriptFrame.style.display="none",t._scriptFrame.src="PLEASE_IGNORE_THIS_404.htm",document.body.appendChild(t._scriptFrame));var r=t._scriptFrame.contentWindow.document;if(!r)throw"Could not create script frame.";n=r.createElement("script")}else n=document.createElement("script");n.type="text/javascript",n.charset="utf-8",n.id=o;var a=i.url;if(a=e.liveswitch.HttpTransfer.addQueryToUrl(a,i.methodParameterName,i.method),a=e.liveswitch.HttpTransfer.addQueryToUrl(a,i.headersParameterName,e.liveswitch.Json.serialize(i.headers)),a=e.liveswitch.HttpTransfer.addQueryToUrl(a,i.callbackParameterName,o),a=e.liveswitch.HttpTransfer.addQueryToUrl(a,i.cacheBusterParameterName,(new Date).getTime().toString()),a=e.liveswitch.HttpTransfer.addQueryToUrl(a,i.contentParameterName,i.content),a.length>t.maxUrlLength&&alert("URL length "+a.length+" exceeds maximum for JSON-P ("+t.maxUrlLength+")."),n.src=a,i.onRequestCreated&&i.onRequestCreated(null),window.setTimeout((function(){t.callbackExists(o)&&t.failureHandler(i,o,"JSON-P request timed out.")}),i.timeout),i.useFrame)if(t._scriptFrameLoaded)try{var l=t._scriptFrame.contentWindow.document.body;l.appendChild(n)}catch(c){t.failureHandler(i,o,"JSON-P request failed. Could not access script frame.")}else e.liveswitch.Util.observe(t._scriptFrame,"load",(function(){window.setTimeout((function(){try{var e=t._scriptFrame.contentWindow.document.body;e.appendChild(n)}catch(c){t.failureHandler(i,o,"JSON-P request failed. Could not access script frame.")}}),10),t._scriptFrameLoaded=!0}));else s.appendChild(n)}catch(c){t.failureHandler(i,o,"JSON-P request failed. "+(c.message||c.error||c.description||c))}},t.cleanup=function(i,o){var n=i.split("."),s=n[n.length-1];t._cb[s]=null,delete t._cb[s];try{var r=void 0;if(o){var a=t._pastScriptFrames.concat([]);null!==t._scriptFrame&&a.push(t._scriptFrame);for(var l=void 0,c=a.length-1;c>=0;c--)if(l=a[c].contentWindow.document,l&&(r=l.getElementById(i)),r)break;r&&l.body.removeChild(r)}else r=document.getElementById(i),r&&document.getElementsByTagName("head")[0].removeChild(r)}catch(h){e.liveswitch.Log.error("Could not remove script element.",h)}},t.callbackExists=function(i){var o=i.split("."),n=o[o.length-1];return e.liveswitch.HashExtensions.containsKey(t._cb,n)},t.maxUrlLength=2048,t._scriptFrame=null,t._scriptFrameLoaded=!1,t._callbackCount=0,t._cb={},t._pastScriptFrames=[],t._scriptFrameDestroyer=0,t}();t.Jsonp=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o3&&!o._abortingOnUnload){clearTimeout(r);try{o.onreadystatechange=null}catch(d){o.onreadystatechange=function(){}}if(o.status>0?t.handler(i,o):t.failureHandler(i,"Invalid XHR response."),i.abortOnUnload)return delete t._current[s]}});var h=!1;if(!t.getDisableBinary()&&i.contentBinary)try{o.send(i.contentBinary.buffer),h=!0}catch(d){try{o.send(i.contentBinary),h=!0}catch(d){t.setDisableBinary(!0)}}return h||(i.content?(a&&o.setRequestHeader("Content-Type","application/json"),o.send(i.content)):o.send()),r=window.setTimeout((function(){try{o._aborting=!0,o.abort()}catch(p){}}),i.timeout),i.sync&&(t.handler(i,o),i.abortOnUnload&&delete t._current[s]),!0}catch(d){return t.failureHandler(i,"XHR request failed. "+(d.message||d.error||d.description||d)),!1}},t.initialize=function(){t.__initialized||e.liveswitch.Util.observe(window,"unload",(function(){for(var e in t._current){var i=t._current[e];try{i._abortingOnUnload=!0,i.abort()}catch(o){}}})),t.__initialized=!0},t._count=0,t._current={},t._disableBinary=!1,t._defaultWithCredentials=!0,t.__initialized=!1,t}();t.Xhr=i,i.initialize()})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){}return t.prototype.getTypeString=function(){return"[fm.liveswitch.PostMessage]"},t.getOrigin=function(e){return/\w+:\/\/[^\/]+/.exec(e)[0]},t.createFrame=function(i,o){var n=t._cache[i.frameUrl];if(n)n.frame.loading?n.callbacks.push(o):window.setTimeout((function(){n.frame.loaded?o(n.frame,null):o(null,"Frame not loaded.")}),1);else{var s=document.createElement("iframe");s.style.display="none",document.body.appendChild(s);var r=[o];s.loading=!0,t._cache[i.frameUrl]=n={frame:s,callbacks:r};var a=window.setTimeout((function(){s.loading=!1,s.loaded=!1,s.timedOut=!0;while(r.length>0)r.shift()(null,"Frame load timed out.")}),i.timeout);e.liveswitch.Util.observe(s,"load",(function(){if(!s.timedOut){clearTimeout(a);var o=function(a){if(a.source===s.contentWindow&&"pong"===a.data){if(s.timedOut)return;clearTimeout(n),s.loading=!1,s.loaded=!0,s.timedOut=!1,t.listen(i,s);while(r.length>0)r.shift()(s,null);return e.liveswitch.Util.unobserve(window,"message",o)}},n=window.setTimeout((function(){s.loading=!1,s.loaded=!1,s.timedOut=!0;while(r.length>0)r.shift()(null,"Frame pong timed out.");if(o)return e.liveswitch.Util.unobserve(window,"message",o)}),500);e.liveswitch.Util.observe(window,"message",o),s.contentWindow.postMessage("ping",t.getOrigin(i.url))}})),s.src=e.liveswitch.HttpTransfer.addQueryToUrl(i.frameUrl,"type","pmf")}},t.send=function(i){i=e.liveswitch.Util.extend({url:"",onFailure:null,onSuccess:null,onRequestCreated:null,onResponseReceived:null},i||{}),i.contentBinary=null,t.createFrame(i,(function(o,n){if(o)return i.id=++t._optionsCounter,t._optionsCache[i.id]=i,o.contentWindow.postMessage(e.liveswitch.Json.serialize(i),t.getOrigin(i.url));if(i.onFailure){var s="Could not initialize postMessage frame.";return n&&(s+=" "+n),i.onFailure({message:s,local:!0})}}))},t.listen=function(i,o){e.liveswitch.Util.observe(window,"message",(function(n){if(n.source===o.contentWindow){try{n=e.liveswitch.Json.deserialize(n.data)}catch(s){return}if(!n.id)return;if(i=t._optionsCache[n.id],!i)return;1!==n.type&&2!==n.type||delete t._optionsCache[n.id],1===n.type?i.onFailure&&i.onFailure(n):2===n.type?i.onSuccess&&i.onSuccess(n):3===n.type?i.onRequestCreated&&i.onRequestCreated(null):4===n.type&&i.onResponseReceived&&i.onResponseReceived(null)}}))},t._cache={},t._optionsCounter=0,t._optionsCache={},t}();t.PostMessage=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n=64){for(r=t[0],a=t[1],l=t[2],c=t[3],h=t[4],p=t[5],d=t[6],w=t[7],v=0;v<16;v++)f=o+4*v,e[v]=(255&i[f])<<24|(255&i[f+1])<<16|(255&i[f+2])<<8|255&i[f+3];for(v=16;v<64;v++)u=e[v-2],g=(u>>>17|u<<15)^(u>>>19|u<<13)^u>>>10,u=e[v-15],m=(u>>>7|u<<25)^(u>>>18|u<<14)^u>>>3,e[v]=(g+e[v-7]|0)+(m+e[v-16]|0);for(v=0;v<64;v++)g=(((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(h&p^~h&d)|0)+(w+(n[v]+e[v]|0)|0)|0,m=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&a^r&l^a&l)|0,w=d,d=p,p=h,h=c+g|0,c=l,l=a,a=r,r=g+m|0;t[0]+=r,t[1]+=a,t[2]+=l,t[3]+=c,t[4]+=h,t[5]+=p,t[6]+=d,t[7]+=w,o+=64,s-=64}return o}var r=function(){function t(){this.digestLength=i,this.blockSize=o,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return t.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},t.prototype.clean=function(){for(var e=0;e0){while(this.bufferLength<64&&i>0)this.buffer[this.bufferLength++]=t[o++],i--;64===this.bufferLength&&(s(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}i>=64&&(o=s(this.temp,this.state,t,o,i),i%=64);while(i>0)this.buffer[this.bufferLength++]=t[o++],i--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,i=this.bufferLength,o=t/536870912|0,n=t<<3,r=t%64<56?64:128;this.buffer[i]=128;for(var a=i+1;a>>24&255,this.buffer[r-7]=o>>>16&255,this.buffer[r-6]=o>>>8&255,this.buffer[r-5]=o>>>0&255,this.buffer[r-4]=n>>>24&255,this.buffer[r-3]=n>>>16&255,this.buffer[r-2]=n>>>8&255,this.buffer[r-1]=n>>>0&255,s(this.temp,this.state,this.buffer,0,r),this.finished=!0}for(a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t-1},t.join=function(t){for(var i=[],o=1;o0&&n.append(t),n.append(i[s]);return n.toString()},t.split=function(t,i){if(null===t||void 0===t||null===i||void 0===i)throw new e.liveswitch.Exception("split() received a null argument.");for(var o=[],n=0,s=0;si.toString()?1:0},t.format=function(t){for(var i=[],o=1;o=0&&i.stop()&&i._callback&&i._callback(i._state)}),t)},t.prototype.stop=function(){return!!this._timer&&(clearTimeout(this._timer),this._timer=null,!0)},t}();t.TimeoutTimer=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(){if(1==arguments.length){var e=arguments[0],t=e/1e4;this._milliseconds=t%1e3,t-=this._milliseconds;var i=t/1e3;this._seconds=i%60,i-=this._seconds;var o=i/60;this._minutes=o%60,o-=this._minutes;var n=o/60;this._hours=n}else{n=arguments[0],o=arguments[0],i=arguments[0];this._hours=n,this._minutes=o,this._seconds=i}}return e.prototype.getTotalSeconds=function(){return 3600*this._hours+60*this._minutes+this._seconds},e.prototype.getTotalMilliseconds=function(){return 36e5*this._hours+6e4*this._minutes+1e3*this._seconds+this._milliseconds},e}();e.TimeSpan=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(e){this._typeString=e}return t.prototype.getTypeString=function(){return"[fm.liveswitch.Type]"},t.prototype.getFullName=function(){return this._typeString.substr(1,this._typeString.indexOf("]")-1)},t.prototype.getBaseType=function(){var i=e.liveswitch.StringExtensions.split(this._typeString,[",".charCodeAt(0)]);return 1==i.length?new t("[Object]"):new t(i[1])},t}();t.Type=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){var t=function(){function e(e){this._uriString=e}return e.prototype.getTypeString=function(){return"[fm.liveswitch.Uri]"},e.prototype.toString=function(){return this._uriString},e.escapeDataString=function(e){return encodeURIComponent(e)},e}();e.Uri=t})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){e.liveswitch.WebSocketBase.fmliveswitchWebSocketBaseInitialize();for(var t=new Array(arguments.length),i=0;i0&&(this._timer=window.setTimeout((function(){t._webSocket&&(t._aborting=!0,t._webSocket.close(),t.processOnClose(4e3,"Timeout"))}),i));var n=!1,s=e.getBinaryMessage();if(!o.getDisableBinary()&&s)try{this._webSocket.send(s.buffer),n=!0}catch(r){o.setDisableBinary(!0)}return n?void 0:this._webSocket.send(e.getTextMessage())}},o.prototype.close=function(e){if("undefined"!==typeof e){var i=e.getStatusCode()||t.liveswitch.WebSocketStatusCode.Normal,o=e.getReason()||"",n=new t.liveswitch.WebSocketCloseCompleteArgs;n.setStatusCode(i),n.setReason(o),window.clearTimeout(this._timer),this._webSocket&&(this._closing=!0,this._webSocket.close(i,o),this._webSocket=null),this.raiseCloseComplete(e,i,o)}else this.close(new t.liveswitch.WebSocketCloseArgs)},o.prototype.raiseOnRequestCreated=function(){if(this._onRequestCreated){var e=new t.liveswitch.HttpRequestCreatedArgs;e.setSender(this._openArgs.getSender()),e.setRequest(null),this._onRequestCreated(e)}},o.prototype.raiseOnResponseReceived=function(){if(this._onResponseReceived){var e=new t.liveswitch.HttpResponseReceivedArgs;e.setSender(this._openArgs.getSender()),e.setResponse(null),this._onResponseReceived(e)}},o._disableBinary=!1,o}(t.liveswitch.WebSocketBase);i.WebSocket=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i=1&&t.liveswitch.Util.isNullOrUndefined(arguments[0]));else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.AudioTrack]"))o=arguments[0];else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.LocalMedia]"))n=arguments[0],o=n.getAudioTrack();else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.RemoteMedia]"))r=arguments[0],s=r.getAudioTrack();else if(arguments.length>=1)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");if(arguments.length>=2&&t.liveswitch.Util.isNullOrUndefined(arguments[1]));else if(arguments.length>=2&&t.liveswitch.Util.isObjectType(arguments[1],"[fm.liveswitch.AudioTrack]"))s=arguments[1];else if(arguments.length>=2&&t.liveswitch.Util.isObjectType(arguments[1],"[fm.liveswitch.RemoteMedia]"))r=arguments[1],s=r.getAudioTrack();else if(arguments.length>=2)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");if(e=i.call(this,o,s)||this,e.localMedia=n,e.remoteMedia=r,t.liveswitch.Plugin.useActiveX())e._internal=new t.liveswitch.PluginAudioStream(e,null==o?null:o._getInternal(),null==s?null:s._getInternal());else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");e._internal=new t.liveswitch.WebRtcAudioStream(e,null==o?null:o._getInternal(),null==s?null:s._getInternal())}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.AudioStream],"+i.prototype.getTypeString.call(this)},o.prototype._getInternal=function(){return this._internal},o.prototype.getLocalMedia=function(){return this.localMedia},o.prototype.getRemoteMedia=function(){return this.remoteMedia},o.prototype.getDiscardDtmfTones=function(){return!(t.liveswitch.Plugin.useActiveX()||!t.liveswitch.Plugin.useNative())&&this._internal.getDiscardDtmfTones()},o.prototype.setDiscardDtmfTones=function(e){!t.liveswitch.Plugin.useActiveX()&&t.liveswitch.Plugin.useNative()&&this._internal.setDiscardDtmfTones(e)},o.prototype.addOnReceiveDtmfTone=function(e){this._getInternal().addOnReceiveDtmfTone(e)},o.prototype.addOnReceiveDtmfToneChange=function(e){this._getInternal().addOnReceiveDtmfToneChange(e)},o.prototype.addOnSendDtmfTone=function(e){this._getInternal().addOnSendDtmfTone(e)},o.prototype.addOnSendDtmfToneChange=function(e){this._getInternal().addOnSendDtmfToneChange(e)},o.prototype.insertDtmfTone=function(e){return this._getInternal().insertDtmfTone(e)},o.prototype.insertDtmfTones=function(e){return this._getInternal().insertDtmfTones(e)},o.prototype.removeOnReceiveDtmfTone=function(e){this._getInternal().removeOnReceiveDtmfTone(e)},o.prototype.removeOnReceiveDtmfToneChange=function(e){this._getInternal().removeOnReceiveDtmfToneChange(e)},o.prototype.removeOnSendDtmfTone=function(e){this._getInternal().removeOnSendDtmfTone(e)},o.prototype.removeOnSendDtmfToneChange=function(e){this._getInternal().removeOnSendDtmfToneChange(e)},o.prototype.getOpusDisabled=function(){return this._getInternal().getOpusDisabled()},o.prototype.getG722Disabled=function(){return this._getInternal().getG722Disabled()},o.prototype.getPcmuDisabled=function(){return this._getInternal().getPcmuDisabled()},o.prototype.getPcmaDisabled=function(){return this._getInternal().getPcmaDisabled()},o.prototype.setOpusDisabled=function(e){return this._getInternal().setOpusDisabled(e)},o.prototype.setG722Disabled=function(e){return this._getInternal().setG722Disabled(e)},o.prototype.setPcmuDisabled=function(e){return this._getInternal().setPcmuDisabled(e)},o.prototype.setPcmaDisabled=function(e){return this._getInternal().setPcmaDisabled(e)},o.prototype.addOnDiscardOutboundDtmfTones=function(e){!t.liveswitch.Plugin.useActiveX()&&t.liveswitch.Plugin.useNative()&&this._internal.addOnDiscardOutboundDtmfTones(e)},o.prototype.removeOnDiscardOutboundDtmfTones=function(e){!t.liveswitch.Plugin.useActiveX()&&t.liveswitch.Plugin.useNative()&&this._internal.removeOnDiscardOutboundDtmfTones(e)},o}(t.liveswitch.MediaStream);i.AudioStream=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(t){function i(e){var i=t.call(this)||this;return i.media=e,i}return e(i,t),i.prototype.getTypeString=function(){return"[fm.liveswitch.MediaTrack],"+t.prototype.getTypeString.call(this)},i.prototype.getMedia=function(){return this.media},i.prototype.addOnMuted=function(e){return this._getInternal().addOnMuted(e)},i.prototype.addOnUnmuted=function(e){return this._getInternal().addOnUnmuted(e)},i.prototype.addOnStarted=function(e){return this._getInternal().addOnStarted(e)},i.prototype.addOnStopped=function(e){return this._getInternal().addOnStopped(e)},i.prototype.addOnDestroyed=function(e){return this._getInternal().addOnDestroyed(e)},i.prototype.removeOnMuted=function(e){return this._getInternal().removeOnMuted(e)},i.prototype.removeOnUnmuted=function(e){return this._getInternal().removeOnUnmuted(e)},i.prototype.removeOnStarted=function(e){return this._getInternal().removeOnStarted(e)},i.prototype.removeOnStopped=function(e){return this._getInternal().removeOnStopped(e)},i.prototype.removeOnDestroyed=function(e){return this._getInternal().removeOnDestroyed(e)},i.prototype.changeSinkOutput=function(e){return this._getInternal().changeSinkOutput(e)},i.prototype.changeSourceInput=function(e){return this._getInternal().changeSourceInput(e)},i.prototype.destroy=function(){return this._getInternal().destroy()},i.prototype.getMuted=function(){return this._getInternal().getMuted()},i.prototype.getSinkOutput=function(){return this._getInternal().getSinkOutput()},i.prototype.getSinkOutputs=function(){return this._getInternal().getSinkOutputs()},i.prototype.getSourceInput=function(){return this._getInternal().getSourceInput()},i.prototype.getSourceInputs=function(){return this._getInternal().getSourceInputs()},i.prototype.setMuted=function(e){this._getInternal().setMuted(e)},i.prototype.setSinkOutput=function(e){this._getInternal().setSinkOutput(e)},i.prototype.setSourceInput=function(e){this._getInternal().setSourceInput(e)},i}(t.liveswitch.Dynamic);i.MediaTrack=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o){var n=i.call(this,e)||this;if(t.liveswitch.Util.isNullOrUndefined(e))throw new t.liveswitch.Exception("Media cannot be null.");if(t.liveswitch.Plugin.useActiveX())n._internal=new t.liveswitch.PluginAudioTrack(n,e._getInternal()||o);else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");n._internal=new t.liveswitch.WebRtcAudioTrack(n,e._getInternal()||o)}return n}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.AudioTrack],"+i.prototype.getTypeString.call(this)},o.prototype._getInternal=function(){return this._internal},o.prototype.addOnLevel=function(e){return this._internal.addOnLevel(e)},o.prototype.getGain=function(){return this._internal.getGain()},o.prototype.getLevelInterval=function(){return this._internal.getLevelInterval()},o.prototype.getVolume=function(){return this._internal.getVolume()},o.prototype.removeOnLevel=function(e){return this._internal.removeOnLevel(e)},o.prototype.setGain=function(e){this._internal.setGain(e)},o.prototype.setLevelInterval=function(e){this._internal.setLevelInterval(e)},o.prototype.setVolume=function(e){this._internal.setVolume(e)},o}(t.liveswitch.MediaTrack);i.AudioTrack=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){var e=i.call(this)||this;e._onGatheringStateChangeValues=[],e._onIceConnectionStateChangeValues=[],e._onLocalCandidateValues=[],e._onLocalDescriptionValues=[],e._onRemoteCandidateValues=[],e._onRemoteDescriptionValues=[],e._onSignallingStateChangeValues=[],e._onStateChangeValues=[],e._onExternalIdChangeValues=[];var o=null;if(0==arguments.length||arguments.length>=1&&t.liveswitch.Util.isNullOrUndefined(arguments[0]))throw new t.liveswitch.Exception("Stream(s) cannot be null.");if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.Stream]"))o=[arguments[0]];else if(arguments.length>=1&&t.liveswitch.Util.isArrayType(arguments[0],"[fm.liveswitch.Stream]"))o=arguments[0];else if(arguments.length>=1)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");for(var n=null,s=0,r=o;s=1&&t.liveswitch.Util.isNullOrUndefined(arguments[0]))throw new t.liveswitch.Exception("Data channels(s) cannot be null.");if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.DataChannel]"))o=[arguments[0]];else if(arguments.length>=1&&t.liveswitch.Util.isArrayType(arguments[0],"[fm.liveswitch.DataChannel]"))o=arguments[0];else if(arguments.length>=1)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");var n=t.liveswitch.ArrayExtensions.map(o,(function(e){return e._getInternal()}));if(t.liveswitch.Plugin.useActiveX())e._internal=new t.liveswitch.PluginDataStream(e,n);else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");e._internal=new t.liveswitch.WebRtcDataStream(e,n)}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.DataStream],"+i.prototype.getTypeString.call(this)},o.prototype._getInternal=function(){return this._internal},o.prototype.getInfo=function(){return this._getInternal().getInfo()},o.prototype.setGetRemoteConnectionInfo=function(e){if(t.liveswitch.Plugin.useActiveX()){var i=this._internal;i.setGetRemoteConnectionInfo(e)}else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");var o=this._internal;o.setGetRemoteConnectionInfo(e)}},o.prototype.getAllChannels=function(){return this.internalsToExternals(this._getInternal().getAllChannels())},o.prototype.getChannels=function(){return this.internalsToExternals(this._getInternal().getChannels())},o.prototype.externalToInternal=function(e){return e._getInternal()},o.prototype.externalsToInternals=function(e){return t.liveswitch.ArrayExtensions.map(e,(function(e){return e._getInternal()}))},o.prototype.internalToExternal=function(e){return e._getExternal()},o.prototype.internalsToExternals=function(e){return t.liveswitch.ArrayExtensions.map(e,(function(e){return e._getExternal()}))},o.prototype.addChannel=function(e){if(e.getIsInternal())for(var t=0,i=this._onInternalChannelValues;t=1;a--){var l=t.liveswitch.MathAssistant.ceil(o/a),c=e/a,h=i/l,p=c=n&&(n=p,s=a,r=l)}var d=t.liveswitch.MathAssistant.floor(e/s);return new t.liveswitch.LayoutTable(s,r,d,t.liveswitch.MathAssistant.floor(i/r))}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.divideByTwo=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),t.liveswitch.MathAssistant.floor(e/2);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getFacetime=function(){if(0==arguments.length){var e=new t.liveswitch.LayoutPreset;return e.setMode(t.liveswitch.LayoutMode.FloatLocal),e.setAlignment(t.liveswitch.LayoutAlignment.BottomRight),e.setFloatMarginX(10),e.setFloatMarginY(10),e.setFloatWidthPercent(.25),e.setFloatHeightPercent(.25),e.setInlineMargin(0),e}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getGoogleHangouts=function(){if(0==arguments.length){if(t.liveswitch.Platform.getInstance().getIsMobile()){var e=new t.liveswitch.LayoutPreset;return e.setMode(t.liveswitch.LayoutMode.FloatRemote),e.setAlignment(t.liveswitch.LayoutAlignment.BottomRight),e.setFloatMarginX(0),e.setFloatMarginY(10),e.setFloatWidthPercent(.25),e.setFloatHeightPercent(.25),e.setInlineMargin(5),e}var i=new t.liveswitch.LayoutPreset;return i.setMode(t.liveswitch.LayoutMode.Block),i.setAlignment(t.liveswitch.LayoutAlignment.Top),i.setBlockWidthPercent(.666666666666667),i.setBlockHeightPercent(.666666666666667),i.setInlineMargin(0),i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getSingleLayout=function(e,i,o){if(3==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]);var n=new t.liveswitch.Layout;return n.setLocalFrame(o?new t.liveswitch.LayoutFrame(0,0,e,i):null),n}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getSkype=function(){if(0==arguments.length){if(t.liveswitch.Platform.getInstance().getIsMobile())return t.liveswitch.LayoutPreset.getFacetime();var e=new t.liveswitch.LayoutPreset;return e.setMode(t.liveswitch.LayoutMode.Block),e.setDirection(t.liveswitch.LayoutDirection.Horizontal),e.setAlignment(t.liveswitch.LayoutAlignment.Bottom),e.setBlockMarginX(10),e.setBlockMarginY(10),e.setBlockWidthPercent(.333333333333333),e.setBlockHeightPercent(.333333333333333),e.setInlineMargin(10),e}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getXMax=function(e){if(1==arguments.length){if(t.liveswitch.Global.equals(e.length,0))return e[0].getX();for(var i=e[0].getX(),o=1;oi&&(i=n.getX())}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getXMid=function(e){if(1==arguments.length){var i=t.liveswitch.LayoutPreset.getXMin(e),o=t.liveswitch.LayoutPreset.getXMax(e);if(t.liveswitch.Global.equals(i,o))return i;for(var n=t.liveswitch.LayoutPreset.divideByTwo(i+o),s=e[0].getX(),r=t.liveswitch.MathAssistant.abs(n-s),a=1;ai&&(i=n.getY())}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getYMid=function(e){if(1==arguments.length){var i=t.liveswitch.LayoutPreset.getYMin(e),o=t.liveswitch.LayoutPreset.getYMax(e);if(t.liveswitch.Global.equals(i,o))return i;for(var n=t.liveswitch.LayoutPreset.divideByTwo(i+o),s=e[0].getY(),r=t.liveswitch.MathAssistant.abs(n-s),a=1;a0&&this.setFloatWidth(e.getFloatWidth()),e.getFloatHeight()>0&&this.setFloatHeight(e.getFloatHeight()),e.getFloatMarginX()>0&&this.setFloatMarginX(e.getFloatMarginX()),e.getFloatMarginY()>0&&this.setFloatMarginY(e.getFloatMarginY()),e.getFloatWidthPercent()>0&&this.setFloatWidthPercent(e.getFloatWidthPercent()),e.getFloatHeightPercent()>0&&this.setFloatHeightPercent(e.getFloatHeightPercent()),e.getFloatMarginXPercent()>0&&this.setFloatMarginXPercent(e.getFloatMarginXPercent()),e.getFloatMarginYPercent()>0&&this.setFloatMarginYPercent(e.getFloatMarginYPercent()),e.getBlockWidth()>0&&this.setBlockWidth(e.getBlockWidth()),e.getBlockHeight()>0&&this.setBlockHeight(e.getBlockHeight()),e.getBlockMarginX()>0&&this.setBlockMarginX(e.getBlockMarginX()),e.getBlockMarginY()>0&&this.setBlockMarginY(e.getBlockMarginY()),e.getBlockWidthPercent()>0&&this.setBlockWidthPercent(e.getBlockWidthPercent()),e.getBlockHeightPercent()>0&&this.setBlockHeightPercent(e.getBlockHeightPercent()),e.getBlockMarginXPercent()>0&&this.setBlockMarginXPercent(e.getBlockMarginXPercent()),e.getBlockMarginYPercent()>0&&this.setBlockMarginYPercent(e.getBlockMarginYPercent()),e.getInlineMargin()>0&&this.setInlineMargin(e.getInlineMargin())},o.prototype.calculateBlockFrame=function(e,i,o,n){if(4==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]),t.liveswitch.Global.equals(this.getBlockWidth(),0)&&t.liveswitch.Global.equals(this.getBlockWidthPercent(),0)&&this.setBlockWidthPercent(.25),t.liveswitch.Global.equals(this.getBlockHeight(),0)&&t.liveswitch.Global.equals(this.getBlockHeightPercent(),0)&&this.setBlockHeightPercent(.25);var s=this.getBlockWidth()>0?this.getBlockWidth():e*this.getBlockWidthPercent(),r=this.getBlockHeight()>0?this.getBlockHeight():i*this.getBlockHeightPercent();o.setValue(this.getBlockMarginX()>0?this.getBlockMarginX():e*this.getBlockMarginXPercent()),n.setValue(this.getBlockMarginY()>0?this.getBlockMarginY():i*this.getBlockMarginYPercent());var a=0,l=this.getAlignment();do{if(l==t.liveswitch.LayoutAlignment.Top||l==t.liveswitch.LayoutAlignment.Center||l==t.liveswitch.LayoutAlignment.Bottom){a=t.liveswitch.LayoutPreset.divideByTwo(e-s);break}if(l==t.liveswitch.LayoutAlignment.TopRight||l==t.liveswitch.LayoutAlignment.Right||l==t.liveswitch.LayoutAlignment.BottomRight){a=e-s;break}a=0;break}while(0);var c=0,h=this.getAlignment();do{if(h==t.liveswitch.LayoutAlignment.Left||h==t.liveswitch.LayoutAlignment.Center||h==t.liveswitch.LayoutAlignment.Right){c=t.liveswitch.LayoutPreset.divideByTwo(i-r);break}if(h==t.liveswitch.LayoutAlignment.BottomLeft||h==t.liveswitch.LayoutAlignment.Bottom||h==t.liveswitch.LayoutAlignment.BottomRight){c=i-r;break}c=0;break}while(0);return new t.liveswitch.LayoutFrame(a,c,s,r)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.calculateFillFrame=function(e,i){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]),new t.liveswitch.LayoutFrame(0,0,e,i);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.calculateFloatFrame=function(e,i){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]),this.calculateFloatFrames(e,i,1)[0];throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.calculateFloatFrames=function(e,i,o){if(3==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]),o=t.liveswitch.Global.toInt(arguments[2]),t.liveswitch.Global.equals(this.getFloatWidth(),0)&&t.liveswitch.Global.equals(this.getFloatWidthPercent(),0)&&this.setFloatWidthPercent(.25),t.liveswitch.Global.equals(this.getFloatHeight(),0)&&t.liveswitch.Global.equals(this.getFloatHeightPercent(),0)&&this.setFloatHeightPercent(.25);var n=this.getFloatWidth()>0?this.getFloatWidth():e*this.getFloatWidthPercent(),s=this.getFloatHeight()>0?this.getFloatHeight():i*this.getFloatHeightPercent(),r=this.getFloatMarginX()>0?this.getFloatMarginX():e*this.getFloatMarginXPercent(),a=this.getFloatMarginY()>0?this.getFloatMarginY():i*this.getFloatMarginYPercent();t.liveswitch.Global.equals(this.getDirection(),t.liveswitch.LayoutDirection.Horizontal)?n=t.liveswitch.MathAssistant.min(e,n*o):s=t.liveswitch.MathAssistant.min(i,s*o);var l=this.calculateInlineFrames(n,s,o,0,0),c=this.getAlignment();do{if(c==t.liveswitch.LayoutAlignment.TopLeft||c==t.liveswitch.LayoutAlignment.Top||c==t.liveswitch.LayoutAlignment.TopRight){for(var h=0,p=l;h1)d=p-E,w=a-E,t.liveswitch.ArrayExtensions.addRange(m,this.calculateInlineFrames(n+e,s+i-w,M,d,w));else{u=e-M*S+this.getInlineMargin(),v=0;while(v1)d=p-E,w=a-E,t.liveswitch.ArrayExtensions.addRange(m,this.calculateInlineFrames(n+e-d,s+i,C,d,w));else{l=i-C*_+this.getInlineMargin(),c=0;while(c0&&e.setFloatWidth(this.getFloatWidth()),this.getFloatHeight()>0&&e.setFloatHeight(this.getFloatHeight()),this.getFloatMarginX()>0&&e.setFloatMarginX(this.getFloatMarginX()),this.getFloatMarginY()>0&&e.setFloatMarginY(this.getFloatMarginY()),this.getFloatWidthPercent()>0&&e.setFloatWidthPercent(this.getFloatWidthPercent()),this.getFloatHeightPercent()>0&&e.setFloatHeightPercent(this.getFloatHeightPercent()),this.getFloatMarginXPercent()>0&&e.setFloatMarginXPercent(this.getFloatMarginXPercent()),this.getFloatMarginYPercent()>0&&e.setFloatMarginYPercent(this.getFloatMarginYPercent()),this.getBlockWidth()>0&&e.setBlockWidth(this.getBlockWidth()),this.getBlockHeight()>0&&e.setBlockHeight(this.getBlockHeight()),this.getBlockMarginX()>0&&e.setBlockMarginX(this.getBlockMarginX()),this.getBlockMarginY()>0&&e.setBlockMarginY(this.getBlockMarginY()),this.getBlockWidthPercent()>0&&e.setBlockWidthPercent(this.getBlockWidthPercent()),this.getBlockHeightPercent()>0&&e.setBlockHeightPercent(this.getBlockHeightPercent()),this.getBlockMarginXPercent()>0&&e.setBlockMarginXPercent(this.getBlockMarginXPercent()),this.getBlockMarginYPercent()>0&&e.setBlockMarginYPercent(this.getBlockMarginYPercent()),this.getInlineMargin()>0&&e.setInlineMargin(this.getInlineMargin())},o.prototype.getAlignment=function(){if(0==arguments.length)return this._alignment;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockHeight=function(){if(0==arguments.length)return this.__blockHeight;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockHeightPercent=function(){if(0==arguments.length)return this.__blockHeightPercent;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockLayout=function(e,i,o,n,s){if(5==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]),i=t.liveswitch.Global.toInt(arguments[1]),n=t.liveswitch.Global.toInt(arguments[3]);var r=void 0,a=void 0,l=0,c=0,h=new t.liveswitch.Holder(l),p=new t.liveswitch.Holder(c),d=this.calculateBlockFrame(e,i,h,p);l=h.getValue(),c=p.getValue();var w=o?d:null,u=new Array;if(t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.Center)){var v=t.liveswitch.LayoutPreset.divideByTwo(n),f=n-v,g=0,m=0;t.liveswitch.Global.equals(this.getDirection(),t.liveswitch.LayoutDirection.Vertical)?(r=t.liveswitch.Global.equals(w,null)?0:w.getWidth()+l+l,e=t.liveswitch.LayoutPreset.divideByTwo(e-r),g=e+r):(a=t.liveswitch.Global.equals(w,null)?0:w.getHeight()+c+c,i=t.liveswitch.LayoutPreset.divideByTwo(i-a),m=i+a),v>0&&t.liveswitch.ArrayExtensions.addRange(u,this.calculateInlineFrames(e,i,v,0,0)),f>0&&t.liveswitch.ArrayExtensions.addRange(u,this.calculateInlineFrames(e,i,f,g,m))}else{var y=0,b=0;r=t.liveswitch.Global.equals(w,null)?0:w.getWidth()+l,a=t.liveswitch.Global.equals(w,null)?0:w.getHeight()+c,t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.Top)?(b=a,i-=a):t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.Bottom)?i-=a:t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.Left)?(y=r,e-=r):t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.Right)?e-=r:t.liveswitch.Global.equals(this.getDirection(),t.liveswitch.LayoutDirection.Vertical)?((t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.TopLeft)||t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.BottomLeft))&&(y=r),e-=r):((t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.TopLeft)||t.liveswitch.Global.equals(this.getAlignment(),t.liveswitch.LayoutAlignment.TopRight))&&(b=a),i-=a),t.liveswitch.ArrayExtensions.addRange(u,this.calculateInlineFrames(e,i,n,y,b))}var x=new t.liveswitch.Layout;return x.setOrigin(s),x.setWidth(e),x.setHeight(i),x.setLocalFrame(w),x.setRemoteFrames(t.liveswitch.ArrayExtensions.toArray(u)),x}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockMarginX=function(){if(0==arguments.length)return this.__blockMarginX;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockMarginXPercent=function(){if(0==arguments.length)return this.__blockMarginXPercent;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockMarginY=function(){if(0==arguments.length)return this.__blockMarginY;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockMarginYPercent=function(){if(0==arguments.length)return this.__blockMarginYPercent;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockWidth=function(){if(0==arguments.length)return this.__blockWidth;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBlockWidthPercent=function(){if(0==arguments.length)return this.__blockWidthPercent;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBottomRowIndexes=function(e){if(1==arguments.length){var i=void 0,o=t.liveswitch.LayoutPreset.getYMax(e),n=0;for(i=0;i1&&(e=1),this.__blockHeightPercent=e,this.__blockHeight=t.liveswitch.Global.toInt(0)},o.prototype.setBlockMarginX=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__blockMarginX=t.liveswitch.Global.toInt(e),this.__blockMarginXPercent=0},o.prototype.setBlockMarginXPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__blockMarginXPercent=e,this.__blockMarginX=t.liveswitch.Global.toInt(0)},o.prototype.setBlockMarginY=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__blockMarginY=t.liveswitch.Global.toInt(e),this.__blockMarginYPercent=0},o.prototype.setBlockMarginYPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__blockMarginYPercent=e,this.__blockMarginY=t.liveswitch.Global.toInt(0)},o.prototype.setBlockWidth=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__blockWidth=t.liveswitch.Global.toInt(e),this.__blockWidthPercent=0},o.prototype.setBlockWidthPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__blockWidthPercent=e,this.__blockWidth=t.liveswitch.Global.toInt(0)},o.prototype.setDirection=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._direction=e},o.prototype.setFloatHeight=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__floatHeight=t.liveswitch.Global.toInt(e),this.__floatHeightPercent=0},o.prototype.setFloatHeightPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__floatHeightPercent=e,this.__floatHeight=t.liveswitch.Global.toInt(0)},o.prototype.setFloatMarginX=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__floatMarginX=t.liveswitch.Global.toInt(e),this.__floatMarginXPercent=0},o.prototype.setFloatMarginXPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__floatMarginXPercent=e,this.__floatMarginX=t.liveswitch.Global.toInt(0)},o.prototype.setFloatMarginY=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__floatMarginY=t.liveswitch.Global.toInt(e),this.__floatMarginYPercent=0},o.prototype.setFloatMarginYPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__floatMarginYPercent=e,this.__floatMarginY=t.liveswitch.Global.toInt(0)},o.prototype.setFloatWidth=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.__floatWidth=t.liveswitch.Global.toInt(e),this.__floatWidthPercent=0},o.prototype.setFloatWidthPercent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e<0&&(e=0),e>1&&(e=1),this.__floatWidthPercent=e,this.__floatWidth=t.liveswitch.Global.toInt(0)},o.prototype.setInlineMargin=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._inlineMargin=t.liveswitch.Global.toInt(e)},o.prototype.setMode=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._mode=e},o}(t.liveswitch.Dynamic);i.LayoutPreset=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n OnLayout")}return c}if(3==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),s=t.liveswitch.Global.toInt(arguments[2]);return this.getLayout(e,o,!0,s,null,null,null)}if(4==arguments.length&&(t.liveswitch.Util.isNullOrUndefined(arguments[2])||t.liveswitch.Util.isNumber(arguments[2]))&&(t.liveswitch.Util.isNullOrUndefined(arguments[3])||t.liveswitch.Util.isArray(arguments[3])&&(0==arguments[3].length||t.liveswitch.Util.isNullOrUndefined(arguments[3][0])||t.liveswitch.Util.isString(arguments[3][0])))){e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),s=t.liveswitch.Global.toInt(arguments[2]),r=arguments[3];return this.getLayout(e,o,!0,s,r,null,null)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getLayoutOrigin=function(){if(0==arguments.length)return this._layoutOrigin;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getLocalView=function(){if(0==arguments.length)return this.doGetLocalView();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getNewestRemoteView=function(e){if(1==arguments.length){var i=this.getRemoteViewsInternal(e);return t.liveswitch.Global.equals(i,null)?null:i[0]}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getOldestRemoteView=function(e){if(1==arguments.length){var i=this.getRemoteViewsInternal(e);return t.liveswitch.Global.equals(i,null)?null:i[t.liveswitch.ArrayExtensions.getCount(i)-1]}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRemoteView=function(e){if(1==arguments.length)return t.liveswitch.Global.equals(e,null)?null:this.getNewestRemoteView(e);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRemoteViewIds=function(){if(0==arguments.length)return this.doGetRemoteViewsIds();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRemoteViews=function(){if(0==arguments.length)return this.getRemoteViews(this.getRemoteViewIds());if(1==arguments.length){var e=arguments[0];if(t.liveswitch.Global.equals(e,null))throw new t.liveswitch.Exception("Could not get remote views. The IDs cannot be null.");for(var i=new Array,o=0,n=e;oe._parentMissingMax&&window.clearInterval(e._resizeInterval)}),250))},o.prototype.destroyInnerContainer=function(){for(var e=0,t=this.collectionToArray(this._container.getElementsByTagName("div"));ep&&(d-=this.getHorizontalScrollbarHeight(),w=this.getLayout(p,d,null!=i,n.length,o,s,r),v=!0):w.getHeight()>d&&(p-=this.getVerticalScrollbarWidth(),w=this.getLayout(p,d,null!=i,n.length,o,s,r),u=!0)),null!=i){var f=w.getLocalFrame();i.style.position="absolute",i.style.left=f.getX()+"px",i.style.top=f.getY()+"px",i.style.width=f.getWidth()+"px",i.style.height=f.getHeight()+"px",this.getMode()==t.liveswitch.LayoutMode.FloatLocal?i.style.zIndex=n.length.toString():this.getMode()==t.liveswitch.LayoutMode.FloatRemote&&(i.style.zIndex="0")}var g=w.getRemoteFrames();for(l=0;l-1?e.liveswitch.AddressType.IPv6:e.liveswitch.AddressType.IPv4},t}();t.LocalNetwork=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;ithis._pluginConfig.getActiveXTimeout()?t.reject(new e.liveswitch.Exception("ActiveX install timed out.")):window.setTimeout((function(){n.checkForActiveX(t,i,o)}),10)},t.getChromeExtensionId=function(){return e.liveswitch.WebRtcLocalMedia.getChromeExtensionId()},t.setChromeExtensionId=function(t){e.liveswitch.WebRtcLocalMedia.setChromeExtensionId(t)},t.getChromeExtensionUrl=function(){return e.liveswitch.WebRtcLocalMedia.getChromeExtensionUrl()},t.getChromeExtensionInstalled=function(){return e.liveswitch.WebRtcLocalMedia.getChromeExtensionInstalled()},t.getChromeExtensionRequiresUserGesture=function(){return e.liveswitch.WebRtcLocalMedia.getChromeExtensionRequiresUserGesture()},t.setChromeExtensionRequiresUserGesture=function(t){e.liveswitch.WebRtcLocalMedia.setChromeExtensionRequiresUserGesture(t)},t.getChromeExtensionRequired=function(){return e.liveswitch.WebRtcLocalMedia.getChromeExtensionRequired()},t._hasActiveX=!1,t}();t.Plugin=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.getTypeString=function(){return"[fm.liveswitch.PluginStream],"+t.prototype.getTypeString.call(this)},i}(t.liveswitch.Dynamic);i.PluginStream=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(t){function i(e,i){var o=t.call(this)||this;return o._localTrack=e,o._remoteTrack=i,o}return e(i,t),i.prototype.getTypeString=function(){return"[fm.liveswitch.PluginMediaStream],"+t.prototype.getTypeString.call(this)},i.prototype.restrictBitrate=function(e){},i.prototype.getLocalTrack=function(){return this._localTrack},i.prototype.getRemoteTrack=function(){return this._remoteTrack},i}(t.liveswitch.PluginStream);i.PluginMediaStream=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i0&&e.liveswitch.ArrayExtensions.add(n,new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getEmptyValue(),o));var r=e.liveswitch.StringExtensions.substring(t,s,1);e.liveswitch.Global.equals(r,e.liveswitch.dtmf.Tone.getPauseValue())?e.liveswitch.ArrayExtensions.add(n,new e.liveswitch.dtmf.Tone(r,2e3)):e.liveswitch.ArrayExtensions.add(n,new e.liveswitch.dtmf.Tone(r,i))}return e.liveswitch.ArrayExtensions.toArray(n)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getA=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getAValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getAValue=function(){if(0==arguments.length)return"A";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getB=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getBValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getBValue=function(){if(0==arguments.length)return"B";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getC=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getCValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getCValue=function(){if(0==arguments.length)return"C";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getD=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getDValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getDValue=function(){if(0==arguments.length)return"D";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getEight=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getEightValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getEightValue=function(){if(0==arguments.length)return"8";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getEmpty=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getEmptyValue(),0);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getEmptyValue=function(){if(0==arguments.length)return"";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getFive=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getFiveValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getFiveValue=function(){if(0==arguments.length)return"5";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getFour=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getFourValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getFourValue=function(){if(0==arguments.length)return"4";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getHash=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getHashValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getHashValue=function(){if(0==arguments.length)return"#";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getNine=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getNineValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getNineValue=function(){if(0==arguments.length)return"9";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getOne=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getOneValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getOneValue=function(){if(0==arguments.length)return"1";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getPause=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getPauseValue(),2e3);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getPauseDuration=function(){if(0==arguments.length)return 2e3;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getPauseValue=function(){if(0==arguments.length)return",";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getSeven=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getSevenValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getSevenValue=function(){if(0==arguments.length)return"7";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getSix=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getSixValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getSixValue=function(){if(0==arguments.length)return"6";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getStar=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getStarValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getStarValue=function(){if(0==arguments.length)return"*";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getThree=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getThreeValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getThreeValue=function(){if(0==arguments.length)return"3";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getTwo=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getTwoValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getTwoValue=function(){if(0==arguments.length)return"2";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getZero=function(){if(0==arguments.length)return new e.liveswitch.dtmf.Tone(e.liveswitch.dtmf.Tone.getZeroValue(),100);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getZeroValue=function(){if(0==arguments.length)return"0";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJson=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObject(t,(function(t,i){i["value"]=e.liveswitch.JsonSerializer.serializeString(t.getValue()),i["duration"]=e.liveswitch.JsonSerializer.serializeInteger(t.getDuration()),i["end"]=e.liveswitch.JsonSerializer.serializeBoolean(t.getEnd())}));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJsonArray=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObjectArray(t,e.liveswitch.dtmf.Tone.toJson.bind(e.liveswitch.dtmf.Tone));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toToneString=function(t){if(1==arguments.length){for(var i=new e.liveswitch.StringBuilder,o=0,n=t;o=1&&t.liveswitch.Util.isNullOrUndefined(arguments[0]));else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.VideoTrack]"))o=arguments[0];else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.LocalMedia]"))n=arguments[0],o=n.getVideoTrack();else if(arguments.length>=1&&t.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.RemoteMedia]"))r=arguments[0],s=r.getVideoTrack();else if(arguments.length>=1)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");if(arguments.length>=2&&t.liveswitch.Util.isNullOrUndefined(arguments[1]));else if(arguments.length>=2&&t.liveswitch.Util.isObjectType(arguments[1],"[fm.liveswitch.VideoTrack]"))s=arguments[1];else if(arguments.length>=2&&t.liveswitch.Util.isObjectType(arguments[1],"[fm.liveswitch.RemoteMedia]"))r=arguments[1],s=r.getVideoTrack();else if(arguments.length>=2)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");if(e=i.call(this,o,s)||this,e.localMedia=n,e.remoteMedia=r,t.liveswitch.Plugin.useActiveX())e._internal=new t.liveswitch.PluginVideoStream(e,null==o?null:o._getInternal(),null==s?null:s._getInternal());else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");e._internal=new t.liveswitch.WebRtcVideoStream(e,null==o?null:o._getInternal(),null==s?null:s._getInternal())}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.VideoStream],"+i.prototype.getTypeString.call(this)},o.prototype._getInternal=function(){return this._internal},o.prototype.getLocalMedia=function(){return this.localMedia},o.prototype.getRemoteMedia=function(){return this.remoteMedia},o.prototype.getVp8Disabled=function(){return this._getInternal().getVp8Disabled()},o.prototype.getVp9Disabled=function(){return this._getInternal().getVp9Disabled()},o.prototype.getH264Disabled=function(){return this._getInternal().getH264Disabled()},o.prototype.getH265Disabled=function(){return this._getInternal().getH265Disabled()},o.prototype.setVp8Disabled=function(e){return this._getInternal().setVp8Disabled(e)},o.prototype.setVp9Disabled=function(e){return this._getInternal().setVp9Disabled(e)},o.prototype.setH264Disabled=function(e){return this._getInternal().setH264Disabled(e)},o.prototype.setH265Disabled=function(e){return this._getInternal().setH265Disabled(e)},o.prototype.addOnDiscardKeyFrameRequest=function(e){this._getInternal().addOnDiscardKeyFrameRequest(e)},o.prototype.removeOnDiscardKeyFrameRequest=function(e){this._getInternal().removeOnDiscardKeyFrameRequest(e)},o.prototype.raiseKeyFrameRequest=function(e){this._getInternal().raiseKeyFrameRequest(e)},o.prototype.generateMediaIntent=function(){if(0==arguments.length){var e=new t.liveswitch.Promise;this._mediaIntentPromise=e;var i=new t.liveswitch.VideoIntent,o=this.getLocalDirection();o!=t.liveswitch.StreamDirection.Unset&&i.setLocalDirection(o);var n=this.getLocalMedia();if(null!=n){var s=n.getVideoFrameRate();s>0&&i.setFrameRate(s);var r=n.getVideoType();r!=t.liveswitch.VideoType.Unknown&&i.setVideoType(r),this.obtainVideoSize(5,n,i)}else e.resolve(i);return e}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.obtainVideoSize=function(e,t,i){var o=this,n=t.getVideoSize();n.getHeight()>0&&n.getWidth()>0?(i.setResolution(n),this._mediaIntentPromise.resolve(i)):e>0?setTimeout((function(){return o.obtainVideoSize(--e,t,i)}),1e3):this._mediaIntentPromise.resolve(i)},o.prototype.restrict=function(e){var t=e,i=this.getLocalMedia();null!=i&&(i.restrict(t),this._getInternal().restrictBitrate(t.getBitrate()))},o}(t.liveswitch.MediaStream);i.VideoStream=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o){var n=i.call(this,e)||this;if(t.liveswitch.Util.isNullOrUndefined(e))throw new t.liveswitch.Exception("Media cannot be null.");if(t.liveswitch.Plugin.useActiveX())n._internal=new t.liveswitch.PluginVideoTrack(n,e._getInternal()||o);else{if(!t.liveswitch.Plugin.useNative())throw new t.liveswitch.Exception("Browser does not support WebRTC/ORTC and no plugin found.");n._internal=new t.liveswitch.WebRtcVideoTrack(n,e._getInternal()||o)}return n}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.VideoTrack],"+i.prototype.getTypeString.call(this)},o.prototype._getInternal=function(){return this._internal},o.prototype.addOnSize=function(e){return this._internal.addOnSize(e)},o.prototype.addOnSizeChange=function(e){return this._internal.addOnSizeChange(e)},o.prototype.getSize=function(){return this._internal.getSize()},o.prototype.grabFrame=function(){return this._internal.grabFrame()},o.prototype.removeOnSize=function(e){return this._internal.removeOnSize(e)},o.prototype.removeOnSizeChange=function(e){return this._internal.removeOnSizeChange(e)},o}(t.liveswitch.MediaTrack);i.VideoTrack=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e){for(var o=this,n=new Array(arguments.length),s=0;si&&(e=t.liveswitch.Global.toInt(i)),e<0&&(e=t.liveswitch.Global.toInt(-1)),this.__maxReceiveBitrate=t.liveswitch.Global.toInt(e)},o.prototype.setMaxSendBitrate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]);var i=t.liveswitch.Global.toInt(this.getRemoteBandwidth());!t.liveswitch.Global.equals(i,-1)&&e>i&&(e=t.liveswitch.Global.toInt(i)),e<0&&(e=t.liveswitch.Global.toInt(-1)),this.__maxSendBitrate=t.liveswitch.Global.toInt(e)},o.prototype.setMuted=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.setInputMuted(e)},o.prototype.setOutputContent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._outputContent=e},o.prototype.setPendingLocalDirection=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__pendingLocalDirection=e},o.prototype.setPreferredCodecs=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._preferredCodecs=e},o.prototype.setRelatedMediaDescription=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._relatedMediaDescription=e},o.prototype.setRemoteBandwidth=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._remoteBandwidth=t.liveswitch.Global.toInt(e)},o.prototype.setRemoteCanonicalName=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._remoteCanonicalName=e},o.prototype.setRemoteDirection=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=this.getDirection();this.__remoteDirection=e,t.liveswitch.Global.equals(o,this.getDirection())||i.prototype.raiseDirectionChange.call(this)},o.prototype.setRemoteEncoding=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._remoteEncoding=e},o.prototype.setRemoteMuted=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._remoteMuted=e},o.prototype.setRemoteRequestedDeactivation=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._remoteRequestedDeactivation=e},o.prototype.setRenegotiationPending=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._renegotiationPending=e},o.prototype.updateMediaIntent=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.setLocalDirection(this.getLocalDirection())},o}(t.liveswitch.WebRtcStream);i.WebRtcMediaStreamBase=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o,n,s){var r=i.call(this,s)||this;return r._onDiscardBitrateRequestValues=[],r._onDiscardBitrateNotificationValues=[],r._deactivatedByServer=null,r._maxVideoSize=new t.liveswitch.Size,r._sender=null,r._receiver=null,r._singleSendBitrate=-1,r._sendEncodings=null,r._receiveEncodings=null,r._simulcastMode=t.liveswitch.SimulcastMode.Disabled,r._maxSendBitrateRequestQueue=[],r._maxReceiveBitrateRequestQueue=[],r._cachedSignalledDirection=t.liveswitch.StreamDirection.Inactive,r._remoteRequestsMaxSendBitrate=-1,r._restrictedBitrate=-1,null==o?r.setLocalDirection(t.liveswitch.StreamDirection.ReceiveOnly):r.setLocalDirection(t.liveswitch.StreamDirection.SendReceive),r.setRemoteDirection(t.liveswitch.StreamDirection.SendReceive),r.setLocalTrack(o),r.setRemoteTrack(n),o&&o.addOutput(r),n&&n.addInput(r),r.addOnStateChange((function(){r.getState()==t.liveswitch.StreamState.Closed||r.getState()==t.liveswitch.StreamState.Failed?(o&&o.removeOutput(r),n&&n.removeInput(r)):r.getState()==t.liveswitch.StreamState.Connected&&r._restrictedBitrate>0&&r.setMaxSendBitrate(r._restrictedBitrate)})),r}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.WebRtcMediaStream],"+i.prototype.getTypeString.call(this)},o.prototype.setConnection=function(e){i.prototype.setConnection.call(this,e),this.processNextMaxSendBitrate(),this.processNextMaxReceiveBitrateRequest()},o.prototype.getLocalTrack=function(){return this._localTrack},o.prototype.setLocalTrack=function(e){this._localTrack=e},o.prototype.getRemoteTrack=function(){return this._remoteTrack},o.prototype.setRemoteTrack=function(e){this._remoteTrack=e},o.prototype.setInputMuted=function(e){this._localTrack&&this._localTrack.setMuted(e)},o.prototype.getInputMuted=function(){return!!this._localTrack&&this._localTrack.getMuted()},o.prototype.setOutputMuted=function(e){this._remoteTrack&&this._remoteTrack.setMuted(e)},o.prototype.getOutputMuted=function(){return!!this._remoteTrack&&this._remoteTrack.getMuted()},o.prototype.setMaxWidthAndHeight=function(e,t){if(e>0&&t>0){if(e0)if(r.length<=o.length){for(var a=0;a0&&(e.maxBitrate=1e3*r),this.getType()==t.liveswitch.StreamType.Video){var a=i,l=a.getFrameRate();l>0&&(e.maxFramerate=l);var c=a.getScale();c>0&&(e.scaleResolutionDownBy=1/c)}return s!=n},o.prototype.updateEncodingInfo=function(e,i,o){if(e.setDeactivated(i.getDeactivated()),e.setBitrate(i.getBitrate()),e.setRtpStreamId(i.getRtpStreamId()),e.setSynchronizationSource(i.getSynchronizationSource()),this.getType()==t.liveswitch.StreamType.Video){var n=i;e.setFrameRate(n.getFrameRate()),e.setScale(n.getScale());var s=this.getSourceEncoding();if(s){var r=s.getSize();if(r){var a=r.getWidth(),l=r.getHeight();a>0&&l>0&&e.setSize(new t.liveswitch.Size(r.getWidth(),r.getHeight()))}var c=s.getFrameRate();c>0&&e.setFrameRate(c)}}},o.prototype.getNativeTrack=function(e){var t=e?this._localTrack:this._remoteTrack;if(t){var i=t._getMediaStreamTrack();if(i)return i}if(e){var o=this._sender;if(o){i=o.track;if(i)return i}}else{var n=this._receiver;if(n){i=n.track;if(i)return i}}return null},o.prototype.getSourceEncoding=function(){var e=new t.liveswitch.EncodingInfo;if(this.getType()==t.liveswitch.StreamType.Video){var o=this.getNativeTrack(!0);if(o&&o.getSettings){var n=o.getSettings();n&&(n.width>0&&n.height>0&&e.setSize(new t.liveswitch.Size(n.width,n.height)),n.frameRate>0&&e.setFrameRate(n.frameRate))}var s=i.prototype.getMaxSendBitrate.call(this);s>0&&e.setBitrate(s)}return e},o.prototype.replaceLocalTrack=function(e){var i=this.getConnection();return i?i.replaceLocalTrack(e,this):t.liveswitch.Promise.rejectNow(new t.liveswitch.Exception("Not connected."))},o.prototype.replaceRemoteTrack=function(e){var i=this.getConnection();return i?i.replaceRemoteTrack(e,this):t.liveswitch.Promise.rejectNow(new t.liveswitch.Exception("Not connected."))},o.prototype.processCachedChanges=function(){if(this.getRenegotiationPending()){var e=this.getPendingLocalDirection();this.setLocalDirection(e)}},o.prototype.resetRemoteDirection=function(){this.setRemoteDirection(t.liveswitch.StreamDirection.SendReceive)},o.prototype.processSdpMediaDescription=function(e,o,n,s,r,a){var l=i.prototype.processSdpMediaDescription.call(this,e,o,n,s,r,a);if(null!=l)return l;var c=o.getContentAttribute();null!=c&&this.processSdpContentAttribute(c,s);var h=this.getMediaDescriptionManager(),p=new t.liveswitch.MediaDescriptionRequirements,d=h.processSdpMediaDescription(p,e,n,s,a,r);if(null!=d)return d;if(s?this.setLocalMuted(h.localMuted):this.setRemoteMuted(h.remoteMuted),!s)for(var w=0,u=o.getMediaAttributes();w0&&e){var t=this._maxSendBitrateRequestQueue[0];this._maxSendBitrateRequestQueue.splice(0,1),this.doSetMaxSendBitrate(t.bitrate,t.promise)}},o.prototype.doSetMaxSendBitrate=function(e,t){var i=this,o=this.getConnection();o&&o.setMaxSendBitrate(e,this.getType()).then((function(e){i.applySendEncodings(),t.resolve(e),i.processNextMaxSendBitrate()}),(function(e){t.reject(e),i.processNextMaxSendBitrate()}))},o.prototype.setMaxReceiveBitrate=function(e){i.prototype.setMaxReceiveBitrate.call(this,e);var o=new t.liveswitch.BitrateRequest;o.setBitrate(i.prototype.getMaxReceiveBitrate.call(this));var n=this.getConnection();n?this.doSetMaxReceiveBitrate(o):this._maxReceiveBitrateRequestQueue.push(o)},o.prototype.processNextMaxReceiveBitrateRequest=function(){var e=this.getConnection();if(this._maxReceiveBitrateRequestQueue.length>0&&e){var t=this._maxReceiveBitrateRequestQueue[0];this._maxReceiveBitrateRequestQueue.splice(0,1),this.doSetMaxReceiveBitrate(t)}},o.prototype.doSetMaxReceiveBitrate=function(e){var t=this,i=this.getConnection();i&&i.getConnected().then((function(){t.processBitrateRequest(e),t.processNextMaxReceiveBitrateRequest()})).fail((function(){t.processNextMaxReceiveBitrateRequest()}))},o.prototype.getCachedSignalledDirection=function(){return this._cachedSignalledDirection},o.prototype.setCachedSignalledDirection=function(e){this._cachedSignalledDirection=e},o.prototype.syncStreamBitrateWithRemoteMediaDescription=function(e){var t=e.getBandwidths().filter((function(e){return"TIAS"===e.getBandwidthType()}));if(t&&t.length)t[0].getValue()},o.prototype.restrictBitrate=function(e){this._restrictedBitrate=e},o}(t.liveswitch.WebRtcMediaStreamBase);i.WebRtcMediaStream=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o,n){var s=i.call(this,e,o,n,t.liveswitch.StreamType.Audio)||this;return s._dtmfSender=null,s._onSendDtmfToneValues=[],s._onSendDtmfToneChangeValues=[],s._onDiscardOutboundDtmfTonesValues=[],s._external=e,s}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.WebRtcAudioStream],"+i.prototype.getTypeString.call(this)},o.prototype._getExternal=function(){return this._external},o.prototype.getDiscardDtmfTones=function(){return this._discardDtmfTones},o.prototype.setDiscardDtmfTones=function(e){this._discardDtmfTones=e},o.prototype.addOnDiscardOutboundDtmfTones=function(e){t.liveswitch.ArrayExtensions.add(this._onDiscardOutboundDtmfTonesValues,e)},o.prototype.removeOnDiscardOutboundDtmfTones=function(e){t.liveswitch.ArrayExtensions.remove(this._onDiscardOutboundDtmfTonesValues,e)},o.prototype.raiseOnDiscardOutboundDtmfTones=function(e){for(var t=0,i=this._onDiscardOutboundDtmfTonesValues;t0&&(n=s[0].getSetupAttribute())}t.liveswitch.Global.equals(n,null)||(i=n.getSetup())}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAudioStream=function(){if(0==arguments.length){var e=this.getAudioStreams();return t.liveswitch.Global.equals(e,null)||t.liveswitch.Global.equals(e.length,0)?null:e[0]}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBundlePolicy=function(){if(0==arguments.length)return this.__bundlePolicy;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getCanonicalName=function(){if(0==arguments.length)return this.getConnectionWideCanonicalName();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClosed=function(){if(0==arguments.length)return this.__closed;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getConnected=function(){if(0==arguments.length)return this.__connected;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getConnectionWideCanonicalName=function(){if(0==arguments.length){for(var e=this.getStreams(),i=0,o=e;i=1){var n=o[0].getSetupAttribute();if(!t.liveswitch.Global.equals(n,null)){var s=new t.liveswitch.sdp.SetupAttribute(n.getSetup());i?this.__localDTLSRole=s:this.__remoteDTLSRole=s}}}},o.prototype.setBundlePolicy=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(t.liveswitch.Global.equals(e,t.liveswitch.BundlePolicy.Balanced))throw new t.liveswitch.Exception("Balanced stream bundling is currently not supported.");this.__bundlePolicy=e,this.updateBundlePolicy(e)},o.prototype.setDeadStreamTimeout=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._deadStreamTimeout=t.liveswitch.Global.toInt(e)},o.prototype.setError=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._error=e},o.prototype.setExternalId=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=this.__externalId;if(!t.liveswitch.Global.equals(i,e)){this.__externalId=e;var o=this._onExternalIdChange;if(!t.liveswitch.Global.equals(o,null))try{o(this.getId(),i)}catch(n){t.liveswitch.Log.error(t.liveswitch.StringExtensions.format("Exception occurred while raising external ID change to the application code for connection {0}.",this.getId()),n)}}},o.prototype.setIceGatherPolicy=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._iceGatherPolicy=e},o.prototype.setIceServer=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__iceServers.setValue(e)},o.prototype.setIceServers=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__iceServers.replace(e)},o.prototype.setLegacyTimeout=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._legacyTimeout=e},o.prototype.setLocalDescription=function(e){if(1==arguments.length){var i=new t.liveswitch.Promise;try{this.setLocalDescriptionInternal(i,e)}catch(o){i.reject(o)}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setLocalDescriptionInternal=function(e,i){var o=this;if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.getSessionDescriptionManager().updateLocalDescription(i),this.raiseLocalDescription(i);var n=null;if(this.getIsTerminatingOrTerminated())throw new t.liveswitch.Exception(t.liveswitch.StringExtensions.format("Cannot set local description: connection is {0}.",new t.liveswitch.ConnectionStateWrapper(this.getState()).toString()));n=this.doSetLocalDescriptionInternal(i),n.then((function(i){try{t.liveswitch.Log.info(t.liveswitch.StringExtensions.format("Local session description ({0}) for connection {2}:\n{1}",t.liveswitch.StringExtensions.toLower(new t.liveswitch.SessionDescriptionTypeWrapper(i.getType()).toString()),t.liveswitch.StringExtensions.replace(i.getSdpMessage().toString(),"\r\n","\n"),o.getId()));var n=i.getSdpMessage();if(!t.liveswitch.Global.equals(n,null))for(var s=0,r=n.getMediaDescriptions();s=s)throw new t.liveswitch.Exception(t.liveswitch.StringExtensions.format("Received new remote description with session id {0} and session version {1}, but current remote description has id {2} and version {3}. Cannot set remote description.",[t.liveswitch.NumberExtensions.toString(o),t.liveswitch.NumberExtensions.toString(s),t.liveswitch.NumberExtensions.toString(i),t.liveswitch.NumberExtensions.toString(n)]))}},o}(t.liveswitch.Dynamic);i.WebRtcConnectionBase=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o,n){var s=i.call(this,new Object)||this;if(s._remoteMediaTrackCount=0,s._dataStreamsReady=!1,s._mediaStreamsReady=!1,s._lastMediaComponentFrameStatsCollection={},s._iceCandidateProcessingTimeout=2e3,s.dtmfSender=null,s._setMaxSendBitrateQueue=[],s._processingMaxSendBitrate=!1,s._external=e,s._remoteMedia=n,!t.liveswitch.Plugin.hasWebRtc())throw new t.liveswitch.Exception("Native browser support for WebRTC could not be found.");s._streams=[],s._mediaStreams=[],s._audioStreams=[],s._videoStreams=[],s._dataStreams=[],s._isRenegotiation=!1,s._initialized=!1,s._localDescription=null,s._remoteDescription=null,s._sessionDescriptionManager=new t.liveswitch.SessionDescriptionManager,s.addStreamsInternal(o);for(var r=0,a=o;r0){for(var f=function(e){if(p=e.getBitrate(),w=a.constraintMax(w,e.getBitrate()),e instanceof t.liveswitch.VideoEncodingConfig){var i=e;i.getFrameRate()>0&&(u=i.getFrameRate())}},g=0,m=v;g0){var E=_[0];E.getFrameRate()>0&&(S=E.getFrameRate())}}else{_=s.getReceiveEncodingInfos();if(_&&_.length>0){E=_[0];E.getFrameRate()>0&&(S=E.getFrameRate())}var M=s.getRemoteEncoding();M&&M.getFrameRate()>0&&(S=t.liveswitch.MathAssistant.max(S,M.getFrameRate()))}return h.setExpectedFrameRate(S),h},o.prototype.getRemoteReceiverStats=function(e){if(!e)return null;var i=new t.liveswitch.RemoteReceiverStats;return i.setCumulativeNumberOfPacketsLost(e.packetsLost),i.setFractionLost(e.fractionLost),i.setInterarrivalJitter(e.jitter),i.setSynchronizationSource(e.ssrc),i.setLastSenderReportTimestamp(e.timestamp),i},o.prototype.initialize=function(){var e=this;this.setState(t.liveswitch.ConnectionState.Initializing);for(var i=t.liveswitch.Plugin.hasWebRtc(),o=[],n=0,s=this.getIceServers();n0){t.liveswitch.StringExtensions.startsWith(o,"a=")||(o="a="+o);var n=new t.liveswitch.Candidate;n.setSdpMediaIndex(i.candidate.sdpMLineIndex),n.setSdpCandidateAttribute(t.liveswitch.sdp.Attribute.parse(o));var s=e.getUseTrickleIce();s?e.validateCandidate(n)&&e.raiseLocalCandidate(n):e.validateCandidate(n)&&e._discoveredCandidates.push(n)}}};var E=0;this._dataStreamsReady=E==d;for(var M=function(i){var o=i.getState();o==t.liveswitch.DataChannelState.Connected?E++:o==t.liveswitch.DataChannelState.Closed?(E--,0==E&&0==p&&e.setState(t.liveswitch.ConnectionState.Closing)&&(e.doClose(),e.setState(t.liveswitch.ConnectionState.Closed))):o==t.liveswitch.DataChannelState.Failed&&(E--,0==E&&0==p&&e.setState(t.liveswitch.ConnectionState.Failing,new t.liveswitch.Error(t.liveswitch.ErrorCode.ReliableDataChannelSendError,new t.liveswitch.Exception("Data channel failed.")))&&(e.doClose(),e.setState(t.liveswitch.ConnectionState.Failed)));var n=o==t.liveswitch.DataChannelState.Closing||o==t.liveswitch.DataChannelState.Closed||o==t.liveswitch.DataChannelState.Failed;e._dataStreamsReady=E==d,!n&&e._dataStreamsReady&&e._mediaStreamsReady&&e.getState()==t.liveswitch.ConnectionState.Connecting&&e.setState(t.liveswitch.ConnectionState.Connected)},C=function(e){if(I._offerer)for(var t=0,i=e.getAllChannels();t0){var R=[],G=function(i){R=R.concat(i);for(var o=e._remoteMediaTrackCount,n=null,s=null,r=0,a=R;r0&&(s=l,o-=h.length),0==o){e._remoteMedia._setMediaStreams(n,s);for(var p=e._remoteMedia.getAudioTracks(),d=0;d1;if(a){var l=s.getSimulcastMode();if(l==t.liveswitch.SimulcastMode.Disabled)throw new t.liveswitch.Exception("Multiple send encodings were specified, but the SimulcastMode is Disabled. Choose a different SimulcastMode for the stream or reduce the number of encodings to one.");if(l!=t.liveswitch.SimulcastMode.RtpStreamId)throw new t.liveswitch.Exception("Multiple send encodings were specified, but the SimulcastMode "+new t.liveswitch.SimulcastModeWrapper(l).toString()+" was not recognized.");for(var c=0,h=0,p=r;h0))throw new t.liveswitch.Exception("");this._iceCandidateProcessingTimeout=e},o.prototype.doCreateOffer=function(e){return this._offerer=!0,this.doCreate(e),!0},o.prototype.doCreateAnswer=function(e){this._offerer=!1,this.doCreate(e)},o.prototype.processIceGatheringStateComplete=function(){this._iceGatheringComplete=!0,this.getUseTrickleIce()||this._isRenegotiation||!this._originalSetNativeDescriptionComplete||this.injectDiscoveredCandidatesIntoSdp()},o.prototype.injectDiscoveredCandidatesIntoSdp=function(){if(this._injectingCandidates);else if(null==this._localSessionDescriptionPromise||null==this._localSessionDescription){this._injectingCandidates=!0;var e="Local Session Description not ready when trying to inject local candidates into session description.";null==this._localSessionDescriptionPromise&&(e="Local Session Description Promise not set when trying to inject local candidates into session description.");var i=new t.liveswitch.Error(t.liveswitch.ErrorCode.ConnectionInternalError,e);this.setState(t.liveswitch.ConnectionState.Failing,i)&&(this.doClose(),this.setState(t.liveswitch.ConnectionState.Failed)),null!=this._localSessionDescriptionPromise&&this._localSessionDescriptionPromise.reject(new t.liveswitch.Exception(e))}else{this._injectingCandidates=!0;var o=this._localSessionDescription.getSdpMessage(),n=o.getMediaDescriptions();if(null!=n)for(var s=0,r=this._discoveredCandidates;s0){p.update(u);var b=c.getMedia();b.setTransportPort(w)}}this._localSessionDescriptionPromise.resolve(this._localSessionDescription)}},o.prototype.setNativeDescriptionSuccess=function(e,t){var i=this;this._originalSetNativeDescriptionComplete=!0,this._localSessionDescriptionPromise=t,this._localSessionDescription=e,this.getUseTrickleIce()||this._isRenegotiation?t.resolve(e):this._iceGatheringComplete?this.injectDiscoveredCandidatesIntoSdp():window.setTimeout((function(){i.injectDiscoveredCandidatesIntoSdp()}),this.getIceCandidateProcessingTimeout())},o.prototype.modifyExtRtpMapId=function(e,t,i){var o=i.getSessionLevelRtpExtMapAttributes(),n=o.filter((function(e){return e.getId()==t}));i.getMediaDescriptions().forEach((function(e){var i=e.getRtpExtMapAttributes();n=n.concat(i.filter((function(e){return e.getId()==t})))})),n.forEach((function(t){return t.setId(e)}))},o.prototype.getExtRtpMapAttributesWithNoDuplicateUri=function(e,t){if(null!=t&&null!=t.getSdpMessage()){t.getSdpMessage().getMediaDescriptions().forEach((function(t){for(var i=t.getRtpExtMapAttributes(),o=function(t){var o=!1;e.forEach((function(e){null!=i[t].getUri()&&null!=e.getUri()&&i[t].getUri()==e.getUri()&&(o=!0)})),o||e.push(i[t])},n=0;n0){var x=g.getSendEncodingInfos();if(x&&x.length<=b.length)for(var S=0;S0){C.setSynchronizationSource(I[0].getSynchronizationSource());for(var A=0,T=C.getSdpSsrcRestrictionAttributes();A1&&v.purgeFormat("VP9")}var G=g.getRemoteEncoding();if(G){var D=0;while(1){if(!t.liveswitch.ArrayExtensions.contains(m,D.toString()))break;D++}var z=D.toString();M=new t.liveswitch.sdp.rtp.RidAttribute(z,t.liveswitch.sdp.rtp.RidDirection.getReceive(),G.getSdpRidRestrictions());v.addMediaAttribute(M)}}}s=!1;var q=v.getMedia(),L=q.getMediaType(),P=t.liveswitch.sdp.MediaType.toStreamType(L);if(P==t.liveswitch.StreamType.Audio){var B=this.getAudioStreams();if(null!=B&&B.length>0){var k=B[0];if(n=k.getLocalDirection(),r){switch(n){case t.liveswitch.StreamDirection.SendReceive:n=t.liveswitch.StreamDirection.SendOnly;break;case t.liveswitch.StreamDirection.ReceiveOnly:n=t.liveswitch.StreamDirection.Inactive;break}k.setLocalDirection(n)}s=!0;for(var V=0,O=v.getBandwidths();V0&&(v.addBandwidth(new t.liveswitch.sdp.Bandwidth("TIAS",1e3*k.getLocalBandwidth())),v.addBandwidth(new t.liveswitch.sdp.Bandwidth("AS",k.getLocalBandwidth())))}}else if(P==t.liveswitch.StreamType.Video){var J=this.getVideoStreams();if(null!=J&&J.length>0){var F=J[0];if(n=F.getLocalDirection(),a){switch(n){case t.liveswitch.StreamDirection.SendReceive:n=t.liveswitch.StreamDirection.SendOnly;break;case t.liveswitch.StreamDirection.ReceiveOnly:n=t.liveswitch.StreamDirection.Inactive;break}F.setLocalDirection(n)}s=!0;for(var N=0,H=v.getBandwidths();N0&&(v.addBandwidth(new t.liveswitch.sdp.Bandwidth("TIAS",1e3*F.getLocalBandwidth())),v.addBandwidth(new t.liveswitch.sdp.Bandwidth("AS",F.getLocalBandwidth())))}}s&&v.setStreamDirection(n)}return e},o.prototype.doSetLocalDescription=function(e,i){var o=this;t.liveswitch.ManagedThread.dispatch((function(){try{o._initialized||o.initialize(),i=o.updateLocalDescription(i);var n=o.processDescription(i,!0);if(null==n){var s=o.getSignallingState();s==t.liveswitch.SignallingState.New?o.setSignallingState(t.liveswitch.SignallingState.HaveLocalOffer):s==t.liveswitch.SignallingState.HaveRemoteOffer?o.setSignallingState(t.liveswitch.SignallingState.Stable):s==t.liveswitch.SignallingState.Stable&&o.setSignallingState(t.liveswitch.SignallingState.HaveLocalOffer),o._offerer&&o._isRenegotiation&&t.liveswitch.Util.isFirefox()&&(o.addExtRtpMapAttributesOnRenegotiationOffer(i,o._remoteDescription),o.reorderExtRtpMapIdsOnRenegotiationOffer(i,o._localDescription,o._remoteDescription));var r=o.webrtcSessionDescriptionFromSessionDescription(i),a=function(){o._localDescription=i,o.getRemoteDescription()&&o.getState()!=t.liveswitch.ConnectionState.Connected&&o.setState(t.liveswitch.ConnectionState.Connecting),o.setNativeDescriptionSuccess(i,e),o.processNextSetMaxSendBitrate()},l=function(i){o.setState(t.liveswitch.ConnectionState.Failing,new t.liveswitch.Error(t.liveswitch.ErrorCode.ConnectionInvalidArchitecture,i))&&(o.doClose(),o.setState(t.liveswitch.ConnectionState.Failed)),e.reject(i)};try{o._nativePeerConnection.setLocalDescription(r.sessionDescription).then(a,l)}catch(u){o._nativePeerConnection.setLocalDescription(r.sessionDescription,a,l)}for(var c=o.getConnectionWideCanonicalName(),h=o.getStreams(),p=0,d=h;p0&&(l==t.liveswitch.StreamDirection.SendReceive||l==t.liveswitch.StreamDirection.SendOnly)&&o._remoteMediaTrackCount++}0==o._remoteMediaTrackCount&&(o._mediaStreamsReady=!0),o.removeSdesAttributesIfNeeded(i);var c=o.webrtcSessionDescriptionFromSessionDescription(i),h=function(){o.syncStreamsWithRemoteDescription(i),o._remoteDescription=i;var n=o.getRemoteMedia();n._setMediaStreams(n._getAudioMediaStream(),n._getVideoMediaStream());for(var s=n.getVideoTrack(),r=0,a=o.getVideoStreams();r=i.length)throw new t.liveswitch.Exception("Media stream index exceeds RTP senders count.");return i[e]},o.prototype.setMaxSendBitrate=function(e,i){var o=new t.liveswitch.Promise;return this._setMaxSendBitrateQueue.push({bitrate:e,streamType:i,promise:o}),this.processNextSetMaxSendBitrate(),o},o.prototype.processNextSetMaxSendBitrate=function(){if(this._setMaxSendBitrateQueue.length>0&&this._initialized&&this.getSignallingState()==t.liveswitch.SignallingState.Stable&&!this._processingMaxSendBitrate){this._processingMaxSendBitrate=!0;var e=this._setMaxSendBitrateQueue[0];this._setMaxSendBitrateQueue.splice(0,1),this.doSetMaxSendBitrate(e.bitrate,e.streamType,e.promise)}},o.prototype.finalizeBitrateChange=function(){this._processingMaxSendBitrate=!1,this.processNextSetMaxSendBitrate()},o.prototype.doSetMaxSendBitrate=function(e,i,o){var n=this;try{if(!t.liveswitch.Plugin.hasWebRtc())throw new t.liveswitch.Exception("Browser not supported.");var s=this._nativePeerConnection;if(!s)throw new t.liveswitch.Exception("No connection.");var r=this.getLocalDescription();if(!r)throw new t.liveswitch.Exception("No local description.");var a=this.getRemoteDescription();if(!a)throw new t.liveswitch.Exception("No remote description.");var l=a.getSdpMessage(),c=void 0,h=void 0;switch(i){case t.liveswitch.StreamType.Audio:h=l.getAudioDescription(),c=this.getAudioStream();break;case t.liveswitch.StreamType.Video:h=l.getVideoDescription(),c=this.getVideoStream();break;default:throw new t.liveswitch.Exception("Invalid Stream Type: "+i)}this.updateMaxBitrateRemoteSdpMessage(e,c,h),r.setSessionVersion(r.getSessionVersion()+1),a.setSessionVersion(a.getSessionVersion()+1);var p=new t.liveswitch.Promise,d=new t.liveswitch.Promise,w=function(){try{o.resolve(null)}finally{n.finalizeBitrateChange()}},u=function(e){try{o.reject(e)}finally{n.finalizeBitrateChange()}};this._offerer?(p.then(w,u),d.then((function(){n.doSetRemoteDescription(p,a)}),u),s.createOffer().then((function(){n.doSetLocalDescription(d,r)}),u)):(d.then(w,u),p.then((function(){s.createAnswer().then((function(){n.doSetLocalDescription(d,r)}),u)}),u),this.doSetRemoteDescription(p,a))}catch(v){o.reject(v),this.finalizeBitrateChange()}},o.prototype.updateMaxBitrateRemoteSdpMessage=function(e,i,o){if(null==i||null==o)return!1;for(var n=0,s=o.getBandwidths();n0||-1==e)o.getStreamDirection()==t.liveswitch.StreamDirection.Inactive&&o.setStreamDirection(i.getCachedSignalledDirection()),e>0&&(o.addBandwidth(new t.liveswitch.sdp.Bandwidth("TIAS",1e3*e)),o.addBandwidth(new t.liveswitch.sdp.Bandwidth("AS",e)));else{var a=i.getRemoteDirection();a!=t.liveswitch.StreamDirection.Inactive&&i.setCachedSignalledDirection(a),o.setStreamDirection(t.liveswitch.StreamDirection.Inactive),i.setRemoteDirection(t.liveswitch.StreamDirection.Inactive)}},o.webRtcConnectionInitialize=function(){this.__webRtcConnectionInitialized||(window.RTCPeerConnection=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection||window.msRTCPeerConnection,window.RTCDataChannel=window.RTCDataChannel||window.webkitRTCDataChannel||window.mozRTCDataChannel||window.msRTCDataChannel,window.RTCSessionDescription=window.RTCSessionDescription||window.webkitRTCSessionDescription||window.mozRTCSessionDescription||window.msRTCPeerConnection,window.RTCIceCandidate=window.RTCIceCandidate||window.webkitRTCIceCandidate||window.mozRTCIceCandidate||window.msRTCIceCandidate),t.liveswitch.WebRtcConnection.__webRtcConnectionInitialized=!0},o.__webRtcConnectionInitialized=!1,o}(t.liveswitch.WebRtcConnectionBase);i.WebRtcConnection=o,t.liveswitch.WebRtcConnection.webRtcConnectionInitialize()})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n=i)s.reject(new t.liveswitch.Exception(a));else if(r._destroyed)a?s.reject(new t.liveswitch.Exception("Audio sink has been destroyed. ("+a+")")):s.reject(new t.liveswitch.Exception("Audio sink has been destroyed."));else{var l=function(){r.doRetry(e+1,i,o,n,s)};o>0?setTimeout(l,o):l()}}))},o}(t.liveswitch.Dynamic);i.WebRtcDomAudioSink=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o){var n=i.call(this)||this;return n._external=e,n._container=document.createElement("div"),n._container.style.position="relative",n._container.style.overflow="hidden",n._container.className="fm-video",n._video=document.createElement("video"),n._video.style.position="absolute",n._video.setAttribute("autoplay","autoplay"),n._video.setAttribute("playsinline","playsinline"),n._video.setAttribute("webkit-playsinline","webkit-playsinline"),n._video.muted=!0,n._video.addEventListener("resize",(function(e){var t=n.getTrack();if(t)if(n._local)for(var i=0,o=t.getOutputs();i0){while(e--)if(t.liveswitch.WebRtcDomVideoSink._videoSinks[e]==this){t.liveswitch.WebRtcDomVideoSink._videoSinks.splice(e,1);break}0===t.liveswitch.WebRtcDomVideoSink._videoSinks.length&&o._observer&&(t.liveswitch.WebRtcDomVideoSink._observer.disconnect(),t.liveswitch.WebRtcDomVideoSink._observer=null)}"undefined"!==typeof this._video.srcObject&&(this._video.srcObject=null),this._destroyed=!0},o.prototype.setTrack=function(e){var i=this;if(!e)return!1;if(this._track=e,this._local=t.liveswitch.Util.isObjectType(this._track.getMedia(),"[fm.liveswitch.WebRtcLocalMedia]"),this._local?this._container.className="fm-video fm-video-local":this._container.className="fm-video fm-video-remote",this.getLocal()){var o=this.getTrack().getMedia(),n=o.getVideoConstraints();if(o.getScreen())this.setViewMirror(!1);else if(n){var s=n.facingMode;s&&s.exact?s=s.exact:s&&s.ideal&&(s=s.ideal),this.setViewMirror("user"==s)}else this.setViewMirror(!0)}else this.setViewMirror(!1);return t.liveswitch.ManagedThread.dispatch((function(){var e=i.getTrack().getMedia()._getVideoMediaStream();try{i._video.audioVolume=0,i._video.muted=!0}catch(n){t.liveswitch.Log.error("Could not set "+(i.getLocal()?"local":"remote")+" video element audio volume.",n)}try{if("undefined"!==typeof i._video.srcObject)i._video.srcObject=e;else if("undefined"!==typeof i._video.mozSrcObject)i._video.mozSrcObject=e;else if("undefined"!==typeof window.attachMediaStream){var o=null==i._container.parentNode;o&&document.body.appendChild(i._container),window.attachMediaStream(i._video,e),i._video=i._container.firstChild,o&&document.body.removeChild(i._container)}else URL=window.URL||window.webkitURL,i._video.src=URL.createObjectURL(e)}catch(n){t.liveswitch.Log.error("Could not attach "+(i.getLocal()?"local":"remote")+" media stream to video element.",n)}i.playVideo(),i.setViewScale(i.getViewScale()||t.liveswitch.LayoutScale.Contain)})),!0},o.prototype.playVideo=function(){var e=this;this.retry(50,100,(function(){return e.getVideo().play()})).then((function(){t.liveswitch.Log.debug("Video playback started.")}),(function(i){e._destroyed?t.liveswitch.Log.debug("Video playback failed to start.",i):t.liveswitch.Log.error("Video playback failed to start.",i)}))},o.prototype.retry=function(e,i,o){var n=new t.liveswitch.Promise;return e=Math.max(e,0),i=Math.max(i,0),this.doRetry(0,e,i,o,n),n},o.prototype.doRetry=function(e,i,o,n,s){var r=this;n().then((function(){s.resolve(null)}),(function(a){if(e>=i)s.reject(new t.liveswitch.Exception(a));else if(r._destroyed)a?s.reject(new t.liveswitch.Exception("Video sink has been destroyed. ("+a+")")):s.reject(new t.liveswitch.Exception("Video sink has been destroyed."));else{var l=function(){r.doRetry(e+1,i,o,n,s)};o>0?setTimeout(l,o):l()}}))},o.prototype.applyScale=function(e){var i=this;if(this._video.style.hasOwnProperty("objectFit"))switch(this._video.style.width="100%",this._video.style.height="100%",e){case t.liveswitch.LayoutScale.Contain:this._video.style.objectFit="contain";break;case t.liveswitch.LayoutScale.Cover:this._video.style.objectFit="cover";break;case t.liveswitch.LayoutScale.Stretch:this._video.style.objectFit="fill";break}else switch(e){case t.liveswitch.LayoutScale.Contain:this._video.style.width="100%",this._video.style.height="100%";break;case t.liveswitch.LayoutScale.Cover:this._container.style.display="inline-block",this._video.style.left="-100%",this._video.style.right="-100%",this._video.style.top="-100%",this._video.style.bottom="-100%",this._video.style.margin="auto",this._video.style.maxWidth="none",this._video.style.maxHeight="none";var o=function(){var e=i._container.clientWidth,t=i._container.clientHeight,o=i._video.clientWidth,n=i._video.clientHeight;!n||o/n>e/t?(i._video.style.width="auto",i._video.style.height="100%",i._video.style.maxWidth="none"):(i._video.style.width="100%",i._video.style.height="auto",i._video.style.maxWidth="none")};t.liveswitch.Util.observe(this._video,"loadeddata",(function(){o()})),t.liveswitch.Util.observeAttr(this._container,(function(e){"width"!=e&&"height"!=e&&"style"!=e||o()})),o();break;case t.liveswitch.LayoutScale.Stretch:this._video.style.transformOrigin="0px 0px";var n=0,s=0,r=0,a=0,l=function(){var e=i._container.clientWidth,t=i._container.clientHeight,o=i._video.clientWidth,l=i._video.clientHeight;e==n&&t==s&&o==r&&l==a||o&&l&&(i._video.style.transform="scale("+e/o+", "+t/l+")",n=e,s=t,r=o,a=l)};t.liveswitch.Util.observe(this._video,"loadeddata",(function(){l()})),t.liveswitch.Util.observeAttr(this._container,(function(e){"width"!=e&&"height"!=e&&"style"!=e||l()})),l();break}},o._videoSinks=[],o}(t.liveswitch.Dynamic);i.WebRtcDomVideoSink=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0;t?(this._audioTrack._setMediaStreamTrack(e.getAudioTracks()[0]),this._audioSink.setTrack(this._audioTrack),this.initializeAudioContext()):(this._audioTrack._setMediaStreamTrack(null),this.destroyAudioContext())}else this._audioTrack._setMediaStreamTrack(null),this.destroyAudioContext();return!0},o.prototype._setVideoMediaStream=function(e){if(e==this._videoMediaStream)return!1;if(this._videoMediaStream=e,e){var t=e.getVideoTracks().length>0;t?(this._videoTrack._setMediaStreamTrack(e.getVideoTracks()[0]),this._videoSink.setTrack(this._videoTrack)):this._videoTrack._setMediaStreamTrack(null)}else this._videoTrack._setMediaStreamTrack(null);return!0},o.prototype._setMediaStreams=function(e,t){this._setAudioMediaStream(e),this._setVideoMediaStream(t)},o.prototype._setMediaStream=function(e){this._setMediaStreams(e,e)},o.prototype.getAudio=function(){return this._audio},o.prototype.setAudio=function(e){this._audio=e},o.prototype.getVideo=function(){return this._video},o.prototype.setVideo=function(e){this._video=e},o.prototype.addOnAudioDestroyed=function(e){t.liveswitch.ArrayExtensions.add(this._onAudioDestroyedValues,e)},o.prototype.addOnVideoDestroyed=function(e){t.liveswitch.ArrayExtensions.add(this._onVideoDestroyedValues,e)},o.prototype.removeOnAudioDestroyed=function(e){t.liveswitch.ArrayExtensions.remove(this._onAudioDestroyedValues,e)},o.prototype.removeOnVideoDestroyed=function(e){t.liveswitch.ArrayExtensions.remove(this._onVideoDestroyedValues,e)},o.prototype.addOnAudioLevel=function(e){t.liveswitch.ArrayExtensions.add(this._onAudioLevelValues,e),this.initializeAudioContext()},o.prototype.addOnVideoSize=function(e){t.liveswitch.ArrayExtensions.add(this._onVideoSizeValues,e),this.tryAttachVideoSizeEvents()},o.prototype.addOnVideoSizeChange=function(e){t.liveswitch.ArrayExtensions.add(this._onVideoSizeChangeValues,e),this.tryAttachVideoSizeEvents()},o.prototype.tryAttachVideoSizeEvents=function(){var e=this,i=this._videoSink.getVideo();if(i&&!this._videoSizeEventsAttached)try{t.liveswitch.Util.observe(i,"loadedmetadata",(function(t){e.raiseOnVideoSize(i.videoWidth,i.videoHeight)})),t.liveswitch.Util.observe(i,"timeupdate",(function(t){e.raiseOnVideoSize(i.videoWidth,i.videoHeight)})),this._videoSizeEventsAttached=!0}catch(o){t.liveswitch.Log.error("Could not attach video size events.",o)}},o.prototype.raiseOnVideoSize=function(e,i){if(!this._videoSize||this._videoSize.getWidth()!=e||this._videoSize.getHeight()!=i){this._videoSize=new t.liveswitch.Size(e,i);for(var o=0,n=this._onVideoSizeChangeValues;o0)try{var i=this._audioMediaStream.getAudioTracks();if(i&&i.length>0){if(null==this._audioContext&&"undefined"!==typeof AudioContext&&(this._audioContext=new AudioContext),null==this._audioContext&&"undefined"!==typeof window.webkitAudioContext&&(this._audioContext=new window.webkitAudioContext),null!=this._audioContext)if(this._audioMicrophone=this._audioContext.createMediaStreamSource(this._audioMediaStream),this._tryUseAudioWorklet&&this._audioContext.audioWorklet&&this._audioContext.audioWorklet.addModule){var o="\nclass IceLinkAudioWorkletProcessor extends AudioWorkletProcessor {\n constructor (options) {\n super();\n this._sampleSum = 0;\n this._sampleLength = 0;\n this._levelInterval = options.processorOptions.levelInterval;\n this._levelIntervalRemaining = options.processorOptions.levelInterval;\n this.port.onmessage = event => {\n if (event.data.levelInterval) {\n this._levelInterval = event.data.levelInterval;\n this._levelIntervalRemaining = event.data.levelIntervalRemaining;\n }\n }\n }\n process(inputs, outputs) {\n let input = inputs[0];\n if (input.length > 0) {\n let inputChannel = input[0];\n for (let i = 0; i < inputChannel.length; i++) {\n this._sampleSum += inputChannel[i] * inputChannel[i];\n }\n this._sampleLength += inputChannel.length;\n this._levelIntervalRemaining -= 1000 * inputChannel.length / sampleRate;\n if (this._levelIntervalRemaining <= 0) {\n let level = Math.sqrt(this._sampleSum / this._sampleLength);\n this._sampleSum = 0;\n this._sampleLength = 0;\n this._levelIntervalRemaining = this._levelInterval;\n this.port.postMessage({\n level: level\n });\n }\n }\n return true;\n }\n}\nregisterProcessor('icelink-audio-worklet-processor', IceLinkAudioWorkletProcessor);",n=new Blob([o],{type:"application/javascript"});this._audioContext.audioWorklet.addModule(URL.createObjectURL(n)).then((function(){e._audioContext&&(e._audioWorkletNode=new AudioWorkletNode(e._audioContext,"icelink-audio-worklet-processor",{processorOptions:{levelInterval:e._audioLevelInterval}}),e._audioMicrophone.connect(e._audioWorkletNode).connect(e._audioContext.destination),e._audioWorkletNode.port.onmessage=function(t){for(var i=t.data.level,o=0,n=e._onAudioLevelValues;o0&&("undefined"===typeof n.frameRate?(n.frameRate=h,s=!0):"number"===typeof n.frameRate?n.frameRate>h&&(s=!0,n.frameRate=h):(n.frameRate.max>h&&(s=!0,n.frameRate.max=h),n.frameRate.ideal>h&&(s=!0,n.frameRate.ideal=h)));var p=c.getResolution();if(null!=p&&p.getHeight()>0&&p.getWidth()>0){var d=p.getHeight()*p.getWidth(),w=a*l;if(d0){var h=n[0];h&&s.lockAudioEncodings()}}}if(i){o=a.videoMediaStream;if(o){var p=o.getVideoTracks();if(p&&p.length>0){var d=p[0];if(d){var w=s._videoType,u=-1,v=-1,f=-1;if(d.getSettings){var g=d.getSettings();g&&(g.width&&(u=g.width),g.height&&(v=g.height),g.frameRate&&(f=g.frameRate))}s.lockVideoEncodings(w,u,v,f)}}}}r.resolve(a)},p=function(e){s.getScreen()?"https:"==document.location.protocol?t.liveswitch.Log.error("Local screen access denied.",e):t.liveswitch.Log.error("Local screen access denied. (The page may need to be loaded using HTTPS.)",e):"file:"==document.location.protocol?t.liveswitch.Log.error("Local media access denied. (The media source may be unavailable/locked or you may need to access this page through a webserver instead of the file system.)",e):t.liveswitch.Log.error("Local media access denied. (The media source may be unavailable/locked.)",e),r.reject(e)};if(e&&!l&&(a.audioConstraints=this.createAudioConstraints(e,n)),i&&!c&&(a.videoConstraints=this.createVideoConstraints(i,n)),a.audioConstraints||a.videoConstraints){var d={};a.audioConstraints&&(d.audio=a.audioConstraints),a.videoConstraints&&(d.video=a.videoConstraints);var w=navigator.fmGetUserMedia,u=!t.liveswitch.WebRtcLocalMedia.getChromeExtensionRequired()&&(navigator.getDisplayMedia||navigator.mediaDevices.getDisplayMedia);this.getScreen()&&u&&(w=function(e,t,i){var o=null;o=navigator.getDisplayMedia?navigator.getDisplayMedia(e):navigator.mediaDevices.getDisplayMedia?navigator.mediaDevices.getDisplayMedia(e):navigator.mediaDevices.getUserMedia(e),o.then(t).catch(i)}),w(d,(function(e){s.updateAudioSourceInput(e.getAudioTracks()),s.updateVideoSourceInput(e.getVideoTracks()),a.videoConstraints&&s.updateFacingMode(a.videoConstraints),h(e)}),p)}else h(null)}catch(f){r.reject(f)}return r},n.prototype.updateAudioSourceInput=function(e){if(e.length>0){var i=e[0];this._audioSourceInput;if(null==this._audioSourceInput){if("undefined"!==typeof i.getSettings){var o=i.getSettings();null!=o&&(this._audioSourceInput=new t.liveswitch.SourceInput(o.deviceId,i.label))}}else this._audioSourceInput.setName(i.label)}},n.prototype.updateVideoSourceInput=function(e){if(e.length>0){var i=e[0];this._videoSourceInput;if(null==this._videoSourceInput){if("undefined"!==typeof i.getSettings){var o=i.getSettings();null!=o&&(this._videoSourceInput=new t.liveswitch.SourceInput(o.deviceId,i.label))}}else this._videoSourceInput.setName(i.label)}},n.prototype.updateFacingMode=function(e){if(!this.getScreen()){var i=this.getVideoSourceInput();if(e.facingMode||(e.facingMode="user"),e.deviceId&&null!=i){var o=i.getName();(t.liveswitch.StringExtensions.startsWith(o,"back",t.liveswitch.StringComparison.InvariantCultureIgnoreCase)||t.liveswitch.StringExtensions.endsWith(o,"back",t.liveswitch.StringComparison.InvariantCultureIgnoreCase)||t.liveswitch.StringExtensions.startsWith(o,"rear",t.liveswitch.StringComparison.InvariantCultureIgnoreCase)||t.liveswitch.StringExtensions.endsWith(o,"rear",t.liveswitch.StringComparison.InvariantCultureIgnoreCase)||t.liveswitch.StringExtensions.startsWith(o,"environment",t.liveswitch.StringComparison.InvariantCultureIgnoreCase)||t.liveswitch.StringExtensions.endsWith(o,"environment",t.liveswitch.StringComparison.InvariantCultureIgnoreCase))&&(e.facingMode="environment")}}},n.prototype.createAudioConstraints=function(e,i){var o=this.getAudioSourceInput();if(i){var n={optional:[],mandatory:{}};if(this.getScreen()&&this._chromeScreenStreamId&&(n.mandatory.chromeMediaSource="desktop",n.mandatory.chromeMediaSourceId=this._chromeScreenStreamId),o&&n.optional.push({sourceId:o.getId()}),t.liveswitch.Util.isPlainObject(e)){if(e.mandatory)for(var s in e.mandatory)n.mandatory[s]=e.mandatory[s];if(e.optional)for(var r=0,a=e.optional;r0&&(i.width=e.getWidth()),e.getHeight()>0&&(i.height=e.getHeight()),e.getFrameRate()>0&&(i.frameRate=e.getFrameRate()),t.applyConstraints(i)}},o.prototype.isLocal=function(){return t.liveswitch.Util.isObjectType(this.getMedia(),"[fm.liveswitch.WebRtcLocalMedia]")},o.prototype.changeSinkOutput=function(e){if(this.isLocal()){var i=new t.liveswitch.Promise;return i.reject(new t.liveswitch.Exception("Cannot call VideoTrack.changeSinkOutput on a local track.")),i}return this.getMedia().changeVideoSinkOutput(e)},o.prototype.getSinkOutput=function(){if(this.isLocal())throw new t.liveswitch.Exception("Cannot call VideoTrack.getSinkOutput on a local track.");return this.getMedia().getVideoSinkOutput()},o.prototype.getSinkOutputs=function(){if(this.isLocal()){var e=new t.liveswitch.Promise;return e.reject(new t.liveswitch.Exception("Cannot call VideoTrack.getSinkOutputs on a local track.")),e}return this.getMedia().getVideoSinkOutputs()},o.prototype.setSinkOutput=function(e){if(this.isLocal())throw new t.liveswitch.Exception("Cannot call VideoTrack.setSinkOutput on a local track.");this.getMedia().setVideoSinkOutput(e)},o.prototype.changeSourceInput=function(e){if(!this.isLocal()){var i=new t.liveswitch.Promise;return i.reject(new t.liveswitch.Exception("Cannot call VideoTrack.changeSourceInput on a remote track.")),i}return this.getMedia().changeVideoSourceInput(e)},o.prototype.getSourceInput=function(){if(!this.isLocal())throw new t.liveswitch.Exception("Cannot call VideoTrack.getSourceInput on a remote track.");return this.getMedia().getVideoSourceInput()},o.prototype.getSourceInputs=function(){if(!this.isLocal()){var e=new t.liveswitch.Promise;return e.reject(new t.liveswitch.Exception("Cannot call VideoTrack.getSourceInputs on a remote track.")),e}return this.getMedia().getVideoSourceInputs()},o.prototype.setSourceInput=function(e){if(!this.isLocal())throw new t.liveswitch.Exception("Cannot call VideoTrack.setSourceInput on a remote track.");this.getMedia().setVideoSourceInput(e)},o.prototype.addOnSize=function(e){this.getMedia().addOnVideoSize(e)},o.prototype.addOnSizeChange=function(e){this.getMedia().addOnVideoSizeChange(e)},o.prototype.getSize=function(){return this.getMedia().getVideoSize()},o.prototype.grabFrame=function(){return this.getMedia().grabVideoFrame()},o.prototype.removeOnSize=function(e){this.getMedia().removeOnVideoSize(e)},o.prototype.removeOnSizeChange=function(e){this.getMedia().removeOnVideoSizeChange(e)},o}(t.liveswitch.WebRtcMediaTrack);i.WebRtcVideoTrack=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Default"]=1]="Default"})(e.CryptoLibrary||(e.CryptoLibrary={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["IPv4"]=1]="IPv4",e[e["IPv6"]=2]="IPv6",e[e["Unknown"]=3]="Unknown"})(e.AddressType||(e.AddressType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Array"]=1]="Array",e[e["Done"]=2]="Done",e[e["Key"]=3]="Key",e[e["Object"]=4]="Object",e[e["String"]=5]="String"})(e.JsonCheckerMode||(e.JsonCheckerMode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Unknown"]=1]="Unknown",e[e["Windows"]=2]="Windows",e[e["Android"]=3]="Android",e[e["MacOS"]=4]="MacOS",e[e["IOS"]=5]="IOS",e[e["Linux"]=6]="Linux",e[e["TvOS"]=7]="TvOS",e[e["WatchOS"]=8]="WatchOS"})(e.OperatingSystem||(e.OperatingSystem={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Unknown"]=1]="Unknown",e[e["X86"]=2]="X86",e[e["X64"]=3]="X64",e[e["Armv7"]=4]="Armv7",e[e["Armv8"]=5]="Armv8",e[e["Arm64"]=6]="Arm64",e[e["Mips"]=7]="Mips",e[e["Mips64"]=8]="Mips64"})(e.Architecture||(e.Architecture={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Udp"]=1]="Udp",e[e["Tcp"]=2]="Tcp",e[e["Tls"]=3]="Tls",e[e["Unknown"]=4]="Unknown"})(e.ProtocolType||(e.ProtocolType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["CSharp"]=1]="CSharp",e[e["Java"]=2]="Java",e[e["ObjectiveC"]=3]="ObjectiveC",e[e["TypeScript"]=4]="TypeScript"})(e.SourceLanguage||(e.SourceLanguage={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["None"]=1]="None",e[e["Single"]=2]="Single",e[e["Double"]=3]="Double"})(e.StringType||(e.StringType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Equal"]=1]="Equal",e[e["Negative"]=2]="Negative",e[e["Positive"]=3]="Positive"})(e.CompareResult||(e.CompareResult={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Md5"]=1]="Md5",e[e["Sha1"]=2]="Sha1",e[e["Sha256"]=3]="Sha256"})(e.HashType||(e.HashType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["HmacMd5"]=1]="HmacMd5",e[e["HmacSha1"]=2]="HmacSha1",e[e["HmacSha256"]=3]="HmacSha256"})(e.MacType||(e.MacType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["SocketSendError"]=1e5]="SocketSendError",e[e["SocketReceiveError"]=100001]="SocketReceiveError",e[e["SocketClosed"]=100002]="SocketClosed",e[e["SocketSendBufferFull"]=100003]="SocketSendBufferFull",e[e["IPProtocolMismatch"]=100004]="IPProtocolMismatch",e[e["PacketTooLarge"]=100005]="PacketTooLarge",e[e["NetworkUnreachable"]=100006]="NetworkUnreachable",e[e["StunTryAlternate"]=114e3]="StunTryAlternate",e[e["StunBadRequest"]=114001]="StunBadRequest",e[e["StunUnauthorized"]=114002]="StunUnauthorized",e[e["StunTurnForbidden"]=114003]="StunTurnForbidden",e[e["StunTurnMobilityForbidden"]=114004]="StunTurnMobilityForbidden",e[e["StunUnknownAttribute"]=114005]="StunUnknownAttribute",e[e["StunStaleCredentials"]=114006]="StunStaleCredentials",e[e["StunIntegrityCheckFailure"]=114007]="StunIntegrityCheckFailure",e[e["StunMissingUsername"]=114008]="StunMissingUsername",e[e["StunTurnAllocationMismatch"]=114009]="StunTurnAllocationMismatch",e[e["StunStaleNonce"]=114010]="StunStaleNonce",e[e["StunAddressFamilyNotSupported"]=114011]="StunAddressFamilyNotSupported",e[e["StunTurnWrongCredentials"]=114012]="StunTurnWrongCredentials",e[e["StunTurnUnsupportedTransportProtocol"]=114013]="StunTurnUnsupportedTransportProtocol",e[e["StunTurnPeerAddressFamilyMismatch"]=114014]="StunTurnPeerAddressFamilyMismatch",e[e["StunTurnConnectionAlreadyExists"]=114015]="StunTurnConnectionAlreadyExists",e[e["StunTurnConnectionTimeoutOrFailure"]=114016]="StunTurnConnectionTimeoutOrFailure",e[e["StunTurnAllocationQuotaReached"]=114017]="StunTurnAllocationQuotaReached",e[e["StunIceRoleConflict"]=114018]="StunIceRoleConflict",e[e["StunServerError"]=114019]="StunServerError",e[e["StunTurnInsufficientCapacity"]=114020]="StunTurnInsufficientCapacity",e[e["StunInvalidResponseType"]=114021]="StunInvalidResponseType",e[e["StunInvalidErrorCode"]=114022]="StunInvalidErrorCode",e[e["StunInvalidTransactionId"]=114023]="StunInvalidTransactionId",e[e["StunUnknownStunErrorCode"]=114024]="StunUnknownStunErrorCode",e[e["StunInvalidMessageIntegrity"]=114025]="StunInvalidMessageIntegrity",e[e["SocketIPError"]=115001]="SocketIPError",e[e["IceLocalRelayedDatagramCandidateError"]=101e3]="IceLocalRelayedDatagramCandidateError",e[e["IceLocalServerReflexiveCandidateError"]=101001]="IceLocalServerReflexiveCandidateError",e[e["SocketManagerInvalidState"]=101002]="SocketManagerInvalidState",e[e["IceStartError"]=102e3]="IceStartError",e[e["IceUnsuitableSocketAssignment"]=102001]="IceUnsuitableSocketAssignment",e[e["IceAllPortsInUse"]=102002]="IceAllPortsInUse",e[e["IceLocalAddressUnavailable"]=102003]="IceLocalAddressUnavailable",e[e["IceGenericGathererError"]=102004]="IceGenericGathererError",e[e["IceRefreshTimeout"]=103e3]="IceRefreshTimeout",e[e["IceRefreshError"]=103001]="IceRefreshError",e[e["IceCreatePermissionTimeout"]=104e3]="IceCreatePermissionTimeout",e[e["IceCreatePermissionError"]=104001]="IceCreatePermissionError",e[e["IceConnectivityCheckFailed"]=104002]="IceConnectivityCheckFailed",e[e["IceSendError"]=105e3]="IceSendError",e[e["IcePeerReflexiveError"]=105001]="IcePeerReflexiveError",e[e["IncompatibleIceSetup"]=105002]="IncompatibleIceSetup",e[e["DtlsInternalError"]=106e3]="DtlsInternalError",e[e["DtlsKeyExchangeFailed"]=106001]="DtlsKeyExchangeFailed",e[e["DtlsNotReady"]=106002]="DtlsNotReady",e[e["SctpNoPayloadData"]=107e3]="SctpNoPayloadData",e[e["SctpUnsupportedStream"]=107001]="SctpUnsupportedStream",e[e["SctpInvalidState"]=107002]="SctpInvalidState",e[e["SctpInternalError"]=107003]="SctpInternalError",e[e["MediaTransportFailed"]=108e3]="MediaTransportFailed",e[e["ReliableDataChannelOpenError"]=109e3]="ReliableDataChannelOpenError",e[e["ReliableDataChannelSendError"]=109001]="ReliableDataChannelSendError",e[e["ConnectionInvalidArchitecture"]=11e4]="ConnectionInvalidArchitecture",e[e["ConnectionInternalError"]=110001]="ConnectionInternalError",e[e["ConnectionTransportStartError"]=110002]="ConnectionTransportStartError",e[e["ConnectionTransportClosed"]=110003]="ConnectionTransportClosed",e[e["ConnectionDeadStream"]=110004]="ConnectionDeadStream",e[e["ConnectionNotEstablished"]=110005]="ConnectionNotEstablished",e[e["ConnectionRemoteFailure"]=110006]="ConnectionRemoteFailure",e[e["ConnectionSimulcastNotSupported"]=110007]="ConnectionSimulcastNotSupported",e[e["StreamDisabled"]=111e3]="StreamDisabled",e[e["StreamEncryptionMismatch"]=111001]="StreamEncryptionMismatch",e[e["StreamDirectionMismatch"]=111002]="StreamDirectionMismatch",e[e["DataStreamDirectionCannotBeChanged"]=111003]="DataStreamDirectionCannotBeChanged",e[e["InvalidStreamDirectionChange"]=111004]="InvalidStreamDirectionChange",e[e["LocalDescriptionError"]=112e3]="LocalDescriptionError",e[e["RemoteDescriptionError"]=112001]="RemoteDescriptionError",e[e["IceLocalRelayedStreamCandidateError"]=113e3]="IceLocalRelayedStreamCandidateError",e[e["IceInvalidServerAssignmentError"]=113001]="IceInvalidServerAssignmentError"})(e.ErrorCode||(e.ErrorCode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Get"]=1]="Get",e[e["Head"]=2]="Head",e[e["Post"]=3]="Post",e[e["Put"]=4]="Put",e[e["Patch"]=5]="Patch",e[e["Delete"]=6]="Delete"})(e.HttpMethod||(e.HttpMethod={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Verbose"]=1]="Verbose",e[e["Debug"]=2]="Debug",e[e["Info"]=3]="Info",e[e["Warn"]=4]="Warn",e[e["Error"]=5]="Error",e[e["Fatal"]=6]="Fatal",e[e["None"]=7]="None"})(e.LogLevel||(e.LogLevel={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Pending"]=1]="Pending",e[e["Resolved"]=2]="Resolved",e[e["Rejected"]=3]="Rejected"})(e.FutureState||(e.FutureState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Normal"]=1e3]="Normal",e[e["GoingAway"]=1001]="GoingAway",e[e["ProtocolError"]=1002]="ProtocolError",e[e["InvalidType"]=1003]="InvalidType",e[e["NoStatus"]=1005]="NoStatus",e[e["Abnormal"]=1006]="Abnormal",e[e["InvalidData"]=1007]="InvalidData",e[e["PolicyViolation"]=1008]="PolicyViolation",e[e["MessageTooLarge"]=1009]="MessageTooLarge",e[e["UnsupportedExtension"]=1010]="UnsupportedExtension",e[e["UnexpectedCondition"]=1011]="UnexpectedCondition",e[e["SecureHandshakeFailure"]=1015]="SecureHandshakeFailure"})(e.WebSocketStatusCode||(e.WebSocketStatusCode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Waiting"]=2]="Waiting",e[e["InProgress"]=3]="InProgress",e[e["Succeeded"]=4]="Succeeded",e[e["Failed"]=5]="Failed",e[e["Closed"]=6]="Closed",e[e["ConnectivityLost"]=7]="ConnectivityLost"})(e.CandidatePairState||(e.CandidatePairState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Host"]=1]="Host",e[e["ServerReflexive"]=2]="ServerReflexive",e[e["Relayed"]=3]="Relayed",e[e["PeerReflexive"]=4]="PeerReflexive",e[e["Unknown"]=5]="Unknown"})(e.CandidateType||(e.CandidateType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Encode"]=1]="Encode",e[e["Decode"]=2]="Decode"})(e.CodecType||(e.CodecType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Initializing"]=2]="Initializing",e[e["Connecting"]=3]="Connecting",e[e["Connected"]=4]="Connected",e[e["Failing"]=5]="Failing",e[e["Failed"]=6]="Failed",e[e["Closing"]=7]="Closing",e[e["Closed"]=8]="Closed"})(e.ConnectionState||(e.ConnectionState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Connecting"]=2]="Connecting",e[e["Connected"]=3]="Connected",e[e["Closing"]=4]="Closing",e[e["Closed"]=5]="Closed",e[e["Failed"]=6]="Failed"})(e.DataChannelState||(e.DataChannelState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Automatic"]=1]="Automatic",e[e["Balanced"]=2]="Balanced",e[e["FrameRate"]=3]="FrameRate",e[e["Resolution"]=4]="Resolution"})(e.VideoDegradationPreference||(e.VideoDegradationPreference={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Null"]=1]="Null",e[e["Aes128Strong"]=2]="Aes128Strong",e[e["Aes128Weak"]=3]="Aes128Weak",e[e["NullStrong"]=4]="NullStrong",e[e["NullWeak"]=5]="NullWeak"})(e.EncryptionMode||(e.EncryptionMode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Contain"]=1]="Contain",e[e["Cover"]=2]="Cover",e[e["Stretch"]=3]="Stretch"})(e.LayoutScale||(e.LayoutScale={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["Normal"]=1]="Normal",e[e["Caution"]=2]="Caution",e[e["Identical"]=3]="Identical",e[e["Sum"]=4]="Sum",e[e["Transport"]=5]="Transport",e[e["Inherit"]=6]="Inherit",e[e["IdenticalPerPT"]=7]="IdenticalPerPT",e[e["Special"]=8]="Special"})(e.AttributeCategory||(e.AttributeCategory={}))})(e.sdp||(e.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["UnknownAttribute"]=999666]="UnknownAttribute",e[e["DirectionAttribute"]=1]="DirectionAttribute",e[e["CategoryAttribute"]=2]="CategoryAttribute",e[e["CharacterSetAttribute"]=3]="CharacterSetAttribute",e[e["ConferenceTypeAttribute"]=4]="ConferenceTypeAttribute",e[e["CryptoAttribute"]=5]="CryptoAttribute",e[e["FormatParametersAttribute"]=6]="FormatParametersAttribute",e[e["FrameRateAttribute"]=7]="FrameRateAttribute",e[e["KeywordsAttribute"]=8]="KeywordsAttribute",e[e["LanguageAttribute"]=9]="LanguageAttribute",e[e["MaxPacketTimeAttribute"]=10]="MaxPacketTimeAttribute",e[e["OrientationAttribute"]=11]="OrientationAttribute",e[e["PacketTimeAttribute"]=12]="PacketTimeAttribute",e[e["QualityAttribute"]=13]="QualityAttribute",e[e["SdpLanguageAttribute"]=14]="SdpLanguageAttribute",e[e["SetupAttribute"]=15]="SetupAttribute",e[e["ToolAttribute"]=16]="ToolAttribute",e[e["MediaStreamIdSemanticAttribute"]=17]="MediaStreamIdSemanticAttribute",e[e["MediaStreamIdAttribute"]=18]="MediaStreamIdAttribute",e[e["BundleOnlyAttribute"]=40]="BundleOnlyAttribute",e[e["IceCandidateAttribute"]=19]="IceCandidateAttribute",e[e["IceFingerprintAttribute"]=20]="IceFingerprintAttribute",e[e["IceLiteAttribute"]=21]="IceLiteAttribute",e[e["IceMismatchAttribute"]=22]="IceMismatchAttribute",e[e["IceOptionsAttribute"]=23]="IceOptionsAttribute",e[e["IcePasswordAttribute"]=24]="IcePasswordAttribute",e[e["IceUfragAttribute"]=25]="IceUfragAttribute",e[e["IceRemoteCandidatesAttribute"]=26]="IceRemoteCandidatesAttribute",e[e["RtpMapAttribute"]=27]="RtpMapAttribute",e[e["RtpSsrcAttribute"]=28]="RtpSsrcAttribute",e[e["RtpExtMapAttribute"]=29]="RtpExtMapAttribute",e[e["RtcpAttribute"]=30]="RtcpAttribute",e[e["RtcpFeedbackAttribute"]=31]="RtcpFeedbackAttribute",e[e["RtcpMuxAttribute"]=32]="RtcpMuxAttribute",e[e["SctpPortAttribute"]=33]="SctpPortAttribute",e[e["SctpMapAttribute"]=34]="SctpMapAttribute",e[e["SctpMaxMessageSizeAttribute"]=35]="SctpMaxMessageSizeAttribute",e[e["GroupAttribute"]=36]="GroupAttribute",e[e["RtpRidAttribute"]=37]="RtpRidAttribute",e[e["SimulcastAttribute"]=38]="SimulcastAttribute",e[e["RtpSsrcGroupAttribute"]=39]="RtpSsrcGroupAttribute",e[e["MutedAttribute"]=41]="MutedAttribute",e[e["ContentAttribute"]=42]="ContentAttribute"})(e.AttributeType||(e.AttributeType={}))})(e.sdp||(e.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["LipSynchronization"]=1]="LipSynchronization",e[e["FlowIdentification"]=2]="FlowIdentification",e[e["Bundling"]=3]="Bundling",e[e["Unknown"]=4]="Unknown"})(e.GroupSemanticsType||(e.GroupSemanticsType={}))})(e.sdp||(e.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){(function(e){e[e["Unknown"]=1]="Unknown",e[e["Trickle"]=2]="Trickle"})(e.OptionTagType||(e.OptionTagType={}))})(e.ice||(e.ice={}))})(e.sdp||(e.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["Wms"]=1]="Wms"})(e.MediaStreamIdSemanticToken||(e.MediaStreamIdSemanticToken={}))})(e.sdp||(e.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Offer"]=1]="Offer",e[e["Answer"]=2]="Answer"})(e.SessionDescriptionType||(e.SessionDescriptionType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["SendReceive"]=1]="SendReceive",e[e["SendOnly"]=2]="SendOnly",e[e["ReceiveOnly"]=3]="ReceiveOnly",e[e["Inactive"]=4]="Inactive",e[e["Unset"]=5]="Unset"})(e.StreamDirection||(e.StreamDirection={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Initializing"]=2]="Initializing",e[e["Connecting"]=3]="Connecting",e[e["Connected"]=4]="Connected",e[e["Failing"]=5]="Failing",e[e["Failed"]=6]="Failed",e[e["Closing"]=7]="Closing",e[e["Closed"]=8]="Closed"})(e.StreamState||(e.StreamState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Audio"]=1]="Audio",e[e["Video"]=2]="Video",e[e["Application"]=3]="Application",e[e["Message"]=4]="Message",e[e["Text"]=5]="Text"})(e.StreamType||(e.StreamType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Unknown"]=1]="Unknown",e[e["Camera"]=2]="Camera",e[e["Screen"]=3]="Screen"})(e.VideoType||(e.VideoType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.CcmTmmbnPolicy||(e.CcmTmmbnPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.CcmTmmbrPolicy||(e.CcmTmmbrPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.CcmLrrPolicy||(e.CcmLrrPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.CcmFirPolicy||(e.CcmFirPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.NackPliPolicy||(e.NackPliPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["RtpStreamId"]=3]="RtpStreamId"})(e.SimulcastMode||(e.SimulcastMode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Balanced"]=1]="Balanced",e[e["MaxCompatibility"]=2]="MaxCompatibility",e[e["MaxBundle"]=3]="MaxBundle",e[e["Disabled"]=4]="Disabled"})(e.BundlePolicy||(e.BundlePolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Required"]=1]="Required",e[e["Negotiated"]=2]="Negotiated",e[e["Disabled"]=3]="Disabled"})(e.EncryptionPolicy||(e.EncryptionPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Checking"]=2]="Checking",e[e["Connected"]=3]="Connected",e[e["Completed"]=4]="Completed",e[e["Failed"]=5]="Failed",e[e["Disconnected"]=6]="Disconnected",e[e["Closed"]=7]="Closed"})(e.IceConnectionState||(e.IceConnectionState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Gathering"]=2]="Gathering",e[e["Complete"]=3]="Complete",e[e["Closing"]=4]="Closing",e[e["Closed"]=5]="Closed",e[e["Failed"]=6]="Failed"})(e.IceGatheringState||(e.IceGatheringState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["All"]=1]="All",e[e["NoHost"]=2]="NoHost",e[e["Relay"]=3]="Relay"})(e.IceGatherPolicy||(e.IceGatherPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["TopLeft"]=1]="TopLeft",e[e["Top"]=2]="Top",e[e["TopRight"]=3]="TopRight",e[e["Left"]=4]="Left",e[e["Center"]=5]="Center",e[e["Right"]=6]="Right",e[e["BottomLeft"]=7]="BottomLeft",e[e["Bottom"]=8]="Bottom",e[e["BottomRight"]=9]="BottomRight"})(e.LayoutAlignment||(e.LayoutAlignment={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Horizontal"]=1]="Horizontal",e[e["Vertical"]=2]="Vertical"})(e.LayoutDirection||(e.LayoutDirection={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["FloatLocal"]=1]="FloatLocal",e[e["FloatRemote"]=2]="FloatRemote",e[e["Block"]=3]="Block",e[e["Inline"]=4]="Inline",e[e["InlineOverflow"]=5]="InlineOverflow"})(e.LayoutMode||(e.LayoutMode={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["TopLeft"]=1]="TopLeft",e[e["TopRight"]=2]="TopRight",e[e["BottomRight"]=3]="BottomRight",e[e["BottomLeft"]=4]="BottomLeft"})(e.LayoutOrigin||(e.LayoutOrigin={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Starting"]=2]="Starting",e[e["Started"]=3]="Started",e[e["Stopping"]=4]="Stopping",e[e["Stopped"]=5]="Stopped",e[e["Destroying"]=6]="Destroying",e[e["Destroyed"]=7]="Destroyed"})(e.LocalMediaState||(e.LocalMediaState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.NackPolicy||(e.NackPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.RedFecPolicy||(e.RedFecPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Disabled"]=1]="Disabled",e[e["Negotiated"]=2]="Negotiated"})(e.RembPolicy||(e.RembPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["OneByte"]=1]="OneByte",e[e["TwoByte"]=2]="TwoByte"})(e.HeaderExtensionForm||(e.HeaderExtensionForm={}))})(e.rtp||(e.rtp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Negotiated"]=2]="Negotiated",e[e["Disabled"]=3]="Disabled"})(e.SdesPolicy||(e.SdesPolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["HaveLocalOffer"]=2]="HaveLocalOffer",e[e["HaveRemoteOffer"]=3]="HaveRemoteOffer",e[e["Stable"]=4]="Stable"})(e.SignallingState||(e.SignallingState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Gatherer"]=1]="Gatherer",e[e["IceTransport"]=2]="IceTransport",e[e["DtlsTransport"]=3]="DtlsTransport",e[e["SctpTransport"]=4]="SctpTransport",e[e["ReliableDataTransport"]=5]="ReliableDataTransport",e[e["SrtpTransport"]=6]="SrtpTransport",e[e["Unset"]=7]="Unset",e[e["MediaTransport"]=8]="MediaTransport"})(e.TransportType||(e.TransportType={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["NotSupported"]=1]="NotSupported",e[e["FullTrickle"]=2]="FullTrickle",e[e["HalfTrickle"]=3]="HalfTrickle"})(e.TrickleIcePolicy||(e.TrickleIcePolicy={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Offerer"]=1]="Offerer",e[e["Answerer"]=2]="Answerer"})(e.PeerRole||(e.PeerRole={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Registering"]=2]="Registering",e[e["Registered"]=3]="Registered",e[e["Unregistering"]=4]="Unregistering",e[e["Unregistered"]=5]="Unregistered"})(e.ClientState||(e.ClientState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["Unknown"]=1]="Unknown",e[e["Pending"]=2]="Pending",e[e["Proceeding"]=3]="Proceeding",e[e["Sent"]=4]="Sent",e[e["Cancelled"]=5]="Cancelled",e[e["Cancelling"]=6]="Cancelling",e[e["Rejected"]=7]="Rejected",e[e["Accepted"]=8]="Accepted",e[e["NotFound"]=9]="NotFound",e[e["Busy"]=10]="Busy",e[e["NoResponse"]=11]="NoResponse",e[e["Invalid"]=12]="Invalid",e[e["AlreadyInvited"]=13]="AlreadyInvited"})(e.InvitationState||(e.InvitationState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Connected"]=2]="Connected",e[e["Disconnected"]=3]="Disconnected"})(e.NetworkConnectionState||(e.NetworkConnectionState={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["New"]=1]="New",e[e["Connecting"]=2]="Connecting",e[e["Connected"]=3]="Connected",e[e["Disconnecting"]=4]="Disconnecting",e[e["Disconnected"]=5]="Disconnected"})(e.ClientState||(e.ClientState={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["Low"]=1]="Low",e[e["High"]=2]="High",e[e["Default"]=1]="Default"})(e.ConcurrencyMode||(e.ConcurrencyMode={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["WebSocket"]=1]="WebSocket",e[e["LongPolling"]=2]="LongPolling",e[e["CallbackPolling"]=3]="CallbackPolling",e[e["IFrame"]=4]="IFrame",e[e["Flash"]=5]="Flash",e[e["NotSet"]=99]="NotSet"})(e.ConnectionType||(e.ConnectionType={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["None"]=1]="None",e[e["Network"]=2]="Network",e[e["Message"]=3]="Message"})(e.FailureSource||(e.FailureSource={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["Connect"]=1]="Connect",e[e["Disconnect"]=2]="Disconnect",e[e["Bind"]=3]="Bind",e[e["Unbind"]=4]="Unbind",e[e["Subscribe"]=5]="Subscribe",e[e["Unsubscribe"]=6]="Unsubscribe",e[e["Publish"]=7]="Publish",e[e["Service"]=9]="Service",e[e["Stream"]=10]="Stream",e[e["Unknown"]=11]="Unknown"})(e.MessageType||(e.MessageType={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(e){(function(e){(function(e){e[e["Retry"]=1]="Retry",e[e["Handshake"]=2]="Handshake",e[e["None"]=3]="None",e[e["NotSet"]=99]="NotSet"})(e.Reconnect||(e.Reconnect={}))})(e.signalling||(e.signalling={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o0){i.setValue(8-r);for(var a=0;ai.length)e.liveswitch.Log.error("start + length greater than outputFrame length");else{var c=void 0,h=void 0;r?(c=o+l,h=o):(c=o,h=o+l);for(var p=o;pi.length)e.liveswitch.Log.error("start + length greater than outputFrame length");else{var w=void 0,u=void 0,v=void 0,f=void 0;l?(w=a+c,u=a):(w=a,u=a+c);var g=n+1,m=new Array(g),y=2*o;for(v=0;v1&&(m[v]=m[v]+p*(v-1));if(e.liveswitch.Global.equals(r,270))for(v=1;v<=y;v+=2){f=1;while(f=0;f--)i[w++]=t[m[f]+v],i[u++]=t[m[f]+(v+1)];else if(e.liveswitch.Global.equals(r,180))for(v=a+h-1;v>=a;v-=2)i[w++]=t[v-1],i[u++]=t[v];else e.liveswitch.Binary.deinterleave(t,i,a,h,l)}}},t.fromBytes1=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;return e.liveswitch.Global.equals(1&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),7-o),1)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes10=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;if(o>=7){if(i+2=8)o-=8,i++;if(o>=6){if(i+2=8)o-=8,i++;if(o>=5){if(i+2=8)o-=8,i++;if(o>=4){if(i+2=8)o-=8,i++;if(o>=3){if(i+2=8)o-=8,i++;if(o>=2){if(i+2=8)o-=8,i++;return 131071&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes24(t,i,!1),7-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes18=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;if(o>=7){if(i+3=8)o-=8,i++;if(o>=6){if(i+3=8)o-=8,i++;return 3&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),6-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes20=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;if(o>=5){if(i+3=8)o-=8,i++;if(o>=4){if(i+3=8)o-=8,i++;if(o>=3){if(i+3=8)o-=8,i++;if(o>=2){if(i+3=8)o-=8,i++;return 7&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),5-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes32=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]);var n=0;return o?(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24)):(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0))}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes4=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;return 15&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),4-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes40=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]);var n=0;return o?(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32)):(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0))}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes48=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]);var n=0;return o?(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40)):(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0))}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes5=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;return 31&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),3-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes56=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]);var n=0;return o?(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),48)):(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),48),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0))}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes6=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;return 63&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),2-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes64=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]);var n=0;return o?(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),48),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),56)):(n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),56),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),48),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),40),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),32),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),24),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),16),n|=e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),8),n|e.liveswitch.BitAssistant.leftShiftLong(e.liveswitch.BitAssistant.castLong(t[i++]),0))}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes7=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;return 127&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes8(t,i),1-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes8=function(t,i){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length)return i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.BitAssistant.leftShiftInteger(e.liveswitch.BitAssistant.castInteger(t[i]),0);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fromBytes9=function(t,i,o){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);while(o>=8)o-=8,i++;if(i+1>=t.length)throw new e.liveswitch.Exception("Input data is not large enough to read 9 bits.");return 511&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fromBytes16(t,i,!1),7-o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.interleave=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=arguments[0],i=arguments[1];e.liveswitch.Binary.interleave(t,i,0,t.length,!1)}else if(4==arguments.length){t=arguments[0],i=arguments[1];var o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]);e.liveswitch.Binary.interleave(t,i,o,n,!1)}else{if(5!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=arguments[0],i=arguments[1],o=e.liveswitch.Global.toInt(arguments[2]);var s=e.liveswitch.Global.toInt(arguments[3]),r=arguments[4],a=o+s,l=e.liveswitch.MathAssistant.floor(s/2);if(a>i.length)e.liveswitch.Log.error("start + length greater than outputFrame length");else{var c=void 0,h=void 0;r?(c=o+l,h=o):(c=o,h=o+l);for(var p=0,d=0;d0?s*n:o*n,h=o*n*2,p=s>0?s-o:o,d=a+h;if(d>i.length)e.liveswitch.Log.error("start + length greater than outputFrame length");else{var w=void 0,u=void 0,v=void 0,f=void 0;l?(w=a+c,u=a):(w=a,u=a+c);var g=n+1,m=new Array(g),y=o;for(v=0;v=0;f--)i[b++]=t[w+m[f]+v+p],i[b++]=t[u+m[f]+v+p];else if(e.liveswitch.Global.equals(r,180))for(v=c-1;v>=0;v--)i[b++]=t[w+v],i[b++]=t[u+v];else e.liveswitch.Binary.interleave(t,i,a,2*c,l)}}},t.roundUp=function(t,i){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){if(t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Global.equals(i,0))return t;var o=t%i;return e.liveswitch.Global.equals(o,0)?t:t+i-o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes=function(t,i,o,n,s,r){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),6==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),s=e.liveswitch.Global.toInt(arguments[4]),r=e.liveswitch.Global.toInt(arguments[5]);var a=void 0,l=void 0;if(i>=8)return e.liveswitch.Binary.toBytes(t,i%8,o,n,s+e.liveswitch.MathAssistant.floor(i/8),r);var c=e.liveswitch.Binary.roundUp(r+i,8),h=e.liveswitch.MathAssistant.floor(c/8);if(s+h>n.length)throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Output data is not large enough to write {0} bits.",e.liveswitch.NumberExtensions.toString(r)));if(o)throw new e.liveswitch.Exception("Little-endian bit-level serialization is not supported.");var p=e.liveswitch.BitAssistant.leftShiftInteger(t,c-r-i);return h>0&&(a=255&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fm_liveswitch_Binary___bitmasks[r-1][0],i),l=c-8,n[s]=n[s]&a|e.liveswitch.BitAssistant.rightShiftInteger(p&e.liveswitch.BitAssistant.leftShiftInteger(~a,l),l),s++),h>1&&(a=255&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fm_liveswitch_Binary___bitmasks[r-1][1],i),l=c-16,n[s]=n[s]&a|e.liveswitch.BitAssistant.rightShiftInteger(p&e.liveswitch.BitAssistant.leftShiftInteger(~a,l),l),s++),h>2&&(a=255&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fm_liveswitch_Binary___bitmasks[r-1][2],i),l=c-24,n[s]=n[s]&a|e.liveswitch.BitAssistant.rightShiftInteger(p&e.liveswitch.BitAssistant.leftShiftInteger(~a,l),l),s++),h>3&&(a=255&e.liveswitch.BitAssistant.rightShiftInteger(e.liveswitch.Binary.fm_liveswitch_Binary___bitmasks[r-1][3],i),l=c-32,n[s]=n[s]&a|e.liveswitch.BitAssistant.rightShiftInteger(p&e.liveswitch.BitAssistant.leftShiftInteger(~a,l),l),s++),n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes1=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),o=1,n=0;while(i>=8)i-=8,n++,o++;return e.liveswitch.Binary.toBytes1(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t?1:0,i,!1,s,n,1)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes10=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=7?e.liveswitch.Binary.toBytes10(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes10(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,10)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes11=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=6?e.liveswitch.Binary.toBytes11(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes11(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,11)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes12=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=5?e.liveswitch.Binary.toBytes12(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes12(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,12)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes13=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=4?e.liveswitch.Binary.toBytes13(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes13(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,13)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes14=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=3?e.liveswitch.Binary.toBytes14(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes14(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,14)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes15=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return i>=2?e.liveswitch.Binary.toBytes15(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes15(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,15)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes16=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes16(t,i,new Uint8Array(2),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+1=8)i-=8,s++,n++;return e.liveswitch.Binary.toBytes17(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,17)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes18=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=7?e.liveswitch.Binary.toBytes18(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes18(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,18)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes19=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=6?e.liveswitch.Binary.toBytes19(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes19(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,19)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes2=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=1,n=0;while(i>=8)i-=8,n++,o++;return i>=7?e.liveswitch.Binary.toBytes2(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes2(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,2)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes20=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=5?e.liveswitch.Binary.toBytes20(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes20(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,20)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes21=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=4?e.liveswitch.Binary.toBytes21(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes21(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,21)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes22=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=3?e.liveswitch.Binary.toBytes22(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes22(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,!1,r,s,22)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes23=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=3,s=0;while(i>=8)i-=8,s++,n++;return i>=2?e.liveswitch.Binary.toBytes23(t,i,o,new Uint8Array(n+1),s):e.liveswitch.Binary.toBytes23(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,23)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes24=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes24(t,i,new Uint8Array(3),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+2=8)i-=8,n++,o++;return i>=6?e.liveswitch.Binary.toBytes3(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes3(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,3)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes32=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes32(t,i,new Uint8Array(4),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+3=8)i-=8,n++,o++;return i>=5?e.liveswitch.Binary.toBytes4(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes4(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,4)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes40=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes40(t,i,new Uint8Array(5),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+4=8)i-=8,n++,o++;return i>=4?e.liveswitch.Binary.toBytes5(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes5(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,5)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes56=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes56(t,i,new Uint8Array(7),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+6=8)i-=8,n++,o++;return i>=3?e.liveswitch.Binary.toBytes6(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes6(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,6)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes64=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];return e.liveswitch.Binary.toBytes64(t,i,new Uint8Array(8),0)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=arguments[1];var o=arguments[2],n=e.liveswitch.Global.toInt(arguments[3]);return n+7=8)i-=8,n++,o++;return i>=2?e.liveswitch.Binary.toBytes7(t,i,new Uint8Array(o+1),n):e.liveswitch.Binary.toBytes7(t,i,new Uint8Array(o),n)}if(4==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var s=arguments[2];n=e.liveswitch.Global.toInt(arguments[3]);while(i>=8)i-=8,n++;return e.liveswitch.Binary.toBytes(t,i,!1,s,n,7)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes8=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.toBytes8(t,new Uint8Array(1),0)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1],o=e.liveswitch.Global.toInt(arguments[2]);if(o>=i.length)throw new e.liveswitch.Exception("Output data is not large enough to write 8 bits.");return i[o]=e.liveswitch.BitAssistant.rightShiftInteger(255&t,0),i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toBytes9=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),3==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=2,s=0;while(i>=8)i-=8,s++,n++;return e.liveswitch.Binary.toBytes9(t,i,o,new Uint8Array(n),s)}if(5==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2];var r=arguments[3];s=e.liveswitch.Global.toInt(arguments[4]);while(i>=8)i-=8,s++;return e.liveswitch.Binary.toBytes(t,i,o,r,s,9)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.transform=function(){if(e.liveswitch.Binary.fmliveswitchBinaryInitialize(),6==arguments.length){var t=arguments[0],i=arguments[1],o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]),s=e.liveswitch.Global.toInt(arguments[4]),r=e.liveswitch.Global.toInt(arguments[5]);e.liveswitch.Binary.transform(t,i,o,n,s,r,0,0)}else if(8==arguments.length){t=arguments[0],i=arguments[1],o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]),s=e.liveswitch.Global.toInt(arguments[4]),r=e.liveswitch.Global.toInt(arguments[5]);var a=e.liveswitch.Global.toInt(arguments[6]),l=e.liveswitch.Global.toInt(arguments[7]);e.liveswitch.Binary.transform(t,i,o,n,s,r,a,l,1)}else if(9==arguments.length){t=arguments[0],i=arguments[1],o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]),s=e.liveswitch.Global.toInt(arguments[4]),r=e.liveswitch.Global.toInt(arguments[5]),a=e.liveswitch.Global.toInt(arguments[6]),l=e.liveswitch.Global.toInt(arguments[7]);var c=e.liveswitch.Global.toInt(arguments[8]),h=o*n*c,p=s>0?s*n*c:h,d=l>0?l:a,w=s>0?(s-o)*c:0,u=l+h;if(u>i.length)e.liveswitch.Log.error("otuputStart + calculated output plane length is greater than outputFrame length");else{var v=void 0,f=void 0,g=void 0,m=n+1,y=new Array(m),b=o*c;for(v=0;v=0)i[d++]=t[y[f]-v-g],g--;f++}}else if(e.liveswitch.Global.equals(r,90))for(v=0;v=0;f--){g=0;while(g=a;v-=c)if(e.liveswitch.Global.equals(w,0)||e.liveswitch.Global.equals(x,0)||!e.liveswitch.Global.equals(x%b,0))for(g=c-1;g>=0;g--)i[d++]=t[v-g],x++;else v-=w-c,x=0}else if(e.liveswitch.Global.equals(w,0))e.liveswitch.BitAssistant.copy(t,a,i,l,p);else for(v=0;v=7){if(i+2=6){if(i+2=5){if(i+2=4){if(i+2=3){if(i+2=2){if(i+2=7){if(i+3this.getLength())return null;var i=e.liveswitch.DataBuffer.allocate(t,this.getLittleEndian());if(this.__allowRead){if(this.getReadOffset()+t<=this.getLength())i.write(this.__buffer.subset(this.getReadOffset(),t),0),this.__buffer.set(0,this.getReadOffset(),t);else{var o=this.__buffer.getLength()-this.getReadOffset(),n=t-o;i.write(this.__buffer.subset(this.getReadOffset(),o),0),i.write(this.__buffer.subset(0,n),o),this.__buffer.set(0,this.getReadOffset(),o),this.__buffer.set(0,0,n)}this.setReadOffset((this.getReadOffset()+t)%this.getLength())}return i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setLatency=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._latency=e.liveswitch.Global.toInt(t)},t.prototype.setLittleEndian=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._littleEndian=t},t.prototype.setReadOffset=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._readOffset=e.liveswitch.Global.toInt(t)},t.prototype.setWriteOffset=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._writeOffset=e.liveswitch.Global.toInt(t)},t.prototype.write=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");for(var i=void 0,o=0;o=this.getReadOffset()+this.getLatency()&&(this.__allowRead=!0)},t}();t.CircularBuffer=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i0?this.__values[0]:null;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getValues=function(){if(0==arguments.length)return this.__valuesCache;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.last=function(){if(0==arguments.length){var t=this.lastOrDefault();if(e.liveswitch.Global.equals(t,null))throw new e.liveswitch.Exception("The collection does not contain any values.");return t}if(1==arguments.length){var i=arguments[0];t=this.lastOrDefault(i);if(e.liveswitch.Global.equals(t,null))throw new e.liveswitch.Exception("The collection does not contain any matching values.");return t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.lastOrDefault=function(){if(0==arguments.length)return this.lastOrDefault(null);if(1==arguments.length){for(var t=arguments[0],i=e.liveswitch.ArrayExtensions.getCount(this.__values)-1;i>-1;i--){var o=this.__values[i];if(e.liveswitch.Global.equals(t,null)||t(o))return o}return null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.remove=function(t){if(1==arguments.length){var i=!1;return e.liveswitch.Global.equals(t,null)||(e.liveswitch.ArrayExtensions.remove(this.__values,t)&&(this.__valuesCache=this.arrayFromList(this.__values),i=!0,this.removeSuccess(t)),i&&this.removeSuccessNoLock(t)),i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.removeAll=function(){if(0!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var t=void 0;t=this.arrayFromList(this.__values),this.__values=new Array,this.__valuesCache=this.arrayFromList(this.__values);for(var i=0,o=t;i0){var t=this.__values[0];return this.remove(t),t}return null}if(1==arguments.length){for(var i=arguments[0],o=0;o0){var t=this.__values[e.liveswitch.ArrayExtensions.getCount(this.__values)-1];return this.remove(t),t}return null}if(1==arguments.length){for(var i=arguments[0],o=e.liveswitch.ArrayExtensions.getCount(this.__values)-1;o>=0;o++){var n=this.__values[o];if(i(n))return n}return null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.removeMany=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(!e.liveswitch.Global.equals(t,null)&&t.length>0){for(var i=new Array,o=0,n=t;ot)for(var o=this.__min.getValue(),n=e.liveswitch.MathAssistant.min(o,t);!e.liveswitch.Global.equals(this.__min.compareAndSwap(o,n),o);n=e.liveswitch.MathAssistant.min(o,t))o=this.__min.getValue();if(this.__max.getValue()e.liveswitch.StringExtensions.getLength(t))return s.setValue(null),r.setValue(i),!1;if(s.setValue(t.substring(i)),r.setValue(i+e.liveswitch.StringExtensions.getLength(s.getValue())),!e.liveswitch.Global.equals(n,null)&&!e.liveswitch.Global.equals(n.length,0)){var a=e.liveswitch.Iso8601Timestamp.getMinimumNeedleIndex(s.getValue(),n);if(e.liveswitch.Global.equals(a,-1))return!0;s.setValue(e.liveswitch.StringExtensions.substring(t,i,a)),r.setValue(i+e.liveswitch.StringExtensions.getLength(s.getValue()))}return!0}return i+o>e.liveswitch.StringExtensions.getLength(t)?(s.setValue(null),r.setValue(i),!1):(s.setValue(e.liveswitch.StringExtensions.substring(t,i,o)),r.setValue(i+e.liveswitch.StringExtensions.getLength(s.getValue())),e.liveswitch.Global.equals(n,null)||e.liveswitch.Global.equals(n.length,0)||e.liveswitch.Global.equals(e.liveswitch.Iso8601Timestamp.getMinimumNeedleIndex(s.getValue(),n),-1))}if(5==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[2])||e.liveswitch.Util.isNumber(arguments[2]))){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),s=arguments[3],r=arguments[4];var l=e.liveswitch.Iso8601Timestamp.tryRead(t,i,o,null,s,r);return l}if(5==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[2])||e.liveswitch.Util.isArray(arguments[2])&&(0==arguments[2].length||e.liveswitch.Util.isNullOrUndefined(arguments[2][0])||e.liveswitch.Util.isString(arguments[2][0])))){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),n=arguments[2],s=arguments[3],r=arguments[4],l=e.liveswitch.Iso8601Timestamp.tryRead(t,i,-1,n,s,r);return l}if(4==arguments.length){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),s=arguments[2],r=arguments[3];return i+e.liveswitch.StringExtensions.getLength(s)>e.liveswitch.StringExtensions.getLength(t)?(r.setValue(i),!1):e.liveswitch.Global.equals(e.liveswitch.StringExtensions.substring(t,i,e.liveswitch.StringExtensions.getLength(s)),s)?(r.setValue(i+e.liveswitch.StringExtensions.getLength(s)),!0):(r.setValue(i),!1)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t}();t.Iso8601Timestamp=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;ol)throw new e.liveswitch.Exception("Minimum pool size cannot be greater than maximum pool size.");this.__createObject=r,this.setMinSize(a),this.setMaxSize(l),this.__stack=new e.liveswitch.ManagedConcurrentStack,this.__createObjectCounter=new e.liveswitch.AtomicInteger;for(var c=0;cl)throw new e.liveswitch.Exception("Minimum pool size cannot be greater than maximum pool size.");this.__createObject=h,this.setMinSize(p),this.setMaxSize(l),this.__stack=new e.liveswitch.ManagedConcurrentStack,this.__createObjectCounter=new e.liveswitch.AtomicInteger;for(c=0;cl)throw new e.liveswitch.Exception("Minimum pool size cannot be greater than maximum pool size.");this.__createObject=o,this.setMinSize(s),this.setMaxSize(l),this.__stack=new e.liveswitch.ManagedConcurrentStack,this.__createObjectCounter=new e.liveswitch.AtomicInteger;for(c=0;cthis.getMaxSize())throw this.__createObjectCounter.decrement(),new e.liveswitch.Exception("Could not create pooled object. Maximum size reached.");return this.__createObject()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getAvailable=function(){if(0==arguments.length)return this.__stack.getCount();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getMaxSize=function(){if(0==arguments.length)return this._maxSize;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getMinSize=function(){if(0==arguments.length)return this._minSize;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getSize=function(){if(0==arguments.length)return this.__createObjectCounter.getValue();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.put=function(t){if(1==arguments.length)return!e.liveswitch.Global.equals(t,null)&&!this.__isDestroyed&&(this.__stack.push(t),!0);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setMaxSize=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._maxSize=e.liveswitch.Global.toInt(t)},t.prototype.setMinSize=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._minSize=e.liveswitch.Global.toInt(t)},t}();t.Pool=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o>12&15),o=e.liveswitch.JsonSerializer.intToHex(t>>8&15),n=e.liveswitch.JsonSerializer.intToHex(t>>4&15),s=e.liveswitch.JsonSerializer.intToHex(15&t);return e.liveswitch.StringExtensions.concat(["\\u",String.fromCharCode(i),String.fromCharCode(o),String.fromCharCode(n),String.fromCharCode(s)])}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.deserializeBoolean=function(t){if(1==arguments.length){if(!e.liveswitch.StringExtensions.isNullOrEmpty(t)){if(t=e.liveswitch.StringExtensions.trim(t),e.liveswitch.Global.equals(t,"null"))return null;var i=!1,o=new e.liveswitch.Holder(i),n=e.liveswitch.ParseAssistant.tryParseBooleanValue(t,o);if(i=o.getValue(),n)return i}return null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.deserializeBooleanArray=function(t){if(1==arguments.length){if(e.liveswitch.StringExtensions.isNullOrEmpty(t))return null;if(t=e.liveswitch.StringExtensions.trim(t),e.liveswitch.Global.equals(t,"null"))return null;var i=null;if(e.liveswitch.Global.equals(t.charCodeAt(0),91))if(t=e.liveswitch.StringExtensions.substring(t,1,e.liveswitch.StringExtensions.getLength(t)-2),e.liveswitch.StringExtensions.isNullOrEmpty(t))i=new Array(0);else{var o=e.liveswitch.StringExtensions.split(t,[44]);i=new Array(o.length);for(var n=0;n2){t=e.liveswitch.StringExtensions.concat(e.liveswitch.StringExtensions.substring(t,1,e.liveswitch.StringExtensions.getLength(t)-2),",");for(var s=0,r=0,a=!1,l=-2,c=e.liveswitch.StringType.None,h=0,p=0,d=e.liveswitch.StringExtensions.empty,w=e.liveswitch.StringExtensions.empty,u=0;u2)for(var o=0,n=0,s=!1,r=-2,a=e.liveswitch.StringType.None,l=1;l126)e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append(e.liveswitch.JsonSerializer.charToUnicodeString(s));else{var r=s;do{if(8==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\b");break}if(12==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\f");break}if(10==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\n");break}if(13==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\r");break}if(9==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\t");break}if(34==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append('\\"');break}if(47==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\/");break}if(92==r){e.liveswitch.Global.equals(o,-1)||(i.append(t,o,n-o),o=-1),i.append("\\\\");break}e.liveswitch.Global.equals(o,-1)&&(o=n);break}while(0)}}return e.liveswitch.Global.equals(o,-1)||i.append(t,o,e.liveswitch.StringExtensions.getLength(t)-o),i.toString()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.intToHex=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),t<=9?t+48:t-10+97;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.isValidJson=function(t){if(1==arguments.length)return(new e.liveswitch.JsonChecker).checkString(t);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.serializeBoolean=function(t){if(1==arguments.length)return null==t?"null":t?"true":"false";throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.serializeBooleanArray=function(t){if(1==arguments.length){if(e.liveswitch.Global.equals(t,null))return"null";for(var i=new Array(t.length),o=0;o1){var i=t.charCodeAt(0),o=t.charCodeAt(e.liveswitch.StringExtensions.getLength(t)-1);e.liveswitch.Global.equals(i,o)&&(e.liveswitch.Global.equals(i,39)||e.liveswitch.Global.equals(i,34))&&(t=e.liveswitch.StringExtensions.substring(t,1,e.liveswitch.StringExtensions.getLength(t)-2))}return t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.unescapeString=function(t){if(1==arguments.length){for(var i=new e.liveswitch.StringBuilder,o=-1,n=0;n=8&&(this.__position++,this.__bitPosition=this.__bitPosition-8),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read16=function(){if(0==arguments.length){var t=this.__buffer.read16(this.__position);return this.__position=this.__position+2,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read2=function(){if(0==arguments.length){var t=this.__buffer.read2(this.__position,this.__bitPosition);return this.__bitPosition=this.__bitPosition+2,this.__bitPosition>=8&&(this.__position++,this.__bitPosition=this.__bitPosition-8),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read24=function(){if(0==arguments.length){var t=this.__buffer.read24(this.__position);return this.__position=this.__position+3,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read3=function(){if(0==arguments.length){var t=this.__buffer.read3(this.__position,this.__bitPosition);return this.__bitPosition=this.__bitPosition+3,this.__bitPosition>=8&&(this.__position++,this.__bitPosition=this.__bitPosition-8),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read32=function(){if(0==arguments.length){var t=this.__buffer.read32(this.__position);return this.__position=this.__position+4,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read4=function(){if(0==arguments.length){var t=this.__buffer.read4(this.__position,this.__bitPosition);return this.__bitPosition=this.__bitPosition+4,this.__bitPosition>=8&&(this.__position++,this.__bitPosition=this.__bitPosition-8),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read40=function(){if(0==arguments.length){var t=this.__buffer.read40(this.__position);return this.__position=this.__position+5,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read48=function(){if(0==arguments.length){var t=this.__buffer.read48(this.__position);return this.__position=this.__position+6,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read56=function(){if(0==arguments.length){var t=this.__buffer.read56(this.__position);return this.__position=this.__position+7,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read64=function(){if(0==arguments.length){var t=this.__buffer.read64(this.__position);return this.__position=this.__position+8,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read7=function(){if(0==arguments.length){var t=this.__buffer.read7(this.__position,this.__bitPosition);return this.__bitPosition=this.__bitPosition+7,this.__bitPosition>=8&&(this.__position++,this.__bitPosition=this.__bitPosition-8),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read8=function(){if(0==arguments.length){var t=this.__buffer.read8(this.__position);return this.__position++,t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.readByte=function(){if(0==arguments.length)return this.read8();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.readBytes=function(t){if(1==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=this.__buffer.subset(this.__position,t).toArray();return this.__position=this.__position+t,i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setBitPosition=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this.__bitPosition=e.liveswitch.Global.toInt(t)},t.prototype.setPosition=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this.__position=e.liveswitch.Global.toInt(t)},t.prototype.write=function(t){if(1==arguments.length)return this.__buffer.write(t,this.__position),this.__position=this.__position+t.getLength(),this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write16=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),this.__buffer.write16(t,this.__position),this.__position=this.__position+2,this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write32=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),this.__buffer.write32(t,this.__position),this.__position=this.__position+4,this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write64=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),this.__buffer.write64(t,this.__position),this.__position=this.__position+8,this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write8=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),this.__buffer.write8(t,this.__position),this.__position++,this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.writeBytes=function(){if(1==arguments.length){var t=arguments[0];return this.writeBytes(t,0,t.length)}if(3==arguments.length){t=arguments[0];var i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);return this.getAvailable()0){var i=this.getLength()+t.getLength();if(i>this.getLength()){var o=this.getLength();this.resize(i),this.write(t,o),o+=t.getLength()}}return this}if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isArray(arguments[0])&&(0==arguments[0].length||e.liveswitch.Util.isNullOrUndefined(arguments[0][0])||e.liveswitch.Util.isObjectType(arguments[0][0],"[fm.liveswitch.DataBuffer]")))){var n=arguments[0];if(!e.liveswitch.Global.equals(n,null)&&n.length>0){for(var s=this.getLength(),r=0,a=n;rthis.getLength()){var l=this.getLength();this.resize(s);for(var c=0,h=n;c=this.getIndex()){if(this.getIndex()+t>=this.getData().length)return!1}else if(i<0){if(this.getIndex()+t>this.getData().length)return!1}else if(this.getIndex()-i+t>=this.getData().length)return!1}return!0}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.clone=function(){if(0==arguments.length)return this.clone(this.getLittleEndian());if(1==arguments.length){return this.subset(0)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.copy=function(){if(0==arguments.length)return this.copy(!1);if(1==arguments.length){var t=arguments[0],i=void 0;return i=t?e.liveswitch.DataBuffer.fm_liveswitch_DataBuffer___dataBufferPool.take(this.getLength()):e.liveswitch.DataBuffer.allocate(this.getLength(),this.getLittleEndian()),i.write(this),i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.free=function(){if(0==arguments.length)return this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getData=function(){if(0==arguments.length){if(e.liveswitch.Global.equals(this.getInnerData(),null))throw new e.liveswitch.Exception("This data buffer has been invalidated.");return this.getInnerData()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getEncryptionRoc=function(){if(0==arguments.length)return this._encryptionRoc;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIndex=function(){if(0==arguments.length)return this._index;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getInnerData=function(){if(0==arguments.length)return this._innerData;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsPooled=function(){if(0==arguments.length)return!1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsSubset=function(){if(0==arguments.length)return!1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getLength=function(){if(0==arguments.length)return this._length;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getLittleEndian=function(){if(0==arguments.length)return this._littleEndian;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.keep=function(){if(0==arguments.length)return this;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.or=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),this.write8(this.read8(i)|t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.prepend=function(){if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.DataBuffer]"))){var t=arguments[0],i=t.getLength();i<=this.getIndex()?(this.setIndex(this.getIndex()-i),this.setLength(this.getLength()+i)):this.resize(this.getLength()+i,0);var o=0;return this.write(t,o),o+=t.getLength(),this}if(1!=arguments.length||!(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isArray(arguments[0])&&(0==arguments[0].length||e.liveswitch.Util.isNullOrUndefined(arguments[0][0])||e.liveswitch.Util.isObjectType(arguments[0][0],"[fm.liveswitch.DataBuffer]"))))throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var n=arguments[0];if(!e.liveswitch.Global.equals(n,null)&&n.length>0){for(var s=0,r=0,a=n;r511&&(o-=1024),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read11=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes11(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read11Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read11(t,i);return o>1023&&(o-=2048),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read12=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes12(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read12Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read12(t,i);return o>2047&&(o-=4096),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read13=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes13(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read13Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read13(t,i);return o>4095&&(o-=8192),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read14=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes14(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read14Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read14(t,i);return o>8191&&(o-=16384),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read15=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes15(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read15Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read15(t,i);return o>16383&&(o-=32768),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read16=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes16(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+2),this.read16(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read16Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read16(t);return i>32767&&(i-=65536),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+2),this.read16Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read17=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes17(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read17Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read17(t,i);return o>65535&&(o-=131072),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read18=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes18(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read18Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read18(t,i);return o>131071&&(o-=262144),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read19=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes19(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read19Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read19(t,i);return o>262143&&(o-=524288),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read2=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes2(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read20=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes20(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read20Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read20(t,i);return o>524287&&(o-=1048576),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read21=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes21(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read21Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read21(t,i);return o>1048575&&(o-=2097152),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read22=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes22(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read22Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read22(t,i);return o>2097151&&(o-=4194304),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read23=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes23(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read23Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read23(t,i);return o>4194303&&(o-=8388608),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read24=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes24(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+3),this.read24(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read24Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read24(t);return i>8388607&&(i-=16777216),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+3),this.read24Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read2Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read2(t,i);return o>1&&(o-=4),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read3=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes3(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read32=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes32(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+4),this.read32(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read32Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read32(t);return i>2147483647&&(i-=4294967296),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+4),this.read32Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read3Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read3(t,i);return o>3&&(o-=8),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read4=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes4(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read40=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes40(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+5),this.read40(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read40Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read40(t);return i>549755813887&&(i-=1099511627776),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+5),this.read40Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read48=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes48(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+6),this.read48(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read48Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read48(t);return i>0x7fffffffffff&&(i-=281474976710656),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+6),this.read48Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read4Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read4(t,i);return o>7&&(o-=16),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read5=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes5(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read56=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes56(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+7),this.read56(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read56Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read56(t);return i>0x80000000000000&&(i-=72057594037927940),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+7),this.read56Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read5Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read5(t,i);return o>15&&(o-=32),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read6=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes6(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read64=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes64(this.getData(),this.getIndex()+t,this.getLittleEndian())}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+8),this.read64(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read64Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return this.read64(t)}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+8),this.read64Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read6Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read6(t,i);return o>31&&(o-=64),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read7=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes7(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read7Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read7(t,i);return o>63&&(o-=128),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read8=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Binary.fromBytes8(this.getData(),this.getIndex()+t)}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=arguments[1];return i.setValue(t+1),this.read8(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read8Signed=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=this.read8(t);return i>127&&(i-=256),i}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=arguments[1];return o.setValue(t+1),this.read8Signed(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read9=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Binary.fromBytes9(this.getData(),this.getIndex()+t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.read9Signed=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=this.read9(t,i);return o>255&&(o-=512),o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.readUtf8String=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return e.liveswitch.Encoding.getUtf8().getString(this.getData(),this.getIndex()+t,this.getLength()-t)}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=e.liveswitch.Global.toInt(arguments[1]);return e.liveswitch.Encoding.getUtf8().getString(this.getData(),this.getIndex()+t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.resize=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);this.resize(t,this.getLength())}else if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=e.liveswitch.Global.toInt(arguments[1]);this.resize(t,i,!1)}else{if(3!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];if(e.liveswitch.Global.equals(i,-1)&&(i=this.getLength()),i<0)throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Offset '{0}' is invalid.",e.liveswitch.NumberExtensions.toString(i)));var n=t-this.getLength();if(n<0){if(n=-n,i+n>this.getLength())throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Truncating at offset '{0}' for length '{1}' would exceed data buffer length '{2}'.",e.liveswitch.NumberExtensions.toString(i),e.liveswitch.NumberExtensions.toString(n),e.liveswitch.NumberExtensions.toString(this.getLength())));e.liveswitch.Global.equals(i,0)?this.setIndex(this.getIndex()+n):e.liveswitch.Global.equals(i+n,this.getLength())||e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex()+i+n,this.getData(),this.getIndex()+i,this.getLength()-i-n)}else if(n>0){if(i>this.getLength())throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Offset '{0}' exceeds data buffer length '{1}'.",e.liveswitch.NumberExtensions.toString(i),e.liveswitch.NumberExtensions.toString(this.getLength())));if(e.liveswitch.Global.equals(i,0)&&n<=this.getIndex())this.setIndex(this.getIndex()-n),o&&e.liveswitch.BitAssistant.set(this.getData(),this.getIndex(),n,0);else if(e.liveswitch.Global.equals(i,this.getLength())&&this.getIndex()+this.getLength()+nthis.getData().length){if(this.getIsPooled())throw new e.liveswitch.Exception("Cannot expand the underlying byte array of a pooled data buffer.");var s=new Uint8Array(t);e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex(),s,0,i),e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex()+i,s,i+n,this.getLength()-i),this.setInnerData(s)}else if(this.getIndex()+t>this.getData().length){var r=this.getData().length-t;e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex(),this.getData(),r,i),e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex()+i,this.getData(),r+i+n,this.getLength()-i),this.setIndex(r),o&&e.liveswitch.BitAssistant.set(this.getData(),this.getIndex()+i,n,0)}else e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex()+i,this.getData(),this.getIndex()+i+n,this.getLength()-i),o&&e.liveswitch.BitAssistant.set(this.getData(),this.getIndex()+i,n,0)}this.setLength(t)}},t.prototype.sequenceEquals=function(t){if(1==arguments.length)return e.liveswitch.BitAssistant.sequencesAreEqual(this.getData(),this.getIndex(),t.getData(),t.getIndex(),this.getLength());throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.sequenceEqualsConstantTime=function(t){if(1==arguments.length)return e.liveswitch.BitAssistant.sequencesAreEqualConstantTime(this.getData(),this.getIndex(),t.getData(),t.getIndex(),this.getLength());throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.set=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);this.set(t,0,this.getLength())}else if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=e.liveswitch.Global.toInt(arguments[1]);e.liveswitch.BitAssistant.set(this.getData(),this.getIndex()+i,this.getLength()-i,t)}else{if(3!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=e.liveswitch.Global.toInt(arguments[2]);e.liveswitch.BitAssistant.set(this.getData(),this.getIndex()+i,o,t)}},t.prototype.setEncryptionRoc=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._encryptionRoc=e.liveswitch.Global.toInt(t)},t.prototype.setIndex=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._index=e.liveswitch.Global.toInt(t)},t.prototype.setInnerData=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._innerData=t},t.prototype.setLength=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._length=e.liveswitch.Global.toInt(t)},t.prototype.setLittleEndian=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._littleEndian=t},t.prototype.subset=function(){if(1==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]);return this.subset(t,this.getLength()-t)}if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var i=e.liveswitch.Global.toInt(arguments[1]);return t+i>this.getLength()||i<0?null:this.getIsPooled()?new e.liveswitch.DataBufferSubset(this,this.getIndex()+t,i):new e.liveswitch.DataBuffer(this.getData(),this.getIndex()+t,i,this.getLittleEndian())}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.toArray=function(){if(0==arguments.length)return this.toBytes();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.toBytes=function(){if(0==arguments.length){var t=new Uint8Array(this.getLength());return e.liveswitch.BitAssistant.copy(this.getData(),this.getIndex(),t,0,this.getLength()),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.toHexString=function(){if(0==arguments.length)return e.liveswitch.BitAssistant.getHexString(this.getData(),this.getIndex(),this.getLength());throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.toJson=function(){if(0==arguments.length)return e.liveswitch.DataBuffer.toJson(this);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryKeep=function(){if(0!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");try{return this.keep(),!0}catch(t){return!1}},t.prototype.tryRead1=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes1(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead10=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes10(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead11=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes11(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead12=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes12(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead13=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes13(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead14=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes14(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead15=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes15(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead16=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes16(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead17=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes17(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead18=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes18(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead19=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes19(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead2=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes2(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead20=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes20(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead21=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes21(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead22=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes22(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead23=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes23(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead24=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes24(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead3=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes3(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead32=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes32(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead4=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes4(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead40=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes40(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead48=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes48(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead5=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes5(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead56=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes56(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead6=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes6(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead64=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes64(this.getData(),this.getIndex()+t,this.getLittleEndian(),i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead7=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes7(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead8=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var o=e.liveswitch.Binary.tryFromBytes8(this.getData(),this.getIndex()+t,i);return o}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryRead9=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var n=e.liveswitch.Binary.tryFromBytes9(this.getData(),this.getIndex()+t,i,o);return n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write=function(){if(1==arguments.length){var t=arguments[0];this.write(t,0)}else if(2==arguments.length){t=arguments[0];var i=e.liveswitch.Global.toInt(arguments[1]);e.liveswitch.BitAssistant.copy(t.getData(),t.getIndex(),this.getData(),this.getIndex()+i,t.getLength())}else{if(3!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];o.setValue(i+t.getLength()),this.write(t,i)}},t.prototype.write1=function(t,i,o){if(3==arguments.length)return i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes1(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write10=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes10(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write11=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes11(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write12=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes12(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write13=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes13(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write14=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes14(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write15=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes15(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write16=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes16(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+2),this.write16(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write16Signed=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),t>32767&&(t-=65535),this.write16(t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write17=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes17(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write18=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes18(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write19=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes19(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write2=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes2(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write20=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes20(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write21=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes21(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write22=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes22(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write23=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes23(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write24=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes24(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+3),this.write24(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write3=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes3(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write32=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes32(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+4),this.write32(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write4=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes4(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write40=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes40(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+5),this.write40(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write48=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes48(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+6),this.write48(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write5=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes5(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write56=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes56(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+7),this.write56(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write6=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes6(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write64=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes64(t,this.getLittleEndian(),this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+8),this.write64(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write7=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes7(t,o,this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write8=function(){if(2==arguments.length){var t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);return!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes8(t,this.getData(),this.getIndex()+i),null)}if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=arguments[2];return o.setValue(i+1),this.write8(t,i)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.write9=function(t,i,o){if(3==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),!e.liveswitch.Global.equals(e.liveswitch.Binary.toBytes9(t,o,this.getLittleEndian(),this.getData(),this.getIndex()+i),null);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.writeBytes=function(){if(1==arguments.length){var t=arguments[0];this.writeBytes(t,0,t.length,0)}else if(4==arguments.length){t=arguments[0];var i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]);if(n+o>this.getLength())throw new e.liveswitch.Exception("Would write out of the allowed bounds for this data buffer.");e.liveswitch.BitAssistant.copy(t,i,this.getData(),this.getIndex()+n,o)}else if(5==arguments.length){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]),n=e.liveswitch.Global.toInt(arguments[3]);var s=arguments[4];s.setValue(n+o),this.writeBytes(t,i,o,n)}else if(3==arguments.length){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),n=e.liveswitch.Global.toInt(arguments[2]);this.writeBytes(t,i,t.length-i,n)}else{if(2!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=arguments[0],n=e.liveswitch.Global.toInt(arguments[1]);this.writeBytes(t,0,t.length,n)}},t.prototype.xor=function(t,i){if(2==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]),this.write8(this.read8(i)^t,i);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fmliveswitchDataBufferInitialize=function(){e.liveswitch.DataBuffer.__fmliveswitchDataBufferInitialized||e.liveswitch.DataBuffer.__fmliveswitchDataBufferInitializing||(e.liveswitch.DataBuffer.__fmliveswitchDataBufferInitializing=!0,e.liveswitch.DataBuffer.fm_liveswitch_DataBuffer___dataBufferPool=e.liveswitch.DataBufferPool.getTracer(new e.liveswitch.Type("[fm.liveswitch.DataBuffer]")),e.liveswitch.DataBuffer.__fmliveswitchDataBufferInitialized=!0,e.liveswitch.DataBuffer.__fmliveswitchDataBufferInitializing=!1)},t.__fmliveswitchDataBufferInitialized=!1,t.__fmliveswitchDataBufferInitializing=!1,t}();t.DataBuffer=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(e,o,n,s,r){for(var a=this,l=new Array(arguments.length),c=0;c=128?i=30:(i=e.liveswitch.JsonChecker.fm_liveswitch_JsonChecker__ascii_class[t],i<=-1&&this.onError());var o=e.liveswitch.JsonChecker.fm_liveswitch_JsonChecker__state_transition_table[this.__state][i];if(o>=0)this.__state=o,this.__offset=this.__offset+1;else{if(e.liveswitch.Global.equals(o,-9))this.pop(e.liveswitch.JsonCheckerMode.Key),this.__state=1;else if(e.liveswitch.Global.equals(o,-8))this.pop(e.liveswitch.JsonCheckerMode.Object),this.__state=1;else if(e.liveswitch.Global.equals(o,-7))this.pop(e.liveswitch.JsonCheckerMode.Array),this.__state=1;else if(e.liveswitch.Global.equals(o,-6))this.push(e.liveswitch.JsonCheckerMode.Key),this.__state=2;else if(e.liveswitch.Global.equals(o,-5))this.push(e.liveswitch.JsonCheckerMode.Array),this.__state=6;else{var n=void 0;e.liveswitch.Global.equals(o,-4)?(n=this.__stack.peek(),e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Key)?this.__state=4:e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Array)||e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Object)?this.__state=1:e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Done)?(this.push(e.liveswitch.JsonCheckerMode.String),this.__state=7):e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.String)?(this.pop(e.liveswitch.JsonCheckerMode.String),this.__state=1):this.onError()):e.liveswitch.Global.equals(o,-3)?(n=this.__stack.peek(),e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Object)?(this.pop(e.liveswitch.JsonCheckerMode.Object),this.push(e.liveswitch.JsonCheckerMode.Key),this.__state=3):e.liveswitch.Global.equals(n,e.liveswitch.JsonCheckerMode.Array)?this.__state=5:this.onError()):e.liveswitch.Global.equals(o,-2)?(this.pop(e.liveswitch.JsonCheckerMode.Key),this.push(e.liveswitch.JsonCheckerMode.Object),this.__state=5):this.onError()}this.__offset=this.__offset+1}},t.prototype.checkString=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=0,o=0,n=new e.liveswitch.Holder(i),s=e.liveswitch.ParseAssistant.tryParseDoubleValue(t,n);i=n.getValue();var r=new e.liveswitch.Holder(o),a=e.liveswitch.ParseAssistant.tryParseDecimalValue(t,r);if(o=r.getValue(),e.liveswitch.Global.equals(t,"true")||e.liveswitch.Global.equals(t,"false")||e.liveswitch.Global.equals(t,"null")||s||a)return!0;try{for(var l=0;l0&&this.__stack.getCount()>=this.__depth&&this.onError(),this.__stack.push(t)},t.fmliveswitchJsonCheckerInitialize=function(){e.liveswitch.JsonChecker.__fmliveswitchJsonCheckerInitialized||e.liveswitch.JsonChecker.__fmliveswitchJsonCheckerInitializing||(e.liveswitch.JsonChecker.__fmliveswitchJsonCheckerInitializing=!0,e.liveswitch.JsonChecker.fm_liveswitch_JsonChecker__ascii_class=[-1,-1,-1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,30,8,30,30,30,30,30,30,30,30,11,7,12,13,10,14,15,15,15,15,15,15,15,15,15,6,30,30,30,30,30,30,28,28,28,28,29,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,4,9,5,30,30,30,16,17,18,19,20,21,30,30,30,30,30,22,30,23,30,30,30,24,25,26,27,30,30,30,30,30,2,30,3,30,30],e.liveswitch.JsonChecker.fm_liveswitch_JsonChecker__state_transition_table=[[0,0,-6,-1,-5,-1,-1,-1,-4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,-1,-8,-1,-7,-1,-3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[2,2,-1,-9,-1,-1,-1,-1,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[3,3,-1,-1,-1,-1,-1,-1,7,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[4,4,-1,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[5,5,-6,-1,-5,-1,-1,-1,7,-1,-1,-1,13,-1,14,15,-1,-1,-1,-1,-1,23,-1,27,-1,-1,20,-1,-1,-1,-1],[6,6,-6,-1,-5,-7,-1,-1,7,-1,-1,-1,13,-1,14,15,-1,-1,-1,-1,-1,23,-1,27,-1,-1,20,-1,-1,-1,-1],[7,-1,7,7,7,7,7,7,-4,8,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7],[-1,-1,-1,-1,-1,-1,-1,-1,7,7,7,-1,-1,-1,-1,-1,-1,7,-1,-1,-1,7,-1,7,7,-1,7,9,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,10,10,10,10,10,10,10,-1,-1,-1,-1,-1,-1,10,10,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,11,11,11,11,11,11,11,11,-1,-1,-1,-1,-1,-1,11,11,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,12,12,12,12,12,12,12,12,-1,-1,-1,-1,-1,-1,12,12,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,7,7,7,7,7,7,7,-1,-1,-1,-1,-1,-1,7,7,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,14,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,-1,-8,-1,-7,-1,-3,-1,-1,-1,-1,-1,16,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,-1,-8,-1,-7,-1,-3,-1,-1,-1,-1,-1,16,15,15,-1,-1,-1,-1,17,-1,-1,-1,-1,-1,-1,-1,-1,17,-1],[1,1,-1,-8,-1,-7,-1,-3,-1,-1,-1,-1,-1,-1,16,16,-1,-1,-1,-1,17,-1,-1,-1,-1,-1,-1,-1,-1,17,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,18,18,-1,19,19,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,19,19,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[1,1,-1,-8,-1,-7,-1,-3,-1,-1,-1,-1,-1,-1,19,19,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,21,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,22,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,25,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,26,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,28,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,29,-1,-1,-1,-1,-1,-1,-1,-1],[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1]],e.liveswitch.JsonChecker.__fmliveswitchJsonCheckerInitialized=!0,e.liveswitch.JsonChecker.__fmliveswitchJsonCheckerInitializing=!1)},t.__fmliveswitchJsonCheckerInitialized=!1,t.__fmliveswitchJsonCheckerInitializing=!1,t}();t.JsonChecker=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i0?t[0]:null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getProviders=function(){if(e.liveswitch.Log.fmliveswitchLogInitialize(),0==arguments.length)return e.liveswitch.LogConfiguration.getLogProviders();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.info=function(){if(e.liveswitch.Log.fmliveswitchLogInitialize(),1==arguments.length){var t=arguments[0];e.liveswitch.Log.fm_liveswitch_Log___staticLogger.info(t)}else{if(2!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=arguments[0];var i=arguments[1];e.liveswitch.Log.fm_liveswitch_Log___staticLogger.info(t,i)}},t.registerProvider=function(){if(e.liveswitch.Log.fmliveswitchLogInitialize(),1==arguments.length){var t=arguments[0];e.liveswitch.LogConfiguration.addLogProvider(t),t.getLevel()0;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getLogProviders=function(){if(e.liveswitch.LogConfiguration.fmliveswitchLogConfigurationInitialize(),0==arguments.length)return e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___logProviders;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getLowestLogLevel=function(){if(e.liveswitch.LogConfiguration.fmliveswitchLogConfigurationInitialize(),0==arguments.length)return e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration__lowestLogLevel;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getTagLogLevel=function(t){if(e.liveswitch.LogConfiguration.fmliveswitchLogConfigurationInitialize(),1==arguments.length)return!e.liveswitch.Global.equals(t,null)&&e.liveswitch.HashExtensions.containsKey(e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___tagOverrides,t)?e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___tagOverrides[t]:e.liveswitch.LogConfiguration.getLowestLogLevel();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.removeLogProvider=function(t){if(e.liveswitch.LogConfiguration.fmliveswitchLogConfigurationInitialize(),1==arguments.length){var i=e.liveswitch.ArrayExtensions.newArray(e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___logProviders);if(!e.liveswitch.ArrayExtensions.remove(i,t))return!1;if(e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___providerCount--,e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___logProviders=e.liveswitch.ArrayExtensions.toArray(i),e.liveswitch.Global.equals(e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___logProviders.length,0))e.liveswitch.LogConfiguration.setLowestLogLevel(e.liveswitch.LogLevel.None);else if(e.liveswitch.Global.equals(t.getLevel(),e.liveswitch.LogConfiguration.getLowestLogLevel())){for(var o=e.liveswitch.LogConfiguration.getLowestLogLevel(),n=0,s=e.liveswitch.LogConfiguration.fm_liveswitch_LogConfiguration___logProviders;nc?l[c]:null;!t.liveswitch.Global.equals(h,null)&&t.liveswitch.Global.equals(a[c].getState(),h.getState())?this.getChannels()[c].setState(null):this.getChannels()[c].setState(t.liveswitch.StringExtensions.toLower(new t.liveswitch.DataChannelStateWrapper(a[c].getState()).toString())),this.getChannels()[c].populateReports(a[c],s?null:h,n)}}},o.prototype.serializeProperties=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");i.prototype.serializeProperties.call(this,e),t.liveswitch.Global.equals(this.getChannels(),null)||(e["channels"]=t.liveswitch.DataChannelInfo.toJsonArray(this.getChannels())),t.liveswitch.Global.equals(this.getReport(),null)||(e["report"]=this.getReport().toJson())},o.prototype.setChannels=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._channels=e},o.prototype.setReport=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._report=e},o.prototype.toJson=function(){if(0==arguments.length)return t.liveswitch.DataStreamInfo.toJson(this);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o}(t.liveswitch.StreamInfo);i.DataStreamInfo=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0&&(i["channelCount"]=e.liveswitch.JsonSerializer.serializeInteger(t.getChannelCount()))}));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJsonArray=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObjectArray(t,e.liveswitch.FormatInfo.toJson.bind(e.liveswitch.FormatInfo));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getChannelCount=function(){if(0==arguments.length)return this._channelCount;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getClockRate=function(){if(0==arguments.length)return this._clockRate;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getCodecName=function(){if(0==arguments.length)return this.getName();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getName=function(){if(0==arguments.length)return this._name;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.isEquivalent=function(){if(1==arguments.length){var t=arguments[0];return!e.liveswitch.Global.equals(t,null)&&this.isEquivalent(t.getName(),t.getClockRate(),t.getChannelCount())}if(3==arguments.length){var i=arguments[0],o=e.liveswitch.Global.toInt(arguments[1]),n=e.liveswitch.Global.toInt(arguments[2]);return e.liveswitch.Global.equals(i,this.getName())&&e.liveswitch.Global.equals(o,this.getClockRate())&&e.liveswitch.Global.equals(n,this.getChannelCount())}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setChannelCount=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._channelCount=e.liveswitch.Global.toInt(t)},t.prototype.setClockRate=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._clockRate=e.liveswitch.Global.toInt(t)},t.prototype.setCodecName=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.setName(t)},t.prototype.setName=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._name=t},t.prototype.toJson=function(){if(0==arguments.length)return e.liveswitch.FormatInfo.toJson(this);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.toString=function(){if(0==arguments.length)return this.getChannelCount()>1?e.liveswitch.StringExtensions.format("{0}/{1}/{2}",this.getName(),e.liveswitch.NumberExtensions.toString(this.getClockRate()),e.liveswitch.NumberExtensions.toString(this.getChannelCount())):e.liveswitch.StringExtensions.format("{0}/{1}",this.getName(),e.liveswitch.NumberExtensions.toString(this.getClockRate()));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t}();t.FormatInfo=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;ip?(l=o*p,r=e.liveswitch.MathAssistant.floor((i-l)/2)):hp&&(c=i/p,a=e.liveswitch.MathAssistant.floor((o-c)/2)))}return new e.liveswitch.LayoutFrame(r,a,l,c)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJson=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObject(t,(function(t,i){i["x"]=e.liveswitch.NumberExtensions.toString(t.getX()),i["y"]=e.liveswitch.NumberExtensions.toString(t.getY()),i["width"]=e.liveswitch.NumberExtensions.toString(t.getWidth()),i["height"]=e.liveswitch.NumberExtensions.toString(t.getHeight()),i["orientation"]=e.liveswitch.NumberExtensions.toString(t.getOrientation()),e.liveswitch.Global.equals(t.getUserId(),null)||(i["uid"]=e.liveswitch.JsonSerializer.serializeString(t.getUserId())),e.liveswitch.Global.equals(t.getDeviceId(),null)||(i["did"]=e.liveswitch.JsonSerializer.serializeString(t.getDeviceId())),e.liveswitch.Global.equals(t.getClientId(),null)||(i["cid"]=e.liveswitch.JsonSerializer.serializeString(t.getClientId()))}));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getClientId=function(){if(0==arguments.length)return this._clientId;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getDeviceId=function(){if(0==arguments.length)return this._deviceId;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getHeight=function(){if(0==arguments.length)return this._height;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getOrientation=function(){if(0==arguments.length)return this._orientation;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getUserId=function(){if(0==arguments.length)return this._userId;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getViewId=function(){if(0==arguments.length)return this._viewId;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getWidth=function(){if(0==arguments.length)return this._width;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getX=function(){if(0==arguments.length)return this._x;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getY=function(){if(0==arguments.length)return this._y;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.isEquivalent=function(t){if(1==arguments.length)return e.liveswitch.Global.equals(t.getX(),this.getX())&&e.liveswitch.Global.equals(t.getY(),this.getY())&&e.liveswitch.Global.equals(t.getWidth(),this.getWidth())&&e.liveswitch.Global.equals(t.getHeight(),this.getHeight());throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setClientId=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._clientId=t},t.prototype.setDeviceId=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._deviceId=t},t.prototype.setHeight=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._height=e.liveswitch.Global.toInt(t)},t.prototype.setOrientation=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._orientation=e.liveswitch.Global.toInt(t)},t.prototype.setUserId=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._userId=t},t.prototype.setViewId=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._viewId=t},t.prototype.setWidth=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._width=e.liveswitch.Global.toInt(t)},t.prototype.setX=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._x=e.liveswitch.Global.toInt(t)},t.prototype.setY=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t=e.liveswitch.Global.toInt(arguments[0]),this._y=e.liveswitch.Global.toInt(t)},t.prototype.toJson=function(){if(0==arguments.length)return e.liveswitch.LayoutFrame.toJson(this);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t}();t.LayoutFrame=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o0?i/o:0,e<.02?1:e<.03?.9:e<.04?.8:e<.05?.7:e<.06?.6:e<.07?.5:e<.08?.4:e<.09?.3:e<.1?.2:e<.2?.1:0}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPacketsDiscarded=function(){if(0==arguments.length)return this._packetsDiscarded;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPacketsDuplicated=function(){if(0==arguments.length)return this._packetsDuplicated;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPacketsLost=function(){if(0==arguments.length)return this._packetsLost;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPacketsReceived=function(){if(0==arguments.length)return this._packetsReceived;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPacketsRepaired=function(){if(0==arguments.length)return this._packetsRepaired;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRoundTripTime=function(){if(0==arguments.length)return this._roundTripTime;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSink=function(){if(0==arguments.length)return this._sink;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isEquivalent=function(e){if(1==arguments.length)return t.liveswitch.Global.equals(e.getSynchronizationSource(),i.prototype.getSynchronizationSource.call(this))&&(t.liveswitch.Global.equals(e.getTrack(),i.prototype.getTrack.call(this))||!t.liveswitch.Global.equals(i.prototype.getTrack.call(this),null)&&i.prototype.getTrack.call(this).isEquivalent(e.getTrack()))&&(t.liveswitch.Global.equals(e.getCodec(),i.prototype.getCodec.call(this))||!t.liveswitch.Global.equals(i.prototype.getCodec.call(this),null)&&i.prototype.getCodec.call(this).isEquivalent(e.getCodec()))&&t.liveswitch.Global.equals(e.getNackCount(),i.prototype.getNackCount.call(this))&&t.liveswitch.Global.equals(e.getPliCount(),i.prototype.getPliCount.call(this))&&t.liveswitch.Global.equals(e.getFirCount(),i.prototype.getFirCount.call(this))&&t.liveswitch.Global.equals(e.getLrrCount(),i.prototype.getLrrCount.call(this))&&t.liveswitch.Global.equals(e.getSliCount(),i.prototype.getSliCount.call(this))&&t.liveswitch.Global.equals(e.getPacketsReceived(),this.getPacketsReceived())&&t.liveswitch.Global.equals(e.getBytesReceived(),this.getBytesReceived())&&t.liveswitch.Global.equals(e.getPacketsLost(),this.getPacketsLost())&&t.liveswitch.Global.equals(e.getRoundTripTime(),this.getRoundTripTime())&&t.liveswitch.Global.equals(e.getJitter(),this.getJitter())&&t.liveswitch.Global.equals(e.getPacketsDiscarded(),this.getPacketsDiscarded())&&t.liveswitch.Global.equals(e.getPacketsDuplicated(),this.getPacketsDuplicated())&&t.liveswitch.Global.equals(e.getPacketsRepaired(),this.getPacketsRepaired())&&(t.liveswitch.Global.equals(e.getSink(),this.getSink())||!t.liveswitch.Global.equals(this.getSink(),null)&&this.getSink().isEquivalent(e.getSink()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.serializeProperties=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");i.prototype.serializeProperties.call(this,e),e["packetsReceived"]=t.liveswitch.JsonSerializer.serializeLong(this.getPacketsReceived()),e["bytesReceived"]=t.liveswitch.JsonSerializer.serializeLong(this.getBytesReceived()),e["rtt"]=t.liveswitch.JsonSerializer.serializeInteger(this.getRoundTripTime()),e["packetsLost"]=t.liveswitch.JsonSerializer.serializeLong(this.getPacketsLost()),e["jitter"]=t.liveswitch.JsonSerializer.serializeInteger(this.getJitter()),e["packetsDiscarded"]=t.liveswitch.JsonSerializer.serializeLong(this.getPacketsDiscarded()),e["packetsDuplicated"]=t.liveswitch.JsonSerializer.serializeLong(this.getPacketsDuplicated()),e["packetsRepaired"]=t.liveswitch.JsonSerializer.serializeLong(this.getPacketsRepaired()),t.liveswitch.Global.equals(this.getSink(),null)||(e["sink"]=t.liveswitch.MediaSinkStats.toJson(this.getSink()))},o.prototype.setBytesReceived=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._bytesReceived=t.liveswitch.Global.toInt(e)},o.prototype.setJitter=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._jitter=t.liveswitch.Global.toInt(e)},o.prototype.setPacketsDiscarded=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._packetsDiscarded=t.liveswitch.Global.toInt(e)},o.prototype.setPacketsDuplicated=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._packetsDuplicated=t.liveswitch.Global.toInt(e)},o.prototype.setPacketsLost=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._packetsLost=t.liveswitch.Global.toInt(e)},o.prototype.setPacketsReceived=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._packetsReceived=t.liveswitch.Global.toInt(e)},o.prototype.setPacketsRepaired=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._packetsRepaired=t.liveswitch.Global.toInt(e)},o.prototype.setRoundTripTime=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._roundTripTime=t.liveswitch.Global.toInt(e)},o.prototype.setSink=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._sink=e},o.prototype.toJson=function(){if(0==arguments.length)return t.liveswitch.MediaReceiverStats.toJson(this);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o}(t.liveswitch.MediaComponentStats);i.MediaReceiverStats=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n=0)for(var n=0,s=e;ne.getWidth()*e.getHeight()?i:e;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.merge=function(e){if(t.liveswitch.EncodingInfo.fmliveswitchEncodingInfoInitialize(),1==arguments.length){for(var i=new Array,o=0,n=e;othis.getBitrate())&&this.setBitrate(e.getBitrate()),(t.liveswitch.Global.equals(this.getFrameRate(),-1)||e.getFrameRate()>this.getFrameRate())&&this.setFrameRate(e.getFrameRate()),(t.liveswitch.Global.equals(this.getWidth(),-1)&&t.liveswitch.Global.equals(this.getHeight(),-1)||e.getWidth()>this.getWidth()&&e.getHeight()>this.getHeight())&&this.setSize(e.getSize()),(t.liveswitch.Global.equals(this.getScale(),-1)||e.getScale()>this.getScale())&&this.setScale(e.getScale()),this;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBitrate=function(){if(0==arguments.length)return this.__bitrate;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDeactivated=function(){if(0==arguments.length)return this._deactivated;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getFrameRate=function(){if(0==arguments.length)return this.__frameRate;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getHeight=function(){if(0==arguments.length){var e=this.getSize();return t.liveswitch.Global.equals(e,null)?-1:e.getHeight()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsEmpty=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getRtpStreamId(),null)&&t.liveswitch.Global.equals(this.getSynchronizationSource(),-1)&&!this.getDeactivated()&&t.liveswitch.Global.equals(this.getBitrate(),-1)&&t.liveswitch.Global.equals(this.getFrameRate(),-1)&&t.liveswitch.Global.equals(this.getSize(),null)&&t.liveswitch.Global.equals(this.getScale(),-1);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRidRestrictionValue=function(e,i){if(2==arguments.length){for(var o=0,n=e;o0?new t.liveswitch.Size(e.getWidth()*i,e.getHeight()*i):e}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getScaledWidth=function(){if(0==arguments.length){var e=this.getScaledSize();return t.liveswitch.Global.equals(e,null)?-1:e.getWidth()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSdpRidRestrictions=function(){if(0==arguments.length){var e=new Array,i=this.getBitrate();if(i>0){var o=1e3*i;t.liveswitch.ArrayExtensions.add(e,new t.liveswitch.sdp.rtp.RidRestriction(t.liveswitch.sdp.rtp.RidRestriction.getMaxBitrateKey(),t.liveswitch.NumberExtensions.toString(o)))}var n=this.getFrameRate();n>0&&t.liveswitch.ArrayExtensions.add(e,new t.liveswitch.sdp.rtp.RidRestriction(t.liveswitch.sdp.rtp.RidRestriction.getMaxFramesPerSecondKey(),t.liveswitch.NumberExtensions.toString(n)));var s=this.getScale(),r=this.getWidth();r>0&&(s>0&&(r=t.liveswitch.MathAssistant.round(r*s)),t.liveswitch.ArrayExtensions.add(e,new t.liveswitch.sdp.rtp.RidRestriction(t.liveswitch.sdp.rtp.RidRestriction.getMaxWidthKey(),t.liveswitch.NumberExtensions.toString(r))));var a=this.getHeight();return a>0&&(s>0&&(a=t.liveswitch.MathAssistant.round(a*s)),t.liveswitch.ArrayExtensions.add(e,new t.liveswitch.sdp.rtp.RidRestriction(t.liveswitch.sdp.rtp.RidRestriction.getMaxHeightKey(),t.liveswitch.NumberExtensions.toString(a)))),t.liveswitch.ArrayExtensions.toArray(e)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSdpSimulcastStream=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getSdpSimulcastStreamId(),null)?null:new t.liveswitch.sdp.rtp.SimulcastStream(this.getSdpSimulcastStreamId());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSdpSimulcastStreamId=function(){if(0==arguments.length){var e=this.getRtpStreamId();return t.liveswitch.Global.equals(e,null)?null:new t.liveswitch.sdp.rtp.SimulcastStreamId(e,this.getDeactivated())}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSdpSsrcRestrictionAttributes=function(){if(0==arguments.length){for(var e=new Array,i=0,o=this.getSdpRidRestrictions();i0?(i.setValue(o[0]),!0):(i.setValue(null),!1):(i.setValue(null),!1)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.tryGetAttributes=function(t,i){if(2==arguments.length){var o=null,n=new e.liveswitch.Holder(o),s=e.liveswitch.HashExtensions.tryGetValue(this.__attributes,new e.liveswitch.sdp.AttributeTypeWrapper(t).toString(),n);if(o=n.getValue(),s){var r=e.liveswitch.ArrayExtensions.getCount(o);i.setValue(new Array(r));for(var a=0;a256)throw new t.liveswitch.Exception("password must be at least 22 characters long up to 256 characters.");e.setPassword(s),i.prototype.setMultiplexingCategory.call(e,t.liveswitch.sdp.AttributeCategory.Transport)}else{if(1!=o.length)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");s=o[0];if(e=i.call(this)||this,i.prototype.setAttributeType.call(e,t.liveswitch.sdp.AttributeType.IcePasswordAttribute),t.liveswitch.StringExtensions.getLength(s)<22||t.liveswitch.StringExtensions.getLength(s)>256)throw new t.liveswitch.Exception("password must be at least 22 characters long up to 256 characters.");e.setPassword(s),i.prototype.setMultiplexingCategory.call(e,t.liveswitch.sdp.AttributeCategory.Transport)}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.sdp.ice.PasswordAttribute],"+i.prototype.getTypeString.call(this)},o.fromAttributeValue=function(e){if(1==arguments.length)return new t.liveswitch.sdp.ice.PasswordAttribute(e);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.generatePassword=function(){if(0==arguments.length)return t.liveswitch.StringExtensions.replace(t.liveswitch.Guid.newGuid().toString(),"-","");throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length)return this.getPassword();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPassword=function(){if(0==arguments.length)return this._password;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setPassword=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._password=e},o}(t.liveswitch.sdp.Attribute);i.PasswordAttribute=o})(i.ice||(i.ice={}))})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){(function(t){(function(t){var i=function(){function t(t,i,o){for(var n=new Array(arguments.length),s=0;s256)throw new t.liveswitch.Exception("ufrag must be at least 4 characters long up to 256 characters.");i.prototype.setMultiplexingCategory.call(e,t.liveswitch.sdp.AttributeCategory.Transport),e.setUfrag(s)}else{if(1!=o.length)throw new t.liveswitch.Exception("Constructor overload does not exist with specified parameter count/type combination.");s=o[0];if(e=i.call(this)||this,i.prototype.setAttributeType.call(e,t.liveswitch.sdp.AttributeType.IceUfragAttribute),t.liveswitch.StringExtensions.getLength(s)<4||t.liveswitch.StringExtensions.getLength(s)>256)throw new t.liveswitch.Exception("ufrag must be at least 4 characters long up to 256 characters.");i.prototype.setMultiplexingCategory.call(e,t.liveswitch.sdp.AttributeCategory.Transport),e.setUfrag(s)}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.sdp.ice.UfragAttribute],"+i.prototype.getTypeString.call(this)},o.fromAttributeValue=function(e){if(1==arguments.length)return new t.liveswitch.sdp.ice.UfragAttribute(e);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.generateUfrag=function(){if(0==arguments.length)return t.liveswitch.StringExtensions.substring(t.liveswitch.StringExtensions.replace(t.liveswitch.Guid.newGuid().toString(),"-",""),0,8);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length)return this.getUfrag();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getUfrag=function(){if(0==arguments.length)return this._ufrag;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setUfrag=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._ufrag=e},o}(t.liveswitch.sdp.Attribute);i.UfragAttribute=o})(i.ice||(i.ice={}))})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){(function(i){var o=function(i){function o(e){for(var o=this,n=new Array(arguments.length),s=0;s1&&(t.append("/"),t.append(e.liveswitch.NumberExtensions.toString(this.getNumberOfPorts()))),t.append(" "),t.append(this.getTransportProtocol()),e.liveswitch.Global.equals(this.getFormatDescription(),null)||(t.append(" "),t.append(this.getFormatDescription())),t.toString()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.fmliveswitchsdpMediaInitialize=function(){e.liveswitch.sdp.Media.__fmliveswitchsdpMediaInitialized||e.liveswitch.sdp.Media.__fmliveswitchsdpMediaInitializing||(e.liveswitch.sdp.Media.__fmliveswitchsdpMediaInitializing=!0,t.fm_liveswitch_sdp_Media__defaultNumberOfPorts=0,e.liveswitch.sdp.Media.fm_liveswitch_sdp_Media__defaultNumberOfPorts=1,e.liveswitch.sdp.Media.__fmliveswitchsdpMediaInitialized=!0,e.liveswitch.sdp.Media.__fmliveswitchsdpMediaInitializing=!1)},t.__fmliveswitchsdpMediaInitialized=!1,t.__fmliveswitchsdpMediaInitializing=!1,t}();t.Media=i})(t.sdp||(t.sdp={}))})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(e){(function(t){(function(t){var i=function(){function t(t){for(var i=new Array(arguments.length),o=0;o0?i[0]:null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getBundlingSupportFromCollection=function(t){if(1==arguments.length){var i=null,o=new e.liveswitch.Holder(i),n=t.tryGetAttributes(e.liveswitch.sdp.AttributeType.GroupAttribute,o);if(i=o.getValue(),n)for(var s=0,r=i;s-1)for(var c=this.getRtpMapAttributes(),h=0,p=c;h10)throw new t.liveswitch.Exception("quality must be a value in the range 0 to 10.");e.setQuality(s)}return e}return e(o,i),o.prototype.getTypeString=function(){return"[fm.liveswitch.sdp.QualityAttribute],"+i.prototype.getTypeString.call(this)},o.prototype.fmliveswitchsdpQualityAttributeInit=function(){this._quality=0},o.fromAttributeValue=function(e){if(1==arguments.length){var i=new t.liveswitch.sdp.QualityAttribute;return i.setQuality(t.liveswitch.ParseAssistant.parseByteValue(e)),i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length)return t.liveswitch.NumberExtensions.toString(this.getQuality());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getQuality=function(){if(0==arguments.length)return this._quality;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setQuality=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._quality=t.liveswitch.Global.toInt(e)},o}(t.liveswitch.sdp.Attribute);i.QualityAttribute=o})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n=0&&(s=t.liveswitch.StringExtensions.substring(e,0,o),e=e.substring(o+1),r=e);var a=new t.liveswitch.sdp.rtcp.FeedbackAttribute;return a.setPayloadType(i),a.setType(s),a.setSubType(r),a}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.getWildcardPayloadType=function(){if(0==arguments.length)return-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.nackAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getNack());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.nackPliAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getNack(),t.liveswitch.sdp.rtcp.FeedbackAttributeSubType.getPli());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.nackRpsiAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getNack(),t.liveswitch.sdp.rtcp.FeedbackAttributeSubType.getRpsi());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.nackSliAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getNack(),t.liveswitch.sdp.rtcp.FeedbackAttributeSubType.getSli());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.rembAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getRemb());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.transportCCAttribute=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),new t.liveswitch.sdp.rtcp.FeedbackAttribute(e,t.liveswitch.sdp.rtcp.FeedbackAttributeType.getTransportCC());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length){var e=t.liveswitch.Global.equals(this.getPayloadType(),t.liveswitch.sdp.rtcp.FeedbackAttribute.getWildcardPayloadType())?"*":t.liveswitch.NumberExtensions.toString(this.getPayloadType());return t.liveswitch.Global.equals(this.getSubType(),null)?t.liveswitch.StringExtensions.format("{0} {1}",e,this.getType()):t.liveswitch.StringExtensions.format("{0} {1} {2}",e,this.getType(),this.getSubType())}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPayloadType=function(){if(0==arguments.length)return this._payloadType;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSubType=function(){if(0==arguments.length)return this._subType;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getType=function(){if(0==arguments.length)return this._type;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setPayloadType=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._payloadType=t.liveswitch.Global.toInt(e)},o.prototype.setSubType=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._subType=e},o.prototype.setType=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._type=e},o}(t.liveswitch.sdp.Attribute);i.FeedbackAttribute=o})(i.rtcp||(i.rtcp={}))})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){(function(t){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i-1&&i>o,s=t.liveswitch.StreamDirection.SendReceive,r=t.liveswitch.ParseAssistant.parseIntegerValue(t.liveswitch.StringExtensions.substring(e,0,o>-1?t.liveswitch.MathAssistant.min(i,o):i));n&&(s=t.liveswitch.StreamDirectionHelper.directionFromString(t.liveswitch.StringExtensions.substring(e,o+1,i-o-1)));var a=e.substring(i+1),l=t.liveswitch.StringExtensions.indexOf(a," "),c="",h="";t.liveswitch.Global.equals(l,-1)?c=a:(c=t.liveswitch.StringExtensions.substring(a,0,l),h=a.substring(l+1));var p=new t.liveswitch.sdp.rtp.ExtMapAttribute(r,c);return n&&p.setDirection(s),t.liveswitch.StringExtensions.isNullOrEmpty(h)||p.setExtensionAttributes(h),p}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length){var e=new t.liveswitch.StringBuilder;if(e.append(t.liveswitch.NumberExtensions.toString(this.getId())),!t.liveswitch.Global.equals(this.getDirection(),t.liveswitch.StreamDirection.Unset)){var i=t.liveswitch.StreamDirectionHelper.directionToString(this.getDirection());e.append("/"),e.append(i)}return e.append(" "),e.append(this.getUri()),t.liveswitch.StringExtensions.isNullOrEmpty(this.getExtensionAttributes())||(e.append(" "),e.append(this.getExtensionAttributes())),e.toString()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDirection=function(){if(0==arguments.length)return this.__direction;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getExtensionAttributes=function(){if(0==arguments.length)return this._extensionAttributes;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getId=function(){if(0==arguments.length)return this._id;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getUri=function(){if(0==arguments.length)return this._uri;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setDirection=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__direction=e},o.prototype.setExtensionAttributes=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._extensionAttributes=e},o.prototype.setId=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._id=t.liveswitch.Global.toInt(e)},o.prototype.setUri=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._uri=e},o}(t.liveswitch.sdp.Attribute);i.ExtMapAttribute=o})(i.rtp||(i.rtp={}))})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){(function(t){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i0){for(var i=t.liveswitch.StringExtensions.split(t.liveswitch.StringExtensions.trim(e),[32]),o=new Array(i.length),n=0;nh&&t.liveswitch.StringExtensions.startsWith(c[h],"pt=")){a=c[h++];var p=t.liveswitch.StringExtensions.split(a.substring(3),[44]);for(s=new Array(p.length),l=0;lh)for(r=new Array(c.length-h),l=0;l45&&o<48||o>57&&o<65||o>90&&o<95||o>95&&o<97||o>122)return!1}return!0}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.directionIsValid=function(e){if(1==arguments.length){for(var i=0,o=[t.liveswitch.sdp.rtp.RidDirection.getSend(),t.liveswitch.sdp.rtp.RidDirection.getReceive()];i0){for(var r=new Array(i),a=0;a0)for(var l=0,c=this.getRestrictions();l0&&(e.append(" "),e.append(t.liveswitch.StringExtensions.join(";",n))),e.toString()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDirection=function(){if(0==arguments.length)return this.__direction;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getId=function(){if(0==arguments.length)return this._id;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPayloadTypes=function(){if(0==arguments.length)return this._payloadTypes;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRestrictions=function(){if(0==arguments.length)return this._restrictions;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRestrictionValue=function(e){if(1==arguments.length){if(!t.liveswitch.Global.equals(this.getRestrictions(),null))for(var i=0,o=this.getRestrictions();i2?t.liveswitch.ParseAssistant.parseIntegerValue(i[2]):16,r=new t.liveswitch.sdp.sctp.MapAttribute;return r.setPort(o),r.setSctpProtocol(n),r.setStreams(s),r}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAttributeValue=function(){if(0==arguments.length){var e=new t.liveswitch.StringBuilder;return e.append(t.liveswitch.NumberExtensions.toString(this.getPort())),e.append(" "),e.append(this.getSctpProtocol()),e.append(" "),e.append(t.liveswitch.NumberExtensions.toString(this.getStreams())),e.toString()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPort=function(){if(0==arguments.length)return this._port;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSctpProtocol=function(){if(0==arguments.length)return this._sctpProtocol;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStreams=function(){if(0==arguments.length)return this._streams;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setPort=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._port=t.liveswitch.Global.toInt(e)},o.prototype.setSctpProtocol=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._sctpProtocol=e},o.prototype.setStreams=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._streams=t.liveswitch.Global.toInt(e)},o}(t.liveswitch.sdp.Attribute);i.MapAttribute=o})(i.sctp||(i.sctp={}))})(i.sdp||(i.sdp={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0&&(n=e.liveswitch.StringExtensions.concat(n,".")),o=0;oi)a=e.liveswitch.StringExtensions.substring(a,0,i);else if(e.liveswitch.StringExtensions.getLength(a)=32768&&(o-=65536),o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getRtpTimestampDelta=function(t,i){if(2==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]),i=e.liveswitch.Global.toInt(arguments[1]);var o=t-i;return o<-2147483648?o+4294967296:(o>=2147483648&&(o-=4294967296),o)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.lastOrDefault=function(){if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isArray(arguments[0])&&(0==arguments[0].length||e.liveswitch.Util.isNullOrUndefined(arguments[0][0])||e.liveswitch.Util.isObject(arguments[0][0])))){var t=arguments[0];return e.liveswitch.Global.equals(t,null)||e.liveswitch.Global.equals(t.length,0)?null:t[t.length-1]}if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isObject(arguments[0]))){var i=arguments[0];return e.liveswitch.Global.equals(i,null)||e.liveswitch.Global.equals(e.liveswitch.ArrayExtensions.getCount(i),0)?null:i[e.liveswitch.ArrayExtensions.getCount(i)-1]}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.nullableLongEquals=function(t,i){if(2==arguments.length)return e.liveswitch.Global.equals(null!=t,null!=i)&&(!(null!=t)||e.liveswitch.Global.equals(t,i));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.singleOrDefault=function(){if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isArray(arguments[0])&&(0==arguments[0].length||e.liveswitch.Util.isNullOrUndefined(arguments[0][0])||e.liveswitch.Util.isObject(arguments[0][0])))){var t=arguments[0];return e.liveswitch.Global.equals(t,null)||!e.liveswitch.Global.equals(t.length,1)?null:t[0]}if(1==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isObject(arguments[0]))){var i=arguments[0];return e.liveswitch.Global.equals(i,null)||!e.liveswitch.Global.equals(e.liveswitch.ArrayExtensions.getCount(i),1)?null:i[0]}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.splice=function(){if(4==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[2])||e.liveswitch.Util.isArray(arguments[2])&&(0==arguments[2].length||e.liveswitch.Util.isNullOrUndefined(arguments[2][0])||e.liveswitch.Util.isObject(arguments[2][0])))){var t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]),o=arguments[2],n=arguments[3];return e.liveswitch.Utility.splice(t,i,0,o,n)}if(5==arguments.length){t=arguments[0],i=e.liveswitch.Global.toInt(arguments[1]);var s=e.liveswitch.Global.toInt(arguments[2]);o=arguments[3],n=arguments[4];if(i<0&&t.length+i>=0&&(i=t.length+i),i<0||s<0||i+s>t.length){var r=t.length;throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Cannot splice {0} items at index {1} from an array of length {2}.",e.liveswitch.NumberExtensions.toString(s),e.liveswitch.NumberExtensions.toString(i),e.liveswitch.NumberExtensions.toString(r)))}var a=e.liveswitch.Global.equals(o,null)?0:o.length,l=n(t.length-s+a),c=0,h=0,p=0;while(h0&&(t.append(" ("),t.append(e.liveswitch.StringExtensions.join("; ",e.liveswitch.ArrayExtensions.toArray(i))),t.append(")")),t.toString()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.updateLevelIsStrictToCompatible=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.getLevelIsStrict()&&this.setLevelIsStrict(!0)},t.prototype.updateLevelToCompatible=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.liveswitch.Global.equals(t.getLevel(),null)||(e.liveswitch.Global.equals(this.getLevel(),null)?this.setLevel(t.getLevel()):this.getLevelIsStrict()||(t.getLevelIsStrict()?this.setLevel(t.getLevel()):this.setLevel(this.getMinLevel(this.getLevel(),t.getLevel()))))},t.prototype.updateProfileToCompatible=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.liveswitch.Global.equals(t.getProfile(),null)||this.setProfile(t.getProfile())},t.prototype.updateTierToCompatible=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.liveswitch.Global.equals(t.getTier(),null)||this.setTier(t.getTier())},t.prototype.updateToCompatible=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.updateProfileToCompatible(t),this.updateLevelToCompatible(t),this.updateLevelIsStrictToCompatible(t),this.updateTierToCompatible(t)},t}();t.MediaFormat=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n1?1:i<-1?-1:i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.addOnLevel=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.liveswitch.ArrayExtensions.add(this.__onLevel,t)},t.prototype.getInterval=function(){if(0==arguments.length)return this.__interval;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.process=function(t,i,o){if(3!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");i=e.liveswitch.Global.toInt(arguments[1]),o=e.liveswitch.Global.toInt(arguments[2]);var n=e.liveswitch.MathAssistant.floor(e.liveswitch.MathAssistant.floor(t.getLength()/2)/o);(e.liveswitch.Global.equals(this.__samples,null)||this.__samples.length0){var c=l[0];e.liveswitch.Global.equals(c,e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___send)?o=!0:e.liveswitch.Global.equals(c,e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___recv)?n=!0:e.liveswitch.Global.equals(c,e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___video)&&i.setIsVideo(!0)}}o&&n?i.setLocalDirection(e.liveswitch.StreamDirection.SendReceive):o?i.setLocalDirection(e.liveswitch.StreamDirection.SendOnly):n?i.setLocalDirection(e.liveswitch.StreamDirection.ReceiveOnly):i.setLocalDirection(e.liveswitch.StreamDirection.Inactive)},t.parse=function(t){if(e.liveswitch.MediaIntent.fmliveswitchMediaIntentInitialize(),1==arguments.length){var i=e.liveswitch.StringExtensions.split(t,[59]);return i.length>0&&e.liveswitch.Global.equals(i[0],e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___video)?e.liveswitch.VideoIntent.parseVideo(i):null}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsVideo=function(){if(0==arguments.length)return this._isVideo;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getLocalDirection=function(){if(0==arguments.length)return this._localDirection;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.serialize=function(){if(0==arguments.length){var t="";if(this.getIsVideo()&&(t=e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___video),e.liveswitch.Global.equals(this.getLocalDirection(),e.liveswitch.StreamDirection.SendReceive)||e.liveswitch.Global.equals(this.getLocalDirection(),e.liveswitch.StreamDirection.Unset)){e.liveswitch.Global.equals(this.getLocalDirection(),e.liveswitch.StreamDirection.Unset)&&e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___log.warn("Stream has local direction unset, assuming send/recv.");var i=t;return e.liveswitch.StringExtensions.concat([i,";",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___send,";",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___recv])}return e.liveswitch.Global.equals(this.getLocalDirection(),e.liveswitch.StreamDirection.SendOnly)?e.liveswitch.StringExtensions.concat(t,";",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___send):(e.liveswitch.Global.equals(this.getLocalDirection(),e.liveswitch.StreamDirection.ReceiveOnly)&&(t=e.liveswitch.StringExtensions.concat(t,";",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___recv)),t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setIsVideo=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._isVideo=t},t.prototype.setLocalDirection=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._localDirection=t},t.fmliveswitchMediaIntentInitialize=function(){e.liveswitch.MediaIntent.__fmliveswitchMediaIntentInitialized||e.liveswitch.MediaIntent.__fmliveswitchMediaIntentInitializing||(e.liveswitch.MediaIntent.__fmliveswitchMediaIntentInitializing=!0,e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___log=e.liveswitch.Log.getLogger(new e.liveswitch.Type("[fm.liveswitch.MediaIntent]")),e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___video="video",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___send="send",e.liveswitch.MediaIntent.fm_liveswitch_MediaIntent___recv="recv",e.liveswitch.MediaIntent.__fmliveswitchMediaIntentInitialized=!0,e.liveswitch.MediaIntent.__fmliveswitchMediaIntentInitializing=!1)},t.__fmliveswitchMediaIntentInitialized=!1,t.__fmliveswitchMediaIntentInitializing=!1,t}();t.MediaIntent=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){var e=this;t.liveswitch.VideoIntent.fmliveswitchVideoIntentInitialize();for(var o=new Array(arguments.length),n=0;n0){var a=r[0];t.liveswitch.Global.equals(a,t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___resolution)?i.setResolution(t.liveswitch.Size.parse(r[1])):t.liveswitch.Global.equals(a,t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___fps)?i.setFrameRate(t.liveswitch.ParseAssistant.parseIntegerValue(r[1])):t.liveswitch.Global.equals(a,t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___br)?i.setBitrate(t.liveswitch.ParseAssistant.parseLongValue(r[1])):t.liveswitch.Global.equals(a,t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___content)&&i.setVideoType(t.liveswitch.VideoContent.toVideoType(r[1]))}}return t.liveswitch.MediaIntent.deserialize(e,i),i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBitrate=function(){if(0==arguments.length)return this._bitrate;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getFrameRate=function(){if(0==arguments.length)return this._frameRate;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getPixels=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getResolution(),null)?-1:this.getResolution().getWidth()*this.getResolution().getHeight();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getResolution=function(){if(0==arguments.length)return this._resolution;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getVideoType=function(){if(0==arguments.length)return this._videoType;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.serialize=function(){if(0==arguments.length){var e=void 0,o=i.prototype.serialize.call(this);return t.liveswitch.Global.equals(this.getResolution(),null)||(e=o,o=t.liveswitch.StringExtensions.concat([e,";",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___resolution,"=",this.getResolution().toString()])),this.getFrameRate()>0&&(e=o,o=t.liveswitch.StringExtensions.concat([e,";",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___fps,"=",t.liveswitch.NumberExtensions.toString(this.getFrameRate(),t.liveswitch.CultureInfo.getInvariantCulture())])),this.getBitrate()>0&&(e=o,o=t.liveswitch.StringExtensions.concat([e,";",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___br,"=",t.liveswitch.NumberExtensions.toString(this.getBitrate())])),(t.liveswitch.Global.equals(this.getVideoType(),t.liveswitch.VideoType.Camera)||t.liveswitch.Global.equals(this.getVideoType(),t.liveswitch.VideoType.Screen))&&(e=o,o=t.liveswitch.StringExtensions.concat([e,";",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___content,"=",t.liveswitch.VideoContent.fromVideoType(this.getVideoType())])),o}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setBitrate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._bitrate=t.liveswitch.Global.toInt(e)},o.prototype.setFrameRate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._frameRate=e},o.prototype.setResolution=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._resolution=e},o.prototype.setVideoType=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._videoType=e},o.fmliveswitchVideoIntentInitialize=function(){t.liveswitch.VideoIntent.__fmliveswitchVideoIntentInitialized||t.liveswitch.VideoIntent.__fmliveswitchVideoIntentInitializing||(t.liveswitch.VideoIntent.__fmliveswitchVideoIntentInitializing=!0,t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___resolution="resolution",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___fps="fps",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___br="br",t.liveswitch.VideoIntent.fm_liveswitch_VideoIntent___content="content",t.liveswitch.VideoIntent.__fmliveswitchVideoIntentInitialized=!0,t.liveswitch.VideoIntent.__fmliveswitchVideoIntentInitializing=!1)},o.__fmliveswitchVideoIntentInitialized=!1,o.__fmliveswitchVideoIntentInitializing=!1,o}(t.liveswitch.MediaIntent);i.VideoIntent=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(){for(var t=new Array(arguments.length),i=0;i=o.getMinBitrate()&&t.liveswitch.ArrayExtensions.add(e,l)}return t.liveswitch.ArrayExtensions.toArray(e)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o}(t.liveswitch.SimulcastConfig);i.AudioSimulcastConfig=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n=a.getMinBitrate()&&t.liveswitch.ArrayExtensions.add(r,d)}return t.liveswitch.ArrayExtensions.toArray(r)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBitsPerPixel=function(){if(0==arguments.length)return this.__bitsPerPixel;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDegradationPreference=function(){if(0==arguments.length)return this._degradationPreference;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getEncodingConfigs=function(e,o,n,s){if(4==arguments.length){if(o=t.liveswitch.Global.toInt(arguments[1]),n=t.liveswitch.Global.toInt(arguments[2]),i.prototype.getDisabled.call(this))return[new t.liveswitch.VideoEncodingConfig];var r=new t.liveswitch.vp8.Format,a=t.liveswitch.MathAssistant.min(t.liveswitch.MathAssistant.max(r.getMinBitrate(),t.liveswitch.VideoUtility.getBitrate(i.prototype.getPreferredBitrate.call(this),o,n,s,this.getBitsPerPixel())),r.getMaxBitrate());return t.liveswitch.VideoSimulcastConfig.getEncodingConfigs(i.prototype.getEncodingCount.call(this),this.getDegradationPreference(),e,a,s)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setBitsPerPixel=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(e<0)throw new t.liveswitch.Exception("Bits-per-pixel must be greater than or equal to zero.");this.__bitsPerPixel=e},o.prototype.setDegradationPreference=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._degradationPreference=e},o}(t.liveswitch.SimulcastConfig);i.VideoSimulcastConfig=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){var e=this;t.liveswitch.VideoFormat.fmliveswitchVideoFormatInitialize();for(var o=new Array(arguments.length),n=0;ns[0]?e:o}if(this.getIsH265()&&!t.liveswitch.StringExtensions.isNullOrEmpty(e)&&!t.liveswitch.StringExtensions.isNullOrEmpty(o)){var r=t.liveswitch.ParseAssistant.parseIntegerValue(e),a=t.liveswitch.ParseAssistant.parseIntegerValue(o);return r>a?e:o}return i.prototype.getMaxLevel.call(this,e,o)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getMinLevel=function(e,o){if(2==arguments.length){if(this.getIsH264()){var n=t.liveswitch.BitAssistant.getHexBytes(e),s=t.liveswitch.BitAssistant.getHexBytes(o);return n[0]>s[0]?o:e}if(this.getIsH265()&&!t.liveswitch.StringExtensions.isNullOrEmpty(e)&&!t.liveswitch.StringExtensions.isNullOrEmpty(o)){var r=t.liveswitch.ParseAssistant.parseIntegerValue(e),a=t.liveswitch.ParseAssistant.parseIntegerValue(o);return r>a?o:e}return i.prototype.getMinLevel.call(this,e,o)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getParameters=function(){if(0==arguments.length)return null;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isLevelCompatible=function(e){if(1==arguments.length){if(this.getIsH264()){if(t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(i.prototype.getLevel.call(this)),2)&&t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(e),2)){var o=t.liveswitch.BitAssistant.getHexBytes(i.prototype.getLevel.call(this)),n=t.liveswitch.BitAssistant.getHexBytes(e);return o[0]<=n[0]}}else if(this.getIsH265()&&!t.liveswitch.StringExtensions.isNullOrEmpty(i.prototype.getLevel.call(this))&&!t.liveswitch.StringExtensions.isNullOrEmpty(e)){var s=t.liveswitch.ParseAssistant.parseIntegerValue(i.prototype.getLevel.call(this)),r=t.liveswitch.ParseAssistant.parseIntegerValue(e);return s<=r}return i.prototype.isLevelCompatible.call(this,e)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isProfileCompatible=function(e){if(1==arguments.length){if(this.getIsH264()&&t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(i.prototype.getProfile.call(this)),4)&&t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(e),4)){var o=t.liveswitch.BitAssistant.getHexBytes(i.prototype.getProfile.call(this)),n=t.liveswitch.BitAssistant.getHexBytes(e);return o[0]<=n[0]}return i.prototype.isProfileCompatible.call(this,e)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setFourCC=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.setName.call(this,this.fourCCToFormatName(e))},o.prototype.toJson=function(){if(0==arguments.length)return t.liveswitch.VideoFormat.toJson(this);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.updateProfileToCompatible=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(this.getIsH264()&&!t.liveswitch.Global.equals(e.getProfile(),null))if(!t.liveswitch.Global.equals(i.prototype.getProfile.call(this),null)&&t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(i.prototype.getProfile.call(this)),4)&&t.liveswitch.Global.equals(t.liveswitch.StringExtensions.getLength(e.getProfile()),4)){var o=t.liveswitch.BitAssistant.getHexBytes(i.prototype.getProfile.call(this)),n=t.liveswitch.BitAssistant.getHexBytes(e.getProfile());i.prototype.setProfile.call(this,t.liveswitch.BitAssistant.getHexString(new Uint8Array([n[0],o[1]|n[1]])))}else i.prototype.setProfile.call(this,e.getProfile());i.prototype.updateProfileToCompatible.call(this,e)},o.fmliveswitchVideoFormatInitialize=function(){t.liveswitch.VideoFormat.__fmliveswitchVideoFormatInitialized||t.liveswitch.VideoFormat.__fmliveswitchVideoFormatInitializing||(t.liveswitch.VideoFormat.__fmliveswitchVideoFormatInitializing=!0,t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup={},t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__reverseFourCCLookup=null,t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getRgbName()]=t.liveswitch.VideoFormat.toFourCC(114,97,119,32),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getBgrName()]=t.liveswitch.VideoFormat.toFourCC(50,52,66,71),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getNv12Name()]=t.liveswitch.VideoFormat.toFourCC(78,86,49,50),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getNv21Name()]=t.liveswitch.VideoFormat.toFourCC(78,86,50,49),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getI420Name()]=t.liveswitch.VideoFormat.toFourCC(73,52,50,48),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getYv12Name()]=t.liveswitch.VideoFormat.toFourCC(89,86,49,50),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getArgbName()]=t.liveswitch.VideoFormat.toFourCC(65,82,71,66),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getAbgrName()]=t.liveswitch.VideoFormat.toFourCC(65,66,71,82),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getRgbaName()]=t.liveswitch.VideoFormat.toFourCC(82,71,66,65),t.liveswitch.VideoFormat.fm_liveswitch_VideoFormat__fourCCLookup[t.liveswitch.VideoFormat.getBgraName()]=t.liveswitch.VideoFormat.toFourCC(66,71,82,65),t.liveswitch.VideoFormat.__fmliveswitchVideoFormatInitialized=!0,t.liveswitch.VideoFormat.__fmliveswitchVideoFormatInitializing=!1)},o.__fmliveswitchVideoFormatInitialized=!1,o.__fmliveswitchVideoFormatInitializing=!1,o}(t.liveswitch.MediaFormat);i.VideoFormat=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0){r=new Array;var a=-1,l=null;while(s+4n){var p=s+4;return e.liveswitch.DataMessage.fm_liveswitch_DataMessage___log.error(e.liveswitch.StringExtensions.format("Could not parse Data Message. Header length declared to have {0} bytes, while {1} bytes of header length were read.",e.liveswitch.NumberExtensions.toString(n),e.liveswitch.NumberExtensions.toString(p))),null}e.liveswitch.Global.equals(l,null)||e.liveswitch.ArrayExtensions.add(r,l)}}var d=null,w=o;do{if(0==w){d=new e.liveswitch.DataMessage(t.subset(n));break}if(1==w){d=new e.liveswitch.DataMessage(t.readUtf8String(n));break}return e.liveswitch.Log.error(e.liveswitch.StringExtensions.format("Received a data message with an unknown payload {0}. Will not parse.",e.liveswitch.NumberExtensions.toString(o))),null}while(0);return e.liveswitch.Global.equals(r,null)||d.setElements(e.liveswitch.ArrayExtensions.toArray(r)),d}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getBytes=function(){if(0==arguments.length){var t=void 0,i=4,o=null,n=4;e.liveswitch.Global.equals(this.getDataBytes(),null)?e.liveswitch.Global.equals(this.getDataString(),null)||(o=e.liveswitch.Utf8.encode(this.getDataString()),i+=o.length):i+=this.getDataBytes().getLength();var s=0;while(st?this.__internalStreamIndexByOfferIndex[t]:-1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getInternalStreamMediaIndexForStream=function(t,i){if(2==arguments.length)return i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Audio)?this.__internalAudioStreamIndex[i]:e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Video)?this.__internalVideoStreamIndex[i]:e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Application)?this.__internalDataStreamIndex[i]:-1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getOffererStreamIndexFor=function(t){if(1==arguments.length)return t=e.liveswitch.Global.toInt(arguments[0]),this.__offererStreamIndexByInternalIndex.length>t?this.__offererStreamIndexByInternalIndex[t]:-1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getOffererStreamMediaIndexForStream=function(t,i){if(2==arguments.length)return i=e.liveswitch.Global.toInt(arguments[1]),e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Audio)?this.__offererAudioStreamIndex[i]:e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Video)?this.__offererVideoStreamIndex[i]:e.liveswitch.Global.equals(t,e.liveswitch.StreamType.Application)?this.__offererDataStreamIndex[i]:-1;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.populateInternalStreamTypeIndexes=function(t){if(1==arguments.length){for(var i=0;i1&&e.liveswitch.StringExtensions.startsWith(n[1],":")&&o.setValue(e.liveswitch.IceServer.parsePort(n[1].substring(1)))):(n=e.liveswitch.StringExtensions.split(t,[58]),e.liveswitch.Global.equals(n.length,1)?i.setValue(t):e.liveswitch.Global.equals(n.length,2)?(i.setValue(n[0]),o.setValue(e.liveswitch.IceServer.parsePort(n[1]))):n.length>2&&i.setValue(t)),!0)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.parsePort=function(t){if(1==arguments.length){var i=-1,o=new e.liveswitch.Holder(i),n=e.liveswitch.ParseAssistant.tryParseIntegerValue(t,o);if(i=o.getValue(),!n)throw new e.liveswitch.Exception(e.liveswitch.StringExtensions.format("Could not parse port when trying to interpret uri in the IceServer constructor. Please verify that the port was given as an integer. Tried parsing value {0}.",t));return i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJson=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObject(t,(function(i,o){e.liveswitch.Global.equals(t.getUrl(),null)||(o["url"]=e.liveswitch.JsonSerializer.serializeString(t.getUrl())),e.liveswitch.Global.equals(t.getUsername(),null)||(o["username"]=e.liveswitch.JsonSerializer.serializeString(t.getUsername())),e.liveswitch.Global.equals(t.getPassword(),null)||(o["password"]=e.liveswitch.JsonSerializer.serializeString(t.getPassword()))}));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.toJsonArray=function(t){if(1==arguments.length)return e.liveswitch.JsonSerializer.serializeObjectArray(t,e.liveswitch.IceServer.toJson.bind(e.liveswitch.IceServer));throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getHost=function(){if(0==arguments.length){var t=null,i=-1,o=new e.liveswitch.Holder(t),n=new e.liveswitch.Holder(i);e.liveswitch.IceServer.parseAddress(this.getUrl(),o,n);return t=o.getValue(),i=n.getValue(),t}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIPAddress=function(){if(0==arguments.length)return e.liveswitch.Global.equals(this.__ipAddress,null)&&!e.liveswitch.Global.equals(this.__ipAddresses,null)&&this.__ipAddresses.length>0&&(this.__ipAddress=this.__ipAddresses[0]),this.__ipAddress;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIPAddresses=function(){if(0==arguments.length)return e.liveswitch.Global.equals(this.__ipAddresses,null)&&!e.liveswitch.Global.equals(this.__ipAddress,null)&&(this.__ipAddresses=[this.__ipAddress]),this.__ipAddresses;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsSecure=function(){if(0==arguments.length)return e.liveswitch.StringExtensions.startsWith(this.getUrl(),"stuns:")||e.liveswitch.StringExtensions.startsWith(this.getUrl(),"turns:");throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsStun=function(){if(0==arguments.length)return e.liveswitch.StringExtensions.startsWith(this.getUrl(),"stun:")||e.liveswitch.StringExtensions.startsWith(this.getUrl(),"stuns:");throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsTcp=function(){if(0==arguments.length)return!e.liveswitch.StringExtensions.endsWith(this.getUrl(),"?transport=udp")&&!this.getIsStun();throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsTurn=function(){if(0==arguments.length)return e.liveswitch.StringExtensions.startsWith(this.getUrl(),"turn:")||e.liveswitch.StringExtensions.startsWith(this.getUrl(),"turns:");throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getIsUdp=function(){if(0==arguments.length)return!e.liveswitch.StringExtensions.endsWith(this.getUrl(),"?transport=tcp");throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getPassword=function(){if(0==arguments.length)return this._password;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getPort=function(){if(0==arguments.length){var t=null,i=-1,o=new e.liveswitch.Holder(t),n=new e.liveswitch.Holder(i);e.liveswitch.IceServer.parseAddress(this.getUrl(),o,n);return t=o.getValue(),i=n.getValue(),e.liveswitch.Global.equals(i,-1)?!this.getIsSecure()&&this.getIsTurn()?e.liveswitch.IceServer.getDefaultTurnPort():!this.getIsSecure()&&this.getIsStun()?e.liveswitch.IceServer.getDefaultStunPort():this.getIsSecure()&&this.getIsTurn()?e.liveswitch.IceServer.getDefaultTurnsPort():e.liveswitch.IceServer.getDefaultStunsPort():i}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getUrl=function(){if(0==arguments.length)return this._url;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.getUsername=function(){if(0==arguments.length)return this._username;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.setIPAddress=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__ipAddress=t},t.prototype.setIPAddresses=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__ipAddresses=t},t.prototype.setPassword=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._password=t},t.prototype.setUrl=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._url=t},t.prototype.setUsername=function(t){if(1!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._username=t},t.prototype.toJson=function(){if(0==arguments.length)return e.liveswitch.IceServer.toJson(this);throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t}();t.IceServer=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsRaw=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsRaw()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsRgb=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsRgb()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsRgba=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsRgba()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsRgbaType=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsRgbaType()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsRgbType=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsRgbType()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsVp8=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsVp8()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsVp9=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsVp9()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsYuvType=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsYuvType()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getIsYv12=function(){if(0==arguments.length){var e=i.prototype.getFormat.call(this);return!t.liveswitch.Global.equals(e,null)&&e.getIsYv12()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getOrientation=function(){if(0==arguments.length)return this.__orientation;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRotationRequired=function(){if(0==arguments.length){var e=this.getOrientation();return this.getVerticallyMirrored()&&this.getHorizontallyMirrored()?e+=180:this.getVerticallyMirrored()?e=360-e:this.getHorizontallyMirrored()&&(t.liveswitch.Global.equals(this.getOrientation(),0)||t.liveswitch.Global.equals(this.getOrientation(),180))&&(e+=180),e%360}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRValue=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.getFormat.call(this).getIsRgbType()||i.prototype.getFormat.call(this).getIsRgbaType()?i.prototype.getDataBuffer.call(this).read8(this.getRValueOffset(e)):-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRValueOffset=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.getFormat.call(this).getIsRgb()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*3:i.prototype.getFormat.call(this).getIsBgr()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*3+2:i.prototype.getFormat.call(this).getIsRgba()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*4:i.prototype.getFormat.call(this).getIsBgra()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*4+2:i.prototype.getFormat.call(this).getIsArgb()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*4+1:i.prototype.getFormat.call(this).getIsAbgr()?t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth()*4+3:-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStride=function(){if(0==arguments.length){var e=this.getStrides();return t.liveswitch.Global.equals(e,null)?0:e[0]}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStrides=function(){if(0==arguments.length)return this._strides;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getTransformRequired=function(){if(0==arguments.length)return!t.liveswitch.Global.equals(this.getRotationRequired(),0)||this.getInversionRequired();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getUValue=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.getFormat.call(this).getIsYuvType()?this.getIsPacked()?i.prototype.getDataBuffers.call(this)[0].read8(this.getUValueOffset(e)):this.getIsYv12()?i.prototype.getDataBuffers.call(this)[2].read8(this.getUValueOffset(e)):i.prototype.getDataBuffers.call(this)[1].read8(this.getUValueOffset(e)):-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getUValueOffset=function(e){if(1==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]);var i=void 0,o=void 0,n=void 0;if(this.getIsPacked()){if(this.getIsI420()||this.getIsYv12()){var s=t.liveswitch.MathAssistant.floor(this.getStride()/2);return i=t.liveswitch.MathAssistant.floor(this.getWidth()/2),o=t.liveswitch.MathAssistant.floor(e/i)*s+e%i,this.getIsI420()?this.getHeight()*this.getStride()+o:t.liveswitch.MathAssistant.floor(this.getHeight()*this.getStride()*5/4)+o}return n=2*e,o=t.liveswitch.MathAssistant.floor(n/this.getWidth())*this.getStride()+n%this.getWidth(),this.getIsNv12()?this.getHeight()*this.getStride()+o:this.getHeight()*this.getStride()+o+1}return this.getIsI420()||this.getIsYv12()?(i=t.liveswitch.MathAssistant.floor(this.getWidth()/2),this.getIsI420()?t.liveswitch.MathAssistant.floor(e/i)*this.getStrides()[1]+e%i:t.liveswitch.MathAssistant.floor(e/i)*this.getStrides()[2]+e%i):(n=2*e,o=t.liveswitch.MathAssistant.floor(n/this.getWidth())*this.getStrides()[1]+n%this.getWidth(),this.getIsNv12()?o:o+1)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getVerticallyMirrored=function(){if(0==arguments.length)return this._verticallyMirrored;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getVValue=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.getFormat.call(this).getIsYuvType()?this.getIsPacked()?i.prototype.getDataBuffers.call(this)[0].read8(this.getVValueOffset(e)):this.getIsI420()?i.prototype.getDataBuffers.call(this)[2].read8(this.getVValueOffset(e)):i.prototype.getDataBuffers.call(this)[1].read8(this.getVValueOffset(e)):-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getVValueOffset=function(e){if(1==arguments.length){e=t.liveswitch.Global.toInt(arguments[0]);var i=void 0,o=void 0,n=void 0;if(this.getIsPacked()){if(this.getIsI420()||this.getIsYv12()){var s=t.liveswitch.MathAssistant.floor(this.getStride()/2);return i=t.liveswitch.MathAssistant.floor(this.getWidth()/2),o=t.liveswitch.MathAssistant.floor(e/i)*s+e%i,this.getIsI420()?t.liveswitch.MathAssistant.floor(this.getHeight()*this.getStride()*5/4)+o:this.getHeight()*this.getStride()+o}return n=2*e,o=t.liveswitch.MathAssistant.floor(n/this.getWidth())*this.getStride()+n%this.getWidth(),this.getIsNv12()?this.getHeight()*this.getStride()+o+1:this.getHeight()*this.getStride()+o}return this.getIsI420()||this.getIsYv12()?(i=t.liveswitch.MathAssistant.floor(this.getWidth()/2),this.getIsI420()?t.liveswitch.MathAssistant.floor(e/i)*this.getStrides()[2]+e%i:t.liveswitch.MathAssistant.floor(e/i)*this.getStrides()[1]+e%i):(n=2*e,o=t.liveswitch.MathAssistant.floor(n/this.getWidth())*this.getStrides()[1]+n%this.getWidth(),this.getIsNv12()?o+1:o)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getWidth=function(){if(0==arguments.length)return this.__width;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getYValue=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),i.prototype.getFormat.call(this).getIsYuvType()?i.prototype.getDataBuffer.call(this).read8(this.getYValueOffset(e)):-1;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getYValueOffset=function(e){if(1==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),t.liveswitch.MathAssistant.floor(e/this.getWidth())*this.getStride()+e%this.getWidth();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.mute=function(){if(0==arguments.length){if(!this.__isMuted){if(i.prototype.getFormat.call(this).getIsRgbType())i.prototype.getDataBuffer.call(this).set(0);else{var e=void 0,o=void 0;if(i.prototype.getFormat.call(this).getIsRgbaType()){e=i.prototype.getDataBuffer.call(this);var n=1,s=0;for((i.prototype.getFormat.call(this).getIsBgra()||i.prototype.getFormat.call(this).getIsRgba())&&(n=0,s=3),o=0;o0&&e--,this.__height=t.liveswitch.Global.toInt(e)},o.prototype.setHorizontallyMirrored=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._horizontallyMirrored=e},o.prototype.setIsMuted=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__isMuted=e},o.prototype.setOrientation=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(e=t.liveswitch.Global.toInt(arguments[0]),!t.liveswitch.Global.equals(e,0)&&!t.liveswitch.Global.equals(e,90)&&!t.liveswitch.Global.equals(e,180)&&!t.liveswitch.Global.equals(e,270))throw new t.liveswitch.Exception("Video orientation can only be 0, 90, 180 or 270.");this.__orientation=t.liveswitch.Global.toInt(e)},o.prototype.setRValue=function(e,o){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),(i.prototype.getFormat.call(this).getIsRgbType()||i.prototype.getFormat.call(this).getIsRgbaType())&&i.prototype.getDataBuffer.call(this).write8(e,this.getRValueOffset(o));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setStride=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this.setStrides([e])},o.prototype.setStrides=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._strides=e},o.prototype.setUValue=function(e,o){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),!!i.prototype.getFormat.call(this).getIsYuvType()&&(this.getIsPacked()?i.prototype.getDataBuffers.call(this)[0].write8(e,this.getUValueOffset(o)):this.getIsYv12()?i.prototype.getDataBuffers.call(this)[2].write8(e,this.getUValueOffset(o)):i.prototype.getDataBuffers.call(this)[1].write8(e,this.getUValueOffset(o)));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setVerticallyMirrored=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._verticallyMirrored=e},o.prototype.setVValue=function(e,o){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),!!i.prototype.getFormat.call(this).getIsYuvType()&&(this.getIsPacked()?i.prototype.getDataBuffers.call(this)[0].write8(e,this.getVValueOffset(o)):this.getIsI420()?i.prototype.getDataBuffers.call(this)[2].write8(e,this.getVValueOffset(o)):i.prototype.getDataBuffers.call(this)[1].write8(e,this.getVValueOffset(o)));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setWidth=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),!t.liveswitch.Global.equals(e,-1)&&e%2>0&&e--,this.__width=t.liveswitch.Global.toInt(e)},o.prototype.setYValue=function(e,o){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),o=t.liveswitch.Global.toInt(arguments[1]),i.prototype.getFormat.call(this).getIsYuvType()&&i.prototype.getDataBuffer.call(this).write8(e,this.getYValueOffset(o));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.toJson=function(){if(0==arguments.length)return t.liveswitch.VideoBuffer.toJson(this);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.toPacked=function(){if(0==arguments.length)return this.toPacked(!1);if(1==arguments.length){var e=arguments[0],o=void 0,n=void 0;if(!(this.getIsYuvType()&&i.prototype.getDataBuffers.call(this).length>1))return this;var s=this.clone(),r=s.getDataBuffers(),a=s.getStrides();if(t.liveswitch.VideoBuffer.canPackWithoutCopy(r)){o=0;for(var l=0,c=r;l0){if(e.liveswitch.Global.equals(this.getContributingSources(),null)||!e.liveswitch.Global.equals(this.getContributingSourceCount(),this.getContributingSources().length))throw new e.liveswitch.Exception("Contributing sources count has a non-zero value but the contributing sources array is null or contains an invalid count.");for(var o=0;o0&&p>0&&i>0&&o>0?e.liveswitch.VideoUtility.getBitrate(h*p,i,o):c}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getBitratePowerScale=function(){if(0==arguments.length)return.75;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getEncodingConfig=function(t,i,o){if(3==arguments.length){var n=new e.liveswitch.VideoEncodingConfig;return e.liveswitch.VideoUtility.updateEncodingConfig(n,t,i,o),n}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.getPixelCount=function(t,i,o){if(3==arguments.length){t=e.liveswitch.Global.toInt(arguments[0]);var n=640,s=480,r=n*s,a=r*i*o/1e3;return e.liveswitch.MathAssistant.round(e.liveswitch.MathAssistant.pow(t/a,1/e.liveswitch.VideoUtility.getBitratePowerScale())*r)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.processDegradationPreference=function(t,i){if(2==arguments.length)return e.liveswitch.Global.equals(t,e.liveswitch.VideoDegradationPreference.Automatic)?e.liveswitch.Global.equals(i,e.liveswitch.VideoType.Camera)?e.liveswitch.VideoDegradationPreference.Resolution:e.liveswitch.Global.equals(i,e.liveswitch.VideoType.Screen)?e.liveswitch.VideoDegradationPreference.FrameRate:e.liveswitch.VideoDegradationPreference.Balanced:t;throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.updateEncodingConfig=function(t,i,o,n){if(4!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.liveswitch.Global.equals(i,e.liveswitch.VideoDegradationPreference.Balanced)&&(o=e.liveswitch.MathAssistant.sqrt(o)),n>0&&(e.liveswitch.Global.equals(i,e.liveswitch.VideoDegradationPreference.FrameRate)||e.liveswitch.Global.equals(i,e.liveswitch.VideoDegradationPreference.Balanced)?t.setFrameRate(n*o):t.setFrameRate(n)),e.liveswitch.Global.equals(i,e.liveswitch.VideoDegradationPreference.Resolution)||e.liveswitch.Global.equals(i,e.liveswitch.VideoDegradationPreference.Balanced)?t.setScale(e.liveswitch.MathAssistant.sqrt(o)):t.setScale(1)},t}();t.VideoUtility=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0&&(r=t.liveswitch.StringExtensions.concat(r,", ")),r=t.liveswitch.StringExtensions.concat(r,"device ID: ",e)),t.liveswitch.Global.equals(o,null)||(t.liveswitch.StringExtensions.getLength(r)>0&&(r=t.liveswitch.StringExtensions.concat(r,", ")),r=t.liveswitch.StringExtensions.concat(r,"client ID: ",o)),t.liveswitch.Global.equals(n,null)||(t.liveswitch.StringExtensions.getLength(r)>0&&(r=t.liveswitch.StringExtensions.concat(r,", ")),r=t.liveswitch.StringExtensions.concat(r,"connection ID: ",n)),t.liveswitch.StringExtensions.getLength(r)>0?t.liveswitch.Channel.fm_liveswitch_Channel___log.info(t.liveswitch.StringExtensions.format(t.liveswitch.StringExtensions.concat(["Channel",this.getId()," - Kicking ",r,"."]),new Array(0))):t.liveswitch.Channel.fm_liveswitch_Channel___log.info(t.liveswitch.StringExtensions.format(t.liveswitch.StringExtensions.concat("Channel",this.getId()," - Kicking channel."),new Array(0))),this.send(t.liveswitch.Message.createKickMessage(e,i,o,n)).then((function(e){!t.liveswitch.Global.equals(e,null)&&t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getError())?s.reject(new t.liveswitch.Exception(e.getPayload())):s.resolve(null)}),(function(e){s.reject(e)}))},o.prototype.doSimpleSend=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=null,n=null;try{if(this.__left)throw new t.liveswitch.Exception("You have left this channel.");t.liveswitch.Global.equals(o,null)&&(o=function(i){!t.liveswitch.Global.equals(i,null)&&t.liveswitch.Global.equals(i.getType(),t.liveswitch.MessageType.getError())?e.reject(new t.liveswitch.Exception(i.getPayload())):e.resolve(null)}),t.liveswitch.Global.equals(n,null)&&(n=function(t){e.reject(t)}),this.send(i).then(o,n)}catch(s){e.reject(s)}},o.prototype.doUpdate=function(e,i,o,n,s,r){if(6!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.send(t.liveswitch.Message.createUpdateMessage(s,e,i,o,n)).then((function(e){!t.liveswitch.Global.equals(e,null)&&t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getError())?r.reject(new t.liveswitch.Exception(e.getPayload())):r.resolve(null)}),(function(e){r.reject(e)}))},o.prototype.doUpdateLayout=function(e,i,o,n,s,r){if(6!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.send(t.liveswitch.Message.createLayoutMessage(s,e,i,o,n)).then((function(e){!t.liveswitch.Global.equals(e,null)&&t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getError())?r.reject(new t.liveswitch.Exception(e.getPayload())):r.resolve(null)}),(function(e){r.reject(e)}))},o.prototype.getApplicationId=function(){if(0==arguments.length)return this._applicationId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClaim=function(){if(0==arguments.length)return this._claim;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClientId=function(){if(0==arguments.length)return this._clientId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClientRoles=function(){if(0==arguments.length)return this._clientRoles;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClientTag=function(){if(0==arguments.length)return this._clientTag;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getConnections=function(){if(0==arguments.length)return this._connections;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDeviceAlias=function(){if(0==arguments.length)return this._deviceAlias;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDeviceId=function(){if(0==arguments.length)return this._deviceId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getEquivalentRemoteClientInfo=function(e){if(1==arguments.length){for(var i=0,o=this.getRemoteClientInfos();i0?(t.liveswitch.Client.fm_liveswitch_Client___log.warn(t.liveswitch.StringExtensions.format("Client {0} is delaying joining channel {1} by {2} ms. Unsuccessful attempts to join on this channel occurred recently.",this.getId(),o.getChannelId(),t.liveswitch.NumberExtensions.toString(i))),this.delayJoin(o,i)):this.doJoin(o.getPromise(),o.getChannelId(),o.getToken(),o.getTimestamp())}},o.prototype.tryRegister=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=0,o=t.liveswitch.Global.tryCast(e,t.liveswitch.ClientRegistrationInfo);t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.Unregistering)?o.getPromise().reject(new t.liveswitch.Exception("Client is currently unregistering.")):t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.Unregistered)?o.getPromise().reject(new t.liveswitch.Exception("Client is unregistered.")):(i=this.__registrationRateLimiter.checkDelay(t.liveswitch.ManagedStopwatch.getTimestamp()),i>0?(t.liveswitch.Client.fm_liveswitch_Client___log.warn(t.liveswitch.StringExtensions.format("Client {0} is delaying registering by {1} ms. Unsuccessful attempts to register occurred recently.",this.getId(),t.liveswitch.NumberExtensions.toString(i))),this.__registrationBackoffTimer=new t.liveswitch.TimeoutTimer(this.tryRegister.bind(this),e),this.delayRegistration(i)):this.doRegister(o.getPromise(),o.getToken(),o.getTimestamp()))},o.prototype.unregister=function(){if(0==arguments.length){var e=new t.liveswitch.Promise;return this.doUnregister(e,t.liveswitch.ManagedStopwatch.getTimestamp()),e}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.update=function(e){if(1==arguments.length){var i=new t.liveswitch.Promise;try{this.doUpdate(e,i)}catch(o){i.reject(o)}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.validateJoinToken=function(e,i,o){if(3==arguments.length){var n=t.liveswitch.Token.parse(e);return t.liveswitch.Global.equals(n,null)?(i.setValue(null),o.setValue("Could not parse token."),!1):(i.setValue(n.getChannelClaim()),t.liveswitch.Global.equals(i.getValue(),null)?(o.setValue("Token is missing channel claim."),!1):t.liveswitch.StringExtensions.isNullOrEmpty(i.getValue().getId())?(o.setValue("Token channel claim is missing ID."),!1):(o.setValue(null),!0))}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.verifyChannelJoin=function(e){if(1==arguments.length){var i=e.getPromise(),o=e.getChannelId();if(t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.Registering))return i.reject(new t.liveswitch.Exception("Client is registering.")),!1;if(t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.Unregistering))return i.reject(new t.liveswitch.Exception("Client is unregistering.")),!1;if(t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.New)||t.liveswitch.Global.equals(this.getState(),t.liveswitch.ClientState.Unregistered))return i.reject(new t.liveswitch.Exception("Client is not registered.")),!1;if(this.__channels.containsKey(o)){var n=null,s=new t.liveswitch.Holder(n),r=this.__channels.tryGetValue(o,s);if(n=s.getValue(),r)return i.resolve(n),!1}return!t.liveswitch.ArrayExtensions.contains(this.__leaving,o)||(i.reject(new t.liveswitch.Exception("Client is currently leaving.")),!1)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.fmliveswitchClientInitialize=function(){t.liveswitch.Client.__fmliveswitchClientInitialized||t.liveswitch.Client.__fmliveswitchClientInitializing||(t.liveswitch.Client.__fmliveswitchClientInitializing=!0,t.liveswitch.Client.fm_liveswitch_Client___log=t.liveswitch.Log.getLogger(new t.liveswitch.Type("[fm.liveswitch.Client]")),t.liveswitch.Client.__fmliveswitchClientInitialized=!0,t.liveswitch.Client.__fmliveswitchClientInitializing=!1)},o.__fmliveswitchClientInitialized=!1,o.__fmliveswitchClientInitializing=!1,o}(t.liveswitch.Dynamic);i.Client=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t,i,o){for(var n=new Array(arguments.length),s=0;si)return!0}return this.__lastMessageTimestamps[t]=i,!1}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t}();t.LateDiscardContext=i})(e.liveswitch||(e.liveswitch={}))}(fm||(fm={})),function(t){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0){var n=this._onAutomaticIceServers;t.liveswitch.Global.equals(n,null)||n(this,o),t.liveswitch.ArrayExtensions.addRange(i,o.getValues())}var s=this.getIceServers();t.liveswitch.Global.equals(s,null)||t.liveswitch.ArrayExtensions.addRange(i,s),this.setIceServers(t.liveswitch.ArrayExtensions.toArray(i))},o.prototype.processKeyFrameRequest=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=t.liveswitch.JsonSerializer.deserializeLongArray(e.getPayload());if(t.liveswitch.Global.equals(i,null))t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.warn(this.getId(),"Received a malformed 'keyFrameRequest' message.");else if(t.liveswitch.Global.equals(i.length,0))t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.warn(this.getId(),"Received a 'keyFrameRequest' message with no sychronization sources.");else{var o=this.getVideoStream();t.liveswitch.Global.equals(o,null)||o.raiseKeyFrameRequest(i)}},o.prototype.processLocalError=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.setRemoteClosed(!1),this.getInternalConnection().setError(e),this.getInternalConnection().close()},o.prototype.processMediaIntentResponse=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=new Array,o=new t.liveswitch.IceServerCollection;if(!t.liveswitch.Global.equals(e.getIceServers(),null)&&(o.addMany(t.liveswitch.IceServer.fromJsonArray(e.getIceServers())),o.getCount()>0)){var n=this._onAutomaticIceServers;t.liveswitch.Global.equals(n,null)||n(this,o),t.liveswitch.ArrayExtensions.addRange(i,o.getValues())}var s=this.getIceServers();t.liveswitch.Global.equals(s,null)||t.liveswitch.ArrayExtensions.addRange(i,s),this.setIceServers(t.liveswitch.ArrayExtensions.toArray(i)),this.restrictVideo(e),e.getNoHostCandidates()&&(t.liveswitch.Global.equals(this.getType(),t.liveswitch.ConnectionType.getSfu())||t.liveswitch.Global.equals(this.getType(),t.liveswitch.ConnectionType.getMcu()))&&t.liveswitch.Global.equals(this.getIceGatherPolicy(),t.liveswitch.IceGatherPolicy.All)&&(this.__iceGatherPolicySet?t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.info("Media server restriction on the use of local host ICE candidates was overwritten by the local client configuration."):(t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.info("Media server restricted the use of local host ICE candidates. Only server reflexive, peer reflexive and relay candidates will be used."),this.getInternalConnection().setIceGatherPolicy(t.liveswitch.IceGatherPolicy.NoHost))),!t.liveswitch.Global.equals(e.getMediaIntents(),null)&&e.getMediaIntents().length>0&&t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.debug(t.liveswitch.StringExtensions.concat("Gateway accepted MediaIntent: ",e.getMediaIntents()[0]))},o.prototype.processMessage=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__messageQueue.enqueue(e)},o.prototype.processMute=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=t.liveswitch.MutedConfig.fromJson(e.getPayload());t.liveswitch.Global.equals(i,null)?t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.error("Received a malformed 'mute' message."):this.doProcessMute(i)},o.prototype.processNotifyUpstreamUpdate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=t.liveswitch.ConnectionInfo.fromJson(e.getPayload());if(!t.liveswitch.Global.equals(i.getRecording(),this.getRecordingEnabled())){var o=void 0;t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.info(t.liveswitch.StringExtensions.format("Server has {0} recording connection {1}.",i.getRecording()?"started":"stopped",this.getId())),this.setRecordingEnabled(i.getRecording()),this.getRecordingEnabled()?(o=this._onRecordingEnabled,t.liveswitch.Global.equals(o,null)||o(i.getRecordingTag())):(o=this._onRecordingDisabled,t.liveswitch.Global.equals(o,null)||o(i.getRecordingTag()))}},o.prototype.processOnDiscardBitrateNotification=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(!t.liveswitch.Global.equals(e,null)){var i=t.liveswitch.Message.createBitrateNotificationMessage(e);i.setTimestamp(t.liveswitch.UnixTimestamp.dateTimeToUnix(t.liveswitch.DateTime.getUtcNow())),this.trySendRtcpDataChannel(i)||this.send(i)}},o.prototype.processOnDiscardBitrateRequest=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(!t.liveswitch.Global.equals(e,null)){var i=t.liveswitch.Message.createBitrateRequestMessage(e);i.setTimestamp(t.liveswitch.UnixTimestamp.dateTimeToUnix(t.liveswitch.DateTime.getUtcNow())),this.trySendRtcpDataChannel(i)||this.send(i)}},o.prototype.processOnDiscardKeyFrameRequest=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");!t.liveswitch.Global.equals(e,null)&&e.length>0&&this.send(t.liveswitch.Message.createKeyFrameRequestMessage(e))},o.prototype.processOnDiscardOutboundDtmfTones=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.send(t.liveswitch.Message.createDtmfTonesMessage(e))},o.prototype.processQueuedMessage=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getAnswer())?this.processAnswer(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getCandidate())?this.processCandidate(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getKeyFrameRequest())?this.processKeyFrameRequest(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getBitrateRequest())?this.processBitrateRequest(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getBitrateNotification())?this.processBitrateNotification(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getClose())?this.processClose():t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getFail())?this.processFail(new t.liveswitch.Error(t.liveswitch.ErrorCode.ConnectionRemoteFailure,new t.liveswitch.Exception("Media server is no longer available."))):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getReject())?this.processReject(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getError())?this.processError(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getMute())?this.processMute(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getNotifyUpstreamUpdate())?this.processNotifyUpstreamUpdate(e):t.liveswitch.Global.equals(e.getType(),t.liveswitch.MessageType.getRtcpDataChannelSignallingActivation())?this.processRtcpDataChannelSignallingActivation(e):this.doProcessMessage(e)},o.prototype.processReject=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.isError(t.liveswitch.ErrorType.getServerUpstreamCountExceeded())&&t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.fatal("Number of upstream connections has exceeded the configured maximum for this channel. Close other upstream connections or increase the number of the upstream connections configured on the server."),this.setRemoteRejected(!0),this.getInternalConnection().close()},o.prototype.processRemoteError=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.setRemoteClosed(!0),this.getInternalConnection().setError(e),this.getInternalConnection().close()},o.prototype.processRtcpDataChannelSignallingActivation=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.processStateChangeEvent=function(e){var i=this;if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if((t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Closing)||t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Closed)||t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Failing)||t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Failed))&&(this.tryCancelStatsEvent(),this.tryCancelStatsReport()))try{this.sendConnectionEvent(t.liveswitch.EventType.getConnectionStats())}catch(o){t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.debug(this.getId(),"Could not send final connection stats event.",o)}(t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Closed)||t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Failed))&&this.detachInternalEventHandlers(),this.sendConnectionEvent(t.liveswitch.EventType.fromConnectionState(e)).then((function(o){t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Connected)&&(i.scheduleStatsEvent(),i.scheduleStatsReport())}),(function(o){t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.warn(i.getId(),t.liveswitch.StringExtensions.format("Could not send {0} event.",t.liveswitch.EventType.fromConnectionState(e)),o),t.liveswitch.Global.equals(e,t.liveswitch.ConnectionState.Connected)&&(i.scheduleStatsEvent(),i.scheduleStatsReport())}))},o.prototype.raiseAudioBitrateNotification=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.raiseBitrateNotification(i)},o.prototype.raiseAudioBitrateRequest=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.raiseBitrateRequest(i)},o.prototype.raiseLocalCandidate=function(e){var i=this;if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=this._onLocalCandidate;t.liveswitch.Global.equals(o,null)||o(this,e),this.send(this.createCandidateMessage(e)).fail((function(e){t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.error(i.getId(),"Could not send candidate message.",e)}))},o.prototype.raiseNoMediaServersAvailable=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=this._onNoMediaServersAvailable;t.liveswitch.Global.equals(i,null)||i(this,e)},o.prototype.raiseRemoteCandidate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=this._onRemoteCandidate;t.liveswitch.Global.equals(i,null)||i(this,e)},o.prototype.raiseRemoteUpdate=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=this._onRemoteUpdate;t.liveswitch.Global.equals(o,null)||o(e,i)},o.prototype.raiseStatsEvent=function(e){var i=this;if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=null,n=null;this.__statsEventCancelled||(t.liveswitch.Global.equals(o,null)&&(o=function(e){var o=i._onStats;t.liveswitch.Global.equals(o,null)||o(e),i.setMediaQuality(e.getMediaQuality());var n=i._onMediaQuality;t.liveswitch.Global.equals(n,null)||n(i.getMediaQuality()),i.setNetworkQuality(e.getNetworkQuality());var s=i._onNetworkQuality;t.liveswitch.Global.equals(s,null)||s(i.getNetworkQuality()),i.scheduleStatsEvent()}),t.liveswitch.Global.equals(n,null)&&(n=function(e){t.liveswitch.ManagedConnection.fm_liveswitch_ManagedConnection___log.warn(i.getId(),"Could not raise stats.",e),i.scheduleStatsEvent()}),this.getInternalConnection().getStats().then(o,n))},o.prototype.raiseVideoBitrateNotification=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.raiseBitrateNotification(i)},o.prototype.raiseVideoBitrateRequest=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e.raiseBitrateRequest(i)},o.prototype.removeOnAudioUnmuteDisabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onAudioUnmuteDisabled,e)},o.prototype.removeOnAudioUnmuteEnabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onAudioUnmuteEnabled,e)},o.prototype.removeOnAutomaticIceServers=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onAutomaticIceServers,e)},o.prototype.removeOnGatheringStateChange=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onGatheringStateChange,e)},o.prototype.removeOnIceConnectionStateChange=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onIceConnectionStateChange,e)},o.prototype.removeOnLocalCandidate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onLocalCandidate,e)},o.prototype.removeOnLocalDescription=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onLocalDescription,e)},o.prototype.removeOnMediaQuality=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onMediaQuality,e)},o.prototype.removeOnNetworkQuality=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onNetworkQuality,e)},o.prototype.removeOnNoMediaServersAvailable=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onNoMediaServersAvailable,e)},o.prototype.removeOnRecordingDisabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRecordingDisabled,e)},o.prototype.removeOnRecordingEnabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRecordingEnabled,e)},o.prototype.removeOnRemoteAudioEncodingSwitch=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRemoteAudioEncodingSwitch,e)},o.prototype.removeOnRemoteCandidate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRemoteCandidate,e)},o.prototype.removeOnRemoteDescription=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRemoteDescription,e)},o.prototype.removeOnRemoteUpdate=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRemoteUpdate,e)},o.prototype.removeOnRemoteVideoEncodingSwitch=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRemoteVideoEncodingSwitch,e)},o.prototype.removeOnSignallingStateChange=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onSignallingStateChange,e)},o.prototype.removeOnStateChange=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onStateChange,e)},o.prototype.removeOnStats=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onStats,e)},o.prototype.removeOnVideoUnmuteDisabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onVideoUnmuteDisabled,e)},o.prototype.removeOnVideoUnmuteEnabled=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onVideoUnmuteEnabled,e)},o.prototype.restrictVideo=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=this.getVideoStream();if(!t.liveswitch.Global.equals(i,null)){for(var o=e.getMediaIntents(),n=0,s=o;n0&&(s=r[0])}return e.liveswitch.LayoutUtility.floatLocalPreview(n,s,i,o)}if(4==arguments.length&&(e.liveswitch.Util.isNullOrUndefined(arguments[0])||e.liveswitch.Util.isObjectType(arguments[0],"[fm.liveswitch.Layout]"))&&(e.liveswitch.Util.isNullOrUndefined(arguments[1])||e.liveswitch.Util.isObjectType(arguments[1],"[fm.liveswitch.VideoLayout]"))&&(e.liveswitch.Util.isNullOrUndefined(arguments[2])||e.liveswitch.Util.isString(arguments[2]))){t=arguments[0],i=arguments[1],o=arguments[2];var a=arguments[3];n=null,s=null;if(!e.liveswitch.Global.equals(t,null)){n=t.getLocalFrame();r=t.getRemoteFrames();if(!e.liveswitch.Global.equals(r,null)&&r.length>0)for(var l=0,c=r;l_?(E=y*_,C=(m-E)/2):(M=m/_,I=(y-M)/2);for(var A=i.getFrames(),T=0,R=e.liveswitch.HashExtensions.getKeys(A);T=this.__lastUpdateTimestamp){this.__lastUpdateTimestamp=e.getTimestamp();var o=t.liveswitch.ConnectionConfig.fromJson(e.getPayload()),n=i.prototype.getRemoteAudioEncoding.call(this),s=o.getRemoteAudioEncoding();t.liveswitch.Global.equals(s,null)||t.liveswitch.Global.equals(n,s)||!t.liveswitch.Global.equals(n,null)&&n.isEquivalent(s)||i.prototype.setRemoteAudioEncoding.call(this,s);var r=i.prototype.getRemoteVideoEncoding.call(this),a=o.getRemoteVideoEncoding();t.liveswitch.Global.equals(a,null)||t.liveswitch.Global.equals(r,a)||!t.liveswitch.Global.equals(r,null)&&r.isEquivalent(a)||i.prototype.setRemoteVideoEncoding.call(this,a)}},o.prototype.raiseAudioBitrateNotification=function(e,o){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");i.prototype.raiseAudioBitrateNotification.call(this,e,o);var n=this.getInboundAudioBitrate(),s=o.getBitrate();t.liveswitch.Global.equals(n,s)||this.setInboundAudioBitrate(s)},o.prototype.raiseVideoBitrateNotification=function(e,o){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");i.prototype.raiseVideoBitrateNotification.call(this,e,o);var n=this.getInboundVideoBitrate(),s=o.getBitrate();t.liveswitch.Global.equals(n,s)||this.setInboundVideoBitrate(s)},o.prototype.releaseLocalCandidates=function(){if(0!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this.__holdLocalCandidates=!1;for(var e=0,o=this.__heldLocalCandidates;e=this.__lastUpdateTimestamp){this.__lastUpdateTimestamp=e.getTimestamp();var n=t.liveswitch.ConnectionConfig.fromJson(e.getPayload()),s=t.liveswitch.StreamDirection.SendReceive;s=t.liveswitch.StreamDirectionHelper.setReceiveDisabled(t.liveswitch.StreamDirectionHelper.setSendDisabled(s,i.prototype.getRemoteAudioDisabled.call(this)),i.prototype.getLocalAudioDisabled.call(this));var r=t.liveswitch.StreamDirection.SendReceive;r=t.liveswitch.StreamDirectionHelper.setReceiveDisabled(t.liveswitch.StreamDirectionHelper.setSendDisabled(r,i.prototype.getRemoteAudioDisabled.call(this)),i.prototype.getLocalAudioDisabled.call(this));var a=t.liveswitch.StreamDirection.SendReceive;a=t.liveswitch.StreamDirectionHelper.setReceiveDisabled(t.liveswitch.StreamDirectionHelper.setSendDisabled(a,i.prototype.getRemoteDataDisabled.call(this)),i.prototype.getLocalDataDisabled.call(this));var l=null,c=new t.liveswitch.ConnectionInfo(this.getRemoteClientInfo().getUserId(),this.getRemoteClientInfo().getUserAlias(),this.getRemoteClientInfo().getDeviceId(),this.getRemoteClientInfo().getDeviceAlias(),this.getRemoteClientInfo().getId(),this.getRemoteClientInfo().getTag(),this.getRemoteClientInfo().getRoles(),this.getRemoteClientInfo().getProtocol(),i.prototype.getRemoteConnectionId.call(this),i.prototype.getRemoteTag.call(this),i.prototype.getType.call(this),i.prototype.getRemoteMediaId.call(this),i.prototype.getRemoteAudioMuted.call(this),i.prototype.getRemoteVideoMuted.call(this),t.liveswitch.StreamDirectionHelper.directionToString(s),t.liveswitch.StreamDirectionHelper.directionToString(r),t.liveswitch.StreamDirectionHelper.directionToString(a),i.prototype.getRemoteAudioFormats.call(this),i.prototype.getRemoteVideoFormats.call(this),null,l);i.prototype.setRemoteTag.call(this,n.getTag());var h=new t.liveswitch.ConnectionInfo(this.getRemoteClientInfo().getUserId(),this.getRemoteClientInfo().getUserAlias(),this.getRemoteClientInfo().getDeviceId(),this.getRemoteClientInfo().getDeviceAlias(),this.getRemoteClientInfo().getId(),this.getRemoteClientInfo().getTag(),this.getRemoteClientInfo().getRoles(),this.getRemoteClientInfo().getProtocol(),i.prototype.getRemoteConnectionId.call(this),i.prototype.getRemoteTag.call(this),i.prototype.getType.call(this),i.prototype.getRemoteMediaId.call(this),n.getLocalAudioMuted(),n.getLocalVideoMuted(),n.getAudioDirection(),n.getVideoDirection(),n.getDataDirection(),i.prototype.getRemoteAudioFormats.call(this),i.prototype.getRemoteVideoFormats.call(this),null,null);i.prototype.updateConnection.call(this,c,h).fail((function(e){t.liveswitch.PeerConnection.fm_liveswitch_PeerConnection___log.error(t.liveswitch.StringExtensions.format("Could not update peer connection {0}.",i.prototype.getId.call(o)),e)}))}},o.prototype.send=function(e){if(1==arguments.length)return e.setRemoteConnectionId(i.prototype.getRemoteConnectionId.call(this)),i.prototype.send.call(this,e);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.sendErrorToPeer=function(e){var o=this;if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var n=null,s=null,r=null,a=i.prototype.getInternalConnection.call(this).getError();!t.liveswitch.Global.equals(a,null)&&t.liveswitch.Global.equals(a.getCode(),t.liveswitch.ErrorCode.ConnectionInvalidArchitecture)?(t.liveswitch.Global.equals(n,null)&&(n=function(e){t.liveswitch.PeerConnection.fm_liveswitch_PeerConnection___log.error(i.prototype.getId.call(o),"Could not send error message.",e)}),this.send(t.liveswitch.Message.createErrorMessage(t.liveswitch.ErrorType.getSdpStreamMismatch(),this.getRemoteClientInfo().getUserId(),this.getRemoteClientInfo().getDeviceId(),this.getRemoteClientInfo().getId())).fail(n)):!t.liveswitch.Global.equals(a,null)&&t.liveswitch.Global.equals(a.getCode(),t.liveswitch.ErrorCode.ConnectionSimulcastNotSupported)?(t.liveswitch.Global.equals(s,null)&&(s=function(e){t.liveswitch.PeerConnection.fm_liveswitch_PeerConnection___log.error(i.prototype.getId.call(o),"Could not send error message.",e)}),this.send(t.liveswitch.Message.createErrorMessage(t.liveswitch.ErrorType.getSdpSimulcastMismatch(),this.getRemoteClientInfo().getUserId(),this.getRemoteClientInfo().getDeviceId(),this.getRemoteClientInfo().getId())).fail(s)):(t.liveswitch.Global.equals(r,null)&&(r=function(e){t.liveswitch.PeerConnection.fm_liveswitch_PeerConnection___log.error(i.prototype.getId.call(o),"Could not send error message.",e)}),this.send(t.liveswitch.Message.createErrorMessage(t.liveswitch.ErrorType.getSdpCodecMismatch(),this.getRemoteClientInfo().getUserId(),this.getRemoteClientInfo().getDeviceId(),this.getRemoteClientInfo().getId())).fail(r))},o.prototype.setRemoteClientInfo=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._remoteClientInfo=e},o.prototype.setRole=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._role=e},o.fmliveswitchPeerConnectionInitialize=function(){t.liveswitch.PeerConnection.__fmliveswitchPeerConnectionInitialized||t.liveswitch.PeerConnection.__fmliveswitchPeerConnectionInitializing||(t.liveswitch.PeerConnection.__fmliveswitchPeerConnectionInitializing=!0,t.liveswitch.PeerConnection.fm_liveswitch_PeerConnection___log=t.liveswitch.Log.getLogger(new t.liveswitch.Type("[fm.liveswitch.PeerConnection]")),t.liveswitch.PeerConnection.__fmliveswitchPeerConnectionInitialized=!0,t.liveswitch.PeerConnection.__fmliveswitchPeerConnectionInitializing=!1)},o.__fmliveswitchPeerConnectionInitialized=!1,o.__fmliveswitchPeerConnectionInitializing=!1,o}(t.liveswitch.ManagedConnection);i.PeerConnection=o})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(e){(function(t){var i=function(){function t(t,i,o,n,s){for(var r=new Array(arguments.length),a=0;a0&&o+l>e.liveswitch.SendQueue.getSendQueueBatchSizeInCharacters())return e.liveswitch.ArrayExtensions.toArray(t);e.liveswitch.ArrayExtensions.add(t,r),e.liveswitch.ArrayExtensions.removeAt(i,0),o+=l}}return e.liveswitch.ArrayExtensions.toArray(t)}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.clear=function(){if(0!=arguments.length)throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var t=new Array;e.liveswitch.ArrayExtensions.addRange(t,this.__sending),e.liveswitch.ArrayExtensions.addRange(t,this.__pending),e.liveswitch.ArrayExtensions.clear(this.__sending),e.liveswitch.ArrayExtensions.clear(this.__pending);for(var i=0,o=t;i0){e.liveswitch.ArrayExtensions.removeAt(this.__sending,0);for(var t=0,i=this.__sending;t0&&(e.liveswitch.ArrayExtensions.removeAt(this.__sending,0),e.liveswitch.SendQueue.fm_liveswitch_SendQueue___log.debug("A recoverable exception was encountered while sending a message. Will attempt to resend after reconnection.",t.getException()),e.liveswitch.ArrayExtensions.insert(this.__pending,t.getResendIndex(),t))},t.prototype.send=function(t){if(1==arguments.length){var i=new e.liveswitch.SendItem;i.setRequest(t),i.setPromise(new e.liveswitch.Promise),i.setSendBackoff(100);var o=i;return e.liveswitch.ArrayExtensions.add(this.__pending,o),this.trySendPending(),o.getPromise()}throw new e.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},t.prototype.trySendPending=function(){if(0==arguments.length){var t,i=void 0;if(!this.__sendQueueTransport.getIsConnected())return!1;if(e.liveswitch.ArrayExtensions.getCount(this.__sending)>0||e.liveswitch.Global.equals(e.liveswitch.ArrayExtensions.getCount(this.__pending),0))return!1;i=e.liveswitch.SendQueue.takePending(this.__sending,this.__pending),e.liveswitch.SendQueue.fm_liveswitch_SendQueue___log.getIsVerboseEnabled()&&(t=i.length,e.liveswitch.SendQueue.fm_liveswitch_SendQueue___log.verbose(e.liveswitch.StringExtensions.format("Starting flush of send queue with {0} items.",e.liveswitch.NumberExtensions.toString(t)))),this.__sendQueueTransport.startBatch();for(var o=0;on?r[n]:null;this.getAudioStreams()[n].populateInfos(s[n],a),this.scrubTransport(s[n].getTransport(),t.liveswitch.Global.equals(a,null)?null:a.getTransport()),t.liveswitch.Global.equals(o,t.liveswitch.EventType.getConnectionStats())&&(this.getAudioStreams()[n].setId(null),this.getAudioStreams()[n].setSendDisabled(!1),this.getAudioStreams()[n].setReceiveDisabled(!1),this.getAudioStreams()[n].setSendFormats(null),this.getAudioStreams()[n].setReceiveFormats(null),this.getAudioStreams()[n].setSendEncodings(null),this.getAudioStreams()[n].setReceiveEncodings(null))}}}if(!t.liveswitch.Global.equals(this.getVideoStreams(),null)){var l=e.getVideoStreams();if(!t.liveswitch.Global.equals(l,null)){var c=t.liveswitch.Global.equals(i,null)?null:i.getVideoStreams();for(n=0;nn?c[n]:null;this.getVideoStreams()[n].populateInfos(l[n],h),this.scrubTransport(l[n].getTransport(),t.liveswitch.Global.equals(h,null)?null:h.getTransport()),t.liveswitch.Global.equals(o,t.liveswitch.EventType.getConnectionStats())&&(this.getVideoStreams()[n].setId(null),this.getVideoStreams()[n].setSendDisabled(!1),this.getVideoStreams()[n].setReceiveDisabled(!1),this.getVideoStreams()[n].setSendFormats(null),this.getVideoStreams()[n].setReceiveFormats(null),this.getVideoStreams()[n].setSendEncodings(null),this.getVideoStreams()[n].setReceiveEncodings(null))}}}if(!t.liveswitch.Global.equals(this.getDataStream(),null)){var p=e.getDataStream();if(!t.liveswitch.Global.equals(p,null)){var d=t.liveswitch.Global.equals(i,null)?null:i.getDataStream();this.getDataStream().populateInfos(p,d,o),this.scrubTransport(p.getTransport(),t.liveswitch.Global.equals(d,null)?null:d.getTransport()),t.liveswitch.Global.equals(o,t.liveswitch.EventType.getConnectionStats())&&this.getDataStream().setId(null)}}}},o.prototype.scrubTransport=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");for(var o=0;ot.liveswitch.MathAssistant.pow(10,-1*o))&&(this.__json=null),i;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.updateNullableInt=function(e,i){if(2==arguments.length)return null==e&&null==i||(null==e&&null!=i||null!=e&&null==i?this.__json=null:t.liveswitch.Global.equals(e,i)||(this.__json=null)),i;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.updateObject=function(e,i){if(2==arguments.length)return t.liveswitch.Global.equals(e,i)||(this.__json=null),i;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.updateString=function(e,i){if(2==arguments.length)return t.liveswitch.Global.equals(e,i)||(this.__json=null),i;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.updateStringArray=function(e,i){if(2==arguments.length){if(t.liveswitch.Global.equals(e,null)||t.liveswitch.Global.equals(i,null))this.__json=null;else if(t.liveswitch.Global.equals(e.length,i.length)){for(var o=0;o {0}",o))}},o.prototype.raiseUnhandledException=function(e){if(1==arguments.length){var i=this._onUnhandledException;if(!t.liveswitch.Global.equals(i,null)){var o=new t.liveswitch.UnhandledExceptionArgs(e);try{i(o)}catch(n){t.liveswitch.Unhandled.logException(n,"BaseClient -> OnUnhandledException")}return o.getHandled()}return!1}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.removeOnCreateHeaders=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onCreateHeaders,e)},o.prototype.removeOnHttpRequestCreated=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onHttpRequestCreated,e)},o.prototype.removeOnHttpResponseReceived=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onHttpResponseReceived,e)},o.prototype.removeOnRequestCreated=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onRequestCreated,e)},o.prototype.removeOnResponseReceived=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onResponseReceived,e)},o.prototype.removeOnUnhandledException=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.ArrayExtensions.remove(this.__onUnhandledException,e)},o.prototype.setAutoDisconnect=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._autoDisconnect=e},o.prototype.setAutoDisconnectArgs=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._autoDisconnectArgs=e},o.prototype.setConcurrencyMode=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._concurrencyMode=e},o.prototype.setDisableBinary=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._disableBinary=e},o.prototype.setDomainKey=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._domainKey=e},o.prototype.setDomainName=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.Global.equals(e,null)&&(e=t.liveswitch.signalling.Defaults.getDomainName()),this.__domainName=t.liveswitch.signalling.ClientBase.sanitizeDomainName(e)},o.prototype.setRequestMaxRetries=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._requestMaxRetries=t.liveswitch.Global.toInt(e)},o.prototype.setRequestTimeout=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");e=t.liveswitch.Global.toInt(arguments[0]),this._requestTimeout=t.liveswitch.Global.toInt(e)},o.prototype.setRequestUrl=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(t.liveswitch.Global.equals(e,null))throw new t.liveswitch.Exception("Request URL cannot be null.");this.__requestUrl=t.liveswitch.HttpTransfer.replaceWildcards(e)},o.fmliveswitchsignallingClientBaseInitialize=function(){t.liveswitch.signalling.ClientBase.__fmliveswitchsignallingClientBaseInitialized||t.liveswitch.signalling.ClientBase.__fmliveswitchsignallingClientBaseInitializing||(t.liveswitch.signalling.ClientBase.__fmliveswitchsignallingClientBaseInitializing=!0,t.liveswitch.signalling.ClientBase.fm_liveswitch_signalling_ClientBase__headers=null,t.liveswitch.signalling.ClientBase.__fmliveswitchsignallingClientBaseInitialized=!0,t.liveswitch.signalling.ClientBase.__fmliveswitchsignallingClientBaseInitializing=!1)},o.__fmliveswitchsignallingClientBaseInitialized=!1,o.__fmliveswitchsignallingClientBaseInitializing=!1,o}(t.liveswitch.HttpWebRequestSender);i.ClientBase=o})(i.signalling||(i.signalling={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){var o=function(i){function o(){var e=this;t.liveswitch.signalling.Client.fmliveswitchsignallingClientInitialize();for(var o=new Array(arguments.length),n=0;n0&&e-this.__lastDisconnectedTimestamp>=5e3){var i=5e3;return t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.warn(t.liveswitch.StringExtensions.format("Signalling client has not been able to reach server for at least {0} ms.",t.liveswitch.NumberExtensions.toString(i))),this.setState(t.liveswitch.signalling.ClientState.Disconnected),!1}return!0}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.checkSynchronous=function(e){if(1==arguments.length)return null!=e?e:null!=this.getSynchronous()&&this.getSynchronous();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.clearSubscribedChannels=function(){if(0!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.HashExtensions.clear(this._subscribedChannels)},o.prototype.connect=function(){if(0==arguments.length)return this.connect(new t.liveswitch.signalling.ConnectArgs);if(1==arguments.length){var e=arguments[0];if(t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Connected)||t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Connecting)){var i=t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Connecting)?"Client is already connecting.":"Client is already connected.",o=this.createFailureResponse(e,i);return this.raiseConnectFailure(e,o),this}return this.setDisconnectException(null),this.setState(t.liveswitch.signalling.ClientState.Connecting),this.doConnect(e,0)}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.createFailureResponse=function(e,i){if(2==arguments.length){var o=new t.liveswitch.signalling.ClientResponse;o.setDynamicProperties(e.getDynamicProperties());var n=new t.liveswitch.signalling.Message(t.liveswitch.signalling.MetaChannels.getHandshake());return n.setExtensions(e.getExtensions()),n.setTimestamp(t.liveswitch.DateTime.getUtcNow()),n.setSuccessful(!1),n.setError(i),o.setMessage(n),o.setFailureSource(t.liveswitch.signalling.FailureSource.Message),o.setException(new t.liveswitch.Exception(i)),o}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.disconnect=function(){var e=this;if(0==arguments.length)return this.disconnect(new t.liveswitch.signalling.DisconnectArgs);if(1==arguments.length){var i=arguments[0],o=null;if(t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Disconnecting)||t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Disconnected)){var n=t.liveswitch.Global.equals(this.getState(),t.liveswitch.signalling.ClientState.Disconnecting)?"Client is already disconnecting.":"Client is already disconnected.",s=new t.liveswitch.signalling.ClientResponse;s.setDynamicProperties(i.getDynamicProperties());var r=new t.liveswitch.signalling.Message(t.liveswitch.signalling.MetaChannels.getHandshake());r.setExtensions(i.getExtensions()),r.setTimestamp(t.liveswitch.DateTime.getUtcNow()),r.setSuccessful(!1),r.setError(n),s.setMessage(r),s.setFailureSource(t.liveswitch.signalling.FailureSource.Message),s.setException(new t.liveswitch.Exception(n));var a=s;return this.raiseDisconnectComplete(i,a),this}this.setState(t.liveswitch.signalling.ClientState.Disconnecting);var l=new t.liveswitch.signalling.ClientRequest,c=new t.liveswitch.signalling.Message(t.liveswitch.signalling.MetaChannels.getDisconnect());return c.setExtensions(i.getExtensions()),l.setMessage(c),t.liveswitch.Global.equals(o,null)&&(o=function(o){var n=e.__restreamBackoffTimer;t.liveswitch.Global.equals(n,null)||n.stop(),e.__webSocketOpened=!1,e.setDisconnectException(null),e.setState(t.liveswitch.signalling.ClientState.Disconnected),e.raiseDisconnectComplete(i,o)}),l.setCallback(o),this.addToQueue(l,i.getRequestUrl(),this.checkSynchronous(i.getSynchronous()),null!=i.getRequestTimeout()?i.getRequestTimeout():0,null!=i.getRequestMaxRetries()?i.getRequestMaxRetries():0),this.processQueue(!1),this}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.doConnect=function(e,i){var o=this;if(2==arguments.length){i=t.liveswitch.Global.toInt(arguments[1]);var n=null;if(i>10){var s="Too many redirects.",r=this.createFailureResponse(e,s);return this.raiseConnectFailure(e,r),this}var a=new Array;this.getDisableWebSockets()||t.liveswitch.ArrayExtensions.add(a,t.liveswitch.signalling.ConnectionType.WebSocket),t.liveswitch.ArrayExtensions.add(a,t.liveswitch.signalling.ConnectionType.LongPolling),this._supportedConnectionTypes=t.liveswitch.ArrayExtensions.toArray(a);var l=new t.liveswitch.signalling.ClientRequest,c=new t.liveswitch.signalling.Message(t.liveswitch.signalling.MetaChannels.getHandshake());return c.setClientId(this.getClientId()),c.setStreamId(this.getStreamId()),c.setAuthToken(this.getAuthToken()),c.setUserId(this._userId),c.setDeviceId(this._deviceId),c.setVersion(t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client__bayeuxVersion),c.setMinimumVersion(t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client__bayeuxMinimumVersion),c.setSupportedConnectionTypes(this._supportedConnectionTypes),c.setExtensions(e.getExtensions()),l.setMessage(c),t.liveswitch.Global.equals(n,null)&&(n=function(n){if(t.liveswitch.Global.equals(n.getException(),null)){o.setClientId(n.getMessage().getClientId()),o.setStreamId(n.getMessage().getStreamId()),o.setAuthToken(n.getMessage().getAuthToken());var s=n.getMessage().getServerTimeout();null!=s?o.setServerTimeout(s):o.setServerTimeout(25e3);for(var r=2147483647,a=0,l=n.getMessage().getSupportedConnectionTypes();ao._supportedConnectionTypes.length?(n.setFailureSource(t.liveswitch.signalling.FailureSource.Message),n.setException(new t.liveswitch.Exception("Could not negotiate a connection type with the server."))):o._connectionType=o._supportedConnectionTypes[r]}var p=!1;t.liveswitch.Global.equals(n.getRedirectUrl(),null)||(p=!0,o.setRequestUrl(n.getRedirectUrl())),t.liveswitch.Global.equals(n.getStreamRedirectUrl(),null)||(p=!0,o.setStreamRequestUrl(n.getStreamRedirectUrl())),p?(t.liveswitch.Global.equals(o.getRequestUrl(),o.getStreamRequestUrl())?t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.debug(t.liveswitch.StringExtensions.format("Client has been redirected to {0}.",o.getRequestUrl())):t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.debug(t.liveswitch.StringExtensions.format("Client has been redirected to {0} ({1})).",o.getRequestUrl(),o.getStreamRequestUrl())),o.doConnect(e,i+1)):t.liveswitch.Global.equals(n.getException(),null)?(o.processQueue(!0),o.__receivedMessages=!1,t.liveswitch.Global.equals(o._connectionType,t.liveswitch.signalling.ConnectionType.WebSocket)&&!o.getDisableWebSockets()&&o.tryWebSocket()||o.doLongPolling(),o.setState(t.liveswitch.signalling.ClientState.Connected),o.raiseConnectSuccess(e,n)):(o.setDisconnectException(n.getException()),o.setState(t.liveswitch.signalling.ClientState.Disconnected),o.raiseConnectFailure(e,n))}),l.setCallback(n),this.send(l,e.getRequestUrl(),this.checkSynchronous(e.getSynchronous()),null!=e.getRequestTimeout()?e.getRequestTimeout():0,null!=e.getRequestMaxRetries()?e.getRequestMaxRetries():0),this}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.doLongPolling=function(){if(0!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.debug("Starting long-polling transport..."),this._connectionType=t.liveswitch.signalling.ConnectionType.LongPolling,this._streamRequestTransfer=t.liveswitch.signalling.MessageTransferFactory.getHttpMessageTransfer(),this.stream()},o.prototype.doSendMany=function(e,i,o,n){var s=this;if(4!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var r=null,a=void 0;if(e){t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.getIsVerboseEnabled()&&(a=o.getMessages().length,t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.verbose(t.liveswitch.StringExtensions.format("Starting synchronous send for {0} messages...",t.liveswitch.NumberExtensions.toString(a))));var l=i.send(o);t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.getIsVerboseEnabled()&&(a=o.getMessages().length,t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.verbose(t.liveswitch.StringExtensions.format("Finished synchronous send for {0} messages.",t.liveswitch.NumberExtensions.toString(a)))),this.sendCallback(n,l)}else t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.getIsVerboseEnabled()&&(a=o.getMessages().length,t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.verbose(t.liveswitch.StringExtensions.format("Starting asynchronous send on {0} for {1} messages...",this._requestTransfer instanceof t.liveswitch.signalling.WebSocketMessageTransfer?"websocket":"http",t.liveswitch.NumberExtensions.toString(a)))),t.liveswitch.Global.equals(r,null)&&(r=function(e){if(t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.getIsVerboseEnabled()){var i=o.getMessages().length,r=t.liveswitch.Global.equals(e.getMessages(),null)?0:e.getMessages().length;t.liveswitch.signalling.Client.fm_liveswitch_signalling_Client___log.verbose(t.liveswitch.StringExtensions.format("Finished asynchronous send on {0} for {1} messages. Received {2} messages.",s._requestTransfer instanceof t.liveswitch.signalling.WebSocketMessageTransfer?"websocket":"http",t.liveswitch.NumberExtensions.toString(i),t.liveswitch.NumberExtensions.toString(r)))}s.sendCallback(n,e)}),i.sendAsync(o,r)},o.prototype.endBatch=function(){if(0==arguments.length){var e=!1;return this._batchCounter--,this._batchCounter<=0&&(this._batchCounter=0,e=!0),e&&this.processQueue(!1),this}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAuthToken=function(){if(0==arguments.length)return this._authToken;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClientId=function(){if(0==arguments.length)return this._clientId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getConnectionState=function(){if(0==arguments.length)return this.__connectionState;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDisableWebSockets=function(){if(0==arguments.length)return this._disableWebSockets;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDisconnectException=function(){if(0==arguments.length)return this._disconnectException;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getServerTimeout=function(){if(0==arguments.length)return this._serverTimeout;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getState=function(){if(0==arguments.length)return this.__state;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStreamId=function(){if(0==arguments.length)return this._streamId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStreamRequestTimeout=function(){if(0==arguments.length)return i.prototype.getRequestTimeout.call(this)+this.getServerTimeout();throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStreamRequestUrl=function(){if(0==arguments.length)return this.__streamRequestUrl;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSubscribedChannels=function(){if(0==arguments.length){for(var e=new Array,i=0,o=t.liveswitch.HashExtensions.getKeys(this._subscribedChannels);i0;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.processAdvice=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");null!=e.getInterval()&&(this._lastInterval=e.getInterval()),t.liveswitch.Global.equals(e.getReconnect(),t.liveswitch.signalling.Reconnect.NotSet)||(this._lastReconnect=e.getReconnect())},o.prototype.processMaxRetries=function(e,o){if(2==arguments.length)return e=t.liveswitch.Global.toInt(arguments[0]),o?0:t.liveswitch.Global.equals(e,0)?i.prototype.getRequestMaxRetries.call(this):e;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.processPendingReceives=function(e,i){if(2==arguments.length){i=t.liveswitch.Global.toInt(arguments[1]);for(var o=0,n=e;o OnClientChannelReceive"),s.getReconnectAfter()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.raiseConnectFailure=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=new t.liveswitch.signalling.ConnectFailureArgs;o.setException(i.getException()),o.setExtensions(t.liveswitch.signalling.Client.getExtensions(i.getMessage(),e)),o.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i.getMessage())),o.setClient(this),o.setDynamicProperties(e.getDynamicProperties());var n=o,s=this._onConnectFailure;t.liveswitch.Global.equals(s,null)||this.raiseAction(s,n,"Client -> OnConnectFailure"),t.liveswitch.Global.equals(e.getOnFailure(),null)||this.raiseAction(e.getOnFailure(),n,"Client -> Connect -> OnFailure")},o.prototype.raiseConnectSuccess=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=new t.liveswitch.signalling.ConnectSuccessArgs;o.setExtensions(t.liveswitch.signalling.Client.getExtensions(i.getMessage(),e)),o.setConnectionType(this._connectionType),o.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i.getMessage())),o.setClient(this),o.setDynamicProperties(e.getDynamicProperties());var n=o,s=this._onConnectSuccess;t.liveswitch.Global.equals(s,null)||this.raiseAction(s,n,"Client -> OnConnectSuccess"),t.liveswitch.Global.equals(e.getOnSuccess(),null)||this.raiseAction(e.getOnSuccess(),n,"Client -> Connect -> OnSuccess")},o.prototype.raiseDeviceChannelDelivery=function(e,i,o){if(3==arguments.length){o=t.liveswitch.Global.toInt(arguments[2]);var n=new t.liveswitch.signalling.SubscribeReceiveArgs(i.getBayeuxChannel(),i.__dataJson,i.__dataBytes,this._connectionType,o);n.setExtensions(i.getExtensions()),n.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i)),n.setClient(this);var s=n;return t.liveswitch.Global.equals(e,null)||this.raiseAction(e,s,"Client -> OnDeviceChannelReceive"),s.getReconnectAfter()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.raiseDisconnectComplete=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=new t.liveswitch.signalling.DisconnectCompleteArgs;o.setException(i.getException()),o.setExtensions(t.liveswitch.signalling.Client.getExtensions(i.getMessage(),e)),o.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i.getMessage())),o.setClient(this),o.setDynamicProperties(e.getDynamicProperties());var n=o,s=this._onDisconnectComplete;t.liveswitch.Global.equals(s,null)||this.raiseAction(s,n,"Client -> OnDisconnectComplete"),t.liveswitch.Global.equals(e.getOnComplete(),null)||this.raiseAction(e.getOnComplete(),n,"Client -> Disconnect -> OnComplete")},o.prototype.raiseEvent=function(e,o,n){if(3!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(o.setClient(this),!t.liveswitch.Global.equals(e,null))try{e(this,o)}catch(s){i.prototype.raiseUnhandledException.call(this,s)||t.liveswitch.Unhandled.logException(s,t.liveswitch.StringExtensions.format("Client -> {0}",n))}},o.prototype.raiseFunction=function(e,o,n){if(3!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");try{return e(o)}catch(s){return i.prototype.raiseUnhandledException.call(this,s)||t.liveswitch.Unhandled.logException(s,n),null}},o.prototype.raiseSendException=function(e,i,o){if(3!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");for(var n=0,s=e.getRequests();n OnServerSubscribe"),i.setValue(s.getOnReceive())}},o.prototype.raiseServerUnsubscribe=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var i=this._onServerUnsubscribe;if(!t.liveswitch.Global.equals(i,null)){var o=new t.liveswitch.signalling.ServerUnsubscribeArgs;o.__channels=e.getChannels(),o.setExtensions(e.getExtensions()),o.setTimestamp(e.getTimestamp()),o.setClient(this),this.raiseAction(i,o,"Client -> OnServerUnsubscribe")}},o.prototype.raiseServiceFailure=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=new t.liveswitch.signalling.ServiceFailureArgs(t.liveswitch.signalling.Client.getChannelForService(i.getMessage(),e),t.liveswitch.signalling.Client.getDataJsonForService(i.getMessage()),t.liveswitch.signalling.Client.getDataBytesForService(i.getMessage()));o.setException(i.getException()),o.setExtensions(t.liveswitch.signalling.Client.getExtensions(i.getMessage(),e)),o.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i.getMessage())),o.setClient(this),o.setDynamicProperties(e.getDynamicProperties()),o.setSource(i.getFailureSource());var n=o,s=this._onServiceFailure;t.liveswitch.Global.equals(s,null)||this.raiseAction(s,n,"Client -> OnServiceFailure"),t.liveswitch.Global.equals(e.getOnFailure(),null)||this.raiseAction(e.getOnFailure(),n,"Client -> Service -> OnFailure")},o.prototype.raiseServiceSuccess=function(e,i){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");var o=new t.liveswitch.signalling.ServiceSuccessArgs(t.liveswitch.signalling.Client.getChannelForService(i.getMessage(),e),t.liveswitch.signalling.Client.getDataJsonForService(i.getMessage()),t.liveswitch.signalling.Client.getDataBytesForService(i.getMessage()));o.setExtensions(t.liveswitch.signalling.Client.getExtensions(i.getMessage(),e)),o.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i.getMessage())),o.setClient(this),o.setDynamicProperties(e.getDynamicProperties());var n=o,s=this._onServiceSuccess;t.liveswitch.Global.equals(s,null)||this.raiseAction(s,n,"Client -> OnServiceSuccess"),t.liveswitch.Global.equals(e.getOnSuccess(),null)||this.raiseAction(e.getOnSuccess(),n,"Client -> Service -> OnSuccess")},o.prototype.raiseSubscribeReceive=function(e,i,o,n){if(4==arguments.length){n=t.liveswitch.Global.toInt(arguments[3]);var s=new t.liveswitch.signalling.SubscribeReceiveArgs(o.getBayeuxChannel(),o.__dataJson,o.__dataBytes,this._connectionType,n);s.setExtensions(o.getExtensions()),s.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(o)),s.setClient(this),s.setDynamicProperties(i);var r=s;return t.liveswitch.Global.equals(e,null)||this.raiseAction(e,r,"Client -> Subscribe -> OnReceive"),r.getReconnectAfter()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.raiseUserChannelDelivery=function(e,i,o){if(3==arguments.length){o=t.liveswitch.Global.toInt(arguments[2]);var n=new t.liveswitch.signalling.SubscribeReceiveArgs(i.getBayeuxChannel(),i.__dataJson,i.__dataBytes,this._connectionType,o);n.setExtensions(i.getExtensions()),n.setTimestamp(t.liveswitch.signalling.Client.getTimestamp(i)),n.setClient(this);var s=n;return t.liveswitch.Global.equals(e,null)||this.raiseAction(e,s,"Client -> OnUserChannelReceive"),s.getReconnectAfter()}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.receiveMessage=function(e,i){if(2==arguments.length){i=t.liveswitch.Global.toInt(arguments[1]);var o=void 0,n=void 0;if(t.liveswitch.Global.equals(e,null))throw new t.liveswitch.Exception("Signalling client could not process received message. Message was null.");var s=e.getBayeuxChannel();if(t.liveswitch.Global.equals(s,null))throw o=t.liveswitch.StringExtensions.nullCoalesce(e.__dataJson,t.liveswitch.StringExtensions.nullCoalesce(e.getDataJson(),"")),new t.liveswitch.Exception(t.liveswitch.StringExtensions.format("Signalling client could not process received message. BayeuxChannel was null. Message: {0}.",o));if(t.liveswitch.StringExtensions.startsWith(s,t.liveswitch.signalling.Reserved.getClientChannelPrefix())){if(t.liveswitch.Global.equals(e.getTag(),t.liveswitch.signalling.Extensible.getServerActionsExtensionName())){if(o=e.getDataJson(),t.liveswitch.Global.equals(o,null))throw new t.liveswitch.Exception("Signalling client could not process received message. Payload was null.");var r=t.liveswitch.signalling.Message.fromJson(o);return i=this.processServerAction(r,i),i}var a=this._onClientChannelReceive;return t.liveswitch.Global.equals(a,null)||(i=this.raiseClientChannelDelivery(a,e,i)),i}for(var l=new Array,c=new Array,h=0,p=t.liveswitch.HashExtensions.getKeys(this._subscribedOnReceives);h0?(t.liveswitch.Global.equals(s,null)&&(s=function(e){n.stream()}),this.__restreamBackoffTimer=new t.liveswitch.TimeoutTimer(s,null),this.__restreamBackoffTimer.start(o)):this.stream()},o.prototype.send=function(e,i,o,n,s){if(5!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");n=t.liveswitch.Global.toInt(arguments[3]),s=t.liveswitch.Global.toInt(arguments[4]),this.sendMany([e],i,o,n,s)},o.prototype.sendCallback=function(e,o){if(2!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");if(t.liveswitch.Global.equals(o.getException(),null))if(t.liveswitch.Global.equals(o.getMessages(),null))this.raiseSendException(e,new t.liveswitch.Exception(i.prototype.getInvalidResponseMessage.call(this,o)),t.liveswitch.signalling.FailureSource.Message);else if(t.liveswitch.Global.equals(o.getMessages().length,0))this.raiseSendException(e,new t.liveswitch.Exception(i.prototype.getEmptyResponseMessage.call(this,o)),t.liveswitch.signalling.FailureSource.Message);else{for(var n=new Array,s=0,r=o.getMessages();s0){var w=new t.liveswitch.signalling.ClientResponse;w.setDynamicProperties(e.getRequests()[0].getDynamicProperties()),w.setMessages(t.liveswitch.ArrayExtensions.toArray(n)),e.getRequests()[0].getCallback()(w)}for(var u=0,v=o.getMessages();u=0?(i.setValue("Channel may not contain asterisks (*)."),!1):t.liveswitch.signalling.MetaChannels.isReservedChannel(e)?(i.setValue("Channel is reserved."),!1):(i.setValue(null),!0):(i.setValue("Channel must start with a forward-slash (/)."),!1);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.copyExtensions=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");for(var i=0,o=e.getExtensionNames();i-1)return t.liveswitch.Splitter.split(e.message,"::")[1];i=e.message}catch(o){}return i}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getErrorCode=function(){if(0==arguments.length)return t.liveswitch.signalling.FailureArgs.getErrorCode(this.getException());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getErrorMessage=function(){if(0==arguments.length)return t.liveswitch.signalling.FailureArgs.getErrorMessage(this.getException());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getException=function(){if(0==arguments.length)return this._exception;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.setException=function(e){if(1!=arguments.length)throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.");this._exception=e},o}(t.liveswitch.signalling.OutputArgs);i.FailureArgs=o})(i.signalling||(i.signalling={}))})(t.liveswitch||(t.liveswitch={}))}(fm||(fm={})),function(t){(function(i){(function(i){var o=function(i){function o(){for(var e=this,o=new Array(arguments.length),n=0;n0&&(i["ext"]=t.liveswitch.signalling.Extensions.toJson(e.getExtensions())),t.liveswitch.Global.equals(e.getId(),null)||(i["id"]=t.liveswitch.JsonSerializer.serializeString(e.getId())),t.liveswitch.Global.equals(e.getMinimumVersion(),null)||(i["minimumVersion"]=t.liveswitch.JsonSerializer.serializeString(e.getMinimumVersion())),t.liveswitch.Global.equals(e.getChannels(),null)||!t.liveswitch.Global.equals(e.getType(),t.liveswitch.signalling.MessageType.Subscribe)&&!t.liveswitch.Global.equals(e.getType(),t.liveswitch.signalling.MessageType.Unsubscribe)||(i["subscription"]=t.liveswitch.JsonSerializer.serializeStringArray(e.getChannels())),e.getSuccessful()&&(i["successful"]=t.liveswitch.JsonSerializer.serializeBoolean(e.getSuccessful())),t.liveswitch.Global.equals(e.getSupportedConnectionTypes(),null)||(i["supportedConnectionTypes"]=t.liveswitch.signalling.Message.serializeConnectionTypeArray(e.getSupportedConnectionTypes())),t.liveswitch.Global.equals(e.getVersion(),null)||(i["version"]=t.liveswitch.JsonSerializer.serializeString(e.getVersion()))}));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.toJsonArray=function(e){if(1==arguments.length)return t.liveswitch.JsonSerializer.serializeObjectArray(e,t.liveswitch.signalling.Message.toJson.bind(t.liveswitch.signalling.Message));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAcknowledgement=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeBoolean(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getAcknowledgementExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAdvice=function(){if(0==arguments.length)return this.__advice;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getAuthToken=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeString(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getAuthTokenExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getBayeuxChannel=function(){if(0==arguments.length)return this.__bayeuxChannel;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getChannel=function(){if(0==arguments.length)return t.liveswitch.signalling.Extensible.sharedGetChannel(this.__channels);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getChannels=function(){if(0==arguments.length)return t.liveswitch.signalling.Extensible.sharedGetChannels(this.__channels);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getClientId=function(){if(0==arguments.length)return this.__clientId;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getConnectionType=function(){if(0==arguments.length)return this.__connectionType;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDeviceId=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeString(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getDeviceIdExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getDisableBinary=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeBoolean(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getDisableBinaryExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getId=function(){if(0==arguments.length)return this.__id;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getMinimumVersion=function(){if(0==arguments.length)return this.__minimumVersion;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getRemoteClient=function(){if(0==arguments.length)return t.liveswitch.signalling.RemoteClient.fromJson(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getRemoteClientExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getServerActions=function(){if(0==arguments.length){var e=i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getServerActionsExtensionName());if(!t.liveswitch.StringExtensions.isNullOrEmpty(e)){var o=t.liveswitch.signalling.Message.fromJsonArray(e);if(!t.liveswitch.Global.equals(o,null))return o}return null}throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getServerTimeout=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeInteger(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getServerTimeoutExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getStreamId=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeString(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getStreamIdExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getSupportedConnectionTypes=function(){if(0==arguments.length)return this.__supportedConnectionTypes;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getTag=function(){if(0==arguments.length)return t.liveswitch.StringExtensions.nullCoalesce(t.liveswitch.JsonSerializer.deserializeString(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getTagExtensionName())),t.liveswitch.StringExtensions.empty);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getType=function(){if(0==arguments.length)return t.liveswitch.signalling.MetaChannels.getMessageType(this.getBayeuxChannel());throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getUserId=function(){if(0==arguments.length)return t.liveswitch.JsonSerializer.deserializeString(i.prototype.getExtensionValueJson.call(this,t.liveswitch.signalling.Extensible.getUserIdExtensionName()));throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.getVersion=function(){if(0==arguments.length)return this.__version;throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isBind=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Bind);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isConnect=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Connect);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isDisconnect=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Disconnect);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isPublish=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Publish);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isService=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Service);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isStream=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Stream);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isSubscribe=function(){if(0==arguments.length)return t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Subscribe);throw new t.liveswitch.Exception("Method overload does not exist with specified parameter count/type combination.")},o.prototype.isSubscribingTo=function(e){if(1==arguments.length){if(t.liveswitch.Global.equals(this.getType(),t.liveswitch.signalling.MessageType.Subscribe)){if(t.liveswitch.Global.equals(this.getChannels(),null))return!1;for(var i=0,o=this.getChannels();i