var API_URL="http://localhost:25972/jsscaner/api/v1/command";function PostHttpRequest(t,e,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){s.readyState==XMLHttpRequest.DONE&&200==s.status&&e(JSON.parse(s.responseText),n)},s.open("POST",API_URL),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.send(t)}function PostHttpRequestSync(t){var e=new XMLHttpRequest;return e.open("POST",API_URL,!1),e.setRequestHeader("Content-Type","application/json;charset=UTF-8"),e.send(t),JSON.parse(e.responseText)}function GetDataSources(t,e){PostHttpRequest(JSON.stringify({Command:"GetSources"}),t,e)}function AcquireSync(t,e,n,s,o,u,i,r){u={Command:"Acquire",ProductName:t,Duplex:e,Color:n,Resolution:s,Format:o,Blank:u};PostHttpRequest(JSON.stringify(u),i,r)}function AcquireAsync(t,e,n,s,o,u){u={Command:"AcquireAsync",ProductName:t,Duplex:e,Color:n,Resolution:s,Format:o,Blank:u};return PostHttpRequestSync(JSON.stringify(u))}function GetFileSync(t,e,n){t={Command:"GetFileSync",FilePath:t};PostHttpRequest(JSON.stringify(t),e,n)}function GetFileAsyncByIndex(t,e){e={Command:"GetFileAsyncByIndex",Guid:t,Index:e};return PostHttpRequestSync(JSON.stringify(e))}function GetFileAsyncByPath(t,e){e={Command:"GetFileAsyncByPath",Guid:t,FilePath:e};return PostHttpRequestSync(JSON.stringify(e))}function GetProductVersion(){var t={Command:"GetProductVersion",FilePath:filepath};return PostHttpRequestSync(JSON.stringify(t))}function QueryResult(t){t={Command:"QueryResult",Guid:t};return PostHttpRequestSync(JSON.stringify(t))}function GetProductInfo(t,e,n){t={Command:"GetProductInfo",ProductName:t};PostHttpRequest(JSON.stringify(t),e,n)}function DeleteAcquireFiles(t){t={Command:"DeleteAcquireFiles",Guid:t};return PostHttpRequestSync(JSON.stringify(t))}