var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(b,h,c){if(null==b)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(h instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return b+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1; $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,h,c){b!=Array.prototype&&b!=Object.prototype&&(b[h]=c.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this); $jscomp.polyfill=function(b,h,c,e){if(h){c=$jscomp.global;b=b.split(".");for(e=0;e=p}},"es6","es3"); var BrowserPrint=function(){function b(a,b){var d=new XMLHttpRequest;"withCredentials"in d?d.open(a,b,!0):"undefined"!=typeof XDomainRequest?(d=new XDomainRequest,d.open(a,b)):d=null;return d}function h(a,b,d){void 0===b&&(b=e.defaultSuccessCallback);void 0===d&&(d=e.defaultErrorCallback);return c(a,b,d)}function c(a,b,d){a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&200===a.status?""===a.responseType?b(a.responseText):b(a.response):a.readyState===XMLHttpRequest.DONE&&(d?d(a.response): console.log("error occurred with no errorCallback set."))};return a}var e={},k={},p=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);navigator.userAgent.indexOf("Trident/7.0");var l="http://127.0.0.1:9100/";p&&"https:"===location.protocol&&(l="https://127.0.0.1:9101/");e.Device=function(a){var m=this;this.name=a.name;this.deviceType=a.deviceType;this.connection=a.connection;this.uid=a.uid;this.version=2;this.provider=a.provider;this.manufacturer=a.manufacturer;this.readRetries="bluetooth"=== this.connection?1:0;this.sendErrorCallback=function(d){};this.sendFinishedCallback=function(d){};this.readErrorCallback=function(d){};this.readFinishedCallback=function(d){};this.send=function(d,a,f){var g=b("POST",l+"write");g&&(void 0!==m&&(void 0===a&&(a=m.sendFinishedCallback),void 0===f&&(f=m.sendErrorCallback)),c(g,a,f),g.send(JSON.stringify({device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version,provider:this.provider,manufacturer:this.manufacturer}, data:d})))};this.sendUrl=function(d,a,f,e){var g=b("POST",l+"write");g&&(c(m,g,a,f),d={device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version,provider:this.provider,manufacturer:this.manufacturer},url:d},null!=e&&void 0!=e&&(d.options=e),g.send(JSON.stringify(d)))};this.sendFile=function(d,a,f){if("string"===typeof d)e.loadFileFromUrl(d,function(d){m.sendFile(d,a,f)},f);else{var g=b("POST",l+"write");if(g){g.responseType="text";h(g,a,f);var c= new FormData,n={};n.device=m;c.append("json",JSON.stringify(n));c.append("blob",d);g.send(c)}}};this.convertAndSendFile=function(d,a,b,c){c||(c={});c.action||(c.action="print");e.convert(d,this,c,a,b)};this.read=function(d,a){var f=b("POST",l+"read");f&&(void 0!==m&&(void 0===d&&(d=m.readFinishedCallback),void 0===a&&(a=m.readErrorCallback)),c(f,d,a),f.send(JSON.stringify({device:{name:this.name,uid:this.uid,connection:this.connection,deviceType:this.deviceType,version:this.version,provider:this.provider, manufacturer:this.manufacturer}})))};this.readUntilStringReceived=function(d,a,b,e,c){c||(c="");void 0===e&&(e=this.readRetries);a=function(a,b,e,f,g){return function(c){if(c&&0!==c.length)f=0;else if(0>=f){b(g);return}c=g+c;""!==d&&-1