text: sap.ui.define(["sap/ui/webc/common/thirdparty/base/UI5Element","sap/ui/webc/common/thirdparty/base/renderer/LitRenderer","sap/ui/webc/common/thirdparty/base/i18nBundle","sap/ui/webc/main/thirdparty/Dialog","sap/ui/webc/main/thirdparty/Button","sap/ui/webc/main/thirdparty/BusyIndicator","./generated/templates/BarcodeScannerDialogTemplate.lit","./generated/themes/BarcodeScannerDialog.css","./generated/i18n/i18n-defaults"],function(t,e,r,n,i,o,a,u,s){"use strict";function f(t){return t&&typeof t==="object"&&"default"in t?t["default"]:t}var c=f(t);var l=f(e);var h=f(n);var d=f(i);var v=f(o);function p(t,e){var r=Object.setPrototypeOf;r?r(t,e):t.__proto__=e}function g(t,e){if(e===void 0){e=t.constructor}var r=Error.captureStackTrace;r&&r(t,e)}var y=function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var w=function(t){y(e,t);function e(e){var r=this.constructor;var n=t.call(this,e)||this;Object.defineProperty(n,"name",{value:r.name,enumerable:false,configurable:true});p(n,r.prototype);g(n);return n}return e}(Error);var _=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var A=function(t){_(e,t);function e(e){if(e===void 0){e=undefined}var r=t.call(this,e)||this;r.message=e;return r}e.prototype.getKind=function(){var t=this.constructor;return t.kind};e.kind="Exception";return e}(w);var m=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var E=function(t){m(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="ArgumentException";return e}(A);var C=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var I=function(t){C(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="IllegalArgumentException";return e}(A);var S=function(){function t(t){this.binarizer=t;if(t===null){throw new I("Binarizer must be non-null.")}}t.prototype.getWidth=function(){return this.binarizer.getWidth()};t.prototype.getHeight=function(){return this.binarizer.getHeight()};t.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)};t.prototype.getBlackMatrix=function(){if(this.matrix===null||this.matrix===undefined){this.matrix=this.binarizer.getBlackMatrix()}return this.matrix};t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()};t.prototype.crop=function(e,r,n,i){var o=this.binarizer.getLuminanceSource().crop(e,r,n,i);return new t(this.binarizer.createBinarizer(o))};t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()};t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))};t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))};t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch(t){return""}};return t}();var O=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var T=function(t){O(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.getChecksumInstance=function(){return new e};e.kind="ChecksumException";return e}(A);var b=function(){function t(t){this.source=t}t.prototype.getLuminanceSource=function(){return this.source};t.prototype.getWidth=function(){return this.source.getWidth()};t.prototype.getHeight=function(){return this.source.getHeight()};return t}();var R=function(){function t(){}t.arraycopy=function(t,e,r,n,i){while(i--){r[n++]=t[e++]}};t.currentTimeMillis=function(){return Date.now()};return t}();var N=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var D=function(t){N(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="IndexOutOfBoundsException";return e}(A);var P=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var M=function(t){P(e,t);function e(e,r){if(e===void 0){e=undefined}if(r===void 0){r=undefined}var n=t.call(this,r)||this;n.index=e;n.message=r;return n}e.kind="ArrayIndexOutOfBoundsException";return e}(D);var B=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var L=function(){function t(){}t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e};t.fillWithin=function(e,r,n,i){t.rangeCheck(e.length,r,n);for(var o=r;o<n;o++)e[o]=i};t.rangeCheck=function(t,e,r){if(e>r){throw new I("fromIndex("+e+") > toIndex("+r+")")}if(e<0){throw new M(e)}if(r>t){throw new M(r)}};t.asList=function(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}return t};t.create=function(t,e,r){var n=Array.from({length:t});return n.map(function(t){return Array.from({length:e}).fill(r)})};t.createInt32Array=function(t,e,r){var n=Array.from({length:t});return n.map(function(t){return Int32Array.from({length:e}).fill(r)})};t.equals=function(t,e){if(!t){return false}if(!e){return false}if(!t.length){return false}if(!e.length){return false}if(t.length!==e.length){return false}for(var r=0,n=t.length;r<n;r++){if(t[r]!==e[r]){return false}}return true};t.hashCode=function(t){var e,r;if(t===null){return 0}var n=1;try{for(var i=B(t),o=i.next();!o.done;o=i.next()){var a=o.value;n=31*n+a}}catch(t){e={error:t}}finally{try{if(o&&!o.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}return n};t.fillUint8Array=function(t,e){for(var r=0;r!==t.length;r++){t[r]=e}};t.copyOf=function(t,e){return t.slice(0,e)};t.copyOfUint8Array=function(t,e){if(t.length<=e){var r=new Uint8Array(e);r.set(t);return r}return t.slice(0,e)};t.copyOfRange=function(t,e,r){var n=r-e;var i=new Int32Array(n);R.arraycopy(t,e,i,0,n);return i};t.binarySearch=function(e,r,n){if(undefined===n){n=t.numberComparator}var i=0;var o=e.length-1;while(i<=o){var a=o+i>>1;var u=n(r,e[a]);if(u>0){i=a+1}else if(u<0){o=a-1}else{return a}}return-i-1};t.numberComparator=function(t,e){return t-e};return t}();var F=function(){function t(){}t.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var r=31;e=t<<16;if(e!==0){r-=16;t=e}e=t<<8;if(e!==0){r-=8;t=e}e=t<<4;if(e!==0){r-=4;t=e}e=t<<2;if(e!==0){r-=2;t=e}return r-(t<<1>>>31)};t.numberOfLeadingZeros=function(t){if(t===0){return 32}var e=1;if(t>>>16===0){e+=16;t<<=16}if(t>>>24===0){e+=8;t<<=8}if(t>>>28===0){e+=4;t<<=4}if(t>>>30===0){e+=2;t<<=2}e-=t>>>31;return e};t.toHexString=function(t){return t.toString(16)};t.toBinaryString=function(t){return String(parseInt(String(t),2))};t.bitCount=function(t){t=t-(t>>>1&1431655765);t=(t&858993459)+(t>>>2&858993459);t=t+(t>>>4)&252645135;t=t+(t>>>8);t=t+(t>>>16);return t&63};t.truncDivision=function(t,e){return Math.trunc(t/e)};t.parseInt=function(t,e){if(e===void 0){e=undefined}return parseInt(t,e)};t.MIN_VALUE_32_BITS=-2147483648;t.MAX_VALUE=Number.MAX_SAFE_INTEGER;return t}();var x=function(){function t(e,r){if(undefined===e){this.size=0;this.bits=new Int32Array(1)}else{this.size=e;if(undefined===r||null===r){this.bits=t.makeArray(e)}else{this.bits=r}}}t.prototype.getSize=function(){return this.size};t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)};t.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var r=t.makeArray(e);R.arraycopy(this.bits,0,r,0,this.bits.length);this.bits=r}};t.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0};t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)};t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)};t.prototype.getNextSet=function(t){var e=this.size;if(t>=e){return e}var r=this.bits;var n=Math.floor(t/32);var i=r[n];i&=~((1<<(t&31))-1);var o=r.length;while(i===0){if(++n===o){return e}i=r[n]}var a=n*32+F.numberOfTrailingZeros(i);return a>e?e:a};t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e){return e}var r=this.bits;var n=Math.floor(t/32);var i=~r[n];i&=~((1<<(t&31))-1);var o=r.length;while(i===0){if(++n===o){return e}i=~r[n]}var a=n*32+F.numberOfTrailingZeros(i);return a>e?e:a};t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e};t.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size){throw new I}if(e===t){return}e--;var r=Math.floor(t/32);var n=Math.floor(e/32);var i=this.bits;for(var o=r;o<=n;o++){var a=o>r?0:t&31;var u=o<n?31:e&31;var s=(2<<u)-(1<<a);i[o]|=s}};t.prototype.clear=function(){var t=this.bits.length;var e=this.bits;for(var r=0;r<t;r++){e[r]=0}};t.prototype.isRange=function(t,e,r){if(e<t||t<0||e>this.size){throw new I}if(e===t){return true}e--;var n=Math.floor(t/32);var i=Math.floor(e/32);var o=this.bits;for(var a=n;a<=i;a++){var u=a>n?0:t&31;var s=a<i?31:e&31;var f=(2<<s)-(1<<u)&4294967295;if((o[a]&f)!==(r?f:0)){return false}}return true};t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1);if(t){this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)}this.size++};t.prototype.appendBits=function(t,e){if(e<0||e>32){throw new I("Num bits must be between 0 and 32")}this.ensureCapacity(this.size+e);for(var r=e;r>0;r--){this.appendBit((t>>r-1&1)===1)}};t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r<e;r++){this.appendBit(t.get(r))}};t.prototype.xor=function(t){if(this.size!==t.size){throw new I("Sizes don't match")}var e=this.bits;for(var r=0,n=e.length;r<n;r++){e[r]^=t.bits[r]}};t.prototype.toBytes=function(t,e,r,n){for(var i=0;i<n;i++){var o=0;for(var a=0;a<8;a++){if(this.get(t)){o|=1<<7-a}t++}e[r+i]=o}};t.prototype.getBitArray=function(){return this.bits};t.prototype.reverse=function(){var t=new Int32Array(this.bits.length);var e=Math.floor((this.size-1)/32);var r=e+1;var n=this.bits;for(var i=0;i<r;i++){var o=n[i];o=o>>1&1431655765|(o&1431655765)<<1;o=o>>2&858993459|(o&858993459)<<2;o=o>>4&252645135|(o&252645135)<<4;o=o>>8&16711935|(o&16711935)<<8;o=o>>16&65535|(o&65535)<<16;t[e-i]=o}if(this.size!==r*32){var a=r*32-this.size;var u=t[0]>>>a;for(var i=1;i<r;i++){var s=t[i];u|=s<<32-a;t[i-1]=u;u=s>>>a}t[r-1]=u}this.bits=t};t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.size===r.size&&L.equals(this.bits,r.bits)};t.prototype.hashCode=function(){return 31*this.size+L.hashCode(this.bits)};t.prototype.toString=function(){var t="";for(var e=0,r=this.size;e<r;e++){if((e&7)===0){t+=" "}t+=this.get(e)?"X":"."}return t};t.prototype.clone=function(){return new t(this.size,this.bits.slice())};return t}();var k;(function(t){t[t["OTHER"]=0]="OTHER";t[t["PURE_BARCODE"]=1]="PURE_BARCODE";t[t["POSSIBLE_FORMATS"]=2]="POSSIBLE_FORMATS";t[t["TRY_HARDER"]=3]="TRY_HARDER";t[t["CHARACTER_SET"]=4]="CHARACTER_SET";t[t["ALLOWED_LENGTHS"]=5]="ALLOWED_LENGTHS";t[t["ASSUME_CODE_39_CHECK_DIGIT"]=6]="ASSUME_CODE_39_CHECK_DIGIT";t[t["ASSUME_GS1"]=7]="ASSUME_GS1";t[t["RETURN_CODABAR_START_END"]=8]="RETURN_CODABAR_START_END";t[t["NEED_RESULT_POINT_CALLBACK"]=9]="NEED_RESULT_POINT_CALLBACK";t[t["ALLOWED_EAN_EXTENSIONS"]=10]="ALLOWED_EAN_EXTENSIONS"})(k||(k={}));var V=k;var U=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var H=function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.getFormatInstance=function(){return new e};e.kind="FormatException";return e}(A);var G=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var X;(function(t){t[t["Cp437"]=0]="Cp437";t[t["ISO8859_1"]=1]="ISO8859_1";t[t["ISO8859_2"]=2]="ISO8859_2";t[t["ISO8859_3"]=3]="ISO8859_3";t[t["ISO8859_4"]=4]="ISO8859_4";t[t["ISO8859_5"]=5]="ISO8859_5";t[t["ISO8859_6"]=6]="ISO8859_6";t[t["ISO8859_7"]=7]="ISO8859_7";t[t["ISO8859_8"]=8]="ISO8859_8";t[t["ISO8859_9"]=9]="ISO8859_9";t[t["ISO8859_10"]=10]="ISO8859_10";t[t["ISO8859_11"]=11]="ISO8859_11";t[t["ISO8859_13"]=12]="ISO8859_13";t[t["ISO8859_14"]=13]="ISO8859_14";t[t["ISO8859_15"]=14]="ISO8859_15";t[t["ISO8859_16"]=15]="ISO8859_16";t[t["SJIS"]=16]="SJIS";t[t["Cp1250"]=17]="Cp1250";t[t["Cp1251"]=18]="Cp1251";t[t["Cp1252"]=19]="Cp1252";t[t["Cp1256"]=20]="Cp1256";t[t["UnicodeBigUnmarked"]=21]="UnicodeBigUnmarked";t[t["UTF8"]=22]="UTF8";t[t["ASCII"]=23]="ASCII";t[t["Big5"]=24]="Big5";t[t["GB18030"]=25]="GB18030";t[t["EUC_KR"]=26]="EUC_KR"})(X||(X={}));var W=function(){function t(e,r,n){var i,o;var a=[];for(var u=3;u<arguments.length;u++){a[u-3]=arguments[u]}this.valueIdentifier=e;this.name=n;if(typeof r==="number"){this.values=Int32Array.from([r])}else{this.values=r}this.otherEncodingNames=a;t.VALUE_IDENTIFIER_TO_ECI.set(e,this);t.NAME_TO_ECI.set(n,this);var s=this.values;for(var f=0,c=s.length;f!==c;f++){var l=s[f];t.VALUES_TO_ECI.set(l,this)}try{for(var h=G(a),d=h.next();!d.done;d=h.next()){var v=d.value;t.NAME_TO_ECI.set(v,this)}}catch(t){i={error:t}}finally{try{if(d&&!d.done&&(o=h.return))o.call(h)}finally{if(i)throw i.error}}}t.prototype.getValueIdentifier=function(){return this.valueIdentifier};t.prototype.getName=function(){return this.name};t.prototype.getValue=function(){return this.values[0]};t.getCharacterSetECIByValue=function(e){if(e<0||e>=900){throw new H("incorect value")}var r=t.VALUES_TO_ECI.get(e);if(undefined===r){throw new H("incorect value")}return r};t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(undefined===r){throw new H("incorect value")}return r};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.getName()===r.getName()};t.VALUE_IDENTIFIER_TO_ECI=new Map;t.VALUES_TO_ECI=new Map;t.NAME_TO_ECI=new Map;t.Cp437=new t(X.Cp437,Int32Array.from([0,2]),"Cp437");t.ISO8859_1=new t(X.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1");t.ISO8859_2=new t(X.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2");t.ISO8859_3=new t(X.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3");t.ISO8859_4=new t(X.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4");t.ISO8859_5=new t(X.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5");t.ISO8859_6=new t(X.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6");t.ISO8859_7=new t(X.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7");t.ISO8859_8=new t(X.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8");t.ISO8859_9=new t(X.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9");t.ISO8859_10=new t(X.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10");t.ISO8859_11=new t(X.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11");t.ISO8859_13=new t(X.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13");t.ISO8859_14=new t(X.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14");t.ISO8859_15=new t(X.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15");t.ISO8859_16=new t(X.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16");t.SJIS=new t(X.SJIS,20,"SJIS","Shift_JIS");t.Cp1250=new t(X.Cp1250,21,"Cp1250","windows-1250");t.Cp1251=new t(X.Cp1251,22,"Cp1251","windows-1251");t.Cp1252=new t(X.Cp1252,23,"Cp1252","windows-1252");t.Cp1256=new t(X.Cp1256,24,"Cp1256","windows-1256");t.UnicodeBigUnmarked=new t(X.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig");t.UTF8=new t(X.UTF8,26,"UTF8","UTF-8");t.ASCII=new t(X.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII");t.Big5=new t(X.Big5,28,"Big5");t.GB18030=new t(X.GB18030,29,"GB18030","GB2312","EUC_CN","GBK");t.EUC_KR=new t(X.EUC_KR,30,"EUC_KR","EUC-KR");return t}();var j=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var z=function(t){j(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="UnsupportedOperationException";return e}(A);var Y=function(){function t(){}t.decode=function(t,e){var r=this.encodingName(e);if(this.customDecoder){return this.customDecoder(t,r)}if(typeof TextDecoder==="undefined"||this.shouldDecodeOnFallback(r)){return this.decodeFallback(t,r)}return new TextDecoder(r).decode(t)};t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"};t.encode=function(t,e){var r=this.encodingName(e);if(this.customEncoder){return this.customEncoder(t,r)}if(typeof TextEncoder==="undefined"){return this.encodeFallback(t)}return(new TextEncoder).encode(t)};t.isBrowser=function(){return typeof window!=="undefined"&&{}.toString.call(window)==="[object Window]"};t.encodingName=function(t){return typeof t==="string"?t:t.getName()};t.encodingCharacterSet=function(t){if(t instanceof W){return t}return W.getCharacterSetECIByName(t)};t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){var i="";for(var o=0,a=e.length;o<a;o++){var u=e[o].toString(16);if(u.length<2){u="0"+u}i+="%"+u}return decodeURIComponent(i)}if(n.equals(W.UnicodeBigUnmarked)){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))}throw new z("Encoding "+this.encodingName(r)+" not supported by fallback.")};t.isDecodeFallbackSupported=function(t){return t.equals(W.UTF8)||t.equals(W.ISO8859_1)||t.equals(W.ASCII)};t.encodeFallback=function(t){var e=btoa(unescape(encodeURIComponent(t)));var r=e.split("");var n=[];for(var i=0;i<r.length;i++){n.push(r[i].charCodeAt(0))}return new Uint8Array(n)};return t}();var Z=function(){function t(){}t.castAsNonUtf8Char=function(t,e){if(e===void 0){e=null}var r=e?e.getName():this.ISO88591;return Y.decode(new Uint8Array([t]),r)};t.guessEncoding=function(e,r){if(r!==null&&r!==undefined&&undefined!==r.get(V.CHARACTER_SET)){return r.get(V.CHARACTER_SET).toString()}var n=e.length;var i=true;var o=true;var a=true;var u=0;var s=0;var f=0;var c=0;var l=0;var h=0;var d=0;var v=0;var p=0;var g=0;var y=0;var w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191;for(var _=0;_<n&&(i||o||a);_++){var A=e[_]&255;if(a){if(u>0){if((A&128)===0){a=false}else{u--}}else if((A&128)!==0){if((A&64)===0){a=false}else{u++;if((A&32)===0){s++}else{u++;if((A&16)===0){f++}else{u++;if((A&8)===0){c++}else{a=false}}}}}}if(i){if(A>127&&A<160){i=false}else if(A>159){if(A<192||A===215||A===247){y++}}}if(o){if(l>0){if(A<64||A===127||A>252){o=false}else{l--}}else if(A===128||A===160||A>239){o=false}else if(A>160&&A<224){h++;v=0;d++;if(d>p){p=d}}else if(A>127){l++;d=0;v++;if(v>g){g=v}}else{d=0;v=0}}}if(a&&u>0){a=false}if(o&&l>0){o=false}if(a&&(w||s+f+c>0)){return t.UTF8}if(o&&(t.ASSUME_SHIFT_JIS||p>=3||g>=3)){return t.SHIFT_JIS}if(i&&o){return p===2&&h===2||y*10>=n?t.SHIFT_JIS:t.ISO88591}if(i){return t.ISO88591}if(o){return t.SHIFT_JIS}if(a){return t.UTF8}return t.PLATFORM_DEFAULT_ENCODING};t.format=function(t){var e=[];for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}var n=-1;function i(t,r,i,o,a,u){if(t==="%%")return"%";if(e[++n]===undefined)return undefined;t=o?parseInt(o.substr(1)):undefined;var s=a?parseInt(a.substr(1)):undefined;var f;switch(u){case"s":f=e[n];break;case"c":f=e[n][0];break;case"f":f=parseFloat(e[n]).toFixed(t);break;case"p":f=parseFloat(e[n]).toPrecision(t);break;case"e":f=parseFloat(e[n]).toExponential(t);break;case"x":f=parseInt(e[n]).toString(s?s:16);break;case"d":f=parseFloat(parseInt(e[n],s?s:10).toPrecision(t)).toFixed(0);break}f=typeof f==="object"?JSON.stringify(f):(+f).toString(s);var c=parseInt(i);var l=i&&i[0]+""==="0"?"0":" ";while(f.length<c)f=r!==undefined?f+l:l+f;return f}var o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,i)};t.getBytes=function(t,e){return Y.encode(t,e)};t.getCharCode=function(t,e){if(e===void 0){e=0}return t.charCodeAt(e)};t.getCharAt=function(t){return String.fromCharCode(t)};t.SHIFT_JIS=W.SJIS.getName();t.GB2312="GB2312";t.ISO88591=W.ISO8859_1.getName();t.EUC_JP="EUC_JP";t.UTF8=W.UTF8.getName();t.PLATFORM_DEFAULT_ENCODING=t.UTF8;t.ASSUME_SHIFT_JIS=false;return t}();var K=function(){function t(t){if(t===void 0){t=""}this.value=t}t.prototype.enableDecoding=function(t){this.encoding=t;return this};t.prototype.append=function(t){if(typeof t==="string"){this.value+=t.toString()}else if(this.encoding){this.value+=Z.castAsNonUtf8Char(t,this.encoding)}else{this.value+=String.fromCharCode(t)}return this};t.prototype.appendChars=function(t,e,r){for(var n=e;e<e+r;n++){this.append(t[n])}return this};t.prototype.length=function(){return this.value.length};t.prototype.charAt=function(t){return this.value.charAt(t)};t.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)};t.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)};t.prototype.substring=function(t,e){return this.value.substring(t,e)};t.prototype.setLengthToZero=function(){this.value=""};t.prototype.toString=function(){return this.value};t.prototype.insert=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)};return t}();var q=function(){function t(t,e,r,n){this.width=t;this.height=e;this.rowSize=r;this.bits=n;if(undefined===e||null===e){e=t}this.height=e;if(t<1||e<1){throw new I("Both dimensions must be greater than 0")}if(undefined===r||null===r){r=Math.floor((t+31)/32)}this.rowSize=r;if(undefined===n||null===n){this.bits=new Int32Array(this.rowSize*this.height)}}t.parseFromBooleanArray=function(e){var r=e.length;var n=e[0].length;var i=new t(n,r);for(var o=0;o<r;o++){var a=e[o];for(var u=0;u<n;u++){if(a[u]){i.set(u,o)}}}return i};t.parseFromString=function(e,r,n){if(e===null){throw new I("stringRepresentation cannot be null")}var i=new Array(e.length);var o=0;var a=0;var u=-1;var s=0;var f=0;while(f<e.length){if(e.charAt(f)==="\n"||e.charAt(f)==="\r"){if(o>a){if(u===-1){u=o-a}else if(o-a!==u){throw new I("row lengths do not match")}a=o;s++}f++}else if(e.substring(f,f+r.length)===r){f+=r.length;i[o]=true;o++}else if(e.substring(f,f+n.length)===n){f+=n.length;i[o]=false;o++}else{throw new I("illegal character encountered: "+e.substring(f))}}if(o>a){if(u===-1){u=o-a}else if(o-a!==u){throw new I("row lengths do not match")}s++}var c=new t(u,s);for(var l=0;l<o;l++){if(i[l]){c.set(Math.floor(l%u),Math.floor(l/u))}}return c};t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return(this.bits[r]>>>(t&31)&1)!==0};t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(t&31)&4294967295};t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(t&31)&4294967295)};t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(t&31)&4294967295};t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize()){throw new I("input matrix dimensions do not match")}var e=new x(Math.floor(this.width/32)+1);var r=this.rowSize;var n=this.bits;for(var i=0,o=this.height;i<o;i++){var a=i*r;var u=t.getRow(i,e).getBitArray();for(var s=0;s<r;s++){n[a+s]^=u[s]}}};t.prototype.clear=function(){var t=this.bits;var e=t.length;for(var r=0;r<e;r++){t[r]=0}};t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0){throw new I("Left and top must be nonnegative")}if(n<1||r<1){throw new I("Height and width must be at least 1")}var i=t+r;var o=e+n;if(o>this.height||i>this.width){throw new I("The region must fit inside the matrix")}var a=this.rowSize;var u=this.bits;for(var s=e;s<o;s++){var f=s*a;for(var c=t;c<i;c++){u[f+Math.floor(c/32)]|=1<<(c&31)&4294967295}}};t.prototype.getRow=function(t,e){if(e===null||e===undefined||e.getSize()<this.width){e=new x(this.width)}else{e.clear()}var r=this.rowSize;var n=this.bits;var i=t*r;for(var o=0;o<r;o++){e.setBulk(o*32,n[i+o])}return e};t.prototype.setRow=function(t,e){R.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)};t.prototype.rotate180=function(){var t=this.getWidth();var e=this.getHeight();var r=new x(t);var n=new x(t);for(var i=0,o=Math.floor((e+1)/2);i<o;i++){r=this.getRow(i,r);n=this.getRow(e-1-i,n);r.reverse();n.reverse();this.setRow(i,n);this.setRow(e-1-i,r)}};t.prototype.getEnclosingRectangle=function(){var t=this.width;var e=this.height;var r=this.rowSize;var n=this.bits;var i=t;var o=e;var a=-1;var u=-1;for(var s=0;s<e;s++){for(var f=0;f<r;f++){var c=n[s*r+f];if(c!==0){if(s<o){o=s}if(s>u){u=s}if(f*32<i){var l=0;while((c<<31-l&4294967295)===0){l++}if(f*32+l<i){i=f*32+l}}if(f*32+31>a){var l=31;while(c>>>l===0){l--}if(f*32+l>a){a=f*32+l}}}}}if(a<i||u<o){return null}return Int32Array.from([i,o,a-i+1,u-o+1])};t.prototype.getTopLeftOnBit=function(){var t=this.rowSize;var e=this.bits;var r=0;while(r<e.length&&e[r]===0){r++}if(r===e.length){return null}var n=r/t;var i=r%t*32;var o=e[r];var a=0;while((o<<31-a&4294967295)===0){a++}i+=a;return Int32Array.from([i,n])};t.prototype.getBottomRightOnBit=function(){var t=this.rowSize;var e=this.bits;var r=e.length-1;while(r>=0&&e[r]===0){r--}if(r<0){return null}var n=Math.floor(r/t);var i=Math.floor(r%t)*32;var o=e[r];var a=31;while(o>>>a===0){a--}i+=a;return Int32Array.from([i,n])};t.prototype.getWidth=function(){return this.width};t.prototype.getHeight=function(){return this.height};t.prototype.getRowSize=function(){return this.rowSize};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&L.equals(this.bits,r.bits)};t.prototype.hashCode=function(){var t=this.width;t=31*t+this.width;t=31*t+this.height;t=31*t+this.rowSize;t=31*t+L.hashCode(this.bits);return t};t.prototype.toString=function(t,e,r){if(t===void 0){t="X "}if(e===void 0){e="  "}if(r===void 0){r="\n"}return this.buildToString(t,e,r)};t.prototype.buildToString=function(t,e,r){var n=new K;for(var i=0,o=this.height;i<o;i++){for(var a=0,u=this.width;a<u;a++){n.append(this.get(a,i)?t:e)}n.append(r)}return n.toString()};t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())};return t}();var Q=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var J=function(t){Q(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.getNotFoundInstance=function(){return new e};e.kind="NotFoundException";return e}(A);var $=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var tt=function(t){$(e,t);function e(r){var n=t.call(this,r)||this;n.luminances=e.EMPTY;n.buckets=new Int32Array(e.LUMINANCE_BUCKETS);return n}e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource();var i=n.getWidth();if(r===undefined||r===null||r.getSize()<i){r=new x(i)}else{r.clear()}this.initArrays(i);var o=n.getRow(t,this.luminances);var a=this.buckets;for(var u=0;u<i;u++){a[(o[u]&255)>>e.LUMINANCE_SHIFT]++}var s=e.estimateBlackPoint(a);if(i<3){for(var u=0;u<i;u++){if((o[u]&255)<s){r.set(u)}}}else{var f=o[0]&255;var c=o[1]&255;for(var u=1;u<i-1;u++){var l=o[u+1]&255;if((c*4-f-l)/2<s){r.set(u)}f=c;c=l}}return r};e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource();var r=t.getWidth();var n=t.getHeight();var i=new q(r,n);this.initArrays(r);var o=this.buckets;for(var a=1;a<5;a++){var u=Math.floor(n*a/5);var s=t.getRow(u,this.luminances);var f=Math.floor(r*4/5);for(var c=Math.floor(r/5);c<f;c++){var l=s[c]&255;o[l>>e.LUMINANCE_SHIFT]++}}var h=e.estimateBlackPoint(o);var d=t.getMatrix();for(var a=0;a<n;a++){var v=a*r;for(var c=0;c<r;c++){var l=d[v+c]&255;if(l<h){i.set(c,a)}}}return i};e.prototype.createBinarizer=function(t){return new e(t)};e.prototype.initArrays=function(t){if(this.luminances.length<t){this.luminances=new Uint8ClampedArray(t)}var r=this.buckets;for(var n=0;n<e.LUMINANCE_BUCKETS;n++){r[n]=0}};e.estimateBlackPoint=function(t){var r=t.length;var n=0;var i=0;var o=0;for(var a=0;a<r;a++){if(t[a]>o){i=a;o=t[a]}if(t[a]>n){n=t[a]}}var u=0;var s=0;for(var a=0;a<r;a++){var f=a-i;var c=t[a]*f*f;if(c>s){u=a;s=c}}if(i>u){var l=i;i=u;u=l}if(u-i<=r/16){throw new J}var h=u-1;var d=-1;for(var a=u-1;a>i;a--){var v=a-i;var c=v*v*(u-a)*(n-t[a]);if(c>d){h=a;d=c}}return h<<e.LUMINANCE_SHIFT};e.LUMINANCE_BITS=5;e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS;e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS;e.EMPTY=Uint8ClampedArray.from([0]);return e}(b);var et=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var rt=function(t){et(e,t);function e(e){var r=t.call(this,e)||this;r.matrix=null;return r}e.prototype.getBlackMatrix=function(){if(this.matrix!==null){return this.matrix}var r=this.getLuminanceSource();var n=r.getWidth();var i=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&i>=e.MINIMUM_DIMENSION){var o=r.getMatrix();var a=n>>e.BLOCK_SIZE_POWER;if((n&e.BLOCK_SIZE_MASK)!==0){a++}var u=i>>e.BLOCK_SIZE_POWER;if((i&e.BLOCK_SIZE_MASK)!==0){u++}var s=e.calculateBlackPoints(o,a,u,n,i);var f=new q(n,i);e.calculateThresholdForBlock(o,a,u,n,i,s,f);this.matrix=f}else{this.matrix=t.prototype.getBlackMatrix.call(this)}return this.matrix};e.prototype.createBinarizer=function(t){return new e(t)};e.calculateThresholdForBlock=function(t,r,n,i,o,a,u){var s=o-e.BLOCK_SIZE;var f=i-e.BLOCK_SIZE;for(var c=0;c<n;c++){var l=c<<e.BLOCK_SIZE_POWER;if(l>s){l=s}var h=e.cap(c,2,n-3);for(var d=0;d<r;d++){var v=d<<e.BLOCK_SIZE_POWER;if(v>f){v=f}var p=e.cap(d,2,r-3);var g=0;for(var y=-2;y<=2;y++){var w=a[h+y];g+=w[p-2]+w[p-1]+w[p]+w[p+1]+w[p+2]}var _=g/25;e.thresholdBlock(t,v,l,_,i,u)}}};e.cap=function(t,e,r){return t<e?e:t>r?r:t};e.thresholdBlock=function(t,r,n,i,o,a){for(var u=0,s=n*o+r;u<e.BLOCK_SIZE;u++,s+=o){for(var f=0;f<e.BLOCK_SIZE;f++){if((t[s+f]&255)<=i){a.set(r+f,n+u)}}}};e.calculateBlackPoints=function(t,r,n,i,o){var a=o-e.BLOCK_SIZE;var u=i-e.BLOCK_SIZE;var s=new Array(n);for(var f=0;f<n;f++){s[f]=new Int32Array(r);var c=f<<e.BLOCK_SIZE_POWER;if(c>a){c=a}for(var l=0;l<r;l++){var h=l<<e.BLOCK_SIZE_POWER;if(h>u){h=u}var d=0;var v=255;var p=0;for(var g=0,y=c*i+h;g<e.BLOCK_SIZE;g++,y+=i){for(var w=0;w<e.BLOCK_SIZE;w++){var _=t[y+w]&255;d+=_;if(_<v){v=_}if(_>p){p=_}}if(p-v>e.MIN_DYNAMIC_RANGE){for(g++,y+=i;g<e.BLOCK_SIZE;g++,y+=i){for(var w=0;w<e.BLOCK_SIZE;w++){d+=t[y+w]&255}}}}var A=d>>e.BLOCK_SIZE_POWER*2;if(p-v<=e.MIN_DYNAMIC_RANGE){A=v/2;if(f>0&&l>0){var m=(s[f-1][l]+2*s[f][l-1]+s[f-1][l-1])/4;if(v<m){A=m}}}s[f][l]=A}}return s};e.BLOCK_SIZE_POWER=3;e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER;e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1;e.MINIMUM_DIMENSION=e.BLOCK_SIZE*5;e.MIN_DYNAMIC_RANGE=24;return e}(tt);var nt=function(){function t(t,e){this.width=t;this.height=e}t.prototype.getWidth=function(){return this.width};t.prototype.getHeight=function(){return this.height};t.prototype.isCropSupported=function(){return false};t.prototype.crop=function(t,e,r,n){throw new z("This luminance source does not support cropping.")};t.prototype.isRotateSupported=function(){return false};t.prototype.rotateCounterClockwise=function(){throw new z("This luminance source does not support rotation by 90 degrees.")};t.prototype.rotateCounterClockwise45=function(){throw new z("This luminance source does not support rotation by 45 degrees.")};t.prototype.toString=function(){var t=new Uint8ClampedArray(this.width);var e=new K;for(var r=0;r<this.height;r++){var n=this.getRow(r,t);for(var i=0;i<this.width;i++){var o=n[i]&255;var a=void 0;if(o<64){a="#"}else if(o<128){a="+"}else if(o<192){a="."}else{a=" "}e.append(a)}e.append("\n")}return e.toString()};return t}();var it=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ot=function(t){it(e,t);function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;r.delegate=e;return r}e.prototype.getRow=function(t,e){var r=this.delegate.getRow(t,e);var n=this.getWidth();for(var i=0;i<n;i++){r[i]=255-(r[i]&255)}return r};e.prototype.getMatrix=function(){var t=this.delegate.getMatrix();var e=this.getWidth()*this.getHeight();var r=new Uint8ClampedArray(e);for(var n=0;n<e;n++){r[n]=255-(t[n]&255)}return r};e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()};e.prototype.crop=function(t,r,n,i){return new e(this.delegate.crop(t,r,n,i))};e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()};e.prototype.invert=function(){return this.delegate};e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())};e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())};return e}(nt);var at=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ut=function(t){at(e,t);function e(r){var n=t.call(this,r.width,r.height)||this;n.canvas=r;n.tempCanvasElement=null;n.buffer=e.makeBufferFromCanvasImageData(r);return n}e.makeBufferFromCanvasImageData=function(t){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(r.data,t.width,t.height)};e.toGrayscaleBuffer=function(t,e,r){var n=new Uint8ClampedArray(e*r);for(var i=0,o=0,a=t.length;i<a;i+=4,o++){var u=void 0;var s=t[i+3];if(s===0){u=255}else{var f=t[i];var c=t[i+1];var l=t[i+2];u=306*f+601*c+117*l+512>>10}n[o]=u}return n};e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight()){throw new I("Requested row is outside the image: "+t)}var r=this.getWidth();var n=t*r;if(e===null){e=this.buffer.slice(n,n+r)}else{if(e.length<r){e=new Uint8ClampedArray(r)}e.set(this.buffer.slice(n,n+r))}return e};e.prototype.getMatrix=function(){return this.buffer};e.prototype.isCropSupported=function(){return true};e.prototype.crop=function(e,r,n,i){t.prototype.crop.call(this,e,r,n,i);return this};e.prototype.isRotateSupported=function(){return true};e.prototype.rotateCounterClockwise=function(){this.rotate(-90);return this};e.prototype.rotateCounterClockwise45=function(){this.rotate(-45);return this};e.prototype.getTempCanvasElement=function(){if(null===this.tempCanvasElement){var t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width;t.height=this.canvas.height;this.tempCanvasElement=t}return this.tempCanvasElement};e.prototype.rotate=function(t){var r=this.getTempCanvasElement();var n=r.getContext("2d");var i=t*e.DEGREE_TO_RADIANS;var o=this.canvas.width;var a=this.canvas.height;var u=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*a);var s=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*a);r.width=u;r.height=s;n.translate(u/2,s/2);n.rotate(i);n.drawImage(this.canvas,o/-2,a/-2);this.buffer=e.makeBufferFromCanvasImageData(r);return this};e.prototype.invert=function(){return new ot(this)};e.DEGREE_TO_RADIANS=Math.PI/180;return e}(nt);var st=function(){function t(t,e,r){this.deviceId=t;this.label=e;this.kind="videoinput";this.groupId=r||undefined}t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}};return t}();var ft=undefined&&undefined.__awaiter||function(t,e,r,n){function i(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,o){function a(t){try{s(n.next(t))}catch(t){o(t)}}function u(t){try{s(n["throw"](t))}catch(t){o(t)}}function s(t){t.done?r(t.value):i(t.value).then(a,u)}s((n=n.apply(t,e||[])).next())})};var ct=undefined&&undefined.__generator||function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return s([t,e])}}function s(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=e.call(t,r)}catch(t){a=[6,t];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var lt=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ht=function(){function t(t,e,r){if(e===void 0){e=500}this.reader=t;this.timeBetweenScansMillis=e;this._hints=r;this._stopContinuousDecode=false;this._stopAsyncDecode=false;this._timeBetweenDecodingAttempts=0}Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator!=="undefined"},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:false,configurable:true});t.prototype.listVideoInputDevices=function(){return ft(this,void 0,void 0,function(){var t,e,r,n,i,o,a,u,s,f;var c,l;return ct(this,function(h){switch(h.label){case 0:if(!this.hasNavigator){throw new Error("Can't enumerate devices, navigator is not present.")}if(!this.canEnumerateDevices){throw new Error("Can't enumerate devices, method not supported.")}return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=h.sent();e=[];try{for(r=lt(t),n=r.next();!n.done;n=r.next()){i=n.value;o=i.kind==="video"?"videoinput":i.kind;if(o!=="videoinput"){continue}a=i.deviceId||i.id;u=i.label||"Video device "+(e.length+1);s=i.groupId;f={deviceId:a,label:u,kind:o,groupId:s};e.push(f)}}catch(t){c={error:t}}finally{try{if(n&&!n.done&&(l=r.return))l.call(r)}finally{if(c)throw c.error}}return[2,e]}})})};t.prototype.getVideoInputDevices=function(){return ft(this,void 0,void 0,function(){var t;return ct(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:t=e.sent();return[2,t.map(function(t){return new st(t.deviceId,t.label)})]}})})};t.prototype.findDeviceById=function(t){return ft(this,void 0,void 0,function(){var e;return ct(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:e=r.sent();if(!e){return[2,null]}return[2,e.find(function(e){return e.deviceId===t})]}})})};t.prototype.decodeFromInputVideoDevice=function(t,e){return ft(this,void 0,void 0,function(){return ct(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}})})};t.prototype.decodeOnceFromVideoDevice=function(t,e){return ft(this,void 0,void 0,function(){var r,n;return ct(this,function(i){switch(i.label){case 0:this.reset();if(!t){r={facingMode:"environment"}}else{r={deviceId:{exact:t}}}n={video:r};return[4,this.decodeOnceFromConstraints(n,e)];case 1:return[2,i.sent()]}})})};t.prototype.decodeOnceFromConstraints=function(t,e){return ft(this,void 0,void 0,function(){var r;return ct(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:r=n.sent();return[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})};t.prototype.decodeOnceFromStream=function(t,e){return ft(this,void 0,void 0,function(){var r,n;return ct(this,function(i){switch(i.label){case 0:this.reset();return[4,this.attachStreamToVideo(t,e)];case 1:r=i.sent();return[4,this.decodeOnce(r)];case 2:n=i.sent();return[2,n]}})})};t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return ft(this,void 0,void 0,function(){return ct(this,function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}})})};t.prototype.decodeFromVideoDevice=function(t,e,r){return ft(this,void 0,void 0,function(){var n,i;return ct(this,function(o){switch(o.label){case 0:if(!t){n={facingMode:"environment"}}else{n={deviceId:{exact:t}}}i={video:n};return[4,this.decodeFromConstraints(i,e,r)];case 1:return[2,o.sent()]}})})};t.prototype.decodeFromConstraints=function(t,e,r){return ft(this,void 0,void 0,function(){var n;return ct(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:n=i.sent();return[4,this.decodeFromStream(n,e,r)];case 2:return[2,i.sent()]}})})};t.prototype.decodeFromStream=function(t,e,r){return ft(this,void 0,void 0,function(){var n;return ct(this,function(i){switch(i.label){case 0:this.reset();return[4,this.attachStreamToVideo(t,e)];case 1:n=i.sent();return[4,this.decodeContinuously(n,r)];case 2:return[2,i.sent()]}})})};t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=true};t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=true};t.prototype.attachStreamToVideo=function(t,e){return ft(this,void 0,void 0,function(){var r;return ct(this,function(n){switch(n.label){case 0:r=this.prepareVideoElement(e);this.addVideoSource(r,t);this.videoElement=r;this.stream=t;return[4,this.playVideoOnLoadAsync(r)];case 1:n.sent();return[2,r]}})})};t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(r,n){return e.playVideoOnLoad(t,function(){return r()})})};t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()};this.videoCanPlayListener=function(){return r.tryPlayVideo(t)};t.addEventListener("ended",this.videoEndedListener);t.addEventListener("canplay",this.videoCanPlayListener);t.addEventListener("playing",e);this.tryPlayVideo(t)};t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2};t.prototype.tryPlayVideo=function(t){return ft(this,void 0,void 0,function(){return ct(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t)){console.warn("Trying to play video that is already playing.");return[2]}e.label=1;case 1:e.trys.push([1,3,,4]);return[4,t.play()];case 2:e.sent();return[3,4];case 3:e.sent();console.warn("It was not possible to play the video.");return[3,4];case 4:return[2]}})})};t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r){throw new E("element with id '"+t+"' not found")}if(r.nodeName.toLowerCase()!==e.toLowerCase()){throw new E("element with id '"+t+"' must be an "+e+" element")}return r};t.prototype.decodeFromImage=function(t,e){if(!t&&!e){throw new E("either imageElement with a src set or an url must be provided")}if(e&&!t){return this.decodeFromImageUrl(e)}return this.decodeFromImageElement(t)};t.prototype.decodeFromVideo=function(t,e){if(!t&&!e){throw new E("Either an element with a src set or an URL must be provided")}if(e&&!t){return this.decodeFromVideoUrl(e)}return this.decodeFromVideoElement(t)};t.prototype.decodeFromVideoContinuously=function(t,e,r){if(undefined===t&&undefined===e){throw new E("Either an element with a src set or an URL must be provided")}if(e&&!t){return this.decodeFromVideoUrlContinuously(e,r)}return this.decodeFromVideoElementContinuously(t,r)};t.prototype.decodeFromImageElement=function(t){if(!t){throw new E("An image element must be provided.")}this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var r;if(this.isImageLoaded(e)){r=this.decodeOnce(e,false,true)}else{r=this._decodeOnLoadImage(e)}return r};t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)};t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)};t.prototype._decodeFromVideoElementSetup=function(t){if(!t){throw new E("A video element must be provided.")}this.reset();var e=this.prepareVideoElement(t);this.videoElement=e;return e};t.prototype.decodeFromImageUrl=function(t){if(!t){throw new E("An URL must be provided.")}this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);e.src=t;return r};t.prototype.decodeFromVideoUrl=function(t){if(!t){throw new E("An URL must be provided.")}this.reset();var e=this.prepareVideoElement();var r=this.decodeFromVideoElement(e);e.src=t;return r};t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t){throw new E("An URL must be provided.")}this.reset();var r=this.prepareVideoElement();var n=this.decodeFromVideoElementContinuously(r,e);r.src=t;return n};t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,false,true).then(r,n)};t.addEventListener("load",e.imageLoadedListener)})};t.prototype._decodeOnLoadVideo=function(t){return ft(this,void 0,void 0,function(){return ct(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:e.sent();return[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})};t.prototype._decodeOnLoadVideoContinuously=function(t,e){return ft(this,void 0,void 0,function(){return ct(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:r.sent();this.decodeContinuously(t,e);return[2]}})})};t.prototype.isImageLoaded=function(t){if(!t.complete){return false}if(t.naturalWidth===0){return false}return true};t.prototype.prepareImageElement=function(t){var e;if(typeof t==="undefined"){e=document.createElement("img");e.width=200;e.height=200}if(typeof t==="string"){e=this.getMediaElement(t,"img")}if(t instanceof HTMLImageElement){e=t}return e};t.prototype.prepareVideoElement=function(t){var e;if(!t&&typeof document!=="undefined"){e=document.createElement("video");e.width=200;e.height=200}if(typeof t==="string"){e=this.getMediaElement(t,"video")}if(t instanceof HTMLVideoElement){e=t}e.setAttribute("autoplay","true");e.setAttribute("muted","true");e.setAttribute("playsinline","true");return e};t.prototype.decodeOnce=function(t,e,r){var n=this;if(e===void 0){e=true}if(r===void 0){r=true}this._stopAsyncDecode=false;var i=function(o,a){if(n._stopAsyncDecode){a(new J("Video stream has ended before any code could be detected."));n._stopAsyncDecode=undefined;return}try{var u=n.decode(t);o(u)}catch(t){var s=e&&t instanceof J;var f=t instanceof T||t instanceof H;var c=f&&r;if(s||c){return setTimeout(i,n._timeBetweenDecodingAttempts,o,a)}a(t)}};return new Promise(function(t,e){return i(t,e)})};t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=false;var n=function(){if(r._stopContinuousDecode){r._stopContinuousDecode=undefined;return}try{var i=r.decode(t);e(i,null);setTimeout(n,r.timeBetweenScansMillis)}catch(t){e(null,t);var o=t instanceof T||t instanceof H;var a=t instanceof J;if(o||a){setTimeout(n,r._timeBetweenDecodingAttempts)}}};n()};t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)};t.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);this.drawImageOnCanvas(e,t);var r=this.getCaptureCanvas(t);var n=new ut(r);var i=new rt(n);return new S(i)};t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t);var r=e.getContext("2d");this.captureCanvasContext=r}return this.captureCanvasContext};t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas};t.prototype.drawImageOnCanvas=function(t,e){t.drawImage(e,0,0)};t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)};t.prototype.createCaptureCanvas=function(t){if(typeof document==="undefined"){this._destroyCaptureCanvas();return null}var e=document.createElement("canvas");var r;var n;if(typeof t!=="undefined"){if(t instanceof HTMLVideoElement){r=t.videoWidth;n=t.videoHeight}else if(t instanceof HTMLImageElement){r=t.naturalWidth||t.width;n=t.naturalHeight||t.height}}e.style.width=r+"px";e.style.height=n+"px";e.width=r;e.height=n;return e};t.prototype.stopStreams=function(){if(this.stream){this.stream.getVideoTracks().forEach(function(t){return t.stop()});this.stream=undefined}if(this._stopAsyncDecode===false){this.stopAsyncDecode()}if(this._stopContinuousDecode===false){this.stopContinuousDecode()}};t.prototype.reset=function(){this.stopStreams();this._destroyVideoElement();this._destroyImageElement();this._destroyCaptureCanvas()};t.prototype._destroyVideoElement=function(){if(!this.videoElement){return}if(typeof this.videoEndedListener!=="undefined"){this.videoElement.removeEventListener("ended",this.videoEndedListener)}if(typeof this.videoPlayingEventListener!=="undefined"){this.videoElement.removeEventListener("playing",this.videoPlayingEventListener)}if(typeof this.videoCanPlayListener!=="undefined"){this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener)}this.cleanVideoSource(this.videoElement);this.videoElement=undefined};t.prototype._destroyImageElement=function(){if(!this.imageElement){return}if(undefined!==this.imageLoadedListener){this.imageElement.removeEventListener("load",this.imageLoadedListener)}this.imageElement.src=undefined;this.imageElement.removeAttribute("src");this.imageElement=undefined};t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=undefined;this.captureCanvas=undefined};t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}};t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")};return t}();var dt=function(){function t(t,e,r,n,i,o){if(r===void 0){r=e==null?0:8*e.length}if(o===void 0){o=R.currentTimeMillis()}this.text=t;this.rawBytes=e;this.numBits=r;this.resultPoints=n;this.format=i;this.timestamp=o;this.text=t;this.rawBytes=e;if(undefined===r||null===r){this.numBits=e===null||e===undefined?0:8*e.length}else{this.numBits=r}this.resultPoints=n;this.format=i;this.resultMetadata=null;if(undefined===o||null===o){this.timestamp=R.currentTimeMillis()}else{this.timestamp=o}}t.prototype.getText=function(){return this.text};t.prototype.getRawBytes=function(){return this.rawBytes};t.prototype.getNumBits=function(){return this.numBits};t.prototype.getResultPoints=function(){return this.resultPoints};t.prototype.getBarcodeFormat=function(){return this.format};t.prototype.getResultMetadata=function(){return this.resultMetadata};t.prototype.putMetadata=function(t,e){if(this.resultMetadata===null){this.resultMetadata=new Map}this.resultMetadata.set(t,e)};t.prototype.putAllMetadata=function(t){if(t!==null){if(this.resultMetadata===null){this.resultMetadata=t}else{this.resultMetadata=new Map(t)}}};t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null){this.resultPoints=t}else if(t!==null&&t.length>0){var r=new Array(e.length+t.length);R.arraycopy(e,0,r,0,e.length);R.arraycopy(t,0,r,e.length,t.length);this.resultPoints=r}};t.prototype.getTimestamp=function(){return this.timestamp};t.prototype.toString=function(){return this.text};return t}();var vt;(function(t){t[t["AZTEC"]=0]="AZTEC";t[t["CODABAR"]=1]="CODABAR";t[t["CODE_39"]=2]="CODE_39";t[t["CODE_93"]=3]="CODE_93";t[t["CODE_128"]=4]="CODE_128";t[t["DATA_MATRIX"]=5]="DATA_MATRIX";t[t["EAN_8"]=6]="EAN_8";t[t["EAN_13"]=7]="EAN_13";t[t["ITF"]=8]="ITF";t[t["MAXICODE"]=9]="MAXICODE";t[t["PDF_417"]=10]="PDF_417";t[t["QR_CODE"]=11]="QR_CODE";t[t["RSS_14"]=12]="RSS_14";t[t["RSS_EXPANDED"]=13]="RSS_EXPANDED";t[t["UPC_A"]=14]="UPC_A";t[t["UPC_E"]=15]="UPC_E";t[t["UPC_EAN_EXTENSION"]=16]="UPC_EAN_EXTENSION"})(vt||(vt={}));var pt=vt;var gt;(function(t){t[t["OTHER"]=0]="OTHER";t[t["ORIENTATION"]=1]="ORIENTATION";t[t["BYTE_SEGMENTS"]=2]="BYTE_SEGMENTS";t[t["ERROR_CORRECTION_LEVEL"]=3]="ERROR_CORRECTION_LEVEL";t[t["ISSUE_NUMBER"]=4]="ISSUE_NUMBER";t[t["SUGGESTED_PRICE"]=5]="SUGGESTED_PRICE";t[t["POSSIBLE_COUNTRY"]=6]="POSSIBLE_COUNTRY";t[t["UPC_EAN_EXTENSION"]=7]="UPC_EAN_EXTENSION";t[t["PDF417_EXTRA_METADATA"]=8]="PDF417_EXTRA_METADATA";t[t["STRUCTURED_APPEND_SEQUENCE"]=9]="STRUCTURED_APPEND_SEQUENCE";t[t["STRUCTURED_APPEND_PARITY"]=10]="STRUCTURED_APPEND_PARITY"})(gt||(gt={}));var yt=gt;var wt=function(){function t(t,e,r,n,i,o){if(i===void 0){i=-1}if(o===void 0){o=-1}this.rawBytes=t;this.text=e;this.byteSegments=r;this.ecLevel=n;this.structuredAppendSequenceNumber=i;this.structuredAppendParity=o;this.numBits=t===undefined||t===null?0:8*t.length}t.prototype.getRawBytes=function(){return this.rawBytes};t.prototype.getNumBits=function(){return this.numBits};t.prototype.setNumBits=function(t){this.numBits=t};t.prototype.getText=function(){return this.text};t.prototype.getByteSegments=function(){return this.byteSegments};t.prototype.getECLevel=function(){return this.ecLevel};t.prototype.getErrorsCorrected=function(){return this.errorsCorrected};t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t};t.prototype.getErasures=function(){return this.erasures};t.prototype.setErasures=function(t){this.erasures=t};t.prototype.getOther=function(){return this.other};t.prototype.setOther=function(t){this.other=t};t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0};t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity};t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber};return t}();var _t=function(){function t(){}t.prototype.exp=function(t){return this.expTable[t]};t.prototype.log=function(t){if(t===0){throw new I}return this.logTable[t]};t.addOrSubtract=function(t,e){return t^e};return t}();var At=function(){function t(t,e){if(e.length===0){throw new I}this.field=t;var r=e.length;if(r>1&&e[0]===0){var n=1;while(n<r&&e[n]===0){n++}if(n===r){this.coefficients=Int32Array.from([0])}else{this.coefficients=new Int32Array(r-n);R.arraycopy(e,n,this.coefficients,0,this.coefficients.length)}}else{this.coefficients=e}}t.prototype.getCoefficients=function(){return this.coefficients};t.prototype.getDegree=function(){return this.coefficients.length-1};t.prototype.isZero=function(){return this.coefficients[0]===0};t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]};t.prototype.evaluateAt=function(t){if(t===0){return this.getCoefficient(0)}var e=this.coefficients;var r;if(t===1){r=0;for(var n=0,i=e.length;n!==i;n++){var o=e[n];r=_t.addOrSubtract(r,o)}return r}r=e[0];var a=e.length;var u=this.field;for(var n=1;n<a;n++){r=_t.addOrSubtract(u.multiply(t,r),e[n])}return r};t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field)){throw new I("GenericGFPolys do not have same GenericGF field")}if(this.isZero()){return e}if(e.isZero()){return this}var r=this.coefficients;var n=e.coefficients;if(r.length>n.length){var i=r;r=n;n=i}var o=new Int32Array(n.length);var a=n.length-r.length;R.arraycopy(n,0,o,0,a);for(var u=a;u<n.length;u++){o[u]=_t.addOrSubtract(r[u-a],n[u])}return new t(this.field,o)};t.prototype.multiply=function(e){if(!this.field.equals(e.field)){throw new I("GenericGFPolys do not have same GenericGF field")}if(this.isZero()||e.isZero()){return this.field.getZero()}var r=this.coefficients;var n=r.length;var i=e.coefficients;var o=i.length;var a=new Int32Array(n+o-1);var u=this.field;for(var s=0;s<n;s++){var f=r[s];for(var c=0;c<o;c++){a[s+c]=_t.addOrSubtract(a[s+c],u.multiply(f,i[c]))}}return new t(u,a)};t.prototype.multiplyScalar=function(e){if(e===0){return this.field.getZero()}if(e===1){return this}var r=this.coefficients.length;var n=this.field;var i=new Int32Array(r);var o=this.coefficients;for(var a=0;a<r;a++){i[a]=n.multiply(o[a],e)}return new t(n,i)};t.prototype.multiplyByMonomial=function(e,r){if(e<0){throw new I}if(r===0){return this.field.getZero()}var n=this.coefficients;var i=n.length;var o=new Int32Array(i+e);var a=this.field;for(var u=0;u<i;u++){o[u]=a.multiply(n[u],r)}return new t(a,o)};t.prototype.divide=function(t){if(!this.field.equals(t.field)){throw new I("GenericGFPolys do not have same GenericGF field")}if(t.isZero()){throw new I("Divide by 0")}var e=this.field;var r=e.getZero();var n=this;var i=t.getCoefficient(t.getDegree());var o=e.inverse(i);while(n.getDegree()>=t.getDegree()&&!n.isZero()){var a=n.getDegree()-t.getDegree();var u=e.multiply(n.getCoefficient(n.getDegree()),o);var s=t.multiplyByMonomial(a,u);var f=e.buildMonomial(a,u);r=r.addOrSubtract(f);n=n.addOrSubtract(s)}return[r,n]};t.prototype.toString=function(){var t="";for(var e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(r!==0){if(r<0){t+=" - ";r=-r}else{if(t.length>0){t+=" + "}}if(e===0||r!==1){var n=this.field.log(r);if(n===0){t+="1"}else if(n===1){t+="a"}else{t+="a^";t+=n}}if(e!==0){if(e===1){t+="x"}else{t+="x^";t+=e}}}}return t};return t}();var mt=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Et=function(t){mt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="ArithmeticException";return e}(A);var Ct=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var It=function(t){Ct(e,t);function e(e,r,n){var i=t.call(this)||this;i.primitive=e;i.size=r;i.generatorBase=n;var o=new Int32Array(r);var a=1;for(var u=0;u<r;u++){o[u]=a;a*=2;if(a>=r){a^=e;a&=r-1}}i.expTable=o;var s=new Int32Array(r);for(var u=0;u<r-1;u++){s[o[u]]=u}i.logTable=s;i.zero=new At(i,Int32Array.from([0]));i.one=new At(i,Int32Array.from([1]));return i}e.prototype.getZero=function(){return this.zero};e.prototype.getOne=function(){return this.one};e.prototype.buildMonomial=function(t,e){if(t<0){throw new I}if(e===0){return this.zero}var r=new Int32Array(t+1);r[0]=e;return new At(this,r)};e.prototype.inverse=function(t){if(t===0){throw new Et}return this.expTable[this.size-this.logTable[t]-1]};e.prototype.multiply=function(t,e){if(t===0||e===0){return 0}return this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]};e.prototype.getSize=function(){return this.size};e.prototype.getGeneratorBase=function(){return this.generatorBase};e.prototype.toString=function(){return"GF(0x"+F.toHexString(this.primitive)+","+this.size+")"};e.prototype.equals=function(t){return t===this};e.AZTEC_DATA_12=new e(4201,4096,1);e.AZTEC_DATA_10=new e(1033,1024,1);e.AZTEC_DATA_6=new e(67,64,1);e.AZTEC_PARAM=new e(19,16,1);e.QR_CODE_FIELD_256=new e(285,256,0);e.DATA_MATRIX_FIELD_256=new e(301,256,1);e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256;e.MAXICODE_FIELD_64=e.AZTEC_DATA_6;return e}(_t);var St=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ot=function(t){St(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="ReedSolomonException";return e}(A);var Tt=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var bt=function(t){Tt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="IllegalStateException";return e}(A);var Rt=function(){function t(t){this.field=t}t.prototype.decode=function(t,e){var r=this.field;var n=new At(r,t);var i=new Int32Array(e);var o=true;for(var a=0;a<e;a++){var u=n.evaluateAt(r.exp(a+r.getGeneratorBase()));i[i.length-1-a]=u;if(u!==0){o=false}}if(o){return}var s=new At(r,i);var f=this.runEuclideanAlgorithm(r.buildMonomial(e,1),s,e);var c=f[0];var l=f[1];var h=this.findErrorLocations(c);var d=this.findErrorMagnitudes(l,h);for(var a=0;a<h.length;a++){var v=t.length-1-r.log(h[a]);if(v<0){throw new Ot("Bad error location")}t[v]=It.addOrSubtract(t[v],d[a])}};t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e;e=n}var i=this.field;var o=t;var a=e;var u=i.getZero();var s=i.getOne();while(a.getDegree()>=(r/2|0)){var f=o;var c=u;o=a;u=s;if(o.isZero()){throw new Ot("r_{i-1} was zero")}a=f;var l=i.getZero();var h=o.getCoefficient(o.getDegree());var d=i.inverse(h);while(a.getDegree()>=o.getDegree()&&!a.isZero()){var v=a.getDegree()-o.getDegree();var p=i.multiply(a.getCoefficient(a.getDegree()),d);l=l.addOrSubtract(i.buildMonomial(v,p));a=a.addOrSubtract(o.multiplyByMonomial(v,p))}s=l.multiply(u).addOrSubtract(c);if(a.getDegree()>=o.getDegree()){throw new bt("Division algorithm failed to reduce polynomial?")}}var g=s.getCoefficient(0);if(g===0){throw new Ot("sigmaTilde(0) was zero")}var y=i.inverse(g);var w=s.multiplyScalar(y);var _=a.multiplyScalar(y);return[w,_]};t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1){return Int32Array.from([t.getCoefficient(1)])}var r=new Int32Array(e);var n=0;var i=this.field;for(var o=1;o<i.getSize()&&n<e;o++){if(t.evaluateAt(o)===0){r[n]=i.inverse(o);n++}}if(n!==e){throw new Ot("Error locator degree does not match number of roots")}return r};t.prototype.findErrorMagnitudes=function(t,e){var r=e.length;var n=new Int32Array(r);var i=this.field;for(var o=0;o<r;o++){var a=i.inverse(e[o]);var u=1;for(var s=0;s<r;s++){if(o!==s){var f=i.multiply(e[s],a);var c=(f&1)===0?f|1:f&~1;u=i.multiply(u,c)}}n[o]=i.multiply(t.evaluateAt(a),i.inverse(u));if(i.getGeneratorBase()!==0){n[o]=i.multiply(n[o],a)}}return n};return t}();var Nt;(function(t){t[t["UPPER"]=0]="UPPER";t[t["LOWER"]=1]="LOWER";t[t["MIXED"]=2]="MIXED";t[t["DIGIT"]=3]="DIGIT";t[t["PUNCT"]=4]="PUNCT";t[t["BINARY"]=5]="BINARY"})(Nt||(Nt={}));var Dt=function(){function t(){}t.prototype.decode=function(e){this.ddata=e;var r=e.getBits();var n=this.extractBits(r);var i=this.correctBits(n);var o=t.convertBoolArrayToByteArray(i);var a=t.getEncodedData(i);var u=new wt(o,a,null,null);u.setNumBits(i.length);return u};t.highLevelDecode=function(t){return this.getEncodedData(t)};t.getEncodedData=function(e){var r=e.length;var n=Nt.UPPER;var i=Nt.UPPER;var o="";var a=0;while(a<r){if(i===Nt.BINARY){if(r-a<5){break}var u=t.readCode(e,a,5);a+=5;if(u===0){if(r-a<11){break}u=t.readCode(e,a,11)+31;a+=11}for(var s=0;s<u;s++){if(r-a<8){a=r;break}var f=t.readCode(e,a,8);o+=Z.castAsNonUtf8Char(f);a+=8}i=n}else{var c=i===Nt.DIGIT?4:5;if(r-a<c){break}var f=t.readCode(e,a,c);a+=c;var l=t.getCharacter(i,f);if(l.startsWith("CTRL_")){n=i;i=t.getTable(l.charAt(5));if(l.charAt(6)==="L"){n=i}}else{o+=l;i=n}}}return o};t.getTable=function(t){switch(t){case"L":return Nt.LOWER;case"P":return Nt.PUNCT;case"M":return Nt.MIXED;case"D":return Nt.DIGIT;case"B":return Nt.BINARY;case"U":default:return Nt.UPPER}};t.getCharacter=function(e,r){switch(e){case Nt.UPPER:return t.UPPER_TABLE[r];case Nt.LOWER:return t.LOWER_TABLE[r];case Nt.MIXED:return t.MIXED_TABLE[r];case Nt.PUNCT:return t.PUNCT_TABLE[r];case Nt.DIGIT:return t.DIGIT_TABLE[r];default:throw new bt("Bad table")}};t.prototype.correctBits=function(e){var r;var n;if(this.ddata.getNbLayers()<=2){n=6;r=It.AZTEC_DATA_6}else if(this.ddata.getNbLayers()<=8){n=8;r=It.AZTEC_DATA_8}else if(this.ddata.getNbLayers()<=22){n=10;r=It.AZTEC_DATA_10}else{n=12;r=It.AZTEC_DATA_12}var i=this.ddata.getNbDatablocks();var o=e.length/n;if(o<i){throw new H}var a=e.length%n;var u=new Int32Array(o);for(var s=0;s<o;s++,a+=n){u[s]=t.readCode(e,a,n)}try{var f=new Rt(r);f.decode(u,o-i)}catch(t){throw new H(t)}var c=(1<<n)-1;var l=0;for(var s=0;s<i;s++){var h=u[s];if(h===0||h===c){throw new H}else if(h===1||h===c-1){l++}}var d=new Array(i*n-l);var v=0;for(var s=0;s<i;s++){var h=u[s];if(h===1||h===c-1){d.fill(h>1,v,v+n-1);v+=n-1}else{for(var p=n-1;p>=0;--p){d[v++]=(h&1<<p)!==0}}}return d};t.prototype.extractBits=function(t){var e=this.ddata.isCompact();var r=this.ddata.getNbLayers();var n=(e?11:14)+r*4;var i=new Int32Array(n);var o=new Array(this.totalBitsInLayer(r,e));if(e){for(var a=0;a<i.length;a++){i[a]=a}}else{var u=n+1+2*F.truncDivision(F.truncDivision(n,2)-1,15);var s=n/2;var f=F.truncDivision(u,2);for(var a=0;a<s;a++){var c=a+F.truncDivision(a,15);i[s-a-1]=f-c-1;i[s+a]=f+c+1}}for(var a=0,l=0;a<r;a++){var h=(r-a)*4+(e?9:12);var d=a*2;var v=n-1-d;for(var p=0;p<h;p++){var g=p*2;for(var y=0;y<2;y++){o[l+g+y]=t.get(i[d+y],i[d+p]);o[l+2*h+g+y]=t.get(i[d+p],i[v-y]);o[l+4*h+g+y]=t.get(i[v-y],i[v-p]);o[l+6*h+g+y]=t.get(i[v-p],i[d+y])}}l+=h*8}return o};t.readCode=function(t,e,r){var n=0;for(var i=e;i<e+r;i++){n<<=1;if(t[i]){n|=1}}return n};t.readByte=function(e,r){var n=e.length-r;if(n>=8){return t.readCode(e,r,8)}return t.readCode(e,r,n)<<8-n};t.convertBoolArrayToByteArray=function(e){var r=new Uint8Array((e.length+7)/8);for(var n=0;n<r.length;n++){r[n]=t.readByte(e,8*n)}return r};t.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t};t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"];t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"];t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"];t.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"];t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];return t}();var Pt=function(){function t(){}t.round=function(t){if(NaN===t)return 0;if(t<=Number.MIN_SAFE_INTEGER)return Number.MIN_SAFE_INTEGER;if(t>=Number.MAX_SAFE_INTEGER)return Number.MAX_SAFE_INTEGER;return t+(t<0?-.5:.5)|0};t.distance=function(t,e,r,n){var i=t-r;var o=e-n;return Math.sqrt(i*i+o*o)};t.sum=function(t){var e=0;for(var r=0,n=t.length;r!==n;r++){var i=t[r];e+=i}return e};return t}();var Mt=function(){function t(){}t.floatToIntBits=function(t){return t};t.MAX_VALUE=Number.MAX_SAFE_INTEGER;return t}();var Bt=function(){function t(t,e){this.x=t;this.y=e}t.prototype.getX=function(){return this.x};t.prototype.getY=function(){return this.y};t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return false};t.prototype.hashCode=function(){return 31*Mt.floatToIntBits(this.x)+Mt.floatToIntBits(this.y)};t.prototype.toString=function(){return"("+this.x+","+this.y+")"};t.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]);var r=this.distance(t[1],t[2]);var n=this.distance(t[0],t[2]);var i;var o;var a;if(r>=e&&r>=n){o=t[0];i=t[1];a=t[2]}else if(n>=r&&n>=e){o=t[1];i=t[0];a=t[2]}else{o=t[2];i=t[0];a=t[1]}if(this.crossProductZ(i,o,a)<0){var u=i;i=a;a=u}t[0]=i;t[1]=o;t[2]=a};t.distance=function(t,e){return Pt.distance(t.x,t.y,e.x,e.y)};t.crossProductZ=function(t,e,r){var n=e.x;var i=e.y;return(r.x-n)*(t.y-i)-(r.y-i)*(t.x-n)};return t}();var Lt=function(){function t(t,e){this.bits=t;this.points=e}t.prototype.getBits=function(){return this.bits};t.prototype.getPoints=function(){return this.points};return t}();var Ft=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var xt=function(t){Ft(e,t);function e(e,r,n,i,o){var a=t.call(this,e,r)||this;a.compact=n;a.nbDatablocks=i;a.nbLayers=o;return a}e.prototype.getNbLayers=function(){return this.nbLayers};e.prototype.getNbDatablocks=function(){return this.nbDatablocks};e.prototype.isCompact=function(){return this.compact};return e}(Lt);var kt=function(){function t(e,r,n,i){this.image=e;this.height=e.getHeight();this.width=e.getWidth();if(undefined===r||null===r){r=t.INIT_SIZE}if(undefined===n||null===n){n=e.getWidth()/2|0}if(undefined===i||null===i){i=e.getHeight()/2|0}var o=r/2|0;this.leftInit=n-o;this.rightInit=n+o;this.upInit=i-o;this.downInit=i+o;if(this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width){throw new J}}t.prototype.detect=function(){var t=this.leftInit;var e=this.rightInit;var r=this.upInit;var n=this.downInit;var i=false;var o=true;var a=false;var u=false;var s=false;var f=false;var c=false;var l=this.width;var h=this.height;while(o){o=false;var d=true;while((d||!u)&&e<l){d=this.containsBlackPoint(r,n,e,false);if(d){e++;o=true;u=true}else if(!u){e++}}if(e>=l){i=true;break}var v=true;while((v||!s)&&n<h){v=this.containsBlackPoint(t,e,n,true);if(v){n++;o=true;s=true}else if(!s){n++}}if(n>=h){i=true;break}var p=true;while((p||!f)&&t>=0){p=this.containsBlackPoint(r,n,t,false);if(p){t--;o=true;f=true}else if(!f){t--}}if(t<0){i=true;break}var g=true;while((g||!c)&&r>=0){g=this.containsBlackPoint(t,e,r,true);if(g){r--;o=true;c=true}else if(!c){r--}}if(r<0){i=true;break}if(o){a=true}}if(!i&&a){var y=e-t;var w=null;for(var _=1;w===null&&_<y;_++){w=this.getBlackPointOnSegment(t,n-_,t+_,n)}if(w==null){throw new J}var A=null;for(var _=1;A===null&&_<y;_++){A=this.getBlackPointOnSegment(t,r+_,t+_,r)}if(A==null){throw new J}var m=null;for(var _=1;m===null&&_<y;_++){m=this.getBlackPointOnSegment(e,r+_,e-_,r)}if(m==null){throw new J}var E=null;for(var _=1;E===null&&_<y;_++){E=this.getBlackPointOnSegment(e,n-_,e-_,n)}if(E==null){throw new J}return this.centerEdges(E,w,m,A)}else{throw new J}};t.prototype.getBlackPointOnSegment=function(t,e,r,n){var i=Pt.round(Pt.distance(t,e,r,n));var o=(r-t)/i;var a=(n-e)/i;var u=this.image;for(var s=0;s<i;s++){var f=Pt.round(t+s*o);var c=Pt.round(e+s*a);if(u.get(f,c)){return new Bt(f,c)}}return null};t.prototype.centerEdges=function(e,r,n,i){var o=e.getX();var a=e.getY();var u=r.getX();var s=r.getY();var f=n.getX();var c=n.getY();var l=i.getX();var h=i.getY();var d=t.CORR;if(o<this.width/2){return[new Bt(l-d,h+d),new Bt(u+d,s+d),new Bt(f-d,c-d),new Bt(o+d,a-d)]}else{return[new Bt(l+d,h+d),new Bt(u+d,s-d),new Bt(f-d,c+d),new Bt(o-d,a-d)]}};t.prototype.containsBlackPoint=function(t,e,r,n){var i=this.image;if(n){for(var o=t;o<=e;o++){if(i.get(o,r)){return true}}}else{for(var a=t;a<=e;a++){if(i.get(r,a)){return true}}}return false};t.INIT_SIZE=10;t.CORR=1;return t}();var Vt=function(){function t(){}t.checkAndNudgePoints=function(t,e){var r=t.getWidth();var n=t.getHeight();var i=true;for(var o=0;o<e.length&&i;o+=2){var a=Math.floor(e[o]);var u=Math.floor(e[o+1]);if(a<-1||a>r||u<-1||u>n){throw new J}i=false;if(a===-1){e[o]=0;i=true}else if(a===r){e[o]=r-1;i=true}if(u===-1){e[o+1]=0;i=true}else if(u===n){e[o+1]=n-1;i=true}}i=true;for(var o=e.length-2;o>=0&&i;o-=2){var a=Math.floor(e[o]);var u=Math.floor(e[o+1]);if(a<-1||a>r||u<-1||u>n){throw new J}i=false;if(a===-1){e[o]=0;i=true}else if(a===r){e[o]=r-1;i=true}if(u===-1){e[o+1]=0;i=true}else if(u===n){e[o+1]=n-1;i=true}}};return t}();var Ut=function(){function t(t,e,r,n,i,o,a,u,s){this.a11=t;this.a21=e;this.a31=r;this.a12=n;this.a22=i;this.a32=o;this.a13=a;this.a23=u;this.a33=s}t.quadrilateralToQuadrilateral=function(e,r,n,i,o,a,u,s,f,c,l,h,d,v,p,g){var y=t.quadrilateralToSquare(e,r,n,i,o,a,u,s);var w=t.squareToQuadrilateral(f,c,l,h,d,v,p,g);return w.times(y)};t.prototype.transformPoints=function(t){var e=t.length;var r=this.a11;var n=this.a12;var i=this.a13;var o=this.a21;var a=this.a22;var u=this.a23;var s=this.a31;var f=this.a32;var c=this.a33;for(var l=0;l<e;l+=2){var h=t[l];var d=t[l+1];var v=i*h+u*d+c;t[l]=(r*h+o*d+s)/v;t[l+1]=(n*h+a*d+f)/v}};t.prototype.transformPointsWithValues=function(t,e){var r=this.a11;var n=this.a12;var i=this.a13;var o=this.a21;var a=this.a22;var u=this.a23;var s=this.a31;var f=this.a32;var c=this.a33;var l=t.length;for(var h=0;h<l;h++){var d=t[h];var v=e[h];var p=i*d+u*v+c;t[h]=(r*d+o*v+s)/p;e[h]=(n*d+a*v+f)/p}};t.squareToQuadrilateral=function(e,r,n,i,o,a,u,s){var f=e-n+o-u;var c=r-i+a-s;if(f===0&&c===0){return new t(n-e,o-n,e,i-r,a-i,r,0,0,1)}else{var l=n-o;var h=u-o;var d=i-a;var v=s-a;var p=l*v-h*d;var g=(f*v-h*c)/p;var y=(l*c-f*d)/p;return new t(n-e+g*n,u-e+y*u,e,i-r+g*i,s-r+y*s,r,g,y,1)}};t.quadrilateralToSquare=function(e,r,n,i,o,a,u,s){return t.squareToQuadrilateral(e,r,n,i,o,a,u,s).buildAdjoint()};t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)};t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)};return t}();var Ht=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Gt=function(t){Ht(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.prototype.sampleGrid=function(t,e,r,n,i,o,a,u,s,f,c,l,h,d,v,p,g,y,w){var _=Ut.quadrilateralToQuadrilateral(n,i,o,a,u,s,f,c,l,h,d,v,p,g,y,w);return this.sampleGridWithTransform(t,e,r,_)};e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0){throw new J}var i=new q(e,r);var o=new Float32Array(2*e);for(var a=0;a<r;a++){var u=o.length;var s=a+.5;for(var f=0;f<u;f+=2){o[f]=f/2+.5;o[f+1]=s}n.transformPoints(o);Vt.checkAndNudgePoints(t,o);try{for(var f=0;f<u;f+=2){if(t.get(Math.floor(o[f]),Math.floor(o[f+1]))){i.set(f/2,a)}}}catch(t){throw new J}}return i};return e}(Vt);var Xt=function(){function t(){}t.setGridSampler=function(e){t.gridSampler=e};t.getInstance=function(){return t.gridSampler};t.gridSampler=new Gt;return t}();var Wt=function(){function t(t,e){this.x=t;this.y=e}t.prototype.toResultPoint=function(){return new Bt(this.getX(),this.getY())};t.prototype.getX=function(){return this.x};t.prototype.getY=function(){return this.y};return t}();var jt=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]);this.image=t}t.prototype.detect=function(){return this.detectMirror(false)};t.prototype.detectMirror=function(t){var e=this.getMatrixCenter();var r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2];r[2]=n}this.extractParameters(r);var i=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]);var o=this.getMatrixCornerPoints(r);return new xt(i,o,this.compact,this.nbDataBlocks,this.nbLayers)};t.prototype.extractParameters=function(t){if(!this.isValidPoint(t[0])||!this.isValidPoint(t[1])||!this.isValidPoint(t[2])||!this.isValidPoint(t[3])){throw new J}var e=2*this.nbCenterLayers;var r=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(r,e);var n=0;for(var i=0;i<4;i++){var o=r[(this.shift+i)%4];if(this.compact){n<<=7;n+=o>>1&127}else{n<<=10;n+=(o>>2&31<<5)+(o>>1&31)}}var a=this.getCorrectedParameterData(n,this.compact);if(this.compact){this.nbLayers=(a>>6)+1;this.nbDataBlocks=(a&63)+1}else{this.nbLayers=(a>>11)+1;this.nbDataBlocks=(a&2047)+1}};t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,i){var o=(t>>e-2<<1)+(t&1);r=(r<<3)+o});r=((r&1)<<11)+(r>>1);for(var n=0;n<4;n++){if(F.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2){return n}}throw new J};t.prototype.getCorrectedParameterData=function(t,e){var r;var n;if(e){r=7;n=2}else{r=10;n=4}var i=r-n;var o=new Int32Array(r);for(var a=r-1;a>=0;--a){o[a]=t&15;t>>=4}try{var u=new Rt(It.AZTEC_PARAM);u.decode(o,i)}catch(t){throw new J}var s=0;for(var a=0;a<n;a++){s=(s<<4)+o[a]}return s};t.prototype.getBullsEyeCorners=function(t){var e=t;var r=t;var n=t;var i=t;var o=true;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,o,1,-1);var u=this.getFirstDifferent(r,o,1,1);var s=this.getFirstDifferent(n,o,-1,1);var f=this.getFirstDifferent(i,o,-1,-1);if(this.nbCenterLayers>2){var c=this.distancePoint(f,a)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(c<.75||c>1.25||!this.isWhiteOrBlackRectangle(a,u,s,f)){break}}e=a;r=u;n=s;i=f;o=!o}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7){throw new J}this.compact=this.nbCenterLayers===5;var l=new Bt(e.getX()+.5,e.getY()-.5);var h=new Bt(r.getX()+.5,r.getY()+.5);var d=new Bt(n.getX()-.5,n.getY()+.5);var v=new Bt(i.getX()-.5,i.getY()-.5);return this.expandSquare([l,h,d,v],2*this.nbCenterLayers-3,2*this.nbCenterLayers)};t.prototype.getMatrixCenter=function(){var t;var e;var r;var n;try{var i=new kt(this.image).detect();t=i[0];e=i[1];r=i[2];n=i[3]}catch(i){var o=this.image.getWidth()/2;var a=this.image.getHeight()/2;t=this.getFirstDifferent(new Wt(o+7,a-7),false,1,-1).toResultPoint();e=this.getFirstDifferent(new Wt(o+7,a+7),false,1,1).toResultPoint();r=this.getFirstDifferent(new Wt(o-7,a+7),false,-1,1).toResultPoint();n=this.getFirstDifferent(new Wt(o-7,a-7),false,-1,-1).toResultPoint()}var u=Pt.round((t.getX()+n.getX()+e.getX()+r.getX())/4);var s=Pt.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var i=new kt(this.image,15,u,s).detect();t=i[0];e=i[1];r=i[2];n=i[3]}catch(i){t=this.getFirstDifferent(new Wt(u+7,s-7),false,1,-1).toResultPoint();e=this.getFirstDifferent(new Wt(u+7,s+7),false,1,1).toResultPoint();r=this.getFirstDifferent(new Wt(u-7,s+7),false,-1,1).toResultPoint();n=this.getFirstDifferent(new Wt(u-7,s-7),false,-1,-1).toResultPoint()}u=Pt.round((t.getX()+n.getX()+e.getX()+r.getX())/4);s=Pt.round((t.getY()+n.getY()+e.getY()+r.getY())/4);return new Wt(u,s)};t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())};t.prototype.sampleGrid=function(t,e,r,n,i){var o=Xt.getInstance();var a=this.getDimension();var u=a/2-this.nbCenterLayers;var s=a/2+this.nbCenterLayers;return o.sampleGrid(t,a,a,u,u,s,u,s,s,u,s,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),i.getX(),i.getY())};t.prototype.sampleLine=function(t,e,r){var n=0;var i=this.distanceResultPoint(t,e);var o=i/r;var a=t.getX();var u=t.getY();var s=o*(e.getX()-t.getX())/i;var f=o*(e.getY()-t.getY())/i;for(var c=0;c<r;c++){if(this.image.get(Pt.round(a+c*s),Pt.round(u+c*f))){n|=1<<r-c-1}}return n};t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){var i=3;t=new Wt(t.getX()-i,t.getY()+i);e=new Wt(e.getX()-i,e.getY()-i);r=new Wt(r.getX()+i,r.getY()-i);n=new Wt(n.getX()+i,n.getY()+i);var o=this.getColor(n,t);if(o===0){return false}var a=this.getColor(t,e);if(a!==o){return false}a=this.getColor(e,r);if(a!==o){return false}a=this.getColor(r,n);return a===o};t.prototype.getColor=function(t,e){var r=this.distancePoint(t,e);var n=(e.getX()-t.getX())/r;var i=(e.getY()-t.getY())/r;var o=0;var a=t.getX();var u=t.getY();var s=this.image.get(t.getX(),t.getY());var f=Math.ceil(r);for(var c=0;c<f;c++){a+=n;u+=i;if(this.image.get(Pt.round(a),Pt.round(u))!==s){o++}}var l=o/r;if(l>.1&&l<.9){return 0}return l<=.1===s?1:-1};t.prototype.getFirstDifferent=function(t,e,r,n){var i=t.getX()+r;var o=t.getY()+n;while(this.isValid(i,o)&&this.image.get(i,o)===e){i+=r;o+=n}i-=r;o-=n;while(this.isValid(i,o)&&this.image.get(i,o)===e){i+=r}i-=r;while(this.isValid(i,o)&&this.image.get(i,o)===e){o+=n}o-=n;return new Wt(i,o)};t.prototype.expandSquare=function(t,e,r){var n=r/(2*e);var i=t[0].getX()-t[2].getX();var o=t[0].getY()-t[2].getY();var a=(t[0].getX()+t[2].getX())/2;var u=(t[0].getY()+t[2].getY())/2;var s=new Bt(a+n*i,u+n*o);var f=new Bt(a-n*i,u-n*o);i=t[1].getX()-t[3].getX();o=t[1].getY()-t[3].getY();a=(t[1].getX()+t[3].getX())/2;u=(t[1].getY()+t[3].getY())/2;var c=new Bt(a+n*i,u+n*o);var l=new Bt(a-n*i,u-n*o);var h=[s,c,f,l];return h};t.prototype.isValid=function(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()};t.prototype.isValidPoint=function(t){var e=Pt.round(t.getX());var r=Pt.round(t.getY());return this.isValid(e,r)};t.prototype.distancePoint=function(t,e){return Pt.distance(t.getX(),t.getY(),e.getX(),e.getY())};t.prototype.distanceResultPoint=function(t,e){return Pt.distance(t.getX(),t.getY(),e.getX(),e.getY())};t.prototype.getDimension=function(){if(this.compact){return 4*this.nbLayers+11}if(this.nbLayers<=4){return 4*this.nbLayers+15}return 4*this.nbLayers+2*(F.truncDivision(this.nbLayers-4,8)+1)+15};return t}();var zt=function(){function t(){}t.prototype.decode=function(t,e){if(e===void 0){e=null}var r=null;var n=new jt(t.getBlackMatrix());var i=null;var o=null;try{var a=n.detectMirror(false);i=a.getPoints();this.reportFoundResultPoints(e,i);o=(new Dt).decode(a)}catch(t){r=t}if(o==null){try{var a=n.detectMirror(true);i=a.getPoints();this.reportFoundResultPoints(e,i);o=(new Dt).decode(a)}catch(t){if(r!=null){throw r}throw t}}var u=new dt(o.getText(),o.getRawBytes(),o.getNumBits(),i,pt.AZTEC,R.currentTimeMillis());var s=o.getByteSegments();if(s!=null){u.putMetadata(yt.BYTE_SEGMENTS,s)}var f=o.getECLevel();if(f!=null){u.putMetadata(yt.ERROR_CORRECTION_LEVEL,f)}return u};t.prototype.reportFoundResultPoints=function(t,e){if(t!=null){var r=t.get(V.NEED_RESULT_POINT_CALLBACK);if(r!=null){e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}}};t.prototype.reset=function(){};return t}();var Yt=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Yt(e,t);function e(e){if(e===void 0){e=500}return t.call(this,new zt,e)||this}return e})(ht);var Zt=function(){function t(){}t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(c){var r=e&&e.get(V.TRY_HARDER)===true;if(r&&t.isRotateSupported()){var n=t.rotateCounterClockwise();var i=this.doDecode(n,e);var o=i.getResultMetadata();var a=270;if(o!==null&&o.get(yt.ORIENTATION)===true){a=a+o.get(yt.ORIENTATION)%360}i.putMetadata(yt.ORIENTATION,a);var u=i.getResultPoints();if(u!==null){var s=n.getHeight();for(var f=0;f<u.length;f++){u[f]=new Bt(s-u[f].getY()-1,u[f].getX())}}return i}else{throw new J}}};t.prototype.reset=function(){};t.prototype.doDecode=function(t,e){var r=t.getWidth();var n=t.getHeight();var i=new x(r);var o=e&&e.get(V.TRY_HARDER)===true;var a=Math.max(1,n>>(o?8:5));var u;if(o){u=n}else{u=15}var s=Math.trunc(n/2);for(var f=0;f<u;f++){var c=Math.trunc((f+1)/2);var l=(f&1)===0;var h=s+a*(l?c:-c);if(h<0||h>=n){break}try{i=t.getBlackRow(h,i)}catch(t){continue}var d=function(t){if(t===1){i.reverse();if(e&&e.get(V.NEED_RESULT_POINT_CALLBACK)===true){var n=new Map;e.forEach(function(t,e){return n.set(e,t)});n.delete(V.NEED_RESULT_POINT_CALLBACK);e=n}}try{var o=v.decodeRow(h,i,e);if(t===1){o.putMetadata(yt.ORIENTATION,180);var a=o.getResultPoints();if(a!==null){a[0]=new Bt(r-a[0].getX()-1,a[0].getY());a[1]=new Bt(r-a[1].getX()-1,a[1].getY())}}return{value:o}}catch(t){}};var v=this;for(var p=0;p<2;p++){var g=d(p);if(typeof g==="object")return g.value}}throw new J};t.recordPattern=function(t,e,r){var n=r.length;for(var i=0;i<n;i++)r[i]=0;var o=t.getSize();if(e>=o){throw new J}var a=!t.get(e);var u=0;var s=e;while(s<o){if(t.get(s)!==a){r[u]++}else{if(++u===n){break}else{r[u]=1;a=!a}}s++}if(!(u===n||u===n-1&&s===o)){throw new J}};t.recordPatternInReverse=function(e,r,n){var i=n.length;var o=e.get(r);while(r>0&&i>=0){if(e.get(--r)!==o){i--;o=!o}}if(i>=0){throw new J}t.recordPattern(e,r+1,n)};t.patternMatchVariance=function(t,e,r){var n=t.length;var i=0;var o=0;for(var a=0;a<n;a++){i+=t[a];o+=e[a]}if(i<o){return Number.POSITIVE_INFINITY}var u=i/o;r*=u;var s=0;for(var f=0;f<n;f++){var c=t[f];var l=e[f]*u;var h=c>l?c-l:l-c;if(h>r){return Number.POSITIVE_INFINITY}s+=h}return s/i};return t}();var Kt=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var qt=function(t){Kt(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.findStartPattern=function(t){var r=t.getSize();var n=t.getNextSet(0);var i=0;var o=Int32Array.from([0,0,0,0,0,0]);var a=n;var u=false;var s=6;for(var f=n;f<r;f++){if(t.get(f)!==u){o[i]++}else{if(i===s-1){var c=e.MAX_AVG_VARIANCE;var l=-1;for(var h=e.CODE_START_A;h<=e.CODE_START_C;h++){var d=Zt.patternMatchVariance(o,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);if(d<c){c=d;l=h}}if(l>=0&&t.isRange(Math.max(0,a-(f-a)/2),a,false)){return Int32Array.from([a,f,l])}a+=o[0]+o[1];o=o.slice(2,o.length-1);o[i-1]=0;o[i]=0;i--}else{i++}o[i]=1;u=!u}}throw new J};e.decodeCode=function(t,r,n){Zt.recordPattern(t,n,r);var i=e.MAX_AVG_VARIANCE;var o=-1;for(var a=0;a<e.CODE_PATTERNS.length;a++){var u=e.CODE_PATTERNS[a];var s=this.patternMatchVariance(r,u,e.MAX_INDIVIDUAL_VARIANCE);if(s<i){i=s;o=a}}if(o>=0){return o}else{throw new J}};e.prototype.decodeRow=function(t,r,n){var i=n&&n.get(V.ASSUME_GS1)===true;var o=e.findStartPattern(r);var a=o[2];var u=0;var s=new Uint8Array(20);s[u++]=a;var f;switch(a){case e.CODE_START_A:f=e.CODE_CODE_A;break;case e.CODE_START_B:f=e.CODE_CODE_B;break;case e.CODE_START_C:f=e.CODE_CODE_C;break;default:throw new H}var c=false;var l=false;var h="";var d=o[0];var v=o[1];var p=Int32Array.from([0,0,0,0,0,0]);var g=0;var y=0;var w=a;var _=0;var A=true;var m=false;var E=false;while(!c){var C=l;l=false;g=y;y=e.decodeCode(r,p,v);s[u++]=y;if(y!==e.CODE_STOP){A=true}if(y!==e.CODE_STOP){_++;w+=_*y}d=v;v+=p.reduce(function(t,e){return t+e},0);switch(y){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new H}switch(f){case e.CODE_CODE_A:if(y<64){if(E===m){h+=String.fromCharCode(" ".charCodeAt(0)+y)}else{h+=String.fromCharCode(" ".charCodeAt(0)+y+128)}E=false}else if(y<96){if(E===m){h+=String.fromCharCode(y-64)}else{h+=String.fromCharCode(y+64)}E=false}else{if(y!==e.CODE_STOP){A=false}switch(y){case e.CODE_FNC_1:if(i){if(h.length===0){h+="]C1"}else{h+=String.fromCharCode(29)}}break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:if(!m&&E){m=true;E=false}else if(m&&E){m=false;E=false}else{E=true}break;case e.CODE_SHIFT:l=true;f=e.CODE_CODE_B;break;case e.CODE_CODE_B:f=e.CODE_CODE_B;break;case e.CODE_CODE_C:f=e.CODE_CODE_C;break;case e.CODE_STOP:c=true;break}}break;case e.CODE_CODE_B:if(y<96){if(E===m){h+=String.fromCharCode(" ".charCodeAt(0)+y)}else{h+=String.fromCharCode(" ".charCodeAt(0)+y+128)}E=false}else{if(y!==e.CODE_STOP){A=false}switch(y){case e.CODE_FNC_1:if(i){if(h.length===0){h+="]C1"}else{h+=String.fromCharCode(29)}}break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:if(!m&&E){m=true;E=false}else if(m&&E){m=false;E=false}else{E=true}break;case e.CODE_SHIFT:l=true;f=e.CODE_CODE_A;break;case e.CODE_CODE_A:f=e.CODE_CODE_A;break;case e.CODE_CODE_C:f=e.CODE_CODE_C;break;case e.CODE_STOP:c=true;break}}break;case e.CODE_CODE_C:if(y<100){if(y<10){h+="0"}h+=y}else{if(y!==e.CODE_STOP){A=false}switch(y){case e.CODE_FNC_1:if(i){if(h.length===0){h+="]C1"}else{h+=String.fromCharCode(29)}}break;case e.CODE_CODE_A:f=e.CODE_CODE_A;break;case e.CODE_CODE_B:f=e.CODE_CODE_B;break;case e.CODE_STOP:c=true;break}}break}if(C){f=f===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A}}var I=v-d;v=r.getNextUnset(v);if(!r.isRange(v,Math.min(r.getSize(),v+(v-d)/2),false)){throw new J}w-=_*g;if(w%103!==g){throw new T}var S=h.length;if(S===0){throw new J}if(S>0&&A){if(f===e.CODE_CODE_C){h=h.substring(0,S-2)}else{h=h.substring(0,S-1)}}var O=(o[1]+o[0])/2;var b=d+I/2;var R=s.length;var N=new Uint8Array(R);for(var D=0;D<R;D++){N[D]=s[D]}var P=[new Bt(O,t),new Bt(b,t)];return new dt(h,N,0,P,pt.CODE_128,(new Date).getTime())};e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])];e.MAX_AVG_VARIANCE=.25;e.MAX_INDIVIDUAL_VARIANCE=.7;e.CODE_SHIFT=98;e.CODE_CODE_C=99;e.CODE_CODE_B=100;e.CODE_CODE_A=101;e.CODE_FNC_1=102;e.CODE_FNC_2=97;e.CODE_FNC_3=96;e.CODE_FNC_4_A=101;e.CODE_FNC_4_B=100;e.CODE_START_A=103;e.CODE_START_B=104;e.CODE_START_C=105;e.CODE_STOP=106;return e}(Zt);var Qt=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Jt=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var $t=function(t){Qt(e,t);function e(e,r){if(e===void 0){e=false}if(r===void 0){r=false}var n=t.call(this)||this;n.usingCheckDigit=e;n.extendedMode=r;n.decodeRowResult="";n.counters=new Int32Array(9);return n}e.prototype.decodeRow=function(t,r,n){var i,o,a,u;var s=this.counters;s.fill(0);this.decodeRowResult="";var f=e.findAsteriskPattern(r,s);var c=r.getNextSet(f[1]);var l=r.getSize();var h;var d;do{e.recordPattern(r,c,s);var v=e.toNarrowWidePattern(s);if(v<0){throw new J}h=e.patternToChar(v);this.decodeRowResult+=h;d=c;try{for(var p=(i=void 0,Jt(s)),g=p.next();!g.done;g=p.next()){var y=g.value;c+=y}}catch(t){i={error:t}}finally{try{if(g&&!g.done&&(o=p.return))o.call(p)}finally{if(i)throw i.error}}c=r.getNextSet(c)}while(h!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var _=Jt(s),A=_.next();!A.done;A=_.next()){var y=A.value;w+=y}}catch(t){a={error:t}}finally{try{if(A&&!A.done&&(u=_.return))u.call(_)}finally{if(a)throw a.error}}var m=c-d-w;if(c!==l&&m*2<w){throw new J}if(this.usingCheckDigit){var E=this.decodeRowResult.length-1;var C=0;for(var I=0;I<E;I++){C+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(I))}if(this.decodeRowResult.charAt(E)!==e.ALPHABET_STRING.charAt(C%43)){throw new T}this.decodeRowResult=this.decodeRowResult.substring(0,E)}if(this.decodeRowResult.length===0){throw new J}var S;if(this.extendedMode){S=e.decodeExtended(this.decodeRowResult)}else{S=this.decodeRowResult}var O=(f[1]+f[0])/2;var b=d+w/2;return new dt(S,null,0,[new Bt(O,t),new Bt(b,t)],pt.CODE_39,(new Date).getTime())};e.findAsteriskPattern=function(t,r){var n=t.getSize();var i=t.getNextSet(0);var o=0;var a=i;var u=false;var s=r.length;for(var f=i;f<n;f++){if(t.get(f)!==u){r[o]++}else{if(o===s-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((f-a)/2)),a,false)){return[a,f]}a+=r[0]+r[1];r.copyWithin(0,2,2+o-1);r[o-1]=0;r[o]=0;o--}else{o++}r[o]=1;u=!u}}throw new J};e.toNarrowWidePattern=function(t){var e,r;var n=t.length;var i=0;var o;do{var a=2147483647;try{for(var u=(e=void 0,Jt(t)),s=u.next();!s.done;s=u.next()){var f=s.value;if(f<a&&f>i){a=f}}}catch(t){e={error:t}}finally{try{if(s&&!s.done&&(r=u.return))r.call(u)}finally{if(e)throw e.error}}i=a;o=0;var c=0;var l=0;for(var h=0;h<n;h++){var f=t[h];if(f>i){l|=1<<n-1-h;o++;c+=f}}if(o===3){for(var h=0;h<n&&o>0;h++){var f=t[h];if(f>i){o--;if(f*2>=c){return-1}}}return l}}while(o>3);return-1};e.patternToChar=function(t){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++){if(e.CHARACTER_ENCODINGS[r]===t){return e.ALPHABET_STRING.charAt(r)}}if(t===e.ASTERISK_ENCODING){return"*"}throw new J};e.decodeExtended=function(t){var e=t.length;var r="";for(var n=0;n<e;n++){var i=t.charAt(n);if(i==="+"||i==="$"||i==="%"||i==="/"){var o=t.charAt(n+1);var a="\0";switch(i){case"+":if(o>="A"&&o<="Z"){a=String.fromCharCode(o.charCodeAt(0)+32)}else{throw new H}break;case"$":if(o>="A"&&o<="Z"){a=String.fromCharCode(o.charCodeAt(0)-64)}else{throw new H}break;case"%":if(o>="A"&&o<="E"){a=String.fromCharCode(o.charCodeAt(0)-38)}else if(o>="F"&&o<="J"){a=String.fromCharCode(o.charCodeAt(0)-11)}else if(o>="K"&&o<="O"){a=String.fromCharCode(o.charCodeAt(0)+16)}else if(o>="P"&&o<="T"){a=String.fromCharCode(o.charCodeAt(0)+43)}else if(o==="U"){a="\0"}else if(o==="V"){a="@"}else if(o==="W"){a="`"}else if(o==="X"||o==="Y"||o==="Z"){a=""}else{throw new H}break;case"/":if(o>="A"&&o<="O"){a=String.fromCharCode(o.charCodeAt(0)-32)}else if(o==="Z"){a=":"}else{throw new H}break}r+=a;n++}else{r+=i}}return r};e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42];e.ASTERISK_ENCODING=148;return e}(Zt);var te=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ee=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var re=function(t){te(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.narrowLineWidth=-1;return e}e.prototype.decodeRow=function(t,r,n){var i,o;var a=this.decodeStart(r);var u=this.decodeEnd(r);var s=new K;e.decodeMiddle(r,a[1],u[0],s);var f=s.toString();var c=null;if(n!=null){c=n.get(V.ALLOWED_LENGTHS)}if(c==null){c=e.DEFAULT_ALLOWED_LENGTHS}var l=f.length;var h=false;var d=0;try{for(var v=ee(c),p=v.next();!p.done;p=v.next()){var g=p.value;if(l===g){h=true;break}if(g>d){d=g}}}catch(t){i={error:t}}finally{try{if(p&&!p.done&&(o=v.return))o.call(v)}finally{if(i)throw i.error}}if(!h&&l>d){h=true}if(!h){throw new H}var y=[new Bt(a[1],t),new Bt(u[0],t)];var w=new dt(f,null,0,y,pt.ITF,(new Date).getTime());return w};e.decodeMiddle=function(t,r,n,i){var o=new Int32Array(10);var a=new Int32Array(5);var u=new Int32Array(5);o.fill(0);a.fill(0);u.fill(0);while(r<n){Zt.recordPattern(t,r,o);for(var s=0;s<5;s++){var f=2*s;a[s]=o[f];u[s]=o[f+1]}var c=e.decodeDigit(a);i.append(c.toString());c=this.decodeDigit(u);i.append(c.toString());o.forEach(function(t){r+=t})}};e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t);var n=e.findGuardPattern(t,r,e.START_PATTERN);this.narrowLineWidth=(n[1]-n[0])/4;this.validateQuietZone(t,n[0]);return n};e.prototype.validateQuietZone=function(t,e){var r=this.narrowLineWidth*10;r=r<e?r:e;for(var n=e-1;r>0&&n>=0;n--){if(t.get(n)){break}r--}if(r!==0){throw new J}};e.skipWhiteSpace=function(t){var e=t.getSize();var r=t.getNextSet(0);if(r===e){throw new J}return r};e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t);var n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(i){if(i instanceof J){n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1])}}this.validateQuietZone(t,n[0]);var i=n[0];n[0]=t.getSize()-n[1];n[1]=t.getSize()-i;return n}finally{t.reverse()}};e.findGuardPattern=function(t,r,n){var i=n.length;var o=new Int32Array(i);var a=t.getSize();var u=false;var s=0;var f=r;o.fill(0);for(var c=r;c<a;c++){if(t.get(c)!==u){o[s]++}else{if(s===i-1){if(Zt.patternMatchVariance(o,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE){return[f,c]}f+=o[0]+o[1];R.arraycopy(o,2,o,0,s-1);o[s-1]=0;o[s]=0;s--}else{s++}o[s]=1;u=!u}}throw new J};e.decodeDigit=function(t){var r=e.MAX_AVG_VARIANCE;var n=-1;var i=e.PATTERNS.length;for(var o=0;o<i;o++){var a=e.PATTERNS[o];var u=Zt.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);if(u<r){r=u;n=o}else if(u===r){n=-1}}if(n>=0){return n%10}else{throw new J}};e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])];e.MAX_AVG_VARIANCE=.38;e.MAX_INDIVIDUAL_VARIANCE=.5;e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14];e.START_PATTERN=Int32Array.from([1,1,1,1]);e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];return e}(Zt);var ne=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ie=function(t){ne(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.decodeRowStringBuffer="";return e}e.findStartGuardPattern=function(t){var r=false;var n;var i=0;var o=Int32Array.from([0,0,0]);while(!r){o=Int32Array.from([0,0,0]);n=e.findGuardPattern(t,i,false,this.START_END_PATTERN,o);var a=n[0];i=n[1];var u=a-(i-a);if(u>=0){r=t.isRange(u,a,false)}}return n};e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)};e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(r===0)return false;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n};e.getStandardUPCEANChecksum=function(t){var e=t.length;var r=0;for(var n=e-1;n>=0;n-=2){var i=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9){throw new H}r+=i}r*=3;for(var n=e-2;n>=0;n-=2){var i=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9){throw new H}r+=i}return(1e3-r)%10};e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,false,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))};e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))};e.findGuardPattern=function(t,r,n,i,o){var a=t.getSize();r=n?t.getNextUnset(r):t.getNextSet(r);var u=0;var s=r;var f=i.length;var c=n;for(var l=r;l<a;l++){if(t.get(l)!==c){o[u]++}else{if(u===f-1){if(Zt.patternMatchVariance(o,i,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE){return Int32Array.from([s,l])}s+=o[0]+o[1];var h=o.slice(2,o.length-1);for(var d=0;d<u-1;d++){o[d]=h[d]}o[u-1]=0;o[u]=0;u--}else{u++}o[u]=1;c=!c}}throw new J};e.decodeDigit=function(t,r,n,i){this.recordPattern(t,n,r);var o=this.MAX_AVG_VARIANCE;var a=-1;var u=i.length;for(var s=0;s<u;s++){var f=i[s];var c=Zt.patternMatchVariance(r,f,e.MAX_INDIVIDUAL_VARIANCE);if(c<o){o=c;a=s}}if(a>=0){return a}else{throw new J}};e.MAX_AVG_VARIANCE=.48;e.MAX_INDIVIDUAL_VARIANCE=.7;e.START_END_PATTERN=Int32Array.from([1,1,1]);e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]);e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]);e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];return e}(Zt);var oe=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ae=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5];this.decodeMiddleCounters=Int32Array.from([0,0,0,0]);this.decodeRowStringBuffer=""}t.prototype.decodeRow=function(e,r,n){var i=this.decodeRowStringBuffer;var o=this.decodeMiddle(r,n,i);var a=i.toString();var u=t.parseExtensionString(a);var s=[new Bt((n[0]+n[1])/2,e),new Bt(o,e)];var f=new dt(a,null,0,s,pt.UPC_EAN_EXTENSION,(new Date).getTime());if(u!=null){f.putAllMetadata(u)}return f};t.prototype.decodeMiddle=function(e,r,n){var i,o;var a=this.decodeMiddleCounters;a[0]=0;a[1]=0;a[2]=0;a[3]=0;var u=e.getSize();var s=r[1];var f=0;for(var c=0;c<5&&s<u;c++){var l=ie.decodeDigit(e,a,s,ie.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var h=(i=void 0,oe(a)),d=h.next();!d.done;d=h.next()){var v=d.value;s+=v}}catch(t){i={error:t}}finally{try{if(d&&!d.done&&(o=h.return))o.call(h)}finally{if(i)throw i.error}}if(l>=10){f|=1<<4-c}if(c!==4){s=e.getNextSet(s);s=e.getNextUnset(s)}}if(n.length!==5){throw new J}var p=this.determineCheckDigit(f);if(t.extensionChecksum(n.toString())!==p){throw new J}return s};t.extensionChecksum=function(t){var e=t.length;var r=0;for(var n=e-2;n>=0;n-=2){r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0)}r*=3;for(var n=e-1;n>=0;n-=2){r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0)}r*=3;return r%10};t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++){if(t===this.CHECK_DIGIT_ENCODINGS[e]){return e}}throw new J};t.parseExtensionString=function(e){if(e.length!==5){return null}var r=t.parseExtension5String(e);if(r==null){return null}return new Map([[yt.SUGGESTED_PRICE,r]])};t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e="";break}var r=parseInt(t.substring(1));var n=(r/100).toString();var i=r%100;var o=i<10?"0"+i:i.toString();return e+n+"."+o};return t}();var ue=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var se=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]);this.decodeRowStringBuffer=""}t.prototype.decodeRow=function(e,r,n){var i=this.decodeRowStringBuffer;var o=this.decodeMiddle(r,n,i);var a=i.toString();var u=t.parseExtensionString(a);var s=[new Bt((n[0]+n[1])/2,e),new Bt(o,e)];var f=new dt(a,null,0,s,pt.UPC_EAN_EXTENSION,(new Date).getTime());if(u!=null){f.putAllMetadata(u)}return f};t.prototype.decodeMiddle=function(t,e,r){var n,i;var o=this.decodeMiddleCounters;o[0]=0;o[1]=0;o[2]=0;o[3]=0;var a=t.getSize();var u=e[1];var s=0;for(var f=0;f<2&&u<a;f++){var c=ie.decodeDigit(t,o,u,ie.L_AND_G_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+c%10);try{for(var l=(n=void 0,ue(o)),h=l.next();!h.done;h=l.next()){var d=h.value;u+=d}}catch(t){n={error:t}}finally{try{if(h&&!h.done&&(i=l.return))i.call(l)}finally{if(n)throw n.error}}if(c>=10){s|=1<<1-f}if(f!==1){u=t.getNextSet(u);u=t.getNextUnset(u)}}if(r.length!==2){throw new J}if(parseInt(r.toString())%4!==s){throw new J}return u};t.parseExtensionString=function(t){if(t.length!==2){return null}return new Map([[yt.ISSUE_NUMBER,parseInt(t)]])};return t}();var fe=function(){function t(){}t.decodeRow=function(t,e,r){var n=ie.findGuardPattern(e,r,false,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var i=new ae;return i.decodeRow(t,e,n)}catch(r){var o=new se;return o.decodeRow(t,e,n)}};t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);return t}();var ce=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var le=function(t){ce(e,t);function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="";e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(t){return Int32Array.from(t)});for(var n=10;n<20;n++){var i=e.L_PATTERNS[n-10];var o=new Int32Array(i.length);for(var a=0;a<i.length;a++){o[a]=i[i.length-a-1]}e.L_AND_G_PATTERNS[n]=o}return r}e.prototype.decodeRow=function(t,r,n){var i=e.findStartGuardPattern(r);var o=n==null?null:n.get(V.NEED_RESULT_POINT_CALLBACK);if(o!=null){var a=new Bt((i[0]+i[1])/2,t);o.foundPossibleResultPoint(a)}var u=this.decodeMiddle(r,i,this.decodeRowStringBuffer);var s=u.rowOffset;var f=u.resultString;if(o!=null){var c=new Bt(s,t);o.foundPossibleResultPoint(c)}var l=e.decodeEnd(r,s);if(o!=null){var h=new Bt((l[0]+l[1])/2,t);o.foundPossibleResultPoint(h)}var d=l[1];var v=d+(d-l[0]);if(v>=r.getSize()||!r.isRange(d,v,false)){throw new J}var p=f.toString();if(p.length<8){throw new H}if(!e.checkChecksum(p)){throw new T}var g=(i[1]+i[0])/2;var y=(l[1]+l[0])/2;var w=this.getBarcodeFormat();var _=[new Bt(g,t),new Bt(y,t)];var A=new dt(p,null,0,_,w,(new Date).getTime());var m=0;try{var E=fe.decodeRow(t,r,l[1]);A.putMetadata(yt.UPC_EAN_EXTENSION,E.getText());A.putAllMetadata(E.getResultMetadata());A.addResultPoints(E.getResultPoints());m=E.getText().length}catch(t){}var C=n==null?null:n.get(V.ALLOWED_EAN_EXTENSIONS);if(C!=null){var I=false;for(var S in C){if(m.toString()===S){I=true;break}}if(!I){throw new J}}if(w===pt.EAN_13||w===pt.UPC_A);return A};e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)};e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(r===0)return false;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n};e.getStandardUPCEANChecksum=function(t){var e=t.length;var r=0;for(var n=e-1;n>=0;n-=2){var i=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9){throw new H}r+=i}r*=3;for(var n=e-2;n>=0;n-=2){var i=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);if(i<0||i>9){throw new H}r+=i}return(1e3-r)%10};e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,false,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))};return e}(ie);var he=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var de=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ve=function(t){he(e,t);function e(){var e=t.call(this)||this;e.decodeMiddleCounters=Int32Array.from([0,0,0,0]);return e}e.prototype.decodeMiddle=function(t,r,n){var i,o,a,u;var s=this.decodeMiddleCounters;s[0]=0;s[1]=0;s[2]=0;s[3]=0;var f=t.getSize();var c=r[1];var l=0;for(var h=0;h<6&&c<f;h++){var d=le.decodeDigit(t,s,c,le.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d%10);try{for(var v=(i=void 0,de(s)),p=v.next();!p.done;p=v.next()){var g=p.value;c+=g}}catch(t){i={error:t}}finally{try{if(p&&!p.done&&(o=v.return))o.call(v)}finally{if(i)throw i.error}}if(d>=10){l|=1<<5-h}}n=e.determineFirstDigit(n,l);var y=le.findGuardPattern(t,c,true,le.MIDDLE_PATTERN,new Int32Array(le.MIDDLE_PATTERN.length).fill(0));c=y[1];for(var h=0;h<6&&c<f;h++){var d=le.decodeDigit(t,s,c,le.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+d);try{for(var w=(a=void 0,de(s)),_=w.next();!_.done;_=w.next()){var g=_.value;c+=g}}catch(t){a={error:t}}finally{try{if(_&&!_.done&&(u=w.return))u.call(w)}finally{if(a)throw a.error}}}return{rowOffset:c,resultString:n}};e.prototype.getBarcodeFormat=function(){return pt.EAN_13};e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++){if(e===this.FIRST_DIGIT_ENCODINGS[r]){t=String.fromCharCode("0".charCodeAt(0)+r)+t;return t}}throw new J};e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];return e}(le);var pe=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ge=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ye=function(t){pe(e,t);function e(){var e=t.call(this)||this;e.decodeMiddleCounters=Int32Array.from([0,0,0,0]);return e}e.prototype.decodeMiddle=function(t,e,r){var n,i,o,a;var u=this.decodeMiddleCounters;u[0]=0;u[1]=0;u[2]=0;u[3]=0;var s=t.getSize();var f=e[1];for(var c=0;c<4&&f<s;c++){var l=le.decodeDigit(t,u,f,le.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l);try{for(var h=(n=void 0,ge(u)),d=h.next();!d.done;d=h.next()){var v=d.value;f+=v}}catch(t){n={error:t}}finally{try{if(d&&!d.done&&(i=h.return))i.call(h)}finally{if(n)throw n.error}}}var p=le.findGuardPattern(t,f,true,le.MIDDLE_PATTERN,new Int32Array(le.MIDDLE_PATTERN.length).fill(0));f=p[1];for(var c=0;c<4&&f<s;c++){var l=le.decodeDigit(t,u,f,le.L_PATTERNS);r+=String.fromCharCode("0".charCodeAt(0)+l);try{for(var g=(o=void 0,ge(u)),y=g.next();!y.done;y=g.next()){var v=y.value;f+=v}}catch(t){o={error:t}}finally{try{if(y&&!y.done&&(a=g.return))a.call(g)}finally{if(o)throw o.error}}}return{rowOffset:f,resultString:r}};e.prototype.getBarcodeFormat=function(){return pt.EAN_8};return e}(le);var we=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var _e=function(t){we(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.ean13Reader=new ve;return e}e.prototype.getBarcodeFormat=function(){return pt.UPC_A};e.prototype.decode=function(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))};e.prototype.decodeRow=function(t,e,r){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,r))};e.prototype.decodeMiddle=function(t,e,r){return this.ean13Reader.decodeMiddle(t,e,r)};e.prototype.maybeReturnResult=function(t){var e=t.getText();if(e.charAt(0)==="0"){var r=new dt(e.substring(1),null,null,t.getResultPoints(),pt.UPC_A);if(t.getResultMetadata()!=null){r.putAllMetadata(t.getResultMetadata())}return r}else{throw new J}};e.prototype.reset=function(){this.ean13Reader.reset()};return e}(le);var Ae=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var me=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Ee=function(t){Ae(e,t);function e(){var e=t.call(this)||this;e.decodeMiddleCounters=new Int32Array(4);return e}e.prototype.decodeMiddle=function(t,r,n){var i,o;var a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0;a[1]=0;a[2]=0;a[3]=0;var u=t.getSize();var s=r[1];var f=0;for(var c=0;c<6&&s<u;c++){var l=e.decodeDigit(t,a,s,e.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+l%10);try{for(var h=(i=void 0,me(a)),d=h.next();!d.done;d=h.next()){var v=d.value;s+=v}}catch(t){i={error:t}}finally{try{if(d&&!d.done&&(o=h.return))o.call(h)}finally{if(i)throw i.error}}if(l>=10){f|=1<<5-c}}e.determineNumSysAndCheckDigit(new K(n),f);return s};e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,true,e.MIDDLE_END_PATTERN)};e.prototype.checkChecksum=function(t){return le.checkChecksum(e.convertUPCEtoUPCA(t))};e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++){for(var n=0;n<10;n++){if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n]){t.insert(0,"0"+r);t.append("0"+n);return}}}throw J.getNotFoundInstance()};e.prototype.getBarcodeFormat=function(){return pt.UPC_E};e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)});var r=new K;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2);r.append(n);r.append("0000");r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3);r.append("00000");r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4);r.append("00000");r.append(e[4]);break;default:r.appendChars(e,0,5);r.append("0000");r.append(n);break}if(t.length>=8){r.append(t.charAt(7))}return r.toString()};e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]);e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])];return e}(le);var Ce=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ie=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Se=function(t){Ce(e,t);function e(e){var r=t.call(this)||this;var n=e==null?null:e.get(V.POSSIBLE_FORMATS);var i=[];if(n!=null){if(n.indexOf(pt.EAN_13)>-1){i.push(new ve)}else if(n.indexOf(pt.UPC_A)>-1){i.push(new _e)}if(n.indexOf(pt.EAN_8)>-1){i.push(new ye)}if(n.indexOf(pt.UPC_E)>-1){i.push(new Ee)}}if(i.length===0){i.push(new ve);i.push(new ye);i.push(new Ee)}r.readers=i;return r}e.prototype.decodeRow=function(t,e,r){var n,i;try{for(var o=Ie(this.readers),a=o.next();!a.done;a=o.next()){var u=a.value;try{var s=u.decodeRow(t,e,r);var f=s.getBarcodeFormat()===pt.EAN_13&&s.getText().charAt(0)==="0";var c=r==null?null:r.get(V.POSSIBLE_FORMATS);var l=c==null||c.includes(pt.UPC_A);if(f&&l){var h=s.getRawBytes();var d=new dt(s.getText().substring(1),h,h.length,s.getResultPoints(),pt.UPC_A);d.putAllMetadata(s.getResultMetadata());return d}return s}catch(t){}}}catch(t){n={error:t}}finally{try{if(a&&!a.done&&(i=o.return))i.call(o)}finally{if(n)throw n.error}}throw new J};e.prototype.reset=function(){var t,e;try{for(var r=Ie(this.readers),n=r.next();!n.done;n=r.next()){var i=n.value;i.reset()}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}};return e}(Zt);var Oe=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Te=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var be=function(t){Oe(e,t);function e(){var e=t.call(this)||this;e.decodeFinderCounters=new Int32Array(4);e.dataCharacterCounters=new Int32Array(8);e.oddRoundingErrors=new Array(4);e.evenRoundingErrors=new Array(4);e.oddCounts=new Array(e.dataCharacterCounters.length/2);e.evenCounts=new Array(e.dataCharacterCounters.length/2);return e}e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters};e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters};e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors};e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors};e.prototype.getOddCounts=function(){return this.oddCounts};e.prototype.getEvenCounts=function(){return this.evenCounts};e.prototype.parseFinderValue=function(t,r){for(var n=0;n<r.length;n++){if(Zt.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE){return n}}throw new J};e.count=function(t){return Pt.sum(new Int32Array(t))};e.increment=function(t,e){var r=0;var n=e[0];for(var i=1;i<t.length;i++){if(e[i]>n){n=e[i];r=i}}t[r]++};e.decrement=function(t,e){var r=0;var n=e[0];for(var i=1;i<t.length;i++){if(e[i]<n){n=e[i];r=i}}t[r]--};e.isFinderPattern=function(t){var r,n;var i=t[0]+t[1];var o=i+t[2]+t[3];var a=i/o;if(a>=e.MIN_FINDER_PATTERN_RATIO&&a<=e.MAX_FINDER_PATTERN_RATIO){var u=Number.MAX_SAFE_INTEGER;var s=Number.MIN_SAFE_INTEGER;try{for(var f=Te(t),c=f.next();!c.done;c=f.next()){var l=c.value;if(l>s){s=l}if(l<u){u=l}}}catch(t){r={error:t}}finally{try{if(c&&!c.done&&(n=f.return))n.call(f)}finally{if(r)throw r.error}}return s<10*u}return false};e.MAX_AVG_VARIANCE=.2;e.MAX_INDIVIDUAL_VARIANCE=.45;e.MIN_FINDER_PATTERN_RATIO=9.5/12;e.MAX_FINDER_PATTERN_RATIO=12.5/14;return e}(Zt);var Re=function(){function t(t,e){this.value=t;this.checksumPortion=e}t.prototype.getValue=function(){return this.value};t.prototype.getChecksumPortion=function(){return this.checksumPortion};t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.value===r.value&&this.checksumPortion===r.checksumPortion};t.prototype.hashCode=function(){return this.value^this.checksumPortion};return t}();var Ne=function(){function t(t,e,r,n,i){this.value=t;this.startEnd=e;this.value=t;this.startEnd=e;this.resultPoints=new Array;this.resultPoints.push(new Bt(r,i));this.resultPoints.push(new Bt(n,i))}t.prototype.getValue=function(){return this.value};t.prototype.getStartEnd=function(){return this.startEnd};t.prototype.getResultPoints=function(){return this.resultPoints};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.value===r.value};t.prototype.hashCode=function(){return this.value};return t}();var De=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Pe=function(){function t(){}t.getRSSvalue=function(e,r,n){var i,o;var a=0;try{for(var u=De(e),s=u.next();!s.done;s=u.next()){var f=s.value;a+=f}}catch(t){i={error:t}}finally{try{if(s&&!s.done&&(o=u.return))o.call(u)}finally{if(i)throw i.error}}var c=0;var l=0;var h=e.length;for(var d=0;d<h-1;d++){var v=void 0;for(v=1,l|=1<<d;v<e[d];v++,l&=~(1<<d)){var p=t.combins(a-v-1,h-d-2);if(n&&l===0&&a-v-(h-d-1)>=h-d-1){p-=t.combins(a-v-(h-d),h-d-2)}if(h-d-1>1){var g=0;for(var y=a-v-(h-d-2);y>r;y--){g+=t.combins(a-v-y-1,h-d-3)}p-=g*(h-1-d)}else if(a-v>r){p--}c+=p}a-=v}return c};t.combins=function(t,e){var r;var n;if(t-e>e){n=e;r=t-e}else{n=t-e;r=e}var i=1;var o=1;for(var a=t;a>r;a--){i*=a;if(o<=n){i/=o;o++}}while(o<=n){i/=o;o++}return i};return t}();var Me=function(){function t(){}t.buildBitArray=function(t){var e=t.length*2-1;if(t[t.length-1].getRightChar()==null){e-=1}var r=12*e;var n=new x(r);var i=0;var o=t[0];var a=o.getRightChar().getValue();for(var u=11;u>=0;--u){if((a&1<<u)!=0){n.set(i)}i++}for(var u=1;u<t.length;++u){var s=t[u];var f=s.getLeftChar().getValue();for(var c=11;c>=0;--c){if((f&1<<c)!=0){n.set(i)}i++}if(s.getRightChar()!=null){var l=s.getRightChar().getValue();for(var c=11;c>=0;--c){if((l&1<<c)!=0){n.set(i)}i++}}}return n};return t}();var Be=function(){function t(t,e){if(e){this.decodedInformation=null}else{this.finished=t;this.decodedInformation=e}}t.prototype.getDecodedInformation=function(){return this.decodedInformation};t.prototype.isFinished=function(){return this.finished};return t}();var Le=function(){function t(t){this.newPosition=t}t.prototype.getNewPosition=function(){return this.newPosition};return t}();var Fe=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var xe=function(t){Fe(e,t);function e(e,r){var n=t.call(this,e)||this;n.value=r;return n}e.prototype.getValue=function(){return this.value};e.prototype.isFNC1=function(){return this.value===e.FNC1};e.FNC1="$";return e}(Le);var ke=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ve=function(t){ke(e,t);function e(e,r,n){var i=t.call(this,e)||this;if(n){i.remaining=true;i.remainingValue=i.remainingValue}else{i.remaining=false;i.remainingValue=0}i.newString=r;return i}e.prototype.getNewString=function(){return this.newString};e.prototype.isRemaining=function(){return this.remaining};e.prototype.getRemainingValue=function(){return this.remainingValue};return e}(Le);var Ue=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var He=function(t){Ue(e,t);function e(e,r,n){var i=t.call(this,e)||this;if(r<0||r>10||n<0||n>10){throw new H}i.firstDigit=r;i.secondDigit=n;return i}e.prototype.getFirstDigit=function(){return this.firstDigit};e.prototype.getSecondDigit=function(){return this.secondDigit};e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit};e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1};e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1};e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1};e.FNC1=10;return e}(Le);var Ge=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Xe=function(){function t(){}t.parseFieldsInGeneralPurpose=function(e){var r,n,i,o,a,u,s,f;if(!e){return null}if(e.length<2){throw new J}var c=e.substring(0,2);try{for(var l=Ge(t.TWO_DIGIT_DATA_LENGTH),h=l.next();!h.done;h=l.next()){var d=h.value;if(d[0]===c){if(d[1]===t.VARIABLE_LENGTH){return t.processVariableAI(2,d[2],e)}return t.processFixedAI(2,d[1],e)}}}catch(t){r={error:t}}finally{try{if(h&&!h.done&&(n=l.return))n.call(l)}finally{if(r)throw r.error}}if(e.length<3){throw new J}var v=e.substring(0,3);try{for(var p=Ge(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next()){var d=g.value;if(d[0]===v){if(d[1]===t.VARIABLE_LENGTH){return t.processVariableAI(3,d[2],e)}return t.processFixedAI(3,d[1],e)}}}catch(t){i={error:t}}finally{try{if(g&&!g.done&&(o=p.return))o.call(p)}finally{if(i)throw i.error}}try{for(var y=Ge(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=y.next();!w.done;w=y.next()){var d=w.value;if(d[0]===v){if(d[1]===t.VARIABLE_LENGTH){return t.processVariableAI(4,d[2],e)}return t.processFixedAI(4,d[1],e)}}}catch(t){a={error:t}}finally{try{if(w&&!w.done&&(u=y.return))u.call(y)}finally{if(a)throw a.error}}if(e.length<4){throw new J}var _=e.substring(0,4);try{for(var A=Ge(t.FOUR_DIGIT_DATA_LENGTH),m=A.next();!m.done;m=A.next()){var d=m.value;if(d[0]===_){if(d[1]===t.VARIABLE_LENGTH){return t.processVariableAI(4,d[2],e)}return t.processFixedAI(4,d[1],e)}}}catch(t){s={error:t}}finally{try{if(m&&!m.done&&(f=A.return))f.call(A)}finally{if(s)throw s.error}}throw new J};t.processFixedAI=function(e,r,n){if(n.length<e){throw new J}var i=n.substring(0,e);if(n.length<e+r){throw new J}var o=n.substring(e,e+r);var a=n.substring(e+r);var u="("+i+")"+o;var s=t.parseFieldsInGeneralPurpose(a);return s==null?u:u+s};t.processVariableAI=function(e,r,n){var i=n.substring(0,e);var o;if(n.length<e+r){o=n.length}else{o=e+r}var a=n.substring(e,o);var u=n.substring(o);var s="("+i+")"+a;var f=t.parseFieldsInGeneralPurpose(u);return f==null?s:s+f};t.VARIABLE_LENGTH=[];t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]];t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]];t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]];t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]];return t}();var We=function(){function t(t){this.buffer=new K;this.information=t}t.prototype.decodeAllCodes=function(t,e){var r=e;var n=null;do{var i=this.decodeGeneralPurposeField(r,n);var o=Xe.parseFieldsInGeneralPurpose(i.getNewString());if(o!=null){t.append(o)}if(i.isRemaining()){n=""+i.getRemainingValue()}else{n=null}if(r===i.getNewPosition()){break}r=i.getNewPosition()}while(true);return t.toString()};t.prototype.isStillNumeric=function(t){if(t+7>this.information.getSize()){return t+4<=this.information.getSize()}for(var e=t;e<t+3;++e){if(this.information.get(e)){return true}}return this.information.get(t+3)};t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);if(e===0){return new He(this.information.getSize(),He.FNC1,He.FNC1)}return new He(this.information.getSize(),e-1,He.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);var n=(r-8)/11;var i=(r-8)%11;return new He(t+7,n,i)};t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)};t.extractNumericValueFromBitArray=function(t,e,r){var n=0;for(var i=0;i<r;++i){if(t.get(e+i)){n|=1<<r-i-1}}return n};t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero();if(e!=null){this.buffer.append(e)}this.current.setPosition(t);var r=this.parseBlocks();if(r!=null&&r.isRemaining()){return new Ve(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue())}return new Ve(this.current.getPosition(),this.buffer.toString())};t.prototype.parseBlocks=function(){var t;var e;do{var r=this.current.getPosition();if(this.current.isAlpha()){e=this.parseAlphaBlock();t=e.isFinished()}else if(this.current.isIsoIec646()){e=this.parseIsoIec646Block();t=e.isFinished()}else{e=this.parseNumericBlock();t=e.isFinished()}var n=r!==this.current.getPosition();if(!n&&!t){break}}while(!t);return e.getDecodedInformation()};t.prototype.parseNumericBlock=function(){while(this.isStillNumeric(this.current.getPosition())){var t=this.decodeNumeric(this.current.getPosition());this.current.setPosition(t.getNewPosition());if(t.isFirstDigitFNC1()){var e=void 0;if(t.isSecondDigitFNC1()){e=new Ve(this.current.getPosition(),this.buffer.toString())}else{e=new Ve(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit())}return new Be(true,e)}this.buffer.append(t.getFirstDigit());if(t.isSecondDigitFNC1()){var e=new Ve(this.current.getPosition(),this.buffer.toString());return new Be(true,e)}this.buffer.append(t.getSecondDigit())}if(this.isNumericToAlphaNumericLatch(this.current.getPosition())){this.current.setAlpha();this.current.incrementPosition(4)}return new Be(false)};t.prototype.parseIsoIec646Block=function(){while(this.isStillIsoIec646(this.current.getPosition())){var t=this.decodeIsoIec646(this.current.getPosition());this.current.setPosition(t.getNewPosition());if(t.isFNC1()){var e=new Ve(this.current.getPosition(),this.buffer.toString());return new Be(true,e)}this.buffer.append(t.getValue())}if(this.isAlphaOr646ToNumericLatch(this.current.getPosition())){this.current.incrementPosition(3);this.current.setNumeric()}else if(this.isAlphaTo646ToAlphaLatch(this.current.getPosition())){if(this.current.getPosition()+5<this.information.getSize()){this.current.incrementPosition(5)}else{this.current.setPosition(this.information.getSize())}this.current.setAlpha()}return new Be(false)};t.prototype.parseAlphaBlock=function(){while(this.isStillAlpha(this.current.getPosition())){var t=this.decodeAlphanumeric(this.current.getPosition());this.current.setPosition(t.getNewPosition());if(t.isFNC1()){var e=new Ve(this.current.getPosition(),this.buffer.toString());return new Be(true,e)}this.buffer.append(t.getValue())}if(this.isAlphaOr646ToNumericLatch(this.current.getPosition())){this.current.incrementPosition(3);this.current.setNumeric()}else if(this.isAlphaTo646ToAlphaLatch(this.current.getPosition())){if(this.current.getPosition()+5<this.information.getSize()){this.current.incrementPosition(5)}else{this.current.setPosition(this.information.getSize())}this.current.setIsoIec646()}return new Be(false)};t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize()){return false}var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16){return true}if(t+7>this.information.getSize()){return false}var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116){return true}if(t+8>this.information.getSize()){return false}var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253};t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15){return new xe(t+5,xe.FNC1)}if(e>=5&&e<15){return new xe(t+5,"0"+(e-5))}var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<90){return new xe(t+7,""+(r+1))}if(r>=90&&r<116){return new xe(t+7,""+(r+7))}var n=this.extractNumericValueFromBitArray(t,8);var i;switch(n){case 232:i="!";break;case 233:i='"';break;case 234:i="%";break;case 235:i="&";break;case 236:i="'";break;case 237:i="(";break;case 238:i=")";break;case 239:i="*";break;case 240:i="+";break;case 241:i=",";break;case 242:i="-";break;case 243:i=".";break;case 244:i="/";break;case 245:i=":";break;case 246:i=";";break;case 247:i="<";break;case 248:i="=";break;case 249:i=">";break;case 250:i="?";break;case 251:i="_";break;case 252:i=" ";break;default:throw new H}return new xe(t+8,i)};t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize()){return false}var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16){return true}if(t+6>this.information.getSize()){return false}var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63};t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15){return new xe(t+5,xe.FNC1)}if(e>=5&&e<15){return new xe(t+5,"0"+(e-5))}var r=this.extractNumericValueFromBitArray(t,6);if(r>=32&&r<58){return new xe(t+6,""+(r+33))}var n;switch(r){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new bt("Decoding invalid alphanumeric value: "+r)}return new xe(t+6,n)};t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize()){return false}for(var e=0;e<5&&e+t<this.information.getSize();++e){if(e===2){if(!this.information.get(t+2)){return false}}else if(this.information.get(t+e)){return false}}return true};t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize()){return false}for(var e=t;e<t+3;++e){if(this.information.get(e)){return false}}return true};t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize()){return false}for(var e=0;e<4&&e+t<this.information.getSize();++e){if(this.information.get(t+e)){return false}}return true};return t}();var je=function(){function t(t){this.information=t;this.generalDecoder=new We(t)}t.prototype.getInformation=function(){return this.information};t.prototype.getGeneralDecoder=function(){return this.generalDecoder};return t}();var ze=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ye=function(t){ze(e,t);function e(e){return t.call(this,e)||this}e.prototype.encodeCompressedGtin=function(t,e){t.append("(01)");var r=t.length();t.append("9");this.encodeCompressedGtinWithoutAI(t,e,r)};e.prototype.encodeCompressedGtinWithoutAI=function(t,r,n){for(var i=0;i<4;++i){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);if(o/100===0){t.append("0")}if(o/10===0){t.append("0")}t.append(o)}e.appendCheckDigit(t,n)};e.appendCheckDigit=function(t,e){var r=0;for(var n=0;n<13;n++){var i=t.charAt(n+e).charCodeAt(0)-"0".charCodeAt(0);r+=(n&1)===0?3*i:i}r=10-r%10;if(r===10){r=0}t.append(r)};e.GTIN_SIZE=40;return e}(je);var Ze=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ke=function(t){Ze(e,t);function e(e){return t.call(this,e)||this}e.prototype.parseInformation=function(){var t=new K;t.append("(01)");var r=t.length();var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);t.append(n);this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r);return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)};e.HEADER_SIZE=1+1+2;return e}(Ye);var qe=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Qe=function(t){qe(e,t);function e(e){return t.call(this,e)||this}e.prototype.parseInformation=function(){var t=new K;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)};e.HEADER_SIZE=2+1+2;return e}(je);var Je=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var $e=function(t){Je(e,t);function e(e){return t.call(this,e)||this}e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);var i=this.checkWeight(n);var o=1e5;for(var a=0;a<5;++a){if(i/o===0){t.append("0")}o/=10}t.append(i)};return e}(Ye);var tr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var er=function(t){tr(e,t);function e(e){return t.call(this,e)||this}e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+$e.GTIN_SIZE+e.WEIGHT_SIZE){throw new J}var t=new K;this.encodeCompressedGtin(t,e.HEADER_SIZE);this.encodeCompressedWeight(t,e.HEADER_SIZE+$e.GTIN_SIZE,e.WEIGHT_SIZE);return t.toString()};e.HEADER_SIZE=4+1;e.WEIGHT_SIZE=15;return e}($e);var rr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var nr=function(t){rr(e,t);function e(e){return t.call(this,e)||this}e.prototype.addWeightCode=function(t,e){t.append("(3103)")};e.prototype.checkWeight=function(t){return t};return e}(er);var ir=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var or=function(t){ir(e,t);function e(e){return t.call(this,e)||this}e.prototype.addWeightCode=function(t,e){if(e<1e4){t.append("(3202)")}else{t.append("(3203)")}};e.prototype.checkWeight=function(t){if(t<1e4){return t}return t-1e4};return e}(er);var ar=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ur=function(t){ar(e,t);function e(e){return t.call(this,e)||this}e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ye.GTIN_SIZE){throw new J}var t=new K;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ye.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392");t.append(r);t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ye.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);t.append(n.getNewString());return t.toString()};e.HEADER_SIZE=5+1+2;e.LAST_DIGIT_SIZE=2;return e}(Ye);var sr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var fr=function(t){sr(e,t);function e(e){return t.call(this,e)||this}e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Ye.GTIN_SIZE){throw new J}var t=new K;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ye.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393");t.append(r);t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Ye.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);if(n/100==0){t.append("0")}if(n/10==0){t.append("0")}t.append(n);var i=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Ye.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);t.append(i.getNewString());return t.toString()};e.HEADER_SIZE=5+1+2;e.LAST_DIGIT_SIZE=2;e.FIRST_THREE_DIGITS_SIZE=10;return e}(Ye);var cr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var lr=function(t){cr(e,t);function e(e,r,n){var i=t.call(this,e)||this;i.dateCode=n;i.firstAIdigits=r;return i}e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE){throw new J}var t=new K;this.encodeCompressedGtin(t,e.HEADER_SIZE);this.encodeCompressedWeight(t,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE);this.encodeCompressedDate(t,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE);return t.toString()};e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(n==38400){return}t.append("(");t.append(this.dateCode);t.append(")");var i=n%32;n/=32;var o=n%12+1;n/=12;var a=n;if(a/10==0){t.append("0")}t.append(a);if(o/10==0){t.append("0")}t.append(o);if(i/10==0){t.append("0")}t.append(i)};e.prototype.addWeightCode=function(t,e){t.append("(");t.append(this.firstAIdigits);t.append(e/1e5);t.append(")")};e.prototype.checkWeight=function(t){return t%1e5};e.HEADER_SIZE=7+1;e.WEIGHT_SIZE=20;e.DATE_SIZE=16;return e}($e);function hr(t){try{if(t.get(1)){return new Ke(t)}if(!t.get(2)){return new Qe(t)}var e=We.extractNumericValueFromBitArray(t,1,4);switch(e){case 4:return new nr(t);case 5:return new or(t)}var r=We.extractNumericValueFromBitArray(t,1,5);switch(r){case 12:return new ur(t);case 13:return new fr(t)}var n=We.extractNumericValueFromBitArray(t,1,7);switch(n){case 56:return new lr(t,"310","11");case 57:return new lr(t,"320","11");case 58:return new lr(t,"310","13");case 59:return new lr(t,"320","13");case 60:return new lr(t,"310","15");case 61:return new lr(t,"320","15");case 62:return new lr(t,"310","17");case 63:return new lr(t,"320","17")}}catch(e){console.log(e);throw new bt("unknown decoder: "+t)}}var dr=function(){function t(t,e,r,n){this.leftchar=t;this.rightchar=e;this.finderpattern=r;this.maybeLast=n}t.prototype.mayBeLast=function(){return this.maybeLast};t.prototype.getLeftChar=function(){return this.leftchar};t.prototype.getRightChar=function(){return this.rightchar};t.prototype.getFinderPattern=function(){return this.finderpattern};t.prototype.mustBeLast=function(){return this.rightchar==null};t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"};t.equals=function(e,r){if(!(e instanceof t)){return false}return t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)};t.equalsOrNull=function(e,r){return e===null?r===null:t.equals(e,r)};t.prototype.hashCode=function(){var t=this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue();return t};return t}();var vr=function(){function t(t,e,r){this.pairs=t;this.rowNumber=e;this.wasReversed=r}t.prototype.getPairs=function(){return this.pairs};t.prototype.getRowNumber=function(){return this.rowNumber};t.prototype.isReversed=function(){return this.wasReversed};t.prototype.isEquivalent=function(t){return this.checkEqualitity(this,t)};t.prototype.toString=function(){return"{ "+this.pairs+" }"};t.prototype.equals=function(e,r){if(!(e instanceof t)){return false}return this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed};t.prototype.checkEqualitity=function(t,e){if(!t||!e)return;var r;t.forEach(function(t,n){e.forEach(function(e){if(t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()){r=true}})});return r};return t}();var pr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var gr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var yr=function(t){pr(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;r.pairs=new Array(e.MAX_PAIRS);r.rows=new Array;r.startEnd=[2];return r}e.prototype.decodeRow=function(t,r,n){this.pairs.length=0;this.startFromEven=false;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(t){}this.pairs.length=0;this.startFromEven=true;return e.constructResult(this.decodeRow2pairs(t,r))};e.prototype.reset=function(){this.pairs.length=0;this.rows.length=0};e.prototype.decodeRow2pairs=function(t,e){var r=false;while(!r){try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof J){if(!this.pairs.length){throw new J}r=true}}}if(this.checkChecksum()){return this.pairs}var n;if(this.rows.length){n=true}else{n=false}this.storeRow(t,false);if(n){var i=this.checkRowsBoolean(false);if(i!=null){return i}i=this.checkRowsBoolean(true);if(i!=null){return i}}throw new J};e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25){this.rows.length=0;return null}this.pairs.length=0;if(t){this.rows=this.rows.reverse()}var e=null;try{e=this.checkRows(new Array,0)}catch(t){console.log(t)}if(t){this.rows=this.rows.reverse()}return e};e.prototype.checkRows=function(t,r){var n,i;for(var o=r;o<this.rows.length;o++){var a=this.rows[o];this.pairs.length=0;try{for(var u=(n=void 0,gr(t)),s=u.next();!s.done;s=u.next()){var f=s.value;this.pairs.push(f.getPairs())}}catch(t){n={error:t}}finally{try{if(s&&!s.done&&(i=u.return))i.call(u)}finally{if(n)throw n.error}}this.pairs.push(a.getPairs());if(!e.isValidSequence(this.pairs)){continue}if(this.checkChecksum()){return this.pairs}var c=new Array(t);c.push(a);try{return this.checkRows(c,o+1)}catch(t){console.log(t)}}throw new J};e.isValidSequence=function(t){var r,n;try{for(var i=gr(e.FINDER_PATTERN_SEQUENCES),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.length>a.length){continue}var u=true;for(var s=0;s<t.length;s++){if(t[s].getFinderPattern().getValue()!=a[s]){u=false;break}}if(u){return true}}}catch(t){r={error:t}}finally{try{if(o&&!o.done&&(n=i.return))n.call(i)}finally{if(r)throw r.error}}return false};e.prototype.storeRow=function(t,r){var n=0;var i=false;var o=false;while(n<this.rows.length){var a=this.rows[n];if(a.getRowNumber()>t){o=a.isEquivalent(this.pairs);break}i=a.isEquivalent(this.pairs);n++}if(o||i){return}if(e.isPartialRow(this.pairs,this.rows)){return}this.rows.push(n,new vr(this.pairs,t,r));this.removePartialRows(this.pairs,this.rows)};e.prototype.removePartialRows=function(t,e){var r,n,i,o,a,u;try{for(var s=gr(e),f=s.next();!f.done;f=s.next()){var c=f.value;if(c.getPairs().length===t.length){continue}var l=true;try{for(var h=(i=void 0,gr(c.getPairs())),d=h.next();!d.done;d=h.next()){var v=d.value;var p=false;try{for(var g=(a=void 0,gr(t)),y=g.next();!y.done;y=g.next()){var w=y.value;if(dr.equals(v,w)){p=true;break}}}catch(t){a={error:t}}finally{try{if(y&&!y.done&&(u=g.return))u.call(g)}finally{if(a)throw a.error}}if(!p){l=false}}}catch(t){i={error:t}}finally{try{if(d&&!d.done&&(o=h.return))o.call(h)}finally{if(i)throw i.error}}}}catch(t){r={error:t}}finally{try{if(f&&!f.done&&(n=s.return))n.call(s)}finally{if(r)throw r.error}}};e.isPartialRow=function(t,e){var r,n,i,o,a,u;try{for(var s=gr(e),f=s.next();!f.done;f=s.next()){var c=f.value;var l=true;try{for(var h=(i=void 0,gr(t)),d=h.next();!d.done;d=h.next()){var v=d.value;var p=false;try{for(var g=(a=void 0,gr(c.getPairs())),y=g.next();!y.done;y=g.next()){var w=y.value;if(v.equals(w)){p=true;break}}}catch(t){a={error:t}}finally{try{if(y&&!y.done&&(u=g.return))u.call(g)}finally{if(a)throw a.error}}if(!p){l=false;break}}}catch(t){i={error:t}}finally{try{if(d&&!d.done&&(o=h.return))o.call(h)}finally{if(i)throw i.error}}if(l){return true}}}catch(t){r={error:t}}finally{try{if(f&&!f.done&&(n=s.return))n.call(s)}finally{if(r)throw r.error}}return false};e.prototype.getRows=function(){return this.rows};e.constructResult=function(t){var e=Me.buildBitArray(t);var r=hr(e);var n=r.parseInformation();var i=t[0].getFinderPattern().getResultPoints();var o=t[t.length-1].getFinderPattern().getResultPoints();var a=[i[0],i[1],o[0],o[1]];return new dt(n,null,null,a,pt.RSS_EXPANDED,null)};e.prototype.checkChecksum=function(){var t=this.pairs.get(0);var e=t.getLeftChar();var r=t.getRightChar();if(r==null){return false}var n=r.getChecksumPortion();var i=2;for(var o=1;o<this.pairs.size();++o){var a=this.pairs.get(o);n+=a.getLeftChar().getChecksumPortion();i++;var u=a.getRightChar();if(u!=null){n+=u.getChecksumPortion();i++}}n%=211;var s=211*(i-4)+n;return s==e.getValue()};e.getNextSecondBar=function(t,e){var r;if(t.get(e)){r=t.getNextUnset(e);r=t.getNextSet(r)}else{r=t.getNextSet(e);r=t.getNextUnset(r)}return r};e.prototype.retrieveNextPair=function(t,r,n){var i=r.length%2==0;if(this.startFromEven){i=!i}var o;var a=true;var u=-1;do{this.findNextPair(t,r,u);o=this.parseFoundFinderPattern(t,n,i);if(o==null){u=e.getNextSecondBar(t,this.startEnd[0])}else{a=false}}while(a);var s=this.decodeDataCharacter(t,o,i,true);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast()){throw new J}var f;try{f=this.decodeDataCharacter(t,o,i,false)}catch(t){f=null;console.log(t)}return new dr(s,f,o,true)};e.prototype.isEmptyPair=function(t){if(t.length===0){return true}return false};e.prototype.findNextPair=function(t,r,n){var i=this.getDecodeFinderCounters();i[0]=0;i[1]=0;i[2]=0;i[3]=0;var o=t.getSize();var a;if(n>=0){a=n}else if(this.isEmptyPair(r)){a=0}else{var u=r[r.length-1];a=u.getFinderPattern().getStartEnd()[1]}var s=r.length%2!=0;if(this.startFromEven){s=!s}var f=false;while(a<o){f=!t.get(a);if(!f){break}a++}var c=0;var l=a;for(var h=a;h<o;h++){if(t.get(h)!=f){i[c]++}else{if(c==3){if(s){e.reverseCounters(i)}if(e.isFinderPattern(i)){this.startEnd[0]=l;this.startEnd[1]=h;return}if(s){e.reverseCounters(i)}l+=i[0]+i[1];i[0]=i[2];i[1]=i[3];i[2]=0;i[3]=0;c--}else{c++}i[c]=1;f=!f}}throw new J};e.reverseCounters=function(t){var e=t.length;for(var r=0;r<e/2;++r){var n=t[r];t[r]=t[e-r-1];t[e-r-1]=n}};e.prototype.parseFoundFinderPattern=function(t,r,n){var i;var o;var a;if(n){var u=this.startEnd[0]-1;while(u>=0&&!t.get(u)){u--}u++;i=this.startEnd[0]-u;o=u;a=this.startEnd[1]}else{o=this.startEnd[0];a=t.getNextUnset(this.startEnd[1]+1);i=a-this.startEnd[1]}var s=this.getDecodeFinderCounters();R.arraycopy(s,0,s,1,s.length-1);s[0]=i;var f;try{f=this.parseFinderValue(s,e.FINDER_PATTERNS)}catch(t){return null}return new Ne(f,[o,a],o,a,r)};e.prototype.decodeDataCharacter=function(t,r,n,i){var o=this.getDataCharacterCounters();for(var a=0;a<o.length;a++){o[a]=0}if(i){e.recordPatternInReverse(t,r.getStartEnd()[0],o)}else{e.recordPattern(t,r.getStartEnd()[1],o);for(var u=0,s=o.length-1;u<s;u++,s--){var f=o[u];o[u]=o[s];o[s]=f}}var c=17;var l=Pt.sum(new Int32Array(o))/c;var h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(l-h)/h>.3){throw new J}var d=this.getOddCounts();var v=this.getEvenCounts();var p=this.getOddRoundingErrors();var g=this.getEvenRoundingErrors();for(var u=0;u<o.length;u++){var y=1*o[u]/l;var w=y+.5;if(w<1){if(y<.3){throw new J}w=1}else if(w>8){if(y>8.7){throw new J}w=8}var _=u/2;if((u&1)==0){d[_]=w;p[_]=y-w}else{v[_]=w;g[_]=y-w}}this.adjustOddEvenCounts(c);var A=4*r.getValue()+(n?0:2)+(i?0:1)-1;var m=0;var E=0;for(var u=d.length-1;u>=0;u--){if(e.isNotA1left(r,n,i)){var C=e.WEIGHTS[A][2*u];E+=d[u]*C}m+=d[u]}var I=0;for(var u=v.length-1;u>=0;u--){if(e.isNotA1left(r,n,i)){var C=e.WEIGHTS[A][2*u+1];I+=v[u]*C}}var S=E+I;if((m&1)!=0||m>13||m<4){throw new J}var O=(13-m)/2;var T=e.SYMBOL_WIDEST[O];var b=9-T;var R=Pe.getRSSvalue(d,T,true);var N=Pe.getRSSvalue(v,b,false);var D=e.EVEN_TOTAL_SUBSET[O];var P=e.GSUM[O];var M=R*D+N+P;return new Re(M,S)};e.isNotA1left=function(t,e,r){return!(t.getValue()==0&&e&&r)};e.prototype.adjustOddEvenCounts=function(t){var r=Pt.sum(new Int32Array(this.getOddCounts()));var n=Pt.sum(new Int32Array(this.getEvenCounts()));var i=false;var o=false;if(r>13){o=true}else if(r<4){i=true}var a=false;var u=false;if(n>13){u=true}else if(n<4){a=true}var s=r+n-t;var f=(r&1)==1;var c=(n&1)==0;if(s==1){if(f){if(c){throw new J}o=true}else{if(!c){throw new J}u=true}}else if(s==-1){if(f){if(c){throw new J}i=true}else{if(!c){throw new J}a=true}}else if(s==0){if(f){if(!c){throw new J}if(r<n){i=true;u=true}else{o=true;a=true}}else{if(c){throw new J}}}else{throw new J}if(i){if(o){throw new J}e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o){e.decrement(this.getOddCounts(),this.getOddRoundingErrors())}if(a){if(u){throw new J}e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}if(u){e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}};e.SYMBOL_WIDEST=[7,5,4,3,1];e.EVEN_TOTAL_SUBSET=[4,20,52,104,204];e.GSUM=[0,348,1388,2948,3988];e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])];e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]];e.FINDER_PAT_A=0;e.FINDER_PAT_B=1;e.FINDER_PAT_C=2;e.FINDER_PAT_D=3;e.FINDER_PAT_E=4;e.FINDER_PAT_F=5;e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]];e.MAX_PAIRS=11;return e}(be);var wr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var _r=function(t){wr(e,t);function e(e,r,n){var i=t.call(this,e,r)||this;i.count=0;i.finderPattern=n;return i}e.prototype.getFinderPattern=function(){return this.finderPattern};e.prototype.getCount=function(){return this.count};e.prototype.incrementCount=function(){this.count++};return e}(Re);var Ar=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var mr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Er=function(t){Ar(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.possibleLeftPairs=[];e.possibleRightPairs=[];return e}e.prototype.decodeRow=function(t,r,n){var i,o,a,u;var s=this.decodePair(r,false,t,n);e.addOrTally(this.possibleLeftPairs,s);r.reverse();var f=this.decodePair(r,true,t,n);e.addOrTally(this.possibleRightPairs,f);r.reverse();try{for(var c=mr(this.possibleLeftPairs),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.getCount()>1){try{for(var d=(a=void 0,mr(this.possibleRightPairs)),v=d.next();!v.done;v=d.next()){var p=v.value;if(p.getCount()>1&&e.checkChecksum(h,p)){return e.constructResult(h,p)}}}catch(t){a={error:t}}finally{try{if(v&&!v.done&&(u=d.return))u.call(d)}finally{if(a)throw a.error}}}}}catch(t){i={error:t}}finally{try{if(l&&!l.done&&(o=c.return))o.call(c)}finally{if(i)throw i.error}}throw new J};e.addOrTally=function(t,e){var r,n;if(e==null){return}var i=false;try{for(var o=mr(t),a=o.next();!a.done;a=o.next()){var u=a.value;if(u.getValue()===e.getValue()){u.incrementCount();i=true;break}}}catch(t){r={error:t}}finally{try{if(a&&!a.done&&(n=o.return))n.call(o)}finally{if(r)throw r.error}}if(!i){t.push(e)}};e.prototype.reset=function(){this.possibleLeftPairs.length=0;this.possibleRightPairs.length=0};e.constructResult=function(t,e){var r=4537077*t.getValue()+e.getValue();var n=new String(r).toString();var i=new K;for(var o=13-n.length;o>0;o--){i.append("0")}i.append(n);var a=0;for(var o=0;o<13;o++){var u=i.charAt(o).charCodeAt(0)-"0".charCodeAt(0);a+=(o&1)===0?3*u:u}a=10-a%10;if(a===10){a=0}i.append(a.toString());var s=t.getFinderPattern().getResultPoints();var f=e.getFinderPattern().getResultPoints();return new dt(i.toString(),null,0,[s[0],s[1],f[0],f[1]],pt.RSS_14,(new Date).getTime())};e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79;var n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();if(n>72){n--}if(n>8){n--}return r===n};e.prototype.decodePair=function(t,e,r,n){try{var i=this.findFinderPattern(t,e);var o=this.parseFoundFinderPattern(t,r,e,i);var a=n==null?null:n.get(V.NEED_RESULT_POINT_CALLBACK);if(a!=null){var u=(i[0]+i[1])/2;if(e){u=t.getSize()-1-u}a.foundPossibleResultPoint(new Bt(u,r))}var s=this.decodeDataCharacter(t,o,true);var f=this.decodeDataCharacter(t,o,false);return new _r(1597*s.getValue()+f.getValue(),s.getChecksumPortion()+4*f.getChecksumPortion(),o)}catch(t){return null}};e.prototype.decodeDataCharacter=function(t,r,n){var i=this.getDataCharacterCounters();for(var o=0;o<i.length;o++){i[o]=0}if(n){Zt.recordPatternInReverse(t,r.getStartEnd()[0],i)}else{Zt.recordPattern(t,r.getStartEnd()[1]+1,i);for(var a=0,u=i.length-1;a<u;a++,u--){var s=i[a];i[a]=i[u];i[u]=s}}var f=n?16:15;var c=Pt.sum(new Int32Array(i))/f;var l=this.getOddCounts();var h=this.getEvenCounts();var d=this.getOddRoundingErrors();var v=this.getEvenRoundingErrors();for(var a=0;a<i.length;a++){var p=i[a]/c;var g=Math.floor(p+.5);if(g<1){g=1}else if(g>8){g=8}var y=Math.floor(a/2);if((a&1)===0){l[y]=g;d[y]=p-g}else{h[y]=g;v[y]=p-g}}this.adjustOddEvenCounts(n,f);var w=0;var _=0;for(var a=l.length-1;a>=0;a--){_*=9;_+=l[a];w+=l[a]}var A=0;var m=0;for(var a=h.length-1;a>=0;a--){A*=9;A+=h[a];m+=h[a]}var E=_+3*A;if(n){if((w&1)!==0||w>12||w<4){throw new J}var C=(12-w)/2;var I=e.OUTSIDE_ODD_WIDEST[C];var S=9-I;var O=Pe.getRSSvalue(l,I,false);var T=Pe.getRSSvalue(h,S,true);var b=e.OUTSIDE_EVEN_TOTAL_SUBSET[C];var R=e.OUTSIDE_GSUM[C];return new Re(O*b+T+R,E)}else{if((m&1)!==0||m>10||m<4){throw new J}var C=(10-m)/2;var I=e.INSIDE_ODD_WIDEST[C];var S=9-I;var O=Pe.getRSSvalue(l,I,true);var T=Pe.getRSSvalue(h,S,false);var N=e.INSIDE_ODD_TOTAL_SUBSET[C];var R=e.INSIDE_GSUM[C];return new Re(T*N+O+R,E)}};e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0;r[1]=0;r[2]=0;r[3]=0;var n=t.getSize();var i=false;var o=0;while(o<n){i=!t.get(o);if(e===i){break}o++}var a=0;var u=o;for(var s=o;s<n;s++){if(t.get(s)!==i){r[a]++}else{if(a===3){if(be.isFinderPattern(r)){return[u,s]}u+=r[0]+r[1];r[0]=r[2];r[1]=r[3];r[2]=0;r[3]=0;a--}else{a++}r[a]=1;i=!i}}throw new J};e.prototype.parseFoundFinderPattern=function(t,r,n,i){var o=t.get(i[0]);var a=i[0]-1;while(a>=0&&o!==t.get(a)){a--}a++;var u=i[0]-a;var s=this.getDecodeFinderCounters();var f=new Int32Array(s.length);R.arraycopy(s,0,f,1,s.length-1);f[0]=u;var c=this.parseFinderValue(f,e.FINDER_PATTERNS);var l=a;var h=i[1];if(n){l=t.getSize()-1-l;h=t.getSize()-1-h}return new Ne(c,[a,i[1]],l,h,r)};e.prototype.adjustOddEvenCounts=function(t,e){var r=Pt.sum(new Int32Array(this.getOddCounts()));var n=Pt.sum(new Int32Array(this.getEvenCounts()));var i=false;var o=false;var a=false;var u=false;if(t){if(r>12){o=true}else if(r<4){i=true}if(n>12){u=true}else if(n<4){a=true}}else{if(r>11){o=true}else if(r<5){i=true}if(n>10){u=true}else if(n<4){a=true}}var s=r+n-e;var f=(r&1)===(t?1:0);var c=(n&1)===1;if(s===1){if(f){if(c){throw new J}o=true}else{if(!c){throw new J}u=true}}else if(s===-1){if(f){if(c){throw new J}i=true}else{if(!c){throw new J}a=true}}else if(s===0){if(f){if(!c){throw new J}if(r<n){i=true;u=true}else{o=true;a=true}}else{if(c){throw new J}}}else{throw new J}if(i){if(o){throw new J}be.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o){be.decrement(this.getOddCounts(),this.getOddRoundingErrors())}if(a){if(u){throw new J}be.increment(this.getEvenCounts(),this.getOddRoundingErrors())}if(u){be.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}};e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126];e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81];e.OUTSIDE_GSUM=[0,161,961,2015,2715];e.INSIDE_GSUM=[0,336,1036,1516];e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1];e.INSIDE_ODD_WIDEST=[2,4,6,8];e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];return e}(be);var Cr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ir=function(t){Cr(e,t);function e(e){var r=t.call(this)||this;r.readers=[];var n=!e?null:e.get(V.POSSIBLE_FORMATS);var i=e&&e.get(V.ASSUME_CODE_39_CHECK_DIGIT)!==undefined;if(n){if(n.includes(pt.EAN_13)||n.includes(pt.UPC_A)||n.includes(pt.EAN_8)||n.includes(pt.UPC_E)){r.readers.push(new Se(e))}if(n.includes(pt.CODE_39)){r.readers.push(new $t(i))}if(n.includes(pt.CODE_128)){r.readers.push(new qt)}if(n.includes(pt.ITF)){r.readers.push(new re)}if(n.includes(pt.RSS_14)){r.readers.push(new Er)}if(n.includes(pt.RSS_EXPANDED)){console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk.");r.readers.push(new yr)}}if(r.readers.length===0){r.readers.push(new Se(e));r.readers.push(new $t);r.readers.push(new Se(e));r.readers.push(new qt);r.readers.push(new re);r.readers.push(new Er)}return r}e.prototype.decodeRow=function(t,e,r){for(var n=0;n<this.readers.length;n++){try{return this.readers[n].decodeRow(t,e,r)}catch(t){}}throw new J};e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})};return e}(Zt);var Sr=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Sr(e,t);function e(e,r){if(e===void 0){e=500}return t.call(this,new Ir(r),e,r)||this}return e})(ht);var Or=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Tr=function(){function t(t,e,r){this.ecCodewords=t;this.ecBlocks=[e];r&&this.ecBlocks.push(r)}t.prototype.getECCodewords=function(){return this.ecCodewords};t.prototype.getECBlocks=function(){return this.ecBlocks};return t}();var br=function(){function t(t,e){this.count=t;this.dataCodewords=e}t.prototype.getCount=function(){return this.count};t.prototype.getDataCodewords=function(){return this.dataCodewords};return t}();var Rr=function(){function t(t,e,r,n,i,o){var a,u;this.versionNumber=t;this.symbolSizeRows=e;this.symbolSizeColumns=r;this.dataRegionSizeRows=n;this.dataRegionSizeColumns=i;this.ecBlocks=o;var s=0;var f=o.getECCodewords();var c=o.getECBlocks();try{for(var l=Or(c),h=l.next();!h.done;h=l.next()){var d=h.value;s+=d.getCount()*(d.getDataCodewords()+f)}}catch(t){a={error:t}}finally{try{if(h&&!h.done&&(u=l.return))u.call(l)}finally{if(a)throw a.error}}this.totalCodewords=s}t.prototype.getVersionNumber=function(){return this.versionNumber};t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows};t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns};t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows};t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns};t.prototype.getTotalCodewords=function(){return this.totalCodewords};t.prototype.getECBlocks=function(){return this.ecBlocks};t.getVersionForDimensions=function(e,r){var n,i;if((e&1)!==0||(r&1)!==0){throw new H}try{for(var o=Or(t.VERSIONS),a=o.next();!a.done;a=o.next()){var u=a.value;if(u.symbolSizeRows===e&&u.symbolSizeColumns===r){return u}}}catch(t){n={error:t}}finally{try{if(a&&!a.done&&(i=o.return))i.call(o)}finally{if(n)throw n.error}}throw new H};t.prototype.toString=function(){return""+this.versionNumber};t.buildVersions=function(){return[new t(1,10,10,8,8,new Tr(5,new br(1,3))),new t(2,12,12,10,10,new Tr(7,new br(1,5))),new t(3,14,14,12,12,new Tr(10,new br(1,8))),new t(4,16,16,14,14,new Tr(12,new br(1,12))),new t(5,18,18,16,16,new Tr(14,new br(1,18))),new t(6,20,20,18,18,new Tr(18,new br(1,22))),new t(7,22,22,20,20,new Tr(20,new br(1,30))),new t(8,24,24,22,22,new Tr(24,new br(1,36))),new t(9,26,26,24,24,new Tr(28,new br(1,44))),new t(10,32,32,14,14,new Tr(36,new br(1,62))),new t(11,36,36,16,16,new Tr(42,new br(1,86))),new t(12,40,40,18,18,new Tr(48,new br(1,114))),new t(13,44,44,20,20,new Tr(56,new br(1,144))),new t(14,48,48,22,22,new Tr(68,new br(1,174))),new t(15,52,52,24,24,new Tr(42,new br(2,102))),new t(16,64,64,14,14,new Tr(56,new br(2,140))),new t(17,72,72,16,16,new Tr(36,new br(4,92))),new t(18,80,80,18,18,new Tr(48,new br(4,114))),new t(19,88,88,20,20,new Tr(56,new br(4,144))),new t(20,96,96,22,22,new Tr(68,new br(4,174))),new t(21,104,104,24,24,new Tr(56,new br(6,136))),new t(22,120,120,18,18,new Tr(68,new br(6,175))),new t(23,132,132,20,20,new Tr(62,new br(8,163))),new t(24,144,144,22,22,new Tr(62,new br(8,156),new br(2,155))),new t(25,8,18,6,16,new Tr(7,new br(1,5))),new t(26,8,32,6,14,new Tr(11,new br(1,10))),new t(27,12,26,10,24,new Tr(14,new br(1,16))),new t(28,12,36,10,16,new Tr(18,new br(1,22))),new t(29,16,36,14,16,new Tr(24,new br(1,32))),new t(30,16,48,14,22,new Tr(28,new br(1,49)))]};t.VERSIONS=t.buildVersions();return t}();var Nr=function(){function t(e){var r=e.getHeight();if(r<8||r>144||(r&1)!==0){throw new H}this.version=t.readVersion(e);this.mappingBitMatrix=this.extractDataRegion(e);this.readMappingMatrix=new q(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}t.prototype.getVersion=function(){return this.version};t.readVersion=function(t){var e=t.getHeight();var r=t.getWidth();return Rr.getVersionForDimensions(e,r)};t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords());var e=0;var r=4;var n=0;var i=this.mappingBitMatrix.getHeight();var o=this.mappingBitMatrix.getWidth();var a=false;var u=false;var s=false;var f=false;do{if(r===i&&n===0&&!a){t[e++]=this.readCorner1(i,o)&255;r-=2;n+=2;a=true}else if(r===i-2&&n===0&&(o&3)!==0&&!u){t[e++]=this.readCorner2(i,o)&255;r-=2;n+=2;u=true}else if(r===i+4&&n===2&&(o&7)===0&&!s){t[e++]=this.readCorner3(i,o)&255;r-=2;n+=2;s=true}else if(r===i-2&&n===0&&(o&7)===4&&!f){t[e++]=this.readCorner4(i,o)&255;r-=2;n+=2;f=true}else{do{if(r<i&&n>=0&&!this.readMappingMatrix.get(n,r)){t[e++]=this.readUtah(r,n,i,o)&255}r-=2;n+=2}while(r>=0&&n<o);r+=1;n+=3;do{if(r>=0&&n<o&&!this.readMappingMatrix.get(n,r)){t[e++]=this.readUtah(r,n,i,o)&255}r+=2;n-=2}while(r<i&&n>=0);r+=3;n+=1}}while(r<i||n<o);if(e!==this.version.getTotalCodewords()){throw new H}return t};t.prototype.readModule=function(t,e,r,n){if(t<0){t+=r;e+=4-(r+4&7)}if(e<0){e+=n;t+=4-(n+4&7)}this.readMappingMatrix.set(e,t);return this.mappingBitMatrix.get(e,t)};t.prototype.readUtah=function(t,e,r,n){var i=0;if(this.readModule(t-2,e-2,r,n)){i|=1}i<<=1;if(this.readModule(t-2,e-1,r,n)){i|=1}i<<=1;if(this.readModule(t-1,e-2,r,n)){i|=1}i<<=1;if(this.readModule(t-1,e-1,r,n)){i|=1}i<<=1;if(this.readModule(t-1,e,r,n)){i|=1}i<<=1;if(this.readModule(t,e-2,r,n)){i|=1}i<<=1;if(this.readModule(t,e-1,r,n)){i|=1}i<<=1;if(this.readModule(t,e,r,n)){i|=1}return i};t.prototype.readCorner1=function(t,e){var r=0;if(this.readModule(t-1,0,t,e)){r|=1}r<<=1;if(this.readModule(t-1,1,t,e)){r|=1}r<<=1;if(this.readModule(t-1,2,t,e)){r|=1}r<<=1;if(this.readModule(0,e-2,t,e)){r|=1}r<<=1;if(this.readModule(0,e-1,t,e)){r|=1}r<<=1;if(this.readModule(1,e-1,t,e)){r|=1}r<<=1;if(this.readModule(2,e-1,t,e)){r|=1}r<<=1;if(this.readModule(3,e-1,t,e)){r|=1}return r};t.prototype.readCorner2=function(t,e){var r=0;if(this.readModule(t-3,0,t,e)){r|=1}r<<=1;if(this.readModule(t-2,0,t,e)){r|=1}r<<=1;if(this.readModule(t-1,0,t,e)){r|=1}r<<=1;if(this.readModule(0,e-4,t,e)){r|=1}r<<=1;if(this.readModule(0,e-3,t,e)){r|=1}r<<=1;if(this.readModule(0,e-2,t,e)){r|=1}r<<=1;if(this.readModule(0,e-1,t,e)){r|=1}r<<=1;if(this.readModule(1,e-1,t,e)){r|=1}return r};t.prototype.readCorner3=function(t,e){var r=0;if(this.readModule(t-1,0,t,e)){r|=1}r<<=1;if(this.readModule(t-1,e-1,t,e)){r|=1}r<<=1;if(this.readModule(0,e-3,t,e)){r|=1}r<<=1;if(this.readModule(0,e-2,t,e)){r|=1}r<<=1;if(this.readModule(0,e-1,t,e)){r|=1}r<<=1;if(this.readModule(1,e-3,t,e)){r|=1}r<<=1;if(this.readModule(1,e-2,t,e)){r|=1}r<<=1;if(this.readModule(1,e-1,t,e)){r|=1}return r};t.prototype.readCorner4=function(t,e){var r=0;if(this.readModule(t-3,0,t,e)){r|=1}r<<=1;if(this.readModule(t-2,0,t,e)){r|=1}r<<=1;if(this.readModule(t-1,0,t,e)){r|=1}r<<=1;if(this.readModule(0,e-2,t,e)){r|=1}r<<=1;if(this.readModule(0,e-1,t,e)){r|=1}r<<=1;if(this.readModule(1,e-1,t,e)){r|=1}r<<=1;if(this.readModule(2,e-1,t,e)){r|=1}r<<=1;if(this.readModule(3,e-1,t,e)){r|=1}return r};t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows();var r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e){throw new I("Dimension of bitMatrix must match the version size")}var n=this.version.getDataRegionSizeRows();var i=this.version.getDataRegionSizeColumns();var o=e/n|0;var a=r/i|0;var u=o*n;var s=a*i;var f=new q(s,u);for(var c=0;c<o;++c){var l=c*n;for(var h=0;h<a;++h){var d=h*i;for(var v=0;v<n;++v){var p=c*(n+2)+1+v;var g=l+v;for(var y=0;y<i;++y){var w=h*(i+2)+1+y;if(t.get(w,p)){var _=d+y;f.set(_,g)}}}}}return f};return t}();var Dr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Pr=function(){function t(t,e){this.numDataCodewords=t;this.codewords=e}t.getDataBlocks=function(e,r){var n,i,o,a;var u=r.getECBlocks();var s=0;var f=u.getECBlocks();try{for(var c=Dr(f),l=c.next();!l.done;l=c.next()){var h=l.value;s+=h.getCount()}}catch(t){n={error:t}}finally{try{if(l&&!l.done&&(i=c.return))i.call(c)}finally{if(n)throw n.error}}var d=new Array(s);var v=0;try{for(var p=Dr(f),g=p.next();!g.done;g=p.next()){var h=g.value;for(var y=0;y<h.getCount();y++){var w=h.getDataCodewords();var _=u.getECCodewords()+w;d[v++]=new t(w,new Uint8Array(_))}}}catch(t){o={error:t}}finally{try{if(g&&!g.done&&(a=p.return))a.call(p)}finally{if(o)throw o.error}}var A=d[0].codewords.length;var m=A-u.getECCodewords();var E=m-1;var C=0;for(var y=0;y<E;y++){for(var S=0;S<v;S++){d[S].codewords[y]=e[C++]}}var O=r.getVersionNumber()===24;var T=O?8:v;for(var S=0;S<T;S++){d[S].codewords[m-1]=e[C++]}var b=d[0].codewords.length;for(var y=m;y<b;y++){for(var S=0;S<v;S++){var R=O?(S+8)%v:S;var N=O&&R>7?y-1:y;d[R].codewords[N]=e[C++]}}if(C!==e.length){throw new I}return d};t.prototype.getNumDataCodewords=function(){return this.numDataCodewords};t.prototype.getCodewords=function(){return this.codewords};return t}();var Mr=function(){function t(t){this.bytes=t;this.byteOffset=0;this.bitOffset=0}t.prototype.getBitOffset=function(){return this.bitOffset};t.prototype.getByteOffset=function(){return this.byteOffset};t.prototype.readBits=function(t){if(t<1||t>32||t>this.available()){throw new I(""+t)}var e=0;var r=this.bitOffset;var n=this.byteOffset;var i=this.bytes;if(r>0){var o=8-r;var a=t<o?t:o;var u=o-a;var s=255>>8-a<<u;e=(i[n]&s)>>u;t-=a;r+=a;if(r===8){r=0;n++}}if(t>0){while(t>=8){e=e<<8|i[n]&255;n++;t-=8}if(t>0){var u=8-t;var s=255>>u<<u;e=e<<t|(i[n]&s)>>u;r+=t}}this.bitOffset=r;this.byteOffset=n;return e};t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset};return t}();var Br;(function(t){t[t["PAD_ENCODE"]=0]="PAD_ENCODE";t[t["ASCII_ENCODE"]=1]="ASCII_ENCODE";t[t["C40_ENCODE"]=2]="C40_ENCODE";t[t["TEXT_ENCODE"]=3]="TEXT_ENCODE";t[t["ANSIX12_ENCODE"]=4]="ANSIX12_ENCODE";t[t["EDIFACT_ENCODE"]=5]="EDIFACT_ENCODE";t[t["BASE256_ENCODE"]=6]="BASE256_ENCODE"})(Br||(Br={}));var Lr=function(){function t(){}t.decode=function(t){var e=new Mr(t);var r=new K;var n=new K;var i=new Array;var o=Br.ASCII_ENCODE;do{if(o===Br.ASCII_ENCODE){o=this.decodeAsciiSegment(e,r,n)}else{switch(o){case Br.C40_ENCODE:this.decodeC40Segment(e,r);break;case Br.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case Br.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case Br.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case Br.BASE256_ENCODE:this.decodeBase256Segment(e,r,i);break;default:throw new H}o=Br.ASCII_ENCODE}}while(o!==Br.PAD_ENCODE&&e.available()>0);if(n.length()>0){r.append(n.toString())}return new wt(t,r.toString(),i.length===0?null:i,null)};t.decodeAsciiSegment=function(t,e,r){var n=false;do{var i=t.readBits(8);if(i===0){throw new H}else if(i<=128){if(n){i+=128}e.append(String.fromCharCode(i-1));return Br.ASCII_ENCODE}else if(i===129){return Br.PAD_ENCODE}else if(i<=229){var o=i-130;if(o<10){e.append("0")}e.append(""+o)}else{switch(i){case 230:return Br.C40_ENCODE;case 231:return Br.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:n=true;break;case 236:e.append("[)>05");r.insert(0,"");break;case 237:e.append("[)>06");r.insert(0,"");break;case 238:return Br.ANSIX12_ENCODE;case 239:return Br.TEXT_ENCODE;case 240:return Br.EDIFACT_ENCODE;case 241:break;default:if(i!==254||t.available()!==0){throw new H}break}}}while(t.available()>0);return Br.ASCII_ENCODE};t.decodeC40Segment=function(t,e){var r=false;var n=[];var i=0;do{if(t.available()===8){return}var o=t.readBits(8);if(o===254){return}this.parseTwoBytes(o,t.readBits(8),n);for(var a=0;a<3;a++){var u=n[a];switch(i){case 0:if(u<3){i=u+1}else if(u<this.C40_BASIC_SET_CHARS.length){var s=this.C40_BASIC_SET_CHARS[u];if(r){e.append(String.fromCharCode(s.charCodeAt(0)+128));r=false}else{e.append(s)}}else{throw new H}break;case 1:if(r){e.append(String.fromCharCode(u+128));r=false}else{e.append(String.fromCharCode(u))}i=0;break;case 2:if(u<this.C40_SHIFT2_SET_CHARS.length){var s=this.C40_SHIFT2_SET_CHARS[u];if(r){e.append(String.fromCharCode(s.charCodeAt(0)+128));r=false}else{e.append(s)}}else{switch(u){case 27:e.append(String.fromCharCode(29));break;case 30:r=true;break;default:throw new H}}i=0;break;case 3:if(r){e.append(String.fromCharCode(u+224));r=false}else{e.append(String.fromCharCode(u+96))}i=0;break;default:throw new H}}}while(t.available()>0)};t.decodeTextSegment=function(t,e){var r=false;var n=[];var i=0;do{if(t.available()===8){return}var o=t.readBits(8);if(o===254){return}this.parseTwoBytes(o,t.readBits(8),n);for(var a=0;a<3;a++){var u=n[a];switch(i){case 0:if(u<3){i=u+1}else if(u<this.TEXT_BASIC_SET_CHARS.length){var s=this.TEXT_BASIC_SET_CHARS[u];if(r){e.append(String.fromCharCode(s.charCodeAt(0)+128));r=false}else{e.append(s)}}else{throw new H}break;case 1:if(r){e.append(String.fromCharCode(u+128));r=false}else{e.append(String.fromCharCode(u))}i=0;break;case 2:if(u<this.TEXT_SHIFT2_SET_CHARS.length){var s=this.TEXT_SHIFT2_SET_CHARS[u];if(r){e.append(String.fromCharCode(s.charCodeAt(0)+128));r=false}else{e.append(s)}}else{switch(u){case 27:e.append(String.fromCharCode(29));break;case 30:r=true;break;default:throw new H}}i=0;break;case 3:if(u<this.TEXT_SHIFT3_SET_CHARS.length){var s=this.TEXT_SHIFT3_SET_CHARS[u];if(r){e.append(String.fromCharCode(s.charCodeAt(0)+128));r=false}else{e.append(s)}i=0}else{throw new H}break;default:throw new H}}}while(t.available()>0)};t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(t.available()===8){return}var n=t.readBits(8);if(n===254){return}this.parseTwoBytes(n,t.readBits(8),r);for(var i=0;i<3;i++){var o=r[i];switch(o){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(o<14){e.append(String.fromCharCode(o+44))}else if(o<40){e.append(String.fromCharCode(o+51))}else{throw new H}break}}}while(t.available()>0)};t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1;var i=Math.floor(n/1600);r[0]=i;n-=i*1600;i=Math.floor(n/40);r[1]=i;r[2]=n-i*40};t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16){return}for(var r=0;r<4;r++){var n=t.readBits(6);if(n===31){var i=8-t.getBitOffset();if(i!==8){t.readBits(i)}return}if((n&32)===0){n|=64}e.append(String.fromCharCode(n))}}while(t.available()>0)};t.decodeBase256Segment=function(t,e,r){var n=1+t.getByteOffset();var i=this.unrandomize255State(t.readBits(8),n++);var o;if(i===0){o=t.available()/8|0}else if(i<250){o=i}else{o=250*(i-249)+this.unrandomize255State(t.readBits(8),n++)}if(o<0){throw new H}var a=new Uint8Array(o);for(var u=0;u<o;u++){if(t.available()<8){throw new H}a[u]=this.unrandomize255State(t.readBits(8),n++)}r.push(a);try{e.append(Y.decode(a,Z.ISO88591))}catch(t){throw new bt("Platform does not support required encoding: "+t.message)}};t.unrandomize255State=function(t,e){var r=149*e%255+1;var n=t-r;return n>=0?n:n+256};t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"];t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS;t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];return t}();var Fr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var xr=function(){function t(){this.rsDecoder=new Rt(It.DATA_MATRIX_FIELD_256)}t.prototype.decode=function(t){var e,r;var n=new Nr(t);var i=n.getVersion();var o=n.readCodewords();var a=Pr.getDataBlocks(o,i);var u=0;try{for(var s=Fr(a),f=s.next();!f.done;f=s.next()){var c=f.value;u+=c.getNumDataCodewords()}}catch(t){e={error:t}}finally{try{if(f&&!f.done&&(r=s.return))r.call(s)}finally{if(e)throw e.error}}var l=new Uint8Array(u);var h=a.length;for(var d=0;d<h;d++){var v=a[d];var p=v.getCodewords();var g=v.getNumDataCodewords();this.correctErrors(p,g);for(var y=0;y<g;y++){l[y*h+d]=p[y]}}return Lr.decode(l)};t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(t){throw new T}for(var n=0;n<e;n++){t[n]=r[n]}};return t}();var kr=function(){function t(t){this.image=t;this.rectangleDetector=new kt(this.image)}t.prototype.detect=function(){var e=this.rectangleDetector.detect();var r=this.detectSolid1(e);r=this.detectSolid2(r);r[3]=this.correctTopRight(r);if(!r[3]){throw new J}r=this.shiftToModuleCenter(r);var n=r[0];var i=r[1];var o=r[2];var a=r[3];var u=this.transitionsBetween(n,a)+1;var s=this.transitionsBetween(o,a)+1;if((u&1)===1){u+=1}if((s&1)===1){s+=1}if(4*u<7*s&&4*s<7*u){u=s=Math.max(u,s)}var f=t.sampleGrid(this.image,n,i,o,a,u,s);return new Lt(f,[n,i,o,a])};t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1);var i=(e.getY()-t.getY())/(r+1);return new Bt(t.getX()+n,t.getY()+i)};t.moveAway=function(t,e,r){var n=t.getX();var i=t.getY();if(n<e){n-=1}else{n+=1}if(i<r){i-=1}else{i+=1}return new Bt(n,i)};t.prototype.detectSolid1=function(t){var e=t[0];var r=t[1];var n=t[3];var i=t[2];var o=this.transitionsBetween(e,r);var a=this.transitionsBetween(r,n);var u=this.transitionsBetween(n,i);var s=this.transitionsBetween(i,e);var f=o;var c=[i,e,r,n];if(f>a){f=a;c[0]=e;c[1]=r;c[2]=n;c[3]=i}if(f>u){f=u;c[0]=r;c[1]=n;c[2]=i;c[3]=e}if(f>s){c[0]=n;c[1]=i;c[2]=e;c[3]=r}return c};t.prototype.detectSolid2=function(e){var r=e[0];var n=e[1];var i=e[2];var o=e[3];var a=this.transitionsBetween(r,o);var u=t.shiftPoint(n,i,(a+1)*4);var s=t.shiftPoint(i,n,(a+1)*4);var f=this.transitionsBetween(u,r);var c=this.transitionsBetween(s,o);if(f<c){e[0]=r;e[1]=n;e[2]=i;e[3]=o}else{e[0]=n;e[1]=i;e[2]=o;e[3]=r}return e};t.prototype.correctTopRight=function(e){var r=e[0];var n=e[1];var i=e[2];var o=e[3];var a=this.transitionsBetween(r,o);var u=this.transitionsBetween(n,o);var s=t.shiftPoint(r,n,(u+1)*4);var f=t.shiftPoint(i,n,(a+1)*4);a=this.transitionsBetween(s,o);u=this.transitionsBetween(f,o);var c=new Bt(o.getX()+(i.getX()-n.getX())/(a+1),o.getY()+(i.getY()-n.getY())/(a+1));var l=new Bt(o.getX()+(r.getX()-n.getX())/(u+1),o.getY()+(r.getY()-n.getY())/(u+1));if(!this.isValid(c)){if(this.isValid(l)){return l}return null}if(!this.isValid(l)){return c}var h=this.transitionsBetween(s,c)+this.transitionsBetween(f,c);var d=this.transitionsBetween(s,l)+this.transitionsBetween(f,l);if(h>d){return c}else{return l}};t.prototype.shiftToModuleCenter=function(e){var r=e[0];var n=e[1];var i=e[2];var o=e[3];var a=this.transitionsBetween(r,o)+1;var u=this.transitionsBetween(i,o)+1;var s=t.shiftPoint(r,n,u*4);var f=t.shiftPoint(i,n,a*4);a=this.transitionsBetween(s,o)+1;u=this.transitionsBetween(f,o)+1;if((a&1)===1){a+=1}if((u&1)===1){u+=1}var c=(r.getX()+n.getX()+i.getX()+o.getX())/4;var l=(r.getY()+n.getY()+i.getY()+o.getY())/4;r=t.moveAway(r,c,l);n=t.moveAway(n,c,l);i=t.moveAway(i,c,l);o=t.moveAway(o,c,l);var h;var d;s=t.shiftPoint(r,n,u*4);s=t.shiftPoint(s,o,a*4);h=t.shiftPoint(n,r,u*4);h=t.shiftPoint(h,i,a*4);f=t.shiftPoint(i,o,u*4);f=t.shiftPoint(f,n,a*4);d=t.shiftPoint(o,i,u*4);d=t.shiftPoint(d,r,a*4);return[s,h,f,d]};t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()};t.sampleGrid=function(t,e,r,n,i,o,a){var u=Xt.getInstance();return u.sampleGrid(t,o,a,.5,.5,o-.5,.5,o-.5,a-.5,.5,a-.5,e.getX(),e.getY(),i.getX(),i.getY(),n.getX(),n.getY(),r.getX(),r.getY())};t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX());var n=Math.trunc(t.getY());var i=Math.trunc(e.getX());var o=Math.trunc(e.getY());var a=Math.abs(o-n)>Math.abs(i-r);if(a){var u=r;r=n;n=u;u=i;i=o;o=u}var s=Math.abs(i-r);var f=Math.abs(o-n);var c=-s/2;var l=n<o?1:-1;var h=r<i?1:-1;var d=0;var v=this.image.get(a?n:r,a?r:n);for(var p=r,g=n;p!==i;p+=h){var y=this.image.get(a?g:p,a?p:g);if(y!==v){d++;v=y}c+=f;if(c>0){if(g===o){break}g+=l;c-=s}}return d};return t}();var Vr=function(){function t(){this.decoder=new xr}t.prototype.decode=function(e,r){if(r===void 0){r=null}var n;var i;if(r!=null&&r.has(V.PURE_BARCODE)){var o=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(o);i=t.NO_POINTS}else{var a=new kr(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits());i=a.getPoints()}var u=n.getRawBytes();var s=new dt(n.getText(),u,8*u.length,i,pt.DATA_MATRIX,R.currentTimeMillis());var f=n.getByteSegments();if(f!=null){s.putMetadata(yt.BYTE_SEGMENTS,f)}var c=n.getECLevel();if(c!=null){s.putMetadata(yt.ERROR_CORRECTION_LEVEL,c)}return s};t.prototype.reset=function(){};t.extractPureBits=function(t){var e=t.getTopLeftOnBit();var r=t.getBottomRightOnBit();if(e==null||r==null){throw new J}var n=this.moduleSize(e,t);var i=e[1];var o=r[1];var a=e[0];var u=r[0];var s=(u-a+1)/n;var f=(o-i+1)/n;if(s<=0||f<=0){throw new J}var c=n/2;i+=c;a+=c;var l=new q(s,f);for(var h=0;h<f;h++){var d=i+h*n;for(var v=0;v<s;v++){if(t.get(a+v*n,d)){l.set(v,h)}}}return l};t.moduleSize=function(t,e){var r=e.getWidth();var n=t[0];var i=t[1];while(n<r&&e.get(n,i)){n++}if(n===r){throw new J}var o=n-t[0];if(o===0){throw new J}return o};t.NO_POINTS=[];return t}();var Ur=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Ur(e,t);function e(e){if(e===void 0){e=500}return t.call(this,new Vr,e)||this}return e})(ht);var Hr;(function(t){t[t["L"]=0]="L";t[t["M"]=1]="M";t[t["Q"]=2]="Q";t[t["H"]=3]="H"})(Hr||(Hr={}));var Gr=function(){function t(e,r,n){this.value=e;this.stringValue=r;this.bits=n;t.FOR_BITS.set(n,this);t.FOR_VALUE.set(e,this)}t.prototype.getValue=function(){return this.value};t.prototype.getBits=function(){return this.bits};t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new E(e+"not available")}};t.prototype.toString=function(){return this.stringValue};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.value===r.value};t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size){throw new I}return t.FOR_BITS.get(e)};t.FOR_BITS=new Map;t.FOR_VALUE=new Map;t.L=new t(Hr.L,"L",1);t.M=new t(Hr.M,"M",0);t.Q=new t(Hr.Q,"Q",3);t.H=new t(Hr.H,"H",2);return t}();var Xr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Wr=function(){function t(t){this.errorCorrectionLevel=Gr.forBits(t>>3&3);this.dataMask=t&7}t.numBitsDiffering=function(t,e){return F.bitCount(t^e)};t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);if(n!==null){return n}return t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)};t.doDecodeFormatInformation=function(e,r){var n,i;var o=Number.MAX_SAFE_INTEGER;var a=0;try{for(var u=Xr(t.FORMAT_INFO_DECODE_LOOKUP),s=u.next();!s.done;s=u.next()){var f=s.value;var c=f[0];if(c===e||c===r){return new t(f[1])}var l=t.numBitsDiffering(e,c);if(l<o){a=f[1];o=l}if(e!==r){l=t.numBitsDiffering(r,c);if(l<o){a=f[1];o=l}}}}catch(t){n={error:t}}finally{try{if(s&&!s.done&&(i=u.return))i.call(u)}finally{if(n)throw n.error}}if(o<=3){return new t(a)}return null};t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel};t.prototype.getDataMask=function(){return this.dataMask};t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.errorCorrectionLevel===r.errorCorrectionLevel&&this.dataMask===r.dataMask};t.FORMAT_INFO_MASK_QR=21522;t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];return t}();var jr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var zr=function(){function t(t){var e=[];for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}this.ecCodewordsPerBlock=t;this.ecBlocks=e}t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock};t.prototype.getNumBlocks=function(){var t,e;var r=0;var n=this.ecBlocks;try{for(var i=jr(n),o=i.next();!o.done;o=i.next()){var a=o.value;r+=a.getCount()}}catch(e){t={error:e}}finally{try{if(o&&!o.done&&(e=i.return))e.call(i)}finally{if(t)throw t.error}}return r};t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()};t.prototype.getECBlocks=function(){return this.ecBlocks};return t}();var Yr=function(){function t(t,e){this.count=t;this.dataCodewords=e}t.prototype.getCount=function(){return this.count};t.prototype.getDataCodewords=function(){return this.dataCodewords};return t}();var Zr=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Kr=function(){function t(t,e){var r,n;var i=[];for(var o=2;o<arguments.length;o++){i[o-2]=arguments[o]}this.versionNumber=t;this.alignmentPatternCenters=e;this.ecBlocks=i;var a=0;var u=i[0].getECCodewordsPerBlock();var s=i[0].getECBlocks();try{for(var f=Zr(s),c=f.next();!c.done;c=f.next()){var l=c.value;a+=l.getCount()*(l.getDataCodewords()+u)}}catch(t){r={error:t}}finally{try{if(c&&!c.done&&(n=f.return))n.call(f)}finally{if(r)throw r.error}}this.totalCodewords=a}t.prototype.getVersionNumber=function(){return this.versionNumber};t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters};t.prototype.getTotalCodewords=function(){return this.totalCodewords};t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber};t.prototype.getECBlocksForLevel=function(t){return this.ecBlocks[t.getValue()]};t.getProvisionalVersionForDimension=function(t){if(t%4!==1){throw new H}try{return this.getVersionForNumber((t-17)/4)}catch(t){throw new H}};t.getVersionForNumber=function(e){if(e<1||e>40){throw new I}return t.VERSIONS[e-1]};t.decodeVersionInformation=function(e){var r=Number.MAX_SAFE_INTEGER;var n=0;for(var i=0;i<t.VERSION_DECODE_INFO.length;i++){var o=t.VERSION_DECODE_INFO[i];if(o===e){return t.getVersionForNumber(i+7)}var a=Wr.numBitsDiffering(e,o);if(a<r){n=i+7;r=a}}if(r<=3){return t.getVersionForNumber(n)}return null};t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion();var e=new q(t);e.setRegion(0,0,9,9);e.setRegion(t-8,0,8,9);e.setRegion(0,t-8,9,8);var r=this.alignmentPatternCenters.length;for(var n=0;n<r;n++){var i=this.alignmentPatternCenters[n]-2;for(var o=0;o<r;o++){if(n===0&&(o===0||o===r-1)||n===r-1&&o===0){continue}e.setRegion(this.alignmentPatternCenters[o]-2,i,5,5)}}e.setRegion(6,9,1,t-17);e.setRegion(9,6,t-17,1);if(this.versionNumber>6){e.setRegion(t-11,0,3,6);e.setRegion(0,t-11,6,3)}return e};t.prototype.toString=function(){return""+this.versionNumber};t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]);t.VERSIONS=[new t(1,new Int32Array(0),new zr(7,new Yr(1,19)),new zr(10,new Yr(1,16)),new zr(13,new Yr(1,13)),new zr(17,new Yr(1,9))),new t(2,Int32Array.from([6,18]),new zr(10,new Yr(1,34)),new zr(16,new Yr(1,28)),new zr(22,new Yr(1,22)),new zr(28,new Yr(1,16))),new t(3,Int32Array.from([6,22]),new zr(15,new Yr(1,55)),new zr(26,new Yr(1,44)),new zr(18,new Yr(2,17)),new zr(22,new Yr(2,13))),new t(4,Int32Array.from([6,26]),new zr(20,new Yr(1,80)),new zr(18,new Yr(2,32)),new zr(26,new Yr(2,24)),new zr(16,new Yr(4,9))),new t(5,Int32Array.from([6,30]),new zr(26,new Yr(1,108)),new zr(24,new Yr(2,43)),new zr(18,new Yr(2,15),new Yr(2,16)),new zr(22,new Yr(2,11),new Yr(2,12))),new t(6,Int32Array.from([6,34]),new zr(18,new Yr(2,68)),new zr(16,new Yr(4,27)),new zr(24,new Yr(4,19)),new zr(28,new Yr(4,15))),new t(7,Int32Array.from([6,22,38]),new zr(20,new Yr(2,78)),new zr(18,new Yr(4,31)),new zr(18,new Yr(2,14),new Yr(4,15)),new zr(26,new Yr(4,13),new Yr(1,14))),new t(8,Int32Array.from([6,24,42]),new zr(24,new Yr(2,97)),new zr(22,new Yr(2,38),new Yr(2,39)),new zr(22,new Yr(4,18),new Yr(2,19)),new zr(26,new Yr(4,14),new Yr(2,15))),new t(9,Int32Array.from([6,26,46]),new zr(30,new Yr(2,116)),new zr(22,new Yr(3,36),new Yr(2,37)),new zr(20,new Yr(4,16),new Yr(4,17)),new zr(24,new Yr(4,12),new Yr(4,13))),new t(10,Int32Array.from([6,28,50]),new zr(18,new Yr(2,68),new Yr(2,69)),new zr(26,new Yr(4,43),new Yr(1,44)),new zr(24,new Yr(6,19),new Yr(2,20)),new zr(28,new Yr(6,15),new Yr(2,16))),new t(11,Int32Array.from([6,30,54]),new zr(20,new Yr(4,81)),new zr(30,new Yr(1,50),new Yr(4,51)),new zr(28,new Yr(4,22),new Yr(4,23)),new zr(24,new Yr(3,12),new Yr(8,13))),new t(12,Int32Array.from([6,32,58]),new zr(24,new Yr(2,92),new Yr(2,93)),new zr(22,new Yr(6,36),new Yr(2,37)),new zr(26,new Yr(4,20),new Yr(6,21)),new zr(28,new Yr(7,14),new Yr(4,15))),new t(13,Int32Array.from([6,34,62]),new zr(26,new Yr(4,107)),new zr(22,new Yr(8,37),new Yr(1,38)),new zr(24,new Yr(8,20),new Yr(4,21)),new zr(22,new Yr(12,11),new Yr(4,12))),new t(14,Int32Array.from([6,26,46,66]),new zr(30,new Yr(3,115),new Yr(1,116)),new zr(24,new Yr(4,40),new Yr(5,41)),new zr(20,new Yr(11,16),new Yr(5,17)),new zr(24,new Yr(11,12),new Yr(5,13))),new t(15,Int32Array.from([6,26,48,70]),new zr(22,new Yr(5,87),new Yr(1,88)),new zr(24,new Yr(5,41),new Yr(5,42)),new zr(30,new Yr(5,24),new Yr(7,25)),new zr(24,new Yr(11,12),new Yr(7,13))),new t(16,Int32Array.from([6,26,50,74]),new zr(24,new Yr(5,98),new Yr(1,99)),new zr(28,new Yr(7,45),new Yr(3,46)),new zr(24,new Yr(15,19),new Yr(2,20)),new zr(30,new Yr(3,15),new Yr(13,16))),new t(17,Int32Array.from([6,30,54,78]),new zr(28,new Yr(1,107),new Yr(5,108)),new zr(28,new Yr(10,46),new Yr(1,47)),new zr(28,new Yr(1,22),new Yr(15,23)),new zr(28,new Yr(2,14),new Yr(17,15))),new t(18,Int32Array.from([6,30,56,82]),new zr(30,new Yr(5,120),new Yr(1,121)),new zr(26,new Yr(9,43),new Yr(4,44)),new zr(28,new Yr(17,22),new Yr(1,23)),new zr(28,new Yr(2,14),new Yr(19,15))),new t(19,Int32Array.from([6,30,58,86]),new zr(28,new Yr(3,113),new Yr(4,114)),new zr(26,new Yr(3,44),new Yr(11,45)),new zr(26,new Yr(17,21),new Yr(4,22)),new zr(26,new Yr(9,13),new Yr(16,14))),new t(20,Int32Array.from([6,34,62,90]),new zr(28,new Yr(3,107),new Yr(5,108)),new zr(26,new Yr(3,41),new Yr(13,42)),new zr(30,new Yr(15,24),new Yr(5,25)),new zr(28,new Yr(15,15),new Yr(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new zr(28,new Yr(4,116),new Yr(4,117)),new zr(26,new Yr(17,42)),new zr(28,new Yr(17,22),new Yr(6,23)),new zr(30,new Yr(19,16),new Yr(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new zr(28,new Yr(2,111),new Yr(7,112)),new zr(28,new Yr(17,46)),new zr(30,new Yr(7,24),new Yr(16,25)),new zr(24,new Yr(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new zr(30,new Yr(4,121),new Yr(5,122)),new zr(28,new Yr(4,47),new Yr(14,48)),new zr(30,new Yr(11,24),new Yr(14,25)),new zr(30,new Yr(16,15),new Yr(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new zr(30,new Yr(6,117),new Yr(4,118)),new zr(28,new Yr(6,45),new Yr(14,46)),new zr(30,new Yr(11,24),new Yr(16,25)),new zr(30,new Yr(30,16),new Yr(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new zr(26,new Yr(8,106),new Yr(4,107)),new zr(28,new Yr(8,47),new Yr(13,48)),new zr(30,new Yr(7,24),new Yr(22,25)),new zr(30,new Yr(22,15),new Yr(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new zr(28,new Yr(10,114),new Yr(2,115)),new zr(28,new Yr(19,46),new Yr(4,47)),new zr(28,new Yr(28,22),new Yr(6,23)),new zr(30,new Yr(33,16),new Yr(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new zr(30,new Yr(8,122),new Yr(4,123)),new zr(28,new Yr(22,45),new Yr(3,46)),new zr(30,new Yr(8,23),new Yr(26,24)),new zr(30,new Yr(12,15),new Yr(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new zr(30,new Yr(3,117),new Yr(10,118)),new zr(28,new Yr(3,45),new Yr(23,46)),new zr(30,new Yr(4,24),new Yr(31,25)),new zr(30,new Yr(11,15),new Yr(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new zr(30,new Yr(7,116),new Yr(7,117)),new zr(28,new Yr(21,45),new Yr(7,46)),new zr(30,new Yr(1,23),new Yr(37,24)),new zr(30,new Yr(19,15),new Yr(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new zr(30,new Yr(5,115),new Yr(10,116)),new zr(28,new Yr(19,47),new Yr(10,48)),new zr(30,new Yr(15,24),new Yr(25,25)),new zr(30,new Yr(23,15),new Yr(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new zr(30,new Yr(13,115),new Yr(3,116)),new zr(28,new Yr(2,46),new Yr(29,47)),new zr(30,new Yr(42,24),new Yr(1,25)),new zr(30,new Yr(23,15),new Yr(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new zr(30,new Yr(17,115)),new zr(28,new Yr(10,46),new Yr(23,47)),new zr(30,new Yr(10,24),new Yr(35,25)),new zr(30,new Yr(19,15),new Yr(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new zr(30,new Yr(17,115),new Yr(1,116)),new zr(28,new Yr(14,46),new Yr(21,47)),new zr(30,new Yr(29,24),new Yr(19,25)),new zr(30,new Yr(11,15),new Yr(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new zr(30,new Yr(13,115),new Yr(6,116)),new zr(28,new Yr(14,46),new Yr(23,47)),new zr(30,new Yr(44,24),new Yr(7,25)),new zr(30,new Yr(59,16),new Yr(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new zr(30,new Yr(12,121),new Yr(7,122)),new zr(28,new Yr(12,47),new Yr(26,48)),new zr(30,new Yr(39,24),new Yr(14,25)),new zr(30,new Yr(22,15),new Yr(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new zr(30,new Yr(6,121),new Yr(14,122)),new zr(28,new Yr(6,47),new Yr(34,48)),new zr(30,new Yr(46,24),new Yr(10,25)),new zr(30,new Yr(2,15),new Yr(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new zr(30,new Yr(17,122),new Yr(4,123)),new zr(28,new Yr(29,46),new Yr(14,47)),new zr(30,new Yr(49,24),new Yr(10,25)),new zr(30,new Yr(24,15),new Yr(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new zr(30,new Yr(4,122),new Yr(18,123)),new zr(28,new Yr(13,46),new Yr(32,47)),new zr(30,new Yr(48,24),new Yr(14,25)),new zr(30,new Yr(42,15),new Yr(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new zr(30,new Yr(20,117),new Yr(4,118)),new zr(28,new Yr(40,47),new Yr(7,48)),new zr(30,new Yr(43,24),new Yr(22,25)),new zr(30,new Yr(10,15),new Yr(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new zr(30,new Yr(19,118),new Yr(6,119)),new zr(28,new Yr(18,47),new Yr(31,48)),new zr(30,new Yr(34,24),new Yr(34,25)),new zr(30,new Yr(20,15),new Yr(61,16)))];return t}();var qr;(function(t){t[t["DATA_MASK_000"]=0]="DATA_MASK_000";t[t["DATA_MASK_001"]=1]="DATA_MASK_001";t[t["DATA_MASK_010"]=2]="DATA_MASK_010";t[t["DATA_MASK_011"]=3]="DATA_MASK_011";t[t["DATA_MASK_100"]=4]="DATA_MASK_100";t[t["DATA_MASK_101"]=5]="DATA_MASK_101";t[t["DATA_MASK_110"]=6]="DATA_MASK_110";t[t["DATA_MASK_111"]=7]="DATA_MASK_111"})(qr||(qr={}));var Qr=function(){function t(t,e){this.value=t;this.isMasked=e}t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++){for(var n=0;n<e;n++){if(this.isMasked(r,n)){t.flip(n,r)}}}};t.values=new Map([[qr.DATA_MASK_000,new t(qr.DATA_MASK_000,function(t,e){return(t+e&1)===0})],[qr.DATA_MASK_001,new t(qr.DATA_MASK_001,function(t,e){return(t&1)===0})],[qr.DATA_MASK_010,new t(qr.DATA_MASK_010,function(t,e){return e%3===0})],[qr.DATA_MASK_011,new t(qr.DATA_MASK_011,function(t,e){return(t+e)%3===0})],[qr.DATA_MASK_100,new t(qr.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)===0})],[qr.DATA_MASK_101,new t(qr.DATA_MASK_101,function(t,e){return t*e%6===0})],[qr.DATA_MASK_110,new t(qr.DATA_MASK_110,function(t,e){return t*e%6<3})],[qr.DATA_MASK_111,new t(qr.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)===0})]]);return t}();var Jr=function(){function t(t){var e=t.getHeight();if(e<21||(e&3)!==1){throw new H}this.bitMatrix=t}t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==undefined){return this.parsedFormatInfo}var t=0;for(var e=0;e<6;e++){t=this.copyBit(e,8,t)}t=this.copyBit(7,8,t);t=this.copyBit(8,8,t);t=this.copyBit(8,7,t);for(var r=5;r>=0;r--){t=this.copyBit(8,r,t)}var n=this.bitMatrix.getHeight();var i=0;var o=n-7;for(var r=n-1;r>=o;r--){i=this.copyBit(8,r,i)}for(var e=n-8;e<n;e++){i=this.copyBit(e,8,i)}this.parsedFormatInfo=Wr.decodeFormatInformation(t,i);if(this.parsedFormatInfo!==null){return this.parsedFormatInfo}throw new H};t.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==undefined){return this.parsedVersion}var t=this.bitMatrix.getHeight();var e=Math.floor((t-17)/4);if(e<=6){return Kr.getVersionForNumber(e)}var r=0;var n=t-11;for(var i=5;i>=0;i--){for(var o=t-9;o>=n;o--){r=this.copyBit(o,i,r)}}var a=Kr.decodeVersionInformation(r);if(a!==null&&a.getDimensionForVersion()===t){this.parsedVersion=a;return a}r=0;for(var o=5;o>=0;o--){for(var i=t-9;i>=n;i--){r=this.copyBit(o,i,r)}}a=Kr.decodeVersionInformation(r);if(a!==null&&a.getDimensionForVersion()===t){this.parsedVersion=a;return a}throw new H};t.prototype.copyBit=function(t,e,r){var n=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return n?r<<1|1:r<<1};t.prototype.readCodewords=function(){var t=this.readFormatInformation();var e=this.readVersion();var r=Qr.values.get(t.getDataMask());var n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);var i=e.buildFunctionPattern();var o=true;var a=new Uint8Array(e.getTotalCodewords());var u=0;var s=0;var f=0;for(var c=n-1;c>0;c-=2){if(c===6){c--}for(var l=0;l<n;l++){var h=o?n-1-l:l;for(var d=0;d<2;d++){if(!i.get(c-d,h)){f++;s<<=1;if(this.bitMatrix.get(c-d,h)){s|=1}if(f===8){a[u++]=s;f=0;s=0}}}}o=!o}if(u!==e.getTotalCodewords()){throw new H}return a};t.prototype.remask=function(){if(this.parsedFormatInfo===null){return}var t=Qr.values[this.parsedFormatInfo.getDataMask()];var e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)};t.prototype.setMirror=function(t){this.parsedVersion=null;this.parsedFormatInfo=null;this.isMirror=t};t.prototype.mirror=function(){var t=this.bitMatrix;for(var e=0,r=t.getWidth();e<r;e++){for(var n=e+1,i=t.getHeight();n<i;n++){if(t.get(e,n)!==t.get(n,e)){t.flip(n,e);t.flip(e,n)}}}};return t}();var $r=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var tn=function(){function t(t,e){this.numDataCodewords=t;this.codewords=e}t.getDataBlocks=function(e,r,n){var i,o,a,u;if(e.length!==r.getTotalCodewords()){throw new I}var s=r.getECBlocksForLevel(n);var f=0;var c=s.getECBlocks();try{for(var l=$r(c),h=l.next();!h.done;h=l.next()){var d=h.value;f+=d.getCount()}}catch(t){i={error:t}}finally{try{if(h&&!h.done&&(o=l.return))o.call(l)}finally{if(i)throw i.error}}var v=new Array(f);var p=0;try{for(var g=$r(c),y=g.next();!y.done;y=g.next()){var d=y.value;for(var w=0;w<d.getCount();w++){var _=d.getDataCodewords();var A=s.getECCodewordsPerBlock()+_;v[p++]=new t(_,new Uint8Array(A))}}}catch(t){a={error:t}}finally{try{if(y&&!y.done&&(u=g.return))u.call(g)}finally{if(a)throw a.error}}var m=v[0].codewords.length;var E=v.length-1;while(E>=0){var C=v[E].codewords.length;if(C===m){break}E--}E++;var S=m-s.getECCodewordsPerBlock();var O=0;for(var w=0;w<S;w++){for(var T=0;T<p;T++){v[T].codewords[w]=e[O++]}}for(var T=E;T<p;T++){v[T].codewords[S]=e[O++]}var b=v[0].codewords.length;for(var w=S;w<b;w++){for(var T=0;T<p;T++){var R=T<E?w:w+1;v[T].codewords[R]=e[O++]}}return v};t.prototype.getNumDataCodewords=function(){return this.numDataCodewords};t.prototype.getCodewords=function(){return this.codewords};return t}();var en;(function(t){t[t["TERMINATOR"]=0]="TERMINATOR";t[t["NUMERIC"]=1]="NUMERIC";t[t["ALPHANUMERIC"]=2]="ALPHANUMERIC";t[t["STRUCTURED_APPEND"]=3]="STRUCTURED_APPEND";t[t["BYTE"]=4]="BYTE";t[t["ECI"]=5]="ECI";t[t["KANJI"]=6]="KANJI";t[t["FNC1_FIRST_POSITION"]=7]="FNC1_FIRST_POSITION";t[t["FNC1_SECOND_POSITION"]=8]="FNC1_SECOND_POSITION";t[t["HANZI"]=9]="HANZI"})(en||(en={}));var rn=function(){function t(e,r,n,i){this.value=e;this.stringValue=r;this.characterCountBitsForVersions=n;this.bits=i;t.FOR_BITS.set(i,this);t.FOR_VALUE.set(e,this)}t.forBits=function(e){var r=t.FOR_BITS.get(e);if(undefined===r){throw new I}return r};t.prototype.getCharacterCountBits=function(t){var e=t.getVersionNumber();var r;if(e<=9){r=0}else if(e<=26){r=1}else{r=2}return this.characterCountBitsForVersions[r]};t.prototype.getValue=function(){return this.value};t.prototype.getBits=function(){return this.bits};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;return this.value===r.value};t.prototype.toString=function(){return this.stringValue};t.FOR_BITS=new Map;t.FOR_VALUE=new Map;t.TERMINATOR=new t(en.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0);t.NUMERIC=new t(en.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1);t.ALPHANUMERIC=new t(en.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2);t.STRUCTURED_APPEND=new t(en.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3);t.BYTE=new t(en.BYTE,"BYTE",Int32Array.from([8,16,16]),4);t.ECI=new t(en.ECI,"ECI",Int32Array.from([0,0,0]),7);t.KANJI=new t(en.KANJI,"KANJI",Int32Array.from([8,10,12]),8);t.FNC1_FIRST_POSITION=new t(en.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5);t.FNC1_SECOND_POSITION=new t(en.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9);t.HANZI=new t(en.HANZI,"HANZI",Int32Array.from([8,10,12]),13);return t}();var nn=function(){function t(){}t.decode=function(e,r,n,i){var o=new Mr(e);var a=new K;var u=new Array;var s=-1;var f=-1;try{var c=null;var l=false;var h=void 0;do{if(o.available()<4){h=rn.TERMINATOR}else{var d=o.readBits(4);h=rn.forBits(d)}switch(h){case rn.TERMINATOR:break;case rn.FNC1_FIRST_POSITION:case rn.FNC1_SECOND_POSITION:l=true;break;case rn.STRUCTURED_APPEND:if(o.available()<16){throw new H}s=o.readBits(8);f=o.readBits(8);break;case rn.ECI:var v=t.parseECIValue(o);c=W.getCharacterSetECIByValue(v);if(c===null){throw new H}break;case rn.HANZI:var p=o.readBits(4);var g=o.readBits(h.getCharacterCountBits(r));if(p===t.GB2312_SUBSET){t.decodeHanziSegment(o,a,g)}break;default:var y=o.readBits(h.getCharacterCountBits(r));switch(h){case rn.NUMERIC:t.decodeNumericSegment(o,a,y);break;case rn.ALPHANUMERIC:t.decodeAlphanumericSegment(o,a,y,l);break;case rn.BYTE:t.decodeByteSegment(o,a,y,c,u,i);break;case rn.KANJI:t.decodeKanjiSegment(o,a,y);break;default:throw new H}break}}while(h!==rn.TERMINATOR)}catch(t){throw new H}return new wt(e,a.toString(),u.length===0?null:u,n===null?null:n.toString(),s,f)};t.decodeHanziSegment=function(t,e,r){if(r*13>t.available()){throw new H}var n=new Uint8Array(2*r);var i=0;while(r>0){var o=t.readBits(13);var a=o/96<<8&4294967295|o%96;if(a<959){a+=41377}else{a+=42657}n[i]=a>>8&255;n[i+1]=a&255;i+=2;r--}try{e.append(Y.decode(n,Z.GB2312))}catch(t){throw new H(t)}};t.decodeKanjiSegment=function(t,e,r){if(r*13>t.available()){throw new H}var n=new Uint8Array(2*r);var i=0;while(r>0){var o=t.readBits(13);var a=o/192<<8&4294967295|o%192;if(a<7936){a+=33088}else{a+=49472}n[i]=a>>8;n[i+1]=a;i+=2;r--}try{e.append(Y.decode(n,Z.SHIFT_JIS))}catch(t){throw new H(t)}};t.decodeByteSegment=function(t,e,r,n,i,o){if(8*r>t.available()){throw new H}var a=new Uint8Array(r);for(var u=0;u<r;u++){a[u]=t.readBits(8)}var s;if(n===null){s=Z.guessEncoding(a,o)}else{s=n.getName()}try{e.append(Y.decode(a,s))}catch(t){throw new H(t)}i.push(a)};t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length){throw new H}return t.ALPHANUMERIC_CHARS[e]};t.decodeAlphanumericSegment=function(e,r,n,i){var o=r.length();while(n>1){if(e.available()<11){throw new H}var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45)));r.append(t.toAlphaNumericChar(a%45));n-=2}if(n===1){if(e.available()<6){throw new H}r.append(t.toAlphaNumericChar(e.readBits(6)))}if(i){for(var u=o;u<r.length();u++){if(r.charAt(u)==="%"){if(u<r.length()-1&&r.charAt(u+1)==="%"){r.deleteCharAt(u+1)}else{r.setCharAt(u,String.fromCharCode(29))}}}}};t.decodeNumericSegment=function(e,r,n){while(n>=3){if(e.available()<10){throw new H}var i=e.readBits(10);if(i>=1e3){throw new H}r.append(t.toAlphaNumericChar(Math.floor(i/100)));r.append(t.toAlphaNumericChar(Math.floor(i/10)%10));r.append(t.toAlphaNumericChar(i%10));n-=3}if(n===2){if(e.available()<7){throw new H}var o=e.readBits(7);if(o>=100){throw new H}r.append(t.toAlphaNumericChar(Math.floor(o/10)));r.append(t.toAlphaNumericChar(o%10))}else if(n===1){if(e.available()<4){throw new H}var a=e.readBits(4);if(a>=10){throw new H}r.append(t.toAlphaNumericChar(a))}};t.parseECIValue=function(t){var e=t.readBits(8);if((e&128)===0){return e&127}if((e&192)===128){var r=t.readBits(8);return(e&63)<<8&4294967295|r}if((e&224)===192){var n=t.readBits(16);return(e&31)<<16&4294967295|n}throw new H};t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";t.GB2312_SUBSET=1;return t}();var on=function(){function t(t){this.mirrored=t}t.prototype.isMirrored=function(){return this.mirrored};t.prototype.applyMirroredCorrection=function(t){if(!this.mirrored||t===null||t.length<3){return}var e=t[0];t[0]=t[2];t[2]=e};return t}();var an=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var un=function(){function t(){this.rsDecoder=new Rt(It.QR_CODE_FIELD_256)}t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(q.parseFromBooleanArray(t),e)};t.prototype.decodeBitMatrix=function(t,e){var r=new Jr(t);var n=null;try{return this.decodeBitMatrixParser(r,e)}catch(t){n=t}try{r.remask();r.setMirror(true);r.readVersion();r.readFormatInformation();r.mirror();var i=this.decodeBitMatrixParser(r,e);i.setOther(new on(true));return i}catch(t){if(n!==null){throw n}throw t}};t.prototype.decodeBitMatrixParser=function(t,e){var r,n,i,o;var a=t.readVersion();var u=t.readFormatInformation().getErrorCorrectionLevel();var s=t.readCodewords();var f=tn.getDataBlocks(s,a,u);var c=0;try{for(var l=an(f),h=l.next();!h.done;h=l.next()){var d=h.value;c+=d.getNumDataCodewords()}}catch(t){r={error:t}}finally{try{if(h&&!h.done&&(n=l.return))n.call(l)}finally{if(r)throw r.error}}var v=new Uint8Array(c);var p=0;try{for(var g=an(f),y=g.next();!y.done;y=g.next()){var d=y.value;var w=d.getCodewords();var _=d.getNumDataCodewords();this.correctErrors(w,_);for(var A=0;A<_;A++){v[p++]=w[A]}}}catch(t){i={error:t}}finally{try{if(y&&!y.done&&(o=g.return))o.call(g)}finally{if(i)throw i.error}}return nn.decode(v,a,u,e)};t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(t){throw new T}for(var n=0;n<e;n++){t[n]=r[n]}};return t}();var sn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var fn=function(t){sn(e,t);function e(e,r,n){var i=t.call(this,e,r)||this;i.estimatedModuleSize=n;return i}e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return false};e.prototype.combineEstimate=function(t,r,n){var i=(this.getX()+r)/2;var o=(this.getY()+t)/2;var a=(this.estimatedModuleSize+n)/2;return new e(i,o,a)};return e}(Bt);var cn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ln=function(){function t(t,e,r,n,i,o,a){this.image=t;this.startX=e;this.startY=r;this.width=n;this.height=i;this.moduleSize=o;this.resultPointCallback=a;this.possibleCenters=[];this.crossCheckStateCount=new Int32Array(3)}t.prototype.find=function(){var t=this.startX;var e=this.height;var r=this.width;var n=t+r;var i=this.startY+e/2;var o=new Int32Array(3);var a=this.image;for(var u=0;u<e;u++){var s=i+((u&1)===0?Math.floor((u+1)/2):-Math.floor((u+1)/2));o[0]=0;o[1]=0;o[2]=0;var f=t;while(f<n&&!a.get(f,s)){f++}var c=0;while(f<n){if(a.get(f,s)){if(c===1){o[1]++}else{if(c===2){if(this.foundPatternCross(o)){var l=this.handlePossibleCenter(o,s,f);if(l!==null){return l}}o[0]=o[2];o[1]=1;o[2]=0;c=1}else{o[++c]++}}}else{if(c===1){c++}o[c]++}f++}if(this.foundPatternCross(o)){var l=this.handlePossibleCenter(o,s,n);if(l!==null){return l}}}if(this.possibleCenters.length!==0){return this.possibleCenters[0]}throw new J};t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2};t.prototype.foundPatternCross=function(t){var e=this.moduleSize;var r=e/2;for(var n=0;n<3;n++){if(Math.abs(e-t[n])>=r){return false}}return true};t.prototype.crossCheckVertical=function(e,r,n,i){var o=this.image;var a=o.getHeight();var u=this.crossCheckStateCount;u[0]=0;u[1]=0;u[2]=0;var s=e;while(s>=0&&o.get(r,s)&&u[1]<=n){u[1]++;s--}if(s<0||u[1]>n){return NaN}while(s>=0&&!o.get(r,s)&&u[0]<=n){u[0]++;s--}if(u[0]>n){return NaN}s=e+1;while(s<a&&o.get(r,s)&&u[1]<=n){u[1]++;s++}if(s===a||u[1]>n){return NaN}while(s<a&&!o.get(r,s)&&u[2]<=n){u[2]++;s++}if(u[2]>n){return NaN}var f=u[0]+u[1]+u[2];if(5*Math.abs(f-i)>=2*i){return NaN}return this.foundPatternCross(u)?t.centerFromEnd(u,s):NaN};t.prototype.handlePossibleCenter=function(e,r,n){var i,o;var a=e[0]+e[1]+e[2];var u=t.centerFromEnd(e,n);var s=this.crossCheckVertical(r,u,2*e[1],a);if(!isNaN(s)){var f=(e[0]+e[1]+e[2])/3;try{for(var c=cn(this.possibleCenters),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.aboutEquals(f,s,u)){return h.combineEstimate(s,u,f)}}}catch(t){i={error:t}}finally{try{if(l&&!l.done&&(o=c.return))o.call(c)}finally{if(i)throw i.error}}var d=new fn(u,s,f);this.possibleCenters.push(d);if(this.resultPointCallback!==null&&this.resultPointCallback!==undefined){this.resultPointCallback.foundPossibleResultPoint(d)}}return null};return t}();var hn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var dn=function(t){hn(e,t);function e(e,r,n,i){var o=t.call(this,e,r)||this;o.estimatedModuleSize=n;o.count=i;if(undefined===i){o.count=1}return o}e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize};e.prototype.getCount=function(){return this.count};e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return false};e.prototype.combineEstimate=function(t,r,n){var i=this.count+1;var o=(this.count*this.getX()+r)/i;var a=(this.count*this.getY()+t)/i;var u=(this.count*this.estimatedModuleSize+n)/i;return new e(o,a,u,i)};return e}(Bt);var vn=function(){function t(t){this.bottomLeft=t[0];this.topLeft=t[1];this.topRight=t[2]}t.prototype.getBottomLeft=function(){return this.bottomLeft};t.prototype.getTopLeft=function(){return this.topLeft};t.prototype.getTopRight=function(){return this.topRight};return t}();var pn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var gn=function(){function t(t,e){this.image=t;this.resultPointCallback=e;this.possibleCenters=[];this.crossCheckStateCount=new Int32Array(5);this.resultPointCallback=e}t.prototype.getImage=function(){return this.image};t.prototype.getPossibleCenters=function(){return this.possibleCenters};t.prototype.find=function(e){var r=e!==null&&e!==undefined&&undefined!==e.get(V.TRY_HARDER);var n=e!==null&&e!==undefined&&undefined!==e.get(V.PURE_BARCODE);var i=this.image;var o=i.getHeight();var a=i.getWidth();var u=Math.floor(3*o/(4*t.MAX_MODULES));if(u<t.MIN_SKIP||r){u=t.MIN_SKIP}var s=false;var f=new Int32Array(5);for(var c=u-1;c<o&&!s;c+=u){f[0]=0;f[1]=0;f[2]=0;f[3]=0;f[4]=0;var l=0;for(var h=0;h<a;h++){if(i.get(h,c)){if((l&1)===1){l++}f[l]++}else{if((l&1)===0){if(l===4){if(t.foundPatternCross(f)){var d=this.handlePossibleCenter(f,c,h,n);if(d===true){u=2;if(this.hasSkipped===true){s=this.haveMultiplyConfirmedCenters()}else{var v=this.findRowSkip();if(v>f[2]){c+=v-f[2]-u;h=a-1}}}else{f[0]=f[2];f[1]=f[3];f[2]=f[4];f[3]=1;f[4]=0;l=3;continue}l=0;f[0]=0;f[1]=0;f[2]=0;f[3]=0;f[4]=0}else{f[0]=f[2];f[1]=f[3];f[2]=f[4];f[3]=1;f[4]=0;l=3}}else{f[++l]++}}else{f[l]++}}}if(t.foundPatternCross(f)){var d=this.handlePossibleCenter(f,c,a,n);if(d===true){u=f[0];if(this.hasSkipped){s=this.haveMultiplyConfirmedCenters()}}}}var p=this.selectBestPatterns();Bt.orderBestPatterns(p);return new vn(p)};t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2};t.foundPatternCross=function(t){var e=0;for(var r=0;r<5;r++){var n=t[r];if(n===0){return false}e+=n}if(e<7){return false}var i=e/7;var o=i/2;return Math.abs(i-t[0])<o&&Math.abs(i-t[1])<o&&Math.abs(3*i-t[2])<3*o&&Math.abs(i-t[3])<o&&Math.abs(i-t[4])<o};t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;t[0]=0;t[1]=0;t[2]=0;t[3]=0;t[4]=0;return t};t.prototype.crossCheckDiagonal=function(e,r,n,i){var o=this.getCrossCheckStateCount();var a=0;var u=this.image;while(e>=a&&r>=a&&u.get(r-a,e-a)){o[2]++;a++}if(e<a||r<a){return false}while(e>=a&&r>=a&&!u.get(r-a,e-a)&&o[1]<=n){o[1]++;a++}if(e<a||r<a||o[1]>n){return false}while(e>=a&&r>=a&&u.get(r-a,e-a)&&o[0]<=n){o[0]++;a++}if(o[0]>n){return false}var s=u.getHeight();var f=u.getWidth();a=1;while(e+a<s&&r+a<f&&u.get(r+a,e+a)){o[2]++;a++}if(e+a>=s||r+a>=f){return false}while(e+a<s&&r+a<f&&!u.get(r+a,e+a)&&o[3]<n){o[3]++;a++}if(e+a>=s||r+a>=f||o[3]>=n){return false}while(e+a<s&&r+a<f&&u.get(r+a,e+a)&&o[4]<n){o[4]++;a++}if(o[4]>=n){return false}var c=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(c-i)<2*i&&t.foundPatternCross(o)};t.prototype.crossCheckVertical=function(e,r,n,i){var o=this.image;var a=o.getHeight();var u=this.getCrossCheckStateCount();var s=e;while(s>=0&&o.get(r,s)){u[2]++;s--}if(s<0){return NaN}while(s>=0&&!o.get(r,s)&&u[1]<=n){u[1]++;s--}if(s<0||u[1]>n){return NaN}while(s>=0&&o.get(r,s)&&u[0]<=n){u[0]++;s--}if(u[0]>n){return NaN}s=e+1;while(s<a&&o.get(r,s)){u[2]++;s++}if(s===a){return NaN}while(s<a&&!o.get(r,s)&&u[3]<n){u[3]++;s++}if(s===a||u[3]>=n){return NaN}while(s<a&&o.get(r,s)&&u[4]<n){u[4]++;s++}if(u[4]>=n){return NaN}var f=u[0]+u[1]+u[2]+u[3]+u[4];if(5*Math.abs(f-i)>=2*i){return NaN}return t.foundPatternCross(u)?t.centerFromEnd(u,s):NaN};t.prototype.crossCheckHorizontal=function(e,r,n,i){var o=this.image;var a=o.getWidth();var u=this.getCrossCheckStateCount();var s=e;while(s>=0&&o.get(s,r)){u[2]++;s--}if(s<0){return NaN}while(s>=0&&!o.get(s,r)&&u[1]<=n){u[1]++;s--}if(s<0||u[1]>n){return NaN}while(s>=0&&o.get(s,r)&&u[0]<=n){u[0]++;s--}if(u[0]>n){return NaN}s=e+1;while(s<a&&o.get(s,r)){u[2]++;s++}if(s===a){return NaN}while(s<a&&!o.get(s,r)&&u[3]<n){u[3]++;s++}if(s===a||u[3]>=n){return NaN}while(s<a&&o.get(s,r)&&u[4]<n){u[4]++;s++}if(u[4]>=n){return NaN}var f=u[0]+u[1]+u[2]+u[3]+u[4];if(5*Math.abs(f-i)>=i){return NaN}return t.foundPatternCross(u)?t.centerFromEnd(u,s):NaN};t.prototype.handlePossibleCenter=function(e,r,n,i){var o=e[0]+e[1]+e[2]+e[3]+e[4];var a=t.centerFromEnd(e,n);var u=this.crossCheckVertical(r,Math.floor(a),e[2],o);if(!isNaN(u)){a=this.crossCheckHorizontal(Math.floor(a),Math.floor(u),e[2],o);if(!isNaN(a)&&(!i||this.crossCheckDiagonal(Math.floor(u),Math.floor(a),e[2],o))){var s=o/7;var f=false;var c=this.possibleCenters;for(var l=0,h=c.length;l<h;l++){var d=c[l];if(d.aboutEquals(s,u,a)){c[l]=d.combineEstimate(u,a,s);f=true;break}}if(!f){var v=new dn(a,u,s);c.push(v);if(this.resultPointCallback!==null&&this.resultPointCallback!==undefined){this.resultPointCallback.foundPossibleResultPoint(v)}}return true}}return false};t.prototype.findRowSkip=function(){var e,r;var n=this.possibleCenters.length;if(n<=1){return 0}var i=null;try{for(var o=pn(this.possibleCenters),a=o.next();!a.done;a=o.next()){var u=a.value;if(u.getCount()>=t.CENTER_QUORUM){if(i==null){i=u}else{this.hasSkipped=true;return Math.floor((Math.abs(i.getX()-u.getX())-Math.abs(i.getY()-u.getY()))/2)}}}}catch(t){e={error:t}}finally{try{if(a&&!a.done&&(r=o.return))r.call(o)}finally{if(e)throw e.error}}return 0};t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,i;var o=0;var a=0;var u=this.possibleCenters.length;try{for(var s=pn(this.possibleCenters),f=s.next();!f.done;f=s.next()){var c=f.value;if(c.getCount()>=t.CENTER_QUORUM){o++;a+=c.getEstimatedModuleSize()}}}catch(t){e={error:t}}finally{try{if(f&&!f.done&&(r=s.return))r.call(s)}finally{if(e)throw e.error}}if(o<3){return false}var l=a/u;var h=0;try{for(var d=pn(this.possibleCenters),v=d.next();!v.done;v=d.next()){var c=v.value;h+=Math.abs(c.getEstimatedModuleSize()-l)}}catch(t){n={error:t}}finally{try{if(v&&!v.done&&(i=d.return))i.call(d)}finally{if(n)throw n.error}}return h<=.05*a};t.prototype.selectBestPatterns=function(){var t,e,r,n;var i=this.possibleCenters.length;if(i<3){throw new J}var o=this.possibleCenters;var a;if(i>3){var u=0;var s=0;try{for(var f=pn(this.possibleCenters),c=f.next();!c.done;c=f.next()){var l=c.value;var h=l.getEstimatedModuleSize();u+=h;s+=h*h}}catch(e){t={error:e}}finally{try{if(c&&!c.done&&(e=f.return))e.call(f)}finally{if(t)throw t.error}}a=u/i;var d=Math.sqrt(s/i-a*a);o.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-a);var n=Math.abs(t.getEstimatedModuleSize()-a);return r<n?-1:r>n?1:0});var v=Math.max(.2*a,d);for(var p=0;p<o.length&&o.length>3;p++){var g=o[p];if(Math.abs(g.getEstimatedModuleSize()-a)>v){o.splice(p,1);p--}}}if(o.length>3){var u=0;try{for(var y=pn(o),w=y.next();!w.done;w=y.next()){var _=w.value;u+=_.getEstimatedModuleSize()}}catch(t){r={error:t}}finally{try{if(w&&!w.done&&(n=y.return))n.call(y)}finally{if(r)throw r.error}}a=u/o.length;o.sort(function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-a);var n=Math.abs(t.getEstimatedModuleSize()-a);return r<n?1:r>n?-1:0}else{return e.getCount()-t.getCount()}});o.splice(3)}return[o[0],o[1],o[2]]};t.CENTER_QUORUM=2;t.MIN_SKIP=3;t.MAX_MODULES=57;return t}();var yn=function(){function t(t){this.image=t}t.prototype.getImage=function(){return this.image};t.prototype.getResultPointCallback=function(){return this.resultPointCallback};t.prototype.detect=function(t){this.resultPointCallback=t===null||t===undefined?null:t.get(V.NEED_RESULT_POINT_CALLBACK);var e=new gn(this.image,this.resultPointCallback);var r=e.find(t);return this.processFinderPatternInfo(r)};t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft();var n=e.getTopRight();var i=e.getBottomLeft();var o=this.calculateModuleSize(r,n,i);if(o<1){throw new J("No pattern found in proccess finder.")}var a=t.computeDimension(r,n,i,o);var u=Kr.getProvisionalVersionForDimension(a);var s=u.getDimensionForVersion()-7;var f=null;if(u.getAlignmentPatternCenters().length>0){var c=n.getX()-r.getX()+i.getX();var l=n.getY()-r.getY()+i.getY();var h=1-3/s;var d=Math.floor(r.getX()+h*(c-r.getX()));var v=Math.floor(r.getY()+h*(l-r.getY()));for(var p=4;p<=16;p<<=1){try{f=this.findAlignmentInRegion(o,d,v,p);break}catch(t){if(!(t instanceof J)){throw t}}}}var g=t.createTransform(r,n,i,f,a);var y=t.sampleGrid(this.image,g,a);var w;if(f===null){w=[i,r,n]}else{w=[i,r,n,f]}return new Lt(y,w)};t.createTransform=function(t,e,r,n,i){var o=i-3.5;var a;var u;var s;var f;if(n!==null){a=n.getX();u=n.getY();s=o-3;f=s}else{a=e.getX()-t.getX()+r.getX();u=e.getY()-t.getY()+r.getY();s=o;f=o}return Ut.quadrilateralToQuadrilateral(3.5,3.5,o,3.5,s,f,3.5,o,t.getX(),t.getY(),e.getX(),e.getY(),a,u,r.getX(),r.getY())};t.sampleGrid=function(t,e,r){var n=Xt.getInstance();return n.sampleGridWithTransform(t,r,r,e)};t.computeDimension=function(t,e,r,n){var i=Pt.round(Bt.distance(t,e)/n);var o=Pt.round(Bt.distance(t,r)/n);var a=Math.floor((i+o)/2)+7;switch(a&3){case 0:a++;break;case 2:a--;break;case 3:throw new J("Dimensions could be not found.")}return a};t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2};t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));if(isNaN(r)){return n/7}if(isNaN(n)){return r/7}return(r+n)/14};t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var i=this.sizeOfBlackWhiteBlackRun(t,e,r,n);var o=1;var a=t-(r-t);if(a<0){o=t/(t-a);a=0}else if(a>=this.image.getWidth()){o=(this.image.getWidth()-1-t)/(a-t);a=this.image.getWidth()-1}var u=Math.floor(e-(n-e)*o);o=1;if(u<0){o=e/(e-u);u=0}else if(u>=this.image.getHeight()){o=(this.image.getHeight()-1-e)/(u-e);u=this.image.getHeight()-1}a=Math.floor(t+(a-t)*o);i+=this.sizeOfBlackWhiteBlackRun(t,e,a,u);return i-1};t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var i=Math.abs(n-e)>Math.abs(r-t);if(i){var o=t;t=e;e=o;o=r;r=n;n=o}var a=Math.abs(r-t);var u=Math.abs(n-e);var s=-a/2;var f=t<r?1:-1;var c=e<n?1:-1;var l=0;var h=r+f;for(var d=t,v=e;d!==h;d+=f){var p=i?v:d;var g=i?d:v;if(l===1===this.image.get(p,g)){if(l===2){return Pt.distance(d,v,t,e)}l++}s+=u;if(s>0){if(v===n){break}v+=c;s-=a}}if(l===2){return Pt.distance(r+f,n,t,e)}return NaN};t.prototype.findAlignmentInRegion=function(t,e,r,n){var i=Math.floor(n*t);var o=Math.max(0,e-i);var a=Math.min(this.image.getWidth()-1,e+i);if(a-o<t*3){throw new J("Alignment top exceeds estimated module size.")}var u=Math.max(0,r-i);var s=Math.min(this.image.getHeight()-1,r+i);if(s-u<t*3){throw new J("Alignment bottom exceeds estimated module size.")}var f=new ln(this.image,o,u,a-o,s-u,t,this.resultPointCallback);return f.find()};return t}();var wn=function(){function t(){this.decoder=new un}t.prototype.getDecoder=function(){return this.decoder};t.prototype.decode=function(e,r){var n;var i;if(r!==undefined&&r!==null&&undefined!==r.get(V.PURE_BARCODE)){var o=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,r);i=t.NO_POINTS}else{var a=new yn(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r);i=a.getPoints()}if(n.getOther()instanceof on){n.getOther().applyMirroredCorrection(i)}var u=new dt(n.getText(),n.getRawBytes(),undefined,i,pt.QR_CODE,undefined);var s=n.getByteSegments();if(s!==null){u.putMetadata(yt.BYTE_SEGMENTS,s)}var f=n.getECLevel();if(f!==null){u.putMetadata(yt.ERROR_CORRECTION_LEVEL,f)}if(n.hasStructuredAppend()){u.putMetadata(yt.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber());u.putMetadata(yt.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())}return u};t.prototype.reset=function(){};t.extractPureBits=function(t){var e=t.getTopLeftOnBit();var r=t.getBottomRightOnBit();if(e===null||r===null){throw new J}var n=this.moduleSize(e,t);var i=e[1];var o=r[1];var a=e[0];var u=r[0];if(a>=u||i>=o){throw new J}if(o-i!==u-a){u=a+(o-i);if(u>=t.getWidth()){throw new J}}var s=Math.round((u-a+1)/n);var f=Math.round((o-i+1)/n);if(s<=0||f<=0){throw new J}if(f!==s){throw new J}var c=Math.floor(n/2);i+=c;a+=c;var l=a+Math.floor((s-1)*n)-u;if(l>0){if(l>c){throw new J}a-=l}var h=i+Math.floor((f-1)*n)-o;if(h>0){if(h>c){throw new J}i-=h}var d=new q(s,f);for(var v=0;v<f;v++){var p=i+Math.floor(v*n);for(var g=0;g<s;g++){if(t.get(a+Math.floor(g*n),p)){d.set(g,v)}}}return d};t.moduleSize=function(t,e){var r=e.getHeight();var n=e.getWidth();var i=t[0];var o=t[1];var a=true;var u=0;while(i<n&&o<r){if(a!==e.get(i,o)){if(++u===5){break}a=!a}i++;o++}if(i===n||o===r){throw new J}return(i-t[0])/7};t.NO_POINTS=new Array;return t}();var _n=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var An=function(){function t(){}t.prototype.PDF417Common=function(){};t.getBitCountSum=function(t){return Pt.sum(t)};t.toIntArray=function(e){var r,n;if(e==null||!e.length){return t.EMPTY_INT_ARRAY}var i=new Int32Array(e.length);var o=0;try{for(var a=_n(e),u=a.next();!u.done;u=a.next()){var s=u.value;i[o++]=s}}catch(t){r={error:t}}finally{try{if(u&&!u.done&&(n=a.return))n.call(a)}finally{if(r)throw r.error}}return i};t.getCodeword=function(e){var r=L.binarySearch(t.SYMBOL_TABLE,e&262143);if(r<0){return-1}return(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS};t.NUMBER_OF_CODEWORDS=929;t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1;t.MIN_ROWS_IN_BARCODE=3;t.MAX_ROWS_IN_BARCODE=90;t.MODULES_IN_CODEWORD=17;t.MODULES_IN_STOP_PATTERN=18;t.BARS_IN_MODULE=8;t.EMPTY_INT_ARRAY=new Int32Array([]);t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]);t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);return t}();var mn=function(){function t(t,e){this.bits=t;this.points=e}t.prototype.getBits=function(){return this.bits};t.prototype.getPoints=function(){return this.points};return t}();var En=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Cn=function(){function t(){}t.detectMultiple=function(e,r,n){var i=e.getBlackMatrix();var o=t.detect(n,i);if(!o.length){i=i.clone();i.rotate180();o=t.detect(n,i)}return new mn(i,o)};t.detect=function(e,r){var n,i;var o=new Array;var a=0;var u=0;var s=false;while(a<r.getHeight()){var f=t.findVertices(r,a,u);if(f[0]==null&&f[3]==null){if(!s){break}s=false;u=0;try{for(var c=(n=void 0,En(o)),l=c.next();!l.done;l=c.next()){var h=l.value;if(h[1]!=null){a=Math.trunc(Math.max(a,h[1].getY()))}if(h[3]!=null){a=Math.max(a,Math.trunc(h[3].getY()))}}}catch(t){n={error:t}}finally{try{if(l&&!l.done&&(i=c.return))i.call(c)}finally{if(n)throw n.error}}a+=t.ROW_STEP;continue}s=true;o.push(f);if(!e){break}if(f[2]!=null){u=Math.trunc(f[2].getX());a=Math.trunc(f[2].getY())}else{u=Math.trunc(f[4].getX());a=Math.trunc(f[4].getY())}}return o};t.findVertices=function(e,r,n){var i=e.getHeight();var o=e.getWidth();var a=new Array(8);t.copyToResult(a,t.findRowsWithPattern(e,i,o,r,n,t.START_PATTERN),t.INDEXES_START_PATTERN);if(a[4]!=null){n=Math.trunc(a[4].getX());r=Math.trunc(a[4].getY())}t.copyToResult(a,t.findRowsWithPattern(e,i,o,r,n,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN);return a};t.copyToResult=function(t,e,r){for(var n=0;n<r.length;n++){t[r[n]]=e[n]}};t.findRowsWithPattern=function(e,r,n,i,o,a){var u=new Array(4);var s=false;var f=new Int32Array(a.length);for(;i<r;i+=t.ROW_STEP){var c=t.findGuardPattern(e,o,i,n,false,a,f);if(c!=null){while(i>0){var l=t.findGuardPattern(e,o,--i,n,false,a,f);if(l!=null){c=l}else{i++;break}}u[0]=new Bt(c[0],i);u[1]=new Bt(c[1],i);s=true;break}}var h=i+1;if(s){var d=0;var l=Int32Array.from([Math.trunc(u[0].getX()),Math.trunc(u[1].getX())]);for(;h<r;h++){var c=t.findGuardPattern(e,l[0],h,n,false,a,f);if(c!=null&&Math.abs(l[0]-c[0])<t.MAX_PATTERN_DRIFT&&Math.abs(l[1]-c[1])<t.MAX_PATTERN_DRIFT){l=c;d=0}else{if(d>t.SKIPPED_ROW_COUNT_MAX){break}else{d++}}}h-=d+1;u[2]=new Bt(l[0],h);u[3]=new Bt(l[1],h)}if(h-i<t.BARCODE_MIN_HEIGHT){L.fill(u,null)}return u};t.findGuardPattern=function(e,r,n,i,o,a,u){L.fillWithin(u,0,u.length,0);var s=r;var f=0;while(e.get(s,n)&&s>0&&f++<t.MAX_PIXEL_DRIFT){s--}var c=s;var l=0;var h=a.length;for(var d=o;c<i;c++){var v=e.get(c,n);if(v!==d){u[l]++}else{if(l===h-1){if(t.patternMatchVariance(u,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE){return new Int32Array([s,c])}s+=u[0]+u[1];R.arraycopy(u,2,u,0,l-1);u[l-1]=0;u[l]=0;l--}else{l++}u[l]=1;d=!d}}if(l===h-1&&t.patternMatchVariance(u,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE){return new Int32Array([s,c-1])}return null};t.patternMatchVariance=function(t,e,r){var n=t.length;var i=0;var o=0;for(var a=0;a<n;a++){i+=t[a];o+=e[a]}if(i<o){return Infinity}var u=i/o;r*=u;var s=0;for(var f=0;f<n;f++){var c=t[f];var l=e[f]*u;var h=c>l?c-l:l-c;if(h>r){return Infinity}s+=h}return s/i};t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]);t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]);t.MAX_AVG_VARIANCE=.42;t.MAX_INDIVIDUAL_VARIANCE=.8;t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]);t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]);t.MAX_PIXEL_DRIFT=3;t.MAX_PATTERN_DRIFT=5;t.SKIPPED_ROW_COUNT_MAX=25;t.ROW_STEP=5;t.BARCODE_MIN_HEIGHT=10;return t}();var In=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Sn=function(){function t(t,e){if(e.length===0){throw new I}this.field=t;var r=e.length;if(r>1&&e[0]===0){var n=1;while(n<r&&e[n]===0){n++}if(n===r){this.coefficients=new Int32Array([0])}else{this.coefficients=new Int32Array(r-n);R.arraycopy(e,n,this.coefficients,0,this.coefficients.length)}}else{this.coefficients=e}}t.prototype.getCoefficients=function(){return this.coefficients};t.prototype.getDegree=function(){return this.coefficients.length-1};t.prototype.isZero=function(){return this.coefficients[0]===0};t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]};t.prototype.evaluateAt=function(t){var e,r;if(t===0){return this.getCoefficient(0)}if(t===1){var n=0;try{for(var i=In(this.coefficients),o=i.next();!o.done;o=i.next()){var a=o.value;n=this.field.add(n,a)}}catch(t){e={error:t}}finally{try{if(o&&!o.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}return n}var u=this.coefficients[0];var s=this.coefficients.length;for(var f=1;f<s;f++){u=this.field.add(this.field.multiply(t,u),this.coefficients[f])}return u};t.prototype.add=function(e){if(!this.field.equals(e.field)){throw new I("ModulusPolys do not have same ModulusGF field")}if(this.isZero()){return e}if(e.isZero()){return this}var r=this.coefficients;var n=e.coefficients;if(r.length>n.length){var i=r;r=n;n=i}var o=new Int32Array(n.length);var a=n.length-r.length;R.arraycopy(n,0,o,0,a);for(var u=a;u<n.length;u++){o[u]=this.field.add(r[u-a],n[u])}return new t(this.field,o)};t.prototype.subtract=function(t){if(!this.field.equals(t.field)){throw new I("ModulusPolys do not have same ModulusGF field")}if(t.isZero()){return this}return this.add(t.negative())};t.prototype.multiply=function(e){if(e instanceof t){return this.multiplyOther(e)}return this.multiplyScalar(e)};t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field)){throw new I("ModulusPolys do not have same ModulusGF field")}if(this.isZero()||e.isZero()){return new t(this.field,new Int32Array([0]))}var r=this.coefficients;var n=r.length;var i=e.coefficients;var o=i.length;var a=new Int32Array(n+o-1);for(var u=0;u<n;u++){var s=r[u];for(var f=0;f<o;f++){a[u+f]=this.field.add(a[u+f],this.field.multiply(s,i[f]))}}return new t(this.field,a)};t.prototype.negative=function(){var e=this.coefficients.length;var r=new Int32Array(e);for(var n=0;n<e;n++){r[n]=this.field.subtract(0,this.coefficients[n])}return new t(this.field,r)};t.prototype.multiplyScalar=function(e){if(e===0){return new t(this.field,new Int32Array([0]))}if(e===1){return this}var r=this.coefficients.length;var n=new Int32Array(r);for(var i=0;i<r;i++){n[i]=this.field.multiply(this.coefficients[i],e)}return new t(this.field,n)};t.prototype.multiplyByMonomial=function(e,r){if(e<0){throw new I}if(r===0){return new t(this.field,new Int32Array([0]))}var n=this.coefficients.length;var i=new Int32Array(n+e);for(var o=0;o<n;o++){i[o]=this.field.multiply(this.coefficients[o],r)}return new t(this.field,i)};t.prototype.toString=function(){var t=new K;for(var e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(r!==0){if(r<0){t.append(" - ");r=-r}else{if(t.length()>0){t.append(" + ")}}if(e===0||r!==1){t.append(r)}if(e!==0){if(e===1){t.append("x")}else{t.append("x^");t.append(e)}}}}return t.toString()};return t}();var On=function(){function t(){}t.prototype.add=function(t,e){return(t+e)%this.modulus};t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus};t.prototype.exp=function(t){return this.expTable[t]};t.prototype.log=function(t){if(t===0){throw new I}return this.logTable[t]};t.prototype.inverse=function(t){if(t===0){throw new Et}return this.expTable[this.modulus-this.logTable[t]-1]};t.prototype.multiply=function(t,e){if(t===0||e===0){return 0}return this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]};t.prototype.getSize=function(){return this.modulus};t.prototype.equals=function(t){return t===this};return t}();var Tn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var bn=function(t){Tn(e,t);function e(e,r){var n=t.call(this)||this;n.modulus=e;n.expTable=new Int32Array(e);n.logTable=new Int32Array(e);var i=1;for(var o=0;o<e;o++){n.expTable[o]=i;i=i*r%e}for(var o=0;o<e-1;o++){n.logTable[n.expTable[o]]=o}n.zero=new Sn(n,new Int32Array([0]));n.one=new Sn(n,new Int32Array([1]));return n}e.prototype.getZero=function(){return this.zero};e.prototype.getOne=function(){return this.one};e.prototype.buildMonomial=function(t,e){if(t<0){throw new I}if(e===0){return this.zero}var r=new Int32Array(t+1);r[0]=e;return new Sn(this,r)};e.PDF417_GF=new e(An.NUMBER_OF_CODEWORDS,3);return e}(On);var Rn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Nn=function(){function t(){this.field=bn.PDF417_GF}t.prototype.decode=function(t,e,r){var n,i;var o=new Sn(this.field,t);var a=new Int32Array(e);var u=false;for(var s=e;s>0;s--){var f=o.evaluateAt(this.field.exp(s));a[e-s]=f;if(f!==0){u=true}}if(!u){return 0}var c=this.field.getOne();if(r!=null){try{for(var l=Rn(r),h=l.next();!h.done;h=l.next()){var d=h.value;var v=this.field.exp(t.length-1-d);var p=new Sn(this.field,new Int32Array([this.field.subtract(0,v),1]));c=c.multiply(p)}}catch(t){n={error:t}}finally{try{if(h&&!h.done&&(i=l.return))i.call(l)}finally{if(n)throw n.error}}}var g=new Sn(this.field,a);var y=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),g,e);var w=y[0];var _=y[1];var A=this.findErrorLocations(w);var m=this.findErrorMagnitudes(_,w,A);for(var s=0;s<A.length;s++){var E=t.length-1-this.field.log(A[s]);if(E<0){throw T.getChecksumInstance()}t[E]=this.field.subtract(t[E],m[s])}return A.length};t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e;e=n}var i=t;var o=e;var a=this.field.getZero();var u=this.field.getOne();while(o.getDegree()>=Math.round(r/2)){var s=i;var f=a;i=o;a=u;if(i.isZero()){throw T.getChecksumInstance()}o=s;var c=this.field.getZero();var l=i.getCoefficient(i.getDegree());var h=this.field.inverse(l);while(o.getDegree()>=i.getDegree()&&!o.isZero()){var d=o.getDegree()-i.getDegree();var v=this.field.multiply(o.getCoefficient(o.getDegree()),h);c=c.add(this.field.buildMonomial(d,v));o=o.subtract(i.multiplyByMonomial(d,v))}u=c.multiply(a).subtract(f).negative()}var p=u.getCoefficient(0);if(p===0){throw T.getChecksumInstance()}var g=this.field.inverse(p);var y=u.multiply(g);var w=o.multiply(g);return[y,w]};t.prototype.findErrorLocations=function(t){var e=t.getDegree();var r=new Int32Array(e);var n=0;for(var i=1;i<this.field.getSize()&&n<e;i++){if(t.evaluateAt(i)===0){r[n]=this.field.inverse(i);n++}}if(n!==e){throw T.getChecksumInstance()}return r};t.prototype.findErrorMagnitudes=function(t,e,r){var n=e.getDegree();var i=new Int32Array(n);for(var o=1;o<=n;o++){i[n-o]=this.field.multiply(o,e.getCoefficient(o))}var a=new Sn(this.field,i);var u=r.length;var s=new Int32Array(u);for(var o=0;o<u;o++){var f=this.field.inverse(r[o]);var c=this.field.subtract(0,t.evaluateAt(f));var l=this.field.inverse(a.evaluateAt(f));s[o]=this.field.multiply(c,l)}return s};return t}();var Dn=function(){function t(e,r,n,i,o){if(e instanceof t){this.constructor_2(e)}else{this.constructor_1(e,r,n,i,o)}}t.prototype.constructor_1=function(t,e,r,n,i){var o=e==null||r==null;var a=n==null||i==null;if(o&&a){throw new J}if(o){e=new Bt(0,n.getY());r=new Bt(0,i.getY())}else if(a){n=new Bt(t.getWidth()-1,e.getY());i=new Bt(t.getWidth()-1,r.getY())}this.image=t;this.topLeft=e;this.bottomLeft=r;this.topRight=n;this.bottomRight=i;this.minX=Math.trunc(Math.min(e.getX(),r.getX()));this.maxX=Math.trunc(Math.max(n.getX(),i.getX()));this.minY=Math.trunc(Math.min(e.getY(),n.getY()));this.maxY=Math.trunc(Math.max(r.getY(),i.getY()))};t.prototype.constructor_2=function(t){this.image=t.image;this.topLeft=t.getTopLeft();this.bottomLeft=t.getBottomLeft();this.topRight=t.getTopRight();this.bottomRight=t.getBottomRight();this.minX=t.getMinX();this.maxX=t.getMaxX();this.minY=t.getMinY();this.maxY=t.getMaxY()};t.merge=function(e,r){if(e==null){return r}if(r==null){return e}return new t(e.image,e.topLeft,e.bottomLeft,r.topRight,r.bottomRight)};t.prototype.addMissingRows=function(e,r,n){var i=this.topLeft;var o=this.bottomLeft;var a=this.topRight;var u=this.bottomRight;if(e>0){var s=n?this.topLeft:this.topRight;var f=Math.trunc(s.getY()-e);if(f<0){f=0}var c=new Bt(s.getX(),f);if(n){i=c}else{a=c}}if(r>0){var l=n?this.bottomLeft:this.bottomRight;var h=Math.trunc(l.getY()+r);if(h>=this.image.getHeight()){h=this.image.getHeight()-1}var d=new Bt(l.getX(),h);if(n){o=d}else{u=d}}return new t(this.image,i,o,a,u)};t.prototype.getMinX=function(){return this.minX};t.prototype.getMaxX=function(){return this.maxX};t.prototype.getMinY=function(){return this.minY};t.prototype.getMaxY=function(){return this.maxY};t.prototype.getTopLeft=function(){return this.topLeft};t.prototype.getTopRight=function(){return this.topRight};t.prototype.getBottomLeft=function(){return this.bottomLeft};t.prototype.getBottomRight=function(){return this.bottomRight};return t}();var Pn=function(){function t(t,e,r,n){this.columnCount=t;this.errorCorrectionLevel=n;this.rowCountUpperPart=e;this.rowCountLowerPart=r;this.rowCount=e+r}t.prototype.getColumnCount=function(){return this.columnCount};t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel};t.prototype.getRowCount=function(){return this.rowCount};t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart};t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart};return t}();var Mn=function(){function t(){this.buffer=""}t.form=function(t,e){var r=-1;function n(t,n,i,o,a,u){if(t==="%%")return"%";if(e[++r]===undefined)return undefined;t=o?parseInt(o.substr(1)):undefined;var s=a?parseInt(a.substr(1)):undefined;var f;switch(u){case"s":f=e[r];break;case"c":f=e[r][0];break;case"f":f=parseFloat(e[r]).toFixed(t);break;case"p":f=parseFloat(e[r]).toPrecision(t);break;case"e":f=parseFloat(e[r]).toExponential(t);break;case"x":f=parseInt(e[r]).toString(s?s:16);break;case"d":f=parseFloat(parseInt(e[r],s?s:10).toPrecision(t)).toFixed(0);break}f=typeof f==="object"?JSON.stringify(f):(+f).toString(s);var c=parseInt(i);var l=i&&i[0]+""==="0"?"0":" ";while(f.length<c)f=n!==undefined?f+l:l+f;return f}var i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(i,n)};t.prototype.format=function(e){var r=[];for(var n=1;n<arguments.length;n++){r[n-1]=arguments[n]}this.buffer+=t.form(e,r)};t.prototype.toString=function(){return this.buffer};return t}();var Bn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Ln=function(){function t(t){this.boundingBox=new Dn(t);this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(r!=null){return r}for(var n=1;n<t.MAX_NEARBY_DISTANCE;n++){var i=this.imageRowToCodewordIndex(e)-n;if(i>=0){r=this.codewords[i];if(r!=null){return r}}i=this.imageRowToCodewordIndex(e)+n;if(i<this.codewords.length){r=this.codewords[i];if(r!=null){return r}}}return null};t.prototype.imageRowToCodewordIndex=function(t){return t-this.boundingBox.getMinY()};t.prototype.setCodeword=function(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e};t.prototype.getCodeword=function(t){return this.codewords[this.imageRowToCodewordIndex(t)]};t.prototype.getBoundingBox=function(){return this.boundingBox};t.prototype.getCodewords=function(){return this.codewords};t.prototype.toString=function(){var t,e;var r=new Mn;var n=0;try{for(var i=Bn(this.codewords),o=i.next();!o.done;o=i.next()){var a=o.value;if(a==null){r.format("%3d:    |   %n",n++);continue}r.format("%3d: %3d|%3d%n",n++,a.getRowNumber(),a.getValue())}}catch(e){t={error:e}}finally{try{if(o&&!o.done&&(e=i.return))e.call(i)}finally{if(t)throw t.error}}return r.toString()};t.MAX_NEARBY_DISTANCE=5;return t}();var Fn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var xn=undefined&&undefined.__read||function(t,e){var r=typeof Symbol==="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],a;try{while((e===void 0||e-- >0)&&!(i=n.next()).done)o.push(i.value)}catch(t){a={error:t}}finally{try{if(i&&!i.done&&(r=n["return"]))r.call(n)}finally{if(a)throw a.error}}return o};var kn=function(){function t(){this.values=new Map}t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);if(e==null){e=0}e++;this.values.set(t,e)};t.prototype.getValue=function(){var t,e;var r=-1;var n=new Array;var i=function(t,e){var i={getKey:function(){return t},getValue:function(){return e}};if(i.getValue()>r){r=i.getValue();n=[];n.push(i.getKey())}else if(i.getValue()===r){n.push(i.getKey())}};try{for(var o=Fn(this.values.entries()),a=o.next();!a.done;a=o.next()){var u=xn(a.value,2),s=u[0],f=u[1];i(s,f)}}catch(e){t={error:e}}finally{try{if(a&&!a.done&&(e=o.return))e.call(o)}finally{if(t)throw t.error}}return An.toIntArray(n)};t.prototype.getConfidence=function(t){return this.values.get(t)};return t}();var Vn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Un=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Hn=function(t){Vn(e,t);function e(e,r){var n=t.call(this,e)||this;n._isLeft=r;return n}e.prototype.setRowNumbers=function(){var t,e;try{for(var r=Un(this.getCodewords()),n=r.next();!n.done;n=r.next()){var i=n.value;if(i!=null){i.setRowNumberAsRowIndicatorColumn()}}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}};e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers();this.removeIncorrectCodewords(e,t);var r=this.getBoundingBox();var n=this._isLeft?r.getTopLeft():r.getTopRight();var i=this._isLeft?r.getBottomLeft():r.getBottomRight();var o=this.imageRowToCodewordIndex(Math.trunc(n.getY()));var a=this.imageRowToCodewordIndex(Math.trunc(i.getY()));var u=-1;var s=1;var f=0;for(var c=o;c<a;c++){if(e[c]==null){continue}var l=e[c];var h=l.getRowNumber()-u;if(h===0){f++}else if(h===1){s=Math.max(s,f);f=1;u=l.getRowNumber()}else if(h<0||l.getRowNumber()>=t.getRowCount()||h>c){e[c]=null}else{var d=void 0;if(s>2){d=(s-2)*h}else{d=h}var v=d>=c;for(var p=1;p<=d&&!v;p++){v=e[c-p]!=null}if(v){e[c]=null}else{u=l.getRowNumber();f=1}}}};e.prototype.getRowHeights=function(){var t,e;var r=this.getBarcodeMetadata();if(r==null){return null}this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var i=Un(this.getCodewords()),o=i.next();!o.done;o=i.next()){var a=o.value;if(a!=null){var u=a.getRowNumber();if(u>=n.length){continue}n[u]++}}}catch(e){t={error:e}}finally{try{if(o&&!o.done&&(e=i.return))e.call(i)}finally{if(t)throw t.error}}return n};e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){var e=this.getBoundingBox();var r=this._isLeft?e.getTopLeft():e.getTopRight();var n=this._isLeft?e.getBottomLeft():e.getBottomRight();var i=this.imageRowToCodewordIndex(Math.trunc(r.getY()));var o=this.imageRowToCodewordIndex(Math.trunc(n.getY()));var a=this.getCodewords();var u=-1;for(var s=i;s<o;s++){if(a[s]==null){continue}var f=a[s];f.setRowNumberAsRowIndicatorColumn();var c=f.getRowNumber()-u;if(c===0);else if(c===1){u=f.getRowNumber()}else if(f.getRowNumber()>=t.getRowCount()){a[s]=null}else{u=f.getRowNumber()}}};e.prototype.getBarcodeMetadata=function(){var t,e;var r=this.getCodewords();var n=new kn;var i=new kn;var o=new kn;var a=new kn;try{for(var u=Un(r),s=u.next();!s.done;s=u.next()){var f=s.value;if(f==null){continue}f.setRowNumberAsRowIndicatorColumn();var c=f.getValue()%30;var l=f.getRowNumber();if(!this._isLeft){l+=2}switch(l%3){case 0:i.setValue(c*3+1);break;case 1:a.setValue(c/3);o.setValue(c%3);break;case 2:n.setValue(c+1);break}}}catch(e){t={error:e}}finally{try{if(s&&!s.done&&(e=u.return))e.call(u)}finally{if(t)throw t.error}}if(n.getValue().length===0||i.getValue().length===0||o.getValue().length===0||a.getValue().length===0||n.getValue()[0]<1||i.getValue()[0]+o.getValue()[0]<An.MIN_ROWS_IN_BARCODE||i.getValue()[0]+o.getValue()[0]>An.MAX_ROWS_IN_BARCODE){return null}var h=new Pn(n.getValue()[0],i.getValue()[0],o.getValue()[0],a.getValue()[0]);this.removeIncorrectCodewords(r,h);return h};e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(t[r]==null){continue}var i=n.getValue()%30;var o=n.getRowNumber();if(o>e.getRowCount()){t[r]=null;continue}if(!this._isLeft){o+=2}switch(o%3){case 0:if(i*3+1!==e.getRowCountUpperPart()){t[r]=null}break;case 1:if(Math.trunc(i/3)!==e.getErrorCorrectionLevel()||i%3!==e.getRowCountLowerPart()){t[r]=null}break;case 2:if(i+1!==e.getColumnCount()){t[r]=null}break}}};e.prototype.isLeft=function(){return this._isLeft};e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)};return e}(Ln);var Gn=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Xn=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2;this.barcodeMetadata=t;this.barcodeColumnCount=t.getColumnCount();this.boundingBox=e;this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]);this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t=An.MAX_CODEWORDS_IN_BARCODE;var e;do{e=t;t=this.adjustRowNumbersAndGetCount()}while(t>0&&t<e);return this.detectionResultColumns};t.prototype.adjustIndicatorColumnRowNumbers=function(t){if(t!=null){t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}};t.prototype.adjustRowNumbersAndGetCount=function(){var t=this.adjustRowNumbersByRow();if(t===0){return 0}for(var e=1;e<this.barcodeColumnCount+1;e++){var r=this.detectionResultColumns[e].getCodewords();for(var n=0;n<r.length;n++){if(r[n]==null){continue}if(!r[n].hasValidRowNumber()){this.adjustRowNumbers(e,n,r)}}}return t};t.prototype.adjustRowNumbersByRow=function(){this.adjustRowNumbersFromBothRI();var t=this.adjustRowNumbersFromLRI();return t+this.adjustRowNumbersFromRRI()};t.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null){return}var t=this.detectionResultColumns[0].getCodewords();var e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(var r=0;r<t.length;r++){if(t[r]!=null&&e[r]!=null&&t[r].getRowNumber()===e[r].getRowNumber()){for(var n=1;n<=this.barcodeColumnCount;n++){var i=this.detectionResultColumns[n].getCodewords()[r];if(i==null){continue}i.setRowNumber(t[r].getRowNumber());if(!i.hasValidRowNumber()){this.detectionResultColumns[n].getCodewords()[r]=null}}}}};t.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null){return 0}var e=0;var r=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(var n=0;n<r.length;n++){if(r[n]==null){continue}var i=r[n].getRowNumber();var o=0;for(var a=this.barcodeColumnCount+1;a>0&&o<this.ADJUST_ROW_NUMBER_SKIP;a--){var u=this.detectionResultColumns[a].getCodewords()[n];if(u!=null){o=t.adjustRowNumberIfValid(i,o,u);if(!u.hasValidRowNumber()){e++}}}}return e};t.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null){return 0}var e=0;var r=this.detectionResultColumns[0].getCodewords();for(var n=0;n<r.length;n++){if(r[n]==null){continue}var i=r[n].getRowNumber();var o=0;for(var a=1;a<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;a++){var u=this.detectionResultColumns[a].getCodewords()[n];if(u!=null){o=t.adjustRowNumberIfValid(i,o,u);if(!u.hasValidRowNumber()){e++}}}}return e};t.adjustRowNumberIfValid=function(t,e,r){if(r==null){return e}if(!r.hasValidRowNumber()){if(r.isValidRowNumber(t)){r.setRowNumber(t);e=0}else{++e}}return e};t.prototype.adjustRowNumbers=function(e,r,n){var i,o;var a=n[r];var u=this.detectionResultColumns[e-1].getCodewords();var s=u;if(this.detectionResultColumns[e+1]!=null){s=this.detectionResultColumns[e+1].getCodewords()}var f=new Array(14);f[2]=u[r];f[3]=s[r];if(r>0){f[0]=n[r-1];f[4]=u[r-1];f[5]=s[r-1]}if(r>1){f[8]=n[r-2];f[10]=u[r-2];f[11]=s[r-2]}if(r<n.length-1){f[1]=n[r+1];f[6]=u[r+1];f[7]=s[r+1]}if(r<n.length-2){f[9]=n[r+2];f[12]=u[r+2];f[13]=s[r+2]}try{for(var c=Gn(f),l=c.next();!l.done;l=c.next()){var h=l.value;if(t.adjustRowNumber(a,h)){return}}}catch(t){i={error:t}}finally{try{if(l&&!l.done&&(o=c.return))o.call(c)}finally{if(i)throw i.error}}};t.adjustRowNumber=function(t,e){if(e==null){return false}if(e.hasValidRowNumber()&&e.getBucket()===t.getBucket()){t.setRowNumber(e.getRowNumber());return true}return false};t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount};t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()};t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()};t.prototype.setBoundingBox=function(t){this.boundingBox=t};t.prototype.getBoundingBox=function(){return this.boundingBox};t.prototype.setDetectionResultColumn=function(t,e){this.detectionResultColumns[t]=e};t.prototype.getDetectionResultColumn=function(t){return this.detectionResultColumns[t]};t.prototype.toString=function(){var t=this.detectionResultColumns[0];if(t==null){t=this.detectionResultColumns[this.barcodeColumnCount+1]}var e=new Mn;for(var r=0;r<t.getCodewords().length;r++){e.format("CW %3d:",r);for(var n=0;n<this.barcodeColumnCount+2;n++){if(this.detectionResultColumns[n]==null){e.format("    |   ");continue}var i=this.detectionResultColumns[n].getCodewords()[r];if(i==null){e.format("    |   ");continue}e.format(" %3d|%3d",i.getRowNumber(),i.getValue())}e.format("%n")}return e.toString()};return t}();var Wn=function(){function t(e,r,n,i){this.rowNumber=t.BARCODE_ROW_UNKNOWN;this.startX=Math.trunc(e);this.endX=Math.trunc(r);this.bucket=Math.trunc(n);this.value=Math.trunc(i)}t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)};t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3};t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))};t.prototype.getWidth=function(){return this.endX-this.startX};t.prototype.getStartX=function(){return this.startX};t.prototype.getEndX=function(){return this.endX};t.prototype.getBucket=function(){return this.bucket};t.prototype.getValue=function(){return this.value};t.prototype.getRowNumber=function(){return this.rowNumber};t.prototype.setRowNumber=function(t){this.rowNumber=t};t.prototype.toString=function(){return this.rowNumber+"|"+this.value};t.BARCODE_ROW_UNKNOWN=-1;return t}();var jn=function(){function t(){}t.initialize=function(){for(var e=0;e<An.SYMBOL_TABLE.length;e++){var r=An.SYMBOL_TABLE[e];var n=r&1;for(var i=0;i<An.BARS_IN_MODULE;i++){var o=0;while((r&1)===n){o+=1;r>>=1}n=r&1;if(!t.RATIOS_TABLE[e]){t.RATIOS_TABLE[e]=new Array(An.BARS_IN_MODULE)}t.RATIOS_TABLE[e][An.BARS_IN_MODULE-i-1]=Math.fround(o/An.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=true};t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));if(r!==-1){return r}return t.getClosestDecodedValue(e)};t.sampleBitCounts=function(t){var e=Pt.sum(t);var r=new Int32Array(An.BARS_IN_MODULE);var n=0;var i=0;for(var o=0;o<An.MODULES_IN_CODEWORD;o++){var a=e/(2*An.MODULES_IN_CODEWORD)+o*e/An.MODULES_IN_CODEWORD;if(i+t[n]<=a){i+=t[n];n++}r[n]++}return r};t.getDecodedCodewordValue=function(e){var r=t.getBitValue(e);return An.getCodeword(r)===-1?-1:r};t.getBitValue=function(t){var e=0;for(var r=0;r<t.length;r++){for(var n=0;n<t[r];n++){e=e<<1|(r%2===0?1:0)}}return Math.trunc(e)};t.getClosestDecodedValue=function(e){var r=Pt.sum(e);var n=new Array(An.BARS_IN_MODULE);if(r>1){for(var i=0;i<n.length;i++){n[i]=Math.fround(e[i]/r)}}var o=Mt.MAX_VALUE;var a=-1;if(!this.bSymbolTableReady){t.initialize()}for(var u=0;u<t.RATIOS_TABLE.length;u++){var s=0;var f=t.RATIOS_TABLE[u];for(var c=0;c<An.BARS_IN_MODULE;c++){var l=Math.fround(f[c]-n[c]);s+=Math.fround(l*l);if(s>=o){break}}if(s<o){o=s;a=An.SYMBOL_TABLE[u]}}return a};t.bSymbolTableReady=false;t.RATIOS_TABLE=new Array(An.SYMBOL_TABLE.length).map(function(t){return new Array(An.BARS_IN_MODULE)});return t}();var zn=function(){function t(){this.segmentCount=-1;this.fileSize=-1;this.timestamp=-1;this.checksum=-1}t.prototype.getSegmentIndex=function(){return this.segmentIndex};t.prototype.setSegmentIndex=function(t){this.segmentIndex=t};t.prototype.getFileId=function(){return this.fileId};t.prototype.setFileId=function(t){this.fileId=t};t.prototype.getOptionalData=function(){return this.optionalData};t.prototype.setOptionalData=function(t){this.optionalData=t};t.prototype.isLastSegment=function(){return this.lastSegment};t.prototype.setLastSegment=function(t){this.lastSegment=t};t.prototype.getSegmentCount=function(){return this.segmentCount};t.prototype.setSegmentCount=function(t){this.segmentCount=t};t.prototype.getSender=function(){return this.sender||null};t.prototype.setSender=function(t){this.sender=t};t.prototype.getAddressee=function(){return this.addressee||null};t.prototype.setAddressee=function(t){this.addressee=t};t.prototype.getFileName=function(){return this.fileName};t.prototype.setFileName=function(t){this.fileName=t};t.prototype.getFileSize=function(){return this.fileSize};t.prototype.setFileSize=function(t){this.fileSize=t};t.prototype.getChecksum=function(){return this.checksum};t.prototype.setChecksum=function(t){this.checksum=t};t.prototype.getTimestamp=function(){return this.timestamp};t.prototype.setTimestamp=function(t){this.timestamp=t};return t}();var Yn=function(){function t(){}t.parseLong=function(t,e){if(e===void 0){e=undefined}return parseInt(t,e)};return t}();var Zn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Kn=function(t){Zn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="NullPointerException";return e}(A);var qn=function(){function t(){}t.prototype.writeBytes=function(t){this.writeBytesOffset(t,0,t.length)};t.prototype.writeBytesOffset=function(t,e,r){if(t==null){throw new Kn}else if(e<0||e>t.length||r<0||e+r>t.length||e+r<0){throw new D}else if(r===0){return}for(var n=0;n<r;n++){this.write(t[e+n])}};t.prototype.flush=function(){};t.prototype.close=function(){};return t}();var Qn=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Jn=function(t){Qn(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(A);var $n=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var ti=function(t){$n(e,t);function e(e){if(e===void 0){e=32}var r=t.call(this)||this;r.count=0;if(e<0){throw new I("Negative initial size: "+e)}r.buf=new Uint8Array(e);return r}e.prototype.ensureCapacity=function(t){if(t-this.buf.length>0)this.grow(t)};e.prototype.grow=function(t){var e=this.buf.length;var r=e<<1;if(r-t<0)r=t;if(r<0){if(t<0)throw new Jn;r=F.MAX_VALUE}this.buf=L.copyOfUint8Array(this.buf,r)};e.prototype.write=function(t){this.ensureCapacity(this.count+1);this.buf[this.count]=t;this.count+=1};e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0){throw new D}this.ensureCapacity(this.count+r);R.arraycopy(t,e,this.buf,this.count,r);this.count+=r};e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)};e.prototype.reset=function(){this.count=0};e.prototype.toByteArray=function(){return L.copyOfUint8Array(this.buf,this.count)};e.prototype.size=function(){return this.count};e.prototype.toString=function(t){if(!t){return this.toString_void()}if(typeof t==="string"){return this.toString_string(t)}return this.toString_number(t)};e.prototype.toString_void=function(){return new String(this.buf).toString()};e.prototype.toString_string=function(t){return new String(this.buf).toString()};e.prototype.toString_number=function(t){return new String(this.buf).toString()};e.prototype.close=function(){};return e}(qn);var ei;(function(t){t[t["ALPHA"]=0]="ALPHA";t[t["LOWER"]=1]="LOWER";t[t["MIXED"]=2]="MIXED";t[t["PUNCT"]=3]="PUNCT";t[t["ALPHA_SHIFT"]=4]="ALPHA_SHIFT";t[t["PUNCT_SHIFT"]=5]="PUNCT_SHIFT"})(ei||(ei={}));function ri(){if(typeof window!=="undefined"){return window["BigInt"]||null}if(typeof global!=="undefined"){return global["BigInt"]||null}if(typeof self!=="undefined"){return self["BigInt"]||null}throw new Error("Can't search globals for BigInt!")}var ni;function ii(t){if(typeof ni==="undefined"){ni=ri()}if(ni===null){throw new Error("BigInt is not supported!")}return ni(t)}function oi(){var t=[];t[0]=ii(1);var e=ii(900);t[1]=e;for(var r=2;r<16;r++){t[r]=t[r-1]*e}return t}var ai=function(){function t(){}t.decode=function(e,r){var n=new K("");var i=W.ISO8859_1;n.enableDecoding(i);var o=1;var a=e[o++];var u=new zn;while(o<e[0]){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:o=t.textCompaction(e,o,n);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:o=t.byteCompaction(a,e,i,o,n);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(e[o++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:o=t.numericCompaction(e,o,n);break;case t.ECI_CHARSET:W.getCharacterSetECIByValue(e[o++]);break;case t.ECI_GENERAL_PURPOSE:o+=2;break;case t.ECI_USER_DEFINED:o++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=t.decodeMacroBlock(e,o,u);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new H;default:o--;o=t.textCompaction(e,o,n);break}if(o<e.length){a=e[o++]}else{throw H.getFormatInstance()}}if(n.length()===0){throw H.getFormatInstance()}var s=new wt(null,n.toString(),null,r);s.setOther(u);return s};t.decodeMacroBlock=function(e,r,n){if(r+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0]){throw H.getFormatInstance()}var i=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS);for(var o=0;o<t.NUMBER_OF_SEQUENCE_CODEWORDS;o++,r++){i[o]=e[r]}n.setSegmentIndex(F.parseInt(t.decodeBase900toBase10(i,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new K;r=t.textCompaction(e,r,a);n.setFileId(a.toString());var u=-1;if(e[r]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD){u=r+1}while(r<e[0]){switch(e[r]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:r++;switch(e[r]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var s=new K;r=t.textCompaction(e,r+1,s);n.setFileName(s.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var f=new K;r=t.textCompaction(e,r+1,f);n.setSender(f.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var c=new K;r=t.textCompaction(e,r+1,c);n.setAddressee(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var l=new K;r=t.numericCompaction(e,r+1,l);n.setSegmentCount(F.parseInt(l.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var h=new K;r=t.numericCompaction(e,r+1,h);n.setTimestamp(Yn.parseLong(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var d=new K;r=t.numericCompaction(e,r+1,d);n.setChecksum(F.parseInt(d.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var v=new K;r=t.numericCompaction(e,r+1,v);n.setFileSize(Yn.parseLong(v.toString()));break;default:throw H.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:r++;n.setLastSegment(true);break;default:throw H.getFormatInstance()}}if(u!==-1){var p=r-u;if(n.isLastSegment()){p--}n.setOptionalData(L.copyOfRange(e,u,u+p))}return r};t.textCompaction=function(e,r,n){var i=new Int32Array((e[0]-r)*2);var o=new Int32Array((e[0]-r)*2);var a=0;var u=false;while(r<e[0]&&!u){var s=e[r++];if(s<t.TEXT_COMPACTION_MODE_LATCH){i[a]=s/30;i[a+1]=s%30;a+=2}else{switch(s){case t.TEXT_COMPACTION_MODE_LATCH:i[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--;u=true;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE;s=e[r++];o[a]=s;a++;break}}}t.decodeTextCompaction(i,o,a,n);return r};t.decodeTextCompaction=function(e,r,n,i){var o=ei.ALPHA;var a=ei.ALPHA;var u=0;while(u<n){var s=e[u];var f="";switch(o){case ei.ALPHA:if(s<26){f=String.fromCharCode(65+s)}else{switch(s){case 26:f=" ";break;case t.LL:o=ei.LOWER;break;case t.ML:o=ei.MIXED;break;case t.PS:a=o;o=ei.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[u]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break;case ei.LOWER:if(s<26){f=String.fromCharCode(97+s)}else{switch(s){case 26:f=" ";break;case t.AS:a=o;o=ei.ALPHA_SHIFT;break;case t.ML:o=ei.MIXED;break;case t.PS:a=o;o=ei.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[u]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break;case ei.MIXED:if(s<t.PL){f=t.MIXED_CHARS[s]}else{switch(s){case t.PL:o=ei.PUNCT;break;case 26:f=" ";break;case t.LL:o=ei.LOWER;break;case t.AL:o=ei.ALPHA;break;case t.PS:a=o;o=ei.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[u]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break;case ei.PUNCT:if(s<t.PAL){f=t.PUNCT_CHARS[s]}else{switch(s){case t.PAL:o=ei.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[u]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break;case ei.ALPHA_SHIFT:o=a;if(s<26){f=String.fromCharCode(65+s)}else{switch(s){case 26:f=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break;case ei.PUNCT_SHIFT:o=a;if(s<t.PAL){f=t.PUNCT_CHARS[s]}else{switch(s){case t.PAL:o=ei.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:i.append(r[u]);break;case t.TEXT_COMPACTION_MODE_LATCH:o=ei.ALPHA;break}}break}if(f!==""){i.append(f)}u++}};t.byteCompaction=function(e,r,n,i,o){var a=new ti;var u=0;var s=0;var f=false;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:var c=new Int32Array(6);var l=r[i++];while(i<r[0]&&!f){c[u++]=l;s=900*s+l;l=r[i++];switch(l){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:i--;f=true;break;default:if(u%5===0&&u>0){for(var h=0;h<6;++h){a.write(Number(ii(s)>>ii(8*(5-h))))}s=0;u=0}break}}if(i===r[0]&&l<t.TEXT_COMPACTION_MODE_LATCH){c[u++]=l}for(var d=0;d<u;d++){a.write(c[d])}break;case t.BYTE_COMPACTION_MODE_LATCH_6:while(i<r[0]&&!f){var v=r[i++];if(v<t.TEXT_COMPACTION_MODE_LATCH){u++;s=900*s+v}else{switch(v){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:i--;f=true;break}}if(u%5===0&&u>0){for(var h=0;h<6;++h){a.write(Number(ii(s)>>ii(8*(5-h))))}s=0;u=0}}break}o.append(Y.decode(a.toByteArray(),n));return i};t.numericCompaction=function(e,r,n){var i=0;var o=false;var a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);while(r<e[0]&&!o){var u=e[r++];if(r===e[0]){o=true}if(u<t.TEXT_COMPACTION_MODE_LATCH){a[i]=u;i++}else{switch(u){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:r--;o=true;break}}if((i%t.MAX_NUMERIC_CODEWORDS===0||u===t.NUMERIC_COMPACTION_MODE_LATCH||o)&&i>0){n.append(t.decodeBase900toBase10(a,i));i=0}}return r};t.decodeBase900toBase10=function(e,r){var n=ii(0);for(var i=0;i<r;i++){n+=t.EXP900[r-i-1]*ii(e[i])}var o=n.toString();if(o.charAt(0)!=="1"){throw new H}return o.substring(1)};t.TEXT_COMPACTION_MODE_LATCH=900;t.BYTE_COMPACTION_MODE_LATCH=901;t.NUMERIC_COMPACTION_MODE_LATCH=902;t.BYTE_COMPACTION_MODE_LATCH_6=924;t.ECI_USER_DEFINED=925;t.ECI_GENERAL_PURPOSE=926;t.ECI_CHARSET=927;t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928;t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923;t.MACRO_PDF417_TERMINATOR=922;t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913;t.MAX_NUMERIC_CODEWORDS=15;t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0;t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1;t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2;t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3;t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4;t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5;t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6;t.PL=25;t.LL=27;t.AS=27;t.ML=28;t.AL=28;t.PS=29;t.PAL=29;t.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'";t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^";t.EXP900=ri()?oi():[];t.NUMBER_OF_SEQUENCE_CODEWORDS=2;return t}();var ui=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var si=function(){function t(){}t.decode=function(e,r,n,i,o,a,u){var s=new Dn(e,r,n,i,o);var f=null;var c=null;var l;for(var h=true;;h=false){if(r!=null){f=t.getRowIndicatorColumn(e,s,r,true,a,u)}if(i!=null){c=t.getRowIndicatorColumn(e,s,i,false,a,u)}l=t.merge(f,c);if(l==null){throw J.getNotFoundInstance()}var d=l.getBoundingBox();if(h&&d!=null&&(d.getMinY()<s.getMinY()||d.getMaxY()>s.getMaxY())){s=d}else{break}}l.setBoundingBox(s);var v=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,f);l.setDetectionResultColumn(v,c);var p=f!=null;for(var g=1;g<=v;g++){var y=p?g:v-g;if(l.getDetectionResultColumn(y)!==undefined){continue}var w=void 0;if(y===0||y===v){w=new Hn(s,y===0)}else{w=new Ln(s)}l.setDetectionResultColumn(y,w);var _=-1;var A=_;for(var m=s.getMinY();m<=s.getMaxY();m++){_=t.getStartColumn(l,y,m,p);if(_<0||_>s.getMaxX()){if(A===-1){continue}_=A}var E=t.detectCodeword(e,s.getMinX(),s.getMaxX(),p,_,m,a,u);if(E!=null){w.setCodeword(m,E);A=_;a=Math.min(a,E.getWidth());u=Math.max(u,E.getWidth())}}}return t.createDecoderResult(l)};t.merge=function(e,r){if(e==null&&r==null){return null}var n=t.getBarcodeMetadata(e,r);if(n==null){return null}var i=Dn.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new Xn(n,i)};t.adjustBoundingBox=function(e){var r,n;if(e==null){return null}var i=e.getRowHeights();if(i==null){return null}var o=t.getMax(i);var a=0;try{for(var u=ui(i),s=u.next();!s.done;s=u.next()){var f=s.value;a+=o-f;if(f>0){break}}}catch(t){r={error:t}}finally{try{if(s&&!s.done&&(n=u.return))n.call(u)}finally{if(r)throw r.error}}var c=e.getCodewords();for(var l=0;a>0&&c[l]==null;l++){a--}var h=0;for(var l=i.length-1;l>=0;l--){h+=o-i[l];if(i[l]>0){break}}for(var l=c.length-1;h>0&&c[l]==null;l--){h--}return e.getBoundingBox().addMissingRows(a,h,e.isLeft())};t.getMax=function(t){var e,r;var n=-1;try{for(var i=ui(t),o=i.next();!o.done;o=i.next()){var a=o.value;n=Math.max(n,a)}}catch(t){e={error:t}}finally{try{if(o&&!o.done&&(r=i.return))r.call(i)}finally{if(e)throw e.error}}return n};t.getBarcodeMetadata=function(t,e){var r;if(t==null||(r=t.getBarcodeMetadata())==null){return e==null?null:e.getBarcodeMetadata()}var n;if(e==null||(n=e.getBarcodeMetadata())==null){return r}if(r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()){return null}return r};t.getRowIndicatorColumn=function(e,r,n,i,o,a){var u=new Hn(r,i);for(var s=0;s<2;s++){var f=s===0?1:-1;var c=Math.trunc(Math.trunc(n.getX()));for(var l=Math.trunc(Math.trunc(n.getY()));l<=r.getMaxY()&&l>=r.getMinY();l+=f){var h=t.detectCodeword(e,0,e.getWidth(),i,c,l,o,a);if(h!=null){u.setCodeword(l,h);if(i){c=h.getStartX()}else{c=h.getEndX()}}}}return u};t.adjustCodewordCount=function(e,r){var n=r[0][1];var i=n.getValue();var o=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(i.length===0){if(o<1||o>An.MAX_CODEWORDS_IN_BARCODE){throw J.getNotFoundInstance()}n.setValue(o)}else if(i[0]!==o){n.setValue(o)}};t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);var n=new Array;var i=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount());var o=[];var a=new Array;for(var u=0;u<e.getBarcodeRowCount();u++){for(var s=0;s<e.getBarcodeColumnCount();s++){var f=r[u][s+1].getValue();var c=u*e.getBarcodeColumnCount()+s;if(f.length===0){n.push(c)}else if(f.length===1){i[c]=f[0]}else{a.push(c);o.push(f)}}}var l=new Array(o.length);for(var h=0;h<l.length;h++){l[h]=o[h]}return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),i,An.toIntArray(n),An.toIntArray(a),l)};t.createDecoderResultFromAmbiguousValues=function(e,r,n,i,o){var a=new Int32Array(i.length);var u=100;while(u-- >0){for(var s=0;s<a.length;s++){r[i[s]]=o[s][a[s]]}try{return t.decodeCodewords(r,e,n)}catch(t){var f=t instanceof T;if(!f){throw t}}if(a.length===0){throw T.getChecksumInstance()}for(var s=0;s<a.length;s++){if(a[s]<o[s].length-1){a[s]++;break}else{a[s]=0;if(s===a.length-1){throw T.getChecksumInstance()}}}}throw T.getChecksumInstance()};t.createBarcodeMatrix=function(t){var e,r,n,i;var o=Array.from({length:t.getBarcodeRowCount()},function(){return new Array(t.getBarcodeColumnCount()+2)});for(var a=0;a<o.length;a++){for(var u=0;u<o[a].length;u++){o[a][u]=new kn}}var s=0;try{for(var f=ui(t.getDetectionResultColumns()),c=f.next();!c.done;c=f.next()){var l=c.value;if(l!=null){try{for(var h=(n=void 0,ui(l.getCodewords())),d=h.next();!d.done;d=h.next()){var v=d.value;if(v!=null){var p=v.getRowNumber();if(p>=0){if(p>=o.length){continue}o[p][s].setValue(v.getValue())}}}}catch(t){n={error:t}}finally{try{if(d&&!d.done&&(i=h.return))i.call(h)}finally{if(n)throw n.error}}}s++}}catch(t){e={error:t}}finally{try{if(c&&!c.done&&(r=f.return))r.call(f)}finally{if(e)throw e.error}}return o};t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1};t.getStartColumn=function(e,r,n,i){var o,a;var u=i?1:-1;var s=null;if(t.isValidBarcodeColumn(e,r-u)){s=e.getDetectionResultColumn(r-u).getCodeword(n)}if(s!=null){return i?s.getEndX():s.getStartX()}s=e.getDetectionResultColumn(r).getCodewordNearby(n);if(s!=null){return i?s.getStartX():s.getEndX()}if(t.isValidBarcodeColumn(e,r-u)){s=e.getDetectionResultColumn(r-u).getCodewordNearby(n)}if(s!=null){return i?s.getEndX():s.getStartX()}var f=0;while(t.isValidBarcodeColumn(e,r-u)){r-=u;try{for(var c=(o=void 0,ui(e.getDetectionResultColumn(r).getCodewords())),l=c.next();!l.done;l=c.next()){var h=l.value;if(h!=null){return(i?h.getEndX():h.getStartX())+u*f*(h.getEndX()-h.getStartX())}}}catch(t){o={error:t}}finally{try{if(l&&!l.done&&(a=c.return))a.call(c)}finally{if(o)throw o.error}}f++}return i?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()};t.detectCodeword=function(e,r,n,i,o,a,u,s){o=t.adjustCodewordStartColumn(e,r,n,i,o,a);var f=t.getModuleBitCount(e,r,n,i,o,a);if(f==null){return null}var c;var l=Pt.sum(f);if(i){c=o+l}else{for(var h=0;h<f.length/2;h++){var d=f[h];f[h]=f[f.length-1-h];f[f.length-1-h]=d}c=o;o=c-l}if(!t.checkCodewordSkew(l,u,s)){return null}var v=jn.getDecodedValue(f);var p=An.getCodeword(v);if(p===-1){return null}return new Wn(o,c,t.getCodewordBucketNumber(v),p)};t.getModuleBitCount=function(t,e,r,n,i,o){var a=i;var u=new Int32Array(8);var s=0;var f=n?1:-1;var c=n;while((n?a<r:a>=e)&&s<u.length){if(t.get(a,o)===c){u[s]++;a+=f}else{s++;c=!c}}if(s===u.length||a===(n?r:e)&&s===u.length-1){return u}return null};t.getNumberOfECCodeWords=function(t){return 2<<t};t.adjustCodewordStartColumn=function(e,r,n,i,o,a){var u=o;var s=i?-1:1;for(var f=0;f<2;f++){while((i?u>=r:u<n)&&i===e.get(u,a)){if(Math.abs(o-u)>t.CODEWORD_SKEW_SIZE){return o}u+=s}s=-s;i=!i}return u};t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE};t.decodeCodewords=function(e,r,n){if(e.length===0){throw H.getFormatInstance()}var i=1<<r+1;var o=t.correctErrors(e,n,i);t.verifyCodewordCount(e,i);var a=ai.decode(e,""+r);a.setErrorsCorrected(o);a.setErasures(n.length);return a};t.correctErrors=function(e,r,n){if(r!=null&&r.length>n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS){throw T.getChecksumInstance()}return t.errorCorrection.decode(e,n,r)};t.verifyCodewordCount=function(t,e){if(t.length<4){throw H.getFormatInstance()}var r=t[0];if(r>t.length){throw H.getFormatInstance()}if(r===0){if(e<t.length){t[0]=t.length-e}else{throw H.getFormatInstance()}}};t.getBitCountForCodeword=function(t){var e=new Int32Array(8);var r=0;var n=e.length-1;while(true){if((t&1)!==r){r=t&1;n--;if(n<0){break}}e[n]++;t>>=1}return e};t.getCodewordBucketNumber=function(t){if(t instanceof Int32Array){return this.getCodewordBucketNumber_Int32Array(t)}return this.getCodewordBucketNumber_number(t)};t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))};t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9};t.toString=function(t){var e=new Mn;for(var r=0;r<t.length;r++){e.format("Row %2d: ",r);for(var n=0;n<t[r].length;n++){var i=t[r][n];if(i.getValue().length===0){e.format("        ",null)}else{e.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}}e.format("%n")}return e.toString()};t.CODEWORD_SKEW_SIZE=2;t.MAX_ERRORS=3;t.MAX_EC_CODEWORDS=512;t.errorCorrection=new Nn;return t}();var fi=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var ci=function(){function t(){}t.prototype.decode=function(e,r){if(r===void 0){r=null}var n=t.decode(e,r,false);if(n==null||n.length===0||n[0]==null){throw J.getNotFoundInstance()}return n[0]};t.prototype.decodeMultiple=function(e,r){if(r===void 0){r=null}try{return t.decode(e,r,true)}catch(t){if(t instanceof H||t instanceof T){throw J.getNotFoundInstance()}throw t}};t.decode=function(e,r,n){var i,o;var a=new Array;var u=Cn.detectMultiple(e,r,n);try{for(var s=fi(u.getPoints()),f=s.next();!f.done;f=s.next()){var c=f.value;var l=si.decode(u.getBits(),c[4],c[5],c[6],c[7],t.getMinCodewordWidth(c),t.getMaxCodewordWidth(c));var h=new dt(l.getText(),l.getRawBytes(),undefined,c,pt.PDF_417);h.putMetadata(yt.ERROR_CORRECTION_LEVEL,l.getECLevel());var d=l.getOther();if(d!=null){h.putMetadata(yt.PDF417_EXTRA_METADATA,d)}a.push(h)}}catch(t){i={error:t}}finally{try{if(f&&!f.done&&(o=s.return))o.call(s)}finally{if(i)throw i.error}}return a.map(function(t){return t})};t.getMaxWidth=function(t,e){if(t==null||e==null){return 0}return Math.trunc(Math.abs(t.getX()-e.getX()))};t.getMinWidth=function(t,e){if(t==null||e==null){return F.MAX_VALUE}return Math.trunc(Math.abs(t.getX()-e.getX()))};t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*An.MODULES_IN_CODEWORD/An.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*An.MODULES_IN_CODEWORD/An.MODULES_IN_STOP_PATTERN)))};t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*An.MODULES_IN_CODEWORD/An.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*An.MODULES_IN_CODEWORD/An.MODULES_IN_STOP_PATTERN)))};t.prototype.reset=function(){};return t}();var li=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var hi=function(t){li(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="ReaderException";return e}(A);var di=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var vi=function(){function t(){}t.prototype.decode=function(t,e){this.setHints(e);return this.decodeInternal(t)};t.prototype.decodeWithState=function(t){if(this.readers===null||this.readers===undefined){this.setHints(null)}return this.decodeInternal(t)};t.prototype.setHints=function(t){this.hints=t;var e=t!==null&&t!==undefined&&undefined!==t.get(V.TRY_HARDER);var r=t===null||t===undefined?null:t.get(V.POSSIBLE_FORMATS);var n=new Array;if(r!==null&&r!==undefined){var i=r.some(function(t){return t===pt.UPC_A||t===pt.UPC_E||t===pt.EAN_13||t===pt.EAN_8||t===pt.CODABAR||t===pt.CODE_39||t===pt.CODE_93||t===pt.CODE_128||t===pt.ITF||t===pt.RSS_14||t===pt.RSS_EXPANDED});if(i&&!e){n.push(new Ir(t))}if(r.includes(pt.QR_CODE)){n.push(new wn)}if(r.includes(pt.DATA_MATRIX)){n.push(new Vr)}if(r.includes(pt.AZTEC)){n.push(new zt)}if(r.includes(pt.PDF_417)){n.push(new ci)}if(i&&e){n.push(new Ir(t))}}if(n.length===0){if(!e){n.push(new Ir(t))}n.push(new wn);n.push(new Vr);n.push(new zt);n.push(new ci);if(e){n.push(new Ir(t))}}this.readers=n};t.prototype.reset=function(){var t,e;if(this.readers!==null){try{for(var r=di(this.readers),n=r.next();!n.done;n=r.next()){var i=n.value;i.reset()}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}}};t.prototype.decodeInternal=function(t){var e,r;if(this.readers===null){throw new hi("No readers where selected, nothing can be read.")}try{for(var n=di(this.readers),i=n.next();!i.done;i=n.next()){var o=i.value;try{return o.decode(t,this.hints)}catch(t){if(t instanceof hi){continue}}}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}throw new J("No MultiFormat Readers were able to detect the code.")};return t}();var pi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var gi=function(t){pi(e,t);function e(e,r){if(e===void 0){e=null}if(r===void 0){r=500}var n=this;var i=new vi;i.setHints(e);n=t.call(this,i,r)||this;return n}e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)};return e}(ht);var yi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){yi(e,t);function e(e){if(e===void 0){e=500}return t.call(this,new ci,e)||this}return e})(ht);var wi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){wi(e,t);function e(e){if(e===void 0){e=500}return t.call(this,new wn,e)||this}return e})(ht);var _i;(function(t){t[t["ERROR_CORRECTION"]=0]="ERROR_CORRECTION";t[t["CHARACTER_SET"]=1]="CHARACTER_SET";t[t["DATA_MATRIX_SHAPE"]=2]="DATA_MATRIX_SHAPE";t[t["MIN_SIZE"]=3]="MIN_SIZE";t[t["MAX_SIZE"]=4]="MAX_SIZE";t[t["MARGIN"]=5]="MARGIN";t[t["PDF417_COMPACT"]=6]="PDF417_COMPACT";t[t["PDF417_COMPACTION"]=7]="PDF417_COMPACTION";t[t["PDF417_DIMENSIONS"]=8]="PDF417_DIMENSIONS";t[t["AZTEC_LAYERS"]=9]="AZTEC_LAYERS";t[t["QR_VERSION"]=10]="QR_VERSION"})(_i||(_i={}));var Ai=_i;var mi=function(){function t(t){this.field=t;this.cachedGenerators=[];this.cachedGenerators.push(new At(t,Int32Array.from([1])))}t.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length){var r=e[e.length-1];var n=this.field;for(var i=e.length;i<=t;i++){var o=r.multiply(new At(n,Int32Array.from([1,n.exp(i-1+n.getGeneratorBase())])));e.push(o);r=o}}return e[t]};t.prototype.encode=function(t,e){if(e===0){throw new I("No error correction bytes")}var r=t.length-e;if(r<=0){throw new I("No data bytes provided")}var n=this.buildGenerator(e);var i=new Int32Array(r);R.arraycopy(t,0,i,0,r);var o=new At(this.field,i);o=o.multiplyByMonomial(e,1);var a=o.divide(n)[1];var u=a.getCoefficients();var s=e-u.length;for(var f=0;f<s;f++){t[r+f]=0}R.arraycopy(u,0,t,r+s,u.length)};return t}();var Ei=function(){function t(){}t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,true)+t.applyMaskPenaltyRule1Internal(e,false)};t.applyMaskPenaltyRule2=function(e){var r=0;var n=e.getArray();var i=e.getWidth();var o=e.getHeight();for(var a=0;a<o-1;a++){var u=n[a];for(var s=0;s<i-1;s++){var f=u[s];if(f===u[s+1]&&f===n[a+1][s]&&f===n[a+1][s+1]){r++}}}return t.N2*r};t.applyMaskPenaltyRule3=function(e){var r=0;var n=e.getArray();var i=e.getWidth();var o=e.getHeight();for(var a=0;a<o;a++){for(var u=0;u<i;u++){var s=n[a];if(u+6<i&&s[u]===1&&s[u+1]===0&&s[u+2]===1&&s[u+3]===1&&s[u+4]===1&&s[u+5]===0&&s[u+6]===1&&(t.isWhiteHorizontal(s,u-4,u)||t.isWhiteHorizontal(s,u+7,u+11))){r++}if(a+6<o&&n[a][u]===1&&n[a+1][u]===0&&n[a+2][u]===1&&n[a+3][u]===1&&n[a+4][u]===1&&n[a+5][u]===0&&n[a+6][u]===1&&(t.isWhiteVertical(n,u,a-4,a)||t.isWhiteVertical(n,u,a+7,a+11))){r++}}}return r*t.N3};t.isWhiteHorizontal=function(t,e,r){e=Math.max(e,0);r=Math.min(r,t.length);for(var n=e;n<r;n++){if(t[n]===1){return false}}return true};t.isWhiteVertical=function(t,e,r,n){r=Math.max(r,0);n=Math.min(n,t.length);for(var i=r;i<n;i++){if(t[i][e]===1){return false}}return true};t.applyMaskPenaltyRule4=function(e){var r=0;var n=e.getArray();var i=e.getWidth();var o=e.getHeight();for(var a=0;a<o;a++){var u=n[a];for(var s=0;s<i;s++){if(u[s]===1){r++}}}var f=e.getHeight()*e.getWidth();var c=Math.floor(Math.abs(r*2-f)*10/f);return c*t.N4};t.getDataMaskBit=function(t,e,r){var n;var i;switch(t){case 0:n=r+e&1;break;case 1:n=r&1;break;case 2:n=e%3;break;case 3:n=(r+e)%3;break;case 4:n=Math.floor(r/2)+Math.floor(e/3)&1;break;case 5:i=r*e;n=(i&1)+i%3;break;case 6:i=r*e;n=(i&1)+i%3&1;break;case 7:i=r*e;n=i%3+(r+e&1)&1;break;default:throw new I("Invalid mask pattern: "+t)}return n===0};t.applyMaskPenaltyRule1Internal=function(e,r){var n=0;var i=r?e.getHeight():e.getWidth();var o=r?e.getWidth():e.getHeight();var a=e.getArray();for(var u=0;u<i;u++){var s=0;var f=-1;for(var c=0;c<o;c++){var l=r?a[u][c]:a[c][u];if(l===f){s++}else{if(s>=5){n+=t.N1+(s-5)}s=1;f=l}}if(s>=5){n+=t.N1+(s-5)}}return n};t.N1=3;t.N2=3;t.N3=40;t.N4=10;return t}();var Ci=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var Ii=function(){function t(t,e){this.width=t;this.height=e;var r=new Array(e);for(var n=0;n!==e;n++){r[n]=new Uint8Array(t)}this.bytes=r}t.prototype.getHeight=function(){return this.height};t.prototype.getWidth=function(){return this.width};t.prototype.get=function(t,e){return this.bytes[e][t]};t.prototype.getArray=function(){return this.bytes};t.prototype.setNumber=function(t,e,r){this.bytes[e][t]=r};t.prototype.setBoolean=function(t,e,r){this.bytes[e][t]=r?1:0};t.prototype.clear=function(t){var e,r;try{for(var n=Ci(this.bytes),i=n.next();!i.done;i=n.next()){var o=i.value;L.fill(o,t)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}};t.prototype.equals=function(e){if(!(e instanceof t)){return false}var r=e;if(this.width!==r.width){return false}if(this.height!==r.height){return false}for(var n=0,i=this.height;n<i;++n){var o=this.bytes[n];var a=r.bytes[n];for(var u=0,s=this.width;u<s;++u){if(o[u]!==a[u]){return false}}}return true};t.prototype.toString=function(){var t=new K;for(var e=0,r=this.height;e<r;++e){var n=this.bytes[e];for(var i=0,o=this.width;i<o;++i){switch(n[i]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append("  ");break}}t.append("\n")}return t.toString()};return t}();var Si=function(){function t(){this.maskPattern=-1}t.prototype.getMode=function(){return this.mode};t.prototype.getECLevel=function(){return this.ecLevel};t.prototype.getVersion=function(){return this.version};t.prototype.getMaskPattern=function(){return this.maskPattern};t.prototype.getMatrix=function(){return this.matrix};t.prototype.toString=function(){var t=new K;t.append("<<\n");t.append(" mode: ");t.append(this.mode?this.mode.toString():"null");t.append("\n ecLevel: ");t.append(this.ecLevel?this.ecLevel.toString():"null");t.append("\n version: ");t.append(this.version?this.version.toString():"null");t.append("\n maskPattern: ");t.append(this.maskPattern.toString());if(this.matrix){t.append("\n matrix:\n");t.append(this.matrix.toString())}else{t.append("\n matrix: null\n")}t.append(">>\n");return t.toString()};t.prototype.setMode=function(t){this.mode=t};t.prototype.setECLevel=function(t){this.ecLevel=t};t.prototype.setVersion=function(t){this.version=t};t.prototype.setMaskPattern=function(t){this.maskPattern=t};t.prototype.setMatrix=function(t){this.matrix=t};t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS};t.NUM_MASK_PATTERNS=8;return t}();var Oi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Ti=function(t){Oi(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.kind="WriterException";return e}(A);var bi=function(){function t(){}t.clearMatrix=function(t){t.clear(255)};t.buildMatrix=function(e,r,n,i,o){t.clearMatrix(o);t.embedBasicPatterns(n,o);t.embedTypeInfo(r,i,o);t.maybeEmbedVersionInfo(n,o);t.embedDataBits(e,i,o)};t.embedBasicPatterns=function(e,r){t.embedPositionDetectionPatternsAndSeparators(r);t.embedDarkDotAtLeftBottomCorner(r);t.maybeEmbedPositionAdjustmentPatterns(e,r);t.embedTimingPatterns(r)};t.embedTypeInfo=function(e,r,n){var i=new x;t.makeTypeInfoBits(e,r,i);for(var o=0,a=i.getSize();o<a;++o){var u=i.get(i.getSize()-1-o);var s=t.TYPE_INFO_COORDINATES[o];var f=s[0];var c=s[1];n.setBoolean(f,c,u);if(o<8){var l=n.getWidth()-o-1;var h=8;n.setBoolean(l,h,u)}else{var l=8;var h=n.getHeight()-7+(o-8);n.setBoolean(l,h,u)}}};t.maybeEmbedVersionInfo=function(e,r){if(e.getVersionNumber()<7){return}var n=new x;t.makeVersionInfoBits(e,n);var i=6*3-1;for(var o=0;o<6;++o){for(var a=0;a<3;++a){var u=n.get(i);i--;r.setBoolean(o,r.getHeight()-11+a,u);r.setBoolean(r.getHeight()-11+a,o,u)}}};t.embedDataBits=function(e,r,n){var i=0;var o=-1;var a=n.getWidth()-1;var u=n.getHeight()-1;while(a>0){if(a===6){a-=1}while(u>=0&&u<n.getHeight()){for(var s=0;s<2;++s){var f=a-s;if(!t.isEmpty(n.get(f,u))){continue}var c=void 0;if(i<e.getSize()){c=e.get(i);++i}else{c=false}if(r!==255&&Ei.getDataMaskBit(r,f,u)){c=!c}n.setBoolean(f,u,c)}u+=o}o=-o;u+=o;a-=2}if(i!==e.getSize()){throw new Ti("Not all bits consumed: "+i+"/"+e.getSize())}};t.findMSBSet=function(t){return 32-F.numberOfLeadingZeros(t)};t.calculateBCHCode=function(e,r){if(r===0){throw new I("0 polynomial")}var n=t.findMSBSet(r);e<<=n-1;while(t.findMSBSet(e)>=n){e^=r<<t.findMSBSet(e)-n}return e};t.makeTypeInfoBits=function(e,r,n){if(!Si.isValidMaskPattern(r)){throw new Ti("Invalid mask pattern")}var i=e.getBits()<<3|r;n.appendBits(i,5);var o=t.calculateBCHCode(i,t.TYPE_INFO_POLY);n.appendBits(o,10);var a=new x;a.appendBits(t.TYPE_INFO_MASK_PATTERN,15);n.xor(a);if(n.getSize()!==15){throw new Ti("should not happen but we got: "+n.getSize())}};t.makeVersionInfoBits=function(e,r){r.appendBits(e.getVersionNumber(),6);var n=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);r.appendBits(n,12);if(r.getSize()!==18){throw new Ti("should not happen but we got: "+r.getSize())}};t.isEmpty=function(t){return t===255};t.embedTimingPatterns=function(e){for(var r=8;r<e.getWidth()-8;++r){var n=(r+1)%2;if(t.isEmpty(e.get(r,6))){e.setNumber(r,6,n)}if(t.isEmpty(e.get(6,r))){e.setNumber(6,r,n)}}};t.embedDarkDotAtLeftBottomCorner=function(t){if(t.get(8,t.getHeight()-8)===0){throw new Ti}t.setNumber(8,t.getHeight()-8,1)};t.embedHorizontalSeparationPattern=function(e,r,n){for(var i=0;i<8;++i){if(!t.isEmpty(n.get(e+i,r))){throw new Ti}n.setNumber(e+i,r,0)}};t.embedVerticalSeparationPattern=function(e,r,n){for(var i=0;i<7;++i){if(!t.isEmpty(n.get(e,r+i))){throw new Ti}n.setNumber(e,r+i,0)}};t.embedPositionAdjustmentPattern=function(e,r,n){for(var i=0;i<5;++i){var o=t.POSITION_ADJUSTMENT_PATTERN[i];for(var a=0;a<5;++a){n.setNumber(e+a,r+i,o[a])}}};t.embedPositionDetectionPattern=function(e,r,n){for(var i=0;i<7;++i){var o=t.POSITION_DETECTION_PATTERN[i];for(var a=0;a<7;++a){n.setNumber(e+a,r+i,o[a])}}};t.embedPositionDetectionPatternsAndSeparators=function(e){var r=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e);t.embedPositionDetectionPattern(e.getWidth()-r,0,e);t.embedPositionDetectionPattern(0,e.getWidth()-r,e);var n=8;t.embedHorizontalSeparationPattern(0,n-1,e);t.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e);t.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);var i=7;t.embedVerticalSeparationPattern(i,0,e);t.embedVerticalSeparationPattern(e.getHeight()-i-1,0,e);t.embedVerticalSeparationPattern(i,e.getHeight()-i,e)};t.maybeEmbedPositionAdjustmentPatterns=function(e,r){if(e.getVersionNumber()<2){return}var n=e.getVersionNumber()-1;var i=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(var o=0,a=i.length;o!==a;o++){var u=i[o];if(u>=0){for(var s=0;s!==a;s++){var f=i[s];if(f>=0&&t.isEmpty(r.get(f,u))){t.embedPositionAdjustmentPattern(f-2,u-2,r)}}}}};t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]);t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]);t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]);t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]);t.VERSION_INFO_POLY=7973;t.TYPE_INFO_POLY=1335;t.TYPE_INFO_MASK_PATTERN=21522;return t}();var Ri=function(){function t(t,e){this.dataBytes=t;this.errorCorrectionBytes=e}t.prototype.getDataBytes=function(){return this.dataBytes};t.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes};return t}();var Ni=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function t(){}t.calculateMaskPenalty=function(t){return Ei.applyMaskPenaltyRule1(t)+Ei.applyMaskPenaltyRule2(t)+Ei.applyMaskPenaltyRule3(t)+Ei.applyMaskPenaltyRule4(t)};t.encode=function(e,r,n){if(n===void 0){n=null}var i=t.DEFAULT_BYTE_MODE_ENCODING;var o=n!==null&&undefined!==n.get(Ai.CHARACTER_SET);if(o){i=n.get(Ai.CHARACTER_SET).toString()}var a=this.chooseMode(e,i);var u=new x;if(a===rn.BYTE&&(o||t.DEFAULT_BYTE_MODE_ENCODING!==i)){var s=W.getCharacterSetECIByName(i);if(s!==undefined){this.appendECI(s,u)}}this.appendModeInfo(a,u);var f=new x;this.appendBytes(e,a,f,i);var c;if(n!==null&&undefined!==n.get(Ai.QR_VERSION)){var l=Number.parseInt(n.get(Ai.QR_VERSION).toString(),10);c=Kr.getVersionForNumber(l);var h=this.calculateBitsNeeded(a,u,f,c);if(!this.willFit(h,c,r)){throw new Ti("Data too big for requested version")}}else{c=this.recommendVersion(r,a,u,f)}var d=new x;d.appendBitArray(u);var v=a===rn.BYTE?f.getSizeInBytes():e.length;this.appendLengthInfo(v,c,a,d);d.appendBitArray(f);var p=c.getECBlocksForLevel(r);var g=c.getTotalCodewords()-p.getTotalECCodewords();this.terminateBits(g,d);var y=this.interleaveWithECBytes(d,c.getTotalCodewords(),g,p.getNumBlocks());var w=new Si;w.setECLevel(r);w.setMode(a);w.setVersion(c);var _=c.getDimensionForVersion();var A=new Ii(_,_);var m=this.chooseMaskPattern(y,r,c,A);w.setMaskPattern(m);bi.buildMatrix(y,r,c,m,A);w.setMatrix(A);return w};t.recommendVersion=function(t,e,r,n){var i=this.calculateBitsNeeded(e,r,n,Kr.getVersionForNumber(1));var o=this.chooseVersion(i,t);var a=this.calculateBitsNeeded(e,r,n,o);return this.chooseVersion(a,t)};t.calculateBitsNeeded=function(t,e,r,n){return e.getSize()+t.getCharacterCountBits(n)+r.getSize()};t.getAlphanumericCode=function(e){if(e<t.ALPHANUMERIC_TABLE.length){return t.ALPHANUMERIC_TABLE[e]}return-1};t.chooseMode=function(e,r){if(r===void 0){r=null}if(W.SJIS.getName()===r&&this.isOnlyDoubleByteKanji(e)){return rn.KANJI}var n=false;var i=false;for(var o=0,a=e.length;o<a;++o){var u=e.charAt(o);if(t.isDigit(u)){n=true}else if(this.getAlphanumericCode(u.charCodeAt(0))!==-1){i=true}else{return rn.BYTE}}if(i){return rn.ALPHANUMERIC}if(n){return rn.NUMERIC}return rn.BYTE};t.isOnlyDoubleByteKanji=function(t){var e;try{e=Y.encode(t,W.SJIS)}catch(t){return false}var r=e.length;if(r%2!==0){return false}for(var n=0;n<r;n+=2){var i=e[n]&255;if((i<129||i>159)&&(i<224||i>235)){return false}}return true};t.chooseMaskPattern=function(t,e,r,n){var i=Number.MAX_SAFE_INTEGER;var o=-1;for(var a=0;a<Si.NUM_MASK_PATTERNS;a++){bi.buildMatrix(t,e,r,a,n);var u=this.calculateMaskPenalty(n);if(u<i){i=u;o=a}}return o};t.chooseVersion=function(e,r){for(var n=1;n<=40;n++){var i=Kr.getVersionForNumber(n);if(t.willFit(e,i,r)){return i}}throw new Ti("Data too big")};t.willFit=function(t,e,r){var n=e.getTotalCodewords();var i=e.getECBlocksForLevel(r);var o=i.getTotalECCodewords();var a=n-o;var u=(t+7)/8;return a>=u};t.terminateBits=function(t,e){var r=t*8;if(e.getSize()>r){throw new Ti("data bits cannot fit in the QR Code"+e.getSize()+" > "+r)}for(var n=0;n<4&&e.getSize()<r;++n){e.appendBit(false)}var i=e.getSize()&7;if(i>0){for(var n=i;n<8;n++){e.appendBit(false)}}var o=t-e.getSizeInBytes();for(var n=0;n<o;++n){e.appendBits((n&1)===0?236:17,8)}if(e.getSize()!==r){throw new Ti("Bits size does not equal capacity")}};t.getNumDataBytesAndNumECBytesForBlockID=function(t,e,r,n,i,o){if(n>=r){throw new Ti("Block ID too large")}var a=t%r;var u=r-a;var s=Math.floor(t/r);var f=s+1;var c=Math.floor(e/r);var l=c+1;var h=s-c;var d=f-l;if(h!==d){throw new Ti("EC bytes mismatch")}if(r!==u+a){throw new Ti("RS blocks mismatch")}if(t!==(c+h)*u+(l+d)*a){throw new Ti("Total bytes mismatch")}if(n<u){i[0]=c;o[0]=h}else{i[0]=l;o[0]=d}};t.interleaveWithECBytes=function(e,r,n,i){var o,a,u,s;if(e.getSizeInBytes()!==n){throw new Ti("Number of bits and data bytes does not match")}var f=0;var c=0;var l=0;var h=new Array;for(var d=0;d<i;++d){var v=new Int32Array(1);var p=new Int32Array(1);t.getNumDataBytesAndNumECBytesForBlockID(r,n,i,d,v,p);var g=v[0];var y=new Uint8Array(g);e.toBytes(8*f,y,0,g);var w=t.generateECBytes(y,p[0]);h.push(new Ri(y,w));c=Math.max(c,g);l=Math.max(l,w.length);f+=v[0]}if(n!==f){throw new Ti("Data bytes does not match offset")}var _=new x;for(var d=0;d<c;++d){try{for(var A=(o=void 0,Ni(h)),m=A.next();!m.done;m=A.next()){var E=m.value;var y=E.getDataBytes();if(d<y.length){_.appendBits(y[d],8)}}}catch(t){o={error:t}}finally{try{if(m&&!m.done&&(a=A.return))a.call(A)}finally{if(o)throw o.error}}}for(var d=0;d<l;++d){try{for(var C=(u=void 0,Ni(h)),I=C.next();!I.done;I=C.next()){var E=I.value;var w=E.getErrorCorrectionBytes();if(d<w.length){_.appendBits(w[d],8)}}}catch(t){u={error:t}}finally{try{if(I&&!I.done&&(s=C.return))s.call(C)}finally{if(u)throw u.error}}}if(r!==_.getSizeInBytes()){throw new Ti("Interleaving error: "+r+" and "+_.getSizeInBytes()+" differ.")}return _};t.generateECBytes=function(t,e){var r=t.length;var n=new Int32Array(r+e);for(var i=0;i<r;i++){n[i]=t[i]&255}new mi(It.QR_CODE_FIELD_256).encode(n,e);var o=new Uint8Array(e);for(var i=0;i<e;i++){o[i]=n[r+i]}return o};t.appendModeInfo=function(t,e){e.appendBits(t.getBits(),4)};t.appendLengthInfo=function(t,e,r,n){var i=r.getCharacterCountBits(e);if(t>=1<<i){throw new Ti(t+" is bigger than "+((1<<i)-1))}n.appendBits(t,i)};t.appendBytes=function(e,r,n,i){switch(r){case rn.NUMERIC:t.appendNumericBytes(e,n);break;case rn.ALPHANUMERIC:t.appendAlphanumericBytes(e,n);break;case rn.BYTE:t.append8BitBytes(e,n,i);break;case rn.KANJI:t.appendKanjiBytes(e,n);break;default:throw new Ti("Invalid mode: "+r)}};t.getDigit=function(t){return t.charCodeAt(0)-48};t.isDigit=function(e){var r=t.getDigit(e);return r>=0&&r<=9};t.appendNumericBytes=function(e,r){var n=e.length;var i=0;while(i<n){var o=t.getDigit(e.charAt(i));if(i+2<n){var a=t.getDigit(e.charAt(i+1));var u=t.getDigit(e.charAt(i+2));r.appendBits(o*100+a*10+u,10);i+=3}else if(i+1<n){var a=t.getDigit(e.charAt(i+1));r.appendBits(o*10+a,7);i+=2}else{r.appendBits(o,4);i++}}};t.appendAlphanumericBytes=function(e,r){var n=e.length;var i=0;while(i<n){var o=t.getAlphanumericCode(e.charCodeAt(i));if(o===-1){throw new Ti}if(i+1<n){var a=t.getAlphanumericCode(e.charCodeAt(i+1));if(a===-1){throw new Ti}r.appendBits(o*45+a,11);i+=2}else{r.appendBits(o,6);i++}}};t.append8BitBytes=function(t,e,r){var n;try{n=Y.encode(t,r)}catch(t){throw new Ti(t)}for(var i=0,o=n.length;i!==o;i++){var a=n[i];e.appendBits(a,8)}};t.appendKanjiBytes=function(t,e){var r;try{r=Y.encode(t,W.SJIS)}catch(t){throw new Ti(t)}var n=r.length;for(var i=0;i<n;i+=2){var o=r[i]&255;var a=r[i+1]&255;var u=o<<8&4294967295|a;var s=-1;if(u>=33088&&u<=40956){s=u-33088}else if(u>=57408&&u<=60351){s=u-49472}if(s===-1){throw new Ti("Invalid byte sequence")}var f=(s>>8)*192+(s&255);e.appendBits(f,13)}};t.appendECI=function(t,e){e.appendBits(rn.ECI.getBits(),4);e.appendBits(t.getValue(),8)};t.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]);t.DEFAULT_BYTE_MODE_ENCODING=W.UTF8.getName();return t})();var Di=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Di(e,t);function e(e,r,n,i,o,a,u,s){var f=t.call(this,a,u)||this;f.yuvData=e;f.dataWidth=r;f.dataHeight=n;f.left=i;f.top=o;if(i+a>r||o+u>n){throw new I("Crop rectangle does not fit within image data.")}if(s){f.reverseHorizontal(a,u)}return f}e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight()){throw new I("Requested row is outside the image: "+t)}var r=this.getWidth();if(e===null||e===undefined||e.length<r){e=new Uint8ClampedArray(r)}var n=(t+this.top)*this.dataWidth+this.left;R.arraycopy(this.yuvData,n,e,0,r);return e};e.prototype.getMatrix=function(){var t=this.getWidth();var e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight){return this.yuvData}var r=t*e;var n=new Uint8ClampedArray(r);var i=this.top*this.dataWidth+this.left;if(t===this.dataWidth){R.arraycopy(this.yuvData,i,n,0,r);return n}for(var o=0;o<e;o++){var a=o*t;R.arraycopy(this.yuvData,i,n,a,t);i+=this.dataWidth}return n};e.prototype.isCropSupported=function(){return true};e.prototype.crop=function(t,r,n,i){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+r,n,i,false)};e.prototype.renderThumbnail=function(){var t=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR;var r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR;var n=new Int32Array(t*r);var i=this.yuvData;var o=this.top*this.dataWidth+this.left;for(var a=0;a<r;a++){var u=a*t;for(var s=0;s<t;s++){var f=i[o+s*e.THUMBNAIL_SCALE_FACTOR]&255;n[u+s]=4278190080|f*65793}o+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return n};e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR};e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR};e.prototype.reverseHorizontal=function(t,e){var r=this.yuvData;for(var n=0,i=this.top*this.dataWidth+this.left;n<e;n++,i+=this.dataWidth){var o=i+t/2;for(var a=i,u=i+t-1;a<o;a++,u--){var s=r[a];r[a]=r[u];r[u]=s}}};e.prototype.invert=function(){return new ot(this)};e.THUMBNAIL_SCALE_FACTOR=2;return e})(nt);var Pi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Pi(e,t);function e(e,r,n,i,o,a,u){var s=t.call(this,r,n)||this;s.dataWidth=i;s.dataHeight=o;s.left=a;s.top=u;if(e.BYTES_PER_ELEMENT===4){var f=r*n;var c=new Uint8ClampedArray(f);for(var l=0;l<f;l++){var h=e[l];var d=h>>16&255;var v=h>>7&510;var p=h&255;c[l]=(d+v+p)/4&255}s.luminances=c}else{s.luminances=e}if(undefined===i){s.dataWidth=r}if(undefined===o){s.dataHeight=n}if(undefined===a){s.left=0}if(undefined===u){s.top=0}if(s.left+r>s.dataWidth||s.top+n>s.dataHeight){throw new I("Crop rectangle does not fit within image data.")}return s}e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight()){throw new I("Requested row is outside the image: "+t)}var r=this.getWidth();if(e===null||e===undefined||e.length<r){e=new Uint8ClampedArray(r)}var n=(t+this.top)*this.dataWidth+this.left;R.arraycopy(this.luminances,n,e,0,r);return e};e.prototype.getMatrix=function(){var t=this.getWidth();var e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight){return this.luminances}var r=t*e;var n=new Uint8ClampedArray(r);var i=this.top*this.dataWidth+this.left;if(t===this.dataWidth){R.arraycopy(this.luminances,i,n,0,r);return n}for(var o=0;o<e;o++){var a=o*t;R.arraycopy(this.luminances,i,n,a,t);i+=this.dataWidth}return n};e.prototype.isCropSupported=function(){return true};e.prototype.crop=function(t,r,n,i){return new e(this.luminances,n,i,this.dataWidth,this.dataHeight,this.left+t,this.top+r)};e.prototype.invert=function(){return new ot(this)};return e})(nt);var Mi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){Mi(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.forName=function(t){return this.getCharacterSetECIByName(t)};return e})(W);var Bi=function(){function t(t){this.previous=t}t.prototype.getPrevious=function(){return this.previous};return t}();var Li=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var Fi=function(t){Li(e,t);function e(e,r,n){var i=t.call(this,e)||this;i.value=r;i.bitCount=n;return i}e.prototype.appendTo=function(t,e){t.appendBits(this.value,this.bitCount)};e.prototype.add=function(t,r){return new e(this,t,r)};e.prototype.addBinaryShift=function(t,r){console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token");return new e(this,t,r)};e.prototype.toString=function(){var t=this.value&(1<<this.bitCount)-1;t|=1<<this.bitCount;return"<"+F.toBinaryString(t|1<<this.bitCount).substring(1)+">"};return e}(Bi);var xi=undefined&&undefined.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(e.hasOwnProperty(r))t[r]=e[r]};return t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();(function(t){xi(e,t);function e(e,r,n){var i=t.call(this,e,0,0)||this;i.binaryShiftStart=r;i.binaryShiftByteCount=n;return i}e.prototype.appendTo=function(t,e){for(var r=0;r<this.binaryShiftByteCount;r++){if(r===0||r===31&&this.binaryShiftByteCount<=62){t.appendBits(31,5);if(this.binaryShiftByteCount>62){t.appendBits(this.binaryShiftByteCount-31,16)}else if(r===0){t.appendBits(Math.min(this.binaryShiftByteCount,31),5)}else{t.appendBits(this.binaryShiftByteCount-31,5)}}t.appendBits(e[this.binaryShiftStart+r],8)}};e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)};e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"};return e})(Fi);var ki=0;var Vi=1;var Ui=2;var Hi=3;var Gi=4;new Fi(null,0,0);var Xi=undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function Wi(t){var e,r;try{for(var n=Xi(t),i=n.next();!i.done;i=n.next()){var o=i.value;L.fill(o,-1)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}t[ki][Gi]=0;t[Vi][Gi]=0;t[Vi][ki]=28;t[Hi][Gi]=0;t[Ui][Gi]=0;t[Ui][ki]=15;return t}Wi(L.createInt32Array(6,6));undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function ji(t){var e=Z.getCharCode(" ");var r=Z.getCharCode(".");var n=Z.getCharCode(",");t[ki][e]=1;var i=Z.getCharCode("Z");var o=Z.getCharCode("A");for(var a=o;a<=i;a++){t[ki][a]=a-o+2}t[Vi][e]=1;var u=Z.getCharCode("z");var s=Z.getCharCode("a");for(var a=s;a<=u;a++){t[Vi][a]=a-s+2}t[Ui][e]=1;var f=Z.getCharCode("9");var c=Z.getCharCode("0");for(var a=c;a<=f;a++){t[Ui][a]=a-c+2}t[Ui][n]=12;t[Ui][r]=13;var l=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""];for(var h=0;h<l.length;h++){t[Hi][Z.getCharCode(l[h])]=h}var d=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(var h=0;h<d.length;h++){if(Z.getCharCode(d[h])>0){t[Gi][Z.getCharCode(d[h])]=h}}return t}ji(L.createInt32Array(5,256));undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};undefined&&undefined.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};const zi={audio:false,video:{height:{min:480,ideal:960,max:1440},aspectRatio:1.333333333,facingMode:"environment"}};const Yi={tag:"ui5-barcode-scanner-dialog",languageAware:true,slots:{},properties:{loading:{type:Boolean}},events:{"scan-success":{detail:{text:{type:String},rawBytes:{type:Object}}},"scan-error":{detail:{message:{type:String}}}}};class Zi extends c{constructor(){super();this.i18nBundle=r.getI18nBundle("@ui5/webcomponents-fiori");this._codeReader=new gi}static get metadata(){return Yi}static get render(){return l}static get template(){return null}static get staticAreaTemplate(){return a}static get styles(){return null}static get staticAreaStyles(){return[u]}static async onDefine(){await r.fetchI18nBundle("@ui5/webcomponents-fiori")}show(){if(this.loading){console.warn("Barcode scanning is already in progress.");return}if(!this._hasGetUserMedia()){this.fireEvent("scan-error",{message:"getUserMedia() is not supported by your browser"});return}this.loading=true;this._getUserPermission().then(()=>this._showDialog()).catch(t=>{this.fireEvent("scan-error",{message:t});this.loading=false})}close(){this._closeDialog();this.loading=false}_hasGetUserMedia(){return!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)}_getUserPermission(){return navigator.mediaDevices.getUserMedia(zi)}async _getDialog(){const t=await this.getStaticAreaItemDomRef();return t.querySelector("[ui5-dialog]")}async _getVideoElement(){const t=await this.getStaticAreaItemDomRef();return t.querySelector(".ui5-barcode-scanner-dialog-video")}async _showDialog(){this.dialog=await this._getDialog();this.dialog.show()}_closeDialog(){if(this._isOpen){this.dialog.close()}}_startReader(){this._decodeFromCamera(null)}async _resetReader(){const t=await this._getVideoElement();t.pause();this._codeReader.reset()}async _decodeFromCamera(t){const e=await this._getVideoElement();this._codeReader.decodeFromVideoDevice(t,e,(t,e)=>{this.loading=false;if(t){this.fireEvent("scan-success",{text:t.getText(),rawBytes:t.getRawBytes()})}if(e&&!(e instanceof J)){this.fireEvent("scan-error",{message:e})}}).catch(t=>this.fireEvent("scan-error",{message:t}))}get _isOpen(){return!!this.dialog&&this.dialog.opened}get _cancelButtonText(){return this.i18nBundle.getText(s.BARCODE_SCANNER_DIALOG_CANCEL_BUTTON_TXT)}get _busyIndicatorText(){return this.i18nBundle.getText(s.BARCODE_SCANNER_DIALOG_LOADING_TXT)}static get dependencies(){return[h,v,d]}}Zi.define();return Zi});