(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".scanner__container[data-v-c4f5ee33]{position:relative}.scanner__container .content[data-v-c4f5ee33]{display:flex;min-height:100vh;width:100%;align-items:center;justify-content:center}.scanner__container .content video[data-v-c4f5ee33]{height:100%;width:100%}.scanner__container .container-btn-stop[data-v-c4f5ee33]{position:absolute;top:90%;left:50%;margin:auto;transform:translate(-50%,-50%)}.scanner__container .container-btn-stop button.btn-stop[data-v-c4f5ee33]{height:2.5rem;width:2.5rem;border-radius:9999px;border-width:4px;--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-delay:75ms;animation:blink-c4f5ee33 1s infinite}@keyframes blink-c4f5ee33{0%{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}50%{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}to{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}}.scanner__container .container-btn-stop button.btn-stop[data-v-c4f5ee33]:hover{border-width:4px;--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity));animation:none}.scanner__container .container-btn-facemode[data-v-c4f5ee33]{position:absolute;top:90%;left:15%;margin:auto;transform:translate(-50%,-50%)}.scanner__container .container-btn-facemode button.btn-facemode[data-v-c4f5ee33]{display:inline-flex;height:2.5rem;width:2.5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity));padding:.375rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-delay:75ms}.scanner__container .container-btn-facemode button.btn-facemode[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity));--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity)) }.scanner__container .btn-stream[data-v-c4f5ee33]{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity));padding:.625rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.scanner__container .btn-stream[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.scanner__container .btn-stream[data-v-c4f5ee33]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity)) }.scanner__container .btn-reset[data-v-c4f5ee33]{margin-inline-start:.5rem;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity));padding:.625rem 1.25rem;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.scanner__container .btn-reset[data-v-c4f5ee33]:hover{--tw-bg-opacity: 1;background-color:rgb(22 101 52 / var(--tw-bg-opacity))}.scanner__container .btn-reset[data-v-c4f5ee33]:focus{outline:2px solid transparent;outline-offset:2px}")),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})(); (function(Nt,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],O):(Nt=typeof globalThis<"u"?globalThis:Nt||self,O(Nt.Vue3BarcodeQRcodeReader={},Nt.Vue))})(this,function(Nt,O){"use strict";function Ke(r){return O.getCurrentScope()?(O.onScopeDispose(r),!0):!1}function ve(r){return typeof r=="function"?r():O.unref(r)}const Zr=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const $r=Object.prototype.toString,Kr=r=>$r.call(r)==="[object Object]",qr=()=>{};function Qr(r,t=!0){O.getCurrentInstance()?O.onMounted(r):t?r():O.nextTick(r)}function Jr(r){var t;const e=ve(r);return(t=e==null?void 0:e.$el)!=null?t:e}const pe=Zr?window:void 0;function tn(...r){let t,e,n,i;if(typeof r[0]=="string"||Array.isArray(r[0])?([e,n,i]=r,t=pe):[t,e,n,i]=r,!t)return qr;Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]);const a=[],o=()=>{a.forEach(c=>c()),a.length=0},f=(c,l,h,d)=>(c.addEventListener(l,h,d),()=>c.removeEventListener(l,h,d)),s=O.watch(()=>[Jr(t),ve(i)],([c,l])=>{if(o(),!c)return;const h=Kr(l)?{...l}:l;a.push(...e.flatMap(d=>n.map(v=>f(c,d,v,h))))},{immediate:!0,flush:"post"}),u=()=>{s(),o()};return Ke(u),u}function en(){const r=O.ref(!1);return O.getCurrentInstance()&&O.onMounted(()=>{r.value=!0}),r}function rn(r){const t=en();return O.computed(()=>(t.value,!!r()))}function nn(r,t={}){const{window:e=pe}=t,n=rn(()=>e&&"matchMedia"in e&&typeof e.matchMedia=="function");let i;const a=O.ref(!1),o=u=>{a.value=u.matches},f=()=>{i&&("removeEventListener"in i?i.removeEventListener("change",o):i.removeListener(o))},s=O.watchEffect(()=>{n.value&&(f(),i=e.matchMedia(ve(r)),"addEventListener"in i?i.addEventListener("change",o):i.addListener(o),a.value=i.matches)});return Ke(()=>{s(),f(),i=void 0}),a}function an(r={}){const{window:t=pe,initialWidth:e=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:a=!0}=r,o=O.ref(e),f=O.ref(n),s=()=>{t&&(a?(o.value=t.innerWidth,f.value=t.innerHeight):(o.value=t.document.documentElement.clientWidth,f.value=t.document.documentElement.clientHeight))};if(s(),Qr(s),tn("resize",s,{passive:!0}),i){const u=nn("(orientation: portrait)");O.watch(u,()=>s())}return{width:o,height:f}}const qe=(r,t)=>{const e=r.__vccOpts||r;for(const[n,i]of t)e[n]=i;return e},on={},fn={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"},sn=[O.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},[O.createElementVNode("path",{d:"M22.003 3v4.497A.503.503 0 0 1 21.5 8v0c-.2 0-.38-.119-.466-.3A10.001 10.001 0 0 0 12.003 2c-5.186 0-9.45 3.947-9.95 9"}),O.createElementVNode("path",{d:"M6 16.4V9.394a.6.6 0 0 1 .6-.6h1.173a.6.6 0 0 0 .504-.275l1.446-2.244A.6.6 0 0 1 10.227 6h3.546a.6.6 0 0 1 .504.275l1.446 2.244a.6.6 0 0 0 .504.275H17.4a.6.6 0 0 1 .6.6V16.4a.6.6 0 0 1-.6.6H6.6a.6.6 0 0 1-.6-.6Z"}),O.createElementVNode("path",{d:"M12 14a2 2 0 1 0 0-4a2 2 0 0 0 0 4Zm-9.95 7v-4.497c0-.278.226-.503.504-.503v0c.2 0 .38.119.466.3a10.001 10.001 0 0 0 9.03 5.7c5.186 0 9.45-3.947 9.951-9"})],-1)];function un(r,t){return O.openBlock(),O.createElementBlock("svg",fn,sn)}const Qe=qe(on,[["render",un]]);function cn(r,t){var e=Object.setPrototypeOf;e?e(r,t):r.__proto__=t}function ln(r,t){t===void 0&&(t=r.constructor);var e=Error.captureStackTrace;e&&e(r,t)}var hn=function(){var r=function(e,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(i[o]=a[o])},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)}}(),dn=function(r){hn(t,r);function t(e,n){var i=this.constructor,a=r.call(this,e,n)||this;return Object.defineProperty(a,"name",{value:i.name,enumerable:!1,configurable:!0}),cn(a,i.prototype),ln(a),a}return t}(Error),vn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),vt=function(r){vn(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}(dn),pn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),It=function(r){pn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArgumentException",t}(vt),gn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),M=function(r){gn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IllegalArgumentException",t}(vt),xn=function(){function r(t){if(this.binarizer=t,t===null)throw new M("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 a=this.binarizer.getLuminanceSource().crop(t,e,n,i);return new r(this.binarizer.createBinarizer(a))},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}(),yn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),at=function(r){yn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.getChecksumInstance=function(){return new t},t.kind="ChecksumException",t}(vt),_n=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}(),j=function(){function r(){}return r.arraycopy=function(t,e,n,i,a){for(;a--;)n[i++]=t[e++]},r.currentTimeMillis=function(){return Date.now()},r}(),wn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),ge=function(r){wn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="IndexOutOfBoundsException",t}(vt),An=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Je=function(r){An(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}(ge),En=globalThis&&globalThis.__values||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.")},J=function(){function r(){}return r.fill=function(t,e){for(var n=0,i=t.length;nn)throw new M("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Je(e);if(n>t)throw new Je(n)},r.asList=function(){for(var t=[],e=0;e>1,f=n(e,t[o]);if(f>0)i=o+1;else if(f<0)a=o-1;else return o}return-i-1},r.numberComparator=function(t,e){return t-e},r}(),F=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}(),ot=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);j.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),a=n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=n[i]}var f=i*32+F.numberOfTrailingZeros(a);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),a=~n[i];a&=~((1<<(t&31))-1);for(var o=n.length;a===0;){if(++i===o)return e;a=~n[i]}var f=i*32+F.numberOfTrailingZeros(a);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(ethis.size)throw new M;if(e!==t){e--;for(var n=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,o=n;o<=i;o++){var f=o>n?0:t&31,s=othis.size)throw new M;if(e===t)return!0;e--;for(var i=Math.floor(t/32),a=Math.floor(e/32),o=this.bits,f=i;f<=a;f++){var s=f>i?0:t&31,u=f32)throw new M("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>1&1431655765|(o&1431655765)<<1,o=o>>2&858993459|(o&858993459)<<2,o=o>>4&252645135|(o&252645135)<<4,o=o>>8&16711935|(o&16711935)<<8,o=o>>16&65535|(o&65535)<<16,t[e-a]=o}if(this.size!==n*32){for(var f=n*32-this.size,s=t[0]>>>f,a=1;a>>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&&J.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+J.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},W;(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"})(W||(W={}));var tt=function(){function r(t,e,n){for(var i,a,o=[],f=3;f=900)throw new T("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new T("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(W.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(W.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(W.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(W.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(W.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(W.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(W.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(W.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(W.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(W.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(W.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(W.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(W.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(W.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(W.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(W.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(W.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(W.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(W.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(W.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(W.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(W.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(W.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(W.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(W.Big5,28,"Big5"),r.GB18030=new r(W.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(W.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),mn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),ee=function(r){mn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="UnsupportedOperationException",t}(vt),At=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 tt?t:tt.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var i="",a=0,o=t.length;a3&&t[0]===239&&t[1]===187&&t[2]===191,A=0;A0?E&128?f--:o=!1:E&128&&(E&64?(f++,E&32?(f++,E&16?(f++,E&8?o=!1:c++):u++):s++):o=!1)),i&&(E>127&&E<160?i=!1:E>159&&(E<192||E===215||E===247)&&_++),a&&(l>0?E<64||E===127||E>252?a=!1:l--:E===128||E===160||E>239?a=!1:E>160&&E<224?(h++,v=0,d++,d>g&&(g=d)):E>127?(l++,d=0,v++,v>x&&(x=v)):(d=0,v=0))}return o&&f>0&&(o=!1),a&&l>0&&(a=!1),o&&(y||s+u+c>0)?r.UTF8:a&&(r.ASSUME_SHIFT_JIS||g>=3||x>=3)?r.SHIFT_JIS:i&&a?g===2&&h===2||_*10>=n?r.SHIFT_JIS:r.ISO88591:i?r.ISO88591:a?r.SHIFT_JIS:o?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;no){if(f===-1)f=a-o;else if(a-o!==f)throw new M("row lengths do not match");o=a,s++}u++}else if(t.substring(u,u+e.length)===e)u+=e.length,i[a]=!0,a++;else if(t.substring(u,u+n.length)===n)u+=n.length,i[a]=!1,a++;else throw new M("illegal character encountered: "+t.substring(u));if(a>o){if(f===-1)f=a-o;else if(a-o!==f)throw new M("row lengths do not match");s++}for(var c=new r(f,s),l=0;l>>(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 M("input matrix dimensions do not match");for(var e=new ot(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits,a=0,o=this.height;athis.height||a>this.width)throw new M("The region must fit inside the matrix");for(var f=this.rowSize,s=this.bits,u=e;us&&(s=u),c*32f){for(var h=31;!(l>>>h);)h--;c*32+h>f&&(f=c*32+h)}}}return f=0&&e[n]===0;)n--;if(n<0)return null;for(var i=Math.floor(n/t),a=Math.floor(n%t)*32,o=e[n],f=31;!(o>>>f);)f--;return a+=f,Int32Array.from([a,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&&J.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+J.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=` `),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var i=new B,a=0,o=this.height;a>t.LUMINANCE_SHIFT]++;var u=t.estimateBlackPoint(f);if(a<3)for(var s=0;s>t.LUMINANCE_SHIFT]++}for(var d=t.estimateBlackPoint(o),v=e.getMatrix(),f=0;fo&&(a=f,o=e[f]),e[f]>i&&(i=e[f]);for(var s=0,u=0,f=0;fu&&(s=f,u=l)}if(a>s){var h=a;a=s,s=h}if(s-a<=n/16)throw new C;for(var d=s-1,v=-1,f=s-1;f>a;f--){var g=f-a,l=g*g*(s-f)*(i-e[f]);l>v&&(d=f,v=l)}return d<=t.MINIMUM_DIMENSION&&i>=t.MINIMUM_DIMENSION){var a=e.getMatrix(),o=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&o++;var f=i>>t.BLOCK_SIZE_POWER;i&t.BLOCK_SIZE_MASK&&f++;var s=t.calculateBlackPoints(a,o,f,n,i),u=new Ot(n,i);t.calculateThresholdForBlock(a,o,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,a,o,f,s){for(var u=o-t.BLOCK_SIZE,c=a-t.BLOCK_SIZE,l=0;lu&&(h=u);for(var d=t.cap(l,2,i-3),v=0;vc&&(g=c);for(var x=t.cap(v,2,n-3),_=0,y=-2;y<=2;y++){var A=f[d+y];_+=A[x-2]+A[x-1]+A[x]+A[x+1]+A[x+2]}var E=_/25;t.thresholdBlock(e,g,h,E,a,s)}}},t.cap=function(e,n,i){return ei?i:e},t.thresholdBlock=function(e,n,i,a,o,f){for(var s=0,u=i*o+n;sf&&(l=f);for(var h=0;hs&&(d=s);for(var v=0,g=255,x=0,_=0,y=l*a+d;_x&&(x=E)}if(x-g>t.MIN_DYNAMIC_RANGE)for(_++,y+=a;_>t.BLOCK_SIZE_POWER*2;if(x-g<=t.MIN_DYNAMIC_RANGE&&(I=g/2,c>0&&h>0)){var S=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;g>10}a[f]=u}else for(var o=0,f=0,v=e.length;o>10}a[f]=255-u}return a},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);var i=this.getWidth(),a=e*i;return n===null?n=this.buffer.slice(a,a+i):(n.length0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gt=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 pt(this,void 0,void 0,function(){var t,e,n,i,a,o,f,s,u,c,l,h;return gt(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=Bn(t),i=n.next();!i.done;i=n.next())a=i.value,o=a.kind==="video"?"videoinput":a.kind,o==="videoinput"&&(f=a.deviceId||a.id,s=a.label||"Video device "+(e.length+1),u=a.groupId,c={deviceId:f,label:s,kind:o,groupId:u},e.push(c))}catch(v){l={error:v}}finally{try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return pt(this,void 0,void 0,function(){var t;return gt(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 Mn(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(t){return pt(this,void 0,void 0,function(){var e;return gt(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 pt(this,void 0,void 0,function(){return gt(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 pt(this,void 0,void 0,function(){var n,i;return gt(this,function(a){switch(a.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,a.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return pt(this,void 0,void 0,function(){var n;return gt(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 pt(this,void 0,void 0,function(){var n,i;return gt(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=a.sent(),[4,this.decodeOnce(n)];case 2:return i=a.sent(),[2,i]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return pt(this,void 0,void 0,function(){return gt(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 pt(this,void 0,void 0,function(){var i,a;return gt(this,function(o){switch(o.label){case 0:return t?i={deviceId:{exact:t}}:i={facingMode:"environment"},a={video:i},[4,this.decodeFromConstraints(a,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return pt(this,void 0,void 0,function(){var i;return gt(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return i=a.sent(),[4,this.decodeFromStream(i,e,n)];case 2:return[2,a.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return pt(this,void 0,void 0,function(){var i;return gt(this,function(a){switch(a.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return i=a.sent(),[4,this.decodeContinuously(i,n)];case 2:return[2,a.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return pt(this,void 0,void 0,function(){var n;return gt(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 pt(this,void 0,void 0,function(){return gt(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]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new It("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new It("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new It("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 It("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 It("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 It("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 It("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 It("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 It("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 It("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 pt(this,void 0,void 0,function(){return gt(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 pt(this,void 0,void 0,function(){return gt(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 a=function(o,f){if(i._stopAsyncDecode){f(new C("Video stream has ended before any code could be detected.")),i._stopAsyncDecode=void 0;return}try{var s=i.decode(t);o(s)}catch(h){var u=e&&h instanceof C,c=h instanceof at||h instanceof T,l=c&&n;if(u||l)return setTimeout(a,i._timeBetweenDecodingAttempts,o,f);f(h)}};return new Promise(function(o,f){return a(o,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 a=n.decode(t);e(a,null),setTimeout(i,n.timeBetweenScansMillis)}catch(s){e(null,s);var o=s instanceof at||s instanceof T,f=s instanceof C;(o||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){this.getCaptureCanvasContext(t),t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var e=this.getCaptureCanvas(t),n=new Pn(e),i=new Dn(n);return new xn(i)},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}(),ut=function(){function r(t,e,n,i,a,o){n===void 0&&(n=e==null?0:8*e.length),o===void 0&&(o=j.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=i,this.format=a,this.timestamp=o,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=i,this.format=a,this.resultMetadata=null,o==null?this.timestamp=j.currentTimeMillis():this.timestamp=o}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);j.arraycopy(e,0,n,0,e.length),j.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}(),_e;(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"})(_e||(_e={}));const P=_e;var we;(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"})(we||(we={}));const ct=we;var ne=function(){function r(t,e,n,i,a,o){a===void 0&&(a=-1),o===void 0&&(o=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=i,this.structuredAppendSequenceNumber=a,this.structuredAppendParity=o,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}(),jt=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new M;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),Rt=function(){function r(t,e){if(e.length===0)throw new M;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;in.length){var i=e;e=n,n=i}var a=new Int32Array(n.length),o=n.length-e.length;j.arraycopy(n,0,a,0,o);for(var f=o;f=t.getDegree()&&!i.isZero();){var f=i.getDegree()-t.getDegree(),s=e.multiply(i.getCoefficient(i.getDegree()),o),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}(),Fn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),tr=function(r){Fn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ArithmeticException",t}(vt),Ln=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),yt=function(r){Ln(t,r);function t(e,n,i){var a=r.call(this)||this;a.primitive=e,a.size=n,a.generatorBase=i;for(var o=new Int32Array(n),f=1,s=0;s=n&&(f^=e,f&=n-1);a.expTable=o;for(var u=new Int32Array(n),s=0;s=(n/2|0);){var c=o,l=s;if(o=f,s=u,o.isZero())throw new ie("r_{i-1} was zero");f=c;for(var h=a.getZero(),d=o.getCoefficient(o.getDegree()),v=a.inverse(d);f.getDegree()>=o.getDegree()&&!f.isZero();){var g=f.getDegree()-o.getDegree(),x=a.multiply(f.getCoefficient(f.getDegree()),v);h=h.addOrSubtract(a.buildMonomial(g,x)),f=f.addOrSubtract(o.multiplyByMonomial(g,x))}if(u=h.multiply(s).addOrSubtract(l),f.getDegree()>=o.getDegree())throw new Zt("Division algorithm failed to reduce polynomial?")}var _=u.getCoefficient(0);if(_===0)throw new ie("sigmaTilde(0) was zero");var y=a.inverse(_),A=u.multiplyScalar(y),E=f.multiplyScalar(y);return[A,E]},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,a=this.field,o=1;o1,v,v+n-1),v+=n-1;else for(var g=n-1;g>=0;--g)d[v++]=(h&1<=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","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),V=function(){function r(){}return r.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},r.distance=function(t,e,n,i){var a=t-n,o=e-i;return Math.sqrt(a*a+o*o)},r.sum=function(t){for(var e=0,n=0,i=t.length;n!==i;n++){var a=t[n];e+=a}return e},r}(),Ae=function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),D=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(t){if(t instanceof r){var e=t;return this.x===e.x&&this.y===e.y}return!1},r.prototype.hashCode=function(){return 31*Ae.floatToIntBits(this.x)+Ae.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),i=this.distance(t[0],t[2]),a,o,f;if(n>=e&&n>=i?(o=t[0],a=t[1],f=t[2]):i>=n&&i>=e?(o=t[1],a=t[0],f=t[2]):(o=t[2],a=t[0],f=t[1]),this.crossProductZ(a,o,f)<0){var s=a;a=f,f=s}t[0]=a,t[1]=o,t[2]=f},r.distance=function(t,e){return V.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var i=e.x,a=e.y;return(n.x-i)*(t.y-a)-(n.y-a)*(t.x-i)},r}(),Ee=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),Vn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Hn=function(r){Vn(t,r);function t(e,n,i,a,o){var f=r.call(this,e,n)||this;return f.compact=i,f.nbDatablocks=a,f.nbLayers=o,f}return t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(Ee),Ce=function(){function r(t,e,n,i){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),i==null&&(i=t.getHeight()/2|0);var a=e/2|0;if(this.leftInit=n-a,this.rightInit=n+a,this.upInit=i-a,this.downInit=i+a,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new C}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,i=this.downInit,a=!1,o=!0,f=!1,s=!1,u=!1,c=!1,l=!1,h=this.width,d=this.height;o;){o=!1;for(var v=!0;(v||!s)&&e=h){a=!0;break}for(var g=!0;(g||!u)&&i=d){a=!0;break}for(var x=!0;(x||!c)&&t>=0;)x=this.containsBlackPoint(n,i,t,!1),x?(t--,o=!0,c=!0):c||t--;if(t<0){a=!0;break}for(var _=!0;(_||!l)&&n>=0;)_=this.containsBlackPoint(t,e,n,!0),_?(n--,o=!0,l=!0):l||n--;if(n<0){a=!0;break}o&&(f=!0)}if(!a&&f){for(var y=e-t,A=null,E=1;A===null&&En||s<-1||s>i)throw new C;a=!1,f===-1?(e[o]=0,a=!0):f===n&&(e[o]=n-1,a=!0),s===-1?(e[o+1]=0,a=!0):s===i&&(e[o+1]=i-1,a=!0)}a=!0;for(var o=e.length-2;o>=0&&a;o-=2){var f=Math.floor(e[o]),s=Math.floor(e[o+1]);if(f<-1||f>n||s<-1||s>i)throw new C;a=!1,f===-1?(e[o]=0,a=!0):f===n&&(e[o]=n-1,a=!0),s===-1?(e[o+1]=0,a=!0):s===i&&(e[o+1]=i-1,a=!0)}},r}(),nr=function(){function r(t,e,n,i,a,o,f,s,u){this.a11=t,this.a21=e,this.a31=n,this.a12=i,this.a22=a,this.a32=o,this.a13=f,this.a23=s,this.a33=u}return r.quadrilateralToQuadrilateral=function(t,e,n,i,a,o,f,s,u,c,l,h,d,v,g,x){var _=r.quadrilateralToSquare(t,e,n,i,a,o,f,s),y=r.squareToQuadrilateral(u,c,l,h,d,v,g,x);return y.times(_)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,i=this.a12,a=this.a13,o=this.a21,f=this.a22,s=this.a23,u=this.a31,c=this.a32,l=this.a33,h=0;h>1&127):(i<<=10,i+=(o>>2&992)+(o>>1&31))}var f=this.getCorrectedParameterData(i,this.compact);this.compact?(this.nbLayers=(f>>6)+1,this.nbDataBlocks=(f&63)+1):(this.nbLayers=(f>>11)+1,this.nbDataBlocks=(f&2047)+1)},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(a,o,f){var s=(a>>e-2<<1)+(a&1);n=(n<<3)+s}),n=((n&1)<<11)+(n>>1);for(var i=0;i<4;i++)if(F.bitCount(n^this.EXPECTED_CORNER_BITS[i])<=2)return i;throw new C},r.prototype.getCorrectedParameterData=function(t,e){var n,i;e?(n=7,i=2):(n=10,i=4);for(var a=n-i,o=new Int32Array(n),f=n-1;f>=0;--f)o[f]=t&15,t>>=4;try{var s=new ae(yt.AZTEC_PARAM);s.decode(o,a)}catch{throw new C}for(var u=0,f=0;f2){var l=this.distancePoint(c,f)*this.nbCenterLayers/(this.distancePoint(a,e)*(this.nbCenterLayers+2));if(l<.75||l>1.25||!this.isWhiteOrBlackRectangle(f,s,u,c))break}e=f,n=s,i=u,a=c,o=!o}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new C;this.compact=this.nbCenterLayers===5;var h=new D(e.getX()+.5,e.getY()-.5),d=new D(n.getX()+.5,n.getY()+.5),v=new D(i.getX()-.5,i.getY()+.5),g=new D(a.getX()-.5,a.getY()-.5);return this.expandSquare([h,d,v,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,i;try{var a=new Ce(this.image).detect();t=a[0],e=a[1],n=a[2],i=a[3]}catch{var o=this.image.getWidth()/2,f=this.image.getHeight()/2;t=this.getFirstDifferent(new _t(o+7,f-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new _t(o+7,f+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new _t(o-7,f+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new _t(o-7,f-7),!1,-1,-1).toResultPoint()}var s=V.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=V.round((t.getY()+i.getY()+e.getY()+n.getY())/4);try{var a=new Ce(this.image,15,s,u).detect();t=a[0],e=a[1],n=a[2],i=a[3]}catch{t=this.getFirstDifferent(new _t(s+7,u-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new _t(s+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new _t(s-7,u+7),!1,-1,1).toResultPoint(),i=this.getFirstDifferent(new _t(s-7,u-7),!1,-1,-1).toResultPoint()}return s=V.round((t.getX()+i.getX()+e.getX()+n.getX())/4),u=V.round((t.getY()+i.getY()+e.getY()+n.getY())/4),new _t(s,u)},r.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(t,e,n,i,a){var o=Ie.getInstance(),f=this.getDimension(),s=f/2-this.nbCenterLayers,u=f/2+this.nbCenterLayers;return o.sampleGrid(t,f,f,s,s,u,s,u,u,s,u,e.getX(),e.getY(),n.getX(),n.getY(),i.getX(),i.getY(),a.getX(),a.getY())},r.prototype.sampleLine=function(t,e,n){for(var i=0,a=this.distanceResultPoint(t,e),o=a/n,f=t.getX(),s=t.getY(),u=o*(e.getX()-t.getX())/a,c=o*(e.getY()-t.getY())/a,l=0;l.1&&h<.9?0:h<=.1===u?1:-1},r.prototype.getFirstDifferent=function(t,e,n,i){for(var a=t.getX()+n,o=t.getY()+i;this.isValid(a,o)&&this.image.get(a,o)===e;)a+=n,o+=i;for(a-=n,o-=i;this.isValid(a,o)&&this.image.get(a,o)===e;)a+=n;for(a-=n;this.isValid(a,o)&&this.image.get(a,o)===e;)o+=i;return o-=i,new _t(a,o)},r.prototype.expandSquare=function(t,e,n){var i=n/(2*e),a=t[0].getX()-t[2].getX(),o=t[0].getY()-t[2].getY(),f=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new D(f+i*a,s+i*o),c=new D(f-i*a,s-i*o);a=t[1].getX()-t[3].getX(),o=t[1].getY()-t[3].getY(),f=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2;var l=new D(f+i*a,s+i*o),h=new D(f-i*a,s-i*o),d=[u,l,c,h];return d},r.prototype.isValid=function(t,e){return t>=0&&t0&&e>(o?8:5)),s;o?s=i:s=15;for(var u=Math.trunc(i/2),c=0;c=i)break;try{a=t.getBlackRow(d,a)}catch{continue}for(var v=function(y){if(y===1&&(a.reverse(),e&&e.get(Q.NEED_RESULT_POINT_CALLBACK)===!0)){var A=new Map;e.forEach(function(S,m){return A.set(m,S)}),A.delete(Q.NEED_RESULT_POINT_CALLBACK),e=A}try{var E=g.decodeRow(d,a,e);if(y===1){E.putMetadata(ct.ORIENTATION,180);var I=E.getResultPoints();I!==null&&(I[0]=new D(n-I[0].getX()-1,I[0].getY()),I[1]=new D(n-I[1].getX()-1,I[1].getY()))}return{value:E}}catch{}},g=this,x=0;x<2;x++){var _=v(x);if(typeof _=="object")return _.value}}throw new C},r.recordPattern=function(t,e,n){for(var i=n.length,a=0;a=o)throw new C;for(var f=!t.get(e),s=0,u=e;u0&&i>=0;)t.get(--e)!==a&&(i--,a=!a);if(i>=0)throw new C;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var i=t.length,a=0,o=0,f=0;fh?l-h:h-l;if(d>n)return Number.POSITIVE_INFINITY;u+=d}return u/a},r}(),Yn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),ir=function(r){Yn(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.findStartPattern=function(e){for(var n=e.getSize(),i=e.getNextSet(0),a=0,o=Int32Array.from([0,0,0,0,0,0]),f=i,s=!1,u=6,c=i;c=0&&e.isRange(Math.max(0,f-(c-f)/2),f,!1))return Int32Array.from([f,c,h]);f+=o[0]+o[1],o=o.slice(2,o.length-1),o[a-1]=0,o[a]=0,a--}else a++;o[a]=1,s=!s}throw new C},t.decodeCode=function(e,n,i){et.recordPattern(e,i,n);for(var a=t.MAX_AVG_VARIANCE,o=-1,f=0;f=0)return o;throw new C},t.prototype.decodeRow=function(e,n,i){var a=i&&i.get(Q.ASSUME_GS1)===!0,o=t.findStartPattern(n),f=o[2],s=0,u=new Uint8Array(20);u[s++]=f;var c;switch(f){case t.CODE_START_A:c=t.CODE_CODE_A;break;case t.CODE_START_B:c=t.CODE_CODE_B;break;case t.CODE_START_C:c=t.CODE_CODE_C;break;default:throw new T}for(var l=!1,h=!1,d="",v=o[0],g=o[1],x=Int32Array.from([0,0,0,0,0,0]),_=0,y=0,A=f,E=0,I=!0,S=!1,m=!1;!l;){var b=h;switch(h=!1,_=y,y=t.decodeCode(n,x,g),u[s++]=y,y!==t.CODE_STOP&&(I=!0),y!==t.CODE_STOP&&(E++,A+=E*y),v=g,g+=x.reduce(function(Ze,$e){return Ze+$e},0),y){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new T}switch(c){case t.CODE_CODE_A:if(y<64)m===S?d+=String.fromCharCode(" ".charCodeAt(0)+y):d+=String.fromCharCode(" ".charCodeAt(0)+y+128),m=!1;else if(y<96)m===S?d+=String.fromCharCode(y-64):d+=String.fromCharCode(y+64),m=!1;else switch(y!==t.CODE_STOP&&(I=!1),y){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!S&&m?(S=!0,m=!1):S&&m?(S=!1,m=!1):m=!0;break;case t.CODE_SHIFT:h=!0,c=t.CODE_CODE_B;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_B:if(y<96)m===S?d+=String.fromCharCode(" ".charCodeAt(0)+y):d+=String.fromCharCode(" ".charCodeAt(0)+y+128),m=!1;else switch(y!==t.CODE_STOP&&(I=!1),y){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!S&&m?(S=!0,m=!1):S&&m?(S=!1,m=!1):m=!0;break;case t.CODE_SHIFT:h=!0,c=t.CODE_CODE_A;break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_C:c=t.CODE_CODE_C;break;case t.CODE_STOP:l=!0;break}break;case t.CODE_CODE_C:if(y<100)y<10&&(d+="0"),d+=y;else switch(y!==t.CODE_STOP&&(I=!1),y){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_CODE_A:c=t.CODE_CODE_A;break;case t.CODE_CODE_B:c=t.CODE_CODE_B;break;case t.CODE_STOP:l=!0;break}break}b&&(c=c===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var N=g-v;if(g=n.getNextUnset(g),!n.isRange(g,Math.min(n.getSize(),g+(g-v)/2),!1))throw new C;if(A-=E*_,A%103!==_)throw new at;var R=d.length;if(R===0)throw new C;R>0&&I&&(c===t.CODE_CODE_C?d=d.substring(0,R-2):d=d.substring(0,R-1));for(var q=(o[1]+o[0])/2,L=v+N/2,K=u.length,wt=new Uint8Array(K),bt=0;bt=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ar=function(r){jn(t,r);function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var i=r.call(this)||this;return i.usingCheckDigit=e,i.extendedMode=n,i.decodeRowResult="",i.counters=new Int32Array(9),i}return t.prototype.decodeRow=function(e,n,i){var a,o,f,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c=t.findAsteriskPattern(n,u),l=n.getNextSet(c[1]),h=n.getSize(),d,v;do{t.recordPattern(n,l,u);var g=t.toNarrowWidePattern(u);if(g<0)throw new C;d=t.patternToChar(g),this.decodeRowResult+=d,v=l;try{for(var x=(a=void 0,Se(u)),_=x.next();!_.done;_=x.next()){var y=_.value;l+=y}}catch(K){a={error:K}}finally{try{_&&!_.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}l=n.getNextSet(l)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var A=0;try{for(var E=Se(u),I=E.next();!I.done;I=E.next()){var y=I.value;A+=y}}catch(K){f={error:K}}finally{try{I&&!I.done&&(s=E.return)&&s.call(E)}finally{if(f)throw f.error}}var S=l-v-A;if(l!==h&&S*2o&&(s=l)}}catch(g){n={error:g}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}o=s,f=0;for(var h=0,d=0,v=0;vo&&(d|=1<0;v++){var l=e[v];if(l>o&&(f--,l*2>=h))return-1}return d}}while(f>3);return-1},t.patternToChar=function(e){for(var n=0;n="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new T;break;case"$":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new T;break;case"%":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f==="X"||f==="Y"||f==="Z")s="";else throw new T;break;case"/":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new T;break}i+=s,a++}else i+=o}return i},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.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],t.ASTERISK_ENCODING=148,t}(et),Zn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Te=globalThis&&globalThis.__values||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.")},or=function(r){Zn(t,r);function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return t.prototype.decodeRow=function(e,n,i){var a,o,f,s,u=this.findAsteriskPattern(n),c=n.getNextSet(u[1]),l=n.getSize(),h=this.counters;h.fill(0),this.decodeRowResult="";var d,v;do{t.recordPattern(n,c,h);var g=this.toPattern(h);if(g<0)throw new C;d=this.patternToChar(g),this.decodeRowResult+=d,v=c;try{for(var x=(a=void 0,Te(h)),_=x.next();!_.done;_=x.next()){var y=_.value;c+=y}}catch(N){a={error:N}}finally{try{_&&!_.done&&(o=x.return)&&o.call(x)}finally{if(a)throw a.error}}c=n.getNextSet(c)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var A=0;try{for(var E=Te(h),I=E.next();!I.done;I=E.next()){var y=I.value;A+=y}}catch(N){f={error:N}}finally{try{I&&!I.done&&(s=E.return)&&s.call(E)}finally{if(f)throw f.error}}if(c===l||!n.get(c))throw new C;if(this.decodeRowResult.length<2)throw new C;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var S=this.decodeExtended(this.decodeRowResult),m=(u[1]+u[0])/2,b=v+A/2;return new ut(S,null,0,[new D(m,e),new D(b,e)],P.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),i=e.getNextSet(0);this.counters.fill(0);for(var a=this.counters,o=i,f=!1,s=a.length,u=0,c=i;c4)return-1;if(l&1)u<<=h;else for(var d=0;d="a"&&o<="d"){if(a>=n-1)throw new T;var f=e.charAt(a+1),s="\0";switch(o){case"d":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)+32);else throw new T;break;case"a":if(f>="A"&&f<="Z")s=String.fromCharCode(f.charCodeAt(0)-64);else throw new T;break;case"b":if(f>="A"&&f<="E")s=String.fromCharCode(f.charCodeAt(0)-38);else if(f>="F"&&f<="J")s=String.fromCharCode(f.charCodeAt(0)-11);else if(f>="K"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)+16);else if(f>="P"&&f<="T")s=String.fromCharCode(f.charCodeAt(0)+43);else if(f==="U")s="\0";else if(f==="V")s="@";else if(f==="W")s="`";else if(f>="X"&&f<="Z")s=String.fromCharCode(127);else throw new T;break;case"c":if(f>="A"&&f<="O")s=String.fromCharCode(f.charCodeAt(0)-32);else if(f==="Z")s=":";else throw new T;break}i+=s,a++}else i+=o}return i},t.prototype.checkChecksums=function(e){var n=e.length;this.checkOneChecksum(e,n-2,20),this.checkOneChecksum(e,n-1,15)},t.prototype.checkOneChecksum=function(e,n,i){for(var a=1,o=0,f=n-1;f>=0;f--)o+=a*t.ALPHABET_STRING.indexOf(e.charAt(f)),++a>i&&(a=1);if(e.charAt(n)!==t.ALPHABET_STRING[o%47])throw new at},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.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],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(et),$n=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Kn=globalThis&&globalThis.__values||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.")},fr=function(r){$n(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return t.prototype.decodeRow=function(e,n,i){var a,o,f=this.decodeStart(n),s=this.decodeEnd(n),u=new B;t.decodeMiddle(n,f[1],s[0],u);var c=u.toString(),l=null;i!=null&&(l=i.get(Q.ALLOWED_LENGTHS)),l==null&&(l=t.DEFAULT_ALLOWED_LENGTHS);var h=c.length,d=!1,v=0;try{for(var g=Kn(l),x=g.next();!x.done;x=g.next()){var _=x.value;if(h===_){d=!0;break}_>v&&(v=_)}}catch(E){a={error:E}}finally{try{x&&!x.done&&(o=g.return)&&o.call(g)}finally{if(a)throw a.error}}if(!d&&h>v&&(d=!0),!d)throw new T;var y=[new D(f[1],e),new D(s[0],e)],A=new ut(c,null,0,y,P.ITF,new Date().getTime());return A},t.decodeMiddle=function(e,n,i,a){var o=new Int32Array(10),f=new Int32Array(5),s=new Int32Array(5);for(o.fill(0),f.fill(0),s.fill(0);n0&&a>=0&&!e.get(a);a--)i--;if(i!==0)throw new C},t.skipWhiteSpace=function(e){var n=e.getSize(),i=e.getNextSet(0);if(i===n)throw new C;return i},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),i=void 0;try{i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(o){o instanceof C&&(i=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,i[0]);var a=i[0];return i[0]=e.getSize()-i[1],i[1]=e.getSize()-a,i}finally{e.reverse()}},t.findGuardPattern=function(e,n,i){var a=i.length,o=new Int32Array(a),f=e.getSize(),s=!1,u=0,c=n;o.fill(0);for(var l=n;l=0)return i%10;throw new C},t.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])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(et),qn=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Xt=function(r){qn(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return t.findStartGuardPattern=function(e){for(var n=!1,i,a=0,o=Int32Array.from([0,0,0]);!n;){o=Int32Array.from([0,0,0]),i=t.findGuardPattern(e,a,!1,this.START_END_PATTERN,o);var f=i[0];a=i[1];var s=f-(a-f);s>=0&&(n=e.isRange(s,f,!1))}return i},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,a=n-1;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new T;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new T;i+=o}return(1e3-i)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,n,i,a){return this.findGuardPattern(e,n,i,a,new Int32Array(a.length))},t.findGuardPattern=function(e,n,i,a,o){var f=e.getSize();n=i?e.getNextUnset(n):e.getNextSet(n);for(var s=0,u=n,c=a.length,l=i,h=n;h=0)return f;throw new C},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.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])],t}(et),Qn=globalThis&&globalThis.__values||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.")},Jn=function(){function r(){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 r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(e,n,i),o=i.toString(),f=r.parseExtensionString(o),s=[new D((n[0]+n[1])/2,t),new D(a,t)],u=new ut(o,null,0,s,P.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<5&&s=10&&(u|=1<<4-c),c!==4&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==5)throw new C;var g=this.determineCheckDigit(u);if(r.extensionChecksum(n.toString())!==g)throw new C;return s},r.extensionChecksum=function(t){for(var e=t.length,n=0,i=e-2;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(var i=e-1;i>=0;i-=2)n+=t.charAt(i).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new C},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[ct.SUGGESTED_PRICE,e]])},r.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="ยฃ";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e="";break}var n=parseInt(t.substring(1)),i=(n/100).toString(),a=n%100,o=a<10?"0"+a:a.toString();return e+i+"."+o},r}(),ti=globalThis&&globalThis.__values||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.")},ei=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var i=this.decodeRowStringBuffer,a=this.decodeMiddle(e,n,i),o=i.toString(),f=r.parseExtensionString(o),s=[new D((n[0]+n[1])/2,t),new D(a,t)],u=new ut(o,null,0,s,P.UPC_EAN_EXTENSION,new Date().getTime());return f!=null&&u.putAllMetadata(f),u},r.prototype.decodeMiddle=function(t,e,n){var i,a,o=this.decodeMiddleCounters;o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var f=t.getSize(),s=e[1],u=0,c=0;c<2&&s=10&&(u|=1<<1-c),c!==1&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==2)throw new C;if(parseInt(n.toString())%4!==u)throw new C;return s},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[ct.ISSUE_NUMBER,parseInt(t)]])},r}(),ri=function(){function r(){}return r.decodeRow=function(t,e,n){var i=Xt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var a=new Jn;return a.decodeRow(t,e,i)}catch{var o=new ei;return o.decodeRow(t,e,i)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),ni=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),rt=function(r){ni(t,r);function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(f){return Int32Array.from(f)});for(var n=10;n<20;n++){for(var i=t.L_PATTERNS[n-10],a=new Int32Array(i.length),o=0;o=n.getSize()||!n.isRange(v,g,!1))throw new C;var x=c.toString();if(x.length<8)throw new T;if(!t.checkChecksum(x))throw new at;var _=(a[1]+a[0])/2,y=(h[1]+h[0])/2,A=this.getBarcodeFormat(),E=[new D(_,e),new D(y,e)],I=new ut(x,null,0,E,A,new Date().getTime()),S=0;try{var m=ri.decodeRow(e,n,h[1]);I.putMetadata(ct.UPC_EAN_EXTENSION,m.getText()),I.putAllMetadata(m.getResultMetadata()),I.addResultPoints(m.getResultPoints()),S=m.getText().length}catch{}var b=i==null?null:i.get(Q.ALLOWED_EAN_EXTENSIONS);if(b!=null){var N=!1;for(var R in b)if(S.toString()===R){N=!0;break}if(!N)throw new C}return A===P.EAN_13||P.UPC_A,I},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var i=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===i},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,i=0,a=n-1;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new T;i+=o}i*=3;for(var a=n-2;a>=0;a-=2){var o=e.charAt(a).charCodeAt(0)-"0".charCodeAt(0);if(o<0||o>9)throw new T;i+=o}return(1e3-i)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(Xt),ii=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),sr=globalThis&&globalThis.__values||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.")},be=function(r){ii(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=n[1],h=0,d=0;d<6&&l=10&&(h|=1<<5-d)}i=t.determineFirstDigit(i,h);var y=rt.findGuardPattern(e,l,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0));l=y[1];for(var d=0;d<6&&l=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},cr=function(r){ai(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,f,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=e.getSize(),l=n[1],h=0;h<4&&l=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hr=function(r){fi(t,r);function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return t.prototype.decodeMiddle=function(e,n,i){var a,o,f=this.decodeMiddleCounters.map(function(x){return x});f[0]=0,f[1]=0,f[2]=0,f[3]=0;for(var s=e.getSize(),u=n[1],c=0,l=0;l<6&&u=10&&(c|=1<<5-l)}return t.determineNumSysAndCheckDigit(new B(i),c),u},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return rt.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var i=0;i<=1;i++)for(var a=0;a<10;a++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[i][a]){e.insert(0,"0"+i),e.append("0"+a);return}throw C.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return P.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(o){return o.charCodeAt(0)}),i=new B;i.append(e.charAt(0));var a=n[5];switch(a){case 0:case 1:case 2:i.appendChars(n,0,2),i.append(a),i.append("0000"),i.appendChars(n,2,3);break;case 3:i.appendChars(n,0,3),i.append("00000"),i.appendChars(n,3,2);break;case 4:i.appendChars(n,0,4),i.append("00000"),i.append(n[4]);break;default:i.appendChars(n,0,5),i.append("0000"),i.append(a);break}return e.length>=8&&i.append(e.charAt(7)),i.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.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])],t}(rt),ui=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),dr=globalThis&&globalThis.__values||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.")},Oe=function(r){ui(t,r);function t(e){var n=r.call(this)||this,i=e==null?null:e.get(Q.POSSIBLE_FORMATS),a=[];return i!=null&&(i.indexOf(P.EAN_13)>-1&&a.push(new be),i.indexOf(P.UPC_A)>-1&&a.push(new lr),i.indexOf(P.EAN_8)>-1&&a.push(new cr),i.indexOf(P.UPC_E)>-1&&a.push(new hr)),a.length===0&&(a.push(new be),a.push(new lr),a.push(new cr),a.push(new hr)),n.readers=a,n}return t.prototype.decodeRow=function(e,n,i){var a,o;try{for(var f=dr(this.readers),s=f.next();!s.done;s=f.next()){var u=s.value;try{var c=u.decodeRow(e,n,i),l=c.getBarcodeFormat()===P.EAN_13&&c.getText().charAt(0)==="0",h=i==null?null:i.get(Q.POSSIBLE_FORMATS),d=h==null||h.includes(P.UPC_A);if(l&&d){var v=c.getRawBytes(),g=new ut(c.getText().substring(1),v,v?v.length:null,c.getResultPoints(),P.UPC_A);return g.putAllMetadata(c.getResultMetadata()),g}return c}catch{}}}catch(x){a={error:x}}finally{try{s&&!s.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}throw new C},t.prototype.reset=function(){var e,n;try{for(var i=dr(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;o.reset()}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t}(et),ci=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),li=function(r){ci(t,r);function t(){var e=r!==null&&r.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 t.prototype.decodeRow=function(e,n,i){var a=this.getValidRowData(n);if(!a)throw new C;var o=this.codaBarDecodeRow(a.row);if(!o)throw new C;return new ut(o,null,0,[new D(a.left,e),new D(a.right,e)],P.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),i=n.indexOf(!0);if(i===-1)return null;var a=n.lastIndexOf(!0);if(a<=i)return null;n=n.slice(i,a+1);for(var o=[],f=n[0],s=1,u=1;u0;){var a=e.splice(0,8).splice(0,7),o=a.map(function(s){return s=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lt=function(r){hi(t,r);function t(){var e=r.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var i=0;ia&&(a=n[o],i=o);e[i]++},t.decrement=function(e,n){for(var i=0,a=n[0],o=1;o=t.MIN_FINDER_PATTERN_RATIO&&f<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=di(e),l=c.next();!l.done;l=c.next()){var h=l.value;h>u&&(u=h),h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Wt=function(){function r(){}return r.getRSSvalue=function(t,e,n){var i,a,o=0;try{for(var f=vi(t),s=f.next();!s.done;s=f.next()){var u=s.value;o+=u}}catch(y){i={error:y}}finally{try{s&&!s.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}for(var c=0,l=0,h=t.length,d=0;d=h-d-1&&(g-=r.combins(o-v-(h-d),h-d-2)),h-d-1>1){for(var x=0,_=o-v-(h-d-2);_>e;_--)x+=r.combins(o-v-_-1,h-d-3);g-=x*(h-1-d)}else o-v>e&&g--;c+=g}o-=v}return c},r.combins=function(t,e){var n,i;t-e>e?(i=e,n=t-e):(i=t-e,n=e);for(var a=1,o=1,f=t;f>n;f--)a*=f,o<=i&&(a/=o,o++);for(;o<=i;)a/=o,o++;return a},r}(),pi=function(){function r(){}return r.buildBitArray=function(t){var e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=12*e,i=new ot(n),a=0,o=t[0],f=o.getRightChar().getValue(),s=11;s>=0;--s)f&1<=0;--l)c&1<=0;--l)h&1<10||i<0||i>10)throw new T;return a.firstDigit=n,a.secondDigit=i,a}return t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(De),fe=globalThis&&globalThis.__values||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.")},_i=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,i,a,o,f,s,u;if(!t)return null;if(t.length<2)throw new C;var c=t.substring(0,2);try{for(var l=fe(r.TWO_DIGIT_DATA_LENGTH),h=l.next();!h.done;h=l.next()){var d=h.value;if(d[0]===c)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,d[2],t):r.processFixedAI(2,d[1],t)}}catch(S){e={error:S}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}if(t.length<3)throw new C;var v=t.substring(0,3);try{for(var g=fe(r.THREE_DIGIT_DATA_LENGTH),x=g.next();!x.done;x=g.next()){var d=x.value;if(d[0]===v)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,d[2],t):r.processFixedAI(3,d[1],t)}}catch(S){i={error:S}}finally{try{x&&!x.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}try{for(var _=fe(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),y=_.next();!y.done;y=_.next()){var d=y.value;if(d[0]===v)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(S){o={error:S}}finally{try{y&&!y.done&&(f=_.return)&&f.call(_)}finally{if(o)throw o.error}}if(t.length<4)throw new C;var A=t.substring(0,4);try{for(var E=fe(r.FOUR_DIGIT_DATA_LENGTH),I=E.next();!I.done;I=E.next()){var d=I.value;if(d[0]===A)return d[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,d[2],t):r.processFixedAI(4,d[1],t)}}catch(S){s={error:S}}finally{try{I&&!I.done&&(u=E.return)&&u.call(E)}finally{if(s)throw s.error}}throw new C},r.processFixedAI=function(t,e,n){if(n.lengththis.information.getSize())return t+4<=this.information.getSize();for(var e=t;ethis.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return e===0?new zt(this.information.getSize(),zt.FNC1,zt.FNC1):new zt(this.information.getSize(),e-1,zt.FNC1)}var n=this.extractNumericValueFromBitArray(t,7),i=(n-8)/11,a=(n-8)%11;return new zt(t+7,i,a)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var i=0,a=0;athis.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 n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;var i=this.extractNumericValueFromBitArray(t,8);return i>=232&&i<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new mt(t+5,mt.FNC1);if(e>=5&&e<15)return new mt(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new mt(t+7,""+(n+1));if(n>=90&&n<116)return new mt(t+7,""+(n+7));var i=this.extractNumericValueFromBitArray(t,8),a;switch(i){case 232:a="!";break;case 233:a='"';break;case 234:a="%";break;case 235:a="&";break;case 236:a="'";break;case 237:a="(";break;case 238:a=")";break;case 239:a="*";break;case 240:a="+";break;case 241:a=",";break;case 242:a="-";break;case 243:a=".";break;case 244:a="/";break;case 245:a=":";break;case 246:a=";";break;case 247:a="<";break;case 248:a="=";break;case 249:a=">";break;case 250:a="?";break;case 251:a="_";break;case 252:a=" ";break;default:throw new T}return new mt(t+8,a)},r.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 n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new mt(t+5,mt.FNC1);if(e>=5&&e<15)return new mt(t+5,"0"+(e-5));var n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new mt(t+6,""+(n+33));var i;switch(n){case 58:i="*";break;case 59:i=",";break;case 60:i="-";break;case 61:i=".";break;case 62:i="/";break;default:throw new Zt("Decoding invalid alphanumeric value: "+n)}return new mt(t+6,i)},r.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+tthis.information.getSize())return!1;for(var e=t;ethis.information.getSize())return!1;for(var e=0;e<4&&e+t=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ui=function(r){ki(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.pairs=new Array(t.MAX_PAIRS),e.rows=new Array,e.startEnd=[2],e}return t.prototype.decodeRow=function(e,n,i){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){for(var i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(f){if(f instanceof C){if(!this.pairs.length)throw new C;i=!0}}if(this.checkChecksum())return this.pairs;var a;if(this.rows.length?a=!0:a=!1,this.storeRow(e,!1),a){var o=this.checkRowsBoolean(!1);if(o!=null||(o=this.checkRowsBoolean(!0),o!=null))return o}throw new C},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(i){console.log(i)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var i,a,o=n;of.length)){for(var s=!0,u=0;ue){o=f.isEquivalent(this.pairs);break}a=f.isEquivalent(this.pairs),i++}o||a||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(i,new Li(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var i,a,o,f,s,u;try{for(var c=Mt(n),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.getPairs().length!==e.length){var d=!0;try{for(var v=(o=void 0,Mt(h.getPairs())),g=v.next();!g.done;g=v.next()){var x=g.value,_=!1;try{for(var y=(s=void 0,Mt(e)),A=y.next();!A.done;A=y.next()){var E=A.value;if(xr.equals(x,E)){_=!0;break}}}catch(I){s={error:I}}finally{try{A&&!A.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}_||(d=!1)}}catch(I){o={error:I}}finally{try{g&&!g.done&&(f=v.return)&&f.call(v)}finally{if(o)throw o.error}}}}}catch(I){i={error:I}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}},t.isPartialRow=function(e,n){var i,a,o,f,s,u;try{for(var c=Mt(n),l=c.next();!l.done;l=c.next()){var h=l.value,d=!0;try{for(var v=(o=void 0,Mt(e)),g=v.next();!g.done;g=v.next()){var x=g.value,_=!1;try{for(var y=(s=void 0,Mt(h.getPairs())),A=y.next();!A.done;A=y.next()){var E=A.value;if(x.equals(E)){_=!0;break}}}catch(I){s={error:I}}finally{try{A&&!A.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}if(!_){d=!1;break}}}catch(I){o={error:I}}finally{try{g&&!g.done&&(f=v.return)&&f.call(v)}finally{if(o)throw o.error}}if(d)return!0}}catch(I){i={error:I}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=pi.buildBitArray(e),i=Fi(n),a=i.parseInformation(),o=e[0].getFinderPattern().getResultPoints(),f=e[e.length-1].getFinderPattern().getResultPoints(),s=[o[0],o[1],f[0],f[1]];return new ut(a,null,null,s,P.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),i=e.getRightChar();if(i===null)return!1;for(var a=i.getChecksumPortion(),o=2,f=1;f=0)f=i;else if(this.isEmptyPair(n))f=0;else{var s=n[n.length-1];f=s.getFinderPattern().getStartEnd()[1]}var u=n.length%2!==0;this.startFromEven&&(u=!u);for(var c=!1;f=0&&!e.get(s);)s--;s++,a=this.startEnd[0]-s,o=s,f=this.startEnd[1]}else o=this.startEnd[0],f=e.getNextUnset(this.startEnd[1]+1),a=f-this.startEnd[1];var u=this.getDecodeFinderCounters();j.arraycopy(u,0,u,1,u.length-1),u[0]=a;var c;try{c=this.parseFinderValue(u,t.FINDER_PATTERNS)}catch{return null}return new vr(c,[o,f],o,f,n)},t.prototype.decodeDataCharacter=function(e,n,i,a){for(var o=this.getDataCharacterCounters(),f=0;f.3)throw new C;for(var v=this.getOddCounts(),g=this.getEvenCounts(),x=this.getOddRoundingErrors(),_=this.getEvenRoundingErrors(),s=0;s8){if(y>8.7)throw new C;A=8}var E=s/2;s&1?(g[E]=A,_[E]=y-A):(v[E]=A,x[E]=y-A)}this.adjustOddEvenCounts(l);for(var I=4*n.getValue()+(i?0:2)+(a?0:1)-1,S=0,m=0,s=v.length-1;s>=0;s--){if(t.isNotA1left(n,i,a)){var b=t.WEIGHTS[I][2*s];m+=v[s]*b}S+=v[s]}for(var N=0,s=g.length-1;s>=0;s--)if(t.isNotA1left(n,i,a)){var b=t.WEIGHTS[I][2*s+1];N+=g[s]*b}var R=m+N;if(S&1||S>13||S<4)throw new C;var q=(13-S)/2,L=t.SYMBOL_WIDEST[q],K=9-L,wt=Wt.getRSSvalue(v,L,!0),bt=Wt.getRSSvalue(g,K,!1),je=t.EVEN_TOTAL_SUBSET[q],Ze=t.GSUM[q],$e=wt*je+bt+Ze;return new oe($e,R)},t.isNotA1left=function(e,n,i){return!(e.getValue()===0&&n&&i)},t.prototype.adjustOddEvenCounts=function(e){var n=V.sum(new Int32Array(this.getOddCounts())),i=V.sum(new Int32Array(this.getEvenCounts())),a=!1,o=!1;n>13?o=!0:n<4&&(a=!0);var f=!1,s=!1;i>13?s=!0:i<4&&(f=!0);var u=n+i-e,c=(n&1)===1,l=(i&1)===0;if(u===1)if(c){if(l)throw new C;o=!0}else{if(!l)throw new C;s=!0}else if(u===-1)if(c){if(l)throw new C;a=!0}else{if(!l)throw new C;f=!0}else if(u===0){if(c){if(!l)throw new C;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.")},yr=function(r){Gi(t,r);function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return t.prototype.decodeRow=function(e,n,i){var a,o,f,s,u=this.decodePair(n,!1,e,i);t.addOrTally(this.possibleLeftPairs,u),n.reverse();var c=this.decodePair(n,!0,e,i);t.addOrTally(this.possibleRightPairs,c),n.reverse();try{for(var l=Ne(this.possibleLeftPairs),h=l.next();!h.done;h=l.next()){var d=h.value;if(d.getCount()>1)try{for(var v=(f=void 0,Ne(this.possibleRightPairs)),g=v.next();!g.done;g=v.next()){var x=g.value;if(x.getCount()>1&&t.checkChecksum(d,x))return t.constructResult(d,x)}}catch(_){f={error:_}}finally{try{g&&!g.done&&(s=v.return)&&s.call(v)}finally{if(f)throw f.error}}}}catch(_){a={error:_}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}throw new C},t.addOrTally=function(e,n){var i,a;if(n!=null){var o=!1;try{for(var f=Ne(e),s=f.next();!s.done;s=f.next()){var u=s.value;if(u.getValue()===n.getValue()){u.incrementCount(),o=!0;break}}}catch(c){i={error:c}}finally{try{s&&!s.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}o||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var i=4537077*e.getValue()+n.getValue(),a=new String(i).toString(),o=new B,f=13-a.length;f>0;f--)o.append("0");o.append(a);for(var s=0,f=0;f<13;f++){var u=o.charAt(f).charCodeAt(0)-"0".charCodeAt(0);s+=f&1?u:3*u}s=10-s%10,s===10&&(s=0),o.append(s.toString());var c=e.getFinderPattern().getResultPoints(),l=n.getFinderPattern().getResultPoints();return new ut(o.toString(),null,0,[c[0],c[1],l[0],l[1]],P.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var i=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,a=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return a>72&&a--,a>8&&a--,i===a},t.prototype.decodePair=function(e,n,i,a){try{var o=this.findFinderPattern(e,n),f=this.parseFoundFinderPattern(e,i,n,o),s=a==null?null:a.get(Q.NEED_RESULT_POINT_CALLBACK);if(s!=null){var u=(o[0]+o[1])/2;n&&(u=e.getSize()-1-u),s.foundPossibleResultPoint(new D(u,i))}var c=this.decodeDataCharacter(e,f,!0),l=this.decodeDataCharacter(e,f,!1);return new Hi(1597*c.getValue()+l.getValue(),c.getChecksumPortion()+4*l.getChecksumPortion(),f)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,i){for(var a=this.getDataCharacterCounters(),o=0;o8&&(_=8);var y=Math.floor(f/2);f&1?(d[y]=_,g[y]=x-_):(h[y]=_,v[y]=x-_)}this.adjustOddEvenCounts(i,c);for(var A=0,E=0,f=h.length-1;f>=0;f--)E*=9,E+=h[f],A+=h[f];for(var I=0,S=0,f=d.length-1;f>=0;f--)I*=9,I+=d[f],S+=d[f];var m=E+3*I;if(i){if(A&1||A>12||A<4)throw new C;var b=(12-A)/2,N=t.OUTSIDE_ODD_WIDEST[b],R=9-N,q=Wt.getRSSvalue(h,N,!1),L=Wt.getRSSvalue(d,R,!0),K=t.OUTSIDE_EVEN_TOTAL_SUBSET[b],wt=t.OUTSIDE_GSUM[b];return new oe(q*K+L+wt,m)}else{if(S&1||S>10||S<4)throw new C;var b=(10-S)/2,N=t.INSIDE_ODD_WIDEST[b],R=9-N,q=Wt.getRSSvalue(h,N,!0),L=Wt.getRSSvalue(d,R,!1),bt=t.INSIDE_ODD_TOTAL_SUBSET[b],wt=t.INSIDE_GSUM[b];return new oe(L*bt+q+wt,m)}},t.prototype.findFinderPattern=function(e,n){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=e.getSize(),o=!1,f=0;f=0&&o!==e.get(f);)f--;f++;var s=a[0]-f,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);j.arraycopy(u,0,c,1,u.length-1),c[0]=s;var l=this.parseFinderValue(c,t.FINDER_PATTERNS),h=f,d=a[1];return i&&(h=e.getSize()-1-h,d=e.getSize()-1-d),new vr(l,[f,a[1]],h,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var i=V.sum(new Int32Array(this.getOddCounts())),a=V.sum(new Int32Array(this.getEvenCounts())),o=!1,f=!1,s=!1,u=!1;e?(i>12?f=!0:i<4&&(o=!0),a>12?u=!0:a<4&&(s=!0)):(i>11?f=!0:i<5&&(o=!0),a>10?u=!0:a<4&&(s=!0));var c=i+a-n,l=(i&1)===(e?1:0),h=(a&1)===1;if(c===1)if(l){if(h)throw new C;f=!0}else{if(!h)throw new C;u=!0}else if(c===-1)if(l){if(h)throw new C;o=!0}else{if(!h)throw new C;s=!0}else if(c===0){if(l){if(!h)throw new C;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},X=function(){function r(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),H=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),zi=function(){function r(t,e,n,i,a,o){var f,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=i,this.dataRegionSizeColumns=a,this.ecBlocks=o;var u=0,c=o.getECCodewords(),l=o.getECBlocks();try{for(var h=_r(l),d=h.next();!d.done;d=h.next()){var v=d.value;u+=v.getCount()*(v.getDataCodewords()+c)}}catch(g){f={error:g}}finally{try{d&&!d.done&&(s=h.return)&&s.call(h)}finally{if(f)throw f.error}}this.totalCodewords=u}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(t,e){var n,i;if(t&1||e&1)throw new T;try{for(var a=_r(r.VERSIONS),o=a.next();!o.done;o=a.next()){var f=o.value;if(f.symbolSizeRows===t&&f.symbolSizeColumns===e)return f}}catch(s){n={error:s}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}throw new T},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new X(5,new H(1,3))),new r(2,12,12,10,10,new X(7,new H(1,5))),new r(3,14,14,12,12,new X(10,new H(1,8))),new r(4,16,16,14,14,new X(12,new H(1,12))),new r(5,18,18,16,16,new X(14,new H(1,18))),new r(6,20,20,18,18,new X(18,new H(1,22))),new r(7,22,22,20,20,new X(20,new H(1,30))),new r(8,24,24,22,22,new X(24,new H(1,36))),new r(9,26,26,24,24,new X(28,new H(1,44))),new r(10,32,32,14,14,new X(36,new H(1,62))),new r(11,36,36,16,16,new X(42,new H(1,86))),new r(12,40,40,18,18,new X(48,new H(1,114))),new r(13,44,44,20,20,new X(56,new H(1,144))),new r(14,48,48,22,22,new X(68,new H(1,174))),new r(15,52,52,24,24,new X(42,new H(2,102))),new r(16,64,64,14,14,new X(56,new H(2,140))),new r(17,72,72,16,16,new X(36,new H(4,92))),new r(18,80,80,18,18,new X(48,new H(4,114))),new r(19,88,88,20,20,new X(56,new H(4,144))),new r(20,96,96,22,22,new X(68,new H(4,174))),new r(21,104,104,24,24,new X(56,new H(6,136))),new r(22,120,120,18,18,new X(68,new H(6,175))),new r(23,132,132,20,20,new X(62,new H(8,163))),new r(24,144,144,22,22,new X(62,new H(8,156),new H(2,155))),new r(25,8,18,6,16,new X(7,new H(1,5))),new r(26,8,32,6,14,new X(11,new H(1,10))),new r(27,12,26,10,24,new X(14,new H(1,16))),new r(28,12,36,10,16,new X(18,new H(1,22))),new r(29,16,36,14,16,new X(24,new H(1,32))),new r(30,16,48,14,22,new X(28,new H(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),Yi=function(){function r(t){var e=t.getHeight();if(e<8||e>144||e&1)throw new T;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new Ot(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(t){var e=t.getHeight(),n=t.getWidth();return zi.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,i=0,a=this.mappingBitMatrix.getHeight(),o=this.mappingBitMatrix.getWidth(),f=!1,s=!1,u=!1,c=!1;do if(n===a&&i===0&&!f)t[e++]=this.readCorner1(a,o)&255,n-=2,i+=2,f=!0;else if(n===a-2&&i===0&&o&3&&!s)t[e++]=this.readCorner2(a,o)&255,n-=2,i+=2,s=!0;else if(n===a+4&&i===2&&!(o&7)&&!u)t[e++]=this.readCorner3(a,o)&255,n-=2,i+=2,u=!0;else if(n===a-2&&i===0&&(o&7)===4&&!c)t[e++]=this.readCorner4(a,o)&255,n-=2,i+=2,c=!0;else{do n=0&&!this.readMappingMatrix.get(i,n)&&(t[e++]=this.readUtah(n,i,a,o)&255),n-=2,i+=2;while(n>=0&&i=0&&i=0);n+=3,i+=1}while(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.")},ji=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,i,a,o,f=e.getECBlocks(),s=0,u=f.getECBlocks();try{for(var c=wr(u),l=c.next();!l.done;l=c.next()){var h=l.value;s+=h.getCount()}}catch(wt){n={error:wt}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}var d=new Array(s),v=0;try{for(var g=wr(u),x=g.next();!x.done;x=g.next())for(var h=x.value,_=0;_7?_-1:_;d[L].codewords[K]=t[m++]}if(m!==t.length)throw new M;return d},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),Ar=function(){function r(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new M(""+t);var e=0,n=this.bitOffset,i=this.byteOffset,a=this.bytes;if(n>0){var o=8-n,f=t>8-f<>s,t-=f,n+=f,n===8&&(n=0,i++)}if(t>0){for(;t>=8;)e=e<<8|a[i]&255,i++,t-=8;if(t>0){var s=8-t,u=255>>s<>s,n+=t}}return this.bitOffset=n,this.byteOffset=i,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}(),nt;(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(nt||(nt={}));var Zi=function(){function r(){}return r.decode=function(t){var e=new Ar(t),n=new B,i=new B,a=new Array,o=nt.ASCII_ENCODE;do if(o===nt.ASCII_ENCODE)o=this.decodeAsciiSegment(e,n,i);else{switch(o){case nt.C40_ENCODE:this.decodeC40Segment(e,n);break;case nt.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case nt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case nt.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case nt.BASE256_ENCODE:this.decodeBase256Segment(e,n,a);break;default:throw new T}o=nt.ASCII_ENCODE}while(o!==nt.PAD_ENCODE&&e.available()>0);return i.length()>0&&n.append(i.toString()),new ne(t,n.toString(),a.length===0?null:a,null)},r.decodeAsciiSegment=function(t,e,n){var i=!1;do{var a=t.readBits(8);if(a===0)throw new T;if(a<=128)return i&&(a+=128),e.append(String.fromCharCode(a-1)),nt.ASCII_ENCODE;if(a===129)return nt.PAD_ENCODE;if(a<=229){var o=a-130;o<10&&e.append("0"),e.append(""+o)}else switch(a){case 230:return nt.C40_ENCODE;case 231:return nt.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:break;case 235:i=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return nt.ANSIX12_ENCODE;case 239:return nt.TEXT_ENCODE;case 240:return nt.EDIFACT_ENCODE;case 241:break;default:if(a!==254||t.available()!==0)throw new T;break}}while(t.available()>0);return nt.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,i=[],a=0;do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(a){case 0:if(s<3)a=s+1;else if(s0)},r.decodeTextSegment=function(t,e){var n=!1,i=[],a=0;do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),i);for(var f=0;f<3;f++){var s=i[f];switch(a){case 0:if(s<3)a=s+1;else if(s0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var i=t.readBits(8);if(i===254)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var o=n[a];switch(o){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(o<14)e.append(String.fromCharCode(o+44));else if(o<40)e.append(String.fromCharCode(o+51));else throw new T;break}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var i=(t<<8)+e-1,a=Math.floor(i/1600);n[0]=a,i-=a*1600,a=Math.floor(i/40),n[1]=a,n[2]=i-a*40},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var i=t.readBits(6);if(i===31){var a=8-t.getBitOffset();a!==8&&t.readBits(a);return}i&32||(i|=64),e.append(String.fromCharCode(i))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++),o;if(a===0?o=t.available()/8|0:a<250?o=a:o=250*(a-249)+this.unrandomize255State(t.readBits(8),i++),o<0)throw new T;for(var f=new Uint8Array(o),s=0;s=0?i:i+256},r.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"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.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"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],r}(),$i=globalThis&&globalThis.__values||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.")},Ki=function(){function r(){this.rsDecoder=new ae(yt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,i=new Yi(t),a=i.getVersion(),o=i.readCodewords(),f=ji.getDataBlocks(o,a),s=0;try{for(var u=$i(f),c=u.next();!c.done;c=u.next()){var l=c.value;s+=l.getNumDataCodewords()}}catch(A){e={error:A}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}for(var h=new Uint8Array(s),d=f.length,v=0;vf&&(c=f,l[0]=e,l[1]=n,l[2]=i,l[3]=a),c>s&&(c=s,l[0]=n,l[1]=i,l[2]=a,l[3]=e),c>u&&(l[0]=i,l[1]=a,l[2]=e,l[3]=n),l},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],i=t[2],a=t[3],o=this.transitionsBetween(e,a),f=r.shiftPoint(n,i,(o+1)*4),s=r.shiftPoint(i,n,(o+1)*4),u=this.transitionsBetween(f,e),c=this.transitionsBetween(s,a);return ud?c:l},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],i=t[2],a=t[3],o=this.transitionsBetween(e,a)+1,f=this.transitionsBetween(i,a)+1,s=r.shiftPoint(e,n,f*4),u=r.shiftPoint(i,n,o*4);o=this.transitionsBetween(s,a)+1,f=this.transitionsBetween(u,a)+1,(o&1)===1&&(o+=1),(f&1)===1&&(f+=1);var c=(e.getX()+n.getX()+i.getX()+a.getX())/4,l=(e.getY()+n.getY()+i.getY()+a.getY())/4;e=r.moveAway(e,c,l),n=r.moveAway(n,c,l),i=r.moveAway(i,c,l),a=r.moveAway(a,c,l);var h,d;return s=r.shiftPoint(e,n,f*4),s=r.shiftPoint(s,a,o*4),h=r.shiftPoint(n,e,f*4),h=r.shiftPoint(h,i,o*4),u=r.shiftPoint(i,a,f*4),u=r.shiftPoint(u,n,o*4),d=r.shiftPoint(a,i,f*4),d=r.shiftPoint(d,e,o*4),[s,h,u,d]},r.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(a-n);if(f){var s=n;n=i,i=s,s=a,a=o,o=s}for(var u=Math.abs(a-n),c=Math.abs(o-i),l=-u/2,h=i0){if(_===o)break;_+=h,l-=u}}return v},r}(),Re=function(){function r(){this.decoder=new Ki}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n,i;if(e!=null&&e.has(Q.PURE_BARCODE)){var a=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(a),i=r.NO_POINTS}else{var o=new qi(t.getBlackMatrix()).detect();n=this.decoder.decode(o.getBits()),i=o.getPoints()}var f=n.getRawBytes(),s=new ut(n.getText(),f,8*f.length,i,P.DATA_MATRIX,j.currentTimeMillis()),u=n.getByteSegments();u!=null&&s.putMetadata(ct.BYTE_SEGMENTS,u);var c=n.getECLevel();return c!=null&&s.putMetadata(ct.ERROR_CORRECTION_LEVEL,c),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new C;var i=this.moduleSize(e,t),a=e[1],o=n[1],f=e[0],s=n[0],u=(s-f+1)/i,c=(o-a+1)/i;if(u<=0||c<=0)throw new C;var l=i/2;a+=l,f+=l;for(var h=new Ot(u,c),d=0;d=r.FOR_BITS.size)throw new M;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(Yt.L,"L",1),r.M=new r(Yt.M,"M",0),r.Q=new r(Yt.Q,"Q",3),r.H=new r(Yt.H,"H",2),r}(),ta=globalThis&&globalThis.__values||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.")},Er=function(){function r(t){this.errorCorrectionLevel=Ji.forBits(t>>3&3),this.dataMask=t&7}return r.numBitsDiffering=function(t,e){return F.bitCount(t^e)},r.decodeFormatInformation=function(t,e){var n=r.doDecodeFormatInformation(t,e);return n!==null?n:r.doDecodeFormatInformation(t^r.FORMAT_INFO_MASK_QR,e^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(t,e){var n,i,a=Number.MAX_SAFE_INTEGER,o=0;try{for(var f=ta(r.FORMAT_INFO_DECODE_LOOKUP),s=f.next();!s.done;s=f.next()){var u=s.value,c=u[0];if(c===t||c===e)return new r(u[1]);var l=r.numBitsDiffering(t,c);l=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},w=function(){function r(t){for(var e=[],n=1;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.")},Vt=function(){function r(t,e){for(var n,i,a=[],o=2;o40)throw new M;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,i=0;i6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},r.prototype.toString=function(){return""+this.versionNumber},r.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]),r.VERSIONS=[new r(1,new Int32Array(0),new w(7,new p(1,19)),new w(10,new p(1,16)),new w(13,new p(1,13)),new w(17,new p(1,9))),new r(2,Int32Array.from([6,18]),new w(10,new p(1,34)),new w(16,new p(1,28)),new w(22,new p(1,22)),new w(28,new p(1,16))),new r(3,Int32Array.from([6,22]),new w(15,new p(1,55)),new w(26,new p(1,44)),new w(18,new p(2,17)),new w(22,new p(2,13))),new r(4,Int32Array.from([6,26]),new w(20,new p(1,80)),new w(18,new p(2,32)),new w(26,new p(2,24)),new w(16,new p(4,9))),new r(5,Int32Array.from([6,30]),new w(26,new p(1,108)),new w(24,new p(2,43)),new w(18,new p(2,15),new p(2,16)),new w(22,new p(2,11),new p(2,12))),new r(6,Int32Array.from([6,34]),new w(18,new p(2,68)),new w(16,new p(4,27)),new w(24,new p(4,19)),new w(28,new p(4,15))),new r(7,Int32Array.from([6,22,38]),new w(20,new p(2,78)),new w(18,new p(4,31)),new w(18,new p(2,14),new p(4,15)),new w(26,new p(4,13),new p(1,14))),new r(8,Int32Array.from([6,24,42]),new w(24,new p(2,97)),new w(22,new p(2,38),new p(2,39)),new w(22,new p(4,18),new p(2,19)),new w(26,new p(4,14),new p(2,15))),new r(9,Int32Array.from([6,26,46]),new w(30,new p(2,116)),new w(22,new p(3,36),new p(2,37)),new w(20,new p(4,16),new p(4,17)),new w(24,new p(4,12),new p(4,13))),new r(10,Int32Array.from([6,28,50]),new w(18,new p(2,68),new p(2,69)),new w(26,new p(4,43),new p(1,44)),new w(24,new p(6,19),new p(2,20)),new w(28,new p(6,15),new p(2,16))),new r(11,Int32Array.from([6,30,54]),new w(20,new p(4,81)),new w(30,new p(1,50),new p(4,51)),new w(28,new p(4,22),new p(4,23)),new w(24,new p(3,12),new p(8,13))),new r(12,Int32Array.from([6,32,58]),new w(24,new p(2,92),new p(2,93)),new w(22,new p(6,36),new p(2,37)),new w(26,new p(4,20),new p(6,21)),new w(28,new p(7,14),new p(4,15))),new r(13,Int32Array.from([6,34,62]),new w(26,new p(4,107)),new w(22,new p(8,37),new p(1,38)),new w(24,new p(8,20),new p(4,21)),new w(22,new p(12,11),new p(4,12))),new r(14,Int32Array.from([6,26,46,66]),new w(30,new p(3,115),new p(1,116)),new w(24,new p(4,40),new p(5,41)),new w(20,new p(11,16),new p(5,17)),new w(24,new p(11,12),new p(5,13))),new r(15,Int32Array.from([6,26,48,70]),new w(22,new p(5,87),new p(1,88)),new w(24,new p(5,41),new p(5,42)),new w(30,new p(5,24),new p(7,25)),new w(24,new p(11,12),new p(7,13))),new r(16,Int32Array.from([6,26,50,74]),new w(24,new p(5,98),new p(1,99)),new w(28,new p(7,45),new p(3,46)),new w(24,new p(15,19),new p(2,20)),new w(30,new p(3,15),new p(13,16))),new r(17,Int32Array.from([6,30,54,78]),new w(28,new p(1,107),new p(5,108)),new w(28,new p(10,46),new p(1,47)),new w(28,new p(1,22),new p(15,23)),new w(28,new p(2,14),new p(17,15))),new r(18,Int32Array.from([6,30,56,82]),new w(30,new p(5,120),new p(1,121)),new w(26,new p(9,43),new p(4,44)),new w(28,new p(17,22),new p(1,23)),new w(28,new p(2,14),new p(19,15))),new r(19,Int32Array.from([6,30,58,86]),new w(28,new p(3,113),new p(4,114)),new w(26,new p(3,44),new p(11,45)),new w(26,new p(17,21),new p(4,22)),new w(26,new p(9,13),new p(16,14))),new r(20,Int32Array.from([6,34,62,90]),new w(28,new p(3,107),new p(5,108)),new w(26,new p(3,41),new p(13,42)),new w(30,new p(15,24),new p(5,25)),new w(28,new p(15,15),new p(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new w(28,new p(4,116),new p(4,117)),new w(26,new p(17,42)),new w(28,new p(17,22),new p(6,23)),new w(30,new p(19,16),new p(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new w(28,new p(2,111),new p(7,112)),new w(28,new p(17,46)),new w(30,new p(7,24),new p(16,25)),new w(24,new p(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new w(30,new p(4,121),new p(5,122)),new w(28,new p(4,47),new p(14,48)),new w(30,new p(11,24),new p(14,25)),new w(30,new p(16,15),new p(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new w(30,new p(6,117),new p(4,118)),new w(28,new p(6,45),new p(14,46)),new w(30,new p(11,24),new p(16,25)),new w(30,new p(30,16),new p(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new w(26,new p(8,106),new p(4,107)),new w(28,new p(8,47),new p(13,48)),new w(30,new p(7,24),new p(22,25)),new w(30,new p(22,15),new p(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new w(28,new p(10,114),new p(2,115)),new w(28,new p(19,46),new p(4,47)),new w(28,new p(28,22),new p(6,23)),new w(30,new p(33,16),new p(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new w(30,new p(8,122),new p(4,123)),new w(28,new p(22,45),new p(3,46)),new w(30,new p(8,23),new p(26,24)),new w(30,new p(12,15),new p(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new w(30,new p(3,117),new p(10,118)),new w(28,new p(3,45),new p(23,46)),new w(30,new p(4,24),new p(31,25)),new w(30,new p(11,15),new p(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new w(30,new p(7,116),new p(7,117)),new w(28,new p(21,45),new p(7,46)),new w(30,new p(1,23),new p(37,24)),new w(30,new p(19,15),new p(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new w(30,new p(5,115),new p(10,116)),new w(28,new p(19,47),new p(10,48)),new w(30,new p(15,24),new p(25,25)),new w(30,new p(23,15),new p(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new w(30,new p(13,115),new p(3,116)),new w(28,new p(2,46),new p(29,47)),new w(30,new p(42,24),new p(1,25)),new w(30,new p(23,15),new p(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new w(30,new p(17,115)),new w(28,new p(10,46),new p(23,47)),new w(30,new p(10,24),new p(35,25)),new w(30,new p(19,15),new p(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new w(30,new p(17,115),new p(1,116)),new w(28,new p(14,46),new p(21,47)),new w(30,new p(29,24),new p(19,25)),new w(30,new p(11,15),new p(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new w(30,new p(13,115),new p(6,116)),new w(28,new p(14,46),new p(23,47)),new w(30,new p(44,24),new p(7,25)),new w(30,new p(59,16),new p(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new w(30,new p(12,121),new p(7,122)),new w(28,new p(12,47),new p(26,48)),new w(30,new p(39,24),new p(14,25)),new w(30,new p(22,15),new p(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new w(30,new p(6,121),new p(14,122)),new w(28,new p(6,47),new p(34,48)),new w(30,new p(46,24),new p(10,25)),new w(30,new p(2,15),new p(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new w(30,new p(17,122),new p(4,123)),new w(28,new p(29,46),new p(14,47)),new w(30,new p(49,24),new p(10,25)),new w(30,new p(24,15),new p(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new w(30,new p(4,122),new p(18,123)),new w(28,new p(13,46),new p(32,47)),new w(30,new p(48,24),new p(14,25)),new w(30,new p(42,15),new p(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new w(30,new p(20,117),new p(4,118)),new w(28,new p(40,47),new p(7,48)),new w(30,new p(43,24),new p(22,25)),new w(30,new p(10,15),new p(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new w(30,new p(19,118),new p(6,119)),new w(28,new p(18,47),new p(31,48)),new w(30,new p(34,24),new p(34,25)),new w(30,new p(20,15),new p(61,16)))],r}(),ft;(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(ft||(ft={}));var Cr=function(){function r(t,e){this.value=t,this.isMasked=e}return r.prototype.unmaskBitMatrix=function(t,e){for(var n=0;n=0;n--)t=this.copyBit(8,n,t);for(var i=this.bitMatrix.getHeight(),a=0,o=i-7,n=i-1;n>=o;n--)a=this.copyBit(8,n,a);for(var e=i-8;e=0;a--)for(var o=t-9;o>=i;o--)n=this.copyBit(o,a,n);var f=Vt.decodeVersionInformation(n);if(f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;n=0;for(var o=5;o>=0;o--)for(var a=t-9;a>=i;a--)n=this.copyBit(o,a,n);if(f=Vt.decodeVersionInformation(n),f!==null&&f.getDimensionForVersion()===t)return this.parsedVersion=f,f;throw new T},r.prototype.copyBit=function(t,e,n){var i=this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e);return i?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=Cr.values.get(t.getDataMask()),i=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,i);for(var a=e.buildFunctionPattern(),o=!0,f=new Uint8Array(e.getTotalCodewords()),s=0,u=0,c=0,l=i-1;l>0;l-=2){l===6&&l--;for(var h=0;h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ia=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var i,a,o,f;if(t.length!==e.getTotalCodewords())throw new M;var s=e.getECBlocksForLevel(n),u=0,c=s.getECBlocks();try{for(var l=Ir(c),h=l.next();!h.done;h=l.next()){var d=h.value;u+=d.getCount()}}catch(K){i={error:K}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var v=new Array(u),g=0;try{for(var x=Ir(c),_=x.next();!_.done;_=x.next())for(var d=_.value,y=0;y=0;){var m=v[S].codewords.length;if(m===I)break;S--}S++;for(var b=I-s.getECCodewordsPerBlock(),N=0,y=0;yt.available())throw new T;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=t.readBits(13),f=o/96<<8&4294967295|o%96;f<959?f+=41377:f+=42657,i[a]=f>>8&255,i[a+1]=f&255,a+=2,n--}try{e.append(At.decode(i,k.GB2312))}catch(s){throw new T(s)}},r.decodeKanjiSegment=function(t,e,n){if(n*13>t.available())throw new T;for(var i=new Uint8Array(2*n),a=0;n>0;){var o=t.readBits(13),f=o/192<<8&4294967295|o%192;f<7936?f+=33088:f+=49472,i[a]=f>>8,i[a+1]=f,a+=2,n--}try{e.append(At.decode(i,k.SHIFT_JIS))}catch(s){throw new T(s)}},r.decodeByteSegment=function(t,e,n,i,a,o){if(8*n>t.available())throw new T;for(var f=new Uint8Array(n),s=0;s=r.ALPHANUMERIC_CHARS.length)throw new T;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,i){for(var a=e.length();n>1;){if(t.available()<11)throw new T;var o=t.readBits(11);e.append(r.toAlphaNumericChar(Math.floor(o/45))),e.append(r.toAlphaNumericChar(o%45)),n-=2}if(n===1){if(t.available()<6)throw new T;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(i)for(var f=a;f=3;){if(t.available()<10)throw new T;var i=t.readBits(10);if(i>=1e3)throw new T;e.append(r.toAlphaNumericChar(Math.floor(i/100))),e.append(r.toAlphaNumericChar(Math.floor(i/10)%10)),e.append(r.toAlphaNumericChar(i%10)),n-=3}if(n===2){if(t.available()<7)throw new T;var a=t.readBits(7);if(a>=100)throw new T;e.append(r.toAlphaNumericChar(Math.floor(a/10))),e.append(r.toAlphaNumericChar(a%10))}else if(n===1){if(t.available()<4)throw new T;var o=t.readBits(4);if(o>=10)throw new T;e.append(r.toAlphaNumericChar(o))}},r.parseECIValue=function(t){var e=t.readBits(8);if(!(e&128))return e&127;if((e&192)===128){var n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)===192){var i=t.readBits(16);return(e&31)<<16&4294967295|i}throw new T},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),mr=function(){function r(t){this.mirrored=t}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(t){if(!(!this.mirrored||t===null||t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},r}(),Sr=globalThis&&globalThis.__values||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.")},oa=function(){function r(){this.rsDecoder=new ae(yt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(Ot.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new na(t),i=null;try{return this.decodeBitMatrixParser(n,e)}catch(o){i=o}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var a=this.decodeBitMatrixParser(n,e);return a.setOther(new mr(!0)),a}catch(o){throw i!==null?i:o}},r.prototype.decodeBitMatrixParser=function(t,e){var n,i,a,o,f=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=ia.getDataBlocks(u,f,s),l=0;try{for(var h=Sr(c),d=h.next();!d.done;d=h.next()){var v=d.value;l+=v.getNumDataCodewords()}}catch(S){n={error:S}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}var g=new Uint8Array(l),x=0;try{for(var _=Sr(c),y=_.next();!y.done;y=_.next()){var v=y.value,A=v.getCodewords(),E=v.getNumDataCodewords();this.correctErrors(A,E);for(var I=0;I=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ca=function(){function r(t,e,n,i,a,o,f){this.image=t,this.startX=e,this.startY=n,this.width=i,this.height=a,this.moduleSize=o,this.resultPointCallback=f,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=this.width,i=t+n,a=this.startY+e/2,o=new Int32Array(3),f=this.image,s=0;s=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,i){var a=this.image,o=a.getHeight(),f=this.crossCheckStateCount;f[0]=0,f[1]=0,f[2]=0;for(var s=t;s>=0&&a.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&!a.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;sn)return NaN;for(;sn)return NaN;var u=f[0]+f[1]+f[2];return 5*Math.abs(u-i)>=2*i?NaN:this.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var i,a,o=t[0]+t[1]+t[2],f=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,f,2*t[1],o);if(!isNaN(s)){var u=(t[0]+t[1]+t[2])/3;try{for(var c=ua(this.possibleCenters),l=c.next();!l.done;l=c.next()){var h=l.value;if(h.aboutEquals(u,s,f))return h.combineEstimate(s,f,u)}}catch(v){i={error:v}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}var d=new sa(f,s,u);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r}(),la=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),ha=function(r){la(t,r);function t(e,n,i,a){var o=r.call(this,e,n)||this;return o.estimatedModuleSize=i,o.count=a,a===void 0&&(o.count=1),o}return t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,i){if(Math.abs(n-this.getY())<=e&&Math.abs(i-this.getX())<=e){var a=Math.abs(e-this.estimatedModuleSize);return a<=1||a<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,i){var a=this.count+1,o=(this.count*this.getX()+n)/a,f=(this.count*this.getY()+e)/a,s=(this.count*this.estimatedModuleSize+i)/a;return new t(o,f,s,a)},t}(D),da=function(){function r(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),Kt=globalThis&&globalThis.__values||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.")},va=function(){function r(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(t){var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t!=null&&t.get(Q.PURE_BARCODE)!==void 0,i=this.image,a=i.getHeight(),o=i.getWidth(),f=Math.floor(3*a/(4*r.MAX_MODULES));(fu[2]&&(c+=v-u[2]-f,h=o-1)}else{u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,l=3;continue}l=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,l=3;else u[++l]++;if(r.foundPatternCross(u)){var d=this.handlePossibleCenter(u,c,o,n);d===!0&&(f=u[0],this.hasSkipped&&(s=this.haveMultiplyConfirmedCenters()))}}var g=this.selectBestPatterns();return D.orderBestPatterns(g),new da(g)},r.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},r.foundPatternCross=function(t){for(var e=0,n=0;n<5;n++){var i=t[n];if(i===0)return!1;e+=i}if(e<7)return!1;var a=e/7,o=a/2;return Math.abs(a-t[0])=o&&e>=o&&f.get(e-o,t-o);)a[2]++,o++;if(t=o&&e>=o&&!f.get(e-o,t-o)&&a[1]<=n;)a[1]++,o++;if(tn)return!1;for(;t>=o&&e>=o&&f.get(e-o,t-o)&&a[0]<=n;)a[0]++,o++;if(a[0]>n)return!1;var s=f.getHeight(),u=f.getWidth();for(o=1;t+o=s||e+o>=u)return!1;for(;t+o=s||e+o>=u||a[3]>=n)return!1;for(;t+o=n)return!1;var c=a[0]+a[1]+a[2]+a[3]+a[4];return Math.abs(c-i)<2*i&&r.foundPatternCross(a)},r.prototype.crossCheckVertical=function(t,e,n,i){for(var a=this.image,o=a.getHeight(),f=this.getCrossCheckStateCount(),s=t;s>=0&&a.get(e,s);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!a.get(e,s)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&a.get(e,s)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s=n)return NaN;for(;s=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=2*i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,i){for(var a=this.image,o=a.getWidth(),f=this.getCrossCheckStateCount(),s=t;s>=0&&a.get(s,e);)f[2]++,s--;if(s<0)return NaN;for(;s>=0&&!a.get(s,e)&&f[1]<=n;)f[1]++,s--;if(s<0||f[1]>n)return NaN;for(;s>=0&&a.get(s,e)&&f[0]<=n;)f[0]++,s--;if(f[0]>n)return NaN;for(s=t+1;s=n)return NaN;for(;s=n)return NaN;var u=f[0]+f[1]+f[2]+f[3]+f[4];return 5*Math.abs(u-i)>=i?NaN:r.foundPatternCross(f)?r.centerFromEnd(f,s):NaN},r.prototype.handlePossibleCenter=function(t,e,n,i){var a=t[0]+t[1]+t[2]+t[3]+t[4],o=r.centerFromEnd(t,n),f=this.crossCheckVertical(e,Math.floor(o),t[2],a);if(!isNaN(f)&&(o=this.crossCheckHorizontal(Math.floor(o),Math.floor(f),t[2],a),!isNaN(o)&&(!i||this.crossCheckDiagonal(Math.floor(f),Math.floor(o),t[2],a)))){for(var s=a/7,u=!1,c=this.possibleCenters,l=0,h=c.length;l=r.CENTER_QUORUM)if(i==null)i=f;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-f.getX())-Math.abs(i.getY()-f.getY()))/2)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,i,a=0,o=0,f=this.possibleCenters.length;try{for(var s=Kt(this.possibleCenters),u=s.next();!u.done;u=s.next()){var c=u.value;c.getCount()>=r.CENTER_QUORUM&&(a++,o+=c.getEstimatedModuleSize())}}catch(g){t={error:g}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(a<3)return!1;var l=o/f,h=0;try{for(var d=Kt(this.possibleCenters),v=d.next();!v.done;v=d.next()){var c=v.value;h+=Math.abs(c.getEstimatedModuleSize()-l)}}catch(g){n={error:g}}finally{try{v&&!v.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return h<=.05*o},r.prototype.selectBestPatterns=function(){var t,e,n,i,a=this.possibleCenters.length;if(a<3)throw new C;var o=this.possibleCenters,f;if(a>3){var s=0,u=0;try{for(var c=Kt(this.possibleCenters),l=c.next();!l.done;l=c.next()){var h=l.value,d=h.getEstimatedModuleSize();s+=d,u+=d*d}}catch(I){t={error:I}}finally{try{l&&!l.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}f=s/a;var v=Math.sqrt(u/a-f*f);o.sort(function(I,S){var m=Math.abs(S.getEstimatedModuleSize()-f),b=Math.abs(I.getEstimatedModuleSize()-f);return mb?1:0});for(var g=Math.max(.2*f,v),x=0;x3;x++){var _=o[x];Math.abs(_.getEstimatedModuleSize()-f)>g&&(o.splice(x,1),x--)}}if(o.length>3){var s=0;try{for(var y=Kt(o),A=y.next();!A.done;A=y.next()){var E=A.value;s+=E.getEstimatedModuleSize()}}catch(S){n={error:S}}finally{try{A&&!A.done&&(i=y.return)&&i.call(y)}finally{if(n)throw n.error}}f=s/o.length,o.sort(function(S,m){if(m.getCount()===S.getCount()){var b=Math.abs(m.getEstimatedModuleSize()-f),N=Math.abs(S.getEstimatedModuleSize()-f);return bN?-1:0}else return m.getCount()-S.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),pa=function(){function r(t){this.image=t}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Q.NEED_RESULT_POINT_CALLBACK);var e=new va(this.image,this.resultPointCallback),n=e.find(t);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),i=t.getBottomLeft(),a=this.calculateModuleSize(e,n,i);if(a<1)throw new C("No pattern found in proccess finder.");var o=r.computeDimension(e,n,i,a),f=Vt.getProvisionalVersionForDimension(o),s=f.getDimensionForVersion()-7,u=null;if(f.getAlignmentPatternCenters().length>0)for(var c=n.getX()-e.getX()+i.getX(),l=n.getY()-e.getY()+i.getY(),h=1-3/s,d=Math.floor(e.getX()+h*(c-e.getX())),v=Math.floor(e.getY()+h*(l-e.getY())),g=4;g<=16;g<<=1)try{u=this.findAlignmentInRegion(a,d,v,g);break}catch(A){if(!(A instanceof C))throw A}var x=r.createTransform(e,n,i,u,o),_=r.sampleGrid(this.image,x,o),y;return u===null?y=[i,e,n]:y=[i,e,n,u],new Ee(_,y)},r.createTransform=function(t,e,n,i,a){var o=a-3.5,f,s,u,c;return i!==null?(f=i.getX(),s=i.getY(),u=o-3,c=u):(f=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),u=o,c=o),nr.quadrilateralToQuadrilateral(3.5,3.5,o,3.5,u,c,3.5,o,t.getX(),t.getY(),e.getX(),e.getY(),f,s,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){var i=Ie.getInstance();return i.sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,i){var a=V.round(D.distance(t,e)/i),o=V.round(D.distance(t,n)/i),f=Math.floor((a+o)/2)+7;switch(f&3){case 0:f++;break;case 2:f--;break;case 3:throw new C("Dimensions could be not found.")}return f},r.prototype.calculateModuleSize=function(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2},r.prototype.calculateModuleSizeOneWay=function(t,e){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),i=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?i/7:isNaN(i)?n/7:(n+i)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,i){var a=this.sizeOfBlackWhiteBlackRun(t,e,n,i),o=1,f=t-(n-t);f<0?(o=t/(t-f),f=0):f>=this.image.getWidth()&&(o=(this.image.getWidth()-1-t)/(f-t),f=this.image.getWidth()-1);var s=Math.floor(e-(i-e)*o);return o=1,s<0?(o=e/(e-s),s=0):s>=this.image.getHeight()&&(o=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),f=Math.floor(t+(f-t)*o),a+=this.sizeOfBlackWhiteBlackRun(t,e,f,s),a-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,i){var a=Math.abs(i-e)>Math.abs(n-t);if(a){var o=t;t=e,e=o,o=n,n=i,i=o}for(var f=Math.abs(n-t),s=Math.abs(i-e),u=-f/2,c=t0){if(g===i)break;g+=l,u-=f}}return h===2?V.distance(n+c,i,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,i){var a=Math.floor(i*t),o=Math.max(0,e-a),f=Math.min(this.image.getWidth()-1,e+a);if(f-o=s||a>=o)throw new C;if(o-a!==s-f&&(s=f+(o-a),s>=t.getWidth()))throw new C;var u=Math.round((s-f+1)/i),c=Math.round((o-a+1)/i);if(u<=0||c<=0)throw new C;if(c!==u)throw new C;var l=Math.floor(i/2);a+=l,f+=l;var h=f+Math.floor((u-1)*i)-s;if(h>0){if(h>l)throw new C;f-=h}var d=a+Math.floor((c-1)*i)-o;if(d>0){if(d>l)throw new C;a-=d}for(var v=new Ot(u,c),g=0;g=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},U=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return V.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var i=new Int32Array(t.length),a=0;try{for(var o=ga(t),f=o.next();!f.done;f=o.next()){var s=f.value;i[a++]=s}}catch(u){e={error:u}}finally{try{f&&!f.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},r.getCodeword=function(t){var e=J.binarySearch(r.SYMBOL_TABLE,t&262143);return e<0?-1:(r.CODEWORD_TABLE[e]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),r.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),r}(),xa=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),ya=globalThis&&globalThis.__values||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.")},_a=function(){function r(){}return r.detectMultiple=function(t,e,n){var i=t.getBlackMatrix(),a=r.detect(n,i);return a.length||(i=i.clone(),i.rotate180(),a=r.detect(n,i)),new xa(i,a)},r.detect=function(t,e){for(var n,i,a=new Array,o=0,f=0,s=!1;o0;){var l=r.findGuardPattern(t,a,--i,n,!1,o,u);if(l!=null)c=l;else{i++;break}}f[0]=new D(c[0],i),f[1]=new D(c[1],i),s=!0;break}}var h=i+1;if(s){for(var d=0,l=Int32Array.from([Math.trunc(f[0].getX()),Math.trunc(f[1].getX())]);hr.SKIPPED_ROW_COUNT_MAX)break;d++}}h-=d+1,f[2]=new D(l[0],h),f[3]=new D(l[1],h)}return h-i0&&u++h?l-h:h-l;if(d>n)return 1/0;u+=d}return u/a},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),wa=globalThis&&globalThis.__values||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.")},Ht=function(){function r(t,e){if(e.length===0)throw new M;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var i=1;in.length){var i=e;e=n,n=i}var a=new Int32Array(n.length),o=n.length-e.length;j.arraycopy(n,0,a,0,o);for(var f=o;f=0;e--){var n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),(e===0||n!==1)&&t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},r}(),Aa=function(){function r(){}return r.prototype.add=function(t,e){return(t+e)%this.modulus},r.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new M;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new tr;return this.expTable[this.modulus-this.logTable[t]-1]},r.prototype.multiply=function(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(t){return t===this},r}(),Ea=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Ca=function(r){Ea(t,r);function t(e,n){var i=r.call(this)||this;i.modulus=e,i.expTable=new Int32Array(e),i.logTable=new Int32Array(e);for(var a=1,o=0;o=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ma=function(){function r(){this.field=Ca.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var i,a,o=new Ht(this.field,t),f=new Int32Array(e),s=!1,u=e;u>0;u--){var c=o.evaluateAt(this.field.exp(u));f[e-u]=c,c!==0&&(s=!0)}if(!s)return 0;var l=this.field.getOne();if(n!=null)try{for(var h=Ia(n),d=h.next();!d.done;d=h.next()){var v=d.value,g=this.field.exp(t.length-1-v),x=new Ht(this.field,new Int32Array([this.field.subtract(0,g),1]));l=l.multiply(x)}}catch(b){i={error:b}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}for(var _=new Ht(this.field,f),y=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),_,e),A=y[0],E=y[1],I=this.findErrorLocations(A),S=this.findErrorMagnitudes(E,A,I),u=0;u=Math.round(n/2);){var u=a,c=f;if(a=o,f=s,a.isZero())throw at.getChecksumInstance();o=u;for(var l=this.field.getZero(),h=a.getCoefficient(a.getDegree()),d=this.field.inverse(h);o.getDegree()>=a.getDegree()&&!o.isZero();){var v=o.getDegree()-a.getDegree(),g=this.field.multiply(o.getCoefficient(o.getDegree()),d);l=l.add(this.field.buildMonomial(v,g)),o=o.subtract(a.multiplyByMonomial(v,g))}s=l.multiply(f).subtract(c).negative()}var x=s.getCoefficient(0);if(x===0)throw at.getChecksumInstance();var _=this.field.inverse(x),y=s.multiply(_),A=o.multiply(_);return[y,A]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),i=0,a=1;a0){var s=n?this.topLeft:this.topRight,u=Math.trunc(s.getY()-t);u<0&&(u=0);var c=new D(s.getX(),u);n?i=c:o=c}if(e>0){var l=n?this.bottomLeft:this.bottomRight,h=Math.trunc(l.getY()+e);h>=this.image.getHeight()&&(h=this.image.getHeight()-1);var d=new D(l.getX(),h);n?a=d:f=d}return new r(this.image,i,a,o,f)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),Sa=function(){function r(t,e,n,i){this.columnCount=t,this.errorCorrectionLevel=i,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),Be=function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;function i(o,f,s,u,c,l){if(o==="%%")return"%";if(e[++n]!==void 0){o=u?parseInt(u.substr(1)):void 0;var h=c?parseInt(c.substr(1)):void 0,d;switch(l){case"s":d=e[n];break;case"c":d=e[n][0];break;case"f":d=parseFloat(e[n]).toFixed(o);break;case"p":d=parseFloat(e[n]).toPrecision(o);break;case"e":d=parseFloat(e[n]).toExponential(o);break;case"x":d=parseInt(e[n]).toString(h||16);break;case"d":d=parseFloat(parseInt(e[n],h||10).toPrecision(o)).toFixed(0);break}d=typeof d=="object"?JSON.stringify(d):(+d).toString(h);for(var v=parseInt(s),g=s&&s[0]+""=="0"?"0":" ";d.length=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Tr=function(){function r(t){this.boundingBox=new Me(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return r.prototype.getCodewordNearby=function(t){var e=this.getCodeword(t);if(e!=null)return e;for(var n=1;n=0&&(e=this.codewords[i],e!=null)||(i=this.imageRowToCodewordIndex(t)+n,i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Oa=globalThis&&globalThis.__read||function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n=e.call(r),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(f){o={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a},qt=function(){function r(){this.values=new Map}return r.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)},r.prototype.getValue=function(){var t,e,n=-1,i=new Array,a=function(l,h){var d={getKey:function(){return l},getValue:function(){return h}};d.getValue()>n?(n=d.getValue(),i=[],i.push(d.getKey())):d.getValue()===n&&i.push(d.getKey())};try{for(var o=ba(this.values.entries()),f=o.next();!f.done;f=o.next()){var s=Oa(f.value,2),u=s[0],c=s[1];a(u,c)}}catch(l){t={error:l}}finally{try{f&&!f.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return U.toIntArray(i)},r.prototype.getConfidence=function(t){return this.values.get(t)},r}(),Da=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Fe=globalThis&&globalThis.__values||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.")},br=function(r){Da(t,r);function t(e,n){var i=r.call(this,e)||this;return i._isLeft=n,i}return t.prototype.setRowNumbers=function(){var e,n;try{for(var i=Fe(this.getCodewords()),a=i.next();!a.done;a=i.next()){var o=a.value;o!=null&&o.setRowNumberAsRowIndicatorColumn()}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var i=this.getBoundingBox(),a=this._isLeft?i.getTopLeft():i.getTopRight(),o=this._isLeft?i.getBottomLeft():i.getBottomRight(),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),s=this.imageRowToCodewordIndex(Math.trunc(o.getY())),u=-1,c=1,l=0,h=f;h=e.getRowCount()||v>h)n[h]=null;else{var g=void 0;c>2?g=(c-2)*v:g=v;for(var x=g>=h,_=1;_<=g&&!x;_++)x=n[h-_]!=null;x?n[h]=null:(u=d.getRowNumber(),l=1)}}},t.prototype.getRowHeights=function(){var e,n,i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);var a=new Int32Array(i.getRowCount());try{for(var o=Fe(this.getCodewords()),f=o.next();!f.done;f=o.next()){var s=f.value;if(s!=null){var u=s.getRowNumber();if(u>=a.length)continue;a[u]++}}}catch(c){e={error:c}}finally{try{f&&!f.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return a},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),i=this._isLeft?n.getTopLeft():n.getTopRight(),a=this._isLeft?n.getBottomLeft():n.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),s=this.getCodewords(),u=-1,c=o;c=e.getRowCount()?s[c]=null:u=l.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,n,i=this.getCodewords(),a=new qt,o=new qt,f=new qt,s=new qt;try{for(var u=Fe(i),c=u.next();!c.done;c=u.next()){var l=c.value;if(l!=null){l.setRowNumberAsRowIndicatorColumn();var h=l.getValue()%30,d=l.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:o.setValue(h*3+1);break;case 1:s.setValue(h/3),f.setValue(h%3);break;case 2:a.setValue(h+1);break}}}}catch(g){e={error:g}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}if(a.getValue().length===0||o.getValue().length===0||f.getValue().length===0||s.getValue().length===0||a.getValue()[0]<1||o.getValue()[0]+f.getValue()[0]U.MAX_ROWS_IN_BARCODE)return null;var v=new Sa(a.getValue()[0],o.getValue()[0],f.getValue()[0],s.getValue()[0]);return this.removeIncorrectCodewords(i,v),v},t.prototype.removeIncorrectCodewords=function(e,n){for(var i=0;in.getRowCount()){e[i]=null;continue}switch(this._isLeft||(f+=2),f%3){case 0:o*3+1!==n.getRowCountUpperPart()&&(e[i]=null);break;case 1:(Math.trunc(o/3)!==n.getErrorCorrectionLevel()||o%3!==n.getRowCountLowerPart())&&(e[i]=null);break;case 2:o+1!==n.getColumnCount()&&(e[i]=null);break}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` `+r.prototype.toString.call(this)},t}(Tr),Na=globalThis&&globalThis.__values||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.")},Ra=function(){function r(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t=U.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t0&&a0&&(u[0]=n[e-1],u[4]=f[e-1],u[5]=s[e-1]),e>1&&(u[8]=n[e-2],u[10]=f[e-2],u[11]=s[e-2]),e>=1;n=e&1,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(U.BARS_IN_MODULE)),r.RATIOS_TABLE[t][U.BARS_IN_MODULE-i-1]=Math.fround(a/U.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(t){var e=r.getDecodedCodewordValue(r.sampleBitCounts(t));return e!==-1?e:r.getClosestDecodedValue(t)},r.sampleBitCounts=function(t){for(var e=V.sum(t),n=new Int32Array(U.BARS_IN_MODULE),i=0,a=0,o=0;o1)for(var i=0;i=a)break}st.length||n<0||e+n>t.length||e+n<0)throw new ge;if(n===0)return;for(var i=0;i0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length,i=n<<1;if(i-e<0&&(i=e),i<0){if(e<0)throw new Va;i=F.MAX_VALUE}this.buf=J.copyOfUint8Array(this.buf,i)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,i){if(n<0||n>e.length||i<0||n+i-e.length>0)throw new ge;this.ensureCapacity(this.count+i),j.arraycopy(e,n,this.buf,this.count,i),this.count+=i},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return J.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(ka),Y;(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Y||(Y={}));function Dr(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var ce;function Bt(r){if(typeof ce>"u"&&(ce=Dr()),ce===null)throw new Error("BigInt is not supported!");return ce(r)}function Xa(){var r=[];r[0]=Bt(1);var t=Bt(900);r[1]=t;for(var e=2;e<16;e++)r[e]=r[e-1]*t;return r}var Wa=function(){function r(){}return r.decode=function(t,e){var n=new B(""),i=tt.ISO8859_1;n.enableDecoding(i);for(var a=1,o=t[a++],f=new Ba;at[0])throw T.getFormatInstance();for(var i=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),a=0;a0){for(var h=0;h<6;++h)o.write(Number(Bt(s)>>Bt(8*(5-h))));s=0,f=0}break}i===e[0]&&l0){for(var h=0;h<6;++h)o.write(Number(Bt(s)>>Bt(8*(5-h))));s=0,f=0}}break}return a.append(At.decode(o.toByteArray(),n)),i},r.numericCompaction=function(t,e,n){for(var i=0,a=!1,o=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e0&&(n.append(r.decodeBase900toBase10(o,i)),i=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=Bt(0),i=0;i@[\\]_\`~!\r ,: -.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=Dr()?Xa():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),Qt=globalThis&&globalThis.__values||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.")},za=function(){function r(){}return r.decode=function(t,e,n,i,a,o,f){for(var s=new Me(t,e,n,i,a),u=null,c=null,l,h=!0;;h=!1){if(e!=null&&(u=r.getRowIndicatorColumn(t,s,e,!0,o,f)),i!=null&&(c=r.getRowIndicatorColumn(t,s,i,!1,o,f)),l=r.merge(u,c),l==null)throw C.getNotFoundInstance();var d=l.getBoundingBox();if(h&&d!=null&&(d.getMinY()s.getMaxY()))s=d;else break}l.setBoundingBox(s);var v=l.getBarcodeColumnCount()+1;l.setDetectionResultColumn(0,u),l.setDetectionResultColumn(v,c);for(var g=u!=null,x=1;x<=v;x++){var _=g?x:v-x;if(l.getDetectionResultColumn(_)===void 0){var y=void 0;_===0||_===v?y=new br(s,_===0):y=new Tr(s),l.setDetectionResultColumn(_,y);for(var A=-1,E=A,I=s.getMinY();I<=s.getMaxY();I++){if(A=r.getStartColumn(l,_,I,g),A<0||A>s.getMaxX()){if(E===-1)continue;A=E}var S=r.detectCodeword(t,s.getMinX(),s.getMaxX(),g,A,I,o,f);S!=null&&(y.setCodeword(I,S),E=A,o=Math.min(o,S.getWidth()),f=Math.max(f,S.getWidth()))}}}return r.createDecoderResult(l)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var i=Me.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new Ra(n,i)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var i=t.getRowHeights();if(i==null)return null;var a=r.getMax(i),o=0;try{for(var f=Qt(i),s=f.next();!s.done;s=f.next()){var u=s.value;if(o+=a-u,u>0)break}}catch(d){e={error:d}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}for(var c=t.getCodewords(),l=0;o>0&&c[l]==null;l++)o--;for(var h=0,l=i.length-1;l>=0&&(h+=a-i[l],!(i[l]>0));l--);for(var l=c.length-1;h>0&&c[l]==null;l--)h--;return t.getBoundingBox().addMissingRows(o,h,t.isLeft())},r.getMax=function(t){var e,n,i=-1;try{for(var a=Qt(t),o=a.next();!o.done;o=a.next()){var f=o.value;i=Math.max(i,f)}}catch(s){e={error:s}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},r.getBarcodeMetadata=function(t,e){var n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();var i;return e==null||(i=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,i,a,o){for(var f=new br(e,i),s=0;s<2;s++)for(var u=s===0?1:-1,c=Math.trunc(Math.trunc(n.getX())),l=Math.trunc(Math.trunc(n.getY()));l<=e.getMaxY()&&l>=e.getMinY();l+=u){var h=r.detectCodeword(t,0,t.getWidth(),i,c,l,a,o);h!=null&&(f.setCodeword(l,h),i?c=h.getStartX():c=h.getEndX())}return f},r.adjustCodewordCount=function(t,e){var n=e[0][1],i=n.getValue(),a=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(i.length===0){if(a<1||a>U.MAX_CODEWORDS_IN_BARCODE)throw C.getNotFoundInstance();n.setValue(a)}else i[0]!==a&&n.setValue(a)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,i=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),a=[],o=new Array,f=0;f0;){for(var s=0;s=0){if(x>=o.length)continue;o[x][u].setValue(g.getValue())}}}}catch(_){i={error:_}}finally{try{v&&!v.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}u++}}catch(_){e={error:_}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return o},r.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},r.getStartColumn=function(t,e,n,i){var a,o,f=i?1:-1,s=null;if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodeword(n)),s!=null)return i?s.getEndX():s.getStartX();if(s=t.getDetectionResultColumn(e).getCodewordNearby(n),s!=null)return i?s.getStartX():s.getEndX();if(r.isValidBarcodeColumn(t,e-f)&&(s=t.getDetectionResultColumn(e-f).getCodewordNearby(n)),s!=null)return i?s.getEndX():s.getStartX();for(var u=0;r.isValidBarcodeColumn(t,e-f);){e-=f;try{for(var c=(a=void 0,Qt(t.getDetectionResultColumn(e).getCodewords())),l=c.next();!l.done;l=c.next()){var h=l.value;if(h!=null)return(i?h.getEndX():h.getStartX())+f*u*(h.getEndX()-h.getStartX())}}catch(d){a={error:d}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}u++}return i?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,i,a,o,f,s){a=r.adjustCodewordStartColumn(t,e,n,i,a,o);var u=r.getModuleBitCount(t,e,n,i,a,o);if(u==null)return null;var c,l=V.sum(u);if(i)c=a+l;else{for(var h=0;h=e)&&u=e:fr.CODEWORD_SKEW_SIZE)return a;f+=s}s=-s,i=!i}return f},r.checkCodewordSkew=function(t,e,n){return e-r.CODEWORD_SKEW_SIZE<=t&&t<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(t,e,n){if(t.length===0)throw T.getFormatInstance();var i=1<n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw at.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw T.getFormatInstance();var n=t[0];if(n>t.length)throw T.getFormatInstance();if(n===0)if(e>=1;return e},r.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},r.getCodewordBucketNumber_number=function(t){return r.getCodewordBucketNumber(r.getBitCountForCodeword(t))},r.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},r.toString=function(t){for(var e=new Be,n=0;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.")},Le=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=r.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw C.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(t,e){e===void 0&&(e=null);try{return r.decode(t,e,!0)}catch(n){throw n instanceof T||n instanceof at?C.getNotFoundInstance():n}},r.decode=function(t,e,n){var i,a,o=new Array,f=_a.detectMultiple(t,e,n);try{for(var s=Ya(f.getPoints()),u=s.next();!u.done;u=s.next()){var c=u.value,l=za.decode(f.getBits(),c[4],c[5],c[6],c[7],r.getMinCodewordWidth(c),r.getMaxCodewordWidth(c)),h=new ut(l.getText(),l.getRawBytes(),void 0,c,P.PDF_417);h.putMetadata(ct.ERROR_CORRECTION_LEVEL,l.getECLevel());var d=l.getOther();d!=null&&h.putMetadata(ct.PDF417_EXTRA_METADATA,d),o.push(h)}}catch(v){i={error:v}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}return o.map(function(v){return v})},r.getMaxWidth=function(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMinWidth=function(t,e){return t==null||e==null?F.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(r.getMaxWidth(t[0],t[4]),r.getMaxWidth(t[6],t[2])*U.MODULES_IN_CODEWORD/U.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*U.MODULES_IN_CODEWORD/U.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(r.getMinWidth(t[0],t[4]),r.getMinWidth(t[6],t[2])*U.MODULES_IN_CODEWORD/U.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*U.MODULES_IN_CODEWORD/U.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),ja=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Nr=function(r){ja(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.kind="ReaderException",t}(vt),Rr=globalThis&&globalThis.__values||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.")},Za=function(){function r(){}return r.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},r.prototype.decodeWithState=function(t){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(t)},r.prototype.setHints=function(t){this.hints=t;var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t==null?null:t.get(Q.POSSIBLE_FORMATS),i=new Array;if(n!=null){var a=n.some(function(o){return o===P.UPC_A||o===P.UPC_E||o===P.EAN_13||o===P.EAN_8||o===P.CODABAR||o===P.CODE_39||o===P.CODE_93||o===P.CODE_128||o===P.ITF||o===P.RSS_14||o===P.RSS_EXPANDED});a&&!e&&i.push(new $t(t)),n.includes(P.QR_CODE)&&i.push(new Pe),n.includes(P.DATA_MATRIX)&&i.push(new Re),n.includes(P.AZTEC)&&i.push(new me),n.includes(P.PDF_417)&&i.push(new Le),a&&e&&i.push(new $t(t))}i.length===0&&(e||i.push(new $t(t)),i.push(new Pe),i.push(new Re),i.push(new me),i.push(new Le),e&&i.push(new $t(t))),this.readers=i},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=Rr(this.readers),i=n.next();!i.done;i=n.next()){var a=i.value;a.reset()}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},r.prototype.decodeInternal=function(t){var e,n;if(this.readers===null)throw new Nr("No readers where selected, nothing can be read.");try{for(var i=Rr(this.readers),a=i.next();!a.done;a=i.next()){var o=a.value;try{return o.decode(t,this.hints)}catch(f){if(f instanceof Nr)continue}}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}throw new C("No MultiFormat Readers were able to detect the code.")},r}(),$a=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Ka=function(r){$a(t,r);function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var i=this,a=new Za;return a.setHints(e),i=r.call(this,a,n)||this,i}return t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t}(Gt),qa=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}();(function(r){qa(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Le,e)||this}return t})(Gt);var Qa=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}();(function(r){Qa(t,r);function t(e){return e===void 0&&(e=500),r.call(this,new Pe,e)||this}return t})(Gt);var ke;(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(ke||(ke={}));const le=ke;var Pr=function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Rt(t,Int32Array.from([1])))}return r.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var n=e[e.length-1],i=this.field,a=e.length;a<=t;a++){var o=n.multiply(new Rt(i,Int32Array.from([1,i.exp(a-1+i.getGeneratorBase())])));e.push(o),n=o}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new M("No error correction bytes");var n=t.length-e;if(n<=0)throw new M("No data bytes provided");var i=this.buildGenerator(e),a=new Int32Array(n);j.arraycopy(t,0,a,0,n);var o=new Rt(this.field,a);o=o.multiplyByMonomial(e,1);for(var f=o.divide(i)[1],s=f.getCoefficients(),u=e-s.length,c=0;c=5&&(n+=r.N1+(s-5)),s=1,u=l)}s>=5&&(n+=r.N1+(s-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),Ja=globalThis&&globalThis.__values||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.")},to=function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),i=0;i!==e;i++)n[i]=new Uint8Array(t);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(t,e){return this.bytes[e][t]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(t,e,n){this.bytes[e][t]=n},r.prototype.setBoolean=function(t,e,n){this.bytes[e][t]=n?1:0},r.prototype.clear=function(t){var e,n;try{for(var i=Ja(this.bytes),a=i.next();!a.done;a=i.next()){var o=a.value;J.fill(o,t)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(var n=0,i=this.height;n> `),t.toString()},r.prototype.setMode=function(t){this.mode=t},r.prototype.setECLevel=function(t){this.ecLevel=t},r.prototype.setVersion=function(t){this.version=t},r.prototype.setMaskPattern=function(t){this.maskPattern=t},r.prototype.setMatrix=function(t){this.matrix=t},r.isValidMaskPattern=function(t){return t>=0&&t0;){for(o===6&&(o-=1);f>=0&&f=n;)t^=e<=0)for(var s=0;s!==o;s++){var u=i[s];u>=0&&r.isEmpty(e.get(u,f))&&r.embedPositionAdjustmentPattern(u-2,f-2,e)}}},r.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),r.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),ro=function(){function r(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),Br=globalThis&&globalThis.__values||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.")};(function(){function r(){}return r.calculateMaskPenalty=function(t){return Jt.applyMaskPenaltyRule1(t)+Jt.applyMaskPenaltyRule2(t)+Jt.applyMaskPenaltyRule3(t)+Jt.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var i=r.DEFAULT_BYTE_MODE_ENCODING,a=n!==null&&n.get(le.CHARACTER_SET)!==void 0;a&&(i=n.get(le.CHARACTER_SET).toString());var o=this.chooseMode(t,i),f=new ot;if(o===Z.BYTE&&(a||r.DEFAULT_BYTE_MODE_ENCODING!==i)){var s=tt.getCharacterSetECIByName(i);s!==void 0&&this.appendECI(s,f)}this.appendModeInfo(o,f);var u=new ot;this.appendBytes(t,o,u,i);var c;if(n!==null&&n.get(le.QR_VERSION)!==void 0){var l=Number.parseInt(n.get(le.QR_VERSION).toString(),10);c=Vt.getVersionForNumber(l);var h=this.calculateBitsNeeded(o,f,u,c);if(!this.willFit(h,c,e))throw new $("Data too big for requested version")}else c=this.recommendVersion(e,o,f,u);var d=new ot;d.appendBitArray(f);var v=o===Z.BYTE?u.getSizeInBytes():t.length;this.appendLengthInfo(v,c,o,d),d.appendBitArray(u);var g=c.getECBlocksForLevel(e),x=c.getTotalCodewords()-g.getTotalECCodewords();this.terminateBits(x,d);var _=this.interleaveWithECBytes(d,c.getTotalCodewords(),x,g.getNumBlocks()),y=new Ue;y.setECLevel(e),y.setMode(o),y.setVersion(c);var A=c.getDimensionForVersion(),E=new to(A,A),I=this.chooseMaskPattern(_,e,c,E);return y.setMaskPattern(I),Mr.buildMatrix(_,e,c,I,E),y.setMatrix(E),y},r.recommendVersion=function(t,e,n,i){var a=this.calculateBitsNeeded(e,n,i,Vt.getVersionForNumber(1)),o=this.chooseVersion(a,t),f=this.calculateBitsNeeded(e,n,i,o);return this.chooseVersion(f,t)},r.calculateBitsNeeded=function(t,e,n,i){return e.getSize()+t.getCharacterCountBits(i)+n.getSize()},r.getAlphanumericCode=function(t){return t159)&&(a<224||a>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,i){for(var a=Number.MAX_SAFE_INTEGER,o=-1,f=0;f=s},r.terminateBits=function(t,e){var n=t*8;if(e.getSize()>n)throw new $("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var i=0;i<4&&e.getSize()0)for(var i=a;i<8;i++)e.appendBit(!1);for(var o=t-e.getSizeInBytes(),i=0;i=n)throw new $("Block ID too large");var f=t%n,s=n-f,u=Math.floor(t/n),c=u+1,l=Math.floor(e/n),h=l+1,d=u-l,v=c-h;if(d!==v)throw new $("EC bytes mismatch");if(n!==s+f)throw new $("RS blocks mismatch");if(t!==(l+d)*s+(h+v)*f)throw new $("Total bytes mismatch");i=1<=0&&e<=9},r.appendNumericBytes=function(t,e){for(var n=t.length,i=0;i=33088&&s<=40956?u=s-33088:s>=57408&&s<=60351&&(u=s-49472),u===-1)throw new $("Invalid byte sequence");var c=(u>>8)*192+(u&255);e.appendBits(c,13)}},r.appendECI=function(t,e){e.appendBits(Z.ECI.getBits(),4),e.appendBits(t.getValue(),8)},r.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),r.DEFAULT_BYTE_MODE_ENCODING=tt.UTF8.getName(),r})();var no=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}();(function(r){no(t,r);function t(e,n,i,a,o,f,s,u){var c=r.call(this,f,s)||this;if(c.yuvData=e,c.dataWidth=n,c.dataHeight=i,c.left=a,c.top=o,a+f>n||o+s>i)throw new M("Crop rectangle does not fit within image data.");return u&&c.reverseHorizontal(f,s),c}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length>16&255,g=d>>7&510,x=d&255;l[h]=(v+g+x)/4&255}u.luminances=l}else u.luminances=e;if(a===void 0&&(u.dataWidth=n),o===void 0&&(u.dataHeight=i),f===void 0&&(u.left=0),s===void 0&&(u.top=0),u.left+n>u.dataWidth||u.top+i>u.dataHeight)throw new M("Crop rectangle does not fit within image data.");return u}return t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new M("Requested row is outside the image: "+e);var i=this.getWidth();(n==null||n.length=256&&(e^=so);return{LOG:r,ALOG:t}};Ve=uo([],[]),Ve.LOG,Ve.ALOG;var Fr;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(Fr||(Fr={}));var Lr=129,kr=230,co=231,lo=235,ho=236,vo=237,po=238,go=239,xo=240,He=254,yo=254,Ur="[)>05",Vr="[)>06",Hr="",z=0,ht=1,xt=2,it=3,st=4,dt=5,_o=function(){function r(){}return r.prototype.getEncodingMode=function(){return z},r.prototype.encode=function(t){var e=Tt.determineConsecutiveDigitCount(t.getMessage(),t.pos);if(e>=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var n=t.getCurrentChar(),i=Tt.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode())switch(i){case dt:t.writeCodeword(co),t.signalEncoderChange(dt);return;case ht:t.writeCodeword(kr),t.signalEncoderChange(ht);return;case it:t.writeCodeword(po),t.signalEncoderChange(it);break;case xt:t.writeCodeword(go),t.signalEncoderChange(xt);break;case st:t.writeCodeword(xo),t.signalEncoderChange(st);break;default:throw new Error("Illegal mode: "+i)}else Tt.isExtendedASCII(n)?(t.writeCodeword(lo),t.writeCodeword(n-128+1),t.pos++):(t.writeCodeword(n+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(Tt.isDigit(t)&&Tt.isDigit(e)){var n=(t-48)*10+(e-48);return n+130}throw new Error("not digits: "+t+e)},r}(),wo=function(){function r(){}return r.prototype.getEncodingMode=function(){return dt},r.prototype.encode=function(t){var e=new B;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();e.append(n),t.pos++;var i=Tt.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(i!==this.getEncodingMode()){t.signalEncoderChange(z);break}}var a=e.length()-1,o=1,f=t.getCodewordCount()+a+o;t.updateSymbolInfo(f);var s=t.getSymbolInfo().getDataCapacity()-f>0;if(t.hasMoreCharacters()||s)if(a<=249)e.setCharAt(0,k.getCharAt(a));else if(a<=1555)e.setCharAt(0,k.getCharAt(Math.floor(a/250)+249)),e.insert(1,k.getCharAt(a%250));else throw new Error("Message length not in valid ranges: "+a);for(var u=0,n=e.length();u3||u!==1))&&(t.pos=i)}e.length()>0&&t.writeCodeword(kr),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var i=this.encodeChar(n,e),a=Math.floor(e.length()/3)*2,o=t.getCodewordCount()+a;t.updateSymbolInfo(o);var f=t.getSymbolInfo().getDataCapacity()-o;if(!t.hasMoreCharacters()){var s=new B;for(e.length()%3===2&&f!==2&&(i=this.backtrackOneCharacter(t,e,s,i));e.length()%3===1&&(i>3||f!==1);)i=this.backtrackOneCharacter(t,e,s,i);break}var u=e.length();if(u%3===0){var c=Tt.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(c!==this.getEncodingMode()){t.signalEncoderChange(z);break}}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,i){var a=e.length(),o=e.toString().substring(0,a-i);e.setLengthToZero(),e.append(o),t.pos--;var f=t.getCurrentChar();return i=this.encodeChar(f,n),t.resetSymbolInfo(),i},r.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(3);e.setLengthToZero(),e.append(n)},r.prototype.handleEOD=function(t,e){var n=Math.floor(e.length()/3*2),i=e.length()%3,a=t.getCodewordCount()+n;t.updateSymbolInfo(a);var o=t.getSymbolInfo().getDataCapacity()-a;if(i===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(He)}else if(o===1&&i===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(He),t.pos--}else if(i===0){for(;e.length()>=3;)this.writeNextTriplet(t,e);(o>0||t.hasMoreCharacters())&&t.writeCodeword(He)}else throw new Error("Unexpected case. Please report!");t.signalEncoderChange(z)},r.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");var n=2;return n+=this.encodeChar(t-128,e),n},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,i=e%256,a=new B;return a.append(n),a.append(i),a.toString()},r}(),Ao=function(){function r(){}return r.prototype.getEncodingMode=function(){return st},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();this.encodeChar(n,e),t.pos++;var i=e.length();if(i>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var a=e.toString().substring(4);e.setLengthToZero(),e.append(a);var o=Tt.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){t.signalEncoderChange(z);break}}}e.append(k.getCharAt(31)),this.handleEOD(t,e)},r.prototype.handleEOD=function(t,e){try{var n=e.length();if(n===0)return;if(n===1){t.updateSymbolInfo();var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),a=t.getRemainingCharacters();if(a>i&&(t.updateSymbolInfo(t.getCodewordCount()+1),i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),a<=i&&i<=2)return}if(n>4)throw new Error("Count must not exceed 4");var o=n-1,f=this.encodeToCodewords(e.toString()),s=!t.hasMoreCharacters(),u=s&&o<=2;if(o<=2){t.updateSymbolInfo(t.getCodewordCount()+o);var i=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount();i>=3&&(u=!1,t.updateSymbolInfo(t.getCodewordCount()+f.length))}u?(t.resetSymbolInfo(),t.pos-=o):t.writeCodewords(f)}finally{t.signalEncoderChange(z)}},r.prototype.encodeChar=function(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append(k.getCharAt(t-64)):Tt.illegalCharacter(k.getCharAt(t))},r.prototype.encodeToCodewords=function(t){var e=t.length;if(e===0)throw new Error("StringBuilder must not be empty");var n=t.charAt(0).charCodeAt(0),i=e>=2?t.charAt(1).charCodeAt(0):0,a=e>=3?t.charAt(2).charCodeAt(0):0,o=e>=4?t.charAt(3).charCodeAt(0):0,f=(n<<18)+(i<<12)+(a<<6)+o,s=f>>16&255,u=f>>8&255,c=f&255,l=new B;return l.append(s),e>=2&&l.append(u),e>=3&&l.append(c),l.toString()},r}(),Eo=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Co=globalThis&&globalThis.__values||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.")},G=function(){function r(t,e,n,i,a,o,f,s){f===void 0&&(f=0),s===void 0&&(s=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=i,this.matrixHeight=a,this.dataRegions=o,this.rsBlockData=f,this.rsBlockError=s}return r.lookup=function(t,e,n,i,a){var o,f;e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!0);try{for(var s=Co(mo),u=s.next();!u.done;u=s.next()){var c=u.value;if(!(e===1&&c.rectangular)&&!(e===2&&!c.rectangular)&&!(n!=null&&(c.getSymbolWidth()i.getWidth()||c.getSymbolHeight()>i.getHeight()))&&t<=c.dataCapacity)return c}}catch(l){o={error:l}}finally{try{u&&!u.done&&(f=s.return)&&f.call(s)}finally{if(o)throw o.error}}if(a)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+this.getHorizontalDataRegions()*2},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+this.getVerticalDataRegions()*2},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},r}(),Io=function(r){Eo(t,r);function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(G),mo=[new G(!1,3,5,8,8,1),new G(!1,5,7,10,10,1),new G(!0,5,7,16,6,1),new G(!1,8,10,12,12,1),new G(!0,10,11,14,6,2),new G(!1,12,12,14,14,1),new G(!0,16,14,24,10,1),new G(!1,18,14,16,16,1),new G(!1,22,18,18,18,1),new G(!0,22,18,16,10,2),new G(!1,30,20,20,20,1),new G(!0,32,24,16,14,2),new G(!1,36,24,22,22,1),new G(!1,44,28,24,24,1),new G(!0,49,28,22,14,2),new G(!1,62,36,14,14,4),new G(!1,86,42,16,16,4),new G(!1,114,48,18,18,4),new G(!1,144,56,20,20,4),new G(!1,174,68,22,22,4),new G(!1,204,84,24,24,4,102,42),new G(!1,280,112,14,14,16,140,56),new G(!1,368,144,16,16,16,92,36),new G(!1,456,192,18,18,16,114,48),new G(!1,576,224,20,20,16,144,56),new G(!1,696,272,22,22,16,174,68),new G(!1,816,336,24,24,16,136,56),new G(!1,1050,408,18,18,36,175,68),new G(!1,1304,496,20,20,36,163,62),new Io],So=function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(f){return f.charCodeAt(0)}),n=new B,i=0,a=e.length;ithis.symbolInfo.getDataCapacity())&&(this.symbolInfo=G.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),To=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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){To(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return it},t.prototype.encode=function(e){for(var n=new B;e.hasMoreCharacters();){var i=e.getCurrentChar();e.pos++,this.encodeChar(i,n);var a=n.length();if(a%3===0){this.writeNextTriplet(e,n);var o=Tt.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(o!==this.getEncodingMode()){e.signalEncoderChange(z);break}}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case"*".charCodeAt(0):n.append(1);break;case">".charCodeAt(0):n.append(2);break;case" ".charCodeAt(0):n.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?n.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?n.append(e-65+14):Tt.illegalCharacter(k.getCharAt(e));break}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var i=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),a=n.length();e.pos-=a,(e.getRemainingCharacters()>1||i>1||e.getRemainingCharacters()!==i)&&e.writeCodeword(yo),e.getNewEncoding()<0&&e.signalEncoderChange(z)},t}(Ge),Oo=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Do=function(r){Oo(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.getEncodingMode=function(){return xt},t.prototype.encodeChar=function(e,n){if(e===" ".charCodeAt(0))return n.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return n.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return n.append(e-97+14),1;if(e<" ".charCodeAt(0))return n.append(0),n.append(e),2;if(e<="/".charCodeAt(0))return n.append(1),n.append(e-33),2;if(e<="@".charCodeAt(0))return n.append(1),n.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return n.append(1),n.append(e-91+22),2;if(e==="`".charCodeAt(0))return n.append(2),n.append(0),2;if(e<="Z".charCodeAt(0))return n.append(2),n.append(e-65+1),2;if(e<=127)return n.append(2),n.append(e-123+27),2;n.append("1");var i=2;return i+=this.encodeChar(e-128,n),i},t}(Ge),No=function(){function r(){}return r.randomize253State=function(t){var e=149*t%253+1,n=Lr+e;return n<=254?n:n-254},r.encodeHighLevel=function(t,e,n,i,a){e===void 0&&(e=0),n===void 0&&(n=null),i===void 0&&(i=null),a===void 0&&(a=!1);var o=new Ge,f=[new _o,o,new Do,new bo,new Ao,new wo],s=new So(t);s.setSymbolShape(e),s.setSizeConstraints(n,i),t.startsWith(Ur)&&t.endsWith(Hr)?(s.writeCodeword(ho),s.setSkipAtEnd(2),s.pos+=Ur.length):t.startsWith(Vr)&&t.endsWith(Hr)&&(s.writeCodeword(vo),s.setSkipAtEnd(2),s.pos+=Vr.length);var u=z;for(a&&(o.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)f[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var l=s.getSymbolInfo().getDataCapacity();c=t.length)return n;var i;n===z?i=[0,1,1,1,1,1.25]:(i=[1,2,2,2,2,2.25],i[n]=0);for(var a=0,o=new Uint8Array(6),f=[];;){if(e+a===t.length){J.fill(o,0),J.fill(f,0);var s=this.findMinimums(i,f,F.MAX_VALUE,o),u=this.getMinimumCount(o);if(f[z]===s)return z;if(u===1){if(o[dt]>0)return dt;if(o[st]>0)return st;if(o[xt]>0)return xt;if(o[it]>0)return it}return ht}var c=t.charCodeAt(e+a);if(a++,this.isDigit(c)?i[z]+=.5:this.isExtendedASCII(c)?(i[z]=Math.ceil(i[z]),i[z]+=2):(i[z]=Math.ceil(i[z]),i[z]++),this.isNativeC40(c)?i[ht]+=2/3:this.isExtendedASCII(c)?i[ht]+=8/3:i[ht]+=4/3,this.isNativeText(c)?i[xt]+=2/3:this.isExtendedASCII(c)?i[xt]+=8/3:i[xt]+=4/3,this.isNativeX12(c)?i[it]+=2/3:this.isExtendedASCII(c)?i[it]+=13/3:i[it]+=10/3,this.isNativeEDIFACT(c)?i[st]+=3/4:this.isExtendedASCII(c)?i[st]+=17/4:i[st]+=13/4,this.isSpecialB256(c)?i[dt]+=4:i[dt]++,a>=4){if(J.fill(o,0),J.fill(f,0),this.findMinimums(i,f,F.MAX_VALUE,o),f[z]o&&(n=o,J.fill(i,0)),n===o&&(i[a]=i[a]+1)}return n},r.getMinimumCount=function(t){for(var e=0,n=0;n<6;n++)e+=t[n];return e||0},r.isDigit=function(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isNativeText=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isX12TermSep=function(t){return t===13||t==="*".charCodeAt(0)||t===">".charCodeAt(0)},r.isNativeEDIFACT=function(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,i=e;i=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Gr=function(){function r(t){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return At.encode(t,this.charset)!=null}catch{return!1}},r}(),Ro=function(){function r(t,e,n){var i,a,o,f,s,u;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(N){return new Gr(oo.forName(N))}),this.encoders=[];var c=[];c.push(new Gr(fo.ISO_8859_1));for(var l=e!=null&&e.name.startsWith("UTF"),h=0;h=this.bytes.length)return!1;for(var n=0;n=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},r.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var n=new B,i=t;i=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},r.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]===1e3},r.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},r.prototype.addEdge=function(t,e,n){(t[e][n.encoderIndex]==null||t[e][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(t[e][n.encoderIndex]=n)},r.prototype.addEdges=function(t,e,n,i,a,o){var f=t.charAt(i).charCodeAt(0),s=0,u=e.length();e.getPriorityEncoderIndex()>=0&&(f===o||e.canEncode(f,e.getPriorityEncoderIndex()))&&(s=e.getPriorityEncoderIndex(),u=s+1);for(var c=s;c=0;o--)l.unshift(d[o]&255);var v=h.previous===null?0:h.previous.encoderIndex;v!==h.encoderIndex&&l.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}for(var g=[],o=0;o0)&&!(i=n.next()).done;)a.push(i.value)}catch(f){o={error:f}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return a};globalThis&&globalThis.__spread;var Wr;(function(r){r[r.ASCII=0]="ASCII",r[r.C40=1]="C40",r[r.TEXT=2]="TEXT",r[r.X12=3]="X12",r[r.EDF=4]="EDF",r[r.B256=5]="B256"})(Wr||(Wr={})),function(r){Bo(t,r);function t(e,n,i,a,o){var f=r.call(this,e,n,i)||this;return f.shape=a,f.macroId=o,f}return t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}(Mo);var Lo=function(){function r(){}return r.prototype.isCompact=function(){return this.compact},r.prototype.setCompact=function(t){this.compact=t},r.prototype.getSize=function(){return this.size},r.prototype.setSize=function(t){this.size=t},r.prototype.getLayers=function(){return this.layers},r.prototype.setLayers=function(t){this.layers=t},r.prototype.getCodeWords=function(){return this.codeWords},r.prototype.setCodeWords=function(t){this.codeWords=t},r.prototype.getMatrix=function(){return this.matrix},r.prototype.setMatrix=function(t){this.matrix=t},r}(),zr=function(){function r(){}return r.singletonList=function(t){return[t]},r.min=function(t,e){return t.sort(e)[0]},r}(),ko=function(){function r(t){this.previous=t}return r.prototype.getPrevious=function(){return this.previous},r}(),Uo=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),We=function(r){Uo(t,r);function t(e,n,i){var a=r.call(this,e)||this;return a.value=n,a.bitCount=i,a}return t.prototype.appendTo=function(e,n){e.appendBits(this.value,this.bitCount)},t.prototype.add=function(e,n){return new t(this,e,n)},t.prototype.addBinaryShift=function(e,n){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new t(this,e,n)},t.prototype.toString=function(){var e=this.value&(1<"},t}(ko),Vo=globalThis&&globalThis.__extends||function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)i.hasOwnProperty(a)&&(n[a]=i[a])},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)}}(),Ho=function(r){Vo(t,r);function t(e,n,i){var a=r.call(this,e,0,0)||this;return a.binaryShiftStart=n,a.binaryShiftByteCount=i,a}return t.prototype.appendTo=function(e,n){for(var i=0;i62?e.appendBits(this.binaryShiftByteCount-31,16):i===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+i],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t}(We);function Go(r,t,e){return new Ho(r,t,e)}function te(r,t,e){return new We(r,t,e)}var Xo=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Ft=0,he=1,Ct=2,Yr=3,Dt=4,Wo=new We(null,0,0),ze=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,655360+928+30]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,655360+928+30]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,917504+14336+928+30]),Int32Array.from([(5<<16)+29,(5<<16)+28,655360+928+30,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,655360+992+28,655360+992+30,655360+992+29,0])],zo=globalThis&&globalThis.__values||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.")};function Yo(r){var t,e;try{for(var n=zo(r),i=n.next();!i.done;i=n.next()){var a=i.value;J.fill(a,-1)}}catch(o){t={error:o}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[Ft][Dt]=0,r[he][Dt]=0,r[he][Ft]=28,r[Yr][Dt]=0,r[Ct][Dt]=0,r[Ct][Ft]=15,r}var jr=Yo(J.createInt32Array(6,6)),jo=globalThis&&globalThis.__values||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.")},Zo=function(){function r(t,e,n,i){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=i}return r.prototype.getMode=function(){return this.mode},r.prototype.getToken=function(){return this.token},r.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},r.prototype.getBitCount=function(){return this.bitCount},r.prototype.latchAndAppend=function(t,e){var n=this.bitCount,i=this.token;if(t!==this.mode){var a=ze[this.mode][t];i=te(i,a&65535,a>>16),n+=a>>16}var o=t===Ct?4:5;return i=te(i,e,o),new r(i,t,0,n+o)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,i=this.mode===Ct?4:5;return n=te(n,jr[this.mode][t],i),n=te(n,e,5),new r(n,this.mode,0,this.bitCount+i+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,i=this.bitCount;if(this.mode===Dt||this.mode===Ct){var a=ze[n][Ft];e=te(e,a&65535,a>>16),i+=a>>16,n=Ft}var o=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,f=new r(e,n,this.binaryShiftByteCount+1,i+o);return f.binaryShiftByteCount===2047+31&&(f=f.endBinaryShift(t+1)),f},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return e=Go(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(e,this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(ze[this.mode][t.mode]>>16);return this.binaryShiftByteCountt.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount},r.prototype.toBitArray=function(t){for(var e,n,i=[],a=this.endBinaryShift(t.length).token;a!==null;a=a.getPrevious())i.unshift(a);var o=new ot;try{for(var f=jo(i),s=f.next();!s.done;s=f.next()){var u=s.value;u.appendTo(o,t)}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return o},r.prototype.toString=function(){return k.format("%s bits=%d bytes=%d",Xo[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(Wo,Ft,0,0),r}();function $o(r){var t=k.getCharCode(" "),e=k.getCharCode("."),n=k.getCharCode(",");r[Ft][t]=1;for(var i=k.getCharCode("Z"),a=k.getCharCode("A"),o=a;o<=i;o++)r[Ft][o]=o-a+2;r[he][t]=1;for(var f=k.getCharCode("z"),s=k.getCharCode("a"),o=s;o<=f;o++)r[he][o]=o-s+2;r[Ct][t]=1;for(var u=k.getCharCode("9"),c=k.getCharCode("0"),o=c;o<=u;o++)r[Ct][o]=o-c+2;r[Ct][n]=12,r[Ct][e]=13;for(var l=["\0"," ","","","","","","","\x07","\b"," ",` `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],h=0;h","?","[","]","{","}"],h=0;h0&&(r[Dt][k.getCharCode(d[h])]=h);return r}var Ye=$o(J.createInt32Array(5,256)),de=globalThis&&globalThis.__values||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.")},Ko=function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=k.getCharCode(" "),e=k.getCharCode(` `),n=zr.singletonList(Zo.INITIAL_STATE),i=0;i0?(n=r.updateStateListForPair(n,i,a),i++):n=this.updateStateListForChar(n,i)}var f=zr.min(n,function(s,u){return s.getBitCount()-u.getBitCount()});return f.toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,i,a=[];try{for(var o=de(t),f=o.next();!f.done;f=o.next()){var s=f.value;this.updateStateForChar(s,e,a)}}catch(u){n={error:u}}finally{try{f&&!f.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r.simplifyStates(a)},r.prototype.updateStateForChar=function(t,e,n){for(var i=this.text[e]&255,a=Ye[t.getMode()][i]>0,o=null,f=0;f<=Dt;f++){var s=Ye[f][i];if(s>0){if(o==null&&(o=t.endBinaryShift(e)),!a||f===t.getMode()||f===Ct){var u=o.latchAndAppend(f,s);n.push(u)}if(!a&&jr[t.getMode()][f]>=0){var c=o.shiftAndAppend(f,s);n.push(c)}}}if(t.getBinaryShiftByteCount()>0||Ye[t.getMode()][i]===0){var l=t.addBinaryShiftChar(e);n.push(l)}},r.updateStateListForPair=function(t,e,n){var i,a,o=[];try{for(var f=de(t),s=f.next();!s.done;s=f.next()){var u=s.value;this.updateStateForPair(u,e,n,o)}}catch(c){i={error:c}}finally{try{s&&!s.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}return this.simplifyStates(o)},r.updateStateForPair=function(t,e,n,i){var a=t.endBinaryShift(e);if(i.push(a.latchAndAppend(Dt,n)),t.getMode()!==Dt&&i.push(a.shiftAndAppend(Dt,n)),n===3||n===4){var o=a.latchAndAppend(Ct,16-n).latchAndAppend(Ct,1);i.push(o)}if(t.getBinaryShiftByteCount()>0){var f=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);i.push(f)}},r.simplifyStates=function(t){var e,n,i,a,o=[];try{for(var f=de(t),s=f.next();!s.done;s=f.next()){var u=s.value,c=!0,l=function(x){if(x.isBetterThanOrEqualTo(u))return c=!1,"break";u.isBetterThanOrEqualTo(x)&&(o=o.filter(function(_){return _!==x}))};try{for(var h=(i=void 0,de(o)),d=h.next();!d.done;d=h.next()){var v=d.value,g=l(v);if(g==="break")break}}catch(x){i={error:x}}finally{try{d&&!d.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}c&&o.push(u)}}catch(x){e={error:x}}finally{try{s&&!s.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return o},r}(),qo=globalThis&&globalThis.__values||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.")};(function(){function r(){}return r.encodeBytes=function(t){return r.encode(t,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(t,e,n){var i=new Ko(t).encode(),a=F.truncDivision(i.getSize()*e,100)+11,o=i.getSize()+a,f,s,u,c,l;if(n!==r.DEFAULT_AZTEC_LAYERS){if(f=n<0,s=Math.abs(n),s>(f?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new M(k.format("Illegal value %s for layers",n));u=r.totalBitsInLayer(s,f),c=r.WORD_SIZE[s];var h=u-u%c;if(l=r.stuffBits(i,c),l.getSize()+a>h)throw new M("Data to large for user specified layer");if(f&&l.getSize()>c*64)throw new M("Data to large for user specified layer")}else{c=0,l=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new M("Data too large for an Aztec code");if(f=d<=3,s=f?d+1:d,u=r.totalBitsInLayer(s,f),!(o>u)){(l==null||c!==r.WORD_SIZE[s])&&(c=r.WORD_SIZE[s],l=r.stuffBits(i,c));var h=u-u%c;if(!(f&&l.getSize()>c*64)&&l.getSize()+a<=h)break}}}var v=r.generateCheckWords(l,u,c),g=l.getSize()/c,x=r.generateModeMessage(f,s,g),_=(f?11:14)+s*4,y=new Int32Array(_),A;if(f){A=_;for(var d=0;d=i||t.get(o+s))&&(f|=1<{f.value.reset()}),O.onMounted(async()=>{if(!s.value)throw new vt("Media Stream API is not supported")});const v=O.computed(()=>i.value?"bg-black":"bg-transparent"),g=O.computed(()=>h.capture==="shoot");O.watch(c,()=>I());function x(m,b){return b?x(b,m%b):m}function _(m,b){const N=x(m,b);return{widht:m/N,height:b/N}}function y(){const m=_(c.value,l.value),b=/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(navigator.userAgent),N=navigator.userAgentData;let R=m.widht/m.height;N&&N.mobile?R=m.height/m.widht:navigator.maxTouchPoints===1?R=m.widht/m.height:b&&(R=m.height/m.widht);let L={audio:!1,video:{facingMode:o.value===0?"environment":"user",aspectRatio:R}};f.value.decodeFromConstraints(L,n.value,(K,wt)=>{if(!wt){const bt=K;if(u.value=bt,d("result",bt),g.value)return I(g.value)}})}function A(m=!1){f.value.reset(),a.value=m,i.value=!1,d("onloading",i.value),!m&&(u.value=void 0,d("result",u.value))}function E(){A(),y(),n.value.oncanplay=m=>{a.value=!1,i.value=!0,d("onloading",i.value),d("loaded",m)}}function I(m=!1){var N,R;const b=(R=(N=n.value)==null?void 0:N.srcObject)==null?void 0:R.getTracks();b&&(b&&b.length&&b.forEach(q=>{q.stop()}),A(u.value?!0:m))}function S(){o.value+=1,o.value%2===0&&(o.value=0),setTimeout(()=>{I()},300),setTimeout(()=>{E()},500)}return t({onCanPlay:E,onCanStop:I,onReset:A,onChangeFacemode:S}),(m,b)=>(O.openBlock(),O.createElementBlock("div",{class:O.normalizeClass(["scanner__container",v.value])},[O.withDirectives(O.createElementVNode("div",Qo,[O.createElementVNode("video",{ref_key:"scanner",ref:n,poster:"data:image/gif,AAAA"},null,512)],512),[[O.vShow,i.value]]),i.value?(O.openBlock(),O.createElementBlock(O.Fragment,{key:0},[O.renderSlot(m.$slots,"action-stop",{onCanStop:I},()=>[O.createElementVNode("div",Jo,[O.createElementVNode("button",{class:"btn-stop",onClick:b[0]||(b[0]=N=>I())})])],!0),O.renderSlot(m.$slots,"action-facemode",{onChangeFacemode:S},()=>[O.createElementVNode("div",t1,[O.createElementVNode("button",{class:"btn-facemode",onClick:S},[O.createVNode(Qe)])])],!0)],64)):O.renderSlot(m.$slots,"actions",{key:1,onCanPlay:E,isReset:a.value,onReset:A},()=>[r.showOnStream?O.createCommentVNode("",!0):(O.openBlock(),O.createElementBlock("button",{key:0,type:"button",class:"btn-stream",onClick:E},"Stream")),a.value?(O.openBlock(),O.createElementBlock("button",{key:1,type:"button",class:"btn-reset",onClick:b[1]||(b[1]=N=>A())},"Reset")):O.createCommentVNode("",!0)],!0)],2))}}),i1="",r1=qe(e1,[["__scopeId","data-v-c4f5ee33"]]);Nt.IconCamera=Qe,Nt.Result=ut,Nt.StreamQrcodeBarcodeReader=r1,Object.defineProperty(Nt,Symbol.toStringTag,{value:"Module"})});