Loading
Showing the first 250,000 characters. Open raw for the full source.
function(t,e,r){"use strict";r.d(e,{P:()=>aZ,fiscalQrMachine:()=>az});var n,o,i,a,s,u,c,f,h,l,d,p,g,y,w,v,_,m,C,A,E,I,S,T,b,O,R,N,D,M,P,B,L,x,F,k,V,H,U,X,G,W,z,j,Y,Z,K,q,Q,J,$,tt,te,tr,tn,to,ti,ta,ts,tu,tc,tf,th,tl,td,tp,tg,ty,tw,tv,t_,tm,tC,tA,tE,tI,tS,tT,tb,tO,tR,tN,tD,tM,tP,tB,tL,tx,tF,tk,tV,tH,tU,tX,tG,tW,tz,tj,tY,tZ,tK,tq,tQ,tJ,t$,t1,t2,t0,t3,t4,t8,t6,t5,t7,t9,et,ee,er,en=r(871178),eo=r(768672),ei=r(368499),ea=r(288052);r(749378);var es=r(168056),eu=r(305463);r(550155),r(117589);var ec=r(713692),ef=r(235582);r(584480);var eh=(n=function(t,e){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),el=function(t){function e(e,r){var n,o,i,a,s=this.constructor,u=t.call(this,e,r)||this;return Object.defineProperty(u,"name",{value:s.name,enumerable:!1,configurable:!0}),n=s.prototype,(o=Object.setPrototypeOf)?o(u,n):u.__proto__=n,void 0===i&&(i=u.constructor),(a=Error.captureStackTrace)&&a(u,i),u}return eh(e,t),e}(Error),ed=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ep=function(t){function e(e){void 0===e&&(e=void 0);var r=t.call(this,e)||this;return r.message=e,r}return ed(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(el),eg=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ey=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eg(e,t),e.kind="ArgumentException",e}(ep),ew=(a=function(t,e){return(a=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ev=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ew(e,t),e.kind="IllegalArgumentException",e}(ep),e_=function(){function t(t){if(this.binarizer=t,null===t)throw new ev("Binarizer must be non-null.")}return 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(){return(null===this.matrix||void 0===this.matrix)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,r,n,o){var i=this.binarizer.getLuminanceSource().crop(e,r,n,o);return new t(this.binarizer.createBinarizer(i))},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""}},t}(),em=(s=function(t,e){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return em(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}(ep),eA=function(){function t(t){this.source=t}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),eE=function(){function t(){}return t.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},t.currentTimeMillis=function(){return Date.now()},t}(),eI=(u=function(t,e){return(u=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}u(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eI(e,t),e.kind="IndexOutOfBoundsException",e}(ep),eT=(c=function(t,e){return(c=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eb=function(t){function e(e,r){void 0===e&&(e=void 0),void 0===r&&(r=void 0);var n=t.call(this,r)||this;return n.index=e,n.message=r,n}return eT(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(eS),eO=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},eR=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;r<n;r++)t[r]=e},t.fillWithin=function(e,r,n,o){t.rangeCheck(e.length,r,n);for(var i=r;i<n;i++)e[i]=o},t.rangeCheck=function(t,e,r){if(e>r)throw new ev("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new eb(e);if(r>t)throw new eb(r)},t.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},t.create=function(t,e,r){return Array.from({length:t}).map(function(t){return Array.from({length:e}).fill(r)})},t.createInt32Array=function(t,e,r){return Array.from({length:t}).map(function(t){return Int32Array.from({length:e}).fill(r)})},t.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var r=0,n=t.length;r<n;r++)if(t[r]!==e[r])return!1;return!0},t.hashCode=function(t){if(null===t)return 0;var e,r,n=1;try{for(var o=eO(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=31*n+a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}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);return r.set(t),r}return t.slice(0,e)},t.copyOfRange=function(t,e,r){var n=r-e,o=new Int32Array(n);return eE.arraycopy(t,e,o,0,n),o},t.binarySearch=function(e,r,n){void 0===n&&(n=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),eN=function(){function t(){}return t.numberOfTrailingZeros=function(t){if(0===t)return 32;var e,r=31;return 0!=(e=t<<16)&&(r-=16,t=e),0!=(e=t<<8)&&(r-=8,t=e),0!=(e=t<<4)&&(r-=4,t=e),0!=(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t-=t>>>1&0x55555555,t=(t=(0x33333333&t)+(t>>>2&0x33333333))+(t>>>4)&0xf0f0f0f,t+=t>>>8,63&(t+=t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-0x80000000,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),eD=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,null==r?this.bits=t.makeArray(e):this.bits=r)}return 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>32*this.bits.length){var r=t.makeArray(e);eE.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<<(31&t))!=0},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+eN.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+eN.numberOfTrailingZeros(o);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 ev;if(e!==t)for(var r=Math.floor(t/32),n=Math.floor(--e/32),o=this.bits,i=r;i<=n;i++){var a=i>r?0:31&t,s=(2<<(i<n?31:31&e))-(1<<a);o[i]|=s}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,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 ev;if(e===t)return!0;for(var n=Math.floor(t/32),o=Math.floor(--e/32),i=this.bits,a=n;a<=o;a++){var s=a>n?0:31&t,u=(2<<(a<o?31:31&e))-(1<<s)|0;if((i[a]&u)!==(r?u:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new ev("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 ev("Sizes don't match");for(var e=this.bits,r=0,n=e.length;r<n;r++)e[r]^=t.bits[r]},t.prototype.toBytes=function(t,e,r,n){for(var o=0;o<n;o++){for(var i=0,a=0;a<8;a++)this.get(t)&&(i|=1<<7-a),t++;e[r+o]=i}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),r=e+1,n=this.bits,o=0;o<r;o++){var i=n[o];i=(i=(i=(i=(i=i>>1&0x55555555|(0x55555555&i)<<1)>>2&0x33333333|(0x33333333&i)<<2)>>4&0xf0f0f0f|(0xf0f0f0f&i)<<4)>>8&0xff00ff|(0xff00ff&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){for(var a=32*r-this.size,s=t[0]>>>a,o=1;o<r;o++){var u=t[o];s|=u<<32-a,t[o-1]=s,s=u>>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){return e instanceof t&&this.size===e.size&&eR.equals(this.bits,e.bits)},t.prototype.hashCode=function(){return 31*this.size+eR.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e<r;e++)(7&e)==0&&(t+=" "),t+=this.get(e)?"X":".";return t},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t.prototype.toArray=function(){for(var t=[],e=0,r=this.size;e<r;e++)t.push(this.get(e));return t},t}();(f=tJ||(tJ={}))[f.OTHER=0]="OTHER",f[f.PURE_BARCODE=1]="PURE_BARCODE",f[f.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",f[f.TRY_HARDER=3]="TRY_HARDER",f[f.CHARACTER_SET=4]="CHARACTER_SET",f[f.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",f[f.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",f[f.ENABLE_CODE_39_EXTENDED_MODE=7]="ENABLE_CODE_39_EXTENDED_MODE",f[f.ASSUME_GS1=8]="ASSUME_GS1",f[f.RETURN_CODABAR_START_END=9]="RETURN_CODABAR_START_END",f[f.NEED_RESULT_POINT_CALLBACK=10]="NEED_RESULT_POINT_CALLBACK",f[f.ALLOWED_EAN_EXTENSIONS=11]="ALLOWED_EAN_EXTENSIONS";let eM=tJ;var eP=(h=function(t,e){return(h=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eP(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}(ep),eL=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(l=t$||(t$={}))[l.Cp437=0]="Cp437",l[l.ISO8859_1=1]="ISO8859_1",l[l.ISO8859_2=2]="ISO8859_2",l[l.ISO8859_3=3]="ISO8859_3",l[l.ISO8859_4=4]="ISO8859_4",l[l.ISO8859_5=5]="ISO8859_5",l[l.ISO8859_6=6]="ISO8859_6",l[l.ISO8859_7=7]="ISO8859_7",l[l.ISO8859_8=8]="ISO8859_8",l[l.ISO8859_9=9]="ISO8859_9",l[l.ISO8859_10=10]="ISO8859_10",l[l.ISO8859_11=11]="ISO8859_11",l[l.ISO8859_13=12]="ISO8859_13",l[l.ISO8859_14=13]="ISO8859_14",l[l.ISO8859_15=14]="ISO8859_15",l[l.ISO8859_16=15]="ISO8859_16",l[l.SJIS=16]="SJIS",l[l.Cp1250=17]="Cp1250",l[l.Cp1251=18]="Cp1251",l[l.Cp1252=19]="Cp1252",l[l.Cp1256=20]="Cp1256",l[l.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",l[l.UTF8=22]="UTF8",l[l.ASCII=23]="ASCII",l[l.Big5=24]="Big5",l[l.GB18030=25]="GB18030",l[l.EUC_KR=26]="EUC_KR";var ex=function(){function t(e,r,n){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=n,"number"==typeof r?this.values=Int32Array.from([r]):this.values=r,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(n,this);for(var u=this.values,c=0,f=u.length;c!==f;c++){var h=u[c];t.VALUES_TO_ECI.set(h,this)}try{for(var l=eL(a),d=l.next();!d.done;d=l.next()){var p=d.value;t.NAME_TO_ECI.set(p,this)}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}}return 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 eB("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new eB("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new eB("incorect value");return r},t.prototype.equals=function(e){return e instanceof t&&this.getName()===e.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(t$.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(t$.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(t$.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(t$.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(t$.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(t$.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(t$.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(t$.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(t$.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(t$.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(t$.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(t$.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(t$.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(t$.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(t$.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(t$.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(t$.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(t$.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(t$.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(t$.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(t$.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(t$.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(t$.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(t$.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(t$.Big5,28,"Big5"),t.GB18030=new t(t$.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(t$.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),eF=(d=function(t,e){return(d=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ek=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eF(e,t),e.kind="UnsupportedOperationException",e}(ep),eV=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"u"<typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"u"<typeof TextEncoder?this.encodeFallback(t):new TextEncoder().encode(t)},t.isBrowser=function(){return"u">typeof window&&"[object Window]"===({}).toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof ex?t:ex.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(n.equals(ex.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new ek("Encoding "+this.encodingName(r)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(t){return t.equals(ex.UTF8)||t.equals(ex.ISO8859_1)||t.equals(ex.ASCII)},t.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))).split(""),r=[],n=0;n<e.length;n++)r.push(e[n].charCodeAt(0));return new Uint8Array(r)},t}(),eH=function(){function t(){}return t.castAsNonUtf8Char=function(t,e){void 0===e&&(e=null);var r=e?e.getName():this.ISO88591;return eV.decode(new Uint8Array([t]),r)},t.guessEncoding=function(e,r){if(null!=r&&void 0!==r.get(eM.CHARACTER_SET))return r.get(eM.CHARACTER_SET).toString();for(var n=e.length,o=!0,i=!0,a=!0,s=0,u=0,c=0,f=0,h=0,l=0,d=0,p=0,g=0,y=0,w=0,v=e.length>3&&239===e[0]&&187===e[1]&&191===e[2],_=0;_<n&&(o||i||a);_++){var m=255&e[_];a&&(s>0?(128&m)==0?a=!1:s--:(128&m)!=0&&((64&m)==0?a=!1:(s++,(32&m)==0?u++:(s++,(16&m)==0?c++:(s++,(8&m)==0?f++:a=!1))))),o&&(m>127&&m<160?o=!1:m>159&&(m<192||215===m||247===m)&&w++),i&&(h>0?m<64||127===m||m>252?i=!1:h--:128===m||160===m||m>239?i=!1:m>160&&m<224?(l++,p=0,++d>g&&(g=d)):m>127?(h++,d=0,++p>y&&(y=p)):(d=0,p=0))}return(a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(v||u+c+f>0))?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||y>=3)?t.SHIFT_JIS:o&&i?2===g&&2===l||10*w>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++n]){t=i?parseInt(i.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[n];break;case"c":u=e[n][0];break;case"f":u=parseFloat(e[n]).toFixed(t);break;case"p":u=parseFloat(e[n]).toPrecision(t);break;case"e":u=parseFloat(e[n]).toExponential(t);break;case"x":u=parseInt(e[n]).toString(c||16);break;case"d":u=parseFloat(parseInt(e[n],c||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var f=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length<f;)u=void 0!==r?u+h:h+u;return u}})},t.getBytes=function(t,e){return eV.encode(t,e)},t.getCharCode=function(t,e){return void 0===e&&(e=0),t.charCodeAt(e)},t.getCharAt=function(t){return String.fromCharCode(t)},t.SHIFT_JIS=ex.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=ex.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=ex.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),eU=function(){function t(t){void 0===t&&(t=""),this.value=t}return t.prototype.enableDecoding=function(t){return this.encoding=t,this},t.prototype.append=function(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=eH.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),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.substring(0,t)+e+this.value.substring(t)},t}(),eX=function(){function t(t,e,r,n){if(this.width=t,this.height=e,this.rowSize=r,this.bits=n,null==e&&(e=t),this.height=e,t<1||e<1)throw new ev("Both dimensions must be greater than 0");null==r&&(r=Math.floor((t+31)/32)),this.rowSize=r,null==n&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var r=e.length,n=e[0].length,o=new t(n,r),i=0;i<r;i++)for(var a=e[i],s=0;s<n;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,r,n){if(null===e)throw new ev("stringRepresentation cannot be null");for(var o=Array(e.length),i=0,a=0,s=-1,u=0,c=0;c<e.length;)if("\n"===e.charAt(c)||"\r"===e.charAt(c)){if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new ev("row lengths do not match");a=i,u++}c++}else if(e.substring(c,c+r.length)===r)c+=r.length,o[i]=!0,i++;else if(e.substring(c,c+n.length)===n)c+=n.length,o[i]=!1,i++;else throw new ev("illegal character encountered: "+e.substring(c));if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new ev("row lengths do not match");u++}for(var f=new t(s,u),h=0;h<i;h++)o[h]&&f.set(Math.floor(h%s),Math.floor(h/s));return f},t.prototype.get=function(t,e){var r=e*this.rowSize+Math.floor(t/32);return(this.bits[r]>>>(31&t)&1)!=0},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t))},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new ev("input matrix dimensions do not match");for(var e=new eD(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;o<i;o++)for(var a=o*r,s=t.getRow(o,e).getBitArray(),u=0;u<r;u++)n[a+u]^=s[u]},t.prototype.clear=function(){for(var t=this.bits,e=t.length,r=0;r<e;r++)t[r]=0},t.prototype.setRegion=function(t,e,r,n){if(e<0||t<0)throw new ev("Left and top must be nonnegative");if(n<1||r<1)throw new ev("Height and width must be at least 1");var o=t+r,i=e+n;if(i>this.height||o>this.width)throw new ev("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,u=e;u<i;u++)for(var c=u*a,f=t;f<o;f++)s[c+Math.floor(f/32)]|=1<<(31&f)},t.prototype.getRow=function(t,e){null==e||e.getSize()<this.width?e=new eD(this.width):e.clear();for(var r=this.rowSize,n=this.bits,o=t*r,i=0;i<r;i++)e.setBulk(32*i,n[o+i]);return e},t.prototype.setRow=function(t,e){eE.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),r=new eD(t),n=new eD(t),o=0,i=Math.floor((e+1)/2);o<i;o++)r=this.getRow(o,r),n=this.getRow(e-1-o,n),r.reverse(),n.reverse(),this.setRow(o,n),this.setRow(e-1-o,r)},t.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,r=this.rowSize,n=this.bits,o=t,i=e,a=-1,s=-1,u=0;u<e;u++)for(var c=0;c<r;c++){var f=n[u*r+c];if(0!==f){if(u<i&&(i=u),u>s&&(s=u),32*c<o){for(var h=0;f<<31-h==0;)h++;32*c+h<o&&(o=32*c+h)}if(32*c+31>a){for(var h=31;f>>>h==0;)h--;32*c+h>a&&(a=32*c+h)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])},t.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,r=0;r<e.length&&0===e[r];)r++;if(r===e.length)return null;for(var n=r/t,o=r%t*32,i=e[r],a=0;i<<31-a==0;)a++;return o+=a,Int32Array.from([o,n])},t.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,r=e.length-1;r>=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,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){return e instanceof t&&this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&eR.equals(this.bits,e.bits)},t.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+eR.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new eU,o=0,i=this.height;o<i;o++){for(var a=0,s=this.width;a<s;a++)n.append(this.get(a,o)?t:e);n.append(r)}return n.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),eG=(p=function(t,e){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eG(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}(ep),ez=(g=function(t,e){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ej=function(t){function e(r){var n=t.call(this,r)||this;return n.luminances=e.EMPTY,n.buckets=new Int32Array(e.LUMINANCE_BUCKETS),n}return ez(e,t),e.prototype.getBlackRow=function(t,r){var n=this.getLuminanceSource(),o=n.getWidth();null==r||r.getSize()<o?r=new eD(o):r.clear(),this.initArrays(o);for(var i=n.getRow(t,this.luminances),a=this.buckets,s=0;s<o;s++)a[(255&i[s])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(a);if(o<3)for(var s=0;s<o;s++)(255&i[s])<u&&r.set(s);else for(var c=255&i[0],f=255&i[1],s=1;s<o-1;s++){var h=255&i[s+1];(4*f-c-h)/2<u&&r.set(s),c=f,f=h}return r},e.prototype.getBlackMatrix=function(){var t=this.getLuminanceSource(),r=t.getWidth(),n=t.getHeight(),o=new eX(r,n);this.initArrays(r);for(var i=this.buckets,a=1;a<5;a++)for(var s=Math.floor(n*a/5),u=t.getRow(s,this.luminances),c=Math.floor(4*r/5),f=Math.floor(r/5);f<c;f++){var h=255&u[f];i[h>>e.LUMINANCE_SHIFT]++}for(var l=e.estimateBlackPoint(i),d=t.getMatrix(),a=0;a<n;a++)for(var p=a*r,f=0;f<r;f++){var h=255&d[p+f];h<l&&o.set(f,a)}return o},e.prototype.createBinarizer=function(t){return new e(t)},e.prototype.initArrays=function(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));for(var r=this.buckets,n=0;n<e.LUMINANCE_BUCKETS;n++)r[n]=0},e.estimateBlackPoint=function(t){for(var r=t.length,n=0,o=0,i=0,a=0;a<r;a++)t[a]>i&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);for(var s=0,u=0,a=0;a<r;a++){var c=a-o,f=t[a]*c*c;f>u&&(s=a,u=f)}if(o>s){var h=o;o=s,s=h}if(s-o<=r/16)throw new eW;for(var l=s-1,d=-1,a=s-1;a>o;a--){var p=a-o,f=p*p*(s-a)*(n-t[a]);f>d&&(l=a,d=f)}return l<<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]),e}(eA),eY=(y=function(t,e){return(y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eZ=function(t){function e(e){var r=t.call(this,e)||this;return r.matrix=null,r}return eY(e,t),e.prototype.getBlackMatrix=function(){if(null!==this.matrix)return this.matrix;var r=this.getLuminanceSource(),n=r.getWidth(),o=r.getHeight();if(n>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;(n&e.BLOCK_SIZE_MASK)!=0&&a++;var s=o>>e.BLOCK_SIZE_POWER;(o&e.BLOCK_SIZE_MASK)!=0&&s++;var u=e.calculateBlackPoints(i,a,s,n,o),c=new eX(n,o);e.calculateThresholdForBlock(i,a,s,n,o,u,c),this.matrix=c}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,o,i,a,s){for(var u=i-e.BLOCK_SIZE,c=o-e.BLOCK_SIZE,f=0;f<n;f++){var h=f<<e.BLOCK_SIZE_POWER;h>u&&(h=u);for(var l=e.cap(f,2,n-3),d=0;d<r;d++){var p=d<<e.BLOCK_SIZE_POWER;p>c&&(p=c);for(var g=e.cap(d,2,r-3),y=0,w=-2;w<=2;w++){var v=a[l+w];y+=v[g-2]+v[g-1]+v[g]+v[g+1]+v[g+2]}var _=y/25;e.thresholdBlock(t,p,h,_,o,s)}}},e.cap=function(t,e,r){return t<e?e:t>r?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,u=n*i+r;s<e.BLOCK_SIZE;s++,u+=i)for(var c=0;c<e.BLOCK_SIZE;c++)(255&t[u+c])<=o&&a.set(r+c,n+s)},e.calculateBlackPoints=function(t,r,n,o,i){for(var a=i-e.BLOCK_SIZE,s=o-e.BLOCK_SIZE,u=Array(n),c=0;c<n;c++){u[c]=new Int32Array(r);var f=c<<e.BLOCK_SIZE_POWER;f>a&&(f=a);for(var h=0;h<r;h++){var l=h<<e.BLOCK_SIZE_POWER;l>s&&(l=s);for(var d=0,p=255,g=0,y=0,w=f*o+l;y<e.BLOCK_SIZE;y++,w+=o){for(var v=0;v<e.BLOCK_SIZE;v++){var _=255&t[w+v];d+=_,_<p&&(p=_),_>g&&(g=_)}if(g-p>e.MIN_DYNAMIC_RANGE)for(y++,w+=o;y<e.BLOCK_SIZE;y++,w+=o)for(var v=0;v<e.BLOCK_SIZE;v++)d+=255&t[w+v]}var m=d>>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(m=p/2,c>0&&h>0)){var C=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;p<C&&(m=C)}u[c][h]=m}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(ej),eK=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(t,e,r,n){throw new ek("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new ek("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new ek("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new eU,r=0;r<this.height;r++){for(var n=this.getRow(r,t),o=0;o<this.width;o++){var i=255&n[o],a=void 0;a=i<64?"#":i<128?"+":i<192?".":" ",e.append(a)}e.append("\n")}return e.toString()},t}(),eq=(w=function(t,e){return(w=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),eQ=function(t){function e(e){var r=t.call(this,e.getWidth(),e.getHeight())||this;return r.delegate=e,r}return eq(e,t),e.prototype.getRow=function(t,e){for(var r=this.delegate.getRow(t,e),n=this.getWidth(),o=0;o<n;o++)r[o]=255-(255&r[o]);return r},e.prototype.getMatrix=function(){for(var t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),r=new Uint8ClampedArray(e),n=0;n<e;n++)r[n]=255-(255&t[n]);return r},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(t,r,n,o){return new e(this.delegate.crop(t,r,n,o))},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())},e}(eK),eJ=(v=function(t,e){return(v=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),e$=function(t){function e(r,n){void 0===n&&(n=!1);var o=t.call(this,r.width,r.height)||this;return o.canvas=r,o.tempCanvasElement=null,o.buffer=e.makeBufferFromCanvasImageData(r,n),o}return eJ(e,t),e.makeBufferFromCanvasImageData=function(t,r){void 0===r&&(r=!1);var n=t.getContext("2d").getImageData(0,0,t.width,t.height);return e.toGrayscaleBuffer(n.data,t.width,t.height,r)},e.toGrayscaleBuffer=function(t,r,n,o){void 0===o&&(o=!1);var i=new Uint8ClampedArray(r*n);if(e.FRAME_INDEX=!e.FRAME_INDEX,e.FRAME_INDEX||!o)for(var a=0,s=0,u=t.length;a<u;a+=4,s++){var c=void 0,f=t[a+3];if(0===f)c=255;else{var h=t[a],l=t[a+1],d=t[a+2];c=306*h+601*l+117*d+512>>10}i[s]=c}else for(var a=0,s=0,p=t.length;a<p;a+=4,s++){var c=void 0,f=t[a+3];if(0===f)c=255;else{var h=t[a],l=t[a+1],d=t[a+2];c=306*h+601*l+117*d+512>>10}i[s]=255-c}return i},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new ev("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length<r&&(e=new Uint8ClampedArray(r)),e.set(this.buffer.slice(n,n+r))),e},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(e,r,n,o){return t.prototype.crop.call(this,e,r,n,o),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),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(),n=r.getContext("2d"),o=t*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),u=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);return r.width=s,r.height=u,n.translate(s/2,u/2),n.rotate(o),n.drawImage(this.canvas,-(i/2),-(a/2)),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new eQ(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e.FRAME_INDEX=!0,e}(eK),e1=function(){function t(t,e,r){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),e2=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},e0=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){var u=[i,s];if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}},e3=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e4=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"u">typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return e2(this,void 0,void 0,function(){var t,e,r,n,o,i,a,s,u,c,f,h;return e0(this,function(l){switch(l.label){case 0:if(!this.hasNavigator)throw Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=l.sent(),e=[];try{for(n=(r=e3(t)).next();!n.done;n=r.next())o=n.value,i="video"===o.kind?"videoinput":o.kind,"videoinput"===i&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,c={deviceId:a,label:s,kind:i,groupId:u},e.push(c))}catch(t){f={error:t}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(f)throw f.error}}return[2,e]}})})},t.prototype.getVideoInputDevices=function(){return e2(this,void 0,void 0,function(){return e0(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(t){return new e1(t.deviceId,t.label)})]}})})},t.prototype.findDeviceById=function(t){return e2(this,void 0,void 0,function(){var e;return e0(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:if(!(e=r.sent()))return[2,null];return[2,e.find(function(e){return e.deviceId===t})]}})})},t.prototype.decodeFromInputVideoDevice=function(t,e){return e2(this,void 0,void 0,function(){return e0(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 e2(this,void 0,void 0,function(){var r;return e0(this,function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(t,e){return e2(this,void 0,void 0,function(){var r;return e0(this,function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}})})},t.prototype.decodeOnceFromStream=function(t,e){return e2(this,void 0,void 0,function(){var r;return e0(this,function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return e2(this,void 0,void 0,function(){return e0(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 e2(this,void 0,void 0,function(){var n;return e0(this,function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromConstraints=function(t,e,r){return e2(this,void 0,void 0,function(){var n;return e0(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromStream=function(t,e,r){return e2(this,void 0,void 0,function(){var n;return e0(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return e2(this,void 0,void 0,function(){var r;return e0(this,function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[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 e2(this,void 0,void 0,function(){return e0(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new ey("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new ey("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new ey("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new ey("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new ey("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new ey("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},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 ey("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new ey("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new ey("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new ey("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(t){return e2(this,void 0,void 0,function(){return e0(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return e2(this,void 0,void 0,function(){return e0(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}})})},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return!t&&"u">typeof document&&((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode){a(new eW("Video stream has ended before any code could be detected.")),n._stopAsyncDecode=void 0;return}try{var s=n.decode(t);i(s)}catch(t){var u=e&&t instanceof eW,c=(t instanceof eC||t instanceof eB)&&r;if(u||c)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(t)}};return new Promise(function(t,e){return o(t,e)})},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode){r._stopContinuousDecode=void 0;return}try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(t){e(null,t);var i=t instanceof eC||t instanceof eB,a=t instanceof eW;(i||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){this.getCaptureCanvasContext(t);var e=!1;return t instanceof HTMLVideoElement?(this.drawFrameOnCanvas(t),e=!0):this.drawImageOnCanvas(t),new e_(new eZ(new e$(this.getCaptureCanvas(t),e)))},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),r=void 0;try{r=e.getContext("2d",{willReadFrequently:!0})}catch(t){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.drawFrameOnCanvas=function(t,e,r){void 0===e&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},t.prototype.drawImageOnCanvas=function(t,e,r){void 0===e&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("u"<typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},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")},t}(),e8=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=eE.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,null==r?this.numBits=null==e?0:8*e.length:this.numBits=r,this.resultPoints=n,this.format=o,this.resultMetadata=null,null==i?this.timestamp=eE.currentTimeMillis():this.timestamp=i}return 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){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=Array(e.length+t.length);eE.arraycopy(e,0,r,0,e.length),eE.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},t}();(_=t1||(t1={}))[_.AZTEC=0]="AZTEC",_[_.CODABAR=1]="CODABAR",_[_.CODE_39=2]="CODE_39",_[_.CODE_93=3]="CODE_93",_[_.CODE_128=4]="CODE_128",_[_.DATA_MATRIX=5]="DATA_MATRIX",_[_.EAN_8=6]="EAN_8",_[_.EAN_13=7]="EAN_13",_[_.ITF=8]="ITF",_[_.MAXICODE=9]="MAXICODE",_[_.PDF_417=10]="PDF_417",_[_.QR_CODE=11]="QR_CODE",_[_.RSS_14=12]="RSS_14",_[_.RSS_EXPANDED=13]="RSS_EXPANDED",_[_.UPC_A=14]="UPC_A",_[_.UPC_E=15]="UPC_E",_[_.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION";let e6=t1;(m=t2||(t2={}))[m.OTHER=0]="OTHER",m[m.ORIENTATION=1]="ORIENTATION",m[m.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",m[m.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",m[m.ISSUE_NUMBER=4]="ISSUE_NUMBER",m[m.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",m[m.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",m[m.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",m[m.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",m[m.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",m[m.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY";let e5=t2;var e7=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return 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},t}(),e9=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new ev;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),rt=function(){function t(t,e){if(0===e.length)throw new ev;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;n<r&&0===e[n];)n++;n===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-n),eE.arraycopy(e,n,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return 0===this.coefficients[0]},t.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},t.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){e=0;for(var n=0,o=r.length;n!==o;n++){var i=r[n];e=e9.addOrSubtract(e,i)}return e}e=r[0];for(var a=r.length,s=this.field,n=1;n<a;n++)e=e9.addOrSubtract(s.multiply(t,e),r[n]);return e},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new ev("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var r=this.coefficients,n=e.coefficients;if(r.length>n.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;eE.arraycopy(n,0,i,0,a);for(var s=a;s<n.length;s++)i[s]=e9.addOrSubtract(r[s-a],n[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new ev("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var r=this.coefficients,n=r.length,o=e.coefficients,i=o.length,a=new Int32Array(n+i-1),s=this.field,u=0;u<n;u++)for(var c=r[u],f=0;f<i;f++)a[u+f]=e9.addOrSubtract(a[u+f],s.multiply(c,o[f]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(0===e)return this.field.getZero();if(1===e)return this;for(var r=this.coefficients.length,n=this.field,o=new Int32Array(r),i=this.coefficients,a=0;a<r;a++)o[a]=n.multiply(i[a],e);return new t(n,o)},t.prototype.multiplyByMonomial=function(e,r){if(e<0)throw new ev;if(0===r)return this.field.getZero();for(var n=this.coefficients,o=n.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(n[s],r);return new t(a,i)},t.prototype.divide=function(t){if(!this.field.equals(t.field))throw new ev("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new ev("Divide by 0");for(var e=this.field,r=e.getZero(),n=this,o=t.getCoefficient(t.getDegree()),i=e.inverse(o);n.getDegree()>=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),u=t.multiplyByMonomial(a,s),c=e.buildMonomial(a,s);r=r.addOrSubtract(c),n=n.addOrSubtract(u)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),re=(C=function(t,e){return(C=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}C(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return re(e,t),e.kind="ArithmeticException",e}(ep),rn=(A=function(t,e){return(A=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}A(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ro=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s<r;s++)i[s]=a,(a*=2)>=r&&(a^=e,a&=r-1);o.expTable=i;for(var u=new Int32Array(r),s=0;s<r-1;s++)u[i[s]]=s;return o.logTable=u,o.zero=new rt(o,Int32Array.from([0])),o.one=new rt(o,Int32Array.from([1])),o}return rn(e,t),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 ev;if(0===e)return this.zero;var r=new Int32Array(t+1);return r[0]=e,new rt(this,r)},e.prototype.inverse=function(t){if(0===t)throw new rr;return this.expTable[this.size-this.logTable[t]-1]},e.prototype.multiply=function(t,e){return 0===t||0===e?0: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"+eN.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,e}(e9),ri=(E=function(t,e){return(E=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}E(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ra=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ri(e,t),e.kind="ReedSolomonException",e}(ep),rs=(I=function(t,e){return(I=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}I(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ru=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rs(e,t),e.kind="IllegalStateException",e}(ep),rc=function(){function t(t){this.field=t}return t.prototype.decode=function(t,e){for(var r=this.field,n=new rt(r,t),o=new Int32Array(e),i=!0,a=0;a<e;a++){var s=n.evaluateAt(r.exp(a+r.getGeneratorBase()));o[o.length-1-a]=s,0!==s&&(i=!1)}if(!i)for(var u=new rt(r,o),c=this.runEuclideanAlgorithm(r.buildMonomial(e,1),u,e),f=c[0],h=c[1],l=this.findErrorLocations(f),d=this.findErrorMagnitudes(h,l),a=0;a<l.length;a++){var p=t.length-1-r.log(l[a]);if(p<0)throw new ra("Bad error location");t[p]=ro.addOrSubtract(t[p],d[a])}},t.prototype.runEuclideanAlgorithm=function(t,e,r){if(t.getDegree()<e.getDegree()){var n=t;t=e,e=n}for(var o=this.field,i=t,a=e,s=o.getZero(),u=o.getOne();a.getDegree()>=(r/2|0);){var c=i,f=s;if(i=a,s=u,i.isZero())throw new ra("r_{i-1} was zero");a=c;for(var h=o.getZero(),l=i.getCoefficient(i.getDegree()),d=o.inverse(l);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),d);h=h.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(u=h.multiply(s).addOrSubtract(f),a.getDegree()>=i.getDegree())throw new ru("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(0===y)throw new ra("sigmaTilde(0) was zero");var w=o.inverse(y);return[u.multiplyScalar(w),a.multiplyScalar(w)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i<o.getSize()&&n<e;i++)0===t.evaluateAt(i)&&(r[n]=o.inverse(i),n++);if(n!==e)throw new ra("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(t,e){for(var r=e.length,n=new Int32Array(r),o=this.field,i=0;i<r;i++){for(var a=o.inverse(e[i]),s=1,u=0;u<r;u++)if(i!==u){var c=o.multiply(e[u],a),f=(1&c)==0?1|c:-2&c;s=o.multiply(s,f)}n[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(n[i]=o.multiply(n[i],a))}return n},t}();(S=t0||(t0={}))[S.UPPER=0]="UPPER",S[S.LOWER=1]="LOWER",S[S.MIXED=2]="MIXED",S[S.DIGIT=3]="DIGIT",S[S.PUNCT=4]="PUNCT",S[S.BINARY=5]="BINARY";var rf=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var r=e.getBits(),n=this.extractBits(r),o=this.correctBits(n),i=new e7(t.convertBoolArrayToByteArray(o),t.getEncodedData(o),null,null);return i.setNumBits(o.length),i},t.highLevelDecode=function(t){return this.getEncodedData(t)},t.getEncodedData=function(e){for(var r=e.length,n=t0.UPPER,o=t0.UPPER,i="",a=0;a<r;)if(o===t0.BINARY){if(r-a<5)break;var s=t.readCode(e,a,5);if(a+=5,0===s){if(r-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var u=0;u<s;u++){if(r-a<8){a=r;break}var c=t.readCode(e,a,8);i+=eH.castAsNonUtf8Char(c),a+=8}o=n}else{var f=o===t0.DIGIT?4:5;if(r-a<f)break;var c=t.readCode(e,a,f);a+=f;var h=t.getCharacter(o,c);h.startsWith("CTRL_")?(n=o,o=t.getTable(h.charAt(5)),"L"===h.charAt(6)&&(n=o)):(i+=h,o=n)}return i},t.getTable=function(t){switch(t){case"L":return t0.LOWER;case"P":return t0.PUNCT;case"M":return t0.MIXED;case"D":return t0.DIGIT;case"B":return t0.BINARY;default:return t0.UPPER}},t.getCharacter=function(e,r){switch(e){case t0.UPPER:return t.UPPER_TABLE[r];case t0.LOWER:return t.LOWER_TABLE[r];case t0.MIXED:return t.MIXED_TABLE[r];case t0.PUNCT:return t.PUNCT_TABLE[r];case t0.DIGIT:return t.DIGIT_TABLE[r];default:throw new ru("Bad table")}},t.prototype.correctBits=function(e){2>=this.ddata.getNbLayers()?(n=6,r=ro.AZTEC_DATA_6):8>=this.ddata.getNbLayers()?(n=8,r=ro.AZTEC_DATA_8):22>=this.ddata.getNbLayers()?(n=10,r=ro.AZTEC_DATA_10):(n=12,r=ro.AZTEC_DATA_12);var r,n,o=this.ddata.getNbDatablocks(),i=e.length/n;if(i<o)throw new eB;for(var a=e.length%n,s=new Int32Array(i),u=0;u<i;u++,a+=n)s[u]=t.readCode(e,a,n);try{new rc(r).decode(s,i-o)}catch(t){throw new eB(t)}for(var c=(1<<n)-1,f=0,u=0;u<o;u++){var h=s[u];if(0===h||h===c)throw new eB;(1===h||h===c-1)&&f++}for(var l=Array(o*n-f),d=0,u=0;u<o;u++){var h=s[u];if(1===h||h===c-1)l.fill(h>1,d,d+n-1),d+=n-1;else for(var p=n-1;p>=0;--p)l[d++]=(h&1<<p)!=0}return l},t.prototype.extractBits=function(t){var e=this.ddata.isCompact(),r=this.ddata.getNbLayers(),n=(e?11:14)+4*r,o=new Int32Array(n),i=Array(this.totalBitsInLayer(r,e));if(e)for(var a=0;a<o.length;a++)o[a]=a;else for(var s=n+1+2*eN.truncDivision(eN.truncDivision(n,2)-1,15),u=n/2,c=eN.truncDivision(s,2),a=0;a<u;a++){var f=a+eN.truncDivision(a,15);o[u-a-1]=c-f-1,o[u+a]=c+f+1}for(var a=0,h=0;a<r;a++){for(var l=(r-a)*4+(e?9:12),d=2*a,p=n-1-d,g=0;g<l;g++)for(var y=2*g,w=0;w<2;w++)i[h+y+w]=t.get(o[d+w],o[d+g]),i[h+2*l+y+w]=t.get(o[d+g],o[p-w]),i[h+4*l+y+w]=t.get(o[p-w],o[p-g]),i[h+6*l+y+w]=t.get(o[p-g],o[d+w]);h+=8*l}return i},t.readCode=function(t,e,r){for(var n=0,o=e;o<e+r;o++)n<<=1,t[o]&&(n|=1);return n},t.readByte=function(e,r){var n=e.length-r;return n>=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),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"," ","\x01","\x02","\x03","\x04","\x05","\x06","\x07","\b"," ","\n","\v","\f","\r","\x1b","\x1c","\x1d","\x1e","\x1f","@","\\","^","_","`","|","~","","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"],t}(),rh=function(){function t(){}return t.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},t}(),rl=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),rd=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){return e instanceof t&&this.x===e.x&&this.y===e.y},t.prototype.hashCode=function(){return 31*rl.floatToIntBits(this.x)+rl.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),0>this.crossProductZ(e,r,n)){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return rh.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),rp=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),rg=(T=function(t,e){return(T=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ry=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return rg(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(rp),rw=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new eW}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,u=!1,c=!1,f=!1,h=this.width,l=this.height;i;){i=!1;for(var d=!0;(d||!s)&&e<h;)(d=this.containsBlackPoint(r,n,e,!1))?(e++,i=!0,s=!0):!s&&e++;if(e>=h){o=!0;break}for(var p=!0;(p||!u)&&n<l;)(p=this.containsBlackPoint(t,e,n,!0))?(n++,i=!0,u=!0):!u&&n++;if(n>=l){o=!0;break}for(var g=!0;(g||!c)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,c=!0):!c&&t--;if(t<0){o=!0;break}for(var y=!0;(y||!f)&&r>=0;)(y=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,f=!0):!f&&r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var w=e-t,v=null,_=1;null===v&&_<w;_++)v=this.getBlackPointOnSegment(t,n-_,t+_,n);if(null==v)throw new eW;for(var m=null,_=1;null===m&&_<w;_++)m=this.getBlackPointOnSegment(t,r+_,t+_,r);if(null==m)throw new eW;for(var C=null,_=1;null===C&&_<w;_++)C=this.getBlackPointOnSegment(e,r+_,e-_,r);if(null==C)throw new eW;for(var A=null,_=1;null===A&&_<w;_++)A=this.getBlackPointOnSegment(e,n-_,e-_,n);if(null==A)throw new eW;return this.centerEdges(A,v,C,m)}throw new eW},t.prototype.getBlackPointOnSegment=function(t,e,r,n){for(var o=rh.round(rh.distance(t,e,r,n)),i=(r-t)/o,a=(n-e)/o,s=this.image,u=0;u<o;u++){var c=rh.round(t+u*i),f=rh.round(e+u*a);if(s.get(c,f))return new rd(c,f)}return null},t.prototype.centerEdges=function(e,r,n,o){var i=e.getX(),a=e.getY(),s=r.getX(),u=r.getY(),c=n.getX(),f=n.getY(),h=o.getX(),l=o.getY(),d=t.CORR;return i<this.width/2?[new rd(h-d,l+d),new rd(s+d,u+d),new rd(c-d,f-d),new rd(i+d,a-d)]:[new rd(h+d,l+d),new rd(s+d,u-d),new rd(c-d,f+d),new rd(i-d,a-d)]},t.prototype.containsBlackPoint=function(t,e,r,n){var o=this.image;if(n){for(var i=t;i<=e;i++)if(o.get(i,r))return!0}else for(var a=t;a<=e;a++)if(o.get(r,a))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),rv=function(){function t(){}return t.checkAndNudgePoints=function(t,e){for(var r=t.getWidth(),n=t.getHeight(),o=!0,i=0;i<e.length&&o;i+=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new eW;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}o=!0;for(var i=e.length-2;i>=0&&o;i-=2){var a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new eW;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),r_=function(){function t(t,e,r,n,o,i,a,s,u){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,u,c,f,h,l,d,p,g,y){var w=t.quadrilateralToSquare(e,r,n,o,i,a,s,u);return t.squareToQuadrilateral(c,f,h,l,d,p,g,y).times(w)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,f=this.a33,h=0;h<e;h+=2){var l=t[h],d=t[h+1],p=o*l+s*d+f;t[h]=(r*l+i*d+u)/p,t[h+1]=(n*l+a*d+c)/p}},t.prototype.transformPointsWithValues=function(t,e){for(var r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,f=this.a33,h=t.length,l=0;l<h;l++){var d=t[l],p=e[l],g=o*d+s*p+f;t[l]=(r*d+i*p+u)/g,e[l]=(n*d+a*p+c)/g}},t.squareToQuadrilateral=function(e,r,n,o,i,a,s,u){var c=e-n+i-s,f=r-o+a-u;if(0===c&&0===f)return new t(n-e,i-n,e,o-r,a-o,r,0,0,1);var h=n-i,l=s-i,d=o-a,p=u-a,g=h*p-l*d,y=(c*p-l*f)/g,w=(h*f-c*d)/g;return new t(n-e+y*n,s-e+w*s,e,o-r+y*o,u-r+w*u,r,y,w,1)},t.quadrilateralToSquare=function(e,r,n,o,i,a,s,u){return t.squareToQuadrilateral(e,r,n,o,i,a,s,u).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)},t}(),rm=(b=function(t,e){return(b=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rm(e,t),e.prototype.sampleGrid=function(t,e,r,n,o,i,a,s,u,c,f,h,l,d,p,g,y,w,v){var _=r_.quadrilateralToQuadrilateral(n,o,i,a,s,u,c,f,h,l,d,p,g,y,w,v);return this.sampleGridWithTransform(t,e,r,_)},e.prototype.sampleGridWithTransform=function(t,e,r,n){if(e<=0||r<=0)throw new eW;for(var o=new eX(e,r),i=new Float32Array(2*e),a=0;a<r;a++){for(var s=i.length,u=a+.5,c=0;c<s;c+=2)i[c]=c/2+.5,i[c+1]=u;n.transformPoints(i),rv.checkAndNudgePoints(t,i);try{for(var c=0;c<s;c+=2)t.get(Math.floor(i[c]),Math.floor(i[c+1]))&&o.set(c/2,a)}catch(t){throw new eW}}return o},e}(rv),rA=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new rC,t}(),rE=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.toResultPoint=function(){return new rd(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),rI=function(){function t(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(t){var e=this.getMatrixCenter(),r=this.getBullsEyeCorners(e);if(t){var n=r[0];r[0]=r[2],r[2]=n}return this.extractParameters(r),new ry(this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),this.getMatrixCornerPoints(r),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 eW;var e=2*this.nbCenterLayers,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);for(var n=0,o=0;o<4;o++){var i=r[(this.shift+o)%4];this.compact?(n<<=7,n+=i>>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=(a>>6)+1,this.nbDataBlocks=(63&a)+1):(this.nbLayers=(a>>11)+1,this.nbDataBlocks=(2047&a)+1)},t.prototype.getRotation=function(t,e){var r=0;t.forEach(function(t,n,o){r=(r<<3)+((t>>e-2<<1)+(1&t))}),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(2>=eN.bitCount(r^this.EXPECTED_CORNER_BITS[n]))return n;throw new eW},t.prototype.getCorrectedParameterData=function(t,e){e?(r=7,n=2):(r=10,n=4);for(var r,n,o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new rc(ro.AZTEC_PARAM).decode(i,o)}catch(t){throw new eW}for(var s=0,a=0;a<n;a++)s=(s<<4)+i[a];return s},t.prototype.getBullsEyeCorners=function(t){var e=t,r=t,n=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var a=this.getFirstDifferent(e,i,1,-1),s=this.getFirstDifferent(r,i,1,1),u=this.getFirstDifferent(n,i,-1,1),c=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){var f=this.distancePoint(c,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(a,s,u,c))break}e=a,r=s,n=u,o=c,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new eW;this.compact=5===this.nbCenterLayers;var h=new rd(e.getX()+.5,e.getY()-.5),l=new rd(r.getX()+.5,r.getY()+.5),d=new rd(n.getX()-.5,n.getY()+.5),p=new rd(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,l,d,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){try{var t,e,r,n,o=new rw(this.image).detect();t=o[0],e=o[1],r=o[2],n=o[3]}catch(o){var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new rE(i+7,a-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new rE(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new rE(i-7,a+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new rE(i-7,a-7),!1,-1,-1).toResultPoint()}var s=rh.round((t.getX()+n.getX()+e.getX()+r.getX())/4),u=rh.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var o=new rw(this.image,15,s,u).detect();t=o[0],e=o[1],r=o[2],n=o[3]}catch(o){t=this.getFirstDifferent(new rE(s+7,u-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new rE(s+7,u+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new rE(s-7,u+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new rE(s-7,u-7),!1,-1,-1).toResultPoint()}return new rE(s=rh.round((t.getX()+n.getX()+e.getX()+r.getX())/4),u=rh.round((t.getY()+n.getY()+e.getY()+r.getY())/4))},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=rA.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,u,s,u,u,s,u,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),u=i*(e.getX()-t.getX())/o,c=i*(e.getY()-t.getY())/o,f=0;f<r;f++)this.image.get(rh.round(a+f*u),rh.round(s+f*c))&&(n|=1<<r-f-1);return n},t.prototype.isWhiteOrBlackRectangle=function(t,e,r,n){t=new rE(t.getX()-3,t.getY()+3),e=new rE(e.getX()-3,e.getY()-3),r=new rE(r.getX()+3,r.getY()-3),n=new rE(n.getX()+3,n.getY()+3);var o=this.getColor(n,t);if(0===o)return!1;var i=this.getColor(t,e);return i===o&&(i=this.getColor(e,r))===o&&(i=this.getColor(r,n))===o},t.prototype.getColor=function(t,e){for(var r=this.distancePoint(t,e),n=(e.getX()-t.getX())/r,o=(e.getY()-t.getY())/r,i=0,a=t.getX(),s=t.getY(),u=this.image.get(t.getX(),t.getY()),c=Math.ceil(r),f=0;f<c;f++)a+=n,s+=o,this.image.get(rh.round(a),rh.round(s))!==u&&i++;var h=i/r;return h>.1&&h<.9?0:h<=.1===u?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new rE(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new rd(a+n*o,s+n*i),c=new rd(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),[u,new rd((a=(t[1].getX()+t[3].getX())/2)+n*o,(s=(t[1].getY()+t[3].getY())/2)+n*i),c,new rd(a-n*o,s-n*i)]},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=rh.round(t.getX()),r=rh.round(t.getY());return this.isValid(e,r)},t.prototype.distancePoint=function(t,e){return rh.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.distanceResultPoint=function(t,e){return rh.distance(t.getX(),t.getY(),e.getX(),e.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(eN.truncDivision(this.nbLayers-4,8)+1)+15},t}(),rS=function(){function t(){}return t.prototype.decode=function(t,e){void 0===e&&(e=null);var r=null,n=new rI(t.getBlackMatrix()),o=null,i=null;try{var a=n.detectMirror(!1);o=a.getPoints(),this.reportFoundResultPoints(e,o),i=new rf().decode(a)}catch(t){r=t}if(null==i)try{var a=n.detectMirror(!0);o=a.getPoints(),this.reportFoundResultPoints(e,o),i=new rf().decode(a)}catch(t){if(null!=r)throw r;throw t}var s=new e8(i.getText(),i.getRawBytes(),i.getNumBits(),o,e6.AZTEC,eE.currentTimeMillis()),u=i.getByteSegments();null!=u&&s.putMetadata(e5.BYTE_SEGMENTS,u);var c=i.getECLevel();return null!=c&&s.putMetadata(e5.ERROR_CORRECTION_LEVEL,c),s},t.prototype.reportFoundResultPoints=function(t,e){if(null!=t){var r=t.get(eM.NEED_RESULT_POINT_CALLBACK);null!=r&&e.forEach(function(t,e,n){r.foundPossibleResultPoint(t)})}},t.prototype.reset=function(){},t}();(O=function(t,e){return(O=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}O(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(function(t){return void 0===t&&(t=500),R.call(this,new rS,t)||this},R=e4);var rT=function(){function t(){}return t.prototype.decode=function(t,e){try{return this.doDecode(t,e)}catch(c){if(e&&!0===e.get(eM.TRY_HARDER)&&t.isRotateSupported()){var r=t.rotateCounterClockwise(),n=this.doDecode(r,e),o=n.getResultMetadata(),i=270;null!==o&&!0===o.get(e5.ORIENTATION)&&(i+=o.get(e5.ORIENTATION)%360),n.putMetadata(e5.ORIENTATION,i);var a=n.getResultPoints();if(null!==a)for(var s=r.getHeight(),u=0;u<a.length;u++)a[u]=new rd(s-a[u].getY()-1,a[u].getX());return n}throw new eW}},t.prototype.reset=function(){},t.prototype.doDecode=function(t,e){var r,n=t.getWidth(),o=t.getHeight(),i=new eD(n),a=e&&!0===e.get(eM.TRY_HARDER),s=Math.max(1,o>>(a?8:5));r=a?o:15;for(var u=Math.trunc(o/2),c=0;c<r;c++){var f=Math.trunc((c+1)/2),h=u+s*((1&c)==0?f:-f);if(h<0||h>=o)break;try{i=t.getBlackRow(h,i)}catch(t){continue}for(var l=this,d=0;d<2;d++){var p=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(eM.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach(function(t,e){return r.set(e,t)}),r.delete(eM.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=l.decodeRow(h,i,e);if(1===t){o.putMetadata(e5.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new rd(n-a[0].getX()-1,a[0].getY()),a[1]=new rd(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(t){}}(d);if("object"==typeof p)return p.value}}throw new eW},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o<n;o++)r[o]=0;var i=t.getSize();if(e>=i)throw new eW;for(var a=!t.get(e),s=0,u=e;u<i;){if(t.get(u)!==a)r[s]++;else if(++s===n)break;else r[s]=1,a=!a;u++}if(s!==n&&(s!==n-1||u!==i))throw new eW},t.recordPatternInReverse=function(e,r,n){for(var o=n.length,i=e.get(r);r>0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new eW;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;a<n;a++)o+=t[a],i+=e[a];if(o<i)return 1/0;var s=o/i;r*=s;for(var u=0,c=0;c<n;c++){var f=t[c],h=e[c]*s,l=f>h?f-h:h-f;if(l>r)return 1/0;u+=l}return u/o},t}(),rb=(N=function(t,e){return(N=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rb(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u<r;u++)if(t.get(u)!==s)i[o]++;else{if(5===o){for(var c=e.MAX_AVG_VARIANCE,f=-1,h=e.CODE_START_A;h<=e.CODE_START_C;h++){var l=rT.patternMatchVariance(i,e.CODE_PATTERNS[h],e.MAX_INDIVIDUAL_VARIANCE);l<c&&(c=l,f=h)}if(f>=0&&t.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,f]);a+=i[0]+i[1],(i=i.slice(2,i.length))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new eW},e.decodeCode=function(t,r,n){rT.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a<e.CODE_PATTERNS.length;a++){var s=e.CODE_PATTERNS[a],u=this.patternMatchVariance(r,s,e.MAX_INDIVIDUAL_VARIANCE);u<o&&(o=u,i=a)}if(i>=0)return i;throw new eW},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(eM.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],u=0,c=new Uint8Array(20);switch(c[u++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new eB}for(var f=!1,h=!1,l="",d=a[0],p=a[1],g=Int32Array.from([0,0,0,0,0,0]),y=0,w=0,v=s,_=0,m=!0,C=!1,A=!1;!f;){var E=h;switch(h=!1,y=w,w=e.decodeCode(r,g,p),c[u++]=w,w!==e.CODE_STOP&&(m=!0),w!==e.CODE_STOP&&(v+=++_*w),d=p,p+=g.reduce(function(t,e){return t+e},0),w){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new eB}switch(o){case e.CODE_CODE_A:if(w<64)A===C?l+=String.fromCharCode(32+w):l+=String.fromCharCode(32+w+128),A=!1;else if(w<96)A===C?l+=String.fromCharCode(w-64):l+=String.fromCharCode(w+64),A=!1;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:i&&(0===l.length?l+="]C1":l+="\x1d");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!C&&A?(C=!0,A=!1):C&&A?(C=!1,A=!1):A=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0}break;case e.CODE_CODE_B:if(w<96)A===C?l+=String.fromCharCode(32+w):l+=String.fromCharCode(32+w+128),A=!1;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:i&&(0===l.length?l+="]C1":l+="\x1d");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!C&&A?(C=!0,A=!1):C&&A?(C=!1,A=!1):A=!0;break;case e.CODE_SHIFT:h=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0}break;case e.CODE_CODE_C:if(w<100)w<10&&(l+="0"),l+=w;else switch(w!==e.CODE_STOP&&(m=!1),w){case e.CODE_FNC_1:i&&(0===l.length?l+="]C1":l+="\x1d");break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:f=!0}}E&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var I=p-d;if(p=r.getNextUnset(p),!r.isRange(p,Math.min(r.getSize(),p+(p-d)/2),!1))throw new eW;if((v-=_*y)%103!==y)throw new eC;var S=l.length;if(0===S)throw new eW;S>0&&m&&(l=o===e.CODE_CODE_C?l.substring(0,S-2):l.substring(0,S-1));for(var T=(a[1]+a[0])/2,b=d+I/2,O=c.length,R=new Uint8Array(O),N=0;N<O;N++)R[N]=c[N];return new e8(l,R,0,[new rd(T,t),new rd(b,t)],e6.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,e}(rT),rR=(D=function(t,e){return(D=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rN=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rD=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return rR(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u,c,f,h=this.counters;h.fill(0),this.decodeRowResult="";var l=e.findAsteriskPattern(r,h),d=r.getNextSet(l[1]),p=r.getSize();do{e.recordPattern(r,d,h);var g=e.toNarrowWidePattern(h);if(g<0)throw new eW;u=e.patternToChar(g),this.decodeRowResult+=u,c=d;try{for(var y=(o=void 0,rN(h)),w=y.next();!w.done;w=y.next()){var v=w.value;d+=v}}catch(t){o={error:t}}finally{try{w&&!w.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}d=r.getNextSet(d)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var _=0;try{for(var m=rN(h),C=m.next();!C.done;C=m.next()){var v=C.value;_+=v}}catch(t){a={error:t}}finally{try{C&&!C.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}var A=d-c-_;if(d!==p&&2*A<_)throw new eW;if(this.usingCheckDigit){for(var E=this.decodeRowResult.length-1,I=0,S=0;S<E;S++)I+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(S));if(this.decodeRowResult.charAt(E)!==e.ALPHABET_STRING.charAt(I%43))throw new eC;this.decodeRowResult=this.decodeRowResult.substring(0,E)}if(0===this.decodeRowResult.length)throw new eW;f=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var T=(l[1]+l[0])/2,b=c+_/2;return new e8(f,null,0,[new rd(T,t),new rd(b,t)],e6.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(t,r){for(var n=t.getSize(),o=t.getNextSet(0),i=0,a=o,s=!1,u=r.length,c=o;c<n;c++)if(t.get(c)!==s)r[i]++;else{if(i===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&t.isRange(Math.max(0,a-Math.floor((c-a)/2)),a,!1))return[a,c];a+=r[0]+r[1],r.copyWithin(0,2,2+i-1),r[i-1]=0,r[i]=0,i--}else i++;r[i]=1,s=!s}throw new eW},e.toNarrowWidePattern=function(t){var e,r,n,o=t.length,i=0;do{var a=0x7fffffff;try{for(var s=(e=void 0,rN(t)),u=s.next();!u.done;u=s.next()){var c=u.value;c<a&&c>i&&(a=c)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var f=0,h=0,l=0;l<o;l++){var c=t[l];c>i&&(h|=1<<o-1-l,n++,f+=c)}if(3===n){for(var l=0;l<o&&n>0;l++){var c=t[l];if(c>i&&(n--,2*c>=f))return -1}return h}}while(n>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 eW},e.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if("+"===o||"$"===o||"%"===o||"/"===o){var i=t.charAt(n+1),a="\0";switch(o){case"+":if(i>="A"&&i<="Z")a=String.fromCharCode(i.charCodeAt(0)+32);else throw new eB;break;case"$":if(i>="A"&&i<="Z")a=String.fromCharCode(i.charCodeAt(0)-64);else throw new eB;break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else if("X"===i||"Y"===i||"Z"===i)a="";else throw new eB;break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else if("Z"===i)a=":";else throw new eB}r+=a,n++}else r+=o}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,e}(rT),rM=(M=function(t,e){return(M=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}M(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rP=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rB=function(t){function e(){var e=t.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return rM(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u,c,f=this.findAsteriskPattern(r),h=r.getNextSet(f[1]),l=r.getSize(),d=this.counters;d.fill(0),this.decodeRowResult="";do{e.recordPattern(r,h,d);var p=this.toPattern(d);if(p<0)throw new eW;u=this.patternToChar(p),this.decodeRowResult+=u,c=h;try{for(var g=(o=void 0,rP(d)),y=g.next();!y.done;y=g.next()){var w=y.value;h+=w}}catch(t){o={error:t}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}h=r.getNextSet(h)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var _=rP(d),m=_.next();!m.done;m=_.next()){var w=m.value;v+=w}}catch(t){a={error:t}}finally{try{m&&!m.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(h===l||!r.get(h)||this.decodeRowResult.length<2)throw new eW;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var C=this.decodeExtended(this.decodeRowResult),A=(f[1]+f[0])/2,E=c+v/2;return new e8(C,null,0,[new rd(A,t),new rd(E,t)],e6.CODE_93,new Date().getTime())},e.prototype.findAsteriskPattern=function(t){var r=t.getSize(),n=t.getNextSet(0);this.counters.fill(0);for(var o=this.counters,i=n,a=!1,s=o.length,u=0,c=n;c<r;c++)if(t.get(c)!==a)o[u]++;else{if(u===s-1){if(this.toPattern(o)===e.ASTERISK_ENCODING)return new Int32Array([i,c]);i+=o[0]+o[1],o.copyWithin(0,2,2+u-1),o[u-1]=0,o[u]=0,u--}else u++;o[u]=1,a=!a}throw new eW},e.prototype.toPattern=function(t){var e,r,n=0;try{for(var o=rP(t),i=o.next();!i.done;i=o.next()){var a=i.value;n+=a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}for(var s=0,u=t.length,c=0;c<u;c++){var f=Math.round(9*t[c]/n);if(f<1||f>4)return -1;if((1&c)==0)for(var h=0;h<f;h++)s=s<<1|1;else s<<=f}return s},e.prototype.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);throw new eW},e.prototype.decodeExtended=function(t){for(var e=t.length,r="",n=0;n<e;n++){var o=t.charAt(n);if(o>="a"&&o<="d"){if(n>=e-1)throw new eB;var i=t.charAt(n+1),a="\0";switch(o){case"d":if(i>="A"&&i<="Z")a=String.fromCharCode(i.charCodeAt(0)+32);else throw new eB;break;case"a":if(i>="A"&&i<="Z")a=String.fromCharCode(i.charCodeAt(0)-64);else throw new eB;break;case"b":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else if(i>="X"&&i<="Z")a="";else throw new eB;break;case"c":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else if("Z"===i)a=":";else throw new eB}r+=a,n++}else r+=o}return r},e.prototype.checkChecksums=function(t){var e=t.length;this.checkOneChecksum(t,e-2,20),this.checkOneChecksum(t,e-1,15)},e.prototype.checkOneChecksum=function(t,r,n){for(var o=1,i=0,a=r-1;a>=0;a--)i+=o*e.ALPHABET_STRING.indexOf(t.charAt(a)),++o>n&&(o=1);if(t.charAt(r)!==e.ALPHABET_STRING[i%47])throw new eC},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e}(rT),rL=(P=function(t,e){return(P=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}P(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rx=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rF=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return rL(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),u=new eU;e.decodeMiddle(r,a[1],s[0],u);var c=u.toString(),f=null;null!=n&&(f=n.get(eM.ALLOWED_LENGTHS)),null==f&&(f=e.DEFAULT_ALLOWED_LENGTHS);var h=c.length,l=!1,d=0;try{for(var p=rx(f),g=p.next();!g.done;g=p.next()){var y=g.value;if(h===y){l=!0;break}y>d&&(d=y)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!l&&h>d&&(l=!0),!l)throw new eB;return new e8(c,null,0,[new rd(a[1],t),new rd(s[0],t)],e6.ITF,new Date().getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r<n;){rT.recordPattern(t,r,i);for(var u=0;u<5;u++){var c=2*u;a[u]=i[c],s[u]=i[c+1]}var f=e.decodeDigit(a);o.append(f.toString()),f=this.decodeDigit(s),o.append(f.toString()),i.forEach(function(t){r+=t})}},e.prototype.decodeStart=function(t){var r=e.skipWhiteSpace(t),n=e.findGuardPattern(t,r,e.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n},e.prototype.validateQuietZone=function(t,e){var r=10*this.narrowLineWidth;r=r<e?r:e;for(var n=e-1;r>0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new eW},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new eW;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(o){o instanceof eW&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,u=0,c=r;i.fill(0);for(var f=r;f<a;f++)if(t.get(f)!==s)i[u]++;else{if(u===o-1){if(rT.patternMatchVariance(i,n,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[c,f];c+=i[0]+i[1],eE.arraycopy(i,2,i,0,u-1),i[u-1]=0,i[u]=0,u--}else u++;i[u]=1,s=!s}throw new eW},e.decodeDigit=function(t){for(var r=e.MAX_AVG_VARIANCE,n=-1,o=e.PATTERNS.length,i=0;i<o;i++){var a=e.PATTERNS[i],s=rT.patternMatchVariance(t,a,e.MAX_INDIVIDUAL_VARIANCE);s<r?(r=s,n=i):s===r&&(n=-1)}if(n>=0)return n%10;throw new eW},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])],e}(rT),rk=(B=function(t,e){return(B=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}B(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return rk(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){var o=t.charAt(n).charCodeAt(0)-48;if(o<0||o>9)throw new eB;r+=o}r*=3;for(var n=e-2;n>=0;n-=2){var o=t.charAt(n).charCodeAt(0)-48;if(o<0||o>9)throw new eB;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,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,o,i){var a=t.getSize();r=n?t.getNextUnset(r):t.getNextSet(r);for(var s=0,u=r,c=o.length,f=n,h=r;h<a;h++)if(t.get(h)!==f)i[s]++;else{if(s===c-1){if(rT.patternMatchVariance(i,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,h]);u+=i[0]+i[1];for(var l=i.slice(2,i.length),d=0;d<s-1;d++)i[d]=l[d];i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,f=!f}throw new eW},e.decodeDigit=function(t,r,n,o){this.recordPattern(t,n,r);for(var i=this.MAX_AVG_VARIANCE,a=-1,s=o.length,u=0;u<s;u++){var c=o[u],f=rT.patternMatchVariance(r,c,e.MAX_INDIVIDUAL_VARIANCE);f<i&&(i=f,a=u)}if(a>=0)return a;throw new eW},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])],e}(rT),rH=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rU=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=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=new e8(a,null,0,[new rd((n[0]+n[1])/2,e),new rd(i,e)],e6.UPC_EAN_EXTENSION,new Date().getTime());return null!=s&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],c=0,f=0;f<5&&u<s;f++){var h=rV.decodeDigit(e,a,u,rV.L_AND_G_PATTERNS);n+=String.fromCharCode(48+h%10);try{for(var l=(o=void 0,rH(a)),d=l.next();!d.done;d=l.next()){var p=d.value;u+=p}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}h>=10&&(c|=1<<4-f),4!==f&&(u=e.getNextSet(u),u=e.getNextUnset(u))}if(5!==n.length)throw new eW;var g=this.determineCheckDigit(c);if(t.extensionChecksum(n.toString())!==g)throw new eW;return u},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-48;r*=3;for(var n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-48;return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new eW},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[e5.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){switch(t.charAt(0)){case"0":e="\xa3";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=""}var e,r=parseInt(t.substring(1)),n=(r/100).toString(),o=r%100;return e+n+"."+(o<10?"0"+o:o.toString())},t}(),rX=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rG=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=new e8(a,null,0,[new rd((n[0]+n[1])/2,e),new rd(i,e)],e6.UPC_EAN_EXTENSION,new Date().getTime());return null!=s&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],u=0,c=0;c<2&&s<a;c++){var f=rV.decodeDigit(t,i,s,rV.L_AND_G_PATTERNS);r+=String.fromCharCode(48+f%10);try{for(var h=(n=void 0,rX(i)),l=h.next();!l.done;l=h.next()){var d=l.value;s+=d}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}f>=10&&(u|=1<<1-c),1!==c&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length||parseInt(r.toString())%4!==u)throw new eW;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[e5.ISSUE_NUMBER,parseInt(t)]])},t}(),rW=function(){function t(){}return t.decodeRow=function(t,e,r){var n=rV.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new rU().decodeRow(t,e,n)}catch(r){return new rG().decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),rz=(L=function(t,e){return(L=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}L(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rj=function(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++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[n]=i}return r}return rz(e,t),e.prototype.decodeRow=function(t,r,n){var o=e.findStartGuardPattern(r),i=null==n?null:n.get(eM.NEED_RESULT_POINT_CALLBACK);if(null!=i){var a=new rd((o[0]+o[1])/2,t);i.foundPossibleResultPoint(a)}var s=this.decodeMiddle(r,o,this.decodeRowStringBuffer),u=s.rowOffset,c=s.resultString;if(null!=i){var f=new rd(u,t);i.foundPossibleResultPoint(f)}var h=e.decodeEnd(r,u);if(null!=i){var l=new rd((h[0]+h[1])/2,t);i.foundPossibleResultPoint(l)}var d=h[1],p=d+(d-h[0]);if(p>=r.getSize()||!r.isRange(d,p,!1))throw new eW;var g=c.toString();if(g.length<8)throw new eB;if(!e.checkChecksum(g))throw new eC;var y=(o[1]+o[0])/2,w=(h[1]+h[0])/2,v=this.getBarcodeFormat(),_=new e8(g,null,0,[new rd(y,t),new rd(w,t)],v,new Date().getTime()),m=0;try{var C=rW.decodeRow(t,r,h[1]);_.putMetadata(e5.UPC_EAN_EXTENSION,C.getText()),_.putAllMetadata(C.getResultMetadata()),_.addResultPoints(C.getResultPoints()),m=C.getText().length}catch(t){}var A=null==n?null:n.get(eM.ALLOWED_EAN_EXTENSIONS);if(null!=A){var E=!1;for(var I in A)if(m.toString()===I){E=!0;break}if(!E)throw new eW}return v===e6.EAN_13||e6.UPC_A,_},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){var o=t.charAt(n).charCodeAt(0)-48;if(o<0||o>9)throw new eB;r+=o}r*=3;for(var n=e-2;n>=0;n-=2){var o=t.charAt(n).charCodeAt(0)-48;if(o<0||o>9)throw new eB;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(rV),rY=(x=function(t,e){return(x=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}x(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rZ=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rK=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return rY(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=t.getSize(),f=r[1],h=0,l=0;l<6&&f<c;l++){var d=rj.decodeDigit(t,u,f,rj.L_AND_G_PATTERNS);n+=String.fromCharCode(48+d%10);try{for(var p=(o=void 0,rZ(u)),g=p.next();!g.done;g=p.next()){var y=g.value;f+=y}}catch(t){o={error:t}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}d>=10&&(h|=1<<5-l)}n=e.determineFirstDigit(n,h),f=rj.findGuardPattern(t,f,!0,rj.MIDDLE_PATTERN,new Int32Array(rj.MIDDLE_PATTERN.length).fill(0))[1];for(var l=0;l<6&&f<c;l++){var d=rj.decodeDigit(t,u,f,rj.L_PATTERNS);n+=String.fromCharCode(48+d);try{for(var w=(a=void 0,rZ(u)),v=w.next();!v.done;v=w.next()){var y=v.value;f+=y}}catch(t){a={error:t}}finally{try{v&&!v.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}return{rowOffset:f,resultString:n}},e.prototype.getBarcodeFormat=function(){return e6.EAN_13},e.determineFirstDigit=function(t,e){for(var r=0;r<10;r++)if(e===this.FIRST_DIGIT_ENCODINGS[r])return String.fromCharCode(48+r)+t;throw new eW},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(rj),rq=(F=function(t,e){return(F=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}F(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),rQ=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rJ=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return rq(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=t.getSize(),c=e[1],f=0;f<4&&c<u;f++){var h=rj.decodeDigit(t,s,c,rj.L_PATTERNS);r+=String.fromCharCode(48+h);try{for(var l=(n=void 0,rQ(s)),d=l.next();!d.done;d=l.next()){var p=d.value;c+=p}}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}}c=rj.findGuardPattern(t,c,!0,rj.MIDDLE_PATTERN,new Int32Array(rj.MIDDLE_PATTERN.length).fill(0))[1];for(var f=0;f<4&&c<u;f++){var h=rj.decodeDigit(t,s,c,rj.L_PATTERNS);r+=String.fromCharCode(48+h);try{for(var g=(i=void 0,rQ(s)),y=g.next();!y.done;y=g.next()){var p=y.value;c+=p}}catch(t){i={error:t}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}return{rowOffset:c,resultString:r}},e.prototype.getBarcodeFormat=function(){return e6.EAN_8},e}(rj),r$=(k=function(t,e){return(k=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}k(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),r1=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ean13Reader=new rK,e}return r$(e,t),e.prototype.getBarcodeFormat=function(){return e6.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("0"===e.charAt(0)){var r=new e8(e.substring(1),null,null,t.getResultPoints(),e6.UPC_A);return null!=t.getResultMetadata()&&r.putAllMetadata(t.getResultMetadata()),r}throw new eW},e.prototype.reset=function(){this.ean13Reader.reset()},e}(rj),r2=(V=function(t,e){return(V=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}V(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),r0=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r3=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return r2(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map(function(t){return t});a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],c=0,f=0;f<6&&u<s;f++){var h=e.decodeDigit(t,a,u,e.L_AND_G_PATTERNS);n+=String.fromCharCode(48+h%10);try{for(var l=(o=void 0,r0(a)),d=l.next();!d.done;d=l.next()){var p=d.value;u+=p}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}h>=10&&(c|=1<<5-f)}return e.determineNumSysAndCheckDigit(new eU(n),c),u},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return rj.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 eW.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return e6.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map(function(t){return t.charCodeAt(0)}),r=new eU;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)}return t.length>=8&&r.append(t.charAt(7)),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])],e}(rj),r4=(H=function(t,e){return(H=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}H(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),r8=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r6=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(eM.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(e6.EAN_13)>-1&&o.push(new rK),n.indexOf(e6.UPC_A)>-1&&o.push(new r1),n.indexOf(e6.EAN_8)>-1&&o.push(new rJ),n.indexOf(e6.UPC_E)>-1&&o.push(new r3)),0===o.length&&(o.push(new rK),o.push(new r1),o.push(new rJ),o.push(new r3)),r.readers=o,r}return r4(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=r8(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var u=s.decodeRow(t,e,r),c=u.getBarcodeFormat()===e6.EAN_13&&"0"===u.getText().charAt(0),f=null==r?null:r.get(eM.POSSIBLE_FORMATS),h=null==f||f.includes(e6.UPC_A);if(c&&h){var l=u.getRawBytes(),d=new e8(u.getText().substring(1),l,l?l.length:null,u.getResultPoints(),e6.UPC_A);return d.putAllMetadata(u.getResultMetadata()),d}return u}catch(t){}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new eW},e.prototype.reset=function(){var t,e;try{for(var r=r8(this.readers),n=r.next();!n.done;n=r.next())n.value.reset()}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(rT),r5=(U=function(t,e){return(U=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}U(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),r7=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return r5(e,t),e.prototype.decodeRow=function(t,e,r){var n=this.getValidRowData(e);if(!n)throw new eW;var o=this.codaBarDecodeRow(n.row);if(!o)throw new eW;return new e8(o,null,0,[new rd(n.left,t),new rd(n.right,t)],e6.CODABAR,new Date().getTime())},e.prototype.getValidRowData=function(t){var e=t.toArray(),r=e.indexOf(!0);if(-1===r)return null;var n=e.lastIndexOf(!0);if(n<=r)return null;e=e.slice(r,n+1);for(var o=[],i=e[0],a=1,s=1;s<e.length;s++)e[s]===i?a++:(i=e[s],o.push(a),a=1);return(o.push(a),o.length<23&&(o.length+1)%8!=0)?null:{row:o,left:r,right:n}},e.prototype.codaBarDecodeRow=function(t){for(var e=[],r=Math.ceil(t.reduce(function(t,e){return(t+e)/2},0));t.length>0;){var n=t.splice(0,8).splice(0,7).map(function(t){return t<r?"n":"w"}).join("");if(void 0===this.CODA_BAR_CHAR_SET[n])return null;e.push(this.CODA_BAR_CHAR_SET[n])}var o=e.join("");return this.validCodaBarString(o)?o:null},e.prototype.validCodaBarString=function(t){return/^[A-D].{1,}[A-D]$/.test(t)},e}(rT),r9=(X=function(t,e){return(X=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}X(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nt=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ne=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=[,,,,],e.evenRoundingErrors=[,,,,],e.oddCounts=Array(e.dataCharacterCounters.length/2),e.evenCounts=Array(e.dataCharacterCounters.length/2),e}return r9(e,t),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(rT.patternMatchVariance(t,r[n],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return n;throw new eW},e.count=function(t){return rh.sum(new Int32Array(t))},e.increment=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]>n&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o<t.length;o++)e[o]<n&&(n=e[o],r=o);t[r]--},e.isFinderPattern=function(t){var r,n,o=t[0]+t[1],i=o+t[2]+t[3],a=o/i;if(a>=e.MIN_FINDER_PATTERN_RATIO&&a<=e.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=nt(t),f=c.next();!f.done;f=c.next()){var h=f.value;h>u&&(u=h),h<s&&(s=h)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return u<10*s}return!1},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,e}(rT),nr=function(){function t(t,e){this.value=t,this.checksumPortion=e}return 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){return e instanceof t&&this.value===e.value&&this.checksumPortion===e.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),nn=function(){function t(t,e,r,n,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=[],this.resultPoints.push(new rd(r,o)),this.resultPoints.push(new rd(n,o))}return 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){return e instanceof t&&this.value===e.value},t.prototype.hashCode=function(){return this.value},t}(),no=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ni=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=no(e),u=s.next();!u.done;u=s.next()){var c=u.value;a+=c}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var f=0,h=0,l=e.length,d=0;d<l-1;d++){var p=void 0;for(p=1,h|=1<<d;p<e[d];p++,h&=~(1<<d)){var g=t.combins(a-p-1,l-d-2);if(n&&0===h&&a-p-(l-d-1)>=l-d-1&&(g-=t.combins(a-p-(l-d),l-d-2)),l-d-1>1){for(var y=0,w=a-p-(l-d-2);w>r;w--)y+=t.combins(a-p-w-1,l-d-3);g-=y*(l-1-d)}else a-p>r&&g--;f+=g}a-=p}return f},t.combins=function(t,e){t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var r,n,o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),na=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new eD(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)(o&1<<i)!=0&&r.set(n),n++;for(var i=1;i<t.length;++i){for(var a=t[i],s=a.getLeftChar().getValue(),u=11;u>=0;--u)(s&1<<u)!=0&&r.set(n),n++;if(null!==a.getRightChar())for(var c=a.getRightChar().getValue(),u=11;u>=0;--u)(c&1<<u)!=0&&r.set(n),n++}return r},t}(),ns=function(){function t(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),nu=function(){function t(t){this.newPosition=t}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),nc=(G=function(t,e){return(G=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}G(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nf=function(t){function e(e,r){var n=t.call(this,e)||this;return n.value=r,n}return nc(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(nu),nh=(W=function(t,e){return(W=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}W(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nl=function(t){function e(e,r,n){var o=t.call(this,e)||this;return n?(o.remaining=!0,o.remainingValue=o.remainingValue):(o.remaining=!1,o.remainingValue=0),o.newString=r,o}return nh(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(nu),nd=(z=function(t,e){return(z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}z(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),np=function(t){function e(e,r,n){var o=t.call(this,e)||this;if(r<0||r>10||n<0||n>10)throw new eB;return o.firstDigit=r,o.secondDigit=n,o}return nd(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+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,e}(nu),ng=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ny=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){if(!e)return null;if(e.length<2)throw new eW;var r,n,o,i,a,s,u,c,f=e.substring(0,2);try{for(var h=ng(t.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next()){var d=l.value;if(d[0]===f){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{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new eW;var p=e.substring(0,3);try{for(var g=ng(t.THREE_DIGIT_DATA_LENGTH),y=g.next();!y.done;y=g.next()){var d=y.value;if(d[0]===p){if(d[1]===t.VARIABLE_LENGTH)return t.processVariableAI(3,d[2],e);return t.processFixedAI(3,d[1],e)}}}catch(t){o={error:t}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}try{for(var w=ng(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),v=w.next();!v.done;v=w.next()){var d=v.value;if(d[0]===p){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{v&&!v.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}if(e.length<4)throw new eW;var _=e.substring(0,4);try{for(var m=ng(t.FOUR_DIGIT_DATA_LENGTH),C=m.next();!C.done;C=m.next()){var d=C.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){u={error:t}}finally{try{C&&!C.done&&(c=m.return)&&c.call(m)}finally{if(u)throw u.error}}throw new eW},t.processFixedAI=function(e,r,n){if(n.length<e)throw new eW;var o=n.substring(0,e);if(n.length<e+r)throw new eW;var i=n.substring(e,e+r),a=n.substring(e+r),s="("+o+")"+i,u=t.parseFieldsInGeneralPurpose(a);return null==u?s:s+u},t.processVariableAI=function(e,r,n){var o,i=n.substring(0,e);o=n.length<e+r?n.length:e+r;var a=n.substring(e,o),s=n.substring(o),u="("+i+")"+a,c=t.parseFieldsInGeneralPurpose(s);return null==c?u:u+c},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]],t}(),nw=function(){function t(t){this.buffer=new eU,this.information=t}return t.prototype.decodeAllCodes=function(t,e){for(var r=e,n=null;;){var o=this.decodeGeneralPurposeField(r,n),i=ny.parseFieldsInGeneralPurpose(o.getNewString());if(null!=i&&t.append(i),n=o.isRemaining()?""+o.getRemainingValue():null,r===o.getNewPosition())break;r=o.getNewPosition()}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!0;return this.information.get(t+3)},t.prototype.decodeNumeric=function(t){if(t+7>this.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return 0===e?new np(this.information.getSize(),np.FNC1,np.FNC1):new np(this.information.getSize(),e-1,np.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new np(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;o<r;++o)t.get(e+o)&&(n|=1<<r-o-1);return n},t.prototype.decodeGeneralPurposeField=function(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);var r=this.parseBlocks();return null!=r&&r.isRemaining()?new nl(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new nl(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){do{var t,e,r=this.current.getPosition();if(t=this.current.isAlpha()?(e=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(e=this.parseIsoIec646Block()).isFinished():(e=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){var e=void 0;return new ns(!0,e=t.isSecondDigitFNC1()?new nl(this.current.getPosition(),this.buffer.toString()):new nl(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()))}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){var e=new nl(this.current.getPosition(),this.buffer.toString());return new ns(!0,e)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new ns(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1())return new ns(!0,new nl(this.current.getPosition(),this.buffer.toString()));this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new ns(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1())return new ns(!0,new nl(this.current.getPosition(),this.buffer.toString()));this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new ns(!1)},t.prototype.isStillIsoIec646=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e,r=this.extractNumericValueFromBitArray(t,5);if(15===r)return new nf(t+5,nf.FNC1);if(r>=5&&r<15)return new nf(t+5,"0"+(r-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new nf(t+7,""+(n+1));if(n>=90&&n<116)return new nf(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:e="!";break;case 233:e='"';break;case 234:e="%";break;case 235:e="&";break;case 236:e="'";break;case 237:e="(";break;case 238:e=")";break;case 239:e="*";break;case 240:e="+";break;case 241:e=",";break;case 242:e="-";break;case 243:e=".";break;case 244:e="/";break;case 245:e=":";break;case 246:e=";";break;case 247:e="<";break;case 248:e="=";break;case 249:e=">";break;case 250:e="?";break;case 251:e="_";break;case 252:e=" ";break;default:throw new eB}return new nf(t+8,e)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e,r=this.extractNumericValueFromBitArray(t,5);if(15===r)return new nf(t+5,nf.FNC1);if(r>=5&&r<15)return new nf(t+5,"0"+(r-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new nf(t+6,""+(n+33));switch(n){case 58:e="*";break;case 59:e=",";break;case 60:e="-";break;case 61:e=".";break;case 62:e="/";break;default:throw new ru("Decoding invalid alphanumeric value: "+n)}return new nf(t+6,e)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(t){if(t+3>this.information.getSize())return!1;for(var e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0},t}(),nv=function(){function t(t){this.information=t,this.generalDecoder=new nw(t)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),n_=(j=function(t,e){return(j=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}j(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nm=function(t){function e(e){return t.call(this,e)||this}return n_(e,t),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 o=0;o<4;++o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*o,10);i/100==0&&t.append("0"),i/10==0&&t.append("0"),t.append(i)}e.appendCheckDigit(t,n)},e.appendCheckDigit=function(t,e){for(var r=0,n=0;n<13;n++){var o=t.charAt(n+e).charCodeAt(0)-48;r+=(1&n)==0?3*o:o}10==(r=10-r%10)&&(r=0),t.append(r)},e.GTIN_SIZE=40,e}(nv),nC=(Y=function(t,e){return(Y=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nA=function(t){function e(e){return t.call(this,e)||this}return nC(e,t),e.prototype.parseInformation=function(){var t=new eU;t.append("(01)");var r=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(nm),nE=(Z=function(t,e){return(Z=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}Z(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nI=function(t){function e(e){return t.call(this,e)||this}return nE(e,t),e.prototype.parseInformation=function(){var t=new eU;return this.getGeneralDecoder().decodeAllCodes(t,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(nv),nS=(K=function(t,e){return(K=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}K(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nT=function(t){function e(e){return t.call(this,e)||this}return nS(e,t),e.prototype.encodeCompressedWeight=function(t,e,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,r);this.addWeightCode(t,n);for(var o=this.checkWeight(n),i=1e5,a=0;a<5;++a)o/i==0&&t.append("0"),i/=10;t.append(o)},e}(nm),nb=(q=function(t,e){return(q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}q(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nO=function(t){function e(e){return t.call(this,e)||this}return nb(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+nT.GTIN_SIZE+e.WEIGHT_SIZE)throw new eW;var t=new eU;return this.encodeCompressedGtin(t,e.HEADER_SIZE),this.encodeCompressedWeight(t,e.HEADER_SIZE+nT.GTIN_SIZE,e.WEIGHT_SIZE),t.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(nT),nR=(Q=function(t,e){return(Q=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}Q(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nN=function(t){function e(e){return t.call(this,e)||this}return nR(e,t),e.prototype.addWeightCode=function(t,e){t.append("(3103)")},e.prototype.checkWeight=function(t){return t},e}(nO),nD=(J=function(t,e){return(J=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}J(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nM=function(t){function e(e){return t.call(this,e)||this}return nD(e,t),e.prototype.addWeightCode=function(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")},e.prototype.checkWeight=function(t){return t<1e4?t:t-1e4},e}(nO),nP=($=function(t,e){return($=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nB=function(t){function e(e){return t.call(this,e)||this}return nP(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+nm.GTIN_SIZE)throw new eW;var t=new eU;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+nm.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(392"),t.append(r),t.append(")");var n=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+nm.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(nm),nL=(tt=function(t,e){return(tt=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nx=function(t){function e(e){return t.call(this,e)||this}return nL(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+nm.GTIN_SIZE)throw new eW;var t=new eU;this.encodeCompressedGtin(t,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+nm.GTIN_SIZE,e.LAST_DIGIT_SIZE);t.append("(393"),t.append(r),t.append(")");var n=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+nm.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+nm.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return t.append(o.getNewString()),t.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(nm),nF=(te=function(t,e){return(te=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}te(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nk=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.dateCode=n,o.firstAIdigits=r,o}return nF(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!==e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new eW;var t=new eU;return 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),t.toString()},e.prototype.encodeCompressedDate=function(t,r){var n=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(38400!==n){t.append("("),t.append(this.dateCode),t.append(")");var o=n%32,i=(n/=32)%12+1,a=n/=12;a/10==0&&t.append("0"),t.append(a),i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o)}},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=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(nT),nV=function(){function t(t,e,r,n){this.leftchar=t,this.rightchar=e,this.finderpattern=r,this.maybeLast=n}return 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 null==this.rightchar},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,r){return e instanceof t&&t.equalsOrNull(e.leftchar,r.leftchar)&&t.equalsOrNull(e.rightchar,r.rightchar)&&t.equalsOrNull(e.finderpattern,r.finderpattern)},t.equalsOrNull=function(e,r){return null===e?null===r:t.equals(e,r)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),nH=function(){function t(t,e,r){this.pairs=t,this.rowNumber=e,this.wasReversed=r}return 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){return e instanceof t&&this.checkEqualitity(e,r)&&e.wasReversed===r.wasReversed},t.prototype.checkEqualitity=function(t,e){var r;if(t&&e)return t.forEach(function(t,n){e.forEach(function(e){t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),nU=(tr=function(t,e){return(tr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tr(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nX=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nG=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=Array(e.MAX_PAIRS),r.rows=[],r.startEnd=[2],r}return nU(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(t){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof eW){if(!this.pairs.length)throw new eW;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o||null!=(o=this.checkRowsBoolean(!0)))return o}throw new eW},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows([],0)}catch(t){console.log(t)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;i<this.rows.length;i++){var a=this.rows[i];this.pairs.length=0;try{for(var s=(n=void 0,nX(t)),u=s.next();!u.done;u=s.next()){var c=u.value;this.pairs.push(c.getPairs())}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}if(this.pairs.push(a.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var f=Array(t);f.push(a);try{return this.checkRows(f,i+1)}catch(t){console.log(t)}}}throw new eW},e.isValidSequence=function(t){var r,n;try{for(var o=nX(e.FINDER_PATTERN_SEQUENCES),i=o.next();!i.done;i=o.next()){var a=i.value;if(!(t.length>a.length)){for(var s=!0,u=0;u<t.length;u++)if(t[u].getFinderPattern().getValue()!==a[u]){s=!1;break}if(s)return!0}}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(t,r){for(var n=0,o=!1,i=!1;n<this.rows.length;){var a=this.rows[n];if(a.getRowNumber()>t){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new nH(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var u=nX(e),c=u.next();!c.done;c=u.next()){var f=c.value;if(f.getPairs().length!==t.length)try{for(var h=(o=void 0,nX(f.getPairs())),l=h.next();!l.done;l=h.next()){var d=l.value;try{for(var p=(a=void 0,nX(t)),g=p.next();!g.done;g=p.next()){var y=g.value;if(nV.equals(d,y))break}}catch(t){a={error:t}}finally{try{g&&!g.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var u=nX(e),c=u.next();!c.done;c=u.next()){var f=c.value,h=!0;try{for(var l=(o=void 0,nX(t)),d=l.next();!d.done;d=l.next()){var p=d.value,g=!1;try{for(var y=(a=void 0,nX(f.getPairs())),w=y.next();!w.done;w=y.next()){var v=w.value;if(p.equals(v)){g=!0;break}}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}if(!g){h=!1;break}}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}if(h)return!0}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=(function(t){try{if(t.get(1))return new nA(t);if(!t.get(2))return new nI(t);switch(nw.extractNumericValueFromBitArray(t,1,4)){case 4:return new nN(t);case 5:return new nM(t)}switch(nw.extractNumericValueFromBitArray(t,1,5)){case 12:return new nB(t);case 13:return new nx(t)}switch(nw.extractNumericValueFromBitArray(t,1,7)){case 56:return new nk(t,"310","11");case 57:return new nk(t,"320","11");case 58:return new nk(t,"310","13");case 59:return new nk(t,"320","13");case 60:return new nk(t,"310","15");case 61:return new nk(t,"320","15");case 62:return new nk(t,"310","17");case 63:return new nk(t,"320","17")}}catch(e){throw console.log(e),new ru("unknown decoder: "+t)}})(na.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints();return new e8(e,null,null,[r[0],r[1],n[0],n[1]],e6.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null===r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i<this.pairs.size();++i){var a=this.pairs.get(i);n+=a.getLeftChar().getChecksumPortion(),o++;var s=a.getRightChar();null!=s&&(n+=s.getChecksumPortion(),o++)}return 211*(o-4)+(n%=211)===e.getValue()},e.getNextSecondBar=function(t,e){var r;return t.get(e)?(r=t.getNextUnset(e),r=t.getNextSet(r)):(r=t.getNextSet(e),r=t.getNextUnset(r)),r},e.prototype.retrieveNextPair=function(t,r,n){var o,i,a=r.length%2==0;this.startFromEven&&(a=!a);var s=!0,u=-1;do this.findNextPair(t,r,u),null===(o=this.parseFoundFinderPattern(t,n,a))?u=e.getNextSecondBar(t,this.startEnd[0]):s=!1;while(s);var c=this.decodeDataCharacter(t,o,a,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new eW;try{i=this.decodeDataCharacter(t,o,a,!1)}catch(t){i=null,console.log(t)}return new nV(c,i,o,!0)},e.prototype.isEmptyPair=function(t){return 0===t.length},e.prototype.findNextPair=function(t,r,n){var o,i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a=t.getSize();o=n>=0?n:this.isEmptyPair(r)?0:r[r.length-1].getFinderPattern().getStartEnd()[1];var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;o<a&&(u=!t.get(o));)o++;for(var c=0,f=o,h=o;h<a;h++)if(t.get(h)!==u)i[c]++;else{if(3===c){if(s&&e.reverseCounters(i),e.isFinderPattern(i)){this.startEnd[0]=f,this.startEnd[1]=h;return}s&&e.reverseCounters(i),f+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,c--}else c++;i[c]=1,u=!u}throw new eW},e.reverseCounters=function(t){for(var e=t.length,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){if(n){for(var o,i,a,s,u=this.startEnd[0]-1;u>=0&&!t.get(u);)u--;u++,o=this.startEnd[0]-u,i=u,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var c=this.getDecodeFinderCounters();eE.arraycopy(c,0,c,1,c.length-1),c[0]=o;try{s=this.parseFinderValue(c,e.FINDER_PATTERNS)}catch(t){return null}return new nn(s,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)e.recordPatternInReverse(t,r.getStartEnd()[0],i);else{e.recordPattern(t,r.getStartEnd()[1],i);for(var s=0,u=i.length-1;s<u;s++,u--){var c=i[s];i[s]=i[u],i[u]=c}}var f=rh.sum(new Int32Array(i))/17,h=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(f-h)/h>.3)throw new eW;for(var l=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors(),s=0;s<i.length;s++){var y=i[s]/f,w=y+.5;if(w<1){if(y<.3)throw new eW;w=1}else if(w>8){if(y>8.7)throw new eW;w=8}var v=s/2;(1&s)==0?(l[v]=w,p[v]=y-w):(d[v]=w,g[v]=y-w)}this.adjustOddEvenCounts(17);for(var _=4*r.getValue()+2*!n+ +!o-1,m=0,C=0,s=l.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var A=e.WEIGHTS[_][2*s];C+=l[s]*A}m+=l[s]}for(var E=0,s=d.length-1;s>=0;s--)if(e.isNotA1left(r,n,o)){var A=e.WEIGHTS[_][2*s+1];E+=d[s]*A}var I=C+E;if((1&m)!=0||m>13||m<4)throw new eW;var S=(13-m)/2,T=e.SYMBOL_WIDEST[S],b=ni.getRSSvalue(l,T,!0),O=ni.getRSSvalue(d,9-T,!1);return new nr(b*e.EVEN_TOTAL_SUBSET[S]+O+e.GSUM[S],I)},e.isNotA1left=function(t,e,r){return!(0===t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=rh.sum(new Int32Array(this.getOddCounts())),n=rh.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-t,c=(1&r)==1,f=(1&n)==0;if(1===u)if(c){if(f)throw new eW;i=!0}else{if(!f)throw new eW;s=!0}else if(-1===u)if(c){if(f)throw new eW;o=!0}else{if(!f)throw new eW;a=!0}else if(0===u){if(c){if(!f)throw new eW;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(f)throw new eW}else throw new eW;if(o){if(i)throw new eW;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new eW;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&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,e}(ne),nW=(tn=function(t,e){return(tn=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tn(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nz=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.count=0,o.finderPattern=n,o}return nW(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(nr),nj=(to=function(t,e){return(to=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}to(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nY=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nZ=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return nj(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=nY(this.possibleLeftPairs),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.getCount()>1)try{for(var d=(a=void 0,nY(this.possibleRightPairs)),p=d.next();!p.done;p=d.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(l,g))return e.constructResult(l,g)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(t){o={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}throw new eW},e.addOrTally=function(t,e){if(null!=e){var r,n,o=!1;try{for(var i=nY(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=new String(4537077*t.getValue()+e.getValue()).toString(),n=new eU,o=13-r.length;o>0;o--)n.append("0");n.append(r);for(var i=0,o=0;o<13;o++){var a=n.charAt(o).charCodeAt(0)-48;i+=(1&o)==0?3*a:a}10==(i=10-i%10)&&(i=0),n.append(i.toString());var s=t.getFinderPattern().getResultPoints(),u=e.getFinderPattern().getResultPoints();return new e8(n.toString(),null,0,[s[0],s[1],u[0],u[1]],e6.RSS_14,new Date().getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(eM.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new rd(s,r))}var u=this.decodeDataCharacter(t,i,!0),c=this.decodeDataCharacter(t,i,!1);return new nz(1597*u.getValue()+c.getValue(),u.getChecksumPortion()+4*c.getChecksumPortion(),i)}catch(t){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i<o.length;i++)o[i]=0;if(n)rT.recordPatternInReverse(t,r.getStartEnd()[0],o);else{rT.recordPattern(t,r.getStartEnd()[1]+1,o);for(var a=0,s=o.length-1;a<s;a++,s--){var u=o[a];o[a]=o[s],o[s]=u}}for(var c=n?16:15,f=rh.sum(new Int32Array(o))/c,h=this.getOddCounts(),l=this.getEvenCounts(),d=this.getOddRoundingErrors(),p=this.getEvenRoundingErrors(),a=0;a<o.length;a++){var g=o[a]/f,y=Math.floor(g+.5);y<1?y=1:y>8&&(y=8);var w=Math.floor(a/2);(1&a)==0?(h[w]=y,d[w]=g-y):(l[w]=y,p[w]=g-y)}this.adjustOddEvenCounts(n,c);for(var v=0,_=0,a=h.length-1;a>=0;a--)_*=9,_+=h[a],v+=h[a];for(var m=0,C=0,a=l.length-1;a>=0;a--)m*=9,m+=l[a],C+=l[a];var A=_+3*m;if(n){if((1&v)!=0||v>12||v<4)throw new eW;var E=(12-v)/2,I=e.OUTSIDE_ODD_WIDEST[E],S=9-I,T=ni.getRSSvalue(h,I,!1),b=ni.getRSSvalue(l,S,!0),O=e.OUTSIDE_EVEN_TOTAL_SUBSET[E],R=e.OUTSIDE_GSUM[E];return new nr(T*O+b+R,A)}if((1&C)!=0||C>10||C<4)throw new eW;var E=(10-C)/2,I=e.INSIDE_ODD_WIDEST[E],S=9-I,T=ni.getRSSvalue(h,I,!0),b=ni.getRSSvalue(l,S,!1),N=e.INSIDE_ODD_TOTAL_SUBSET[E],R=e.INSIDE_GSUM[E];return new nr(b*N+T+R,A)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i<n&&e!==(o=!t.get(i));)i++;for(var a=0,s=i,u=i;u<n;u++)if(t.get(u)!==o)r[a]++;else{if(3===a){if(ne.isFinderPattern(r))return[s,u];s+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,a--}else a++;r[a]=1,o=!o}throw new eW},e.prototype.parseFoundFinderPattern=function(t,r,n,o){for(var i=t.get(o[0]),a=o[0]-1;a>=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);eE.arraycopy(u,0,c,1,u.length-1),c[0]=s;var f=this.parseFinderValue(c,e.FINDER_PATTERNS),h=a,l=o[1];return n&&(h=t.getSize()-1-h,l=t.getSize()-1-l),new nn(f,[a,o[1]],h,l,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=rh.sum(new Int32Array(this.getOddCounts())),n=rh.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-e,c=(1&r)==+!!t,f=(1&n)==1;if(1===u)if(c){if(f)throw new eW;i=!0}else{if(!f)throw new eW;s=!0}else if(-1===u)if(c){if(f)throw new eW;o=!0}else{if(!f)throw new eW;a=!0}else if(0===u){if(c){if(!f)throw new eW;r<n?(o=!0,s=!0):(i=!0,a=!0)}else if(f)throw new eW}else throw new eW;if(o){if(i)throw new eW;ne.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&ne.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new eW;ne.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&ne.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])],e}(ne),nK=(ti=function(t,e){return(ti=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}ti(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),nq=function(t){function e(e){var r=t.call(this)||this;r.readers=[];var n=e?e.get(eM.POSSIBLE_FORMATS):null,o=e&&void 0!==e.get(eM.ASSUME_CODE_39_CHECK_DIGIT),i=e&&void 0!==e.get(eM.ENABLE_CODE_39_EXTENDED_MODE);return n&&((n.includes(e6.EAN_13)||n.includes(e6.UPC_A)||n.includes(e6.EAN_8)||n.includes(e6.UPC_E))&&r.readers.push(new r6(e)),n.includes(e6.CODE_39)&&r.readers.push(new rD(o,i)),n.includes(e6.CODE_93)&&r.readers.push(new rB),n.includes(e6.CODE_128)&&r.readers.push(new rO),n.includes(e6.ITF)&&r.readers.push(new rF),n.includes(e6.CODABAR)&&r.readers.push(new r7),n.includes(e6.RSS_14)&&r.readers.push(new nZ),n.includes(e6.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new nG))),0===r.readers.length&&(r.readers.push(new r6(e)),r.readers.push(new rD),r.readers.push(new rB),r.readers.push(new r6(e)),r.readers.push(new rO),r.readers.push(new rF),r.readers.push(new nZ)),r}return nK(e,t),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 eW},e.prototype.reset=function(){this.readers.forEach(function(t){return t.reset()})},e}(rT);(ta=function(t,e){return(ta=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}ta(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(function(t,e){return void 0===t&&(t=500),ts.call(this,new nq(e),t,e)||this},ts=e4);var nQ=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nJ=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),n$=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),n1=function(){function t(t,e,r,n,o,i){this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var a,s,u=0,c=i.getECCodewords(),f=i.getECBlocks();try{for(var h=nQ(f),l=h.next();!l.done;l=h.next()){var d=l.value;u+=d.getCount()*(d.getDataCodewords()+c)}}catch(t){a={error:t}}finally{try{l&&!l.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}this.totalCodewords=u}return 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,o;if((1&e)!=0||(1&r)!=0)throw new eB;try{for(var i=nQ(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new eB},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new nJ(5,new n$(1,3))),new t(2,12,12,10,10,new nJ(7,new n$(1,5))),new t(3,14,14,12,12,new nJ(10,new n$(1,8))),new t(4,16,16,14,14,new nJ(12,new n$(1,12))),new t(5,18,18,16,16,new nJ(14,new n$(1,18))),new t(6,20,20,18,18,new nJ(18,new n$(1,22))),new t(7,22,22,20,20,new nJ(20,new n$(1,30))),new t(8,24,24,22,22,new nJ(24,new n$(1,36))),new t(9,26,26,24,24,new nJ(28,new n$(1,44))),new t(10,32,32,14,14,new nJ(36,new n$(1,62))),new t(11,36,36,16,16,new nJ(42,new n$(1,86))),new t(12,40,40,18,18,new nJ(48,new n$(1,114))),new t(13,44,44,20,20,new nJ(56,new n$(1,144))),new t(14,48,48,22,22,new nJ(68,new n$(1,174))),new t(15,52,52,24,24,new nJ(42,new n$(2,102))),new t(16,64,64,14,14,new nJ(56,new n$(2,140))),new t(17,72,72,16,16,new nJ(36,new n$(4,92))),new t(18,80,80,18,18,new nJ(48,new n$(4,114))),new t(19,88,88,20,20,new nJ(56,new n$(4,144))),new t(20,96,96,22,22,new nJ(68,new n$(4,174))),new t(21,104,104,24,24,new nJ(56,new n$(6,136))),new t(22,120,120,18,18,new nJ(68,new n$(6,175))),new t(23,132,132,20,20,new nJ(62,new n$(8,163))),new t(24,144,144,22,22,new nJ(62,new n$(8,156),new n$(2,155))),new t(25,8,18,6,16,new nJ(7,new n$(1,5))),new t(26,8,32,6,14,new nJ(11,new n$(1,10))),new t(27,12,26,10,24,new nJ(14,new n$(1,16))),new t(28,12,36,10,16,new nJ(18,new n$(1,22))),new t(29,16,36,14,16,new nJ(24,new n$(1,32))),new t(30,16,48,14,22,new nJ(28,new n$(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),n2=function(){function t(e){var r=e.getHeight();if(r<8||r>144||(1&r)!=0)throw new eB;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new eX(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return n1.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,c=!1;do if(r!==o||0!==n||a)if(r!==o-2||0!==n||(3&i)==0||s)if(r!==o+4||2!==n||(7&i)!=0||u)if(r!==o-2||0!==n||(7&i)!=4||c){do r<o&&n>=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2;while(r>=0&&n<i);r+=1,n+=3;do r>=0&&n<i&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r+=2,n-=2;while(r<o&&n>=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,c=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0;while(r<o||n<i);if(e!==this.version.getTotalCodewords())throw new eB;return t},t.prototype.readModule=function(t,e,r,n){return t<0&&(t+=r,e+=4-(r+4&7)),e<0&&(e+=n,t+=4-(n+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)},t.prototype.readUtah=function(t,e,r,n){var o=0;return this.readModule(t-2,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-2,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t-1,e,r,n)&&(o|=1),o<<=1,this.readModule(t,e-2,r,n)&&(o|=1),o<<=1,this.readModule(t,e-1,r,n)&&(o|=1),o<<=1,this.readModule(t,e,r,n)&&(o|=1),o},t.prototype.readCorner1=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,1,t,e)&&(r|=1),r<<=1,this.readModule(t-1,2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.readCorner2=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-4,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner3=function(t,e){var r=0;return this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(0,e-3,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-3,t,e)&&(r|=1),r<<=1,this.readModule(1,e-2,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r},t.prototype.readCorner4=function(t,e){var r=0;return this.readModule(t-3,0,t,e)&&(r|=1),r<<=1,this.readModule(t-2,0,t,e)&&(r|=1),r<<=1,this.readModule(t-1,0,t,e)&&(r|=1),r<<=1,this.readModule(0,e-2,t,e)&&(r|=1),r<<=1,this.readModule(0,e-1,t,e)&&(r|=1),r<<=1,this.readModule(1,e-1,t,e)&&(r|=1),r<<=1,this.readModule(2,e-1,t,e)&&(r|=1),r<<=1,this.readModule(3,e-1,t,e)&&(r|=1),r},t.prototype.extractDataRegion=function(t){var e=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new ev("Dimension of bitMatrix must match the version size");for(var n=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/n|0,a=r/o|0,s=new eX(a*o,i*n),u=0;u<i;++u)for(var c=u*n,f=0;f<a;++f)for(var h=f*o,l=0;l<n;++l)for(var d=u*(n+2)+1+l,p=c+l,g=0;g<o;++g){var y=f*(o+2)+1+g;if(t.get(y,d)){var w=h+g;s.set(w,p)}}return s},t}(),n0=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n3=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),u=0,c=s.getECBlocks();try{for(var f=n0(c),h=f.next();!h.done;h=f.next()){var l=h.value;u+=l.getCount()}}catch(t){n={error:t}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}var d=Array(u),p=0;try{for(var g=n0(c),y=g.next();!y.done;y=g.next())for(var l=y.value,w=0;w<l.getCount();w++){var v=l.getDataCodewords(),_=s.getECCodewords()+v;d[p++]=new t(v,new Uint8Array(_))}}catch(t){i={error:t}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}for(var m=d[0].codewords.length-s.getECCodewords(),C=m-1,A=0,w=0;w<C;w++)for(var E=0;E<p;E++)d[E].codewords[w]=e[A++];for(var I=24===r.getVersionNumber(),S=I?8:p,E=0;E<S;E++)d[E].codewords[m-1]=e[A++];for(var T=d[0].codewords.length,w=m;w<T;w++)for(var E=0;E<p;E++){var b=I?(E+8)%p:E,O=I&&b>7?w-1:w;d[b].codewords[O]=e[A++]}if(A!==e.length)throw new ev;return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),n4=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return 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 ev(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t<i?t:i,s=i-a,u=255>>8-a<<s;e=(o[n]&u)>>s,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;if(t>0){var s=8-t,u=255>>s<<s;e=e<<t|(o[n]&u)>>s,r+=t}}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();(tu=t3||(t3={}))[tu.PAD_ENCODE=0]="PAD_ENCODE",tu[tu.ASCII_ENCODE=1]="ASCII_ENCODE",tu[tu.C40_ENCODE=2]="C40_ENCODE",tu[tu.TEXT_ENCODE=3]="TEXT_ENCODE",tu[tu.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",tu[tu.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",tu[tu.BASE256_ENCODE=6]="BASE256_ENCODE";var n8=function(){function t(){}return t.decode=function(t){var e=new n4(t),r=new eU,n=new eU,o=[],i=t3.ASCII_ENCODE;do if(i===t3.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case t3.C40_ENCODE:this.decodeC40Segment(e,r);break;case t3.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case t3.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case t3.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case t3.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new eB}i=t3.ASCII_ENCODE}while(i!==t3.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new e7(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new eB;if(o<=128){n&&(o+=128),e.append(String.fromCharCode(o-1));break}if(129===o)return t3.PAD_ENCODE;else if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return t3.C40_ENCODE;case 231:return t3.BASE256_ENCODE;case 232:e.append("\x1d");break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>\x1e05\x1d"),r.insert(0,"\x1e\x04");break;case 237:e.append("[)>\x1e06\x1d"),r.insert(0,"\x1e\x04");break;case 238:return t3.ANSIX12_ENCODE;case 239:return t3.TEXT_ENCODE;case 240:return t3.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new eB}}while(t.available()>0);return t3.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else if(s<this.C40_BASIC_SET_CHARS.length){var u=this.C40_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}else throw new eB;break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.C40_SHIFT2_SET_CHARS.length){var u=this.C40_SHIFT2_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}else switch(s){case 27:e.append("\x1d");break;case 30:r=!0;break;default:throw new eB}o=0;break;case 3:r?(e.append(String.fromCharCode(s+224)),r=!1):e.append(String.fromCharCode(s+96)),o=0;break;default:throw new eB}}}while(t.available()>0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else if(s<this.TEXT_BASIC_SET_CHARS.length){var u=this.TEXT_BASIC_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}else throw new eB;break;case 1:r?(e.append(String.fromCharCode(s+128)),r=!1):e.append(String.fromCharCode(s)),o=0;break;case 2:if(s<this.TEXT_SHIFT2_SET_CHARS.length){var u=this.TEXT_SHIFT2_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u)}else switch(s){case 27:e.append("\x1d");break;case 30:r=!0;break;default:throw new eB}o=0;break;case 3:if(s<this.TEXT_SHIFT3_SET_CHARS.length){var u=this.TEXT_SHIFT3_SET_CHARS[s];r?(e.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):e.append(u),o=0}else throw new eB;break;default:throw new eB}}}while(t.available()>0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else if(i<40)e.append(String.fromCharCode(i+51));else throw new eB}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(16>=t.available())return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();8!==o&&t.readBits(o);return}(32&n)==0&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new eB;for(var a=new Uint8Array(n),s=0;s<n;s++){if(8>t.available())throw new eB;a[s]=this.unrandomize255State(t.readBits(8),o++)}r.push(a);try{e.append(eV.decode(a,eH.ISO88591))}catch(t){throw new ru("Platform does not support required encoding: "+t.message)}},t.unrandomize255State=function(t,e){var r=t-(149*e%255+1);return r>=0?r:r+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","{","|","}","~",""],t}(),n6=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n5=function(){function t(){this.rsDecoder=new rc(ro.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new n2(t),o=n.getVersion(),i=n.readCodewords(),a=n3.getDataBlocks(i,o),s=0;try{for(var u=n6(a),c=u.next();!c.done;c=u.next()){var f=c.value;s+=f.getNumDataCodewords()}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}for(var h=new Uint8Array(s),l=a.length,d=0;d<l;d++){var p=a[d],g=p.getCodewords(),y=p.getNumDataCodewords();this.correctErrors(g,y);for(var w=0;w<y;w++)h[w*l+d]=g[w]}return n8.decode(h)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(t){throw new eC}for(var n=0;n<e;n++)t[n]=r[n]},t}(),n7=function(){function t(t){this.image=t,this.rectangleDetector=new rw(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),r=this.detectSolid1(e);if((r=this.detectSolid2(r))[3]=this.correctTopRight(r),!r[3])throw new eW;var n=(r=this.shiftToModuleCenter(r))[0],o=r[1],i=r[2],a=r[3],s=this.transitionsBetween(n,a)+1,u=this.transitionsBetween(i,a)+1;return(1&s)==1&&(s+=1),(1&u)==1&&(u+=1),4*s<7*u&&4*u<7*s&&(s=u=Math.max(s,u)),new rp(t.sampleGrid(this.image,n,o,i,a,s,u),[n,o,i,a])},t.shiftPoint=function(t,e,r){var n=(e.getX()-t.getX())/(r+1),o=(e.getY()-t.getY())/(r+1);return new rd(t.getX()+n,t.getY()+o)},t.moveAway=function(t,e,r){var n=t.getX(),o=t.getY();return n<e?n-=1:n+=1,o<r?o-=1:o+=1,new rd(n,o)},t.prototype.detectSolid1=function(t){var e=t[0],r=t[1],n=t[3],o=t[2],i=this.transitionsBetween(e,r),a=this.transitionsBetween(r,n),s=this.transitionsBetween(n,o),u=this.transitionsBetween(o,e),c=i,f=[o,e,r,n];return c>a&&(c=a,f[0]=e,f[1]=r,f[2]=n,f[3]=o),c>s&&(c=s,f[0]=r,f[1]=n,f[2]=o,f[3]=e),c>u&&(f[0]=n,f[1]=o,f[2]=e,f[3]=r),f},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,(a+1)*4),u=t.shiftPoint(o,n,(a+1)*4);return this.transitionsBetween(s,r)<this.transitionsBetween(u,i)?(e[0]=r,e[1]=n,e[2]=o,e[3]=i):(e[0]=n,e[1]=o,e[2]=i,e[3]=r),e},t.prototype.correctTopRight=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=this.transitionsBetween(n,i),u=t.shiftPoint(r,n,(s+1)*4),c=t.shiftPoint(o,n,(a+1)*4);a=this.transitionsBetween(u,i),s=this.transitionsBetween(c,i);var f=new rd(i.getX()+(o.getX()-n.getX())/(a+1),i.getY()+(o.getY()-n.getY())/(a+1)),h=new rd(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1));return this.isValid(f)?this.isValid(h)?this.transitionsBetween(u,f)+this.transitionsBetween(c,f)>this.transitionsBetween(u,h)+this.transitionsBetween(c,h)?f:h:f:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var r,n,o=e[0],i=e[1],a=e[2],s=e[3],u=this.transitionsBetween(o,s)+1,c=this.transitionsBetween(a,s)+1,f=t.shiftPoint(o,i,4*c),h=t.shiftPoint(a,i,4*u);u=this.transitionsBetween(f,s)+1,c=this.transitionsBetween(h,s)+1,(1&u)==1&&(u+=1),(1&c)==1&&(c+=1);var l=(o.getX()+i.getX()+a.getX()+s.getX())/4,d=(o.getY()+i.getY()+a.getY()+s.getY())/4;return o=t.moveAway(o,l,d),i=t.moveAway(i,l,d),a=t.moveAway(a,l,d),s=t.moveAway(s,l,d),f=t.shiftPoint(o,i,4*c),f=t.shiftPoint(f,s,4*u),r=t.shiftPoint(i,o,4*c),r=t.shiftPoint(r,a,4*u),h=t.shiftPoint(a,s,4*c),h=t.shiftPoint(h,i,4*u),n=t.shiftPoint(s,a,4*c),[f,r,h,n=t.shiftPoint(n,o,4*u)]},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,o,i,a){return rA.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),n.getX(),n.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(t,e){var r=Math.trunc(t.getX()),n=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-n)>Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var u=Math.abs(o-r),c=Math.abs(i-n),f=-u/2,h=n<i?1:-1,l=r<o?1:-1,d=0,p=this.image.get(a?n:r,a?r:n),g=r,y=n;g!==o;g+=l){var w=this.image.get(a?y:g,a?g:y);if(w!==p&&(d++,p=w),(f+=c)>0){if(y===i)break;y+=h,f-=u}}return d},t}(),n9=function(){function t(){this.decoder=new n5}return t.prototype.decode=function(e,r){if(void 0===r&&(r=null),null!=r&&r.has(eM.PURE_BARCODE)){var n,o,i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new n7(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new e8(n.getText(),s,8*s.length,o,e6.DATA_MATRIX,eE.currentTimeMillis()),c=n.getByteSegments();null!=c&&u.putMetadata(e5.BYTE_SEGMENTS,c);var f=n.getECLevel();return null!=f&&u.putMetadata(e5.ERROR_CORRECTION_LEVEL,f),u},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new eW;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,u=(i-o+1)/n;if(s<=0||u<=0)throw new eW;var c=n/2;o+=c,a+=c;for(var f=new eX(s,u),h=0;h<u;h++)for(var l=o+h*n,d=0;d<s;d++)t.get(a+d*n,l)&&f.set(d,h);return f},t.moduleSize=function(t,e){for(var r=e.getWidth(),n=t[0],o=t[1];n<r&&e.get(n,o);)n++;if(n===r)throw new eW;var i=n-t[0];if(0===i)throw new eW;return i},t.NO_POINTS=[],t}();(tc=function(t,e){return(tc=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tc(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)})(function(t){return void 0===t&&(t=500),tf.call(this,new n9,t)||this},tf=e4),(th=t4||(t4={}))[th.L=0]="L",th[th.M=1]="M",th[th.Q=2]="Q",th[th.H=3]="H";var ot=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)}return 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 ey(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){return e instanceof t&&this.value===e.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new ev;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(t4.L,"L",1),t.M=new t(t4.M,"M",0),t.Q=new t(t4.Q,"Q",3),t.H=new t(t4.H,"H",2),t}(),oe=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(t){this.errorCorrectionLevel=ot.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return eN.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=oe(t.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,f=c[0];if(f===e||f===r)return new t(c[1]);var h=t.numBitsDiffering(e,f);h<i&&(a=c[1],i=h),e!==r&&(h=t.numBitsDiffering(r,f))<i&&(a=c[1],i=h)}}catch(t){n={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}return i<=3?new t(a):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){return e instanceof t&&this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.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])],t}(),on=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oo=function(){function t(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.ecCodewordsPerBlock=t,this.ecBlocks=e}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var t,e,r=0,n=this.ecBlocks;try{for(var o=on(n),i=o.next();!i.done;i=o.next()){var a=i.value;r+=a.getCount()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),oi=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),oa=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},os=function(){function t(t,e){for(var r,n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=o;var a=0,s=o[0].getECCodewordsPerBlock(),u=o[0].getECBlocks();try{for(var c=oa(u),f=c.next();!f.done;f=c.next()){var h=f.value;a+=h.getCount()*(h.getDataCodewords()+s)}}catch(t){r={error:t}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}this.totalCodewords=a}return 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 eB;try{return this.getVersionForNumber((t-17)/4)}catch(t){throw new eB}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new ev;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=or.numBitsDiffering(e,i);a<r&&(n=o+7,r=a)}return r<=3?t.getVersionForNumber(n):null},t.prototype.buildFunctionPattern=function(){var t=this.getDimensionForVersion(),e=new eX(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);for(var r=this.alignmentPatternCenters.length,n=0;n<r;n++)for(var o=this.alignmentPatternCenters[n]-2,i=0;i<r;i++)(0!==n||0!==i&&i!==r-1)&&(n!==r-1||0!==i)&&e.setRegion(this.alignmentPatternCenters[i]-2,o,5,5);return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),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 oo(7,new oi(1,19)),new oo(10,new oi(1,16)),new oo(13,new oi(1,13)),new oo(17,new oi(1,9))),new t(2,Int32Array.from([6,18]),new oo(10,new oi(1,34)),new oo(16,new oi(1,28)),new oo(22,new oi(1,22)),new oo(28,new oi(1,16))),new t(3,Int32Array.from([6,22]),new oo(15,new oi(1,55)),new oo(26,new oi(1,44)),new oo(18,new oi(2,17)),new oo(22,new oi(2,13))),new t(4,Int32Array.from([6,26]),new oo(20,new oi(1,80)),new oo(18,new oi(2,32)),new oo(26,new oi(2,24)),new oo(16,new oi(4,9))),new t(5,Int32Array.from([6,30]),new oo(26,new oi(1,108)),new oo(24,new oi(2,43)),new oo(18,new oi(2,15),new oi(2,16)),new oo(22,new oi(2,11),new oi(2,12))),new t(6,Int32Array.from([6,34]),new oo(18,new oi(2,68)),new oo(16,new oi(4,27)),new oo(24,new oi(4,19)),new oo(28,new oi(4,15))),new t(7,Int32Array.from([6,22,38]),new oo(20,new oi(2,78)),new oo(18,new oi(4,31)),new oo(18,new oi(2,14),new oi(4,15)),new oo(26,new oi(4,13),new oi(1,14))),new t(8,Int32Array.from([6,24,42]),new oo(24,new oi(2,97)),new oo(22,new oi(2,38),new oi(2,39)),new oo(22,new oi(4,18),new oi(2,19)),new oo(26,new oi(4,14),new oi(2,15))),new t(9,Int32Array.from([6,26,46]),new oo(30,new oi(2,116)),new oo(22,new oi(3,36),new oi(2,37)),new oo(20,new oi(4,16),new oi(4,17)),new oo(24,new oi(4,12),new oi(4,13))),new t(10,Int32Array.from([6,28,50]),new oo(18,new oi(2,68),new oi(2,69)),new oo(26,new oi(4,43),new oi(1,44)),new oo(24,new oi(6,19),new oi(2,20)),new oo(28,new oi(6,15),new oi(2,16))),new t(11,Int32Array.from([6,30,54]),new oo(20,new oi(4,81)),new oo(30,new oi(1,50),new oi(4,51)),new oo(28,new oi(4,22),new oi(4,23)),new oo(24,new oi(3,12),new oi(8,13))),new t(12,Int32Array.from([6,32,58]),new oo(24,new oi(2,92),new oi(2,93)),new oo(22,new oi(6,36),new oi(2,37)),new oo(26,new oi(4,20),new oi(6,21)),new oo(28,new oi(7,14),new oi(4,15))),new t(13,Int32Array.from([6,34,62]),new oo(26,new oi(4,107)),new oo(22,new oi(8,37),new oi(1,38)),new oo(24,new oi(8,20),new oi(4,21)),new oo(22,new oi(12,11),new oi(4,12))),new t(14,Int32Array.from([6,26,46,66]),new oo(30,new oi(3,115),new oi(1,116)),new oo(24,new oi(4,40),new oi(5,41)),new oo(20,new oi(11,16),new oi(5,17)),new oo(24,new oi(11,12),new oi(5,13))),new t(15,Int32Array.from([6,26,48,70]),new oo(22,new oi(5,87),new oi(1,88)),new oo(24,new oi(5,41),new oi(5,42)),new oo(30,new oi(5,24),new oi(7,25)),new oo(24,new oi(11,12),new oi(7,13))),new t(16,Int32Array.from([6,26,50,74]),new oo(24,new oi(5,98),new oi(1,99)),new oo(28,new oi(7,45),new oi(3,46)),new oo(24,new oi(15,19),new oi(2,20)),new oo(30,new oi(3,15),new oi(13,16))),new t(17,Int32Array.from([6,30,54,78]),new oo(28,new oi(1,107),new oi(5,108)),new oo(28,new oi(10,46),new oi(1,47)),new oo(28,new oi(1,22),new oi(15,23)),new oo(28,new oi(2,14),new oi(17,15))),new t(18,Int32Array.from([6,30,56,82]),new oo(30,new oi(5,120),new oi(1,121)),new oo(26,new oi(9,43),new oi(4,44)),new oo(28,new oi(17,22),new oi(1,23)),new oo(28,new oi(2,14),new oi(19,15))),new t(19,Int32Array.from([6,30,58,86]),new oo(28,new oi(3,113),new oi(4,114)),new oo(26,new oi(3,44),new oi(11,45)),new oo(26,new oi(17,21),new oi(4,22)),new oo(26,new oi(9,13),new oi(16,14))),new t(20,Int32Array.from([6,34,62,90]),new oo(28,new oi(3,107),new oi(5,108)),new oo(26,new oi(3,41),new oi(13,42)),new oo(30,new oi(15,24),new oi(5,25)),new oo(28,new oi(15,15),new oi(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new oo(28,new oi(4,116),new oi(4,117)),new oo(26,new oi(17,42)),new oo(28,new oi(17,22),new oi(6,23)),new oo(30,new oi(19,16),new oi(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new oo(28,new oi(2,111),new oi(7,112)),new oo(28,new oi(17,46)),new oo(30,new oi(7,24),new oi(16,25)),new oo(24,new oi(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new oo(30,new oi(4,121),new oi(5,122)),new oo(28,new oi(4,47),new oi(14,48)),new oo(30,new oi(11,24),new oi(14,25)),new oo(30,new oi(16,15),new oi(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new oo(30,new oi(6,117),new oi(4,118)),new oo(28,new oi(6,45),new oi(14,46)),new oo(30,new oi(11,24),new oi(16,25)),new oo(30,new oi(30,16),new oi(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new oo(26,new oi(8,106),new oi(4,107)),new oo(28,new oi(8,47),new oi(13,48)),new oo(30,new oi(7,24),new oi(22,25)),new oo(30,new oi(22,15),new oi(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new oo(28,new oi(10,114),new oi(2,115)),new oo(28,new oi(19,46),new oi(4,47)),new oo(28,new oi(28,22),new oi(6,23)),new oo(30,new oi(33,16),new oi(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new oo(30,new oi(8,122),new oi(4,123)),new oo(28,new oi(22,45),new oi(3,46)),new oo(30,new oi(8,23),new oi(26,24)),new oo(30,new oi(12,15),new oi(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new oo(30,new oi(3,117),new oi(10,118)),new oo(28,new oi(3,45),new oi(23,46)),new oo(30,new oi(4,24),new oi(31,25)),new oo(30,new oi(11,15),new oi(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new oo(30,new oi(7,116),new oi(7,117)),new oo(28,new oi(21,45),new oi(7,46)),new oo(30,new oi(1,23),new oi(37,24)),new oo(30,new oi(19,15),new oi(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new oo(30,new oi(5,115),new oi(10,116)),new oo(28,new oi(19,47),new oi(10,48)),new oo(30,new oi(15,24),new oi(25,25)),new oo(30,new oi(23,15),new oi(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new oo(30,new oi(13,115),new oi(3,116)),new oo(28,new oi(2,46),new oi(29,47)),new oo(30,new oi(42,24),new oi(1,25)),new oo(30,new oi(23,15),new oi(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new oo(30,new oi(17,115)),new oo(28,new oi(10,46),new oi(23,47)),new oo(30,new oi(10,24),new oi(35,25)),new oo(30,new oi(19,15),new oi(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new oo(30,new oi(17,115),new oi(1,116)),new oo(28,new oi(14,46),new oi(21,47)),new oo(30,new oi(29,24),new oi(19,25)),new oo(30,new oi(11,15),new oi(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new oo(30,new oi(13,115),new oi(6,116)),new oo(28,new oi(14,46),new oi(23,47)),new oo(30,new oi(44,24),new oi(7,25)),new oo(30,new oi(59,16),new oi(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new oo(30,new oi(12,121),new oi(7,122)),new oo(28,new oi(12,47),new oi(26,48)),new oo(30,new oi(39,24),new oi(14,25)),new oo(30,new oi(22,15),new oi(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new oo(30,new oi(6,121),new oi(14,122)),new oo(28,new oi(6,47),new oi(34,48)),new oo(30,new oi(46,24),new oi(10,25)),new oo(30,new oi(2,15),new oi(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new oo(30,new oi(17,122),new oi(4,123)),new oo(28,new oi(29,46),new oi(14,47)),new oo(30,new oi(49,24),new oi(10,25)),new oo(30,new oi(24,15),new oi(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new oo(30,new oi(4,122),new oi(18,123)),new oo(28,new oi(13,46),new oi(32,47)),new oo(30,new oi(48,24),new oi(14,25)),new oo(30,new oi(42,15),new oi(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new oo(30,new oi(20,117),new oi(4,118)),new oo(28,new oi(40,47),new oi(7,48)),new oo(30,new oi(43,24),new oi(22,25)),new oo(30,new oi(10,15),new oi(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new oo(30,new oi(19,118),new oi(6,119)),new oo(28,new oi(18,47),new oi(31,48)),new oo(30,new oi(34,24),new oi(34,25)),new oo(30,new oi(20,15),new oi(61,16)))],t}();(tl=t8||(t8={}))[tl.DATA_MASK_000=0]="DATA_MASK_000",tl[tl.DATA_MASK_001=1]="DATA_MASK_001",tl[tl.DATA_MASK_010=2]="DATA_MASK_010",tl[tl.DATA_MASK_011=3]="DATA_MASK_011",tl[tl.DATA_MASK_100=4]="DATA_MASK_100",tl[tl.DATA_MASK_101=5]="DATA_MASK_101",tl[tl.DATA_MASK_110=6]="DATA_MASK_110",tl[tl.DATA_MASK_111=7]="DATA_MASK_111";var ou=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r<e;r++)for(var n=0;n<e;n++)this.isMasked(r,n)&&t.flip(n,r)},t.values=new Map([[t8.DATA_MASK_000,new t(t8.DATA_MASK_000,function(t,e){return(t+e&1)==0})],[t8.DATA_MASK_001,new t(t8.DATA_MASK_001,function(t,e){return(1&t)==0})],[t8.DATA_MASK_010,new t(t8.DATA_MASK_010,function(t,e){return e%3==0})],[t8.DATA_MASK_011,new t(t8.DATA_MASK_011,function(t,e){return(t+e)%3==0})],[t8.DATA_MASK_100,new t(t8.DATA_MASK_100,function(t,e){return(Math.floor(t/2)+Math.floor(e/3)&1)==0})],[t8.DATA_MASK_101,new t(t8.DATA_MASK_101,function(t,e){return t*e%6==0})],[t8.DATA_MASK_110,new t(t8.DATA_MASK_110,function(t,e){return t*e%6<3})],[t8.DATA_MASK_111,new t(t8.DATA_MASK_111,function(t,e){return(t+e+t*e%3&1)==0})]]),t}(),oc=function(){function t(t){var e=t.getHeight();if(e<21||(3&e)!=1)throw new eB;this.bitMatrix=t}return t.prototype.readFormatInformation=function(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;for(var t=0,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);for(var n=this.bitMatrix.getHeight(),o=0,i=n-7,r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(var e=n-8;e<n;e++)o=this.copyBit(e,8,o);if(this.parsedFormatInfo=or.decodeFormatInformation(t,o),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new eB},t.prototype.readVersion=function(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;var t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return os.getVersionForNumber(e);for(var r=0,n=t-11,o=5;o>=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=os.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;r=0;for(var i=5;i>=0;i--)for(var o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=os.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new eB},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=ou.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,u=0,c=0,f=n-1;f>0;f-=2){6===f&&f--;for(var h=0;h<n;h++)for(var l=i?n-1-h:h,d=0;d<2;d++)o.get(f-d,l)||(c++,u<<=1,this.bitMatrix.get(f-d,l)&&(u|=1),8===c&&(a[s++]=u,c=0,u=0));i=!i}if(s!==e.getTotalCodewords())throw new eB;return a},t.prototype.remask=function(){if(null!==this.parsedFormatInfo){var t=ou.values.get(this.parsedFormatInfo.getDataMask()),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(){for(var t=this.bitMatrix,e=0,r=t.getWidth();e<r;e++)for(var n=e+1,o=t.getHeight();n<o;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))},t}(),of=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oh=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){if(e.length!==r.getTotalCodewords())throw new ev;var o,i,a,s,u=r.getECBlocksForLevel(n),c=0,f=u.getECBlocks();try{for(var h=of(f),l=h.next();!l.done;l=h.next()){var d=l.value;c+=d.getCount()}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var p=Array(c),g=0;try{for(var y=of(f),w=y.next();!w.done;w=y.next())for(var d=w.value,v=0;v<d.getCount();v++){var _=d.getDataCodewords(),m=u.getECCodewordsPerBlock()+_;p[g++]=new t(_,new Uint8Array(m))}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}for(var C=p[0].codewords.length,A=p.length-1;A>=0&&p[A].codewords.length!==C;)A--;A++;for(var E=C-u.getECCodewordsPerBlock(),I=0,v=0;v<E;v++)for(var S=0;S<g;S++)p[S].codewords[v]=e[I++];for(var S=A;S<g;S++)p[S].codewords[E]=e[I++];for(var T=p[0].codewords.length,v=E;v<T;v++)for(var S=0;S<g;S++){var b=S<A?v:v+1;p[S].codewords[b]=e[I++]}return p},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();(td=t6||(t6={}))[td.TERMINATOR=0]="TERMINATOR",td[td.NUMERIC=1]="NUMERIC",td[td.ALPHANUMERIC=2]="ALPHANUMERIC",td[td.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",td[td.BYTE=4]="BYTE",td[td.ECI=5]="ECI",td[td.KANJI=6]="KANJI",td[td.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",td[td.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",td[td.HANZI=9]="HANZI";var ol=function(){function t(e,r,n,o){this.value=e,this.stringValue=r,this.characterCountBitsForVersions=n,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var r=t.FOR_BITS.get(e);if(void 0===r)throw new ev;return r},t.prototype.getCharacterCountBits=function(t){var e,r=t.getVersionNumber();return e=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[e]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){return e instanceof t&&this.value===e.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(t6.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(t6.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(t6.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(t6.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(t6.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(t6.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(t6.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(t6.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(t6.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(t6.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),od=function(){function t(){}return t.decode=function(e,r,n,o){var i=new n4(e),a=new eU,s=[],u=-1,c=-1;try{var f=null,h=!1,l=void 0;do{if(4>i.available())l=ol.TERMINATOR;else{var d=i.readBits(4);l=ol.forBits(d)}switch(l){case ol.TERMINATOR:break;case ol.FNC1_FIRST_POSITION:case ol.FNC1_SECOND_POSITION:h=!0;break;case ol.STRUCTURED_APPEND:if(16>i.available())throw new eB;u=i.readBits(8),c=i.readBits(8);break;case ol.ECI:var p=t.parseECIValue(i);if(f=ex.getCharacterSetECIByValue(p),null===f)throw new eB;break;case ol.HANZI:var g=i.readBits(4),y=i.readBits(l.getCharacterCountBits(r));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,y);break;default:var w=i.readBits(l.getCharacterCountBits(r));switch(l){case ol.NUMERIC:t.decodeNumericSegment(i,a,w);break;case ol.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,w,h);break;case ol.BYTE:t.decodeByteSegment(i,a,w,f,s,o);break;case ol.KANJI:t.decodeKanjiSegment(i,a,w);break;default:throw new eB}}}while(l!==ol.TERMINATOR)}catch(t){throw new eB}return new e7(e,a.toString(),0===s.length?null:s,null===n?null:n.toString(),u,c)},t.decodeHanziSegment=function(t,e,r){if(13*r>t.available())throw new eB;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8|i%96;a<959?a+=41377:a+=42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(eV.decode(n,eH.GB2312))}catch(t){throw new eB(t)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new eB;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8|i%192;a<7936?a+=33088:a+=49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(eV.decode(n,eH.SHIFT_JIS))}catch(t){throw new eB(t)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new eB;for(var a,s=new Uint8Array(r),u=0;u<r;u++)s[u]=t.readBits(8);a=null===n?eH.guessEncoding(s,i):n.getName();try{e.append(eV.decode(s,a))}catch(t){throw new eB(t)}o.push(s)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new eB;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(11>e.available())throw new eB;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(6>e.available())throw new eB;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<r.length();s++)"%"===r.charAt(s)&&(s<r.length()-1&&"%"===r.charAt(s+1)?r.deleteCharAt(s+1):r.setCharAt(s,"\x1d"))},t.decodeNumericSegment=function(e,r,n){for(;n>=3;){if(10>e.available())throw new eB;var o=e.readBits(10);if(o>=1e3)throw new eB;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(7>e.available())throw new eB;var i=e.readBits(7);if(i>=100)throw new eB;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(4>e.available())throw new eB;var a=e.readBits(4);if(a>=10)throw new eB;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if((128&e)==0)return 127&e;if((192&e)==128)return(63&e)<<8|t.readBits(8);if((224&e)==192)return(31&e)<<16|t.readBits(16);throw new eB},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),op=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),og=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oy=function(){function t(){this.rsDecoder=new rc(ro.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(eX.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new oc(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(t){n=t}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new op(!0)),o}catch(t){if(null!==n)throw n;throw t}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=oh.getDataBlocks(u,a,s),f=0;try{for(var h=og(c),l=h.next();!l.done;l=h.next()){var d=l.value;f+=d.getNumDataCodewords()}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}var p=new Uint8Array(f),g=0;try{for(var y=og(c),w=y.next();!w.done;w=y.next()){var d=w.value,v=d.getCodewords(),_=d.getNumDataCodewords();this.correctErrors(v,_);for(var m=0;m<_;m++)p[g++]=v[m]}}catch(t){o={error:t}}finally{try{w&&!w.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}return od.decode(p,a,s,e)},t.prototype.correctErrors=function(t,e){var r=new Int32Array(t);try{this.rsDecoder.decode(r,t.length-e)}catch(t){throw new eC}for(var n=0;n<e;n++)t[n]=r[n]},t}(),ow=(tp=function(t,e){return(tp=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tp(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),ov=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.estimatedModuleSize=n,o}return ow(e,t),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!1},e.prototype.combineEstimate=function(t,r,n){return new e((this.getX()+r)/2,(this.getY()+t)/2,(this.estimatedModuleSize+n)/2)},e}(rd),o_=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},om=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a<e;a++){var s=n+((1&a)==0?Math.floor((a+1)/2):-Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;for(var u=t;u<r&&!i.get(u,s);)u++;for(var c=0;u<r;){if(i.get(u,s))if(1===c)o[1]++;else if(2===c){if(this.foundPatternCross(o)){var f=this.handlePossibleCenter(o,s,u);if(null!==f)return f}o[0]=o[2],o[1]=1,o[2]=0,c=1}else o[++c]++;else 1===c&&c++,o[c]++;u++}if(this.foundPatternCross(o)){var f=this.handlePossibleCenter(o,s,r);if(null!==f)return f}}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new eW},t.centerFromEnd=function(t,e){return e-t[2]-t[1]/2},t.prototype.foundPatternCross=function(t){for(var e=this.moduleSize,r=e/2,n=0;n<3;n++)if(Math.abs(e-t[n])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=e;u>=0&&i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u)&&s[1]<=n;)s[1]++,u++;if(u===a||s[1]>n)return NaN;for(;u<a&&!i.get(r,u)&&s[2]<=n;)s[2]++,u++;return s[2]>n||5*Math.abs(s[0]+s[1]+s[2]-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(u)){var c=(e[0]+e[1]+e[2])/3;try{for(var f=o_(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.aboutEquals(c,u,s))return l.combineEstimate(u,s,c)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var d=new ov(s,u,c);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},t}(),oC=(tg=function(t,e){return(tg=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}tg(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),oA=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return oC(e,t),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!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(rd),oE=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),oI=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oS=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(eM.TRY_HARDER),n=null!=e&&void 0!==e.get(eM.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||r)&&(s=t.MIN_SKIP);for(var u=!1,c=new Int32Array(5),f=s-1;f<i&&!u;f+=s){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;for(var h=0,l=0;l<a;l++)if(o.get(l,f))(1&h)==1&&h++,c[h]++;else if((1&h)==0)if(4===h)if(t.foundPatternCross(c)){var d=this.handlePossibleCenter(c,f,l,n);if(!0===d)if(s=2,!0===this.hasSkipped)u=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>c[2]&&(f+=p-c[2]-s,l=a-1)}else{c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;continue}h=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;else c[++h]++;else c[h]++;if(t.foundPatternCross(c)){var d=this.handlePossibleCenter(c,f,a,n);!0===d&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}}var g=this.selectBestPatterns();return rd.orderBestPatterns(g),new oE(g)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])<i&&Math.abs(o-t[1])<i&&Math.abs(3*o-t[2])<3*i&&Math.abs(o-t[3])<i&&Math.abs(o-t[4])<i},t.prototype.getCrossCheckStateCount=function(){var t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t},t.prototype.crossCheckDiagonal=function(e,r,n,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e<a||r<a)return!1;for(;e>=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(e<a||r<a||i[1]>n)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;e+a<u&&r+a<c&&s.get(r+a,e+a);)i[2]++,a++;if(e+a>=u||r+a>=c)return!1;for(;e+a<u&&r+a<c&&!s.get(r+a,e+a)&&i[3]<n;)i[3]++,a++;if(e+a>=u||r+a>=c||i[3]>=n)return!1;for(;e+a<u&&r+a<c&&s.get(r+a,e+a)&&i[4]<n;)i[4]++,a++;return!(i[4]>=n)&&Math.abs(i[0]+i[1]+i[2]+i[3]+i[4]-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(r,u);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(r,u)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(r,u)&&s[4]<n;)s[4]++,u++;return s[4]>=n||5*Math.abs(s[0]+s[1]+s[2]+s[3]+s[4]-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u<a&&i.get(u,r);)s[2]++,u++;if(u===a)return NaN;for(;u<a&&!i.get(u,r)&&s[3]<n;)s[3]++,u++;if(u===a||s[3]>=n)return NaN;for(;u<a&&i.get(u,r)&&s[4]<n;)s[4]++,u++;return s[4]>=n||5*Math.abs(s[0]+s[1]+s[2]+s[3]+s[4]-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&!isNaN(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i))&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i))){for(var u=i/7,c=!1,f=this.possibleCenters,h=0,l=f.length;h<l;h++){var d=f[h];if(d.aboutEquals(u,s,a)){f[h]=d.combineEstimate(s,a,u),c=!0;break}}if(!c){var p=new oA(a,s,u);f.push(p),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(p)}return!0}return!1},t.prototype.findRowSkip=function(){if(this.possibleCenters.length<=1)return 0;var e,r,n=null;try{for(var o=oI(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM)if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);else n=a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=oI(this.possibleCenters),c=u.next();!c.done;c=u.next()){var f=c.value;f.getCount()>=t.CENTER_QUORUM&&(i++,a+=f.getEstimatedModuleSize())}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(i<3)return!1;var h=a/s,l=0;try{for(var d=oI(this.possibleCenters),p=d.next();!p.done;p=d.next()){var f=p.value;l+=Math.abs(f.getEstimatedModuleSize()-h)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}return l<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o,i=this.possibleCenters.length;if(i<3)throw new eW;var a=this.possibleCenters;if(i>3){var s=0,u=0;try{for(var c=oI(this.possibleCenters),f=c.next();!f.done;f=c.next()){var h=f.value.getEstimatedModuleSize();s+=h,u+=h*h}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}o=s/i;var l=Math.sqrt(u/i-o*o);a.sort(function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-o),n=Math.abs(t.getEstimatedModuleSize()-o);return r<n?-1:+(r>n)});for(var d=Math.max(.2*o,l),p=0;p<a.length&&a.length>3;p++)Math.abs(a[p].getEstimatedModuleSize()-o)>d&&(a.splice(p,1),p--)}if(a.length>3){var s=0;try{for(var g=oI(a),y=g.next();!y.done;y=g.next()){var w=y.value;s+=w.getEstimatedModuleSize()}}catch(t){r={error:t}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(r)throw r.error}}o=s/a.length,a.sort(function(t,e){if(e.getCount()!==t.getCount())return e.getCount()-t.getCount();var r=Math.abs(e.getEstimatedModuleSize()-o),n=Math.abs(t.getEstimatedModuleSize()-o);return r<n?1:r>n?-1:0}),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),oT=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(eM.NEED_RESULT_POINT_CALLBACK);var e=new oS(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new eW("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=os.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var f=n.getX()-r.getX()+o.getX(),h=n.getY()-r.getY()+o.getY(),l=1-3/u,d=Math.floor(r.getX()+l*(f-r.getX())),p=Math.floor(r.getY()+l*(h-r.getY())),g=4;g<=16;g<<=1)try{c=this.findAlignmentInRegion(i,d,p,g);break}catch(t){if(!(t instanceof eW))throw t}var y=t.createTransform(r,n,o,c,a);return new rp(t.sampleGrid(this.image,y,a),null===c?[o,r,n]:[o,r,n,c])},t.createTransform=function(t,e,r,n,o){var i,a,s,u,c=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),u=s=c-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=c,u=c),r_.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,s,u,3.5,c,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return rA.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=Math.floor((rh.round(rd.distance(t,e)/n)+rh.round(rd.distance(t,r)/n))/2)+7;switch(3&o){case 0:o++;break;case 2:o--;break;case 3:throw new eW("Dimensions could be not found.")}return o},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())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),u=-a/2,c=t<r?1:-1,f=e<n?1:-1,h=0,l=r+c,d=t,p=e;d!==l;d+=c){var g=o?p:d,y=o?d:p;if(1===h===this.image.get(g,y)){if(2===h)return rh.distance(d,p,t,e);h++}if((u+=s)>0){if(p===n)break;p+=f,u-=a}}return 2===h?rh.distance(r+c,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new eW("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-s<3*t)throw new eW("Alignment bottom exceeds estimated module size.");return new om(this.image,i,s,a-i,u-s,t,this.resultPointCallback).find()},t}(),ob=function(){function t(){this.decoder=new oy}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){if(null!=r&&void 0!==r.get(eM.PURE_BARCODE)){var n,o,i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new oT(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof op&&n.getOther().applyMirroredCorrection(o);var s=new e8(n.getText(),n.getRawBytes(),void 0,o,e6.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(e5.BYTE_SEGMENTS,u);var c=n.getECLevel();return null!==c&&s.putMetadata(e5.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(e5.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(e5.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new eW;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i||i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new eW;var u=Math.round((s-a+1)/n),c=Math.round((i-o+1)/n);if(u<=0||c<=0||c!==u)throw new eW;var f=Math.floor(n/2);o+=f;var h=(a+=f)+Math.floor((u-1)*n)-s;if(h>0){if(h>f)throw new eW;a-=h}var l=o+Math.floor((c-1)*n)-i;if(l>0){if(l>f)throw new eW;o-=l}for(var d=new eX(u,c),p=0;p<c;p++)for(var g=o+Math.floor(p*n),y=0;y<u;y++)t.get(a+Math.floor(y*n),g)&&d.set(y,p);return d},t.moduleSize=function(t,e){for(var r=e.getHeight(),n=e.getWidth(),o=t[0],i=t[1],a=!0,s=0;o<n&&i<r;){if(a!==e.get(o,i)){if(5==++s)break;a=!a}o++,i++}if(o===n||i===r)throw new eW;return(o-t[0])/7},t.NO_POINTS=[],t}(),oO=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oR=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return rh.sum(t)},t.toIntArray=function(e){if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var r,n,o=new Int32Array(e.length),i=0;try{for(var a=oO(e),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=eR.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(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,12103