var CreateWsmanComm=function(e,t,n,r,o){var s={};function a(e){e="00000000"+e.toString(16);return e.substring(e.length-8)}function c(){for(i in s.socketState=2,s.pendingAjaxCall)s.sendRequest(s.pendingAjaxCall[i][0],s.pendingAjaxCall[i][3],s.pendingAjaxCall[i][4])}function l(e){for(s.socketAccumulator+=(e=new Uint8Array(e.data),String.fromCharCode.apply(null,e));;){if(0==s.socketParseState){var t,n=s.socketAccumulator.indexOf("\r\n\r\n");if(n<0)return;if(s.socketHeader=s.socketAccumulator.substring(0,n).split("\r\n"),null==s.amtVersion)for(var r in s.socketHeader)0==s.socketHeader[r].indexOf("Server: Intel(R) Active Management Technology ")&&(s.amtVersion=s.socketHeader[r].substring(46));for(r in s.socketAccumulator=s.socketAccumulator.substring(n+4),s.socketParseState=1,s.socketData="",s.socketXHeader={Directive:s.socketHeader[0].split(" ")},s.socketHeader)0!=r&&(t=s.socketHeader[r].indexOf(":"),s.socketXHeader[s.socketHeader[r].substring(0,t).toLowerCase()]=s.socketHeader[r].substring(t+2))}if(1==s.socketParseState){var o=-1;if(null==s.socketXHeader.connection||"close"!=s.socketXHeader.connection.toLowerCase()||null!=s.socketXHeader["transfer-encoding"]&&"chunked"==s.socketXHeader["transfer-encoding"].toLowerCase())if(null!=s.socketXHeader["content-length"]){if(o=parseInt(s.socketXHeader["content-length"]),s.socketAccumulator.length=s.MaxActiveAjaxCount||0==s.PendingAjax.length||(e=s.PendingAjax.shift(),s.PerformAjaxEx(e[0],e[1],e[2],e[3],e[4]),s.PerformNextAjax())},s.PerformAjaxEx=function(e,t,n,r,o){if(0==s.FailAllError)return e=e||"",s.ActiveAjaxCount++,s.PerformAjaxExNodeJS(e,t,n,r,o);s.gotNextMessagesError({status:s.FailAllError},"error",null,[e,t,n,r,o])},s.pendingAjaxCall=[],s.PerformAjaxExNodeJS=function(e,t,n,r,o){s.PerformAjaxExNodeJS2(e,t,n,r,o,3)},s.PerformAjaxExNodeJS2=function(e,t,n,r,o,a){if(a<=0||0!=s.FailAllError)return s.ActiveAjaxCount--,999!=s.FailAllError&&s.gotNextMessages(null,"error",{status:0==s.FailAllError?408:s.FailAllError},[e,t,n,r,o]),void s.PerformNextAjax();s.pendingAjaxCall.push([e,t,n,r,o,a]),0==s.socketState?s.xxConnectHttpSocket():2==s.socketState&&s.sendRequest(e,r,o)},s.sendRequest=function(e,t,n){var r=(n=n||"POST")+" "+(t=t||"/wsman")+" HTTP/1.1\r\n";null!=s.challengeParams&&(n=hex_md5(hex_md5(s.user+":"+s.challengeParams.realm+":"+s.pass)+":"+s.challengeParams.nonce+":"+a(s.noncecounter)+":"+s.cnonce+":"+s.challengeParams.qop+":"+hex_md5(n+":"+t+("auth-int"==s.challengeParams.qop?":"+hex_md5(e):""))),r+="Authorization: "+s.renderDigest({username:s.user,realm:s.challengeParams.realm,nonce:s.challengeParams.nonce,uri:t,qop:s.challengeParams.qop,response:n,nc:a(s.noncecounter++),cnonce:s.cnonce})+"\r\n"),function(e){if(2==s.socketState&&null!=s.socket&&s.socket.readyState==WebSocket.OPEN){for(var t=new Uint8Array(e.length),n=0;n