barcode-detector-api-polyfill 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (()=>{function qi(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function Ji(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var $i=function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])},r(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),On=function(r){$i(t,r);function t(e,n){var i=this.constructor,o=r.call(this,e,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),qi(o,i.prototype),Ji(o),o}return t}(Error);var to=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),eo=function(r){to(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t}(On),$=eo;var ro=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),no=function(r){ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t}($),st=no;var io=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),oo=function(r){io(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t}($),O=oo;var ao=function(){function r(t){if(this.binarizer=t,t===null)throw new O("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(t,e,n,i){var o=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(o))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(t))},r.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(t))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Le=ao;var fo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),so=function(r){fo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}($),j=so;var uo=function(){function r(t){this.source=t}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),br=uo;var co=function(){function r(){}return r.arraycopy=function(t,e,n,i,o){for(;o--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),V=co;var ho=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(r){ho(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t}($),ye=lo;var po=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vo=function(r){po(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=e,i.message=n,i}return t.kind="ArrayIndexOutOfBoundsException",t}(ye),Pr=vo;var xo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},go=function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n]=e},r.fillWithin=function(t,e,n,i){r.rangeCheck(t.length,e,n);for(var o=e;o<n;o++)t[o]=i},r.rangeCheck=function(t,e,n){if(e>n)throw new O("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Pr(e);if(n>t)throw new Pr(n)},r.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},r.create=function(t,e,n){var i=Array.from({length:t});return i.map(function(o){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var i=Array.from({length:t});return i.map(function(o){return Int32Array.from({length:e}).fill(n)})},r.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var i=1;try{for(var o=xo(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=31*i+f}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.fillUint8Array=function(t,e){for(var n=0;n!==t.length;n++)t[n]=e},r.copyOf=function(t,e){return t.slice(0,e)},r.copyOfUint8Array=function(t,e){if(t.length<=e){var n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)},r.copyOfRange=function(t,e,n){var i=n-e,o=new Int32Array(i);return V.arraycopy(t,e,o,0,i),o},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,f=n(e,t[a]);if(f>0)i=a+1;else if(f<0)o=a-1;else return a}return-i-1},r.numberComparator=function(t,e){return t-e},r}(),Y=go;var mo=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return t>>>16||(e+=16,t<<=16),t>>>24||(e+=8,t<<=8),t>>>28||(e+=4,t<<=4),t>>>30||(e+=2,t<<=2),e-=t>>>31,e},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),M=mo;var yo=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var e=r.makeArray(t);V.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=~n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=~n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new O;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),o=this.bits,a=n;a<=i;a++){var f=a>n?0:t&31,s=a<i?31:e&31,u=(2<<s)-(1<<f);o[a]|=u}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;n<t;n++)e[n]=0},r.prototype.isRange=function(t,e,n){if(e<t||t<0||e>this.size)throw new O;if(e===t)return!0;e--;for(var i=Math.floor(t/32),o=Math.floor(e/32),a=this.bits,f=i;f<=o;f++){var s=f>i?0:t&31,u=f<o?31:e&31,c=(2<<u)-(1<<s)&4294967295;if((a[f]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new O("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)===1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n<e;n++)this.appendBit(t.get(n))},r.prototype.xor=function(t){if(this.size!==t.size)throw new O("Sizes don't match");for(var e=this.bits,n=0,i=e.length;n<i;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,i){for(var o=0;o<i;o++){for(var a=0,f=0;f<8;f++)this.get(t)&&(a|=1<<7-f),t++;e[n+o]=a}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,i=this.bits,o=0;o<n;o++){var a=i[o];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,t[e-o]=a}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,o=1;o<n;o++){var u=t[o];s|=u<<32-f,t[o-1]=s,s=u>>>f}t[n-1]=s}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Y.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)e&7||(t+=" "),t+=this.get(e)?"X":".";return t},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var t=[],e=0,n=this.size;e<n;e++)t.push(this.get(e));return t},r}(),it=yo;var Mr;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Mr||(Mr={}));var U=Mr;var Ao=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),wo=function(r){Ao(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t}($),S=wo;var Eo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tt;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(tt||(tt={}));var _o=function(){function r(t,e,n){for(var i,o,a=[],f=3;f<arguments.length;f++)a[f-3]=arguments[f];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var s=this.values,u=0,c=s.length;u!==c;u++){var h=s[u];r.VALUES_TO_ECI.set(h,this)}try{for(var l=Eo(a),d=l.next();!d.done;d=l.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new S("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(tt.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(tt.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(tt.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(tt.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(tt.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(tt.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(tt.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(tt.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(tt.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(tt.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(tt.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(tt.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(tt.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(tt.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(tt.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(tt.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(tt.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(tt.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(tt.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(tt.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(tt.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(tt.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(tt.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(tt.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(tt.Big5,28,"Big5"),r.GB18030=new r(tt.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(tt.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),ot=_o;var Co=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Io=function(r){Co(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}($),ce=Io;var So=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof ot?t:ot.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var f=t[o].toString(16);f.length<2&&(f="0"+f),i+="%"+f}return decodeURIComponent(i)}if(n.equals(ot.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ce("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(ot.UTF8)||t.equals(ot.ISO8859_1)||t.equals(ot.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),i=[],o=0;o<n.length;o++)i.push(n[o].charCodeAt(0));return new Uint8Array(i)},r}(),yt=So;var Oo=function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return yt.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(U.CHARACTER_SET)!==void 0)return e.get(U.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,f=0,s=0,u=0,c=0,h=0,l=0,d=0,p=0,v=0,g=0,y=0,m=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,A=0;A<n&&(i||o||a);A++){var _=t[A]&255;a&&(f>0?_&128?f--:a=!1:_&128&&(_&64?(f++,_&32?(f++,_&16?(f++,_&8?a=!1:c++):u++):s++):a=!1)),i&&(_>127&&_<160?i=!1:_>159&&(_<192||_===215||_===247)&&y++),o&&(h>0?_<64||_===127||_>252?o=!1:h--:_===128||_===160||_>239?o=!1:_>160&&_<224?(l++,p=0,d++,d>v&&(v=d)):_>127?(h++,d=0,p++,p>g&&(g=p)):(d=0,p=0))}return a&&f>0&&(a=!1),o&&h>0&&(o=!1),a&&(m||s+u+c>0)?r.UTF8:o&&(r.ASSUME_SHIFT_JIS||v>=3||g>=3)?r.SHIFT_JIS:i&&o?v===2&&l===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:o?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=-1;function o(f,s,u,c,h,l){if(f==="%%")return"%";if(e[++i]!==void 0){f=c?parseInt(c.substr(1)):void 0;var d=h?parseInt(h.substr(1)):void 0,p;switch(l){case"s":p=e[i];break;case"c":p=e[i][0];break;case"f":p=parseFloat(e[i]).toFixed(f);break;case"p":p=parseFloat(e[i]).toPrecision(f);break;case"e":p=parseFloat(e[i]).toExponential(f);break;case"x":p=parseInt(e[i]).toString(d||16);break;case"d":p=parseFloat(parseInt(e[i],d||10).toPrecision(f)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(d);for(var v=parseInt(u),g=u&&u[0]+""=="0"?"0":" ";p.length<v;)p=s!==void 0?p+g:g+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(a,o)},r.getBytes=function(t,e){return yt.encode(t,e)},r.getCharCode=function(t,e){return e===void 0&&(e=0),t.charCodeAt(e)},r.getCharAt=function(t){return String.fromCharCode(t)},r.SHIFT_JIS=ot.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=ot.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=ot.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),F=Oo;var To=function(){function r(t){t===void 0&&(t=""),this.value=t}return r.prototype.enableDecoding=function(t){return this.encoding=t,this},r.prototype.append=function(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=F.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},r.prototype.appendChars=function(t,e,n){for(var i=e;e<e+n;i++)this.append(t[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(t){return this.value.charAt(t)},r.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},r.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},r.prototype.substring=function(t,e){return this.value.substring(t,e)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(t,e){this.value=this.value.substring(0,t)+e+this.value.substring(t)},r}(),P=To;var Do=function(){function r(t,e,n,i){if(this.width=t,this.height=e,this.rowSize=n,this.bits=i,e==null&&(e=t),this.height=e,t<1||e<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,i=new r(n,e),o=0;o<e;o++)for(var a=t[o],f=0;f<n;f++)a[f]&&i.set(f,o);return i},r.parseFromString=function(t,e,n){if(t===null)throw new O("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,f=-1,s=0,u=0;u<t.length;)if(t.charAt(u)===`
1
+ "use strict";(()=>{function qi(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function Ji(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var $i=function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,o){i.__proto__=o}||function(i,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])},r(e,n)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),On=function(r){$i(t,r);function t(e,n){var i=this.constructor,o=r.call(this,e,n)||this;return Object.defineProperty(o,"name",{value:i.name,enumerable:!1,configurable:!0}),qi(o,i.prototype),Ji(o),o}return t}(Error);var to=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),eo=function(r){to(t,r);function t(e){e===void 0&&(e=void 0);var n=r.call(this,e)||this;return n.message=e,n}return t.prototype.getKind=function(){var e=this.constructor;return e.kind},t.kind="Exception",t}(On),$=eo;var ro=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),no=function(r){ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t}($),st=no;var io=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),oo=function(r){io(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t}($),O=oo;var ao=function(){function r(t){if(this.binarizer=t,t===null)throw new O("Binarizer must be non-null.")}return r.prototype.getWidth=function(){return this.binarizer.getWidth()},r.prototype.getHeight=function(){return this.binarizer.getHeight()},r.prototype.getBlackRow=function(t,e){return this.binarizer.getBlackRow(t,e)},r.prototype.getBlackMatrix=function(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},r.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},r.prototype.crop=function(t,e,n,i){var o=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(o))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(t))},r.prototype.rotateCounterClockwise45=function(){var t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(t))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r}(),Le=ao;var fo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),so=function(r){fo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}($),j=so;var uo=function(){function r(t){this.source=t}return r.prototype.getLuminanceSource=function(){return this.source},r.prototype.getWidth=function(){return this.source.getWidth()},r.prototype.getHeight=function(){return this.source.getHeight()},r}(),br=uo;var co=function(){function r(){}return r.arraycopy=function(t,e,n,i,o){for(;o--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),V=co;var ho=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),lo=function(r){ho(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t}($),ye=lo;var po=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vo=function(r){po(t,r);function t(e,n){e===void 0&&(e=void 0),n===void 0&&(n=void 0);var i=r.call(this,n)||this;return i.index=e,i.message=n,i}return t.kind="ArrayIndexOutOfBoundsException",t}(ye),Pr=vo;var xo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},go=function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;n<i;n++)t[n]=e},r.fillWithin=function(t,e,n,i){r.rangeCheck(t.length,e,n);for(var o=e;o<n;o++)t[o]=i},r.rangeCheck=function(t,e,n){if(e>n)throw new O("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Pr(e);if(n>t)throw new Pr(n)},r.asList=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},r.create=function(t,e,n){var i=Array.from({length:t});return i.map(function(o){return Array.from({length:e}).fill(n)})},r.createInt32Array=function(t,e,n){var i=Array.from({length:t});return i.map(function(o){return Int32Array.from({length:e}).fill(n)})},r.equals=function(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0},r.hashCode=function(t){var e,n;if(t===null)return 0;var i=1;try{for(var o=xo(t),a=o.next();!a.done;a=o.next()){var f=a.value;i=31*i+f}}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.fillUint8Array=function(t,e){for(var n=0;n!==t.length;n++)t[n]=e},r.copyOf=function(t,e){return t.slice(0,e)},r.copyOfUint8Array=function(t,e){if(t.length<=e){var n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)},r.copyOfRange=function(t,e,n){var i=n-e,o=new Int32Array(i);return V.arraycopy(t,e,o,0,i),o},r.binarySearch=function(t,e,n){n===void 0&&(n=r.numberComparator);for(var i=0,o=t.length-1;i<=o;){var a=o+i>>1,f=n(e,t[a]);if(f>0)i=a+1;else if(f<0)o=a-1;else return a}return-i-1},r.numberComparator=function(t,e){return t-e},r}(),Y=go;var mo=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return t>>>16||(e+=16,t<<=16),t>>>24||(e+=8,t<<=8),t>>>28||(e+=4,t<<=4),t>>>30||(e+=2,t<<=2),e-=t>>>31,e},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),M=mo;var yo=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=r.makeArray(t):this.bits=e)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>this.bits.length*32){var e=r.makeArray(t);V.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(t&31)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(t&31)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,i=Math.floor(t/32),o=~n[i];o&=~((1<<(t&31))-1);for(var a=n.length;o===0;){if(++i===a)return e;o=~n[i]}var f=i*32+M.numberOfTrailingZeros(o);return f>e?e:f},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(e<t||t<0||e>this.size)throw new O;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),o=this.bits,a=n;a<=i;a++){var f=a>n?0:t&31,s=a<i?31:e&31,u=(2<<s)-(1<<f);o[a]|=u}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;n<t;n++)e[n]=0},r.prototype.isRange=function(t,e,n){if(e<t||t<0||e>this.size)throw new O;if(e===t)return!0;e--;for(var i=Math.floor(t/32),o=Math.floor(e/32),a=this.bits,f=i;f<=o;f++){var s=f>i?0:t&31,u=f<o?31:e&31,c=(2<<u)-(1<<s)&4294967295;if((a[f]&c)!==(n?c:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new O("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)===1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n<e;n++)this.appendBit(t.get(n))},r.prototype.xor=function(t){if(this.size!==t.size)throw new O("Sizes don't match");for(var e=this.bits,n=0,i=e.length;n<i;n++)e[n]^=t.bits[n]},r.prototype.toBytes=function(t,e,n,i){for(var o=0;o<i;o++){for(var a=0,f=0;f<8;f++)this.get(t)&&(a|=1<<7-f),t++;e[n+o]=a}},r.prototype.getBitArray=function(){return this.bits},r.prototype.reverse=function(){for(var t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,i=this.bits,o=0;o<n;o++){var a=i[o];a=a>>1&1431655765|(a&1431655765)<<1,a=a>>2&858993459|(a&858993459)<<2,a=a>>4&252645135|(a&252645135)<<4,a=a>>8&16711935|(a&16711935)<<8,a=a>>16&65535|(a&65535)<<16,t[e-o]=a}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,o=1;o<n;o++){var u=t[o];s|=u<<32-f,t[o-1]=s,s=u>>>f}t[n-1]=s}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+Y.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e<n;e++)e&7||(t+=" "),t+=this.get(e)?"X":".";return t},r.prototype.clone=function(){return new r(this.size,this.bits.slice())},r.prototype.toArray=function(){for(var t=[],e=0,n=this.size;e<n;e++)t.push(this.get(e));return t},r}(),it=yo;var Mr;(function(r){r[r.OTHER=0]="OTHER",r[r.PURE_BARCODE=1]="PURE_BARCODE",r[r.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",r[r.TRY_HARDER=3]="TRY_HARDER",r[r.CHARACTER_SET=4]="CHARACTER_SET",r[r.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",r[r.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",r[r.ASSUME_GS1=7]="ASSUME_GS1",r[r.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",r[r.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",r[r.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Mr||(Mr={}));var U=Mr;var Ao=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),wo=function(r){Ao(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getFormatInstance=function(){return new t},t.kind="FormatException",t}($),S=wo;var Eo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tt;(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(tt||(tt={}));var _o=function(){function r(t,e,n){for(var i,o,a=[],f=3;f<arguments.length;f++)a[f-3]=arguments[f];this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=a,r.VALUE_IDENTIFIER_TO_ECI.set(t,this),r.NAME_TO_ECI.set(n,this);for(var s=this.values,u=0,c=s.length;u!==c;u++){var h=s[u];r.VALUES_TO_ECI.set(h,this)}try{for(var l=Eo(a),d=l.next();!d.done;d=l.next()){var p=d.value;r.NAME_TO_ECI.set(p,this)}}catch(v){i={error:v}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}return r.prototype.getValueIdentifier=function(){return this.valueIdentifier},r.prototype.getName=function(){return this.name},r.prototype.getValue=function(){return this.values[0]},r.getCharacterSetECIByValue=function(t){if(t<0||t>=900)throw new S("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new S("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(tt.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(tt.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(tt.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(tt.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(tt.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(tt.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(tt.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(tt.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(tt.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(tt.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(tt.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(tt.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(tt.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(tt.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(tt.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(tt.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(tt.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(tt.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(tt.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(tt.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(tt.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(tt.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(tt.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(tt.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(tt.Big5,28,"Big5"),r.GB18030=new r(tt.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(tt.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),ot=_o;var Co=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Io=function(r){Co(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}($),ce=Io;var So=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof ot?t:ot.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",o=0,a=t.length;o<a;o++){var f=t[o].toString(16);f.length<2&&(f="0"+f),i+="%"+f}return decodeURIComponent(i)}if(n.equals(ot.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new ce("Encoding "+this.encodingName(e)+" not supported by fallback.")},r.isDecodeFallbackSupported=function(t){return t.equals(ot.UTF8)||t.equals(ot.ISO8859_1)||t.equals(ot.ASCII)},r.encodeFallback=function(t){for(var e=btoa(unescape(encodeURIComponent(t))),n=e.split(""),i=[],o=0;o<n.length;o++)i.push(n[o].charCodeAt(0));return new Uint8Array(i)},r}(),yt=So;var Oo=function(){function r(){}return r.castAsNonUtf8Char=function(t,e){e===void 0&&(e=null);var n=e?e.getName():this.ISO88591;return yt.decode(new Uint8Array([t]),n)},r.guessEncoding=function(t,e){if(e!=null&&e.get(U.CHARACTER_SET)!==void 0)return e.get(U.CHARACTER_SET).toString();for(var n=t.length,i=!0,o=!0,a=!0,f=0,s=0,u=0,c=0,h=0,l=0,d=0,p=0,v=0,g=0,y=0,m=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191,A=0;A<n&&(i||o||a);A++){var _=t[A]&255;a&&(f>0?_&128?f--:a=!1:_&128&&(_&64?(f++,_&32?(f++,_&16?(f++,_&8?a=!1:c++):u++):s++):a=!1)),i&&(_>127&&_<160?i=!1:_>159&&(_<192||_===215||_===247)&&y++),o&&(h>0?_<64||_===127||_>252?o=!1:h--:_===128||_===160||_>239?o=!1:_>160&&_<224?(l++,p=0,d++,d>v&&(v=d)):_>127?(h++,d=0,p++,p>g&&(g=p)):(d=0,p=0))}return a&&f>0&&(a=!1),o&&h>0&&(o=!1),a&&(m||s+u+c>0)?r.UTF8:o&&(r.ASSUME_SHIFT_JIS||v>=3||g>=3)?r.SHIFT_JIS:i&&o?v===2&&l===2||y*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:o?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=-1;function o(f,s,u,c,h,l){if(f==="%%")return"%";if(e[++i]!==void 0){f=c?parseInt(c.substr(1)):void 0;var d=h?parseInt(h.substr(1)):void 0,p;switch(l){case"s":p=e[i];break;case"c":p=e[i][0];break;case"f":p=parseFloat(e[i]).toFixed(f);break;case"p":p=parseFloat(e[i]).toPrecision(f);break;case"e":p=parseFloat(e[i]).toExponential(f);break;case"x":p=parseInt(e[i]).toString(d||16);break;case"d":p=parseFloat(parseInt(e[i],d||10).toPrecision(f)).toFixed(0);break}p=typeof p=="object"?JSON.stringify(p):(+p).toString(d);for(var v=parseInt(u),g=u&&u[0]+""=="0"?"0":" ";p.length<v;)p=s!==void 0?p+g:g+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(a,o)},r.getBytes=function(t,e){return yt.encode(t,e)},r.getCharCode=function(t,e){return e===void 0&&(e=0),t.charCodeAt(e)},r.getCharAt=function(t){return String.fromCharCode(t)},r.SHIFT_JIS=ot.SJIS.getName(),r.GB2312="GB2312",r.ISO88591=ot.ISO8859_1.getName(),r.EUC_JP="EUC_JP",r.UTF8=ot.UTF8.getName(),r.PLATFORM_DEFAULT_ENCODING=r.UTF8,r.ASSUME_SHIFT_JIS=!1,r}(),F=Oo;var To=function(){function r(t){t===void 0&&(t=""),this.value=t}return r.prototype.enableDecoding=function(t){return this.encoding=t,this},r.prototype.append=function(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=F.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this},r.prototype.appendChars=function(t,e,n){for(var i=e;e<e+n;i++)this.append(t[i]);return this},r.prototype.length=function(){return this.value.length},r.prototype.charAt=function(t){return this.value.charAt(t)},r.prototype.deleteCharAt=function(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)},r.prototype.setCharAt=function(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)},r.prototype.substring=function(t,e){return this.value.substring(t,e)},r.prototype.setLengthToZero=function(){this.value=""},r.prototype.toString=function(){return this.value},r.prototype.insert=function(t,e){this.value=this.value.substring(0,t)+e+this.value.substring(t)},r}(),P=To;var Do=function(){function r(t,e,n,i){if(this.width=t,this.height=e,this.rowSize=n,this.bits=i,e==null&&(e=t),this.height=e,t<1||e<1)throw new O("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,i==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return r.parseFromBooleanArray=function(t){for(var e=t.length,n=t[0].length,i=new r(n,e),o=0;o<e;o++)for(var a=t[o],f=0;f<n;f++)a[f]&&i.set(f,o);return i},r.parseFromString=function(t,e,n){if(t===null)throw new O("stringRepresentation cannot be null");for(var i=new Array(t.length),o=0,a=0,f=-1,s=0,u=0;u<t.length;)if(t.charAt(u)===`
2
2
  `||t.charAt(u)==="\r"){if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");a=o,s++}u++}else if(t.substring(u,u+e.length)===e)u+=e.length,i[o]=!0,o++;else if(t.substring(u,u+n.length)===n)u+=n.length,i[o]=!1,o++;else throw new O("illegal character encountered: "+t.substring(u));if(o>a){if(f===-1)f=o-a;else if(o-a!==f)throw new O("row lengths do not match");s++}for(var c=new r(f,s),h=0;h<o;h++)i[h]&&c.set(Math.floor(h%f),Math.floor(h/f));return c},r.prototype.get=function(t,e){var n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new O("input matrix dimensions do not match");for(var e=new it(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,o=0,a=this.height;o<a;o++)for(var f=o*n,s=t.getRow(o,e).getBitArray(),u=0;u<n;u++)i[f+u]^=s[u]},r.prototype.clear=function(){for(var t=this.bits,e=t.length,n=0;n<e;n++)t[n]=0},r.prototype.setRegion=function(t,e,n,i){if(e<0||t<0)throw new O("Left and top must be nonnegative");if(i<1||n<1)throw new O("Height and width must be at least 1");var o=t+n,a=e+i;if(a>this.height||o>this.width)throw new O("The region must fit inside the matrix");for(var f=this.rowSize,s=this.bits,u=e;u<a;u++)for(var c=u*f,h=t;h<o;h++)s[c+Math.floor(h/32)]|=1<<(h&31)&4294967295},r.prototype.getRow=function(t,e){e==null||e.getSize()<this.width?e=new it(this.width):e.clear();for(var n=this.rowSize,i=this.bits,o=t*n,a=0;a<n;a++)e.setBulk(a*32,i[o+a]);return e},r.prototype.setRow=function(t,e){V.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)},r.prototype.rotate180=function(){for(var t=this.getWidth(),e=this.getHeight(),n=new it(t),i=new it(t),o=0,a=Math.floor((e+1)/2);o<a;o++)n=this.getRow(o,n),i=this.getRow(e-1-o,i),n.reverse(),i.reverse(),this.setRow(o,i),this.setRow(e-1-o,n)},r.prototype.getEnclosingRectangle=function(){for(var t=this.width,e=this.height,n=this.rowSize,i=this.bits,o=t,a=e,f=-1,s=-1,u=0;u<e;u++)for(var c=0;c<n;c++){var h=i[u*n+c];if(h!==0){if(u<a&&(a=u),u>s&&(s=u),c*32<o){for(var l=0;!(h<<31-l&4294967295);)l++;c*32+l<o&&(o=c*32+l)}if(c*32+31>f){for(var l=31;!(h>>>l);)l--;c*32+l>f&&(f=c*32+l)}}}return f<o||s<a?null:Int32Array.from([o,a,f-o+1,s-a+1])},r.prototype.getTopLeftOnBit=function(){for(var t=this.rowSize,e=this.bits,n=0;n<e.length&&e[n]===0;)n++;if(n===e.length)return null;for(var i=n/t,o=n%t*32,a=e[n],f=0;!(a<<31-f&4294967295);)f++;return o+=f,Int32Array.from([o,i])},r.prototype.getBottomRightOnBit=function(){for(var t=this.rowSize,e=this.bits,n=e.length-1;n>=0&&e[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/t),o=Math.floor(n%t)*32,a=e[n],f=31;!(a>>>f);)f--;return o+=f,Int32Array.from([o,i])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&Y.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+Y.hashCode(this.bits),t},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=`
3
3
  `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new P,o=0,a=this.height;o<a;o++){for(var f=0,s=this.width;f<s;f++)i.append(this.get(f,o)?t:e);i.append(n)}return i.toString()},r.prototype.clone=function(){return new r(this.width,this.height,this.rowSize,this.bits.slice())},r}(),at=Do;var Ro=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),No=function(r){Ro(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getNotFoundInstance=function(){return new t},t.kind="NotFoundException",t}($),w=No;var bo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Po=function(r){bo(t,r);function t(e){var n=r.call(this,e)||this;return n.luminances=t.EMPTY,n.buckets=new Int32Array(t.LUMINANCE_BUCKETS),n}return t.prototype.getBlackRow=function(e,n){var i=this.getLuminanceSource(),o=i.getWidth();n==null||n.getSize()<o?n=new it(o):n.clear(),this.initArrays(o);for(var a=i.getRow(e,this.luminances),f=this.buckets,s=0;s<o;s++)f[(a[s]&255)>>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(f);if(o<3)for(var s=0;s<o;s++)(a[s]&255)<u&&n.set(s);else for(var c=a[0]&255,h=a[1]&255,s=1;s<o-1;s++){var l=a[s+1]&255;(h*4-c-l)/2<u&&n.set(s),c=h,h=l}return n},t.prototype.getBlackMatrix=function(){var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight(),o=new at(n,i);this.initArrays(n);for(var a=this.buckets,f=1;f<5;f++)for(var s=Math.floor(i*f/5),u=e.getRow(s,this.luminances),c=Math.floor(n*4/5),h=Math.floor(n/5);h<c;h++){var l=u[h]&255;a[l>>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(a),p=e.getMatrix(),f=0;f<i;f++)for(var v=f*n,h=0;h<n;h++){var l=p[v+h]&255;l<d&&o.set(h,f)}return o},t.prototype.createBinarizer=function(e){return new t(e)},t.prototype.initArrays=function(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));for(var n=this.buckets,i=0;i<t.LUMINANCE_BUCKETS;i++)n[i]=0},t.estimateBlackPoint=function(e){for(var n=e.length,i=0,o=0,a=0,f=0;f<n;f++)e[f]>a&&(o=f,a=e[f]),e[f]>i&&(i=e[f]);for(var s=0,u=0,f=0;f<n;f++){var c=f-o,h=e[f]*c*c;h>u&&(s=f,u=h)}if(o>s){var l=o;o=s,s=l}if(s-o<=n/16)throw new w;for(var d=s-1,p=-1,f=s-1;f>o;f--){var v=f-o,h=v*v*(s-f)*(i-e[f]);h>p&&(d=f,p=h)}return d<<t.LUMINANCE_SHIFT},t.LUMINANCE_BITS=5,t.LUMINANCE_SHIFT=8-t.LUMINANCE_BITS,t.LUMINANCE_BUCKETS=1<<t.LUMINANCE_BITS,t.EMPTY=Uint8ClampedArray.from([0]),t}(br),Br=Po;var Mo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Bo=function(r){Mo(t,r);function t(e){var n=r.call(this,e)||this;return n.matrix=null,n}return t.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var e=this.getLuminanceSource(),n=e.getWidth(),i=e.getHeight();if(n>=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var o=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&a++;var f=i>>t.BLOCK_SIZE_POWER;i&t.BLOCK_SIZE_MASK&&f++;var s=t.calculateBlackPoints(o,a,f,n,i),u=new at(n,i);t.calculateThresholdForBlock(o,a,f,n,i,s,u),this.matrix=u}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,i,o,a,f,s){for(var u=a-t.BLOCK_SIZE,c=o-t.BLOCK_SIZE,h=0;h<i;h++){var l=h<<t.BLOCK_SIZE_POWER;l>u&&(l=u);for(var d=t.cap(h,2,i-3),p=0;p<n;p++){var v=p<<t.BLOCK_SIZE_POWER;v>c&&(v=c);for(var g=t.cap(p,2,n-3),y=0,m=-2;m<=2;m++){var A=f[d+m];y+=A[g-2]+A[g-1]+A[g]+A[g+1]+A[g+2]}var _=y/25;t.thresholdBlock(e,v,l,_,o,s)}}},t.cap=function(e,n,i){return e<n?n:e>i?i:e},t.thresholdBlock=function(e,n,i,o,a,f){for(var s=0,u=i*a+n;s<t.BLOCK_SIZE;s++,u+=a)for(var c=0;c<t.BLOCK_SIZE;c++)(e[u+c]&255)<=o&&f.set(n+c,i+s)},t.calculateBlackPoints=function(e,n,i,o,a){for(var f=a-t.BLOCK_SIZE,s=o-t.BLOCK_SIZE,u=new Array(i),c=0;c<i;c++){u[c]=new Int32Array(n);var h=c<<t.BLOCK_SIZE_POWER;h>f&&(h=f);for(var l=0;l<n;l++){var d=l<<t.BLOCK_SIZE_POWER;d>s&&(d=s);for(var p=0,v=255,g=0,y=0,m=h*o+d;y<t.BLOCK_SIZE;y++,m+=o){for(var A=0;A<t.BLOCK_SIZE;A++){var _=e[m+A]&255;p+=_,_<v&&(v=_),_>g&&(g=_)}if(g-v>t.MIN_DYNAMIC_RANGE)for(y++,m+=o;y<t.BLOCK_SIZE;y++,m+=o)for(var A=0;A<t.BLOCK_SIZE;A++)p+=e[m+A]&255}var I=p>>t.BLOCK_SIZE_POWER*2;if(g-v<=t.MIN_DYNAMIC_RANGE&&(I=v/2,c>0&&l>0)){var T=(u[c-1][l]+2*u[c][l-1]+u[c-1][l-1])/4;v<T&&(I=T)}u[c][l]=I}}return u},t.BLOCK_SIZE_POWER=3,t.BLOCK_SIZE=1<<t.BLOCK_SIZE_POWER,t.BLOCK_SIZE_MASK=t.BLOCK_SIZE-1,t.MINIMUM_DIMENSION=t.BLOCK_SIZE*5,t.MIN_DYNAMIC_RANGE=24,t}(Br),ke=Bo;var Fo=function(){function r(t,e){this.width=t,this.height=e}return r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.isCropSupported=function(){return!1},r.prototype.crop=function(t,e,n,i){throw new ce("This luminance source does not support cropping.")},r.prototype.isRotateSupported=function(){return!1},r.prototype.rotateCounterClockwise=function(){throw new ce("This luminance source does not support rotation by 90 degrees.")},r.prototype.rotateCounterClockwise45=function(){throw new ce("This luminance source does not support rotation by 45 degrees.")},r.prototype.toString=function(){for(var t=new Uint8ClampedArray(this.width),e=new P,n=0;n<this.height;n++){for(var i=this.getRow(n,t),o=0;o<this.width;o++){var a=i[o]&255,f=void 0;a<64?f="#":a<128?f="+":a<192?f=".":f=" ",e.append(f)}e.append(`
4
4
  `)}return e.toString()},r}(),Ht=Fo;var Lo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ko=function(r){Lo(t,r);function t(e){var n=r.call(this,e.getWidth(),e.getHeight())||this;return n.delegate=e,n}return t.prototype.getRow=function(e,n){for(var i=this.delegate.getRow(e,n),o=this.getWidth(),a=0;a<o;a++)i[a]=255-(i[a]&255);return i},t.prototype.getMatrix=function(){for(var e=this.delegate.getMatrix(),n=this.getWidth()*this.getHeight(),i=new Uint8ClampedArray(n),o=0;o<n;o++)i[o]=255-(e[o]&255);return i},t.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},t.prototype.crop=function(e,n,i,o){return new t(this.delegate.crop(e,n,i,o))},t.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},t.prototype.invert=function(){return this.delegate},t.prototype.rotateCounterClockwise=function(){return new t(this.delegate.rotateCounterClockwise())},t.prototype.rotateCounterClockwise45=function(){return new t(this.delegate.rotateCounterClockwise45())},t}(Ht),zt=ko;var Uo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Tn=function(r){Uo(t,r);function t(e){var n=r.call(this,e.width,e.height)||this;return n.canvas=e,n.tempCanvasElement=null,n.buffer=t.makeBufferFromCanvasImageData(e),n}return t.makeBufferFromCanvasImageData=function(e){var n=e.getContext("2d").getImageData(0,0,e.width,e.height);return t.toGrayscaleBuffer(n.data,e.width,e.height)},t.toGrayscaleBuffer=function(e,n,i){var o=new Uint8ClampedArray(n*i);if(t.FRAME_INDEX=!t.FRAME_INDEX,t.FRAME_INDEX)for(var a=0,f=0,s=e.length;a<s;a+=4,f++){var u=void 0,c=e[a+3];if(c===0)u=255;else{var h=e[a],l=e[a+1],d=e[a+2];u=306*h+601*l+117*d+512>>10}o[f]=u}else for(var a=0,f=0,p=e.length;a<p;a+=4,f++){var u=void 0,c=e[a+3];if(c===0)u=255;else{var h=e[a],l=e[a+1],d=e[a+2];u=306*h+601*l+117*d+512>>10}o[f]=255-u}return o},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new O("Requested row is outside the image: "+e);var i=this.getWidth(),o=e*i;return n===null?n=this.buffer.slice(o,o+i):(n.length<i&&(n=new Uint8ClampedArray(i)),n.set(this.buffer.slice(o,o+i))),n},t.prototype.getMatrix=function(){return this.buffer},t.prototype.isCropSupported=function(){return!0},t.prototype.crop=function(e,n,i,o){return r.prototype.crop.call(this,e,n,i,o),this},t.prototype.isRotateSupported=function(){return!0},t.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},t.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},t.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement},t.prototype.rotate=function(e){var n=this.getTempCanvasElement(),i=n.getContext("2d"),o=e*t.DEGREE_TO_RADIANS,a=this.canvas.width,f=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*a+Math.abs(Math.sin(o))*f),u=Math.ceil(Math.abs(Math.sin(o))*a+Math.abs(Math.cos(o))*f);return n.width=s,n.height=u,i.translate(s/2,u/2),i.rotate(o),i.drawImage(this.canvas,a/-2,f/-2),this.buffer=t.makeBufferFromCanvasImageData(n),this},t.prototype.invert=function(){return new zt(this)},t.DEGREE_TO_RADIANS=Math.PI/180,t.FRAME_INDEX=!0,t}(Ht);var Dn=function(){function r(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}return r.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},r}();var Ot=function(r,t,e,n){function i(o){return o instanceof e?o:new e(function(a){a(o)})}return new(e||(e=Promise))(function(o,a){function f(c){try{u(n.next(c))}catch(h){a(h)}}function s(c){try{u(n.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(f,s)}u((n=n.apply(r,t||[])).next())})},Tt=function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(u){return function(c){return s([u,c])}}function s(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,i=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){e.label=u[1];break}if(u[0]===6&&e.label<o[1]){e.label=o[1],o=u;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(u);break}o[2]&&e.ops.pop(),e.trys.pop();continue}u=t.call(r,e)}catch(c){u=[6,c],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Ho=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mt=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return Ot(this,void 0,void 0,function(){var t,e,n,i,o,a,f,s,u,c,h,l;return Tt(this,function(d){switch(d.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=Ho(t),i=n.next();!i.done;i=n.next())o=i.value,a=o.kind==="video"?"videoinput":o.kind,a==="videoinput"&&(f=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,c={deviceId:f,label:s,kind:a,groupId:u},e.push(c))}catch(p){h={error:p}}finally{try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(h)throw h.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return Ot(this,void 0,void 0,function(){var t;return Tt(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=e.sent(),[2,t.map(function(n){return new Dn(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=n.sent(),e?[2,e.find(function(i){return i.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return Ot(this,void 0,void 0,function(){return Tt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return Ot(this,void 0,void 0,function(){var n,i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),t?n={deviceId:{exact:t}}:n={facingMode:"environment"},i={video:n},[4,this.decodeOnceFromConstraints(i,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=i.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,i.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return Ot(this,void 0,void 0,function(){var n,i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeOnce(n)];case 2:return i=o.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return Ot(this,void 0,void 0,function(){return Tt(this,function(i){switch(i.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return Ot(this,void 0,void 0,function(){var i,o;return Tt(this,function(a){switch(a.label){case 0:return t?i={deviceId:{exact:t}}:i={facingMode:"environment"},o={video:i},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return i=o.sent(),[4,this.decodeFromStream(i,e,n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return Ot(this,void 0,void 0,function(){var i;return Tt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return i=o.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,o.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return Ot(this,void 0,void 0,function(){var n;return Tt(this,function(i){switch(i.label){case 0:return n=this.prepareVideoElement(e),this.addVideoSource(n,t),this.videoElement=n,this.stream=t,[4,this.playVideoOnLoadAsync(n)];case 1:return i.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,i){return e.playVideoOnLoad(t,function(){return n()})})},r.prototype.playVideoOnLoad=function(t,e){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},r.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},r.prototype.tryPlayVideo=function(t){return Ot(this,void 0,void 0,function(){var e;return Tt(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.play()];case 2:return n.sent(),[3,4];case 3:return e=n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new st("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new st("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new st("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},r.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new st("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},r.prototype.decodeFromVideoContinuously=function(t,e,n){if(t===void 0&&e===void 0)throw new st("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)},r.prototype.decodeFromImageElement=function(t){if(!t)throw new st("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);this.imageElement=e;var n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n},r.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},r.prototype.decodeFromVideoElementContinuously=function(t,e){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)},r.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new st("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},r.prototype.decodeFromImageUrl=function(t){if(!t)throw new st("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var n=this._decodeOnLoadImage(e);return e.src=t,n},r.prototype.decodeFromVideoUrl=function(t){if(!t)throw new st("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n},r.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new st("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),i=this.decodeFromVideoElementContinuously(n,e);return n.src=t,i},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,i){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,i)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return Ot(this,void 0,void 0,function(){return Tt(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()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(t,e){return Ot(this,void 0,void 0,function(){return Tt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),this.decodeContinuously(t,e),[2]}})})},r.prototype.isImageLoaded=function(t){return!(!t.complete||t.naturalWidth===0)},r.prototype.prepareImageElement=function(t){var e;return typeof t>"u"&&(e=document.createElement("img"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},r.prototype.prepareVideoElement=function(t){var e;return!t&&typeof document<"u"&&(e=document.createElement("video"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.prototype.decodeOnce=function(t,e,n){var i=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var o=function(a,f){if(i._stopAsyncDecode){f(new w("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var s=i.decode(t);a(s)}catch(l){var u=e&&l instanceof w,c=l instanceof j||l instanceof S,h=c&&n;if(u||h)return setTimeout(o,i._timeBetweenDecodingAttempts,a,f);f(l)}};return new Promise(function(a,f){return o(a,f)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var i=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var o=n.decode(t);e(o,null),setTimeout(i,n.timeBetweenScansMillis)}catch(s){e(null,s);var a=s instanceof j||s instanceof S,f=s instanceof w;(a||f)&&setTimeout(i,n._timeBetweenDecodingAttempts)}};i()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){var e=this.getCaptureCanvasContext(t);t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var n=this.getCaptureCanvas(t),i=new Tn(n),o=new ke(i);return new Le(o)},r.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),n=void 0;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.drawImageOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},r.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var e=document.createElement("canvas"),n,i;return typeof t<"u"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,i=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,i=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=i+"px",e.width=n,e.height=i,e},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}},r.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},r}();var Vo=function(){function r(t,e,n,i,o,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=V.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=i,this.format=o,this.timestamp=a,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=i,this.format=o,this.resultMetadata=null,a==null?this.timestamp=V.currentTimeMillis():this.timestamp=a}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},r.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},r.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){var n=new Array(e.length+t.length);V.arraycopy(e,0,n,0,e.length),V.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}(),Z=Vo;var Fr;(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Fr||(Fr={}));var C=Fr;var Lr;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Lr||(Lr={}));var ft=Lr;var Go=function(){function r(t,e,n,i,o,a){o===void 0&&(o=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(t){this.numBits=t},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(t){this.erasures=t},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(t){this.other=t},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),Zt=Go;var Wo=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new O;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),he=Wo;var Xo=function(){function r(t,e){if(e.length===0)throw new O;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;i<n&&e[i]===0;)i++;i===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-i),V.arraycopy(e,i,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}return r.prototype.getCoefficients=function(){return this.coefficients},r.prototype.getDegree=function(){return this.coefficients.length-1},r.prototype.isZero=function(){return this.coefficients[0]===0},r.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},r.prototype.evaluateAt=function(t){if(t===0)return this.getCoefficient(0);var e=this.coefficients,n;if(t===1){n=0;for(var i=0,o=e.length;i!==o;i++){var a=e[i];n=he.addOrSubtract(n,a)}return n}n=e[0];for(var f=e.length,s=this.field,i=1;i<f;i++)n=he.addOrSubtract(s.multiply(t,n),e[i]);return n},r.prototype.addOrSubtract=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;var e=this.coefficients,n=t.coefficients;if(e.length>n.length){var i=e;e=n,n=i}var o=new Int32Array(n.length),a=n.length-e.length;V.arraycopy(n,0,o,0,a);for(var f=a;f<n.length;f++)o[f]=he.addOrSubtract(e[f-a],n[f]);return new r(this.field,o)},r.prototype.multiply=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();for(var e=this.coefficients,n=e.length,i=t.coefficients,o=i.length,a=new Int32Array(n+o-1),f=this.field,s=0;s<n;s++)for(var u=e[s],c=0;c<o;c++)a[s+c]=he.addOrSubtract(a[s+c],f.multiply(u,i[c]));return new r(f,a)},r.prototype.multiplyScalar=function(t){if(t===0)return this.field.getZero();if(t===1)return this;for(var e=this.coefficients.length,n=this.field,i=new Int32Array(e),o=this.coefficients,a=0;a<e;a++)i[a]=n.multiply(o[a],t);return new r(n,i)},r.prototype.multiplyByMonomial=function(t,e){if(t<0)throw new O;if(e===0)return this.field.getZero();for(var n=this.coefficients,i=n.length,o=new Int32Array(i+t),a=this.field,f=0;f<i;f++)o[f]=a.multiply(n[f],e);return new r(a,o)},r.prototype.divide=function(t){if(!this.field.equals(t.field))throw new O("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new O("Divide by 0");for(var e=this.field,n=e.getZero(),i=this,o=t.getCoefficient(t.getDegree()),a=e.inverse(o);i.getDegree()>=t.getDegree()&&!i.isZero();){var f=i.getDegree()-t.getDegree(),s=e.multiply(i.getCoefficient(i.getDegree()),a),u=t.multiplyByMonomial(f,s),c=e.buildMonomial(f,s);n=n.addOrSubtract(c),i=i.addOrSubtract(u)}return[n,i]},r.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){var i=this.field.log(n);i===0?t+="1":i===1?t+="a":(t+="a^",t+=i)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r}(),Bt=Xo;var zo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Zo=function(r){zo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t}($),Ue=Zo;var jo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Yo=function(r){jo(t,r);function t(e,n,i){var o=r.call(this)||this;o.primitive=e,o.size=n,o.generatorBase=i;for(var a=new Int32Array(n),f=1,s=0;s<n;s++)a[s]=f,f*=2,f>=n&&(f^=e,f&=n-1);o.expTable=a;for(var u=new Int32Array(n),s=0;s<n-1;s++)u[a[s]]=s;return o.logTable=u,o.zero=new Bt(o,Int32Array.from([0])),o.one=new Bt(o,Int32Array.from([1])),o}return t.prototype.getZero=function(){return this.zero},t.prototype.getOne=function(){return this.one},t.prototype.buildMonomial=function(e,n){if(e<0)throw new O;if(n===0)return this.zero;var i=new Int32Array(e+1);return i[0]=n,new Bt(this,i)},t.prototype.inverse=function(e){if(e===0)throw new Ue;return this.expTable[this.size-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.size-1)]},t.prototype.getSize=function(){return this.size},t.prototype.getGeneratorBase=function(){return this.generatorBase},t.prototype.toString=function(){return"GF(0x"+M.toHexString(this.primitive)+","+this.size+")"},t.prototype.equals=function(e){return e===this},t.AZTEC_DATA_12=new t(4201,4096,1),t.AZTEC_DATA_10=new t(1033,1024,1),t.AZTEC_DATA_6=new t(67,64,1),t.AZTEC_PARAM=new t(19,16,1),t.QR_CODE_FIELD_256=new t(285,256,0),t.DATA_MATRIX_FIELD_256=new t(301,256,1),t.AZTEC_DATA_8=t.DATA_MATRIX_FIELD_256,t.MAXICODE_FIELD_64=t.AZTEC_DATA_6,t}(he),dt=Yo;var Ko=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Qo=function(r){Ko(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReedSolomonException",t}($),Ae=Qo;var qo=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)i.hasOwnProperty(o)&&(n[o]=i[o])},r(t,e)};return function(t,e){r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Jo=function(r){qo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalStateException",t}($),xt=Jo;var $o=function(){function r(t){this.field=t}return r.prototype.decode=function(t,e){for(var n=this.field,i=new Bt(n,t),o=new Int32Array(e),a=!0,f=0;f<e;f++){var s=i.evaluateAt(n.exp(f+n.getGeneratorBase()));o[o.length-1-f]=s,s!==0&&(a=!1)}if(!a)for(var u=new Bt(n,o),c=this.runEuclideanAlgorithm(n.buildMonomial(e,1),u,e),h=c[0],l=c[1],d=this.findErrorLocations(h),p=this.findErrorMagnitudes(l,d),f=0;f<d.length;f++){var v=t.length-1-n.log(d[f]);if(v<0)throw new Ae("Bad error location");t[v]=dt.addOrSubtract(t[v],p[f])}},r.prototype.runEuclideanAlgorithm=function(t,e,n){if(t.getDegree()<e.getDegree()){var i=t;t=e,e=i}for(var o=this.field,a=t,f=e,s=o.getZero(),u=o.getOne();f.getDegree()>=(n/2|0);){var c=a,h=s;if(a=f,s=u,a.isZero())throw new Ae("r_{i-1} was zero");f=c;for(var l=o.getZero(),d=a.getCoefficient(a.getDegree()),p=o.inverse(d);f.getDegree()>=a.getDegree()&&!f.isZero();){var v=f.getDegree()-a.getDegree(),g=o.multiply(f.getCoefficient(f.getDegree()),p);l=l.addOrSubtract(o.buildMonomial(v,g)),f=f.addOrSubtract(a.multiplyByMonomial(v,g))}if(u=l.multiply(s).addOrSubtract(h),f.getDegree()>=a.getDegree())throw new xt("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new Ae("sigmaTilde(0) was zero");var m=o.inverse(y),A=u.multiplyScalar(m),_=f.multiplyScalar(m);return[A,_]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),i=0,o=this.field,a=1;a<o.getSize()&&i<e;a++)t.evaluateAt(a)===0&&(n[i]=o.inverse(a),i++);if(i!==e)throw new Ae("Error locator degree does not match number of roots");return n},r.prototype.findErrorMagnitudes=function(t,e){for(var n=e.length,i=new Int32Array(n),o=this.field,a=0;a<n;a++){for(var f=o.inverse(e[a]),s=1,u=0;u<n;u++)if(a!==u){var c=o.multiply(e[u],f),h=c&1?c&-2:c|1;s=o.multiply(s,h)}i[a]=o.multiply(t.evaluateAt(f),o.inverse(s)),o.getGeneratorBase()!==0&&(i[a]=o.multiply(i[a],f))}return i},r}(),jt=$o;var Ct;(function(r){r[r.UPPER=0]="UPPER",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.DIGIT=3]="DIGIT",r[r.PUNCT=4]="PUNCT",r[r.BINARY=5]="BINARY"})(Ct||(Ct={}));var ta=function(){function r(){}return r.prototype.decode=function(t){this.ddata=t;var e=t.getBits(),n=this.extractBits(e),i=this.correctBits(n),o=r.convertBoolArrayToByteArray(i),a=r.getEncodedData(i),f=new Zt(o,a,null,null);return f.setNumBits(i.length),f},r.highLevelDecode=function(t){return this.getEncodedData(t)},r.getEncodedData=function(t){for(var e=t.length,n=Ct.UPPER,i=Ct.UPPER,o="",a=0;a<e;)if(i===Ct.BINARY){if(e-a<5)break;var f=r.readCode(t,a,5);if(a+=5,f===0){if(e-a<11)break;f=r.readCode(t,a,11)+31,a+=11}for(var s=0;s<f;s++){if(e-a<8){a=e;break}var u=r.readCode(t,a,8);o+=F.castAsNonUtf8Char(u),a+=8}i=n}else{var c=i===Ct.DIGIT?4:5;if(e-a<c)break;var u=r.readCode(t,a,c);a+=c;var h=r.getCharacter(i,u);h.startsWith("CTRL_")?(n=i,i=r.getTable(h.charAt(5)),h.charAt(6)==="L"&&(n=i)):(o+=h,i=n)}return o},r.getTable=function(t){switch(t){case"L":return Ct.LOWER;case"P":return Ct.PUNCT;case"M":return Ct.MIXED;case"D":return Ct.DIGIT;case"B":return Ct.BINARY;case"U":default:return Ct.UPPER}},r.getCharacter=function(t,e){switch(t){case Ct.UPPER:return r.UPPER_TABLE[e];case Ct.LOWER:return r.LOWER_TABLE[e];case Ct.MIXED:return r.MIXED_TABLE[e];case Ct.PUNCT:return r.PUNCT_TABLE[e];case Ct.DIGIT:return r.DIGIT_TABLE[e];default:throw new xt("Bad table")}},r.prototype.correctBits=function(t){var e,n;this.ddata.getNbLayers()<=2?(n=6,e=dt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=dt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=dt.AZTEC_DATA_10):(n=12,e=dt.AZTEC_DATA_12);var i=this.ddata.getNbDatablocks(),o=t.length/n;if(o<i)throw new S;for(var a=t.length%n,f=new Int32Array(o),s=0;s<o;s++,a+=n)f[s]=r.readCode(t,a,n);try{var u=new jt(e);u.decode(f,o-i)}catch(g){throw new S(g)}for(var c=(1<<n)-1,h=0,s=0;s<i;s++){var l=f[s];if(l===0||l===c)throw new S;(l===1||l===c-1)&&h++}for(var d=new Array(i*n-h),p=0,s=0;s<i;s++){var l=f[s];if(l===1||l===c-1)d.fill(l>1,p,p+n-1),p+=n-1;else for(var v=n-1;v>=0;--v)d[p++]=(l&1<<v)!==0}return d},r.prototype.extractBits=function(t){var e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),i=(e?11:14)+n*4,o=new Int32Array(i),a=new Array(this.totalBitsInLayer(n,e));if(e)for(var f=0;f<o.length;f++)o[f]=f;else for(var s=i+1+2*M.truncDivision(M.truncDivision(i,2)-1,15),u=i/2,c=M.truncDivision(s,2),f=0;f<u;f++){var h=f+M.truncDivision(f,15);o[u-f-1]=c-h-1,o[u+f]=c+h+1}for(var f=0,l=0;f<n;f++){for(var d=(n-f)*4+(e?9:12),p=f*2,v=i-1-p,g=0;g<d;g++)for(var y=g*2,m=0;m<2;m++)a[l+y+m]=t.get(o[p+m],o[p+g]),a[l+2*d+y+m]=t.get(o[p+g],o[v-m]),a[l+4*d+y+m]=t.get(o[v-m],o[v-g]),a[l+6*d+y+m]=t.get(o[v-g],o[p+m]);l+=d*8}return a},r.readCode=function(t,e,n){for(var i=0,o=e;o<e+n;o++)i<<=1,t[o]&&(i|=1);return i},r.readByte=function(t,e){var n=t.length-e;return n>=8?r.readCode(t,e,8):r.readCode(t,e,n)<<8-n},r.convertBoolArrayToByteArray=function(t){for(var e=new Uint8Array((t.length+7)/8),n=0;n<e.length;n++)e[n]=r.readByte(t,8*n);return e},r.prototype.totalBitsInLayer=function(t,e){return((e?88:112)+16*t)*t},r.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"],r.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"],r.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`