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