=0&&p<=d.Canvas.canvas.width&&q>=0&&q<=d.Canvas.canvas.height){var h=0;var j=0;if(g==d.KeyAction.UP||g==d.KeyAction.DOWN){if(k.which){((k.which==1)?(h=d.MouseButton.LEFT):((k.which==2)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}else{if(k.button){((k.button==0)?(h=d.MouseButton.LEFT):((k.button==1)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}}}else{if(g==d.KeyAction.SCROLL){if(k.detail){j=(-1*(k.detail*120))}else{if(k.wheelDelta){j=(k.wheelDelta*3)}}}}var l="";if(g==d.KeyAction.DBLCLICK){l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,136,((p/256)&255),(p&255),((q/256)&255),(q&255))}else{if(g==d.KeyAction.SCROLL){l=String.fromCharCode(0,d.InputType.MOUSE,0,12,0,0,((p/256)&255),(p&255),((q/256)&255),(q&255),((j/256)&255),(j&255))}else{l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,((g==d.KeyAction.DOWN)?h:((h*2)&255)),((p/256)&255),(p&255),((q/256)&255),(q&255))}}if(d.Action==d.KeyAction.NONE){if(d.Alternate==0||d.ipad){d.send(l);d.Alternate=1}else{d.Alternate=0}}else{d.send(l)}}}};d.GetDisplayNumbers=function(){d.send(String.fromCharCode(0,11,0,4))};d.SetDisplay=function(g){console.log("Set display",g);d.send(String.fromCharCode(0,12,0,6,g>>8,g&255))};d.intToStr=function(g){return String.fromCharCode((g>>24)&255,(g>>16)&255,(g>>8)&255,g&255)};d.shortToStr=function(g){return String.fromCharCode((g>>8)&255,g&255)};d.onResize=function(){if(d.ScreenWidth==0||d.ScreenHeight==0){return}if(d.Canvas.canvas.width==d.ScreenWidth&&d.Canvas.canvas.height==d.ScreenHeight){return}if(d.FirstDraw){d.Canvas.canvas.width=d.ScreenWidth;d.Canvas.canvas.height=d.ScreenHeight;d.Canvas.fillRect(0,0,d.ScreenWidth,d.ScreenHeight);if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}}d.FirstDraw=false};d.xxMouseInputGrab=false;d.xxKeyInputGrab=false;d.xxMouseMove=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.NONE,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseUp=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDown=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDblClick=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DBLCLICK,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxDOMMouseScroll=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxMouseWheel=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxKeyUp=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyDown=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyPress=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.handleKeys=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyPress(g)};d.handleKeyUp=function(g){if(d.stopInput==true||desktop.State!=3){return false}if(d.firstUpKeys.length<5){d.firstUpKeys.push(g.keyCode);if((d.firstUpKeys.length==5)){var h=d.firstUpKeys.join(",");if((h=="16,17,91,91,16")||(h=="16,17,18,91,92")){d.stopInput=true}}}return d.xxKeyUp(g)};d.handleKeyDown=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyDown(g)};d.mousedblclick=function(g){if(d.stopInput==true){return false}return d.xxMouseDblClick(g)};d.mousedown=function(g){if(d.stopInput==true){return false}return d.xxMouseDown(g)};d.mouseup=function(g){if(d.stopInput==true){return false}return d.xxMouseUp(g)};d.mousemove=function(g){if(d.stopInput==true){return false}return d.xxMouseMove(g)};d.mousewheel=function(g){if(d.stopInput==true){return false}return d.xxMouseWheel(g)};d.xxMsTouchEvent=function(g){if(g.originalEvent.pointerType==4){return}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}if(g.type=="MSPointerDown"||g.type=="MSPointerMove"||g.type=="MSPointerUp"){var h=0;var j=g.originalEvent.pointerId%256;var k=g.offsetX*(Canvas.canvas.width/d.CanvasId.clientWidth);var l=g.offsetY*(Canvas.canvas.height/d.CanvasId.clientHeight);if(g.type=="MSPointerDown"){h=65536|2|4}else{if(g.type=="MSPointerMove"){h=131072|2|4}else{if(g.type=="MSPointerUp"){h=262144}}}if(!d.TouchArray[j]){d.TouchArray[j]={x:k,y:l}}d.SendTouchMsg2(j,h);if(g.type=="MSPointerUp"){delete d.TouchArray[j]}}else{alert(g.type)}return true};d.xxTouchStart=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(KeyAction.DOWN,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(!d.TouchArray[j]){d.TouchArray[j]={x:(g.originalEvent.touches[h].pageX-k[0])*(Canvas.canvas.width/d.CanvasId.clientWidth),y:(g.originalEvent.touches[h].pageY-k[1])*(Canvas.canvas.height/d.CanvasId.clientHeight),f:1}}}if(Object.keys(d.TouchArray).length>0&&touchtimer==null){d.touchtimer=setInterval(function(){d.SendTouchMsg2(256,0)},50)}}};d.xxTouchMove=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(d.KeyAction.NONE,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].x=(g.originalEvent.touches[h].pageX-k[0])*(d.Canvas.canvas.width/d.CanvasId.clientWidth);d.TouchArray[j].y=(g.originalEvent.touches[h].pageY-k[1])*(d.Canvas.canvas.height/d.CanvasId.clientHeight)}}}};d.xxTouchEnd=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}g.which=1;g.pageX=LastX;g.pageY=LastY;d.SendMouseMsg(KeyAction.UP,g)}else{for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].f=2}}}};d.GrabMouseInput=function(){if(d.xxMouseInputGrab==true){return}var g=d.CanvasId;g.onmousemove=d.xxMouseMove;g.onmouseup=d.xxMouseUp;g.onmousedown=d.xxMouseDown;g.touchstart=d.xxTouchStart;g.touchmove=d.xxTouchMove;g.touchend=d.xxTouchEnd;g.MSPointerDown=d.xxMsTouchEvent;g.MSPointerMove=d.xxMsTouchEvent;g.MSPointerUp=d.xxMsTouchEvent;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=d.xxDOMMouseScroll}else{g.onmousewheel=d.xxMouseWheel}d.xxMouseInputGrab=true};d.UnGrabMouseInput=function(){if(d.xxMouseInputGrab==false){return}var g=d.CanvasId;g.onmousemove=null;g.onmouseup=null;g.onmousedown=null;g.touchstart=null;g.touchmove=null;g.touchend=null;g.MSPointerDown=null;g.MSPointerMove=null;g.MSPointerUp=null;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=null}else{g.onmousewheel=null}d.xxMouseInputGrab=false};d.GrabKeyInput=function(){if(d.xxKeyInputGrab==true){return}document.onkeyup=d.xxKeyUp;document.onkeydown=d.xxKeyDown;document.onkeypress=d.xxKeyPress;d.xxKeyInputGrab=true};d.UnGrabKeyInput=function(){if(d.xxKeyInputGrab==false){return}document.onkeyup=null;document.onkeydown=null;document.onkeypress=null;d.xxKeyInputGrab=false};d.GetPositionOfControl=function(g){var h=Array(2);h[0]=h[1]=0;while(g){h[0]+=g.offsetLeft;h[1]+=g.offsetTop;g=g.offsetParent}return h};d.crotX=function(g,h){if(d.rotation==0){return g}if(d.rotation==1){return h}if(d.rotation==2){return d.Canvas.canvas.width-g}if(d.rotation==3){return d.Canvas.canvas.height-h}};d.crotY=function(g,h){if(d.rotation==0){return h}if(d.rotation==1){return d.Canvas.canvas.width-g}if(d.rotation==2){return d.Canvas.canvas.height-h}if(d.rotation==3){return g}};d.rotX=function(g,h){if(d.rotation==0||d.rotation==1){return g}if(d.rotation==2){return g-d.Canvas.canvas.width}if(d.rotation==3){return g-d.Canvas.canvas.height}};d.rotY=function(g,h){if(d.rotation==0||d.rotation==3){return h}if(d.rotation==1){return h-d.Canvas.canvas.width}if(d.rotation==2){return h-d.Canvas.canvas.height}};d.tcanvas=null;d.setRotation=function(l){while(l<0){l+=4}var g=l%4;if(g==d.rotation){return true}var j=d.Canvas.canvas.width;var h=d.Canvas.canvas.height;if(d.rotation==1||d.rotation==3){j=d.Canvas.canvas.height;h=d.Canvas.canvas.width}if(d.tcanvas==null){d.tcanvas=document.createElement("canvas")}var k=d.tcanvas.getContext("2d");k.setTransform(1,0,0,1,0,0);k.canvas.width=j;k.canvas.height=h;k.rotate((d.rotation*-90)*Math.PI/180);if(d.rotation==0){k.drawImage(d.Canvas.canvas,0,0)}if(d.rotation==1){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,0)}if(d.rotation==2){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,-d.Canvas.canvas.height)}if(d.rotation==3){k.drawImage(d.Canvas.canvas,0,-d.Canvas.canvas.height)}if(d.rotation==0||d.rotation==2){d.Canvas.canvas.height=j;d.Canvas.canvas.width=h}if(d.rotation==1||d.rotation==3){d.Canvas.canvas.height=h;d.Canvas.canvas.width=j}d.Canvas.setTransform(1,0,0,1,0,0);d.Canvas.rotate((g*90)*Math.PI/180);d.rotation=g;d.Canvas.drawImage(d.tcanvas,d.rotX(0,0),d.rotY(0,0));d.ScreenWidth=d.Canvas.canvas.width;d.ScreenHeight=d.Canvas.canvas.height;if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}return true};d.MuchTheSame=function(g,h){return(Math.abs(g-h)<4)};d.Debug=function(g){console.log(g)};d.getIEVersion=function(){var g=-1;if(navigator.appName=="Microsoft Internet Explorer"){var j=navigator.userAgent;var h=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(h.exec(j)!=null){g=parseFloat(RegExp.$1)}}return g};d.haltEvent=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};return d};function AmtStackCreateService(t){var s=new Object();s.wsman=t;s.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];s.PendingEnums=[];s.PendingBatchOperations=0;s.ActiveEnumsCount=0;s.MaxActiveEnumsCount=1;s.onProcessChanged=null;var n=0;var m=0;s.GetPendingActions=function(){return(s.PendingEnums.length*2)+(s.ActiveEnumsCount)+s.wsman.comm.PendingAjax.length+s.wsman.comm.ActiveAjaxCount+s.PendingBatchOperations};function r(){var u=s.GetPendingActions();if(n=s.MaxActiveEnumsCount||s.PendingEnums.length==0){return}var v=s.PendingEnums.shift();s.Enum(v[0],v[1],v[2]);c(0)}s.BatchEnum=function(u,x,v,z,w,y){s.PendingBatchOperations+=(x.length*2);a(u,Clone(x),v,z,{},w,y);r()};function a(u,z,v,C,B,w,A){s.PendingBatchOperations-=2;var y=z.shift(),x=s.Enum;if(y[0]=="*"){x=s.Get;y=y.substring(1)}x(y,function(F,D,E,G,H){H[2][D]={response:(E==null?null:E.Body),responses:E,status:G};if(H[1].length==0||G==401||(w!=true&&G!=200&&G!=400)){s.PendingBatchOperations-=(z.length*2);r();v(s,u,H[2],G,C)}else{r();a(u,z,v,C,H[2],A)}},[u,z,B],A);r()}s.BatchGet=function(u,w,v,y,x){h({name:u,names:w,callback:v,current:0,responses:{},tag:y,pri:x});r()};function h(u){if(u.names.length<=u.current){u.callback(s,u.name,u.responses,200,u.tag)}else{s.wsman.ExecGet(s.CompleteName(u.names[u.current]),function(x,w,v,y){g(u,v,y)},u.pri);u.current++}r()}function g(u,v,w){if(v==null||w!=200){u.callback(s,u.name,null,w,u.tag)}else{u.responses[v.Header.Method]=v;h(u)}}s.CompleteName=function(u){if(u.indexOf("AMT_")==0){return s.pfx[0]+u}if(u.indexOf("CIM_")==0){return s.pfx[1]+u}if(u.indexOf("IPS_")==0){return s.pfx[2]+u}};s.CompleteExecResponse=function(u){if(u&&u!=null&&u.Body&&u.Body.ReturnValue){u.Body.ReturnValueStr=s.AmtStatusToStr(u.Body.ReturnValue)}return u};s.RequestPowerStateChange=function(v,u){s.CIM_PowerManagementService_RequestPowerStateChange(v,'http://schemas.xmlsoap.org/ws/2004/08/addressing http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem CIM_ComputerSystem ManagedSystem ',null,null,u)};s.SetBootConfigRole=function(v,u){s.CIM_BootService_SetBootConfigRole('http://schemas.xmlsoap.org/ws/2004/08/addressing http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting Intel(r) AMT: Boot Configuration 0 ',v,u)};s.CancelAllQueries=function(u){s.wsman.CancelAllQueries(u)};s.AMT_AgentPresenceWatchdog_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdog_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AddAction=function(z,y,x,v,u,w,C,A,B){s.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w,C,A,B)};s.AMT_AgentPresenceWatchdog_DeleteAllActions=function(u,x,v,w){s.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},u,x,v,w)};s.AMT_AgentPresenceWatchdogAction_GetActionEac=function(u){s.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},u)};s.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdogVA_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AddAction=function(z,y,x,v,u,w){s.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w)};s.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(u,v){s.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:u},v)};s.AMT_AuditLog_ClearLog=function(u){s.Exec("AMT_AuditLog","ClearLog",{},u)};s.AMT_AuditLog_RequestStateChange=function(v,w,u){s.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_AuditLog_ReadRecords=function(v,u,w){s.Exec("AMT_AuditLog","ReadRecords",{StartIndex:v},u,w)};s.AMT_AuditLog_SetAuditLock=function(x,v,w,u){s.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:x,Flag:v,Handle:w},u)};s.AMT_AuditLog_ExportAuditLogSignature=function(v,u){s.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:v},u)};s.AMT_AuditLog_SetSigningKeyMaterial=function(y,x,w,v,u){s.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:y,SigningKey:x,LengthOfCertificates:w,Certificates:v},u)};s.AMT_AuditPolicyRule_SetAuditPolicy=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuthorizationService_AddUserAclEntryEx=function(x,w,y,u,z,v){s.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:x,DigestPassword:w,KerberosUserSid:y,AccessPermission:u,Realms:z},v)};s.AMT_AuthorizationService_EnumerateUserAclEntries=function(v,u){s.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:v},u)};s.AMT_AuthorizationService_GetUserAclEntryEx=function(v,u,w){s.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:v},u,w)};s.AMT_AuthorizationService_UpdateUserAclEntryEx=function(y,x,w,z,u,A,v){s.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:y,DigestUsername:x,DigestPassword:w,KerberosUserSid:z,AccessPermission:u,Realms:A},v)};s.AMT_AuthorizationService_RemoveUserAclEntry=function(v,u){s.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:v},u)};s.AMT_AuthorizationService_SetAdminAclEntryEx=function(w,v,u){s.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:w,DigestPassword:v},u)};s.AMT_AuthorizationService_GetAdminAclEntry=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},u)};s.AMT_AuthorizationService_GetAdminAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},u)};s.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},u)};s.AMT_AuthorizationService_SetAclEnabledState=function(w,v,u,x){s.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:w,Enabled:v},u,x)};s.AMT_AuthorizationService_GetAclEnabledState=function(v,u,w){s.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:v},u,w)};s.AMT_EndpointAccessControlService_RequestStateChange=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_EndpointAccessControlService_GetPosture=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:v},u)};s.AMT_EndpointAccessControlService_GetPostureHash=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:v},u)};s.AMT_EndpointAccessControlService_UpdatePostureState=function(v,u){s.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:v},u)};s.AMT_EndpointAccessControlService_GetEacOptions=function(u){s.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},u)};s.AMT_EndpointAccessControlService_SetEacOptions=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:v,PostureHashAlgorithm:w},u)};s.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:v},u)};s.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:v},u)};s.AMT_EthernetPortSettings_SetLinkPreference=function(v,w,u){s.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:v,Timeout:w},u)};s.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(v,u){s.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:v},u)};s.AMT_KerberosSettingData_GetCredentialCacheState=function(u){s.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},u)};s.AMT_KerberosSettingData_SetCredentialCacheState=function(v,u){s.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:v},u)};s.AMT_MessageLog_CancelIteration=function(v,u){s.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:v},u)};s.AMT_MessageLog_RequestStateChange=function(v,w,u){s.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_MessageLog_ClearLog=function(u){s.Exec("AMT_MessageLog","ClearLog",{},u)};s.AMT_MessageLog_GetRecords=function(v,w,u,x){s.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:v,MaxReadRecords:w},u,x)};s.AMT_MessageLog_GetRecord=function(v,w,u){s.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:v,PositionToNext:w},u)};s.AMT_MessageLog_PositionAtRecord=function(v,w,x,u){s.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:v,MoveAbsolute:w,RecordNumber:x},u)};s.AMT_MessageLog_PositionToFirstRecord=function(u,v){s.Exec("AMT_MessageLog","PositionToFirstRecord",{},u,v)};s.AMT_MessageLog_FreezeLog=function(v,u){s.Exec("AMT_MessageLog","FreezeLog",{Freeze:v},u)};s.AMT_PublicKeyManagementService_AddCRL=function(w,v,u){s.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:w,SerialNumbers:v},u)};s.AMT_PublicKeyManagementService_ResetCRLList=function(u,v){s.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:u},v)};s.AMT_PublicKeyManagementService_AddCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddKey=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:v},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(w,v,x,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:w,DNName:v,Usage:x},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(v,x,w,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:v,SigningAlgorithm:x,NullSignedCertificateRequest:w},u)};s.AMT_PublicKeyManagementService_GenerateKeyPair=function(v,w,u){s.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:v,KeyLength:w},u)};s.AMT_RedirectionService_RequestStateChange=function(v,u){s.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:v},u)};s.AMT_RedirectionService_TerminateSession=function(v,u){s.Exec("AMT_RedirectionService","TerminateSession",{SessionType:v},u)};s.AMT_RemoteAccessService_AddMpServer=function(u,z,B,v,x,C,A,y,w){s.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:u,InfoFormat:z,Port:B,AuthMethod:v,Certificate:x,Username:C,Password:A,CN:y},w)};s.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(x,y,v,w,u){s.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:x,TunnelLifeTime:y,ExtendedData:v,MpServer:w},u)};s.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(u,v){s.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_CommitChanges=function(u,v){s.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_Unprovision=function(v,u){s.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:v},u)};s.AMT_SetupAndConfigurationService_PartialUnprovision=function(u,v){s.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(u,v){s.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(v,u){s.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:v},u)};s.AMT_SetupAndConfigurationService_SetMEBxPassword=function(v,u){s.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:v},u)};s.AMT_SetupAndConfigurationService_SetTLSPSK=function(v,w,u){s.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:v,PPS:w},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},u)};s.AMT_SetupAndConfigurationService_GetUuid=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUuid",{},u)};s.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},u)};s.AMT_SystemDefensePolicy_GetTimeout=function(u){s.Exec("AMT_SystemDefensePolicy","GetTimeout",{},u)};s.AMT_SystemDefensePolicy_SetTimeout=function(v,u){s.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:v},u)};s.AMT_SystemDefensePolicy_UpdateStatistics=function(v,x,u,z,w,y){s.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:v,ResetOnRead:x},u,z,w,y)};s.AMT_SystemPowerScheme_SetPowerScheme=function(u,v,w){s.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},u,w,0,{InstanceID:v})};s.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(u,v){s.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},u,v)};s.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(v,x,y,u,w){s.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:v,Tm1:x,Tm2:y},u,w)};s.AMT_UserInitiatedConnectionService_RequestStateChange=function(v,w,u){s.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WebUIService_RequestStateChange=function(v,w,u){s.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:u},v)};s.CIM_Account_RequestStateChange=function(v,w,u){s.Exec("CIM_Account","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_AccountManagementService_CreateAccount=function(w,u,v){s.Exec("CIM_AccountManagementService","CreateAccount",{System:w,AccountTemplate:u},v)};s.CIM_BootConfigSetting_ChangeBootOrder=function(v,u){s.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:v},u)};s.CIM_BootService_SetBootConfigRole=function(u,w,v){s.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:u,Role:w},v,0,1)};s.CIM_Card_ConnectorPower=function(v,w,u){s.Exec("CIM_Card","ConnectorPower",{Connector:v,PoweredOn:w},u)};s.CIM_Card_IsCompatible=function(v,u){s.Exec("CIM_Card","IsCompatible",{ElementToCheck:v},u)};s.CIM_Chassis_IsCompatible=function(v,u){s.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:v},u)};s.CIM_Fan_SetSpeed=function(v,u){s.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:v},u)};s.CIM_KVMRedirectionSAP_RequestStateChange=function(v,w,u){s.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:v},u)};s.CIM_MediaAccessDevice_LockMedia=function(v,u){s.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:v},u)};s.CIM_MediaAccessDevice_SetPowerState=function(v,w,u){s.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_MediaAccessDevice_Reset=function(u){s.Exec("CIM_MediaAccessDevice","Reset",{},u)};s.CIM_MediaAccessDevice_EnableDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:v},u)};s.CIM_MediaAccessDevice_OnlineDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:v},u)};s.CIM_MediaAccessDevice_QuiesceDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:v},u)};s.CIM_MediaAccessDevice_SaveProperties=function(u){s.Exec("CIM_MediaAccessDevice","SaveProperties",{},u)};s.CIM_MediaAccessDevice_RestoreProperties=function(u){s.Exec("CIM_MediaAccessDevice","RestoreProperties",{},u)};s.CIM_MediaAccessDevice_RequestStateChange=function(v,w,u){s.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_PhysicalFrame_IsCompatible=function(v,u){s.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:v},u)};s.CIM_PhysicalPackage_IsCompatible=function(v,u){s.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:v},u)};s.CIM_PowerManagementService_RequestPowerStateChange=function(w,v,x,y,u){s.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:w,ManagedElement:v,Time:x,TimeoutPeriod:y},u,0,1)};s.CIM_PowerSupply_SetPowerState=function(v,w,u){s.Exec("CIM_PowerSupply","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_PowerSupply_Reset=function(u){s.Exec("CIM_PowerSupply","Reset",{},u)};s.CIM_PowerSupply_EnableDevice=function(v,u){s.Exec("CIM_PowerSupply","EnableDevice",{Enabled:v},u)};s.CIM_PowerSupply_OnlineDevice=function(v,u){s.Exec("CIM_PowerSupply","OnlineDevice",{Online:v},u)};s.CIM_PowerSupply_QuiesceDevice=function(v,u){s.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:v},u)};s.CIM_PowerSupply_SaveProperties=function(u){s.Exec("CIM_PowerSupply","SaveProperties",{},u)};s.CIM_PowerSupply_RestoreProperties=function(u){s.Exec("CIM_PowerSupply","RestoreProperties",{},u)};s.CIM_PowerSupply_RequestStateChange=function(v,w,u){s.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Processor_SetPowerState=function(v,w,u){s.Exec("CIM_Processor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Processor_Reset=function(u){s.Exec("CIM_Processor","Reset",{},u)};s.CIM_Processor_EnableDevice=function(v,u){s.Exec("CIM_Processor","EnableDevice",{Enabled:v},u)};s.CIM_Processor_OnlineDevice=function(v,u){s.Exec("CIM_Processor","OnlineDevice",{Online:v},u)};s.CIM_Processor_QuiesceDevice=function(v,u){s.Exec("CIM_Processor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Processor_SaveProperties=function(u){s.Exec("CIM_Processor","SaveProperties",{},u)};s.CIM_Processor_RestoreProperties=function(u){s.Exec("CIM_Processor","RestoreProperties",{},u)};s.CIM_Processor_RequestStateChange=function(v,w,u){s.Exec("CIM_Processor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RecordLog_ClearLog=function(u){s.Exec("CIM_RecordLog","ClearLog",{},u)};s.CIM_RecordLog_RequestStateChange=function(v,w,u){s.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RedirectionService_RequestStateChange=function(v,w,u){s.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Sensor_SetPowerState=function(v,w,u){s.Exec("CIM_Sensor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Sensor_Reset=function(u){s.Exec("CIM_Sensor","Reset",{},u)};s.CIM_Sensor_EnableDevice=function(v,u){s.Exec("CIM_Sensor","EnableDevice",{Enabled:v},u)};s.CIM_Sensor_OnlineDevice=function(v,u){s.Exec("CIM_Sensor","OnlineDevice",{Online:v},u)};s.CIM_Sensor_QuiesceDevice=function(v,u){s.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Sensor_SaveProperties=function(u){s.Exec("CIM_Sensor","SaveProperties",{},u)};s.CIM_Sensor_RestoreProperties=function(u){s.Exec("CIM_Sensor","RestoreProperties",{},u)};s.CIM_Sensor_RequestStateChange=function(v,w,u){s.Exec("CIM_Sensor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_StatisticalData_ResetSelectedStats=function(v,u){s.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:v},u)};s.CIM_Watchdog_KeepAlive=function(u){s.Exec("CIM_Watchdog","KeepAlive",{},u)};s.CIM_Watchdog_SetPowerState=function(v,w,u){s.Exec("CIM_Watchdog","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Watchdog_Reset=function(u){s.Exec("CIM_Watchdog","Reset",{},u)};s.CIM_Watchdog_EnableDevice=function(v,u){s.Exec("CIM_Watchdog","EnableDevice",{Enabled:v},u)};s.CIM_Watchdog_OnlineDevice=function(v,u){s.Exec("CIM_Watchdog","OnlineDevice",{Online:v},u)};s.CIM_Watchdog_QuiesceDevice=function(v,u){s.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:v},u)};s.CIM_Watchdog_SaveProperties=function(u){s.Exec("CIM_Watchdog","SaveProperties",{},u)};s.CIM_Watchdog_RestoreProperties=function(u){s.Exec("CIM_Watchdog","RestoreProperties",{},u)};s.CIM_Watchdog_RequestStateChange=function(v,w,u){s.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_WiFiPort_SetPowerState=function(v,w,u){s.Exec("CIM_WiFiPort","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_WiFiPort_Reset=function(u){s.Exec("CIM_WiFiPort","Reset",{},u)};s.CIM_WiFiPort_EnableDevice=function(v,u){s.Exec("CIM_WiFiPort","EnableDevice",{Enabled:v},u)};s.CIM_WiFiPort_OnlineDevice=function(v,u){s.Exec("CIM_WiFiPort","OnlineDevice",{Online:v},u)};s.CIM_WiFiPort_QuiesceDevice=function(v,u){s.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:v},u)};s.CIM_WiFiPort_SaveProperties=function(u){s.Exec("CIM_WiFiPort","SaveProperties",{},u)};s.CIM_WiFiPort_RestoreProperties=function(u){s.Exec("CIM_WiFiPort","RestoreProperties",{},u)};s.CIM_WiFiPort_RequestStateChange=function(v,w,u){s.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_HostBasedSetupService_Setup=function(y,z,x,v,A,w,u){s.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:y,NetworkAdminPassword:z,McNonce:x,Certificate:v,SigningAlgorithm:A,DigitalSignature:w},u)};s.IPS_HostBasedSetupService_AddNextCertInChain=function(x,v,w,u){s.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:x,IsLeafCertificate:v,IsRootCertificate:w},u)};s.IPS_HostBasedSetupService_AdminSetup=function(x,y,w,z,v,u){s.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:x,NetworkAdminPassword:y,McNonce:w,SigningAlgorithm:z,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(w,x,v,u){s.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:w,SigningAlgorithm:x,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_DisableClientControlMode=function(u,v){s.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:u},v)};s.IPS_KVMRedirectionSettingData_TerminateSession=function(u){s.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},u)};s.IPS_OptInService_StartOptIn=function(u){s.Exec("IPS_OptInService","StartOptIn",{},u)};s.IPS_OptInService_CancelOptIn=function(u){s.Exec("IPS_OptInService","CancelOptIn",{},u)};s.IPS_OptInService_SendOptInCode=function(v,u){s.Exec("IPS_OptInService","SendOptInCode",{OptInCode:v},u)};s.IPS_OptInService_StartService=function(u){s.Exec("IPS_OptInService","StartService",{},u)};s.IPS_OptInService_StopService=function(u){s.Exec("IPS_OptInService","StopService",{},u)};s.IPS_OptInService_RequestStateChange=function(v,w,u){s.Exec("IPS_OptInService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_RequestStateChange=function(v,w,u){s.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_ClearLog=function(u,v){s.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:u},v)};s.IPS_SecIOService_RequestStateChange=function(v,w,u){s.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AmtStatusToStr=function(u){if(s.AmtStatusCodes[u]){return s.AmtStatusCodes[u]}else{return"UNKNOWN_ERROR"}};s.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};s.GetMessageLog=function(u,v){s.AMT_MessageLog_PositionToFirstRecord(k,[u,v,[]])};function k(w,u,v,x,y){if(x!=200||v.Body.ReturnValue!="0"){y[0](s,null,y[2]);return}s.AMT_MessageLog_GetRecords(v.Body.IterationIdentifier,390,l,y)}function l(D,A,C,E,G){if(E!=200||C.Body.ReturnValue!="0"){G[0](s,null,G[2]);return}var y,z,I,v,u=G[2],F=new Date(),H,B=C.Body.RecordArray;if(typeof B==="string"){C.Body.RecordArray=[C.Body.RecordArray]}for(y in B){v=null;try{v=window.atob(B[y])}catch(w){}if(v!=null){H=ReadIntX(v,0);if((H>0)&&(H<4294967295)){I={DeviceAddress:v.charCodeAt(4),EventSensorType:v.charCodeAt(5),EventType:v.charCodeAt(6),EventOffset:v.charCodeAt(7),EventSourceType:v.charCodeAt(8),EventSeverity:v.charCodeAt(9),SensorNumber:v.charCodeAt(10),Entity:v.charCodeAt(11),EntityInstance:v.charCodeAt(12),EventData:[],Time:new Date((H+(F.getTimezoneOffset()*60))*1000)};for(z=13;z<21;z++){I.EventData.push(v.charCodeAt(z))}I.EntityStr=o[I.Entity];I.Desc=j(I.EventSensorType,I.EventOffset,I.EventData,I.Entity);if(!I.EntityStr){I.EntityStr="Unknown"}u.push(I)}}}if(C.Body.NoMoreRecords!=true){s.AMT_MessageLog_GetRecords(C.Body.IterationIdentifier,390,l,[G[0],u,G[2]])}else{G[0](s,u,G[2])}}var e="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split("|");var q="Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|User-initiated system setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split("|");var o="Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split("|");s.RealmNames="||Redirection|PT Administration|Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split("|");s.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(x,w,v,u){if(x==15){if(v[0]==235){return"Invalid Data"}if(w==0){return p[v[1]]}return q[v[1]]}if(x==18&&v[0]==170){return"Agent watchdog "+char2hex(v[4])+char2hex(v[3])+char2hex(v[2])+char2hex(v[1])+"-"+char2hex(v[6])+char2hex(v[5])+"-... changed to "+s.WatchdogCurrentStates[v[7]]}if(x==6){return"Authentication failed "+(v[1]+(v[2]<<8))+" times. The system may be under attack."}if(x==30){return"No bootable media"}if(x==32){return"Operating system lockup or power interrupt"}if(x==35){return"System boot failure"}if(x==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+x}return s}var md5_k=[];for(var i=0;i<64;){md5_k[i]=0|(Math.abs(Math.sin(++i))*4294967296)}function hex_md5(p){var g,k,l,o,r=[],q=unescape(encodeURI(p)),e=q.length,m=[g=1732584193,k=-271733879,~g,~k],n=0;for(;n<=e;){r[n>>2]|=(q.charCodeAt(n)||128)<<8*(n++%4)}r[p=(e+8>>6)*16+14]=e*8;n=0;for(;n >4])+(md5_k[o]+(r[[o,5*o+1,3*o+5,7*o][e]%16+n]|0))))<<(e=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*e+o++%4])|l>>>32-e)),g,k]}for(o=4;o;){m[--o]=m[o]+e[o]}}p="";for(;o<32;){p+=((m[o>>3]>>((1^o++&7)*4))&15).toString(16)}return p}function rstr_md5(a){return hex2rstr(hex_md5(a))}function execArgumentsToXml(c){if(c===undefined||c===null){return null}var d="";for(var b in c){var a=c[b];if(!a){continue}if(a.__parameterType==="reference"){d+=referenceToXml(b,a)}else{d+=instanceToXml(b,a)}}return d}function instanceToXml(d,c){if(c===undefined||c===null){return null}var b=!!c.__namespace;var j=b?"";for(var g in c){if(!c.hasOwnProperty(g)||g.indexOf("__")===0){continue}if(typeof c[g]==="function"||Array.isArray(c[g])){continue}if(typeof c[g]==="object"){console.error("only convert one level down...")}else{h+=j+g+">"+c[g].toString()+a+g+">"}}h+="";return h}function referenceToXml(b,a){if(a===undefined||a===null){return null}var c="/wsman "+a.__resourceUri+" ";for(var d in a){if(!a.hasOwnProperty(d)||d.indexOf("__")===0){continue}if(typeof a[d]==="function"||typeof a[d]==="object"||Array.isArray(a[d])){continue}c+=''+a[d].toString()+" "}c+=" ";return c}function GetSidString(c){var b="S-"+c.charCodeAt(0)+"-"+c.charCodeAt(7);for(var a=2;a<(c.length/4);a++){b+="-"+ReadIntX(c,a*4)}return b}function GetSidByteArray(d){if(!d||d==null){return null}var c=d.split("-");if(c.length<4||(c[0]!="s"&&c[0]!="S")){return null}for(var a=1;a=1){var p=0;switch(g.amtaccumulator.charCodeAt(0)){case 17:if(g.amtaccumulator.length<4){return}var L=g.amtaccumulator.charCodeAt(1);switch(L){case 0:if(g.amtaccumulator.length<13){return}var C=g.amtaccumulator.charCodeAt(12);if(g.amtaccumulator.length<13+C){return}g.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));p=(13+C);break;default:g.Stop(1);break}break;case 20:if(g.amtaccumulator.length<9){return}var k=ReadIntX(g.amtaccumulator,5);if(g.amtaccumulator.length<9+k){return}var K=g.amtaccumulator.charCodeAt(1);var l=g.amtaccumulator.charCodeAt(4);var h=[];for(x=0;x=0){g.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(g.user.length+g.authuri.length+8)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0,0))}else{if(h.indexOf(3)>=0){g.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(g.user.length+g.authuri.length+7)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0))}else{if(h.indexOf(1)>=0){g.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(g.user.length+g.pass.length+2)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(g.pass.length)+g.pass)}else{g.Stop(2)}}}}else{if((l==3||l==4)&&K==1){var s=0;var G=j.charCodeAt(s);var F=j.substring(s+1,s+1+G);s+=(G+1);var B=j.charCodeAt(s);var A=j.substring(s+1,s+1+B);s+=(B+1);var E=0;var D=null;var q=g.xxRandomNonce(32);var J="00000002";var v="";if(l==4){E=j.charCodeAt(s);D=j.substring(s+1,s+1+E);s+=(E+1);v=J+":"+q+":"+D+":"}var u=hex_md5(hex_md5(g.user+":"+F+":"+g.pass)+":"+A+":"+v+hex_md5("POST:"+g.authuri));var M=g.user.length+F.length+A.length+g.authuri.length+q.length+J.length+u.length+7;if(l==4){M+=(D.length+1)}var n=String.fromCharCode(19,0,0,0,l)+IntToStrX(M)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(F.length)+F+String.fromCharCode(A.length)+A+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(q.length)+q+String.fromCharCode(J.length)+J+String.fromCharCode(u.length)+u;if(l==4){n+=(String.fromCharCode(D.length)+D)}g.xxSend(n)}else{if(K==0){if(g.protocol==1){var z=10000;var O=100;var N=0;var I=10000;var H=100;var w=0;g.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(g.amtsequence++)+ShortToStrX(z)+ShortToStrX(O)+ShortToStrX(N)+ShortToStrX(I)+ShortToStrX(H)+ShortToStrX(w)+IntToStrX(0))}if(g.protocol==2){g.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0))}if(g.protocol==3){g.connectstate=1;g.xxStateChange(3)}}else{g.Stop(3)}}}break;case 33:if(g.amtaccumulator.length<23){break}p=23;g.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(g.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));if(g.protocol==1){g.amtkeepalivetimer=setInterval(g.xxSendAmtKeepAlive,2000)}g.connectstate=1;g.xxStateChange(3);break;case 41:if(g.amtaccumulator.length<10){break}p=10;break;case 42:if(g.amtaccumulator.length<10){break}var r=(10+((g.amtaccumulator.charCodeAt(9)&255)<<8)+(g.amtaccumulator.charCodeAt(8)&255));if(g.amtaccumulator.length8){g.m.ProcessData(g.amtaccumulator.substring(8))}p=g.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+g.amtaccumulator.charCodeAt(0)+" acclen="+g.amtaccumulator.length);g.Stop(4);return}if(p==0){return}g.amtaccumulator=g.amtaccumulator.substring(p)}};g.xxSend=function(k){if(g.socket!=null&&g.socket.readyState==WebSocket.OPEN){if(g.debugmode==1){console.log("Send",k)}var h=new Uint8Array(k.length);for(var j=0;j0){var q=0;if(o.state==0&&o.acc.length>=12){q=12;o.state=1;o.send("RFB 003.008\n")}else{if(o.state==1&&o.acc.length>=1){q=o.acc.charCodeAt(0)+1;o.send(String.fromCharCode(1));o.state=2}else{if(o.state==2&&o.acc.length>=4){q=4;if(ReadInt(o.acc,0)!=0){return o.Stop()}o.send(String.fromCharCode(1));o.state=3}else{if(o.state==3&&o.acc.length>=24){var D=ReadInt(o.acc,20);if(o.acc.length<24+D){return}q=24+D;o.canvas.canvas.width=o.rwidth=o.width=o.ScreenWidth=ReadShort(o.acc,0);o.canvas.canvas.height=o.rheight=o.height=o.ScreenHeight=ReadShort(o.acc,2);var G="";if(o.useZRLE){G+=IntToStr(16)}G+=IntToStr(0);G+=IntToStr(1092);o.send(String.fromCharCode(2,0)+ShortToStr((G.length/4)+1)+G+IntToStr(-223));if(o.bpp==1){o.send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0))}o.state=4;o.parent.xxStateChange(3);h();if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(o.state==4){switch(o.acc.charCodeAt(0)){case 0:if(o.acc.length<4){return}o.state=100+ReadShort(o.acc,2);q=4;break;case 2:q=1;break;case 3:if(o.acc.length<8){return}var C=ReadInt(o.acc,4)+8;if(o.acc.length100&&o.acc.length>=12){var I=ReadShort(o.acc,0),K=ReadShort(o.acc,2),H=ReadShort(o.acc,4),A=ReadShort(o.acc,6),F=H*A,z=ReadInt(o.acc,8);if(z<17){if(H<1||H>64||A<1||A>64){console.log("Invalid tile size ("+H+","+A+"), disconnecting.");return o.Stop()}if(o.sparew!=H||o.spareh!=A){o.sparew=o.sparew2=H;o.spareh=o.spareh2=A;var J=o.sparew2+"x"+o.spareh2;o.spare=o.sparecache[J];if(!o.spare){o.sparecache[J]=o.spare=o.canvas.createImageData(o.sparew2,o.spareh2)}}}if(z==4294967073){o.canvas.canvas.width=o.rwidth=o.width=H;o.canvas.canvas.height=o.rheight=o.height=A;o.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height));q=12;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(z==0){var E=12,r=12+(F*o.bpp);if(o.acc.length5&&o.acc.charCodeAt(E)==0&&ReadShortX(o.acc,E+1)==(u-v)){a(o.acc,E+5,I,K,H,A,F,u)}q=16+u}else{o.Debug("Unknown Encoding: "+z);return o.Stop()}}}if(--o.state==100){o.state=4;if(o.frameRateDelay==0){h()}else{setTimeout(h,o.frameRateDelay)}}}}}}}}if(q==0){return}o.acc=o.acc.substring(q)}};function a(t,C,K,L,J,w,G,u){var H=t.charCodeAt(C++),A,I,F,B={},D=0,E=0,z;if(H==0){for(z=0;z>8)&248)+","+((I>>3)&252)+","+((I&31)<<3)))+")";o.canvas.fillRect(K,L,J,w)}else{if(H>1&&H<17){var r=4,q=15;for(z=0;z=0;z-=r){j(B[(I>>z)&q],D++)}}g(o.spare,K,L)}else{if(H==128){while(D=0){j(I,D++)}}g(o.spare,K,L)}else{if(H>129){for(z=0;z<(H-128);z++){B[z]=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0)}while(D127){do{E+=(F=t.charCodeAt(C++))}while(F==255)}while(--E>=0){j(I,D++)}}g(o.spare,K,L)}}}}}}o.hold=function(q){if(o.holding==q){return}o.holding=q;o.canvas.fillStyle="#000000";o.canvas.fillRect(0,0,o.width,o.height);if(o.holding==false){if((o.canvas.canvas.width!=o.width)||(o.canvas.canvas.height!=o.height)){o.canvas.canvas.width=o.width;o.canvas.canvas.height=o.height;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}o.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height))}else{o.UnGrabMouseInput();o.UnGrabKeyInput()}};function g(q,r,s){if(o.holding==true){return}o.canvas.putImageData(q,r,s)}function j(s,q){var r=q*4;if(o.bpp==1){o.spare.data[r++]=s&224;o.spare.data[r++]=(s&28)<<3;o.spare.data[r++]=b((s&3)<<6)}else{o.spare.data[r++]=(s>>8)&248;o.spare.data[r++]=(s>>3)&252;o.spare.data[r++]=(s&31)<<3}o.spare.data[r]=255}function b(q){return(q>127)?(q+32):q}function h(){if(o.holding==true){return}o.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(o.rwidth)+ShortToStr(o.rheight))}o.Start=function(){o.state=0;o.acc="";o.ZRLEfirst=1;o.onKvmDataPending=[];o.onKvmDataAck=-1;o.kvmDataSupported=false;for(var q in o.sparecache){delete o.sparecache[q]}};o.Stop=function(){o.UnGrabMouseInput();o.UnGrabKeyInput();o.parent.Stop()};o.send=function(q){o.parent.send(q)};var l={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};function k(q){if(q.code.startsWith("Key")&&q.code.length==4){return q.code.charCodeAt(3)+((q.shiftKey==false)?32:0)}if(q.code.startsWith("Digit")&&q.code.length==6){return q.code.charCodeAt(5)}if(q.code.startsWith("Numpad")&&q.code.length==7){return q.code.charCodeAt(6)}return l[q.code]}function c(q,r){if(!r){r=window.event}if(r.code&&(o.localKeyMap==false)){var s=k(r);if(s!=null){o.sendkey(s,q)}}else{var s=r.keyCode,t=s;if(r.shiftKey==false&&s>=65&&s<=90){t=s+32}if(s>=112&&s<=124){t=s+65358}if(s==8){t=65288}if(s==9){t=65289}if(s==13){t=65293}if(s==16){t=65505}if(s==17){t=65507}if(s==18){t=65513}if(s==27){t=65307}if(s==33){t=65365}if(s==34){t=65366}if(s==35){t=65367}if(s==36){t=65360}if(s==37){t=65361}if(s==38){t=65362}if(s==39){t=65363}if(s==40){t=65364}if(s==45){t=65379}if(s==46){t=65535}if(s>=96&&s<=105){t=s-48}if(s==106){t=42}if(s==107){t=43}if(s==109){t=45}if(s==110){t=46}if(s==111){t=47}if(s==186){t=59}if(s==187){t=61}if(s==188){t=44}if(s==189){t=45}if(s==190){t=46}if(s==191){t=47}if(s==192){t=96}if(s==219){t=91}if(s==220){t=92}if(s==221){t=93}if(s==222){t=39}o.sendkey(t,q)}return o.haltEvent(r)}o.sendkey=function(s,q){if(typeof s=="object"){for(var r in s){o.sendkey(s[r][0],s[r][1])}}else{o.send(String.fromCharCode(4,q,0,0)+IntToStr(s))}};function n(q){if(q.length<8){return 0}var s=ReadInt(o.acc,4)+8;if(q.length=16)&&(r.substring(0,15)=="\0KvmDataChannel")){if(o.kvmDataSupported==false){o.kvmDataSupported=true;console.log("KVM Data Channel Supported.")}if(((o.onKvmDataAck==-1)&&(r.length==16))||(r.charCodeAt(15)!=0)){o.onKvmDataAck=true}if(r.length>=16){o.onKvmData(r.substring(16))}if((o.onKvmDataAck==true)&&(o.onKvmDataPending.length>0)){o.sendKvmData(o.onKvmDataPending.shift())}}}return s}o.sendKvmData=function(q){if(o.onKvmDataAck!==true){o.onKvmDataPending.push(q)}else{q="\0KvmDataChannel\0"+q;o.send(String.fromCharCode(6,0,0,0)+IntToStr(q.length)+q);o.onKvmDataAck=false}};o.sendKeepAlive=function(){if(o.lastKeepAlive=1;aL--){if(av[aL]!=0){break}}if(aQ>aL){aQ=aL}if(aL==0){aC={op:64,bits:1,val:0};aS[aU++]=aC;aS[aU++]=aC;if(aV==u){aR.distbits=1}else{aR.lenbits=1}aR.next=aU;return 0}for(aN=1;aN0&&(aV==h||aL!=1)){aR.next=aU;return -1}aP[1]=0;for(aG=1;aG=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}for(;;){aC={op:0,bits:aG-ax,val:0};if(aX[aT]ay){aC.op=az[aA+aX[aT]];aC.val=aq[ar+aX[aT]]}else{aC.op=32+64}}aE=1<<(aG-ax);aB=1<>>ax)+aB]=aC}while(aB!=0);aE=1<<(aG-1);while(aD&aE){aE>>>=1}if(aE!=0){aD&=aE-1;aD+=aE}else{aD=0}aT++;if(--(av[aG])==0){if(aG==aL){break}aG=aH[aI+aX[aT]]}if(aG>aQ&&(aD&aK)!=aJ){if(ax==0){ax=aQ}aO+=aN;aw=aG-ax;aF=(1<=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}aJ=aD&aK;aS[aU+aJ]={op:aw,bits:aQ,val:aO-aU}}}if(aD!=0){aS[aO+aD]={op:64,bits:aG-ax,val:0}}aR.next=aU+aW;if(aV==u){aR.distbits=aQ}else{aR.lenbits=aQ}return 0}function H(aN,aL){var aM;var aC;var aI;var aD;var aK;var aq;var ax;var aR;var aO;var aQ;var aP;var aB;var ar;var at;var aE;var au;var aH;var aw;var aA;var aJ;var aF;var av;var az=-1;var ay=-1;aM=aN.state;aC=aN.input_data;aI=aN.next_in;aD=aI+aN.avail_in-5;aK=aN.next_out;aq=aK-(aL-aN.avail_out);ax=aK+(aN.avail_out-257);aR=aM.wsize;aO=aM.whave;aQ=aM.wnext;aP=aM.window;aB=aM.hold;ar=aM.bits;at=aM.codes;aE=aM.lencode;au=aM.distcode;aH=(1<>>=aJ;ar-=aJ;aJ=aA.op;if(aJ==0){aN.output_data+=String.fromCharCode(aA.val);aK++}else{if(aJ&16){aF=aA.val;aJ&=15;if(aJ){if(ar>>=aJ;ar-=aJ}if(ar<15){aB+=(aC.charCodeAt(aI++)&255)<>>=aJ;ar-=aJ;aJ=aA.op;if(aJ&16){av=aA.val;aJ&=15;if(ar>>=aJ;ar-=aJ;aJ=aK-aq;if(av>aJ){aJ=av-aJ;if(aJ>aO){if(aM.sane){aN.msg="invalid distance too far back";aM.mode=a;break loop}}az=0;ay=-1;if(aQ==0){az+=aR-aJ;if(aJ=0){aN.output_data+=aP.substring(az,az+aF);aK+=aF;az+=aF}else{var aG=aF;if(aG>aK-ay){aG=aK-ay}aN.output_data+=aN.output_data.substring(ay,ay+aG);aK+=aG;aF-=aG;ay+=aG;aK+=aF;while(aF>2){aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aF-=3}if(aF){aN.output_data+=aN.output_data.charAt(ay++);if(aF>1){aN.output_data+=aN.output_data.charAt(ay++)}}}}else{if((aJ&64)==0){aA=at[au+(aA.val+(aB&((1<>>3;aI-=aF;ar-=aF<<3;aB&=(1<>>4)+1;if(at<48){at&=15}}if(au==1&&(typeof ZLIB.adler32==="function")){ar.checksum_function=ZLIB.adler32}else{if(au==2&&(typeof ZLIB.crc32==="function")){ar.checksum_function=ZLIB.crc32}else{ar.checksum_function=e}}if(at&&(at<8||at>15)){return ZLIB.Z_STREAM_ERROR}if(aq.window&&aq.wbits!=at){aq.window=null}aq.wrap=au;aq.wbits=at;aq.wsize=0;aq.whave=0;aq.wnext=0;return ZLIB.inflateResetKeep(ar)};ZLIB.inflateInit=function(ar){var aq=new ZLIB.z_stream();aq.state=new J();ZLIB.inflateReset(aq,ar);return aq};ZLIB.inflatePrime=function(at,aq,au){var ar;if(!at||!at.state){return ZLIB.Z_STREAM_ERROR}ar=at.state;if(aq<0){ar.hold=0;ar.bits=0;return ZLIB.Z_OK}if(aq>16||ar.bits+aq>32){return ZLIB.Z_STREAM_ERROR}au&=(1<=ar.wsize){ar.window=at.output_data.substring(aq-ar.wsize)}else{if(ar.whave+aq>>8)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,2)}function n(ar,at){var aq=[at&255,(at>>>8)&255,(at>>>16)&255,(at>>>24)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,4)}function Z(ar,aq){aq.strm=ar;aq.left=ar.avail_out;aq.next=ar.next_in;aq.have=ar.avail_in;aq.hold=ar.state.hold;aq.bits=ar.state.bits;return aq}function ah(aq){var ar=aq.strm;ar.next_in=aq.next;ar.avail_out=aq.left;ar.avail_in=aq.have;ar.state.hold=aq.hold;ar.state.bits=aq.bits}function P(aq){aq.hold=0;aq.bits=0}function ag(aq){if(aq.have==0){return false}aq.have--;aq.hold+=(aq.strm.input_data.charCodeAt(aq.next++)&255)<>>=aq;ar.bits-=aq}function c(aq){aq.hold>>>=aq.bits&7;aq.bits-=aq.bits&7}function ai(aq){return((aq>>>24)&255)+((aq>>>8)&65280)+((aq&65280)<<8)+((aq&255)<<24)}var I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(aD,at){var aC;var aB;var aq,az;var ar;var av=-1;var au=-1;var aw;var ax;var ay;var aA;if(!aD||!aD.state||(!aD.input_data&&aD.avail_in!=0)){return ZLIB.Z_STREAM_ERROR}aC=aD.state;if(aC.mode==an){aC.mode=ao}aB={};Z(aD,aB);aq=aB.have;az=aB.left;aA=ZLIB.Z_OK;inf_leave:for(;;){switch(aC.mode){case G:if(aC.wrap==0){aC.mode=ao;break}if(!ad(aB,16)){break inf_leave}if((aC.wrap&2)&&aB.hold==35615){aC.check=aD.checksum_function(0,null,0,0);m(aD,aB.hold);P(aB);aC.mode=D;break}aC.flags=0;if(aC.head!==null){aC.head.done=-1}if(!(aC.wrap&1)||((b(aB,8)<<8)+(aB.hold>>>8))%31){aD.msg="incorrect header check";aC.mode=a;break}if(b(aB,4)!=ZLIB.Z_DEFLATED){aD.msg="unknown compression method";aC.mode=a;break}w(aB,4);ay=b(aB,4)+8;if(aC.wbits==0){aC.wbits=ay}else{if(ay>aC.wbits){aD.msg="invalid window size";aC.mode=a;break}}aC.dmax=1<>>8)&1}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=am;case am:if(!ad(aB,32)){break inf_leave}if(aC.head!==null){aC.head.time=aB.hold}if(aC.flags&512){n(aD,aB.hold)}P(aB);aC.mode=af;case af:if(!ad(aB,16)){break inf_leave}if(aC.head!==null){aC.head.xflags=aB.hold&255;aC.head.os=aB.hold>>>8}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=A;case A:if(aC.flags&1024){if(!ad(aB,16)){break inf_leave}aC.length=aB.hold;if(aC.head!==null){aC.head.extra_len=aB.hold}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.head.extra=""}else{if(aC.head!==null){aC.head.extra=null}}aC.mode=B;case B:if(aC.flags&1024){ar=aC.length;if(ar>aB.have){ar=aB.have}if(ar){if(aC.head!==null&&aC.head.extra!==null){ay=aC.head.extra_len-aC.length;aC.head.extra+=aD.input_data.substring(aB.next,aB.next+(ay+ar>aC.head.extra_max?aC.head.extra_max-ay:ar))}if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;aC.length-=ar}if(aC.length){break inf_leave}}aC.length=0;aC.mode=ac;case ac:if(aC.flags&2048){if(aB.have==0){break inf_leave}if(aC.head!==null&&aC.head.name===null){aC.head.name=""}ar=0;do{ay=aD.input_data.charAt(aB.next+ar);ar++;if(ay==="\0"){break}if(aC.head!==null&&aC.length>>9)&1;aC.head.done=1}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;break;case q:if(!ad(aB,32)){break inf_leave}aD.adler=aC.check=ai(aB.hold);P(aB);aC.mode=p;case p:if(aC.havedict==0){ah(aB);return ZLIB.Z_NEED_DICT}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;case an:if(at==ZLIB.Z_BLOCK||at==ZLIB.Z_TREES){break inf_leave}case ao:if(aC.last){c(aB);aC.mode=d;break}if(!ad(aB,3)){break inf_leave}aC.last=b(aB,1);w(aB,1);switch(b(aB,2)){case 0:aC.mode=aj;break;case 1:C(aC);aC.mode=S;if(at==ZLIB.Z_TREES){w(aB,2);break inf_leave}break;case 2:aC.mode=al;break;case 3:aD.msg="invalid block type";aC.mode=a}w(aB,2);break;case aj:c(aB);if(!ad(aB,32)){break inf_leave}if((aB.hold&65535)!=(((aB.hold>>>16)&65535)^65535)){aD.msg="invalid stored block lengths";aC.mode=a;break}aC.length=aB.hold&65535;P(aB);aC.mode=l;if(at==ZLIB.Z_TREES){break inf_leave}case l:aC.mode=k;case k:ar=aC.length;if(ar){if(ar>aB.have){ar=aB.have}if(ar>aB.left){ar=aB.left}if(ar==0){break inf_leave}aD.output_data+=aD.input_data.substring(aB.next,aB.next+ar);aD.next_out+=ar;aB.have-=ar;aB.next+=ar;aB.left-=ar;aC.length-=ar;break}aC.mode=an;break;case al:if(!ad(aB,14)){break inf_leave}aC.nlen=b(aB,5)+257;w(aB,5);aC.ndist=b(aB,5)+1;w(aB,5);aC.ncode=b(aB,4)+4;w(aB,4);if(aC.nlen>286||aC.ndist>30){aD.msg="too many length or distance symbols";aC.mode=a;break}aC.have=0;aC.mode=W;case W:while(aC.haveaC.nlen+aC.ndist){aD.msg="invalid bit length repeat";aC.mode=a;break}while(ar--){aC.lens[aC.have++]=ay}}}if(aC.mode==a){break}if(aC.lens[256]==0){aD.msg="invalid code -- missing end-of-block";aC.mode=a;break}aC.next=0;aC.lencode=aC.next;aC.lenbits=9;aA=K(aC,X);if(aA){aD.msg="invalid literal/lengths set";aC.mode=a;break}aC.distcode=aC.next;aC.distbits=6;aA=K(aC,u);if(aA){aD.msg="invalid distances set";aC.mode=a;break}aC.mode=S;if(at==ZLIB.Z_TREES){break inf_leave}case S:aC.mode=R;case R:if(aB.have>=6&&aB.left>=258){ah(aB);H(aD,az);Z(aD,aB);if(aC.mode==an){aC.back=-1}break}aC.back=0;for(;;){aw=aC.codes[aC.lencode+b(aB,aC.lenbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if(aw.op&&(aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.lencode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if(ax.bits+aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;aC.length=aw.val;if(aw.op==0){aC.mode=Y;break}if(aw.op&32){aC.back=-1;aC.mode=an;break}if(aw.op&64){aD.msg="invalid literal/length code";aC.mode=a;break}aC.extra=aw.op&15;aC.mode=T;case T:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.length+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.was=aC.length;aC.mode=r;case r:for(;;){aw=aC.codes[aC.distcode+b(aB,aC.distbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if((aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.distcode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if((ax.bits+aw.bits)<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;if(aw.op&64){aD.msg="invalid distance code";aC.mode=a;break}aC.offset=aw.val;aC.extra=aw.op&15;aC.mode=s;case s:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.offset+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.mode=aa;case aa:if(aB.left==0){break inf_leave}ar=az-aB.left;if(aC.offset>ar){ar=aC.offset-ar;if(ar>aC.whave){if(aC.sane){aD.msg="invalid distance too far back";aC.mode=a;break}}if(ar>aC.wnext){ar-=aC.wnext;av=aC.wsize-ar;au=-1}else{av=aC.wnext-ar;au=-1}if(ar>aC.length){ar=aC.length}}else{av=-1;au=aD.next_out-aC.offset;ar=aC.length}if(ar>aB.left){ar=aB.left}aB.left-=ar;aC.length-=ar;if(av>=0){aD.output_data+=aC.window.substring(av,av+ar);aD.next_out+=ar;ar=0}else{aD.next_out+=ar;do{aD.output_data+=aD.output_data.charAt(au++)}while(--ar)}if(aC.length==0){aC.mode=R}break;case Y:if(aB.left==0){break inf_leave}aD.output_data+=String.fromCharCode(aC.length);aD.next_out++;aB.left--;aC.mode=R;break;case d:if(aC.wrap){if(!ad(aB,32)){break inf_leave}az-=aB.left;aD.total_out+=az;aC.total+=az;if(az){aD.adler=aC.check=aD.checksum_function(aC.check,aD.output_data,aD.output_data.length-az,az)}az=aB.left;if((aC.flags?aB.hold:ai(aB.hold))!=aC.check){aD.msg="incorrect data check";aC.mode=a;break}P(aB)}aC.mode=V;case V:if(aC.wrap&&aC.flags){if(!ad(aB,32)){break inf_leave}if(aB.hold!=(aC.total&4294967295)){aD.msg="incorrect length check";aC.mode=a;break}P(aB)}aC.mode=v;case v:aA=ZLIB.Z_STREAM_END;break inf_leave;case a:aA=ZLIB.Z_DATA_ERROR;break inf_leave;case ab:return ZLIB.Z_MEM_ERROR;case ak:default:return ZLIB.Z_STREAM_ERROR}}inf_leave:ah(aB);if(aC.wsize||(az!=aD.avail_out&&aC.mode=0?aq:ar);this.output_data="";this.next_out=0;this.error=ZLIB.inflate(this,at);if(aq>=0){return this.output_data}aw+=this.output_data;if(this.avail_out>0){break}}while(this.error==ZLIB.Z_OK);return aw};ZLIB.z_stream.prototype.inflateReset=function(aq){return ZLIB.inflateReset(this,aq)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js")}(function(){var c=65521;var d=5552;function b(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g.charCodeAt(k)&255;if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g.charCodeAt(k++)&255;l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(h--){e+=g.charCodeAt(k++)&255;l+=e}e%=c;l%=c}return e|(l<<16)}function a(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g[k];if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g[k++];l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(h--){e+=g[k++];l+=e}e%=c;l%=c}return e|(l<<16)}ZLIB.adler32=function(e,g,j,h){if(typeof g==="string"){return b(e,g,j,h)}else{return a(e,g,j,h)}};ZLIB.adler32_combine=function(e,g,h){var k;var l;var j;if(h<0){return 4294967295}h%=c;j=h;k=e&65535;l=j*k;l%=c;k+=(g&65535)+c-1;l+=((e>>16)&65535)+((g>>16)&65535)+c-j;if(k>=c){k-=c}if(k>=c){k-=c}if(l>=(c<<1)){l-=(c<<1)}if(l>=c){l-=c}return k|(l<<16)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js")}(function(){var a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function c(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h.charCodeAt(l++))&255]^(j>>>8)}while(--k)}return j^4294967295}function b(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h[l++])&255]^(j>>>8)}while(--k)}return j^4294967295}ZLIB.crc32=function(j,h,l,k){if(typeof h==="string"){return c(j,h,l,k)}else{return b(j,h,l,k)}};var d=32;function g(h,l){var k;var j=0;k=0;while(l){if(l&1){k^=h[j]}l>>=1;j++}return k}function e(k,h){var j;for(j=0;j>=1;if(l==0){break}e(o,k);if(l&1){h=g(o,h)}l>>=1}while(l!=0);h^=j;return h}}());"use strict";var debugLevel=parseInt("{{{debuglevel}}}");var features=parseInt("{{{features}}}");var sessionTime=parseInt("{{{sessiontime}}}");var domain="{{{domain}}}";var domainUrl="{{{domainurl}}}";var authCookie="{{{authCookie}}}";var meshserver=null;var xdr=null;var serverinfo=null;var nodes=[];var meshes={};var filetree={};var userinfo=null;var serverinfo=null;var users=null;var nodeShortIdent=0;var serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}";var debugmode=false;var attemptWebRTC=((features&128)!=0);var StatusStrs=["Disconnected","Connecting...","Setup...","Connected","Intel® AMT Connected"];var files;var passRequirements="{{{passRequirements}}}";if(passRequirements!=""){passRequirements=JSON.parse(decodeURIComponent(passRequirements))}function startup(){if((features&32)==0){var b=null;try{b=top.location.toString().toLowerCase()}catch(a){}if(top!=self&&(b==null||top.active==false)){top.location=self.location;return}}window.onresize=center;center();QH("p1message","Connecting...");go(1);meshserver=MeshServerCreateControl(domainUrl,authCookie);meshserver.onStateChanged=onStateChanged;meshserver.onMessage=onMessage;meshserver.Start();var c=localStorage.getItem("desktopsettings");if(c!=null){desktopsettings=JSON.parse(c)}applyDesktopSettings()}function onStateChanged(c,d,b,a){if(d==0){setDialogMode(0);go(0);if(a=="noauth"){QH("p0span","Unable to perform authentication");return}if(b==2){setTimeout(serverPoll,5000)}else{QH("p0span","Unable to connect web socket")}}else{if(d==2){meshserver.send({action:"meshes"});meshserver.send({action:"nodes"});meshserver.send({action:"files"});if(xxcurrentView<2){go(2)}}}QV("topMenuIcon",d==2)}function serverPoll(){xdr=null;try{xdr=new XDomainRequest()}catch(a){}if(!xdr){xdr=new XMLHttpRequest()}xdr.open("HEAD",window.location.href);xdr.timeout=15000;xdr.onload=function(){reload()};xdr.onerror=xdr.ontimeout=function(){setTimeout(serverPoll,10000)};xdr.send()}function updateSelf(){QV("verifyEmailId",(userinfo.emailVerified!==true)&&(userinfo.email!=null)&&(serverinfo.emailcheck==true));QV("manageAuthApp",features&4096);QV("manageOtp",((features&4096)!=0)&&((userinfo.otpsecret==1)||(userinfo.otphkeys>0)));QV("p3createMeshLink1",false);QV("p3createMeshLink2",false);if(typeof userinfo.passchange=="number"){if(userinfo.passchange==-1){QH("p2nextPasswordUpdateTime"," - Reset on next login.")}else{if((passRequirements!=null)&&(typeof passRequirements.reset=="number")){var a=(userinfo.passchange)+(passRequirements.reset*86400)-Math.floor(Date.now()/1000);if(a<0){QH("p2nextPasswordUpdateTime"," - Reset on next login.")}else{if(a<3600){QH("p2nextPasswordUpdateTime"," - Reset in "+Math.floor(a/60)+" minute"+addLetterS(Math.floor(a/60))+".")}else{if(a<86400){QH("p2nextPasswordUpdateTime"," - Reset in "+Math.floor(a/3600)+" hour"+addLetterS(Math.floor(a/3600))+".")}else{QH("p2nextPasswordUpdateTime"," - Reset in "+Math.floor(a/86400)+" day"+addLetterS(Math.floor(a/86400))+".")}}}}}}}function addLetterS(a){return(a>1)?"s":""}function onMessage(s,e){switch(e.action){case"serverinfo":serverinfo=e.serverinfo;QV("p3AccountActions",((features&4)==0)&&(serverinfo.domainauth==false));QV("logoutMenuOption",((features&4)==0)&&(serverinfo.domainauth==false));break;case"userinfo":userinfo=e.userinfo;QH("p3userName",userinfo.name);updateSelf();break;case"users":users={};for(var d in e.users){users[e.users[d]._id]=e.users[d]}updateUsers();break;case"wssessioncount":wssessions=e.wssessions;updateUsers();break;case"meshes":meshes={};for(var d in e.meshes){meshes[e.meshes[d]._id]=e.meshes[d]}updateMeshes();updateDevices();break;case"files":filetree=setupBackPointers(e.filetree);updateFiles();break;case"nodes":nodes=[];for(var d in e.nodes){for(var g in e.nodes[d]){if(!meshes[d]){console.log("Invalid mesh (1): "+d);continue}e.nodes[d][g].namel=e.nodes[d][g].name.toLowerCase();if(e.nodes[d][g].rname){e.nodes[d][g].rnamel=e.nodes[d][g].rname.toLowerCase()}else{e.nodes[d][g].rnamel=e.nodes[d][g].namel}e.nodes[d][g].meshnamel=meshes[d].name.toLowerCase();e.nodes[d][g].meshid=d;e.nodes[d][g].state=(e.nodes[d][g].state)?(e.nodes[d][g].state):0;e.nodes[d][g].desc=e.nodes[d][g].desc;if(!e.nodes[d][g].icon){e.nodes[d][g].icon=1}e.nodes[d][g].ident=++nodeShortIdent;nodes.push(e.nodes[d][g])}}updateDevices();if(xxcurrentView==0){if("{{viewmode}}"!=""){go(parseInt("{{viewmode}}"))}else{setDialogMode(0);go(2)}}if("{{currentNode}}"!=""){gotoDevice("{{currentNode}}",parseInt("{{viewmode}}"))}break;case"powertimeline":if(e.nodeid!=powerTimelineReq){break}powerTimelineNode=e.nodeid;powerTimeline=e.timeline;powerTimelineUpdate=Date.now()+300000;if(currentNode._id==e.nodeid){drawDeviceTimeline()}break;case"otpauth-request":if((xxdialogMode==2)&&(xxdialogTag=="otpauth-request")){var r=e.secret;if(r.length==52){r=r.split(/(.............)/).filter(Boolean).join(" ")}else{if(r.length==32){r=r.split(/(....)/).filter(Boolean).join(" ");r=r.substring(0,20)+" "+r.substring(20)}}QH("d2optinfo",'Install Google Authenticator or a compatible application, use this link or enter the secret below. Then, enter the current 6 digit token to activate 2-Step login.'+r+' Token:
');QV("idx_dlgOkButton",true);QE("idx_dlgOkButton",false);Q("d2otpauthinput").focus()}break;case"otpauth-setup":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,e.success?"2-step login activation successful . You will now need a valid token to login again.":"2-step login activation failed . Clear the secret from the application and try again. You only have a few minutes to enter the proper code.");break;case"otpauth-clear":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,e.success?"2-step login activation removed . You can reactivate this feature at any time.":"2-step login activation removal failed . Try again.");break;case"otpauth-getpasswords":if(xxdialogMode){return}var t="One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place.";t+="";if(e.passwords){var c=0;for(var a in e.passwords){if(++c%2){t+=""}var q=""+e.passwords[a].p;while(q.length<8){q="0"+q}if(e.passwords[a].u===true){t+=""+q.substring(0,4)+" "+q.substring(4)}else{t+=" "+q.substring(0,4)+" "+q.substring(4);+" "}}}else{t+=" No Active Tokens"}t+="
";t+=" ";t+=" ";if(e.passwords!=null){t+=" "}t+="
";setDialogMode(2,"Manage Backup Codes",8,null,t,"otpauth-manage");break;case"event":switch(e.event.action){case"accountchange":if(userinfo.name==e.event.account.name){var k=e.event.account.siteadmin?e.event.account.siteadmin:0;var o=userinfo.siteadmin?userinfo.siteadmin:0;if((e.event.account.quota!=userinfo.quota)||(((userinfo.siteadmin&8)==0)&&((e.event.account.siteadmin&8)!=0))){meshserver.send({action:"files"})}userinfo=e.event.account;if(o!=k){updateSiteAdmin()}updateSelf()}break;case"createmesh":if(e.event.links[userinfo._id]!=null){meshes[e.event.meshid]={_id:e.event.meshid,name:e.event.name,mtype:e.event.mtype,desc:e.event.desc,links:e.event.links};updateMeshes();updateDevices();meshserver.send({action:"files"})}break;case"meshchange":if(meshes[e.event.meshid]==null){meshes[e.event.meshid]={_id:e.event.meshid,name:e.event.name,mtype:e.event.mtype,desc:e.event.desc,links:e.event.links};meshserver.send({action:"nodes"})}else{meshes[e.event.meshid].name=e.event.name;meshes[e.event.meshid].desc=e.event.desc;meshes[e.event.meshid].links=e.event.links;if(meshes[e.event.meshid].links[userinfo._id]==null){if((xxcurrentView==20)&&(currentMesh==meshes[e.event.meshid])){go(2)}delete meshes[e.event.meshid];var h=[];for(var a in nodes){if(nodes[a].meshid!=e.event.meshid){h.push(nodes[a])}}nodes=h;if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==e.event.meshid){setDialogMode(0);go(2)}}}updateMeshes();updateDevices();meshserver.send({action:"files"});if(xxcurrentView==20&¤tMesh._id==e.event.meshid){p20updateMesh()}break;case"deletemesh":if(meshes[e.event.meshid]){delete meshes[e.event.meshid];updateMeshes();meshserver.send({action:"files"})}var h=[];for(var a in nodes){if(nodes[a].meshid!=e.event.meshid){h.push(nodes[a])}}nodes=h;updateDevices();if(xxcurrentView>=20&&xxcurrentView<30&¤tMesh._id==e.event.meshid){setDialogMode(0);go(2)}if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==e.event.meshid){setDialogMode(0);go(2)}break;case"addnode":var l=e.event.node;if(!meshes[l.meshid]){break}l.namel=l.name.toLowerCase();if(l.rname){l.rnamel=l.rname.toLowerCase()}else{l.rnamel=l.namel}l.meshnamel=meshes[l.meshid].name.toLowerCase();l.state=0;if(!l.icon){l.icon=1}l.ident=++nodeShortIdent;nodes.push(l);updateDevices();break;case"removenode":var b=-1;for(var a in nodes){if(nodes[a]._id==e.event.nodeid){b=a;break}}if(b!=-1){var l=nodes[b];if(currentNode==l){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(2)}currentNode=null}nodes.splice(b,1);updateDevices();updateMapMarkers()}break;case"changenode":var b=-1;for(var a in nodes){if(nodes[a]._id==e.event.nodeid){b=a;break}}if(b!=-1){var l=nodes[b];l.name=e.event.node.name;l.rname=e.event.node.rname;l.host=e.event.node.host;l.desc=e.event.node.desc;l.publicip=e.event.node.publicip;l.iploc=e.event.node.iploc;l.wifiloc=e.event.node.wifiloc;l.gpsloc=e.event.node.gpsloc;l.tags=e.event.node.tags;l.userloc=e.event.node.userloc;if(e.event.node.agent!=null){if(l.agent==null){l.agent={}}if(e.event.node.agent.ver!=null){l.agent.ver=e.event.node.agent.ver}if(e.event.node.agent.id!=null){l.agent.id=e.event.node.agent.id}if(e.event.node.agent.caps!=null){l.agent.caps=e.event.node.agent.caps}if(e.event.node.agent.core!=null){l.agent.core=e.event.node.agent.core}else{if(l.agent.core){delete l.agent.core}}l.agent.tag=e.event.node.agent.tag}if(e.event.node.intelamt!=null){if(l.intelamt==null){l.intelamt={}}if(e.event.node.intelamt.host!=null){l.intelamt.user=e.event.node.intelamt.host}if(e.event.node.intelamt.user!=null){l.intelamt.user=e.event.node.intelamt.user}if(e.event.node.intelamt.tls!=null){l.intelamt.tls=e.event.node.intelamt.tls}if(e.event.node.intelamt.ver!=null){l.intelamt.ver=e.event.node.intelamt.ver}if(e.event.node.intelamt.state!=null){l.intelamt.state=e.event.node.intelamt.state}}l.namel=l.name.toLowerCase();if(l.rname){l.rnamel=l.rname.toLowerCase()}else{l.rnamel=l.namel}if(e.event.node.icon){l.icon=e.event.node.icon}refreshDevice(l._id);updateDevices()}break;case"nodemeshchange":var b=-1;for(var a in nodes){if(nodes[a]._id==e.event.nodeid){b=a;break}}if(b!=-1){var l=nodes[b];if(meshes[e.event.newMeshId]==null){if(currentNode==l){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(2)}currentNode=null}nodes.splice(b,1)}else{l.meshid=e.event.newMeshId;l.meshnamel=meshes[e.event.newMeshId].name.toLowerCase()}updateDevices();refreshDevice(e.event.nodeid)}else{var l=e.event.node;if(!meshes[l.meshid]){break}l.namel=l.name.toLowerCase();if(l.rname){l.rnamel=l.rname.toLowerCase()}else{l.rnamel=l.namel}l.meshnamel=meshes[l.meshid].name.toLowerCase();l.state=0;if(!l.icon){l.icon=1}l.ident=++nodeShortIdent;if(nodes==null){}nodes.push(l);updateDevices()}break;case"nodeconnect":var b=-1;for(var a in nodes){if(nodes[a]._id==e.event.nodeid){b=a;break}}if(b!=-1){var l=nodes[b];l.conn=e.event.conn;l.pwr=e.event.pwr;updateDevices()}break;case"clearevents":break;case"login":if(users!=null&&users["user/"+domain+"/"+e.event.username.toLowerCase()]){users["user/"+domain+"/"+e.event.username.toLowerCase()].login=e.event.time}break;case"notify":break;case"stopped":break;default:break}break;default:break}}function topMenu(a){if((xxdialogMode!=null)&&(xxdialogMode!=0)&&(xxdialogMode!=999)){return}if(a===undefined){var b=(QS("topMenu").display=="none");if(b==true){if((xxdialogMode==0)||(xxdialogMode==null)){QV("topMenu",true);xxdialogMode=999}}else{QV("topMenu",false);xxdialogMode=0}}else{QV("topMenu",false);xxdialogMode=0;if((a==1)&&(xxcurrentView!=3)){goForward("account")}if((a==2)&&(xxcurrentView!=5)){goForward("files")}}}var backStack=[];function goBack(){if(xxdialogMode){return}if(backStack.length>0){backStack.pop()}goStack()}function goForward(a){if(xxdialogMode){return}backStack.push(a);goStack()}function goStack(){if(backStack.length==0){go(2);return}var a=backStack[backStack.length-1],b=a.split("/")[0];if(b=="node"){setupDeviceMenu(0);gotoDevice(a)}if(b=="mesh"){gotoMesh(a)}if(b=="account"){go(3)}if(b=="devices"){go(2)}if(b=="files"){go(5)}}function updateFooterMenu(b){while(b!=null&&b.length<3){b.push({n:""})}var d="",c="";if(b!=null){for(var a in b){d+=''+b[a].n;c=b[a].n}}QH("footerMenu"," "+d)}function account_manageAuthApp(){if(xxdialogMode||((features&4096)==0)){return}if(userinfo.otpsecret==1){account_removeOtp()}else{account_addOtp()}}function account_addOtp(){if(xxdialogMode||(userinfo.otpsecret==1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"Loading...
","otpauth-request");meshserver.send({action:"otpauth-request"})}function account_addOtpCheck(a){var b=(Q("d2otpauthinput").value.length==6);QE("idx_dlgOkButton",b);if(a&&(a.keyCode==13)&&b){dialogclose(1)}}function account_removeOtp(){if(xxdialogMode||(userinfo.otpsecret!=1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",3,function(){meshserver.send({action:"otpauth-clear"})},"Confirm removal of authenticator application 2-step login?")}function account_manageOtp(a){if((xxdialogMode==2)&&(xxdialogTag=="otpauth-manage")){dialogclose(0)}if(xxdialogMode||(userinfo.otpsecret!=1)||((features&4096)==0)){return}meshserver.send({action:"otpauth-getpasswords",subaction:a})}function account_showVerifyEmail(){if(xxdialogMode||(userinfo.emailVerified==true)||(serverinfo.emailcheck!=true)){return}var a="Click ok to send a verification mail to:"+EscapeHtml(userinfo.email)+"
Please wait a few minute to receive the verification.";setDialogMode(2,"Email Verification",3,account_showVerifyEmailEx,a)}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){if(xxdialogMode){return}var a=addHtmlValue("Email"," ");setDialogMode(2,"Email Address Change",3,account_changeEmail,a);if(userinfo.email!=null){Q("dp3email").value=userinfo.email}account_validateEmail();Q("dp3email").focus()}function account_validateEmail(a,b){QE("idx_dlgOkButton",validateEmail(Q("dp3email").value)&&(Q("dp3email").value!=userinfo.email));if((a!=null)&&(a.keyCode==13)){dialogclose(1)}}function account_changeEmail(){meshserver.send({action:"changeemail",email:Q("dp3email").value})}function account_showDeleteAccount(){if(xxdialogMode){return}var a="";setDialogMode(2,"Delete Account",0,null,a);account_validateDeleteAccount();Q("apassword1").focus()}function account_showChangePassword(){if(xxdialogMode){return}var a="";setDialogMode(2,"Change Password",0,null,a);account_validateNewPassword();Q("apassword0").focus()}function account_createMesh(){if(xxdialogMode){return}if((userinfo.siteadmin!=4294967295)&&((userinfo.siteadmin&64)!=0)){setDialogMode(2,"New Device Group",1,null,"This account does not have the rights to create a new device group.");return}if((userinfo.emailVerified!==true)&&(serverinfo.emailcheck==true)&&(userinfo.siteadmin!=4294967295)){setDialogMode(2,"Account Security",1,null,'Unable to access a device until a email address is verified. This is required for password recovery. Go to the "My Account" to change and verify an email address.');return}if((features&262144)&&!((userinfo.otpsecret==1)||(userinfo.otphkeys>0)||(userinfo.otpkeys>0))){setDialogMode(2,"Account Security",1,null,'Unable to access a device until two-factor authentication is enabled. This is required for extra security. Go to the "My Account" and look at the "Account Security" section.');return}var a=addHtmlValue("Name"," ");a+=addHtmlValue("Type","Software Agent Group Intel® AMT only
");a+=addHtmlValue("Description","
");setDialogMode(2,"Create Device Group",3,account_createMeshEx,a);account_validateMeshCreate();Q("dp3meshname").focus()}function account_validateMeshCreate(){QE("idx_dlgOkButton",Q("dp3meshname").value.length>0)}function account_createMeshEx(a,b){meshserver.send({action:"createmesh",meshname:Q("dp3meshname").value,meshtype:Q("dp3meshtype").value,desc:Q("dp3meshdesc").value})}function account_validateDeleteAccount(){QE("account_dlgOkButton",(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value))}function account_validateNewPassword(){var d="",a=(Q("apassword0").value.length>0)&&(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value)&&(Q("apassword0").value!=Q("apassword1").value);if((features&65536)&&(Q("apasswordhint").value==Q("apassword1").value)){a=false}if(Q("apassword1").value!=""){if(passRequirements==null||passRequirements==""){var c=checkPasswordStrength(Q("apassword1").value);if(c>=80){d="●"}else{if(c>=60){d="●"}else{d="●"}}}else{var b=checkPasswordRequirements(Q("apassword1").value,passRequirements);if(b==false){a=false;d="●"}}}QH("dxPassWarn",d);QE("account_dlgOkButton",a)}function checkPasswordStrength(e){var g=0,d={},h=0,j={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e){return 0}for(var b=0;bg.max){return false}}var d=0,b=0,h=0,c=0;for(var a=0;a";c+='';c+='';c+="
"+EscapeHtml(meshes[i].name)+"
"+d+"
";c+="
"}QH("p3meshes",c);QV("p3noMeshFound",a==0)}function gotoMesh(a){currentMesh=meshes[a];if(currentMesh==null){goBack()}p20updateMesh();go(20)}function server_showRestoreDlg(){if(xxdialogMode){return}var a="Restore the server using a backup, this will delete the existing server data . Only do this if you know what you are doing. ";a+='";setDialogMode(2,"Restore Server",0,null,a);account_validateServerRestore()}function account_validateServerRestore(){QE("account_dlgOkButton",Q("account_dlgFileInput").files.length==1)}function server_showVersionDlg(){if(xxdialogMode){return}setDialogMode(2,"MeshCentral Version",1,null,"Loading...","MeshCentralServerUpdate");meshserver.send({action:"serverversion"})}function server_showVersionDlgUpdate(){QE("idx_dlgOkButton",Q("d2updateCheck").checked)}function server_showVersionDlgEx(){meshserver.send({action:"serverupdate"})}var filetreelinkpath;var filetreelocation=[];function p5refreshFiles(){meshserver.send({action:"files"})}function updateFiles(){QV("MainMenuMyFiles",((features&8)==0));if((features&8)!=0){return}var o="",p="",c="Root ",m="Root",w,g=filetree,k=1;var e=[],t=filetreelinkpath,b=[],a=document.getElementsByName("fc");for(var q=0;q2){w+="/"+filetreelocation[q]}}}g=g.f[filetreelocation[q]];c+=" / "+(g.n!=null?g.n:filetreelocation[q])+" ";k++}else{break}}filetreelocation=e;var u=m.toLowerCase().startsWith("root / "+userinfo._id+" / public");var j=p5sort_files(g.f);for(var q in j){var d=j[q],s=d.n,y;y=s;if(s.length>40){y=''+EscapeHtml(s.substring(0,40))+"... "}else{y=EscapeHtml(s)}s=EscapeHtml(s);var l="";if(d.s!=null){l=getFileSizeStr(d.s)}var n="";if(d.t<3||d.t==4){var x=(d.t==1||d.t==4)?p5getQuotabar(d):"",A="";n=""}else{var r=y;var v="";if(u){v=' (Link )"}if(d.s>0){r=''+y+" "+v}n=""}if(d.t<3){o+=n}else{p+=n}}QH("p5rightOfButtons",p5getQuotabar(g));QH("p5files",o+p);QH("p5currentpath",c);QE("p5FolderUp",filetreelocation.length!=0);QV("p5PublicShare",u);if(t==filetreelinkpath){a=document.getElementsByName("fc");for(var q=0;q=0)}}p5setActions()}function p5getQuotabar(a){while(a.t>1&&a.t!=4){a=a.parent}if((a.t!=1&&a.t!=4)||(a.maxbytes==null)){return""}var b=Math.floor(a.s/1024),c=Math.floor((a.maxbytes-a.s)/1024);return'1?"s":"")+". "+(Math.floor(a.maxbytes/1024))+'k maxinum">'+((c<0)?("Storage limit exceed"):(c+"k remaining"))+" "}function p5showPublicLink(a){setDialogMode(2,"Public Link",1,null,' ')}var sortorder;function p5sort_filename(c,d){if(c.ln>d.ln){return(1*sortorder)}if(c.lnd.d){return(1*sortorder)}if(c.d3){sortorder=-1;d-=3}if(d==1){c.sort(p5sort_filename)}else{if(d==2){c.sort(p5sort_bysize)}else{if(d==3){c.sort(p5sort_timestamp)}}}return c}function p5setActions(){var a=getFileSelCount(),c=getFileCount(),b=getFileSelCount(false);QE("p5DeleteFileButton",(a>0)&&(filetreelocation.length>0));QE("p5NewFolderButton",filetreelocation.length>0);QE("p5UploadButton",filetreelocation.length>0);QE("p5RenameFileButton",(a==1)&&(filetreelocation.length>0));QE("p5SelectAllButton",c>0);Q("p5SelectAllButton").value=(a>0?"None":"All");QE("p5CutButton",(b>0)&&(a==b));QE("p5CopyButton",(b>0)&&(a==b));QE("p5PasteButton",(p5clipboard!=null)&&(p5clipboard.length>0)&&(filetreelocation.length>0))}function getFileSelCount(d){var a=0;var b=document.getElementsByName("fc");for(var c=0;ca){filetreelocation.pop()}}updateFiles()}function p5folderset(a){filetreelocation.push(decodeURIComponent(a));updateFiles()}function p5createfolder(){setDialogMode(2,"New Folder",3,p5createfolderEx," ");focusTextBox("p5renameinput");p5fileNameCheck()}function p5createfolderEx(){meshserver.send({action:"fileoperation",fileop:"createfolder",path:filetreelocation,newfolder:Q("p5renameinput").value})}function p5deletefile(){var a=getFileSelCount();setDialogMode(2,"Delete",3,p5deletefileEx,(a>1)?("Delete "+a+" selected items?"):("Delete selected item?"))}function p5deletefileEx(){var b=[],a=document.getElementsByName("fc");for(var c=0;c ',{action:"fileoperation",fileop:"rename",path:filetreelocation,oldname:c});focusTextBox("p5renameinput");p5fileNameCheck()}function p5renamefileEx(a,c){c.newname=Q("p5renameinput").value;meshserver.send(c)}function p5fileNameCheck(a){var b=isFilenameValid(Q("p5renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a.keyCode==13)){dialogclose(1)}}var isFilenameValid=(function(){var b=/^[^\\/:\*\?"<>\|]+$/,c=/^\./,d=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function a(e){return b.test(e)&&!c.test(e)&&!d.test(e)&&(e[0]!=".")}})();function p5uploadFile(){setDialogMode(2,"Upload File",3,p5uploadFileEx,'');updateUploadDialogOk("p5uploadinput")}function p5uploadFileEx(){Q("p5loginSubmit").click()}function updateUploadDialogOk(a){QE("idx_dlgOkButton",Q(a).value!="")}var p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;function p5copyFile(b){var a=document.getElementsByName("fc");p5clipboard=[];p5clipboardCut=b,p5clipboardFolder=Clone(filetreelocation);for(var c=0;c0)){a="Confim "+(p5clipboardCut==0?"copy":"move")+" of "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p5pasteFileEx,a)}function p5pasteFileEx(){meshserver.send({action:"fileoperation",fileop:(p5clipboardCut==0?"copy":"move"),scpath:p5clipboardFolder,path:filetreelocation,names:p5clipboard});p5folderup(999);if(p5clipboardCut==1){p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;p5updateClipview()}}function p5updateClipview(){var a="";if((p5clipboard!=null)&&(p5clipboard.length>0)){a="Holding "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" for "+(p5clipboardCut==0?"copy":"move")+", Clear ."}QH("p5bottomstatus",a);p5setActions()}function p5clearClip(){p5clipboard=null;p5clipboardFolder=null;p5clipboardCut=0;p5updateClipview()}function p5fileDragDrop(b){haltEvent(b);QV("bigfail",false);QV("bigok",false);if(b.dataTransfer==null||b.dataTransfer.files.length==0||filetreelocation.length==0){return}var g=[],k=[],l=[],a=[],j=b.dataTransfer.files.length;for(var d=0;d, Intel® AMT only "}if(d!=null){if(a==2){u+="
"}if(u!=""){u+=" "}}u+="";u+=' '+EscapeHtml(meshes[nodes[k].meshid].name)+" "+g+"
";d=nodes[k].meshid;e[d]=1;a=0}}else{if(sort==1){if(nodes[k].pwr!==d){deviceHeaderSet();if(d!==null){if(a==2){u+="
"}if(u!=""){u+=""}}u+=""+PowerStateStr2(nodes[k].pwr)+"
";d=nodes[k].pwr;a=0}}else{if(sort==2){if(d==null){d="1"}}}}b++;var v=EscapeHtml(nodes[k].name);if(v.length==0){v="None "}if((nodes[k].rname!=null)&&(nodes[k].rname.length>0)){v+=" / "+EscapeHtml(nodes[k].rname)}var s=EscapeHtml(nodes[k].name);if(showRealNames==true&&nodes[k].rname!=null){s=EscapeHtml(nodes[k].rname)}if(s.length==0){s="None "}var l=nodes[k].icon,t=NodeStateStr(nodes[k]);if((!nodes[k].conn)||(nodes[k].conn==0)){l+=" gray"}u+="";deviceHeaderTotal++;if(typeof deviceHeaderCount[nodes[k].state]=="undefined"){deviceHeaderCount[nodes[k].state]=1}else{deviceHeaderCount[nodes[k].state]++}}if(sort==0){for(var k in meshes){var m=meshes[k],o=m.links[userinfo._id];if(o!=null){var q=o.rights;if(e[m._id]==null){if((d!="")&&(u!="")){u+=""}u+="";u+=' '+EscapeHtml(m.name)+"
";if(m.mtype==1){u+="
No Intel® AMT devices in this group"}if(m.mtype==2){u+=" No devices in this group"}u+=".
";d=m._id;b++}}}}if(b==0){QH("xdevices",'
No devices Use the desktop version of this website to add devices.
')}else{QH("xdevices",u)}deviceHeaderSet();for(var k in deviceHeaders){QH(k,deviceHeaders[k])}for(var k in deviceHeadersTitles){Q(k).title=deviceHeadersTitles[k]}}var powerStatetable=["","Powered","Sleep","Sleep","Sleep","Hibernating","Power off","Present"];var powerStateStrings=["",'
Powered ','
Sleeping ','
Sleeping ','
Deep Sleep ','
Hibernating ','
Soft-Off ','
Present '];var powerStateStrings2=["","Device is powered","Device is in sleep state (S1)","Device is in sleep state (S2)","Device is in deep sleep state (S3)","Device is hibernating (S4)","Device is in soft-off state (S5)","Device is present, but power state cannot be determined"];var powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];function NodeStateStr(a){var b=[];if(a.state>0&&a.state
Agent')}if((a.conn&2)!=0){b.push('CIRA ')}else{if((a.conn&4)!=0){b.push('Intel® AMT ')}}if((a.conn&8)!=0){b.push('Relay ')}}if((a.pwr!=null)&&(a.pwr!=0)){b.push(powerStateStrings[a.pwr])}return b.join(", ")}function PowerStateStr(a){if(a0){a+=", "}a+=deviceHeaderCount[b]+" "+PowerStateStr2(b)}deviceHeadersTitles["DevxHeader"+deviceHeaderId]=a;deviceHeaderId++;deviceHeaderCount={};deviceHeaderTotal=0}function meshSort(c,d){if(c.meshnamel>d.meshnamel){return 1}if(c.meshnameld.rnamel){return 1}if(c.rnameld.namel){return 1}if(c.namele.rnamel){return 1}if(c.rnamele.namel){return 1}if(c.namelg){return 1}if(dd.namel){return 1}if(c.nameld.rnamel){return 1}if(c.rnamel0)||(userinfo.otpkeys>0))){setDialogMode(2,"Account Security",1,null,'Unable to access a device until two-factor authentication is enabled. This is required for extra security. Go to the "My Account" and look at the "Account Security" section.');return}var l=getNodeFromId(m);if(l==null){goBack();return}var h=meshes[l.meshid];if(h==null){goBack();return}var j=h.links[userinfo._id].rights;if(!currentNode||currentNode._id!=l._id||q==true){currentNode=l;var k=EscapeHtml(l.name);if(k.length==0){k="None "}if((j&4)!=0){k=""+k+" "}QH("p10deviceName",k);var t="";t+=addDeviceAttribute('Group ',''+EscapeHtml(meshes[l.meshid].name)+" ");if(l.rname!=null){t+=addDeviceAttribute('Name ',''+EscapeHtml(l.rname)+" ")}if((h.mtype==1)||(l.name!=l.host)){if((j&4)!=0){if(l.host){t+=addDeviceAttribute("Hostname",""+EscapeHtml(l.host)+" ")}else{t+=addDeviceAttribute("Hostname","None ")}}else{t+=addDeviceAttribute("Hostname",EscapeHtml(l.host))}}var d=l.desc?EscapeHtml(l.desc):"None ";if((j&4)!=0){t+=addDeviceAttribute("Description",""+d+" ")}else{t+=addDeviceAttribute("Description",d)}var a=["Unknown","Windows 32bit console","Windows 64bit console","Windows 32bit service","Windows 64bit service","Linux 32bit","Linux 64bit","MIPS","XENx86","Android ARM","Linux ARM","OSX 32bit","Android x86","PogoPlug ARM","Android APK","Linux Poky x86-32bit","OSX 64bit","ChromeOS","Linux Poky x86-64bit","Linux NoKVM x86-32bit","Linux NoKVM x86-64bit","Windows MinCore console","Windows MinCore service","NodeJS","ARM-Linaro","ARMv6l / ARMv7l","ARMv8 64bit"];if((l.agent!=null)&&(l.agent.id!=null)&&(l.agent.ver!=null)){var r="";if(l.agent.id<=a.length){r=a[l.agent.id]}else{r=a[0]}if(l.agent.ver!=0){r+=" v"+l.agent.ver}t+=addDeviceAttribute("Agent",r)}if(l.intelamt!=null){var r="";var p={0:"Not Activated (Pre)",1:"Not Activated (In)",2:"Activated"};if(l.intelamt.ver!=null&&l.intelamt.state==null){r+="Unknown State , v"+l.intelamt.ver}else{if((l.intelamt.ver==null)&&(l.intelamt.state==2)){r+="Activated "}else{if((l.intelamt.ver==null)||(l.intelamt.state==null)){r+="Unknown Version & State "}else{r+=p[l.intelamt.state];if(l.intelamt.flags){if(l.intelamt.flags&2){r=' CCM '}else{if(l.intelamt.flags&4){r=' ACM '}}}r+=(", v"+l.intelamt.ver)}}}if(l.intelamt.tls==1){r+=', TLS '}if(l.intelamt.state==2){if(l.intelamt.user==null||l.intelamt.user==""){if((j&4)!=0){r+=', No Credentials '}else{r+=", No Credentials "}}r+=" ";if((j&4)!=0){r+=' '}}t+=addDeviceAttribute("Intel® AMT",r)}if((l.agent!=null)&&(l.agent.tag!=null)&&(l.agent.tag!="mailto:")){var s=EscapeHtml(l.agent.tag);if(s.startsWith("mailto:")){s=''+s.substring(7)+" "}t+=addDeviceAttribute("Agent Tag",s)}var b=l.conn;if(b&&b>1){var c=[];if((l.conn&1)!=0){c.push('Agent ')}if((l.conn&2)!=0){c.push('Intel® AMT CIRA ')}else{if((l.conn&4)!=0){c.push('Intel® AMT ')}}if((l.conn&8)!=0){c.push('Agent Relay ')}t+=addDeviceAttribute("Connectivity",c.join(", "))}var e="None ";if(l.tags!=null){e="";for(var g in l.tags){e+=''+l.tags[g]+" "}}t+=addDeviceAttribute("Tags",""+e+" ");t+="
";if((j&76)!=0){t+=' '}QH("p10html",t);setupFiles();t="";t+="
";QH("p10html3",t);var o=PowerStateStr(l.state);if((b&1)!=0){if(o.length>0){o+=", "}o+='Mesh Agent '}if((b&2)!=0){if(o.length>0){o+=", "}o+='Intel® AMT connected '}else{if((b&4)!=0){if(o.length>0){o+=", "}o+='Intel® AMT detected '}}QH("MainComputerState",o);QH("MainComputerImage",'
');if((powerTimelineNode!=currentNode._id)&&(powerTimelineReq!=currentNode._id)){QH("p10html2","");powerTimelineReq=currentNode._id;meshserver.send({action:"powertimeline",nodeid:currentNode._id})}}setupDesktop();if(!n){n=10}go(n);setupDeviceMenu()}function deviceToastFunction(){if(xxdialogMode){return}setDialogMode(2,"Device Toast",3,deviceToastFunctionEx,"")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function setupDeviceMenu(d,c){var b=0;if(currentNode){b=meshes[currentNode.meshid].links[userinfo._id].rights}if(d!=null){currentDevicePanel=d}QV("p10general",currentDevicePanel==0);QV("p10desktop",currentDevicePanel==1);QV("p10files",currentDevicePanel==2);var a=[];if(currentDevicePanel!=0){a.push({n:"General",f:"setupDeviceMenu(0)"})}if((currentDevicePanel!=1)&&(currentNode!=null)&&((b&8)||(b&256))&&((currentNode.mtype==1)||(currentNode.agent.caps&1))){a.push({n:"Desktop",f:"setupDeviceMenu(1)"})}if((currentDevicePanel!=2)&&(currentNode!=null)&&(b&8)&&((b==4294967295)||((b&1024)==0))&&((currentNode.mtype==2)&&(currentNode.agent.caps&4))){a.push({n:"Files",f:"setupDeviceMenu(2)"})}updateFooterMenu(a)}function deviceActionFunction(){if(xxdialogMode){return}var a=meshes[currentNode.meshid].links[userinfo._id].rights;var b="Select an operation to perform on this device. ";var c="";if((a&64)!=0){c+="Wake-up "}if((a&8)!=0){c+="Sleep Reset Power off "}c+=" ";b+=addHtmlValue("Operation",c);setDialogMode(2,"Device Action",3,deviceActionFunctionEx,b)}function deviceActionFunctionEx(){var a=Q("d2deviceop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:[currentNode._id]})}else{meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:a})}}function updateDeviceTimeline(){if((meshserver.State!=2)||(powerTimelineNode==null)||(powerTimelineUpdate==null)||(currentNode==null)){return}if((powerTimelineNode==powerTimelineReq)&&(currentNode._id==powerTimelineNode)&&(powerTimelineUpdate1){t.push([0,s[1],s[0]]);var c=s[1];for(var m=2;m(m+1)){k=s[m+1]}t.push([c,c+k,p]);c=c+k}}var A="",b=1,h=new Date();var w=Q("masthead").offsetWidth-(90+9+9+14);h.setHours(0,0,0,0);for(var m=0;m<7;m++){var g="",q=h.getTime(),l=q+(1000*60*60*24);for(var n in t){var a=t[n];if(isTimeBlockInside(q,l,a[0],a[1])==true){var y=Math.max(q,a[0]);var r=Math.min(Math.min(l,a[1]),o);var z=Math.round(((r-y)*w)/86400000);if(z>0){var v=powerStateStrings2[a[2]]+" from "+new Date(y).toLocaleTimeString()+" to "+new Date(r).toLocaleTimeString()+".";g+='
"}}}A+=" "+h.toLocaleDateString()+"
"+g+"
";++b;h=new Date(h.getTime()-(1000*60*60*24))}QH("p10html2",'")}function powerColor(a){if(ac)){return true}if((b>d)&&(bd)&&(a"+a+" "+b+" "}function editDeviceAmtSettings(e,b){if(xxdialogMode){return}var g="",d=getNodeFromId(e),a=3,c=getNodeRights(e);if((c&4)==0){return}g+=addHtmlValue("Username",' ');g+=addHtmlValue("Password"," ");g+=addHtmlValue("Security","No TLS security TLS security required ");if((d.intelamt.user!=null)&&(d.intelamt.user!="")){a=7}setDialogMode(2,"Edit Intel® AMT credentials",a,editDeviceAmtSettingsEx,g,{node:d,func:b});if((d.intelamt.user!=null)&&(d.intelamt.user!="")){Q("dp10username").value=d.intelamt.user}else{Q("dp10username").value="admin"}Q("dp10tls").value=d.intelamt.tls;validateDeviceAmtSettings()}function validateDeviceAmtSettings(){QE("idx_dlgOkButton",passwordcheck(Q("dp10password").value))}function editDeviceAmtSettingsEx(c,d){if(c==2){meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:"",pass:""}})}else{var b=Q("dp10username").value;if(b==""){b="admin"}var a=Q("dp10password").value;if(a==""){b=""}meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:b,pass:a,tls:Q("dp10tls").value}});d.node.intelamt.user=b;d.node.intelamt.tls=Q("dp10tls").value;if(d.func){setTimeout(d.func,300)}}}function p10showDeleteNodeDialog(a){if(xxdialogMode){return}setDialogMode(2,"Delete Node",3,p10showDeleteNodeDialogEx,'Delete "'+EscapeHtml(currentNode.name)+'"? Confirm',a);p10validateDeleteNodeDialog()}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(a,b){meshserver.send({action:"removedevices",nodeids:[b]})}function p10showiconselector(){if(xxdialogMode){return}var a=meshes[currentNode.meshid];var b=a.links[userinfo._id].rights;if((b&4)==0){return}var c="";c+="
";c+="
";c+="
";c+="
";c+="
";c+="
";setDialogMode(2,"Icon Selection",0,null,c);QV("id_dialogclose",true)}function p10setIcon(a){setDialogMode(0);meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:a})}var showEditNodeValueDialog_modes=["Device Name","Hostname","Description","Tags"];var showEditNodeValueDialog_modes2=["name","host","desc","tags"];var showEditNodeValueDialog_modes3=["","","","Group1, Group2, Group3"];function showEditNodeValueDialog(a){if(xxdialogMode){return}var c=addHtmlValue(showEditNodeValueDialog_modes[a],' ");setDialogMode(2,"Edit Device",3,showEditNodeValueDialogEx,c,a);var b=currentNode[showEditNodeValueDialog_modes2[a]];if(b==null){b=""}if(Array.isArray(b)){b=b.join(", ")}Q("dp10devicevalue").value=b;p10editdevicevalueValidate();Q("dp10devicevalue").focus()}function showEditNodeValueDialogEx(a,b){var c={action:"changedevice",nodeid:currentNode._id};c[showEditNodeValueDialog_modes2[b]]=Q("dp10devicevalue").value;meshserver.send(c)}function p10editdevicevalueValidate(b,a){var c=((b>1)||(Q("dp10devicevalue").value.length>0));QE("idx_dlgOkButton",c);if((a!=null)&&(c==true)&&(a.keyCode==13)){dialogclose(1)}}var desktop;var desktopNode;var desktopsettings={encoding:2,showfocus:false,showmouse:true,showcad:true,quality:40,scaling:1024,framerate:50};function setupDesktop(){if((desktopNode!=currentNode)&&(desktop!=null)){desktop.Stop();desktopNode=null;desktop=null}if((desktopNode!=currentNode)||(desktop==null)){QH("DeskParent",' ');desktopNode=currentNode;Q("Desk").addEventListener("DOMMouseScroll",function(a){return dmousewheel(a)});Q("Desk").addEventListener("mousewheel",function(a){return dmousewheel(a)})}desktopNode=currentNode;updateDesktopButtons();if(!Q("Desk")["toBlob"]){QV("deskSaveBtn",false)}}function updateDesktopButtons(){var c=meshes[currentNode.meshid];var a=0;if(desktop!=null){a=desktop.State}var d=c.links[userinfo._id].rights;QV("disconnectbutton1",(a!=0));QV("connectbutton1",(a==0)&&(c.mtype==2)&&((d&8)||(d&256)));QV("connectbutton1h",(a==0)&&((currentNode.intelamt!=null)&&(d&8)&&(c.mtype==1||currentNode.intelamt.state==2)&&((currentNode.intelamt.ver!=null)||(c.mtype==1))));QV("d7amtkvm",(currentNode.intelamt!=null&&((currentNode.intelamt.ver!=null)||(c.mtype==1)))&&((a==0)||(desktop.contype==2)));QV("d7meshkvm",(c.mtype==2)&&((a==false)||(desktop.contype==1)));var e=((currentNode.conn&1)!=0);QE("connectbutton1",e);var b=((currentNode.conn&6)!=0);QE("connectbutton1h",b);QV("DeskToastButton",(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8));QE("DeskToastButton",e);QV("deskActionsBtn",d&8);Q("DeskControl").checked=((d&8)!=0);if(e==false){QV("DeskTools",false)}}function connectDesktop(b,a){if(desktop==null){desktopNode=currentNode;if(a==2){if((desktopNode.intelamt.user==null)||(desktopNode.intelamt.user=="")){editDeviceAmtSettings(desktopNode._id,connectDesktop);return}desktop=CreateAmtRedirect(CreateAmtRemoteDesktop("Desk"),authCookie);desktop.debugmode=debugmode;desktop.onStateChanged=onDesktopStateChange;desktop.m.bpp=(desktopsettings.encoding==1||desktopsettings.encoding==3)?1:2;desktop.m.useZRLE=(desktopsettings.encoding<3);desktop.m.showmouse=desktopsettings.showmouse;desktop.m.onScreenSizeChange=deskAdjust;desktop.Start(desktopNode._id,16994,"*","*",0);desktop.contype=2}else{desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie);desktop.debugmode=debugmode;desktop.m.debugmode=debugmode;desktop.attemptWebRTC=attemptWebRTC;desktop.onStateChanged=onDesktopStateChange;desktop.m.CompressionLevel=desktopsettings.quality;desktop.m.ScalingLevel=desktopsettings.scaling;desktop.m.FrameRateTimer=desktopsettings.framerate;desktop.m.onDisplayinfo=deskDisplayInfo;desktop.m.onScreenSizeChange=deskAdjust;desktop.Start(desktopNode._id);desktop.contype=1}}else{desktop.Stop();desktopNode=desktop=null}}function onDesktopStateChange(c,a){var d=a;if((d==3)&&(c.contype==2)){d++}var b=StatusStrs[d];if((desktop!=null)&&(desktop.webRtcActive==true)){b+=", WebRTC"}QH("deskstatus",b);switch(a){case 0:desktop.Stop();desktopNode=desktop=null;QV("termdisplays",false);if(fullscreen==true){deskToggleFull()}break;case 2:break;default:console.log("Unknown onDesktopStateChange state",a);break}updateDesktopButtons();deskAdjust();setTimeout(deskAdjust,50)}function showDesktopSettings(){if(xxdialogMode){return}applyDesktopSettings();updateDesktopButtons();setDialogMode(7,"Remote Desktop Settings",3,showDesktopSettingsChanged)}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value;desktopsettings.showfocus=d7showfocus.checked;desktopsettings.showmouse=d7showcursor.checked;desktopsettings.quality=d7bitmapquality.value;desktopsettings.scaling=d7bitmapscaling.value;desktopsettings.framerate=d7framelimiter.value;localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings));applyDesktopSettings();if(desktop){if(desktop.contype==1){if(desktop.State!=0){desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate)}}if(desktop.contype==2){if(desktop.State!=0){desktop.Stop();setTimeout(function(){connectDesktop(null,2)},50)}}}}function applyDesktopSettings(){var c="",b=(features&512)?[90,70,50,40,30,20,10,5,1]:[50,40,30,20,10,5,1];for(var a in b){c+=""+b[a]+"% "}QH("d7bitmapquality",c);d7desktopmode.value=desktopsettings.encoding;d7showfocus.checked=desktopsettings.showfocus;d7showcursor.checked=desktopsettings.showmouse;d7bitmapquality.value=40;if(b.indexOf(parseInt(desktopsettings.quality))>=0){d7bitmapquality.value=desktopsettings.quality}d7bitmapscaling.value=desktopsettings.scaling;if(desktopsettings.framerate){d7framelimiter.value=desktopsettings.framerate}}var fullscreen=false;function deskAdjust(){var c=(Q("DeskParent").clientHeight-Q("Desk").clientHeight)/2;if(c<0){var a=Q("DeskParent").clientHeight,b=9999;if(desktop){b=(desktop.m.width/desktop.m.height)*a}QS("Desk")["max-height"]=a+"px";QS("Desk")["max-width"]=b+"px";c=0}else{QS("Desk")["max-height"]=null;QS("Desk")["max-width"]=null}QS("Desk")["margin-top"]=c+"px";QS("Desk")["margin-bottom"]=c+"px"}function toggleDeskTools(){if(xxdialogMode){return}if(QS("DeskTools").display=="none"){QV("DeskTools",true);Q("DeskTools").nodeid=currentNode._id;refreshDeskTools()}else{QV("DeskTools",false)}}function refreshDeskTools(){QV("DeskToolsRefreshButton",false);setTimeout(refreshDeskToolsEx,500);meshserver.send({action:"msg",type:"ps",nodeid:currentNode._id})}function refreshDeskToolsEx(){QV("DeskToolsRefreshButton",true)}var deskTools={sort:1,msg:null};function sortProcess(a){deskTools.sort=a;showDeskToolsProcesses(deskTools.msg)}function sortProcessPid(c,d){if(c.p>d.p){return 1}if(c.pd.d){return 1}if(c.d"+d[b].p+'
'+(d[b].u?d[b].u:"")+"
"+d[b].c+"
"}}QH("DeskToolsProcesses",j)}}function deskSaveImage(){if(xxdialogMode||desktop==null||desktop.State!=3){return}var a=new Date(),b="Desktop-"+currentNode.name+"-"+a.getFullYear()+"-"+("0"+(a.getMonth()+1)).slice(-2)+"-"+("0"+a.getDate()).slice(-2)+"-"+("0"+a.getHours()).slice(-2)+"-"+("0"+a.getMinutes()).slice(-2);Q("Desk")["toBlob"](function(c){saveAs(c,b+".jpg")})}function deskDisplayInfo(e,a,c,d){var g=Q("termdisplays").value;if(a.length>0){var b="";for(var h in a){b+=""+a[h]+" "}QH("termdisplays",b)}QV("termdisplays",a.length>0)}function deskGetDisplayNumbers(a){desktop.m.GetDisplayNumbers()}function deskSetDisplay(b){var a=0,c=Q("termdisplays").value;if(c=="All Displays"){a=65535}else{a=parseInt(c.substring(8))}desktop.m.SetDisplay(a)}function dmousedown(a){if((!xxdialogMode&&desktop!=null)&&Q("DeskControl").checked){desktop.m.mousedown(a)}}function dmouseup(a){if((!xxdialogMode&&desktop!=null)&&Q("DeskControl").checked){desktop.m.mouseup(a)}}function dmousemove(a){if((!xxdialogMode&&desktop!=null)&&Q("DeskControl").checked){desktop.m.mousemove(a)}}function dmousewheel(a){if((!xxdialogMode&&desktop!=null)&&Q("DeskControl").checked&&desktop.m.mousewheel){desktop.m.mousewheel(a);haltEvent(a);return true}return false}function drotate(a){if(!xxdialogMode&&desktop!=null){desktop.m.setRotation(desktop.m.rotation+a);deskAdjust();deskAdjust()}}function stopProcess(a,b){setDialogMode(2,"Process Control",3,stopProcessEx,"Stop process #"+a+' "'+b+'"?',a)}function stopProcessEx(a,b){meshserver.send({action:"msg",type:"pskill",nodeid:currentNode._id,value:b});setTimeout(refreshDeskTools,300)}var filesNode;function setupFiles(){var b=(filesNode==currentNode);filesNode=currentNode;var a=((filesNode.conn&1)!=0)?true:false;QE("p13Connect",a);if(((b==false)||(a==false))&&files){files.Stop();files=null}}function onFilesStateChange(c,a){p13Connect.value=(a==0)?"Connect":"Disconnect";var b=StatusStrs[a];if(files.webRtcActive==true){b+=", WebRTC"}Q("p13Status").textContent=b;switch(a){case 0:QH("p13files","");p13filetree=null;p13filetreelocation=[];QH("p13currentpath","");QE("p13FolderUp",false);p13setActions();if(files!=null){files.Stop();files=null}break;case 3:p13targetpath="";files.sendText({action:"ls",reqid:1,path:""});break;default:break}}function CreateRemoteFiles(b){var a={protocol:5};a.onFileUpdate=b;a.xxStateChange=function(c){};a.ProcessData=function(c){a.onFileUpdate(c)};return a}var autoConnectFilesTimer=null;function autoConnectFiles(a){if(autoConnectFilesTimer==null){autoConnectFilesTimer=setInterval(connectFiles,100)}else{clearInterval(autoConnectFilesTimer);autoConnectFilesTimer=null}}function connectFiles(a){if(!files){files=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie);files.attemptWebRTC=attemptWebRTC;files.onStateChanged=onFilesStateChange;files.Start(filesNode._id)}else{files.Stop();files=null}p13clipboard=p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}var p13filetree=null;var p13targetpath=null;var p13filetreelocation=[];function p13gotFiles(b){if((b.length>0)&&(b.charCodeAt(0)!=123)){p13gotDownloadBinaryData(b);return}b=JSON.parse(decode_utf8(b));if(b.action=="download"){p13gotDownloadCommand(b);return}b.path=b.path.replace(/\//g,"\\");if((p13filetree!=null)&&(b.path==p13filetree.path)){var a=p13getCheckedNames();p13filetree=b;p13updateFiles(a)}else{var c=b.path.replace(/\//g,"\\"),d=p13targetpath.replace(/\//g,"\\");while((c.length>0)&&(c[0]=="\\")){c=c.substring(1)}while((d.length>0)&&(d[0]=="\\")){d=d.substring(1)}if((c==d)||((b.path=="\\")&&(p13targetpath==""))){p13filetree=b;p13updateFiles()}}}function p13getCheckedNames(){var b=[],a=document.getElementsByName("fd");for(var c=0;cRoot ",j="Root";var u=p13filetree.path.split("\\");p13filetreelocation=[];for(var n in u){if(u[n]!=""){p13filetreelocation.push(u[n])}}for(var n in p13filetreelocation){c+=" / "+p13filetreelocation[n]+" "}var q=p13filetreelocation.join("/");var e=p13sort_files(p13filetree.dir);for(var n in e){var d=e[n],p=d.n,s;s=p;if(p.length>70){s=''+EscapeHtml(p.substring(0,70))+"... "}else{s=EscapeHtml(p)}p=EscapeHtml(p);var g="";if(d.s!=null){g=getFileSizeStr(d.s)}var k="";if(d.t<3){var r="",t="";k=""}else{var o=s;if(d.s>0){o=''+s+" "}k=""}if(d.t<3){l+=k}else{m+=k}}QH("p13files",l+m);QH("p13currentpath",c);QE("p13FolderUp",p13filetreelocation.length!=0);if(b!=null){var a=document.getElementsByName("fd");for(var n=0;n=0){a[n].checked=true}}}p13setActions()}function p13folderset(a){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[a].n).split("\\").join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}function p13folderup(a){if(a==null){p13filetreelocation.pop()}else{while(p13filetreelocation.length>a){p13filetreelocation.pop()}}p13targetpath=p13filetreelocation.join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}var p13sortorder;function p13sort_filename(c,d){if(c.ln>d.ln){return(1*p13sortorder)}if(c.lnd.d){return(1*p13sortorder)}if(c.d3){p13sortorder=-1;d-=3}if(d==1){c.sort(p13sort_filename)}else{if(d==2){c.sort(p13sort_bysize)}else{if(d==3){c.sort(p13sort_timestamp)}}}return c}function p13setActions(){if(p13filetree==null){QE("p13DeleteFileButton",false);QE("p13NewFolderButton",false);QE("p13UploadButton",false);QE("p13RenameFileButton",false);QE("p13SelectAllButton",false);Q("p13SelectAllButton").value="All";QE("p13RefreshButton",false);QE("p13CutButton",false);QE("p13CopyButton",false);QE("p13PasteButton",false)}else{var a=p13getFileSelCount(),c=p13getFileCount(),b=p13getFileSelCount(false);var d=((currentNode.agent.id>0)&&(currentNode.agent.id<5));QE("p13DeleteFileButton",(a>0)&&((p13filetreelocation.length>0)||(d==false)));QE("p13NewFolderButton",((p13filetreelocation.length>0)||(d==false)));QE("p13UploadButton",((p13filetreelocation.length>0)||(d==false)));QE("p13RenameFileButton",(a==1)&&((p13filetreelocation.length>0)||(d==false)));QE("p13SelectAllButton",c>0);Q("p13SelectAllButton").value=(a>0?"None":"All");QE("p13RefreshButton",true);QE("p13CutButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13CopyButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13PasteButton",((p13filetreelocation.length>0)||(d==false))&&((p13clipboard!=null)&&(p13clipboard.length>0)))}}function p13getFileSelCount(d){var a=0;var b=document.getElementsByName("fd");for(var c=0;c ");focusTextBox("p13renameinput");p13fileNameCheck()}function p13createfolderEx(){files.sendText({action:"mkdir",reqid:1,path:p13filetreelocation.join("/")+"/"+Q("p13renameinput").value});p13folderup(999)}function p13deletefile(){var a=getFileSelCount();setDialogMode(2,"Delete",3,p13deletefileEx,(a>1)?("Delete "+a+" selected items?"):("Delete selected item?"))}function p13deletefileEx(){var b=[],a=document.getElementsByName("fd");for(var c=0;c ',{action:"rename",path:p13filetreelocation.join("/"),oldname:c});focusTextBox("p13renameinput");p13fileNameCheck()}function p13renamefileEx(a,c){c.newname=Q("p13renameinput").value;files.sendText(c);p13folderup(999)}function p13fileNameCheck(a){var b=isFilenameValid(Q("p13renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a!=null)&&(a.keyCode==13)){dialogclose(1)}}function p13uploadFile(){setDialogMode(2,"Upload File",3,p13uploadFileEx," ");updateUploadDialogOk("p13uploadinput")}function p13uploadFileEx(){p13doUploadFiles(Q("p13uploadinput").files)}var p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;function p13copyFile(b){var a=document.getElementsByName("fd");p13clipboard=[];p13clipboardCut=b,p13clipboardFolder=p13targetpath;for(var c=0;c0)){a="Confim "+(p13clipboardCut==0?"copy":"move")+" of "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p13pasteFileEx,a)}function p13pasteFileEx(){files.sendText({action:(p13clipboardCut==0?"copy":"move"),reqid:1,scpath:p13clipboardFolder,dspath:p13targetpath,names:p13clipboard});p13folderup(999);if(p13clipboardCut==1){p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;p13updateClipview()}}function p13updateClipview(){var a="";if((p13clipboard!=null)&&(p13clipboard.length>0)){a="Holding "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" for "+(p13clipboardCut==0?"copy":"move")+", Clear ."}QH("p13bottomstatus",a);p13setActions()}function p13clearClip(){p13clipboard=null;p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}function updateUploadDialogOk(a){QE("idx_dlgOkButton",Q(a).value!="")}function getFileSelCount(d){var a=0;var b=document.getElementsByName("fc");for(var c=0;c"+downloadFile.file+" ")}function p13downloadFileCancel(){setDialogMode(0);files.sendText({action:"download",sub:"cancel",id:downloadFile.id});downloadFile=null}function p13gotDownloadCommand(a){if((downloadFile==null)||(a.id!=downloadFile.id)){return}if(a.sub=="start"){downloadFile.state=1;files.sendText({action:"download",sub:"startack",id:downloadFile.id})}else{if(a.sub=="cancel"){downloadFile=null;setDialogMode(0)}}}function p13gotDownloadBinaryData(a){if(!downloadFile||downloadFile.state==0){return}if(a.length>4){downloadFile.tsize+=(a.length-4);downloadFile.data+=a.substring(4);Q("d2progressBar").value=downloadFile.tsize}if((ReadInt(a,0)&1)!=0){saveAs(data2blob(downloadFile.data),downloadFile.file);downloadFile=null;setDialogMode(0)}else{files.sendText({action:"download",sub:"ack",id:downloadFile.id})}}var uploadFile;function p13doUploadFiles(a){if(xxdialogMode){return}uploadFile={};uploadFile.xpath=p13filetreelocation.join("/");uploadFile.xfiles=a;uploadFile.xfilePtr=-1;setDialogMode(2,"Upload File",10,p13uploadFileCancel,"Connecting...
");p13uploadReconnect()}function onFileUploadStateChange(b,a){switch(a){case 0:p13folderup(9999);break;case 3:p13uploadNextFile();break;default:console.log("Unknown onFileUploadStateChange state",a);break}}function p13uploadReconnect(){uploadFile.ws=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotUploadData),serverPublicNamePort,authCookie);uploadFile.ws.attemptWebRTC=false;uploadFile.ws.ctrlMsgAllowed=false;uploadFile.ws.onStateChanged=onFileUploadStateChange;uploadFile.ws.Start(filesNode._id)}function p13uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var a=uploadFile.xfiles[uploadFile.xfilePtr];QH("p13dfileName",a.name);Q("d2progressBar").max=a.size;Q("d2progressBar").value=0;uploadFile.xreader=new FileReader();uploadFile.xreader.onload=function(){uploadFile.xdata=uploadFile.xreader.result;uploadFile.ws.sendText({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:a.name,size:uploadFile.xdata.byteLength})};uploadFile.xreader.readAsArrayBuffer(a)}else{p13uploadFileCancel()}}function p13uploadFileCancel(a,b){if(uploadFile!=null){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}uploadFile=null}setDialogMode(0)}function p13gotUploadData(b){var a=JSON.parse(b);if((uploadFile==null)||(parseInt(uploadFile.xfilePtr)!=parseInt(a.reqid))){return}if(a.action=="uploadstart"){p13uploadNextPart(false);for(var c=0;c<8;c++){p13uploadNextPart(true)}}else{if(a.action=="uploadack"){p13uploadNextPart(false)}else{if(a.action=="uploaderror"){p13uploadFileCancel()}}}}function p13uploadNextPart(c){var a=uploadFile.xdata;var e=uploadFile.xptr;var d=uploadFile.xptr+4096;if(d>a.byteLength){if(c==true){return}d=a.byteLength}if(e==a.byteLength){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}if(uploadFile.xfiles.length>uploadFile.xfilePtr+1){p13uploadReconnect()}else{p13uploadFileCancel()}}else{var b=a.slice(e,d);uploadFile.ws.send(b);uploadFile.xptr=d;Q("d2progressBar").value=d}}var currentMesh;function p20updateMesh(){if(currentMesh==null){return}QH("p20meshName",EscapeHtml(currentMesh.name));var e="Unknown #"+currentMesh.mtype;var d=currentMesh.links[userinfo._id].rights;if(currentMesh.mtype==1){e="Intel® AMT group"}if(currentMesh.mtype==2){e="Software agent group"}var l="";l+=addHtmlValue("Name",addLinkConditional(EscapeHtml(currentMesh.name),"p20editmesh(1)",(d&1)!=0));l+=addHtmlValue("Description",addLinkConditional(((currentMesh.desc&¤tMesh.desc!="")?EscapeHtml(currentMesh.desc):"None "),"p20editmesh(2)",(d&1)!=0));l+=addHtmlValue("Type",e);l+=" ";var b=currentMesh.links[userinfo._id];if(b&&((b.rights&2)!=0)){l+=""}l+='User Authorizations ';var a=1,j=[];for(var c in currentMesh.links){j.push({id:c,name:c.split("/")[2],rights:currentMesh.links[c].rights})}j.sort(function(m,n){if(m.name>n.name){return 1}if(m.name '}l+='";l+=""+k+"
"+h+"
"+EscapeHtml(decodeURIComponent(j[c].name))+"
";l+=" ";++a}l+="
";if(d==4294967295){l+=""}QH("p20info",l)}function p20showDeleteMeshDialog(){if(xxdialogMode){return}var a='Are you sure you want to delete mesh "'+EscapeHtml(currentMesh.name)+'"? Deleting the mesh will also delete all information about computers within this mesh. ';a+=" Confirm";setDialogMode(2,"Delete Mesh",3,p20showDeleteMeshDialogEx,a);p20validateDeleteMeshDialog()}function p20validateDeleteMeshDialog(){QE("idx_dlgOkButton",Q("p20check").checked)}function p20showDeleteMeshDialogEx(a,b){meshserver.send({action:"deletemesh",meshid:currentMesh._id,meshname:currentMesh.name})}function p20editmesh(a){if(xxdialogMode){return}var b=addHtmlValue("Name"," ");b+=addHtmlValue("Description"," ");setDialogMode(2,"Edit Device Group",3,p20editmeshEx,b);Q("dp20meshname").value=currentMesh.name;if(currentMesh.desc){Q("dp20meshdesc").value=currentMesh.desc}p20editmeshValidate();if(a==2){Q("dp20meshdesc").focus()}else{Q("dp20meshname").focus()}}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(){QE("idx_dlgOkButton",Q("dp20meshname").value.length>0)}function p20showAddMeshUserDialog(){if(xxdialogMode){return}var a=addHtmlValue("User"," ");a+='';a+=" Full Administrator ";a+=" Edit Device Group ";a+=" Manage Device Group Users ";a+=" Manage Device Group Computers ";a+=" Remote Control ";a+=" Remote View Only ";a+=" No Terminal Access ";a+=" No File Access ";a+=" No Intel® AMT ";a+=" Mesh Agent Console ";a+=" Server Files ";a+=" Wake Devices ";a+=" Edit Device Notes ";a+="
";setDialogMode(2,"Add User to Mesh",3,p20showAddMeshUserDialogEx,a);p20validateAddMeshUserDialog();Q("dp20username").focus()}function p20validateAddMeshUserDialog(){var a=currentMesh.links[userinfo._id].rights;QE("idx_dlgOkButton",(Q("dp20username").value.length>0));QE("p20fulladmin",a==4294967295);QE("p20editmesh",(!Q("p20fulladmin").checked)&&(a==4294967295));QE("p20manageusers",!Q("p20fulladmin").checked);QE("p20managecomputers",!Q("p20fulladmin").checked);QE("p20remotecontrol",!Q("p20fulladmin").checked);QE("p20meshagentconsole",!Q("p20fulladmin").checked);QE("p20meshserverfiles",!Q("p20fulladmin").checked);QE("p20wakedevices",!Q("p20fulladmin").checked);QE("p20editnotes",!Q("p20fulladmin").checked);QE("p20remoteview",!Q("p20fulladmin").checked&&Q("p20remotecontrol").checked);QE("p20noterminal",!Q("p20fulladmin").checked&&Q("p20remotecontrol").checked);QE("p20nofiles",!Q("p20fulladmin").checked&&Q("p20remotecontrol").checked);QE("p20noamt",!Q("p20fulladmin").checked&&Q("p20remotecontrol").checked)}function p20showAddMeshUserDialogEx(){var a=0;if(Q("p20fulladmin").checked==true){a=4294967295}else{if(Q("p20editmesh").checked==true){a+=1}if(Q("p20manageusers").checked==true){a+=2}if(Q("p20managecomputers").checked==true){a+=4}if(Q("p20remotecontrol").checked==true){a+=8}if(Q("p20meshagentconsole").checked==true){a+=16}if(Q("p20meshserverfiles").checked==true){a+=32}if(Q("p20wakedevices").checked==true){a+=64}if(Q("p20editnotes").checked==true){a+=128}if(Q("p20remoteview").checked==true){a+=256}if(Q("p20noterminal").checked==true){a+=512}if(Q("p20nofiles").checked==true){a+=1024}if(Q("p20noamt").checked==true){a+=2048}}meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,username:Q("dp20username").value,meshadmin:a})}function p20viewuser(e){if(xxdialogMode){return}e=decodeURIComponent(e);var d="",b=currentMesh.links[userinfo._id].rights,c=currentMesh.links[e].rights;if(c==4294967295){d=", Full Administrator"}else{if((c&1)!=0){d+=", Edit Device Group"}if((c&2)!=0){d+=", Manage Device Group Users"}if((c&4)!=0){d+=", Manage Device Group Computers"}if((c&8)!=0){d+=", Remote Control"}if((c&16)!=0){d+=", Agent Console"}if((c&32)!=0){d+=", Server Files"}if((c&64)!=0){d+=", Wake Devices"}if((c&128)!=0){d+=", Edit Notes"}if((c&256)!=0){d+=", Remote View Only"}if((c&512)!=0){d+=", No Terminal"}if((c&1024)!=0){d+=", No Files"}if((c&2048)!=0){d+=", No Intel® AMT"}}d=d.substring(2);if(d==""){d="No Rights"}var a=1,g=addHtmlValue("User",EscapeHtml(decodeURIComponent(e.split("/")[2])));g+=addHtmlValue("Permissions",d);if(((userinfo._id)!=e)&&(b==4294967295||(((b&2)!=0)&&(c!=4294967295)))){a+=4}setDialogMode(2,"Mesh User",a,p20viewuserEx,g,e)}function p20viewuserEx(a,b){if(a!=2){return}setDialogMode(2,"Remote Mesh User",3,p20viewuserEx2,"Confirm removal of user "+b.split("/")[2]+"?",b)}function p20deleteUser(a,b){haltEvent(a);p20viewuserEx(2,decodeURIComponent(b))}function p20viewuserEx2(a,b){meshserver.send({action:"removemeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:b})}var xxcurrentView=-1;function go(b){if(xxdialogMode||xxcurrentView==b){return}updateFooterMenu();setDialogMode(0);for(var a=0;a<32;a++){QV("p"+a,a==b)}xxcurrentView=b}var xxdialogMode;var xxdialogFunc;var xxdialogButtons;var xxdialogTag;function setDialogMode(j,k,a,e,d,h){xxdialogMode=j;xxdialogFunc=e;xxdialogButtons=a;xxdialogTag=h;QE("idx_dlgOkButton",true);QV("idx_dlgOkButton",a&1);QV("idx_dlgCancelButton",a&2);QV("id_dialogclose",(a&2)||(a&8));QV("idx_dlgButtonBar",a&7);if(k){QH("id_dialogtitle",k)}for(var g=1;g<24;g++){QV("dialog"+g,g==j)}QV("dialog",j);if(d){if(j==2){QH("id_dialogOptions",d)}else{QH("id_dialogMessage",d)}}}function dialogclose(e){var c=xxdialogFunc;var a=xxdialogButtons;var d=xxdialogTag;setDialogMode();if(((a&8)||e)&&c){c(e,d)}}function center(){QS("dialog").left=((((getDocWidth()-300)/2))+"px");deskAdjust();deskAdjust()}function messagebox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b,1)}function statusbox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b)}function getDocWidth(){if(window.innerWidth){return window.innerWidth}if(document.documentElement&&document.documentElement.clientWidth&&document.documentElement.clientWidth!=0){return document.documentElement.clientWidth}return document.getElementsByTagName("body")[0].clientWidth}function haltEvent(a){if(a.preventDefault){a.preventDefault()}if(a.stopPropagation){a.stopPropagation()}return false}function haltReturn(a){if(a.keyCode==13){haltEvent(a)}}function validateEmail(b){var a=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return a.test(b)}function reload(){window.location.href=window.location.href}function getNodeFromId(b){for(var a in nodes){if(nodes[a]._id==b){return nodes[a]}}return null}function addHtmlValue(a,b){return""}function addHtmlValue2(a,b){return""}function addLink(b,a){return"♦ "+b+" "}function addLinkConditional(d,b,a){if(a){return addLink(d,b)}return d}function passwordcheck(a){var b=/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()]).{8,}/;return b.test(a)}function getFileSizeStr(a){if(a==1){return"1 byte"}return""+a+" bytes"}function joinPaths(){var c=[];for(var a in arguments){var b=arguments[a];if((b!=null)&&(b!="")){while(b.endsWith("/")||b.endsWith("\\")){b=b.substring(0,b.length-1)}while(b.startsWith("/")||b.startsWith("\\")){b=b.substring(1)}c.push(b)}}return c.join("/")}function focusTextBox(a){setTimeout(function(){Q(a).selectionStart=Q(a).selectionEnd=65535;Q(a).focus()},0)}var isFilenameValid=(function(){var b=/^[^\\/:\*\?"<>\|]+$/,c=/^\./,d=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function a(e){return b.test(e)&&!c.test(e)&&!d.test(e)&&(e[0]!=".")}})();