import{_ as vi,i as si,c as Nr,o as fr,b as ci,a as tn,n as $i,x as ea,y as Za,m as Xi,F as V1,r as H1,j as ta,z as zo,A as ti,B as G1,e as Qt,d as Xt,C as X1,D as ja,p as Vn,t as Ka,w as W1,f as z1,g as Y1,k as qa,T as Z1,s as j1}from"./main-D6qyxymd.js";function K1(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const q1={props:{content:{type:Object,required:!0}},emits:["trigger-event","update:content"],watch:{"content.useCustomPagination"(r){r&&this.$emit("update:content",{collectionId:null})}},computed:{isEditing(){return!1},paginationOptions(){return this.content.useCustomPagination?{limit:this.content.paginatorLimit,offset:this.content.paginatorOffset,total:this.content.paginatorTotal}:this.content.collectionId?wwLib.wwCollection.getPaginationOptions(this.content.collectionId):null},nbPage(){if(!this.paginationOptions)return 10;const r=Math.ceil(this.paginationOptions.total/this.paginationOptions.limit);return isNaN(r)?1:r},currentPage(){if(!this.paginationOptions)return 1;const r=Math.floor(this.paginationOptions.offset/this.paginationOptions.limit);return isNaN(r)?0:r},navigation(){const r=this.nbPage-1,e=this.currentPage-1,t=this.currentPage+1;let n=0,a=[];return a.push({label:"1",index:0,states:this.currentPage===0?["active"]:[]}),e>n&&(e>n+1&&a.push({label:"...",index:-1}),a.push({label:`${e+1}`,index:e}),n=e),this.currentPage!==0&&this.currentPage!==r&&(a.push({label:`${this.currentPage+1}`,index:this.currentPage,states:["active"]}),n=this.currentPage),tn&&(a.push({label:`${t+1}`,index:t}),n=t,tn&&a.push({label:`${r+1}`,index:r,states:r===this.currentPage?["active"]:[]}),a}},methods:{goTo(r){this.paginationOptions&&r!==-1&&r!==this.currentPage&&(this.content.useCustomPagination||wwLib.wwCollection.setOffset(this.content.collectionId,r*this.paginationOptions.limit),this.$emit("trigger-event",{name:"change",event:{context:{offset:r*this.paginationOptions.limit,page:r+1,total:this.paginationOptions.total,limit:this.paginationOptions.limit}}}))},prev(){this.currentPage>0&&this.goTo(this.currentPage-1)},next(){this.currentPages.prev&&s.prev(...g))},[t.content.paginatorPrev?(fr(),ea(f,Za(Xi({key:0},t.content.paginatorPrev)),null,16)):tn("",!0)],2),t.content.paginatorText?(fr(!0),Nr(V1,{key:0},H1(s.navigation,(g,w)=>(fr(),Nr("li",{key:w,"aria-current":g.index===s.currentPage,onClick:A=>s.goTo(g.index)},[ta(x,{"is-repeat":"",index:w},{default:zo(()=>[ta(h,Xi({ref_for:!0},t.content.paginatorText,{"ww-props":{text:g.label},states:g.states}),null,16,["ww-props","states"])]),_:2},1032,["index"])],8,J1))),128)):tn("",!0),ci("li",{class:$i({"hide-icon":!s.isEditing&&s.currentPage===s.nbPage-1}),onClick:e[1]||(e[1]=(...g)=>s.next&&s.next(...g))},[t.content.paginatorNext?(fr(),ea(f,Za(Xi({key:0},t.content.paginatorNext)),null,16)):tn("",!0)],2)])])}const _u=vi(q1,[["render",$1],["__scopeId","data-v-d4cb42c6"]]);var oe;(function(r){r[r.QR_CODE=0]="QR_CODE",r[r.AZTEC=1]="AZTEC",r[r.CODABAR=2]="CODABAR",r[r.CODE_39=3]="CODE_39",r[r.CODE_93=4]="CODE_93",r[r.CODE_128=5]="CODE_128",r[r.DATA_MATRIX=6]="DATA_MATRIX",r[r.MAXICODE=7]="MAXICODE",r[r.ITF=8]="ITF",r[r.EAN_13=9]="EAN_13",r[r.EAN_8=10]="EAN_8",r[r.PDF_417=11]="PDF_417",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"})(oe||(oe={}));var Qa=new Map([[oe.QR_CODE,"QR_CODE"],[oe.AZTEC,"AZTEC"],[oe.CODABAR,"CODABAR"],[oe.CODE_39,"CODE_39"],[oe.CODE_93,"CODE_93"],[oe.CODE_128,"CODE_128"],[oe.DATA_MATRIX,"DATA_MATRIX"],[oe.MAXICODE,"MAXICODE"],[oe.ITF,"ITF"],[oe.EAN_13,"EAN_13"],[oe.EAN_8,"EAN_8"],[oe.PDF_417,"PDF_417"],[oe.RSS_14,"RSS_14"],[oe.RSS_EXPANDED,"RSS_EXPANDED"],[oe.UPC_A,"UPC_A"],[oe.UPC_E,"UPC_E"],[oe.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Ja;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.URL=1]="URL"})(Ja||(Ja={}));function es(r){return Object.values(oe).includes(r)}var hi;(function(r){r[r.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",r[r.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(hi||(hi={}));var ts=(function(){function r(){}return r.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",r.SCAN_DEFAULT_FPS=2,r.DEFAULT_DISABLE_FLIP=!1,r.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,r.DEFAULT_SUPPORTED_SCAN_TYPE=[hi.SCAN_TYPE_CAMERA,hi.SCAN_TYPE_FILE],r})(),Yo=(function(){function r(e,t){this.format=e,this.formatName=t}return r.prototype.toString=function(){return this.formatName},r.create=function(e){if(!Qa.has(e))throw"".concat(e," not in html5QrcodeSupportedFormatsTextMap");return new r(e,Qa.get(e))},r})(),$a=(function(){function r(){}return r.createFromText=function(e){var t={text:e};return{decodedText:e,result:t}},r.createFromQrcodeResult=function(e){return{decodedText:e.text,result:e}},r})(),ra;(function(r){r[r.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",r[r.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",r[r.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(ra||(ra={}));var rs=(function(){function r(){}return r.createFrom=function(e){return{errorMessage:e,type:ra.UNKWOWN_ERROR}},r})(),ns=(function(){function r(e){this.verbose=e}return r.prototype.log=function(e){this.verbose&&console.log(e)},r.prototype.warn=function(e){this.verbose&&console.warn(e)},r.prototype.logError=function(e,t){(this.verbose||t===!0)&&console.error(e)},r.prototype.logErrors=function(e){if(e.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(e)},r})();function Or(r){return typeof r>"u"||r===null}var gn=(function(){function r(){}return r.codeParseError=function(e){return"QR code parse error, error = ".concat(e)},r.errorGettingUserMedia=function(e){return"Error getting userMedia, error = ".concat(e)},r.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},r.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},r.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},r.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},r.scannerPaused=function(){return"Scanner paused"},r})(),Zo=(function(){function r(){}return r.isMediaStreamConstraintsValid=function(e,t){if(typeof e!="object"){var n=typeof e;return t.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var a=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],s=new Set(a),f=Object.keys(e),h=0,x=f;hc)throw new A("fromIndex("+o+") > toIndex("+c+")");if(o<0)throw new F(o);if(c>i)throw new F(c)}static asList(...i){return i}static create(i,o,c){return Array.from({length:i}).map(l=>Array.from({length:o}).fill(c))}static createInt32Array(i,o,c){return Array.from({length:i}).map(l=>Int32Array.from({length:o}).fill(c))}static equals(i,o){if(!i||!o||!i.length||!o.length||i.length!==o.length)return!1;for(let c=0,u=i.length;c>1,p=c(o,i[d]);if(p>0)u=d+1;else if(p<0)l=d-1;else return d}return-u-1}static numberComparator(i,o){return i-o}}class L{static numberOfTrailingZeros(i){let o;if(i===0)return 32;let c=31;return o=i<<16,o!==0&&(c-=16,i=o),o=i<<8,o!==0&&(c-=8,i=o),o=i<<4,o!==0&&(c-=4,i=o),o=i<<2,o!==0&&(c-=2,i=o),c-(i<<1>>>31)}static numberOfLeadingZeros(i){if(i===0)return 32;let o=1;return i>>>16||(o+=16,i<<=16),i>>>24||(o+=8,i<<=8),i>>>28||(o+=4,i<<=4),i>>>30||(o+=2,i<<=2),o-=i>>>31,o}static toHexString(i){return i.toString(16)}static toBinaryString(i){return String(parseInt(String(i),2))}static bitCount(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),i=i+(i>>>4)&252645135,i=i+(i>>>8),i=i+(i>>>16),i&63}static truncDivision(i,o){return Math.trunc(i/o)}static parseInt(i,o=void 0){return parseInt(i,o)}}L.MIN_VALUE_32_BITS=-2147483648,L.MAX_VALUE=Number.MAX_SAFE_INTEGER;class k{constructor(i,o){i===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=i,o==null?this.bits=k.makeArray(i):this.bits=o)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(i){if(i>this.bits.length*32){const o=k.makeArray(i);T.arraycopy(this.bits,0,o,0,this.bits.length),this.bits=o}}get(i){return(this.bits[Math.floor(i/32)]&1<<(i&31))!==0}set(i){this.bits[Math.floor(i/32)]|=1<<(i&31)}flip(i){this.bits[Math.floor(i/32)]^=1<<(i&31)}getNextSet(i){const o=this.size;if(i>=o)return o;const c=this.bits;let u=Math.floor(i/32),l=c[u];l&=~((1<<(i&31))-1);const d=c.length;for(;l===0;){if(++u===d)return o;l=c[u]}const p=u*32+L.numberOfTrailingZeros(l);return p>o?o:p}getNextUnset(i){const o=this.size;if(i>=o)return o;const c=this.bits;let u=Math.floor(i/32),l=~c[u];l&=~((1<<(i&31))-1);const d=c.length;for(;l===0;){if(++u===d)return o;l=~c[u]}const p=u*32+L.numberOfTrailingZeros(l);return p>o?o:p}setBulk(i,o){this.bits[Math.floor(i/32)]=o}setRange(i,o){if(othis.size)throw new A;if(o===i)return;o--;const c=Math.floor(i/32),u=Math.floor(o/32),l=this.bits;for(let d=c;d<=u;d++){const p=d>c?0:i&31,y=(2<<(dthis.size)throw new A;if(o===i)return!0;o--;const u=Math.floor(i/32),l=Math.floor(o/32),d=this.bits;for(let p=u;p<=l;p++){const v=p>u?0:i&31,_=(2<<(p32)throw new A("Num bits must be between 0 and 32");this.ensureCapacity(this.size+o);for(let c=o;c>0;c--)this.appendBit((i>>c-1&1)===1)}appendBitArray(i){const o=i.size;this.ensureCapacity(this.size+o);for(let c=0;c>1&1431655765|(d&1431655765)<<1,d=d>>2&858993459|(d&858993459)<<2,d=d>>4&252645135|(d&252645135)<<4,d=d>>8&16711935|(d&16711935)<<8,d=d>>16&65535|(d&65535)<<16,i[o-l]=d}if(this.size!==c*32){const l=c*32-this.size;let d=i[0]>>>l;for(let p=1;p>>l}i[c-1]=d}this.bits=i}static makeArray(i){return new Int32Array(Math.floor((i+31)/32))}equals(i){if(!(i instanceof k))return!1;const o=i;return this.size===o.size&&D.equals(this.bits,o.bits)}hashCode(){return 31*this.size+D.hashCode(this.bits)}toString(){let i="";for(let o=0,c=this.size;o=900)throw new U("incorect value");const o=Y.VALUES_TO_ECI.get(i);if(o===void 0)throw new U("incorect value");return o}static getCharacterSetECIByName(i){const o=Y.NAME_TO_ECI.get(i);if(o===void 0)throw new U("incorect value");return o}equals(i){if(!(i instanceof Y))return!1;const o=i;return this.getName()===o.getName()}}Y.VALUE_IDENTIFIER_TO_ECI=new Map,Y.VALUES_TO_ECI=new Map,Y.NAME_TO_ECI=new Map,Y.Cp437=new Y($.Cp437,Int32Array.from([0,2]),"Cp437"),Y.ISO8859_1=new Y($.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),Y.ISO8859_2=new Y($.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),Y.ISO8859_3=new Y($.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),Y.ISO8859_4=new Y($.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),Y.ISO8859_5=new Y($.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),Y.ISO8859_6=new Y($.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),Y.ISO8859_7=new Y($.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),Y.ISO8859_8=new Y($.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),Y.ISO8859_9=new Y($.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),Y.ISO8859_10=new Y($.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),Y.ISO8859_11=new Y($.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),Y.ISO8859_13=new Y($.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),Y.ISO8859_14=new Y($.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),Y.ISO8859_15=new Y($.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),Y.ISO8859_16=new Y($.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),Y.SJIS=new Y($.SJIS,20,"SJIS","Shift_JIS"),Y.Cp1250=new Y($.Cp1250,21,"Cp1250","windows-1250"),Y.Cp1251=new Y($.Cp1251,22,"Cp1251","windows-1251"),Y.Cp1252=new Y($.Cp1252,23,"Cp1252","windows-1252"),Y.Cp1256=new Y($.Cp1256,24,"Cp1256","windows-1256"),Y.UnicodeBigUnmarked=new Y($.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),Y.UTF8=new Y($.UTF8,26,"UTF8","UTF-8"),Y.ASCII=new Y($.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),Y.Big5=new Y($.Big5,28,"Big5"),Y.GB18030=new Y($.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),Y.EUC_KR=new Y($.EUC_KR,30,"EUC_KR","EUC-KR");class ue extends g{}ue.kind="UnsupportedOperationException";class _e{static decode(i,o){const c=this.encodingName(o);return this.customDecoder?this.customDecoder(i,c):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(c)?this.decodeFallback(i,c):new TextDecoder(c).decode(i)}static shouldDecodeOnFallback(i){return!_e.isBrowser()&&i==="ISO-8859-1"}static encode(i,o){const c=this.encodingName(o);return this.customEncoder?this.customEncoder(i,c):typeof TextEncoder>"u"?this.encodeFallback(i):new TextEncoder().encode(i)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(i){return typeof i=="string"?i:i.getName()}static encodingCharacterSet(i){return i instanceof Y?i:Y.getCharacterSetECIByName(i)}static decodeFallback(i,o){const c=this.encodingCharacterSet(o);if(_e.isDecodeFallbackSupported(c)){let u="";for(let l=0,d=i.length;l3&&i[0]===239&&i[1]===187&&i[2]===191;for(let te=0;te0?(J&128)===0?d=!1:p--:(J&128)!==0&&((J&64)===0?d=!1:(p++,(J&32)===0?v++:(p++,(J&16)===0?y++:(p++,(J&8)===0?_++:d=!1))))),u&&(J>127&&J<160?u=!1:J>159&&(J<192||J===215||J===247)&&z++),l&&(I>0?J<64||J===127||J>252?l=!1:I--:J===128||J===160||J>239?l=!1:J>160&&J<224?(S++,M=0,R++,R>B&&(B=R)):J>127?(I++,R=0,M++,M>V&&(V=M)):(R=0,M=0))}return d&&p>0&&(d=!1),l&&I>0&&(l=!1),d&&(ee||v+y+_>0)?Z.UTF8:l&&(Z.ASSUME_SHIFT_JIS||B>=3||V>=3)?Z.SHIFT_JIS:u&&l?B===2&&S===2||z*10>=c?Z.SHIFT_JIS:Z.ISO88591:u?Z.ISO88591:l?Z.SHIFT_JIS:d?Z.UTF8:Z.PLATFORM_DEFAULT_ENCODING}static format(i,...o){let c=-1;function u(d,p,v,y,_,I){if(d==="%%")return"%";if(o[++c]===void 0)return;d=y?parseInt(y.substr(1)):void 0;let S=_?parseInt(_.substr(1)):void 0,R;switch(I){case"s":R=o[c];break;case"c":R=o[c][0];break;case"f":R=parseFloat(o[c]).toFixed(d);break;case"p":R=parseFloat(o[c]).toPrecision(d);break;case"e":R=parseFloat(o[c]).toExponential(d);break;case"x":R=parseInt(o[c]).toString(S||16);break;case"d":R=parseFloat(parseInt(o[c],S||10).toPrecision(d)).toFixed(0);break}R=typeof R=="object"?JSON.stringify(R):(+R).toString(S);let M=parseInt(v),B=v&&v[0]+""=="0"?"0":" ";for(;R.lengthd){if(p===-1)p=l-d;else if(l-d!==p)throw new A("row lengths do not match");d=l,v++}y++}else if(i.substring(y,y+o.length)===o)y+=o.length,u[l]=!0,l++;else if(i.substring(y,y+c.length)===c)y+=c.length,u[l]=!1,l++;else throw new A("illegal character encountered: "+i.substring(y));if(l>d){if(p===-1)p=l-d;else if(l-d!==p)throw new A("row lengths do not match");v++}const _=new le(p,v);for(let I=0;I>>(i&31)&1)!==0}set(i,o){const c=o*this.rowSize+Math.floor(i/32);this.bits[c]|=1<<(i&31)&4294967295}unset(i,o){const c=o*this.rowSize+Math.floor(i/32);this.bits[c]&=~(1<<(i&31)&4294967295)}flip(i,o){const c=o*this.rowSize+Math.floor(i/32);this.bits[c]^=1<<(i&31)&4294967295}xor(i){if(this.width!==i.getWidth()||this.height!==i.getHeight()||this.rowSize!==i.getRowSize())throw new A("input matrix dimensions do not match");const o=new k(Math.floor(this.width/32)+1),c=this.rowSize,u=this.bits;for(let l=0,d=this.height;lthis.height||l>this.width)throw new A("The region must fit inside the matrix");const p=this.rowSize,v=this.bits;for(let y=o;yv&&(v=y),_*32p){let S=31;for(;!(I>>>S);)S--;_*32+S>p&&(p=_*32+S)}}}return p=0&&o[c]===0;)c--;if(c<0)return null;const u=Math.floor(c/i);let l=Math.floor(c%i)*32;const d=o[c];let p=31;for(;!(d>>>p);)p--;return l+=p,Int32Array.from([l,u])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(i){if(!(i instanceof le))return!1;const o=i;return this.width===o.width&&this.height===o.height&&this.rowSize===o.rowSize&&D.equals(this.bits,o.bits)}hashCode(){let i=this.width;return i=31*i+this.width,i=31*i+this.height,i=31*i+this.rowSize,i=31*i+D.hashCode(this.bits),i}toString(i="X ",o=" ",c=` `){return this.buildToString(i,o,c)}buildToString(i,o,c){let u=new ne;for(let l=0,d=this.height;l>me.LUMINANCE_SHIFT]++;const p=me.estimateBlackPoint(d);if(u<3)for(let v=0;v>me.LUMINANCE_SHIFT]++}}const d=me.estimateBlackPoint(l),p=i.getMatrix();for(let v=0;vl&&(u=_,l=i[_]),i[_]>c&&(c=i[_]);let d=0,p=0;for(let _=0;_p&&(d=_,p=S)}if(u>d){const _=u;u=d,d=_}if(d-u<=o/16)throw new X;let v=d-1,y=-1;for(let _=d-1;_>u;_--){const I=_-u,S=I*I*(d-_)*(c-i[_]);S>y&&(v=_,y=S)}return v<=ge.MINIMUM_DIMENSION&&c>=ge.MINIMUM_DIMENSION){const u=i.getMatrix();let l=o>>ge.BLOCK_SIZE_POWER;(o&ge.BLOCK_SIZE_MASK)!==0&&l++;let d=c>>ge.BLOCK_SIZE_POWER;(c&ge.BLOCK_SIZE_MASK)!==0&&d++;const p=ge.calculateBlackPoints(u,l,d,o,c),v=new le(o,c);ge.calculateThresholdForBlock(u,l,d,o,c,p,v),this.matrix=v}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(i){return new ge(i)}static calculateThresholdForBlock(i,o,c,u,l,d,p){const v=l-ge.BLOCK_SIZE,y=u-ge.BLOCK_SIZE;for(let _=0;_v&&(I=v);const S=ge.cap(_,2,c-3);for(let R=0;Ry&&(M=y);const B=ge.cap(R,2,o-3);let V=0;for(let ee=-2;ee<=2;ee++){const te=d[S+ee];V+=te[B-2]+te[B-1]+te[B]+te[B+1]+te[B+2]}const z=V/25;ge.thresholdBlock(i,M,I,z,u,p)}}}static cap(i,o,c){return ic?c:i}static thresholdBlock(i,o,c,u,l,d){for(let p=0,v=c*l+o;pd&&(_=d);for(let I=0;Ip&&(S=p);let R=0,M=255,B=0;for(let z=0,ee=_*u+S;zB&&(B=J)}if(B-M>ge.MIN_DYNAMIC_RANGE)for(z++,ee+=u;z>ge.BLOCK_SIZE_POWER*2;if(B-M<=ge.MIN_DYNAMIC_RANGE&&(V=M/2,y>0&&I>0)){const z=(v[y-1][I]+2*v[y][I-1]+v[y-1][I-1])/4;M>10}u[d]=v}return u}getRow(i,o){if(i<0||i>=this.getHeight())throw new A("Requested row is outside the image: "+i);const c=this.getWidth(),u=i*c;return o===null?o=this.buffer.slice(u,u+c):(o.lengthnew Sa(o.deviceId,o.label))})}findDeviceById(i){return Lt(this,void 0,void 0,function*(){const o=yield this.listVideoInputDevices();return o?o.find(c=>c.deviceId===i):null})}decodeFromInputVideoDevice(i,o){return Lt(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(i,o)})}decodeOnceFromVideoDevice(i,o){return Lt(this,void 0,void 0,function*(){this.reset();let c;i?c={deviceId:{exact:i}}:c={facingMode:"environment"};const u={video:c};return yield this.decodeOnceFromConstraints(u,o)})}decodeOnceFromConstraints(i,o){return Lt(this,void 0,void 0,function*(){const c=yield navigator.mediaDevices.getUserMedia(i);return yield this.decodeOnceFromStream(c,o)})}decodeOnceFromStream(i,o){return Lt(this,void 0,void 0,function*(){this.reset();const c=yield this.attachStreamToVideo(i,o);return yield this.decodeOnce(c)})}decodeFromInputVideoDeviceContinuously(i,o,c){return Lt(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(i,o,c)})}decodeFromVideoDevice(i,o,c){return Lt(this,void 0,void 0,function*(){let u;i?u={deviceId:{exact:i}}:u={facingMode:"environment"};const l={video:u};return yield this.decodeFromConstraints(l,o,c)})}decodeFromConstraints(i,o,c){return Lt(this,void 0,void 0,function*(){const u=yield navigator.mediaDevices.getUserMedia(i);return yield this.decodeFromStream(u,o,c)})}decodeFromStream(i,o,c){return Lt(this,void 0,void 0,function*(){this.reset();const u=yield this.attachStreamToVideo(i,o);return yield this.decodeContinuously(u,c)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(i,o){return Lt(this,void 0,void 0,function*(){const c=this.prepareVideoElement(o);return this.addVideoSource(c,i),this.videoElement=c,this.stream=i,yield this.playVideoOnLoadAsync(c),c})}playVideoOnLoadAsync(i){return new Promise((o,c)=>this.playVideoOnLoad(i,()=>o()))}playVideoOnLoad(i,o){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(i),i.addEventListener("ended",this.videoEndedListener),i.addEventListener("canplay",this.videoCanPlayListener),i.addEventListener("playing",o),this.tryPlayVideo(i)}isVideoPlaying(i){return i.currentTime>0&&!i.paused&&!i.ended&&i.readyState>2}tryPlayVideo(i){return Lt(this,void 0,void 0,function*(){if(this.isVideoPlaying(i)){console.warn("Trying to play video that is already playing.");return}try{yield i.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(i,o){const c=document.getElementById(i);if(!c)throw new w(`element with id '${i}' not found`);if(c.nodeName.toLowerCase()!==o.toLowerCase())throw new w(`element with id '${i}' must be an ${o} element`);return c}decodeFromImage(i,o){if(!i&&!o)throw new w("either imageElement with a src set or an url must be provided");return o&&!i?this.decodeFromImageUrl(o):this.decodeFromImageElement(i)}decodeFromVideo(i,o){if(!i&&!o)throw new w("Either an element with a src set or an URL must be provided");return o&&!i?this.decodeFromVideoUrl(o):this.decodeFromVideoElement(i)}decodeFromVideoContinuously(i,o,c){if(i===void 0&&o===void 0)throw new w("Either an element with a src set or an URL must be provided");return o&&!i?this.decodeFromVideoUrlContinuously(o,c):this.decodeFromVideoElementContinuously(i,c)}decodeFromImageElement(i){if(!i)throw new w("An image element must be provided.");this.reset();const o=this.prepareImageElement(i);this.imageElement=o;let c;return this.isImageLoaded(o)?c=this.decodeOnce(o,!1,!0):c=this._decodeOnLoadImage(o),c}decodeFromVideoElement(i){const o=this._decodeFromVideoElementSetup(i);return this._decodeOnLoadVideo(o)}decodeFromVideoElementContinuously(i,o){const c=this._decodeFromVideoElementSetup(i);return this._decodeOnLoadVideoContinuously(c,o)}_decodeFromVideoElementSetup(i){if(!i)throw new w("A video element must be provided.");this.reset();const o=this.prepareVideoElement(i);return this.videoElement=o,o}decodeFromImageUrl(i){if(!i)throw new w("An URL must be provided.");this.reset();const o=this.prepareImageElement();this.imageElement=o;const c=this._decodeOnLoadImage(o);return o.src=i,c}decodeFromVideoUrl(i){if(!i)throw new w("An URL must be provided.");this.reset();const o=this.prepareVideoElement(),c=this.decodeFromVideoElement(o);return o.src=i,c}decodeFromVideoUrlContinuously(i,o){if(!i)throw new w("An URL must be provided.");this.reset();const c=this.prepareVideoElement(),u=this.decodeFromVideoElementContinuously(c,o);return c.src=i,u}_decodeOnLoadImage(i){return new Promise((o,c)=>{this.imageLoadedListener=()=>this.decodeOnce(i,!1,!0).then(o,c),i.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(i){return Lt(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(i),yield this.decodeOnce(i)})}_decodeOnLoadVideoContinuously(i,o){return Lt(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(i),this.decodeContinuously(i,o)})}isImageLoaded(i){return!(!i.complete||i.naturalWidth===0)}prepareImageElement(i){let o;return typeof i>"u"&&(o=document.createElement("img"),o.width=200,o.height=200),typeof i=="string"&&(o=this.getMediaElement(i,"img")),i instanceof HTMLImageElement&&(o=i),o}prepareVideoElement(i){let o;return!i&&typeof document<"u"&&(o=document.createElement("video"),o.width=200,o.height=200),typeof i=="string"&&(o=this.getMediaElement(i,"video")),i instanceof HTMLVideoElement&&(o=i),o.setAttribute("autoplay","true"),o.setAttribute("muted","true"),o.setAttribute("playsinline","true"),o}decodeOnce(i,o=!0,c=!0){this._stopAsyncDecode=!1;const u=(l,d)=>{if(this._stopAsyncDecode){d(new X("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const p=this.decode(i);l(p)}catch(p){const v=o&&p instanceof X,_=(p instanceof C||p instanceof U)&&c;if(v||_)return setTimeout(u,this._timeBetweenDecodingAttempts,l,d);d(p)}};return new Promise((l,d)=>u(l,d))}decodeContinuously(i,o){this._stopContinuousDecode=!1;const c=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const u=this.decode(i);o(u,null),setTimeout(c,this.timeBetweenScansMillis)}catch(u){o(null,u);const l=u instanceof C||u instanceof U,d=u instanceof X;(l||d)&&setTimeout(c,this._timeBetweenDecodingAttempts)}};c()}decode(i){const o=this.createBinaryBitmap(i);return this.decodeBitmap(o)}_isHTMLVideoElement(i){return i.videoWidth!==0}drawFrameOnCanvas(i,o,c){o||(o={sx:0,sy:0,sWidth:i.videoWidth,sHeight:i.videoHeight,dx:0,dy:0,dWidth:i.videoWidth,dHeight:i.videoHeight}),c||(c=this.captureCanvasContext),c.drawImage(i,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}drawImageOnCanvas(i,o,c=this.captureCanvasContext){o||(o={sx:0,sy:0,sWidth:i.naturalWidth,sHeight:i.naturalHeight,dx:0,dy:0,dWidth:i.naturalWidth,dHeight:i.naturalHeight}),c||(c=this.captureCanvasContext),c.drawImage(i,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}createBinaryBitmap(i){this.getCaptureCanvasContext(i),this._isHTMLVideoElement(i)?this.drawFrameOnCanvas(i):this.drawImageOnCanvas(i);const o=this.getCaptureCanvas(i),c=new Rr(o),u=new ge(c);return new E(u)}getCaptureCanvasContext(i){if(!this.captureCanvasContext){const c=this.getCaptureCanvas(i).getContext("2d");this.captureCanvasContext=c}return this.captureCanvasContext}getCaptureCanvas(i){if(!this.captureCanvas){const o=this.createCaptureCanvas(i);this.captureCanvas=o}return this.captureCanvas}decodeBitmap(i){return this.reader.decode(i,this._hints)}createCaptureCanvas(i){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const o=document.createElement("canvas");let c,u;return typeof i<"u"&&(i instanceof HTMLVideoElement?(c=i.videoWidth,u=i.videoHeight):i instanceof HTMLImageElement&&(c=i.naturalWidth||i.width,u=i.naturalHeight||i.height)),o.style.width=c+"px",o.style.height=u+"px",o.width=c,o.height=u,o}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(i=>i.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){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)}_destroyImageElement(){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)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(i,o){try{i.srcObject=o}catch{i.src=URL.createObjectURL(o)}}cleanVideoSource(i){try{i.srcObject=null}catch{i.src=""}this.videoElement.removeAttribute("src")}}class Ft{constructor(i,o,c=o==null?0:8*o.length,u,l,d=T.currentTimeMillis()){this.text=i,this.rawBytes=o,this.numBits=c,this.resultPoints=u,this.format=l,this.timestamp=d,this.text=i,this.rawBytes=o,c==null?this.numBits=o==null?0:8*o.length:this.numBits=c,this.resultPoints=u,this.format=l,this.resultMetadata=null,d==null?this.timestamp=T.currentTimeMillis():this.timestamp=d}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(i,o){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(i,o)}putAllMetadata(i){i!==null&&(this.resultMetadata===null?this.resultMetadata=i:this.resultMetadata=new Map(i))}addResultPoints(i){const o=this.resultPoints;if(o===null)this.resultPoints=i;else if(i!==null&&i.length>0){const c=new Array(o.length+i.length);T.arraycopy(o,0,c,0,o.length),T.arraycopy(i,0,c,o.length,i.length),this.resultPoints=c}}getTimestamp(){return this.timestamp}toString(){return this.text}}var Ei;(function(m){m[m.AZTEC=0]="AZTEC",m[m.CODABAR=1]="CODABAR",m[m.CODE_39=2]="CODE_39",m[m.CODE_93=3]="CODE_93",m[m.CODE_128=4]="CODE_128",m[m.DATA_MATRIX=5]="DATA_MATRIX",m[m.EAN_8=6]="EAN_8",m[m.EAN_13=7]="EAN_13",m[m.ITF=8]="ITF",m[m.MAXICODE=9]="MAXICODE",m[m.PDF_417=10]="PDF_417",m[m.QR_CODE=11]="QR_CODE",m[m.RSS_14=12]="RSS_14",m[m.RSS_EXPANDED=13]="RSS_EXPANDED",m[m.UPC_A=14]="UPC_A",m[m.UPC_E=15]="UPC_E",m[m.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Ei||(Ei={}));var pe=Ei,Ci;(function(m){m[m.OTHER=0]="OTHER",m[m.ORIENTATION=1]="ORIENTATION",m[m.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",m[m.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",m[m.ISSUE_NUMBER=4]="ISSUE_NUMBER",m[m.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",m[m.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",m[m.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",m[m.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",m[m.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",m[m.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ci||(Ci={}));var wt=Ci;class yn{constructor(i,o,c,u,l=-1,d=-1){this.rawBytes=i,this.text=o,this.byteSegments=c,this.ecLevel=u,this.structuredAppendSequenceNumber=l,this.structuredAppendParity=d,this.numBits=i==null?0:8*i.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(i){this.numBits=i}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(i){this.errorsCorrected=i}getErasures(){return this.erasures}setErasures(i){this.erasures=i}getOther(){return this.other}setOther(i){this.other=i}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class En{exp(i){return this.expTable[i]}log(i){if(i===0)throw new A;return this.logTable[i]}static addOrSubtract(i,o){return i^o}}class Wt{constructor(i,o){if(o.length===0)throw new A;this.field=i;const c=o.length;if(c>1&&o[0]===0){let u=1;for(;uc.length){const d=o;o=c,c=d}let u=new Int32Array(c.length);const l=c.length-o.length;T.arraycopy(c,0,u,0,l);for(let d=l;d=i.getDegree()&&!u.isZero();){const p=u.getDegree()-i.getDegree(),v=o.multiply(u.getCoefficient(u.getDegree()),d),y=i.multiplyByMonomial(p,v),_=o.buildMonomial(p,v);c=c.addOrSubtract(_),u=u.addOrSubtract(y)}return[c,u]}toString(){let i="";for(let o=this.getDegree();o>=0;o--){let c=this.getCoefficient(o);if(c!==0){if(c<0?(i+=" - ",c=-c):i.length>0&&(i+=" + "),o===0||c!==1){const u=this.field.log(c);u===0?i+="1":u===1?i+="a":(i+="a^",i+=u)}o!==0&&(o===1?i+="x":(i+="x^",i+=o))}}return i}}class Gn extends g{}Gn.kind="ArithmeticException";class Me extends En{constructor(i,o,c){super(),this.primitive=i,this.size=o,this.generatorBase=c;const u=new Int32Array(o);let l=1;for(let p=0;p=o&&(l^=i,l&=o-1);this.expTable=u;const d=new Int32Array(o);for(let p=0;p=(c/2|0);){let R=l,M=p;if(l=d,p=v,l.isZero())throw new nn("r_{i-1} was zero");d=R;let B=u.getZero();const V=l.getCoefficient(l.getDegree()),z=u.inverse(V);for(;d.getDegree()>=l.getDegree()&&!d.isZero();){const ee=d.getDegree()-l.getDegree(),te=u.multiply(d.getCoefficient(d.getDegree()),z);B=B.addOrSubtract(u.buildMonomial(ee,te)),d=d.addOrSubtract(l.multiplyByMonomial(ee,te))}if(v=B.multiply(p).addOrSubtract(M),d.getDegree()>=l.getDegree())throw new Ar("Division algorithm failed to reduce polynomial?")}const y=v.getCoefficient(0);if(y===0)throw new nn("sigmaTilde(0) was zero");const _=u.inverse(y),I=v.multiplyScalar(_),S=d.multiplyScalar(_);return[I,S]}findErrorLocations(i){const o=i.getDegree();if(o===1)return Int32Array.from([i.getCoefficient(1)]);const c=new Int32Array(o);let u=0;const l=this.field;for(let d=1;d1,I,I+c-1),I+=c-1;else for(let M=c-1;M>=0;--M)_[I++]=(R&1<=8?Ze.readCode(i,o,8):Ze.readCode(i,o,c)<<8-c}static convertBoolArrayToByteArray(i){let o=new Uint8Array((i.length+7)/8);for(let c=0;c","?","[","]","{","}","CTRL_UL"],Ze.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class Oe{constructor(){}static round(i){return i===NaN?0:i<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:i>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:i+(i<0?-.5:.5)|0}static distance(i,o,c,u){const l=i-c,d=o-u;return Math.sqrt(l*l+d*d)}static sum(i){let o=0;for(let c=0,u=i.length;c!==u;c++){const l=i[c];o+=l}return o}}class Xn{static floatToIntBits(i){return i}}Xn.MAX_VALUE=Number.MAX_SAFE_INTEGER;class fe{constructor(i,o){this.x=i,this.y=o}getX(){return this.x}getY(){return this.y}equals(i){if(i instanceof fe){const o=i;return this.x===o.x&&this.y===o.y}return!1}hashCode(){return 31*Xn.floatToIntBits(this.x)+Xn.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(i){const o=this.distance(i[0],i[1]),c=this.distance(i[1],i[2]),u=this.distance(i[0],i[2]);let l,d,p;if(c>=o&&c>=u?(d=i[0],l=i[1],p=i[2]):u>=c&&u>=o?(d=i[1],l=i[0],p=i[2]):(d=i[2],l=i[0],p=i[1]),this.crossProductZ(l,d,p)<0){const v=l;l=p,p=v}i[0]=l,i[1]=d,i[2]=p}static distance(i,o){return Oe.distance(i.x,i.y,o.x,o.y)}static crossProductZ(i,o,c){const u=o.x,l=o.y;return(c.x-u)*(i.y-l)-(c.y-l)*(i.x-u)}}class Wn{constructor(i,o){this.bits=i,this.points=o}getBits(){return this.bits}getPoints(){return this.points}}class ba extends Wn{constructor(i,o,c,u,l){super(i,o),this.compact=c,this.nbDatablocks=u,this.nbLayers=l}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class Tr{constructor(i,o,c,u){this.image=i,this.height=i.getHeight(),this.width=i.getWidth(),o==null&&(o=Tr.INIT_SIZE),c==null&&(c=i.getWidth()/2|0),u==null&&(u=i.getHeight()/2|0);const l=o/2|0;if(this.leftInit=c-l,this.rightInit=c+l,this.upInit=u-l,this.downInit=u+l,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new X}detect(){let i=this.leftInit,o=this.rightInit,c=this.upInit,u=this.downInit,l=!1,d=!0,p=!1,v=!1,y=!1,_=!1,I=!1;const S=this.width,R=this.height;for(;d;){d=!1;let M=!0;for(;(M||!v)&&o=S){l=!0;break}let B=!0;for(;(B||!y)&&u=R){l=!0;break}let V=!0;for(;(V||!_)&&i>=0;)V=this.containsBlackPoint(c,u,i,!1),V?(i--,d=!0,_=!0):_||i--;if(i<0){l=!0;break}let z=!0;for(;(z||!I)&&c>=0;)z=this.containsBlackPoint(i,o,c,!0),z?(c--,d=!0,I=!0):I||c--;if(c<0){l=!0;break}d&&(p=!0)}if(!l&&p){const M=o-i;let B=null;for(let te=1;B===null&&tec||v<-1||v>u)throw new X;l=!1,p===-1?(o[d]=0,l=!0):p===c&&(o[d]=c-1,l=!0),v===-1?(o[d+1]=0,l=!0):v===u&&(o[d+1]=u-1,l=!0)}l=!0;for(let d=o.length-2;d>=0&&l;d-=2){const p=Math.floor(o[d]),v=Math.floor(o[d+1]);if(p<-1||p>c||v<-1||v>u)throw new X;l=!1,p===-1?(o[d]=0,l=!0):p===c&&(o[d]=c-1,l=!0),v===-1?(o[d+1]=0,l=!0):v===u&&(o[d+1]=u-1,l=!0)}}}class hr{constructor(i,o,c,u,l,d,p,v,y){this.a11=i,this.a21=o,this.a31=c,this.a12=u,this.a22=l,this.a32=d,this.a13=p,this.a23=v,this.a33=y}static quadrilateralToQuadrilateral(i,o,c,u,l,d,p,v,y,_,I,S,R,M,B,V){const z=hr.quadrilateralToSquare(i,o,c,u,l,d,p,v);return hr.squareToQuadrilateral(y,_,I,S,R,M,B,V).times(z)}transformPoints(i){const o=i.length,c=this.a11,u=this.a12,l=this.a13,d=this.a21,p=this.a22,v=this.a23,y=this.a31,_=this.a32,I=this.a33;for(let S=0;S>1&127):(u<<=10,u+=(p>>2&992)+(p>>1&31))}let l=this.getCorrectedParameterData(u,this.compact);this.compact?(this.nbLayers=(l>>6)+1,this.nbDataBlocks=(l&63)+1):(this.nbLayers=(l>>11)+1,this.nbDataBlocks=(l&2047)+1)}getRotation(i,o){let c=0;i.forEach((u,l,d)=>{let p=(u>>o-2<<1)+(u&1);c=(c<<3)+p}),c=((c&1)<<11)+(c>>1);for(let u=0;u<4;u++)if(L.bitCount(c^this.EXPECTED_CORNER_BITS[u])<=2)return u;throw new X}getCorrectedParameterData(i,o){let c,u;o?(c=7,u=2):(c=10,u=4);let l=c-u,d=new Int32Array(c);for(let v=c-1;v>=0;--v)d[v]=i&15,i>>=4;try{new Cn(Me.AZTEC_PARAM).decode(d,l)}catch{throw new X}let p=0;for(let v=0;v2){let B=this.distancePoint(M,I)*this.nbCenterLayers/(this.distancePoint(l,o)*(this.nbCenterLayers+2));if(B<.75||B>1.25||!this.isWhiteOrBlackRectangle(I,S,R,M))break}o=I,c=S,u=R,l=M,d=!d}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new X;this.compact=this.nbCenterLayers===5;let p=new fe(o.getX()+.5,o.getY()-.5),v=new fe(c.getX()+.5,c.getY()+.5),y=new fe(u.getX()-.5,u.getY()+.5),_=new fe(l.getX()-.5,l.getY()-.5);return this.expandSquare([p,v,y,_],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let i,o,c,u;try{let p=new Tr(this.image).detect();i=p[0],o=p[1],c=p[2],u=p[3]}catch{let v=this.image.getWidth()/2,y=this.image.getHeight()/2;i=this.getFirstDifferent(new kt(v+7,y-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new kt(v+7,y+7),!1,1,1).toResultPoint(),c=this.getFirstDifferent(new kt(v-7,y+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new kt(v-7,y-7),!1,-1,-1).toResultPoint()}let l=Oe.round((i.getX()+u.getX()+o.getX()+c.getX())/4),d=Oe.round((i.getY()+u.getY()+o.getY()+c.getY())/4);try{let p=new Tr(this.image,15,l,d).detect();i=p[0],o=p[1],c=p[2],u=p[3]}catch{i=this.getFirstDifferent(new kt(l+7,d-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new kt(l+7,d+7),!1,1,1).toResultPoint(),c=this.getFirstDifferent(new kt(l-7,d+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new kt(l-7,d-7),!1,-1,-1).toResultPoint()}return l=Oe.round((i.getX()+u.getX()+o.getX()+c.getX())/4),d=Oe.round((i.getY()+u.getY()+o.getY()+c.getY())/4),new kt(l,d)}getMatrixCornerPoints(i){return this.expandSquare(i,2*this.nbCenterLayers,this.getDimension())}sampleGrid(i,o,c,u,l){let d=Dr.getInstance(),p=this.getDimension(),v=p/2-this.nbCenterLayers,y=p/2+this.nbCenterLayers;return d.sampleGrid(i,p,p,v,v,y,v,y,y,v,y,o.getX(),o.getY(),c.getX(),c.getY(),u.getX(),u.getY(),l.getX(),l.getY())}sampleLine(i,o,c){let u=0,l=this.distanceResultPoint(i,o),d=l/c,p=i.getX(),v=i.getY(),y=d*(o.getX()-i.getX())/l,_=d*(o.getY()-i.getY())/l;for(let I=0;I.1&&I<.9?0:I<=.1===y?1:-1}getFirstDifferent(i,o,c,u){let l=i.getX()+c,d=i.getY()+u;for(;this.isValid(l,d)&&this.image.get(l,d)===o;)l+=c,d+=u;for(l-=c,d-=u;this.isValid(l,d)&&this.image.get(l,d)===o;)l+=c;for(l-=c;this.isValid(l,d)&&this.image.get(l,d)===o;)d+=u;return d-=u,new kt(l,d)}expandSquare(i,o,c){let u=c/(2*o),l=i[0].getX()-i[2].getX(),d=i[0].getY()-i[2].getY(),p=(i[0].getX()+i[2].getX())/2,v=(i[0].getY()+i[2].getY())/2,y=new fe(p+u*l,v+u*d),_=new fe(p-u*l,v-u*d);l=i[1].getX()-i[3].getX(),d=i[1].getY()-i[3].getY(),p=(i[1].getX()+i[3].getX())/2,v=(i[1].getY()+i[3].getY())/2;let I=new fe(p+u*l,v+u*d),S=new fe(p-u*l,v-u*d);return[y,I,_,S]}isValid(i,o){return i>=0&&i0&&o{c.foundPossibleResultPoint(u)})}}reset(){}}class f1 extends Wr{constructor(i=500){super(new zn,i)}}class ct{decode(i,o){try{return this.doDecode(i,o)}catch{if(o&&o.get(K.TRY_HARDER)===!0&&i.isRotateSupported()){const l=i.rotateCounterClockwise(),d=this.doDecode(l,o),p=d.getResultMetadata();let v=270;p!==null&&p.get(wt.ORIENTATION)===!0&&(v=v+p.get(wt.ORIENTATION)%360),d.putMetadata(wt.ORIENTATION,v);const y=d.getResultPoints();if(y!==null){const _=l.getHeight();for(let I=0;I>(d?8:5));let v;d?v=u:v=15;const y=Math.trunc(u/2);for(let _=0;_=u)break;try{l=i.getBlackRow(R,l)}catch{continue}for(let M=0;M<2;M++){if(M===1&&(l.reverse(),o&&o.get(K.NEED_RESULT_POINT_CALLBACK)===!0)){const B=new Map;o.forEach((V,z)=>B.set(z,V)),B.delete(K.NEED_RESULT_POINT_CALLBACK),o=B}try{const B=this.decodeRow(R,l,o);if(M===1){B.putMetadata(wt.ORIENTATION,180);const V=B.getResultPoints();V!==null&&(V[0]=new fe(c-V[0].getX()-1,V[0].getY()),V[1]=new fe(c-V[1].getX()-1,V[1].getY()))}return B}catch{}}}throw new X}static recordPattern(i,o,c){const u=c.length;for(let y=0;y=l)throw new X;let d=!i.get(o),p=0,v=o;for(;v0&&u>=0;)i.get(--o)!==l&&(u--,l=!l);if(u>=0)throw new X;ct.recordPattern(i,o+1,c)}static patternMatchVariance(i,o,c){const u=i.length;let l=0,d=0;for(let y=0;yI?_-I:I-_;if(S>c)return Number.POSITIVE_INFINITY;v+=S}return v/l}}class ie extends ct{static findStartPattern(i){const o=i.getSize(),c=i.getNextSet(0);let u=0,l=Int32Array.from([0,0,0,0,0,0]),d=c,p=!1;const v=6;for(let y=c;y=0&&i.isRange(Math.max(0,d-(y-d)/2),d,!1))return Int32Array.from([d,y,I]);d+=l[0]+l[1],l=l.slice(2,l.length-1),l[u-1]=0,l[u]=0,u--}else u++;l[u]=1,p=!p}throw new X}static decodeCode(i,o,c){ct.recordPattern(i,c,o);let u=ie.MAX_AVG_VARIANCE,l=-1;for(let d=0;d=0)return l;throw new X}decodeRow(i,o,c){const u=c&&c.get(K.ASSUME_GS1)===!0,l=ie.findStartPattern(o),d=l[2];let p=0;const v=new Uint8Array(20);v[p++]=d;let y;switch(d){case ie.CODE_START_A:y=ie.CODE_CODE_A;break;case ie.CODE_START_B:y=ie.CODE_CODE_B;break;case ie.CODE_START_C:y=ie.CODE_CODE_C;break;default:throw new U}let _=!1,I=!1,S="",R=l[0],M=l[1];const B=Int32Array.from([0,0,0,0,0,0]);let V=0,z=0,ee=d,te=0,J=!0,Se=!1,Ae=!1;for(;!_;){const dn=I;switch(I=!1,V=z,z=ie.decodeCode(o,B,M),v[p++]=z,z!==ie.CODE_STOP&&(J=!0),z!==ie.CODE_STOP&&(te++,ee+=te*z),R=M,M+=B.reduce((k1,U1)=>k1+U1,0),z){case ie.CODE_START_A:case ie.CODE_START_B:case ie.CODE_START_C:throw new U}switch(y){case ie.CODE_CODE_A:if(z<64)Ae===Se?S+=String.fromCharCode(32+z):S+=String.fromCharCode(32+z+128),Ae=!1;else if(z<96)Ae===Se?S+=String.fromCharCode(z-64):S+=String.fromCharCode(z+64),Ae=!1;else switch(z!==ie.CODE_STOP&&(J=!1),z){case ie.CODE_FNC_1:u&&(S.length===0?S+="]C1":S+="");break;case ie.CODE_FNC_2:case ie.CODE_FNC_3:break;case ie.CODE_FNC_4_A:!Se&&Ae?(Se=!0,Ae=!1):Se&&Ae?(Se=!1,Ae=!1):Ae=!0;break;case ie.CODE_SHIFT:I=!0,y=ie.CODE_CODE_B;break;case ie.CODE_CODE_B:y=ie.CODE_CODE_B;break;case ie.CODE_CODE_C:y=ie.CODE_CODE_C;break;case ie.CODE_STOP:_=!0;break}break;case ie.CODE_CODE_B:if(z<96)Ae===Se?S+=String.fromCharCode(32+z):S+=String.fromCharCode(32+z+128),Ae=!1;else switch(z!==ie.CODE_STOP&&(J=!1),z){case ie.CODE_FNC_1:u&&(S.length===0?S+="]C1":S+="");break;case ie.CODE_FNC_2:case ie.CODE_FNC_3:break;case ie.CODE_FNC_4_B:!Se&&Ae?(Se=!0,Ae=!1):Se&&Ae?(Se=!1,Ae=!1):Ae=!0;break;case ie.CODE_SHIFT:I=!0,y=ie.CODE_CODE_A;break;case ie.CODE_CODE_A:y=ie.CODE_CODE_A;break;case ie.CODE_CODE_C:y=ie.CODE_CODE_C;break;case ie.CODE_STOP:_=!0;break}break;case ie.CODE_CODE_C:if(z<100)z<10&&(S+="0"),S+=z;else switch(z!==ie.CODE_STOP&&(J=!1),z){case ie.CODE_FNC_1:u&&(S.length===0?S+="]C1":S+="");break;case ie.CODE_CODE_A:y=ie.CODE_CODE_A;break;case ie.CODE_CODE_B:y=ie.CODE_CODE_B;break;case ie.CODE_STOP:_=!0;break}break}dn&&(y=y===ie.CODE_CODE_A?ie.CODE_CODE_B:ie.CODE_CODE_A)}const jt=M-R;if(M=o.getNextUnset(M),!o.isRange(M,Math.min(o.getSize(),M+(M-R)/2),!1))throw new X;if(ee-=te*V,ee%103!==V)throw new C;const xr=S.length;if(xr===0)throw new X;xr>0&&J&&(y===ie.CODE_CODE_C?S=S.substring(0,xr-2):S=S.substring(0,xr-1));const Kt=(l[1]+l[0])/2,Ye=R+jt/2,Tt=v.length,er=new Uint8Array(Tt);for(let dn=0;dnc&&(l=v);c=l,u=0;let d=0,p=0;for(let v=0;vc&&(p|=1<0;v++){let y=i[v];if(y>c&&(u--,y*2>=d))return-1}return p}}while(u>3);return-1}static patternToChar(i){for(let o=0;o="A"&&d<="Z")p=String.fromCharCode(d.charCodeAt(0)+32);else throw new U;break;case"$":if(d>="A"&&d<="Z")p=String.fromCharCode(d.charCodeAt(0)-64);else throw new U;break;case"%":if(d>="A"&&d<="E")p=String.fromCharCode(d.charCodeAt(0)-38);else if(d>="F"&&d<="J")p=String.fromCharCode(d.charCodeAt(0)-11);else if(d>="K"&&d<="O")p=String.fromCharCode(d.charCodeAt(0)+16);else if(d>="P"&&d<="T")p=String.fromCharCode(d.charCodeAt(0)+43);else if(d==="U")p="\0";else if(d==="V")p="@";else if(d==="W")p="`";else if(d==="X"||d==="Y"||d==="Z")p="";else throw new U;break;case"/":if(d>="A"&&d<="O")p=String.fromCharCode(d.charCodeAt(0)-32);else if(d==="Z")p=":";else throw new U;break}c+=p,u++}else c+=l}return c}}ft.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",ft.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],ft.ASTERISK_ENCODING=148;class We extends ct{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(i,o,c){let u=this.decodeStart(o),l=this.decodeEnd(o),d=new ne;We.decodeMiddle(o,u[1],l[0],d);let p=d.toString(),v=null;c!=null&&(v=c.get(K.ALLOWED_LENGTHS)),v==null&&(v=We.DEFAULT_ALLOWED_LENGTHS);let y=p.length,_=!1,I=0;for(let M of v){if(y===M){_=!0;break}M>I&&(I=M)}if(!_&&y>I&&(_=!0),!_)throw new U;const S=[new fe(u[1],i),new fe(l[0],i)];return new Ft(p,null,0,S,pe.ITF,new Date().getTime())}static decodeMiddle(i,o,c,u){let l=new Int32Array(10),d=new Int32Array(5),p=new Int32Array(5);for(l.fill(0),d.fill(0),p.fill(0);o0&&u>=0&&!i.get(u);u--)c--;if(c!==0)throw new X}static skipWhiteSpace(i){const o=i.getSize(),c=i.getNextSet(0);if(c===o)throw new X;return c}decodeEnd(i){i.reverse();try{let o=We.skipWhiteSpace(i),c;try{c=We.findGuardPattern(i,o,We.END_PATTERN_REVERSED[0])}catch(l){l instanceof X&&(c=We.findGuardPattern(i,o,We.END_PATTERN_REVERSED[1]))}this.validateQuietZone(i,c[0]);let u=c[0];return c[0]=i.getSize()-c[1],c[1]=i.getSize()-u,c}finally{i.reverse()}}static findGuardPattern(i,o,c){let u=c.length,l=new Int32Array(u),d=i.getSize(),p=!1,v=0,y=o;l.fill(0);for(let _=o;_=0)return c%10;throw new X}}We.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])],We.MAX_AVG_VARIANCE=.38,We.MAX_INDIVIDUAL_VARIANCE=.5,We.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],We.START_PATTERN=Int32Array.from([1,1,1,1]),We.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class nt extends ct{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(i){let o=!1,c,u=0,l=Int32Array.from([0,0,0]);for(;!o;){l=Int32Array.from([0,0,0]),c=nt.findGuardPattern(i,u,!1,this.START_END_PATTERN,l);let d=c[0];u=c[1];let p=d-(u-d);p>=0&&(o=i.isRange(p,d,!1))}return c}static checkChecksum(i){return nt.checkStandardUPCEANChecksum(i)}static checkStandardUPCEANChecksum(i){let o=i.length;if(o===0)return!1;let c=parseInt(i.charAt(o-1),10);return nt.getStandardUPCEANChecksum(i.substring(0,o-1))===c}static getStandardUPCEANChecksum(i){let o=i.length,c=0;for(let u=o-1;u>=0;u-=2){let l=i.charAt(u).charCodeAt(0)-48;if(l<0||l>9)throw new U;c+=l}c*=3;for(let u=o-2;u>=0;u-=2){let l=i.charAt(u).charCodeAt(0)-48;if(l<0||l>9)throw new U;c+=l}return(1e3-c)%10}static decodeEnd(i,o){return nt.findGuardPattern(i,o,!1,nt.START_END_PATTERN,new Int32Array(nt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(i,o,c,u){return this.findGuardPattern(i,o,c,u,new Int32Array(u.length))}static findGuardPattern(i,o,c,u,l){let d=i.getSize();o=c?i.getNextUnset(o):i.getNextSet(o);let p=0,v=o,y=u.length,_=c;for(let I=o;I=0)return d;throw new X}}nt.MAX_AVG_VARIANCE=.48,nt.MAX_INDIVIDUAL_VARIANCE=.7,nt.START_END_PATTERN=Int32Array.from([1,1,1]),nt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),nt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),nt.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])];class _n{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(i,o,c){let u=this.decodeRowStringBuffer,l=this.decodeMiddle(o,c,u),d=u.toString(),p=_n.parseExtensionString(d),v=[new fe((c[0]+c[1])/2,i),new fe(l,i)],y=new Ft(d,null,0,v,pe.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&y.putAllMetadata(p),y}decodeMiddle(i,o,c){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let l=i.getSize(),d=o[1],p=0;for(let y=0;y<5&&d=10&&(p|=1<<4-y),y!==4&&(d=i.getNextSet(d),d=i.getNextUnset(d))}if(c.length!==5)throw new X;let v=this.determineCheckDigit(p);if(_n.extensionChecksum(c.toString())!==v)throw new X;return d}static extensionChecksum(i){let o=i.length,c=0;for(let u=o-2;u>=0;u-=2)c+=i.charAt(u).charCodeAt(0)-48;c*=3;for(let u=o-1;u>=0;u-=2)c+=i.charAt(u).charCodeAt(0)-48;return c*=3,c%10}determineCheckDigit(i){for(let o=0;o<10;o++)if(i===this.CHECK_DIGIT_ENCODINGS[o])return o;throw new X}static parseExtensionString(i){if(i.length!==5)return null;let o=_n.parseExtension5String(i);return o==null?null:new Map([[wt.SUGGESTED_PRICE,o]])}static parseExtension5String(i){let o;switch(i.charAt(0)){case"0":o="ยฃ";break;case"5":o="$";break;case"9":switch(i){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}o="";break;default:o="";break}let c=parseInt(i.substring(1)),u=(c/100).toString(),l=c%100,d=l<10?"0"+l:l.toString();return o+u+"."+d}}class mi{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(i,o,c){let u=this.decodeRowStringBuffer,l=this.decodeMiddle(o,c,u),d=u.toString(),p=mi.parseExtensionString(d),v=[new fe((c[0]+c[1])/2,i),new fe(l,i)],y=new Ft(d,null,0,v,pe.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&y.putAllMetadata(p),y}decodeMiddle(i,o,c){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let l=i.getSize(),d=o[1],p=0;for(let v=0;v<2&&d=10&&(p|=1<<1-v),v!==1&&(d=i.getNextSet(d),d=i.getNextUnset(d))}if(c.length!==2)throw new X;if(parseInt(c.toString())%4!==p)throw new X;return d}static parseExtensionString(i){return i.length!==2?null:new Map([[wt.ISSUE_NUMBER,parseInt(i)]])}}class Na{static decodeRow(i,o,c){let u=nt.findGuardPattern(o,c,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new _n().decodeRow(i,o,u)}catch{return new mi().decodeRow(i,o,u)}}}Na.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class Pe extends nt{constructor(){super(),this.decodeRowStringBuffer="",Pe.L_AND_G_PATTERNS=Pe.L_PATTERNS.map(i=>Int32Array.from(i));for(let i=10;i<20;i++){let o=Pe.L_PATTERNS[i-10],c=new Int32Array(o.length);for(let u=0;u=o.getSize()||!o.isRange(_,I,!1))throw new X;let S=v.toString();if(S.length<8)throw new U;if(!Pe.checkChecksum(S))throw new C;let R=(u[1]+u[0])/2,M=(y[1]+y[0])/2,B=this.getBarcodeFormat(),V=[new fe(R,i),new fe(M,i)],z=new Ft(S,null,0,V,B,new Date().getTime()),ee=0;try{let J=Na.decodeRow(i,o,y[1]);z.putMetadata(wt.UPC_EAN_EXTENSION,J.getText()),z.putAllMetadata(J.getResultMetadata()),z.addResultPoints(J.getResultPoints()),ee=J.getText().length}catch{}let te=c==null?null:c.get(K.ALLOWED_EAN_EXTENSIONS);if(te!=null){let J=!1;for(let Se in te)if(ee.toString()===Se){J=!0;break}if(!J)throw new X}return z}decodeEnd(i,o){return Pe.findGuardPattern(i,o,!1,Pe.START_END_PATTERN,new Int32Array(Pe.START_END_PATTERN.length).fill(0))}static checkChecksum(i){return Pe.checkStandardUPCEANChecksum(i)}static checkStandardUPCEANChecksum(i){let o=i.length;if(o===0)return!1;let c=parseInt(i.charAt(o-1),10);return Pe.getStandardUPCEANChecksum(i.substring(0,o-1))===c}static getStandardUPCEANChecksum(i){let o=i.length,c=0;for(let u=o-1;u>=0;u-=2){let l=i.charAt(u).charCodeAt(0)-48;if(l<0||l>9)throw new U;c+=l}c*=3;for(let u=o-2;u>=0;u-=2){let l=i.charAt(u).charCodeAt(0)-48;if(l<0||l>9)throw new U;c+=l}return(1e3-c)%10}}class zr extends Pe{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(i,o,c){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let l=i.getSize(),d=o[1],p=0;for(let y=0;y<6&&d=10&&(p|=1<<5-y)}c=zr.determineFirstDigit(c,p),d=Pe.findGuardPattern(i,d,!0,Pe.MIDDLE_PATTERN,new Int32Array(Pe.MIDDLE_PATTERN.length).fill(0))[1];for(let y=0;y<6&&dy);u[0]=0,u[1]=0,u[2]=0,u[3]=0;const l=i.getSize();let d=o[1],p=0;for(let y=0;y<6&&d=10&&(p|=1<<5-y)}let v=dr.determineNumSysAndCheckDigit(c,p);return{rowOffset:d,resultString:v}}decodeEnd(i,o){return dr.findGuardPatternWithoutCounters(i,o,!0,dr.MIDDLE_END_PATTERN)}checkChecksum(i){return Pe.checkChecksum(dr.convertUPCEtoUPCA(i))}static determineNumSysAndCheckDigit(i,o){for(let c=0;c<=1;c++)for(let u=0;u<10;u++)if(o===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[c][u]){let l=String.fromCharCode(48+c),d=String.fromCharCode(48+u);return l+i+d}throw X.getNotFoundInstance()}getBarcodeFormat(){return pe.UPC_E}static convertUPCEtoUPCA(i){const o=i.slice(1,7).split("").map(l=>l.charCodeAt(0)),c=new ne;c.append(i.charAt(0));let u=o[5];switch(u){case 0:case 1:case 2:c.appendChars(o,0,2),c.append(u),c.append("0000"),c.appendChars(o,2,3);break;case 3:c.appendChars(o,0,3),c.append("00000"),c.appendChars(o,3,2);break;case 4:c.appendChars(o,0,4),c.append("00000"),c.append(o[4]);break;default:c.appendChars(o,0,5),c.append("0000"),c.append(u);break}return i.length>=8&&c.append(i.charAt(7)),c.toString()}}dr.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),dr.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,26])];class Ii extends ct{constructor(i){super();let o=i==null?null:i.get(K.POSSIBLE_FORMATS),c=[];n(o)?(c.push(new zr),c.push(new Da),c.push(new Ra),c.push(new dr)):(o.indexOf(pe.EAN_13)>-1&&c.push(new zr),o.indexOf(pe.UPC_A)>-1&&c.push(new Da),o.indexOf(pe.EAN_8)>-1&&c.push(new Ra),o.indexOf(pe.UPC_E)>-1&&c.push(new dr)),this.readers=c}decodeRow(i,o,c){for(let u of this.readers)try{const l=u.decodeRow(i,o,c),d=l.getBarcodeFormat()===pe.EAN_13&&l.getText().charAt(0)==="0",p=c==null?null:c.get(K.POSSIBLE_FORMATS),v=p==null||p.includes(pe.UPC_A);if(d&&v){const y=l.getRawBytes(),_=new Ft(l.getText().substring(1),y,y?y.length:null,l.getResultPoints(),pe.UPC_A);return _.putAllMetadata(l.getResultMetadata()),_}return l}catch{}throw new X}reset(){for(let i of this.readers)i.reset()}}class Dt extends ct{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(i,o){for(let c=0;cu&&(u=o[l],c=l);i[c]++}static decrement(i,o){let c=0,u=o[0];for(let l=1;l=Dt.MIN_FINDER_PATTERN_RATIO&&u<=Dt.MAX_FINDER_PATTERN_RATIO){let l=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER;for(let p of i)p>d&&(d=p),p=p-v-1&&(_-=yr.combins(u-y-(p-v),p-v-2)),p-v-1>1){let I=0;for(let S=u-y-(p-v-2);S>o;S--)I+=yr.combins(u-y-S-1,p-v-3);_-=I*(p-1-v)}else u-y>o&&_--;l+=_}u-=y}return l}static combins(i,o){let c,u;i-o>o?(u=o,c=i-o):(u=i-o,c=o);let l=1,d=1;for(let p=i;p>c;p--)l*=p,d<=u&&(l/=d,d++);for(;d<=u;)l/=d,d++;return l}}class u1{static buildBitArray(i){let o=i.length*2-1;i[i.length-1].getRightChar()==null&&(o-=1);let c=12*o,u=new k(c),l=0,p=i[0].getRightChar().getValue();for(let v=11;v>=0;--v)(p&1<=0;--I)(_&1<=0;--S)(I&1<10||c<0||c>10)throw new U;this.firstDigit=o,this.secondDigit=c}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===ir.FNC1}isSecondDigitFNC1(){return this.secondDigit===ir.FNC1}isAnyFNC1(){return this.firstDigit===ir.FNC1||this.secondDigit===ir.FNC1}}ir.FNC1=10;class ae{constructor(){}static parseFieldsInGeneralPurpose(i){if(!i)return null;if(i.length<2)throw new X;let o=i.substring(0,2);for(let l of ae.TWO_DIGIT_DATA_LENGTH)if(l[0]===o)return l[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(2,l[2],i):ae.processFixedAI(2,l[1],i);if(i.length<3)throw new X;let c=i.substring(0,3);for(let l of ae.THREE_DIGIT_DATA_LENGTH)if(l[0]===c)return l[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(3,l[2],i):ae.processFixedAI(3,l[1],i);for(let l of ae.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(l[0]===c)return l[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(4,l[2],i):ae.processFixedAI(4,l[1],i);if(i.length<4)throw new X;let u=i.substring(0,4);for(let l of ae.FOUR_DIGIT_DATA_LENGTH)if(l[0]===u)return l[1]===ae.VARIABLE_LENGTH?ae.processVariableAI(4,l[2],i):ae.processFixedAI(4,l[1],i);throw new X}static processFixedAI(i,o,c){if(c.lengththis.information.getSize())return i+4<=this.information.getSize();for(let o=i;othis.information.getSize()){let l=this.extractNumericValueFromBitArray(i,4);return l===0?new ir(this.information.getSize(),ir.FNC1,ir.FNC1):new ir(this.information.getSize(),l-1,ir.FNC1)}let o=this.extractNumericValueFromBitArray(i,7),c=(o-8)/11,u=(o-8)%11;return new ir(i+7,c,u)}extractNumericValueFromBitArray(i,o){return on.extractNumericValueFromBitArray(this.information,i,o)}static extractNumericValueFromBitArray(i,o,c){let u=0;for(let l=0;lthis.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(i,5);if(o>=5&&o<16)return!0;if(i+7>this.information.getSize())return!1;let c=this.extractNumericValueFromBitArray(i,7);if(c>=64&&c<116)return!0;if(i+8>this.information.getSize())return!1;let u=this.extractNumericValueFromBitArray(i,8);return u>=232&&u<253}decodeIsoIec646(i){let o=this.extractNumericValueFromBitArray(i,5);if(o===15)return new zt(i+5,zt.FNC1);if(o>=5&&o<15)return new zt(i+5,"0"+(o-5));let c=this.extractNumericValueFromBitArray(i,7);if(c>=64&&c<90)return new zt(i+7,""+(c+1));if(c>=90&&c<116)return new zt(i+7,""+(c+7));let u=this.extractNumericValueFromBitArray(i,8),l;switch(u){case 232:l="!";break;case 233:l='"';break;case 234:l="%";break;case 235:l="&";break;case 236:l="'";break;case 237:l="(";break;case 238:l=")";break;case 239:l="*";break;case 240:l="+";break;case 241:l=",";break;case 242:l="-";break;case 243:l=".";break;case 244:l="/";break;case 245:l=":";break;case 246:l=";";break;case 247:l="<";break;case 248:l="=";break;case 249:l=">";break;case 250:l="?";break;case 251:l="_";break;case 252:l=" ";break;default:throw new U}return new zt(i+8,l)}isStillAlpha(i){if(i+5>this.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(i,5);if(o>=5&&o<16)return!0;if(i+6>this.information.getSize())return!1;let c=this.extractNumericValueFromBitArray(i,6);return c>=16&&c<63}decodeAlphanumeric(i){let o=this.extractNumericValueFromBitArray(i,5);if(o===15)return new zt(i+5,zt.FNC1);if(o>=5&&o<15)return new zt(i+5,"0"+(o-5));let c=this.extractNumericValueFromBitArray(i,6);if(c>=32&&c<58)return new zt(i+6,""+(c+33));let u;switch(c){case 58:u="*";break;case 59:u=",";break;case 60:u="-";break;case 61:u=".";break;case 62:u="/";break;default:throw new Ar("Decoding invalid alphanumeric value: "+c)}return new zt(i+6,u)}isAlphaTo646ToAlphaLatch(i){if(i+1>this.information.getSize())return!1;for(let o=0;o<5&&o+ithis.information.getSize())return!1;for(let o=i;othis.information.getSize())return!1;for(let o=0;o<4&&o+i{o.forEach(d=>{u.getLeftChar().getValue()===d.getLeftChar().getValue()&&u.getRightChar().getValue()===d.getRightChar().getValue()&&u.getFinderPatter().getValue()===d.getFinderPatter().getValue()&&(c=!0)})}),c}}class Q extends Dt{constructor(i){super(...arguments),this.pairs=new Array(Q.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=i===!0}decodeRow(i,o,c){this.pairs.length=0,this.startFromEven=!1;try{return Q.constructResult(this.decodeRow2pairs(i,o))}catch(u){this.verbose&&console.log(u)}return this.pairs.length=0,this.startFromEven=!0,Q.constructResult(this.decodeRow2pairs(i,o))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(i,o){let c=!1;for(;!c;)try{this.pairs.push(this.retrieveNextPair(o,this.pairs,i))}catch(l){if(l instanceof X){if(!this.pairs.length)throw new X;c=!0}}if(this.checkChecksum())return this.pairs;let u;if(this.rows.length?u=!0:u=!1,this.storeRow(i,!1),u){let l=this.checkRowsBoolean(!1);if(l!=null||(l=this.checkRowsBoolean(!0),l!=null))return l}throw new X}checkRowsBoolean(i){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,i&&(this.rows=this.rows.reverse());let o=null;try{o=this.checkRows(new Array,0)}catch(c){this.verbose&&console.log(c)}return i&&(this.rows=this.rows.reverse()),o}checkRows(i,o){for(let c=o;co.length)continue;let c=!0;for(let u=0;ui){l=d.isEquivalent(this.pairs);break}u=d.isEquivalent(this.pairs),c++}l||u||Q.isPartialRow(this.pairs,this.rows)||(this.rows.push(c,new Ti(this.pairs,i,o)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(i,o){for(let c of o)if(c.getPairs().length!==i.length){for(let u of c.getPairs())for(let l of i)if(Mr.equals(u,l))break}}static isPartialRow(i,o){for(let c of o){let u=!0;for(let l of i){let d=!1;for(let p of c.getPairs())if(l.equals(p)){d=!0;break}if(!d){u=!1;break}}if(u)return!0}return!1}getRows(){return this.rows}static constructResult(i){let o=u1.buildBitArray(i),u=Ma(o).parseInformation(),l=i[0].getFinderPattern().getResultPoints(),d=i[i.length-1].getFinderPattern().getResultPoints(),p=[l[0],l[1],d[0],d[1]];return new Ft(u,null,null,p,pe.RSS_EXPANDED,null)}checkChecksum(){let i=this.pairs.get(0),o=i.getLeftChar(),c=i.getRightChar();if(c==null)return!1;let u=c.getChecksumPortion(),l=2;for(let p=1;p=0?d=c:this.isEmptyPair(o)?d=0:d=o[o.length-1].getFinderPattern().getStartEnd()[1];let p=o.length%2!=0;this.startFromEven&&(p=!p);let v=!1;for(;d=0&&!i.get(y);)y--;y++,u=this.startEnd[0]-y,l=y,d=this.startEnd[1]}else l=this.startEnd[0],d=i.getNextUnset(this.startEnd[1]+1),u=d-this.startEnd[1];let p=this.getDecodeFinderCounters();T.arraycopy(p,0,p,1,p.length-1),p[0]=u;let v;try{v=this.parseFinderValue(p,Q.FINDER_PATTERNS)}catch{return null}return new Yn(v,[l,d],l,d,o)}decodeDataCharacter(i,o,c,u){let l=this.getDataCharacterCounters();for(let Ye=0;Ye.3)throw new X;let y=this.getOddCounts(),_=this.getEvenCounts(),I=this.getOddRoundingErrors(),S=this.getEvenRoundingErrors();for(let Ye=0;Ye8){if(Tt>8.7)throw new X;er=8}let hn=Ye/2;(Ye&1)==0?(y[hn]=er,I[hn]=Tt-er):(_[hn]=er,S[hn]=Tt-er)}this.adjustOddEvenCounts(d);let R=4*o.getValue()+(c?0:2)+(u?0:1)-1,M=0,B=0;for(let Ye=y.length-1;Ye>=0;Ye--){if(Q.isNotA1left(o,c,u)){let Tt=Q.WEIGHTS[R][2*Ye];B+=y[Ye]*Tt}M+=y[Ye]}let V=0;for(let Ye=_.length-1;Ye>=0;Ye--)if(Q.isNotA1left(o,c,u)){let Tt=Q.WEIGHTS[R][2*Ye+1];V+=_[Ye]*Tt}let z=B+V;if((M&1)!=0||M>13||M<4)throw new X;let ee=(13-M)/2,te=Q.SYMBOL_WIDEST[ee],J=9-te,Se=yr.getRSSvalue(y,te,!0),Ae=yr.getRSSvalue(_,J,!1),jt=Q.EVEN_TOTAL_SUBSET[ee],xr=Q.GSUM[ee],Kt=Se*jt+Ae+xr;return new an(Kt,z)}static isNotA1left(i,o,c){return!(i.getValue()==0&&o&&c)}adjustOddEvenCounts(i){let o=Oe.sum(new Int32Array(this.getOddCounts())),c=Oe.sum(new Int32Array(this.getEvenCounts())),u=!1,l=!1;o>13?l=!0:o<4&&(u=!0);let d=!1,p=!1;c>13?p=!0:c<4&&(d=!0);let v=o+c-i,y=(o&1)==1,_=(c&1)==0;if(v==1)if(y){if(_)throw new X;l=!0}else{if(!_)throw new X;p=!0}else if(v==-1)if(y){if(_)throw new X;u=!0}else{if(!_)throw new X;d=!0}else if(v==0){if(y){if(!_)throw new X;o1){for(let p of this.possibleRightPairs)if(p.getCount()>1&&it.checkChecksum(d,p))return it.constructResult(d,p)}throw new X}static addOrTally(i,o){if(o==null)return;let c=!1;for(let u of i)if(u.getValue()===o.getValue()){u.incrementCount(),c=!0;break}c||i.push(o)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(i,o){let c=4537077*i.getValue()+o.getValue(),u=new String(c).toString(),l=new ne;for(let y=13-u.length;y>0;y--)l.append("0");l.append(u);let d=0;for(let y=0;y<13;y++){let _=l.charAt(y).charCodeAt(0)-48;d+=(y&1)===0?3*_:_}d=10-d%10,d===10&&(d=0),l.append(d.toString());let p=i.getFinderPattern().getResultPoints(),v=o.getFinderPattern().getResultPoints();return new Ft(l.toString(),null,0,[p[0],p[1],v[0],v[1]],pe.RSS_14,new Date().getTime())}static checkChecksum(i,o){let c=(i.getChecksumPortion()+16*o.getChecksumPortion())%79,u=9*i.getFinderPattern().getValue()+o.getFinderPattern().getValue();return u>72&&u--,u>8&&u--,c===u}decodePair(i,o,c,u){try{let l=this.findFinderPattern(i,o),d=this.parseFoundFinderPattern(i,c,o,l),p=u==null?null:u.get(K.NEED_RESULT_POINT_CALLBACK);if(p!=null){let _=(l[0]+l[1])/2;o&&(_=i.getSize()-1-_),p.foundPossibleResultPoint(new fe(_,c))}let v=this.decodeDataCharacter(i,d,!0),y=this.decodeDataCharacter(i,d,!1);return new d1(1597*v.getValue()+y.getValue(),v.getChecksumPortion()+4*y.getChecksumPortion(),d)}catch{return null}}decodeDataCharacter(i,o,c){let u=this.getDataCharacterCounters();for(let V=0;V8&&(ee=8);let te=Math.floor(V/2);(V&1)===0?(p[te]=ee,y[te]=z-ee):(v[te]=ee,_[te]=z-ee)}this.adjustOddEvenCounts(c,l);let I=0,S=0;for(let V=p.length-1;V>=0;V--)S*=9,S+=p[V],I+=p[V];let R=0,M=0;for(let V=v.length-1;V>=0;V--)R*=9,R+=v[V],M+=v[V];let B=S+3*R;if(c){if((I&1)!==0||I>12||I<4)throw new X;let V=(12-I)/2,z=it.OUTSIDE_ODD_WIDEST[V],ee=9-z,te=yr.getRSSvalue(p,z,!1),J=yr.getRSSvalue(v,ee,!0),Se=it.OUTSIDE_EVEN_TOTAL_SUBSET[V],Ae=it.OUTSIDE_GSUM[V];return new an(te*Se+J+Ae,B)}else{if((M&1)!==0||M>10||M<4)throw new X;let V=(10-M)/2,z=it.INSIDE_ODD_WIDEST[V],ee=9-z,te=yr.getRSSvalue(p,z,!0),J=yr.getRSSvalue(v,ee,!1),Se=it.INSIDE_ODD_TOTAL_SUBSET[V],Ae=it.INSIDE_GSUM[V];return new an(J*Se+te+Ae,B)}}findFinderPattern(i,o){let c=this.getDecodeFinderCounters();c[0]=0,c[1]=0,c[2]=0,c[3]=0;let u=i.getSize(),l=!1,d=0;for(;d=0&&l!==i.get(d);)d--;d++;const p=u[0]-d,v=this.getDecodeFinderCounters(),y=new Int32Array(v.length);T.arraycopy(v,0,y,1,v.length-1),y[0]=p;const _=this.parseFinderValue(y,it.FINDER_PATTERNS);let I=d,S=u[1];return c&&(I=i.getSize()-1-I,S=i.getSize()-1-S),new Yn(_,[d,u[1]],I,S,o)}adjustOddEvenCounts(i,o){let c=Oe.sum(new Int32Array(this.getOddCounts())),u=Oe.sum(new Int32Array(this.getEvenCounts())),l=!1,d=!1,p=!1,v=!1;i?(c>12?d=!0:c<4&&(l=!0),u>12?v=!0:u<4&&(p=!0)):(c>11?d=!0:c<5&&(l=!0),u>10?v=!0:u<4&&(p=!0));let y=c+u-o,_=(c&1)===(i?1:0),I=(u&1)===1;if(y===1)if(_){if(I)throw new X;d=!0}else{if(!I)throw new X;v=!0}else if(y===-1)if(_){if(I)throw new X;l=!0}else{if(!I)throw new X;p=!0}else if(y===0){if(_){if(!I)throw new X;ci.reset())}}class x1 extends Wr{constructor(i=500,o){super(new cn(o),i,o)}}class ke{constructor(i,o,c){this.ecCodewords=i,this.ecBlocks=[o],c&&this.ecBlocks.push(c)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class Be{constructor(i,o){this.count=i,this.dataCodewords=o}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class be{constructor(i,o,c,u,l,d){this.versionNumber=i,this.symbolSizeRows=o,this.symbolSizeColumns=c,this.dataRegionSizeRows=u,this.dataRegionSizeColumns=l,this.ecBlocks=d;let p=0;const v=d.getECCodewords(),y=d.getECBlocks();for(let _ of y)p+=_.getCount()*(_.getDataCodewords()+v);this.totalCodewords=p}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(i,o){if((i&1)!==0||(o&1)!==0)throw new U;for(let c of be.VERSIONS)if(c.symbolSizeRows===i&&c.symbolSizeColumns===o)return c;throw new U}toString(){return""+this.versionNumber}static buildVersions(){return[new be(1,10,10,8,8,new ke(5,new Be(1,3))),new be(2,12,12,10,10,new ke(7,new Be(1,5))),new be(3,14,14,12,12,new ke(10,new Be(1,8))),new be(4,16,16,14,14,new ke(12,new Be(1,12))),new be(5,18,18,16,16,new ke(14,new Be(1,18))),new be(6,20,20,18,18,new ke(18,new Be(1,22))),new be(7,22,22,20,20,new ke(20,new Be(1,30))),new be(8,24,24,22,22,new ke(24,new Be(1,36))),new be(9,26,26,24,24,new ke(28,new Be(1,44))),new be(10,32,32,14,14,new ke(36,new Be(1,62))),new be(11,36,36,16,16,new ke(42,new Be(1,86))),new be(12,40,40,18,18,new ke(48,new Be(1,114))),new be(13,44,44,20,20,new ke(56,new Be(1,144))),new be(14,48,48,22,22,new ke(68,new Be(1,174))),new be(15,52,52,24,24,new ke(42,new Be(2,102))),new be(16,64,64,14,14,new ke(56,new Be(2,140))),new be(17,72,72,16,16,new ke(36,new Be(4,92))),new be(18,80,80,18,18,new ke(48,new Be(4,114))),new be(19,88,88,20,20,new ke(56,new Be(4,144))),new be(20,96,96,22,22,new ke(68,new Be(4,174))),new be(21,104,104,24,24,new ke(56,new Be(6,136))),new be(22,120,120,18,18,new ke(68,new Be(6,175))),new be(23,132,132,20,20,new ke(62,new Be(8,163))),new be(24,144,144,22,22,new ke(62,new Be(8,156),new Be(2,155))),new be(25,8,18,6,16,new ke(7,new Be(1,5))),new be(26,8,32,6,14,new ke(11,new Be(1,10))),new be(27,12,26,10,24,new ke(14,new Be(1,16))),new be(28,12,36,10,16,new ke(18,new Be(1,22))),new be(29,16,36,14,16,new ke(24,new Be(1,32))),new be(30,16,48,14,22,new ke(28,new Be(1,49)))]}}be.VERSIONS=be.buildVersions();class Oi{constructor(i){const o=i.getHeight();if(o<8||o>144||(o&1)!==0)throw new U;this.version=Oi.readVersion(i),this.mappingBitMatrix=this.extractDataRegion(i),this.readMappingMatrix=new le(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(i){const o=i.getHeight(),c=i.getWidth();return be.getVersionForDimensions(o,c)}readCodewords(){const i=new Int8Array(this.version.getTotalCodewords());let o=0,c=4,u=0;const l=this.mappingBitMatrix.getHeight(),d=this.mappingBitMatrix.getWidth();let p=!1,v=!1,y=!1,_=!1;do if(c===l&&u===0&&!p)i[o++]=this.readCorner1(l,d)&255,c-=2,u+=2,p=!0;else if(c===l-2&&u===0&&(d&3)!==0&&!v)i[o++]=this.readCorner2(l,d)&255,c-=2,u+=2,v=!0;else if(c===l+4&&u===2&&(d&7)===0&&!y)i[o++]=this.readCorner3(l,d)&255,c-=2,u+=2,y=!0;else if(c===l-2&&u===0&&(d&7)===4&&!_)i[o++]=this.readCorner4(l,d)&255,c-=2,u+=2,_=!0;else{do c=0&&!this.readMappingMatrix.get(u,c)&&(i[o++]=this.readUtah(c,u,l,d)&255),c-=2,u+=2;while(c>=0&&u=0&&u=0);c+=3,u+=1}while(c7?B-1:B;d[z].codewords[ee]=i[I++]}if(I!==i.length)throw new A;return d}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class Ri{constructor(i){this.bytes=i,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(i){if(i<1||i>32||i>this.available())throw new A(""+i);let o=0,c=this.bitOffset,u=this.byteOffset;const l=this.bytes;if(c>0){const d=8-c,p=i>8-p<>v,i-=p,c+=p,c===8&&(c=0,u++)}if(i>0){for(;i>=8;)o=o<<8|l[u]&255,u++,i-=8;if(i>0){const d=8-i,p=255>>d<>d,c+=i}}return this.bitOffset=c,this.byteOffset=u,o}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var ut;(function(m){m[m.PAD_ENCODE=0]="PAD_ENCODE",m[m.ASCII_ENCODE=1]="ASCII_ENCODE",m[m.C40_ENCODE=2]="C40_ENCODE",m[m.TEXT_ENCODE=3]="TEXT_ENCODE",m[m.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",m[m.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",m[m.BASE256_ENCODE=6]="BASE256_ENCODE"})(ut||(ut={}));class Pr{static decode(i){const o=new Ri(i),c=new ne,u=new ne,l=new Array;let d=ut.ASCII_ENCODE;do if(d===ut.ASCII_ENCODE)d=this.decodeAsciiSegment(o,c,u);else{switch(d){case ut.C40_ENCODE:this.decodeC40Segment(o,c);break;case ut.TEXT_ENCODE:this.decodeTextSegment(o,c);break;case ut.ANSIX12_ENCODE:this.decodeAnsiX12Segment(o,c);break;case ut.EDIFACT_ENCODE:this.decodeEdifactSegment(o,c);break;case ut.BASE256_ENCODE:this.decodeBase256Segment(o,c,l);break;default:throw new U}d=ut.ASCII_ENCODE}while(d!==ut.PAD_ENCODE&&o.available()>0);return u.length()>0&&c.append(u.toString()),new yn(i,c.toString(),l.length===0?null:l,null)}static decodeAsciiSegment(i,o,c){let u=!1;do{let l=i.readBits(8);if(l===0)throw new U;if(l<=128)return u&&(l+=128),o.append(String.fromCharCode(l-1)),ut.ASCII_ENCODE;if(l===129)return ut.PAD_ENCODE;if(l<=229){const d=l-130;d<10&&o.append("0"),o.append(""+d)}else switch(l){case 230:return ut.C40_ENCODE;case 231:return ut.BASE256_ENCODE;case 232:o.append("");break;case 233:case 234:break;case 235:u=!0;break;case 236:o.append("[)>05"),c.insert(0,"");break;case 237:o.append("[)>06"),c.insert(0,"");break;case 238:return ut.ANSIX12_ENCODE;case 239:return ut.TEXT_ENCODE;case 240:return ut.EDIFACT_ENCODE;case 241:break;default:if(l!==254||i.available()!==0)throw new U;break}}while(i.available()>0);return ut.ASCII_ENCODE}static decodeC40Segment(i,o){let c=!1;const u=[];let l=0;do{if(i.available()===8)return;const d=i.readBits(8);if(d===254)return;this.parseTwoBytes(d,i.readBits(8),u);for(let p=0;p<3;p++){const v=u[p];switch(l){case 0:if(v<3)l=v+1;else if(v0)}static decodeTextSegment(i,o){let c=!1,u=[],l=0;do{if(i.available()===8)return;const d=i.readBits(8);if(d===254)return;this.parseTwoBytes(d,i.readBits(8),u);for(let p=0;p<3;p++){const v=u[p];switch(l){case 0:if(v<3)l=v+1;else if(v0)}static decodeAnsiX12Segment(i,o){const c=[];do{if(i.available()===8)return;const u=i.readBits(8);if(u===254)return;this.parseTwoBytes(u,i.readBits(8),c);for(let l=0;l<3;l++){const d=c[l];switch(d){case 0:o.append("\r");break;case 1:o.append("*");break;case 2:o.append(">");break;case 3:o.append(" ");break;default:if(d<14)o.append(String.fromCharCode(d+44));else if(d<40)o.append(String.fromCharCode(d+51));else throw new U;break}}}while(i.available()>0)}static parseTwoBytes(i,o,c){let u=(i<<8)+o-1,l=Math.floor(u/1600);c[0]=l,u-=l*1600,l=Math.floor(u/40),c[1]=l,c[2]=u-l*40}static decodeEdifactSegment(i,o){do{if(i.available()<=16)return;for(let c=0;c<4;c++){let u=i.readBits(6);if(u===31){const l=8-i.getBitOffset();l!==8&&i.readBits(l);return}(u&32)===0&&(u|=64),o.append(String.fromCharCode(u))}}while(i.available()>0)}static decodeBase256Segment(i,o,c){let u=1+i.getByteOffset();const l=this.unrandomize255State(i.readBits(8),u++);let d;if(l===0?d=i.available()/8|0:l<250?d=l:d=250*(l-249)+this.unrandomize255State(i.readBits(8),u++),d<0)throw new U;const p=new Uint8Array(d);for(let v=0;v=0?u:u+256}}Pr.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"],Pr.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],Pr.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"],Pr.TEXT_SHIFT2_SET_CHARS=Pr.C40_SHIFT2_SET_CHARS,Pr.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","{","|","}","~",""];class g1{constructor(){this.rsDecoder=new Cn(Me.DATA_MATRIX_FIELD_256)}decode(i){const o=new Oi(i),c=o.getVersion(),u=o.readCodewords(),l=Ni.getDataBlocks(u,c);let d=0;for(let y of l)d+=y.getNumDataCodewords();const p=new Uint8Array(d),v=l.length;for(let y=0;yp&&(_=p,I[0]=o,I[1]=c,I[2]=u,I[3]=l),_>v&&(_=v,I[0]=c,I[1]=u,I[2]=l,I[3]=o),_>y&&(I[0]=u,I[1]=l,I[2]=o,I[3]=c),I}detectSolid2(i){let o=i[0],c=i[1],u=i[2],l=i[3],d=this.transitionsBetween(o,l),p=st.shiftPoint(c,u,(d+1)*4),v=st.shiftPoint(u,c,(d+1)*4),y=this.transitionsBetween(p,o),_=this.transitionsBetween(v,l);return y<_?(i[0]=o,i[1]=c,i[2]=u,i[3]=l):(i[0]=c,i[1]=u,i[2]=l,i[3]=o),i}correctTopRight(i){let o=i[0],c=i[1],u=i[2],l=i[3],d=this.transitionsBetween(o,l),p=this.transitionsBetween(c,l),v=st.shiftPoint(o,c,(p+1)*4),y=st.shiftPoint(u,c,(d+1)*4);d=this.transitionsBetween(v,l),p=this.transitionsBetween(y,l);let _=new fe(l.getX()+(u.getX()-c.getX())/(d+1),l.getY()+(u.getY()-c.getY())/(d+1)),I=new fe(l.getX()+(o.getX()-c.getX())/(p+1),l.getY()+(o.getY()-c.getY())/(p+1));if(!this.isValid(_))return this.isValid(I)?I:null;if(!this.isValid(I))return _;let S=this.transitionsBetween(v,_)+this.transitionsBetween(y,_),R=this.transitionsBetween(v,I)+this.transitionsBetween(y,I);return S>R?_:I}shiftToModuleCenter(i){let o=i[0],c=i[1],u=i[2],l=i[3],d=this.transitionsBetween(o,l)+1,p=this.transitionsBetween(u,l)+1,v=st.shiftPoint(o,c,p*4),y=st.shiftPoint(u,c,d*4);d=this.transitionsBetween(v,l)+1,p=this.transitionsBetween(y,l)+1,(d&1)===1&&(d+=1),(p&1)===1&&(p+=1);let _=(o.getX()+c.getX()+u.getX()+l.getX())/4,I=(o.getY()+c.getY()+u.getY()+l.getY())/4;o=st.moveAway(o,_,I),c=st.moveAway(c,_,I),u=st.moveAway(u,_,I),l=st.moveAway(l,_,I);let S,R;return v=st.shiftPoint(o,c,p*4),v=st.shiftPoint(v,l,d*4),S=st.shiftPoint(c,o,p*4),S=st.shiftPoint(S,u,d*4),y=st.shiftPoint(u,l,p*4),y=st.shiftPoint(y,c,d*4),R=st.shiftPoint(l,u,p*4),R=st.shiftPoint(R,o,d*4),[v,S,y,R]}isValid(i){return i.getX()>=0&&i.getX()0&&i.getY()Math.abs(l-c);if(p){let B=c;c=u,u=B,B=l,l=d,d=B}let v=Math.abs(l-c),y=Math.abs(d-u),_=-v/2,I=u0){if(V===d)break;V+=I,_-=v}}return R}}class Br{constructor(){this.decoder=new g1}decode(i,o=null){let c,u;if(o!=null&&o.has(K.PURE_BARCODE)){const y=Br.extractPureBits(i.getBlackMatrix());c=this.decoder.decode(y),u=Br.NO_POINTS}else{const y=new st(i.getBlackMatrix()).detect();c=this.decoder.decode(y.getBits()),u=y.getPoints()}const l=c.getRawBytes(),d=new Ft(c.getText(),l,8*l.length,u,pe.DATA_MATRIX,T.currentTimeMillis()),p=c.getByteSegments();p!=null&&d.putMetadata(wt.BYTE_SEGMENTS,p);const v=c.getECLevel();return v!=null&&d.putMetadata(wt.ERROR_CORRECTION_LEVEL,v),d}reset(){}static extractPureBits(i){const o=i.getTopLeftOnBit(),c=i.getBottomRightOnBit();if(o==null||c==null)throw new X;const u=this.moduleSize(o,i);let l=o[1];const d=c[1];let p=o[0];const y=(c[0]-p+1)/u,_=(d-l+1)/u;if(y<=0||_<=0)throw new X;const I=u/2;l+=I,p+=I;const S=new le(y,_);for(let R=0;R<_;R++){const M=l+R*u;for(let B=0;B=je.FOR_BITS.size)throw new A;return je.FOR_BITS.get(i)}}je.FOR_BITS=new Map,je.FOR_VALUE=new Map,je.L=new je(fn.L,"L",1),je.M=new je(fn.M,"M",0),je.Q=new je(fn.Q,"Q",3),je.H=new je(fn.H,"H",2);class Mt{constructor(i){this.errorCorrectionLevel=je.forBits(i>>3&3),this.dataMask=i&7}static numBitsDiffering(i,o){return L.bitCount(i^o)}static decodeFormatInformation(i,o){const c=Mt.doDecodeFormatInformation(i,o);return c!==null?c:Mt.doDecodeFormatInformation(i^Mt.FORMAT_INFO_MASK_QR,o^Mt.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(i,o){let c=Number.MAX_SAFE_INTEGER,u=0;for(const l of Mt.FORMAT_INFO_DECODE_LOOKUP){const d=l[0];if(d===i||d===o)return new Mt(l[1]);let p=Mt.numBitsDiffering(i,d);p40)throw new A;return he.VERSIONS[i-1]}static decodeVersionInformation(i){let o=Number.MAX_SAFE_INTEGER,c=0;for(let u=0;u6&&(o.setRegion(i-11,0,3,6),o.setRegion(0,i-11,6,3)),o}toString(){return""+this.versionNumber}}he.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]),he.VERSIONS=[new he(1,new Int32Array(0),new H(7,new O(1,19)),new H(10,new O(1,16)),new H(13,new O(1,13)),new H(17,new O(1,9))),new he(2,Int32Array.from([6,18]),new H(10,new O(1,34)),new H(16,new O(1,28)),new H(22,new O(1,22)),new H(28,new O(1,16))),new he(3,Int32Array.from([6,22]),new H(15,new O(1,55)),new H(26,new O(1,44)),new H(18,new O(2,17)),new H(22,new O(2,13))),new he(4,Int32Array.from([6,26]),new H(20,new O(1,80)),new H(18,new O(2,32)),new H(26,new O(2,24)),new H(16,new O(4,9))),new he(5,Int32Array.from([6,30]),new H(26,new O(1,108)),new H(24,new O(2,43)),new H(18,new O(2,15),new O(2,16)),new H(22,new O(2,11),new O(2,12))),new he(6,Int32Array.from([6,34]),new H(18,new O(2,68)),new H(16,new O(4,27)),new H(24,new O(4,19)),new H(28,new O(4,15))),new he(7,Int32Array.from([6,22,38]),new H(20,new O(2,78)),new H(18,new O(4,31)),new H(18,new O(2,14),new O(4,15)),new H(26,new O(4,13),new O(1,14))),new he(8,Int32Array.from([6,24,42]),new H(24,new O(2,97)),new H(22,new O(2,38),new O(2,39)),new H(22,new O(4,18),new O(2,19)),new H(26,new O(4,14),new O(2,15))),new he(9,Int32Array.from([6,26,46]),new H(30,new O(2,116)),new H(22,new O(3,36),new O(2,37)),new H(20,new O(4,16),new O(4,17)),new H(24,new O(4,12),new O(4,13))),new he(10,Int32Array.from([6,28,50]),new H(18,new O(2,68),new O(2,69)),new H(26,new O(4,43),new O(1,44)),new H(24,new O(6,19),new O(2,20)),new H(28,new O(6,15),new O(2,16))),new he(11,Int32Array.from([6,30,54]),new H(20,new O(4,81)),new H(30,new O(1,50),new O(4,51)),new H(28,new O(4,22),new O(4,23)),new H(24,new O(3,12),new O(8,13))),new he(12,Int32Array.from([6,32,58]),new H(24,new O(2,92),new O(2,93)),new H(22,new O(6,36),new O(2,37)),new H(26,new O(4,20),new O(6,21)),new H(28,new O(7,14),new O(4,15))),new he(13,Int32Array.from([6,34,62]),new H(26,new O(4,107)),new H(22,new O(8,37),new O(1,38)),new H(24,new O(8,20),new O(4,21)),new H(22,new O(12,11),new O(4,12))),new he(14,Int32Array.from([6,26,46,66]),new H(30,new O(3,115),new O(1,116)),new H(24,new O(4,40),new O(5,41)),new H(20,new O(11,16),new O(5,17)),new H(24,new O(11,12),new O(5,13))),new he(15,Int32Array.from([6,26,48,70]),new H(22,new O(5,87),new O(1,88)),new H(24,new O(5,41),new O(5,42)),new H(30,new O(5,24),new O(7,25)),new H(24,new O(11,12),new O(7,13))),new he(16,Int32Array.from([6,26,50,74]),new H(24,new O(5,98),new O(1,99)),new H(28,new O(7,45),new O(3,46)),new H(24,new O(15,19),new O(2,20)),new H(30,new O(3,15),new O(13,16))),new he(17,Int32Array.from([6,30,54,78]),new H(28,new O(1,107),new O(5,108)),new H(28,new O(10,46),new O(1,47)),new H(28,new O(1,22),new O(15,23)),new H(28,new O(2,14),new O(17,15))),new he(18,Int32Array.from([6,30,56,82]),new H(30,new O(5,120),new O(1,121)),new H(26,new O(9,43),new O(4,44)),new H(28,new O(17,22),new O(1,23)),new H(28,new O(2,14),new O(19,15))),new he(19,Int32Array.from([6,30,58,86]),new H(28,new O(3,113),new O(4,114)),new H(26,new O(3,44),new O(11,45)),new H(26,new O(17,21),new O(4,22)),new H(26,new O(9,13),new O(16,14))),new he(20,Int32Array.from([6,34,62,90]),new H(28,new O(3,107),new O(5,108)),new H(26,new O(3,41),new O(13,42)),new H(30,new O(15,24),new O(5,25)),new H(28,new O(15,15),new O(10,16))),new he(21,Int32Array.from([6,28,50,72,94]),new H(28,new O(4,116),new O(4,117)),new H(26,new O(17,42)),new H(28,new O(17,22),new O(6,23)),new H(30,new O(19,16),new O(6,17))),new he(22,Int32Array.from([6,26,50,74,98]),new H(28,new O(2,111),new O(7,112)),new H(28,new O(17,46)),new H(30,new O(7,24),new O(16,25)),new H(24,new O(34,13))),new he(23,Int32Array.from([6,30,54,78,102]),new H(30,new O(4,121),new O(5,122)),new H(28,new O(4,47),new O(14,48)),new H(30,new O(11,24),new O(14,25)),new H(30,new O(16,15),new O(14,16))),new he(24,Int32Array.from([6,28,54,80,106]),new H(30,new O(6,117),new O(4,118)),new H(28,new O(6,45),new O(14,46)),new H(30,new O(11,24),new O(16,25)),new H(30,new O(30,16),new O(2,17))),new he(25,Int32Array.from([6,32,58,84,110]),new H(26,new O(8,106),new O(4,107)),new H(28,new O(8,47),new O(13,48)),new H(30,new O(7,24),new O(22,25)),new H(30,new O(22,15),new O(13,16))),new he(26,Int32Array.from([6,30,58,86,114]),new H(28,new O(10,114),new O(2,115)),new H(28,new O(19,46),new O(4,47)),new H(28,new O(28,22),new O(6,23)),new H(30,new O(33,16),new O(4,17))),new he(27,Int32Array.from([6,34,62,90,118]),new H(30,new O(8,122),new O(4,123)),new H(28,new O(22,45),new O(3,46)),new H(30,new O(8,23),new O(26,24)),new H(30,new O(12,15),new O(28,16))),new he(28,Int32Array.from([6,26,50,74,98,122]),new H(30,new O(3,117),new O(10,118)),new H(28,new O(3,45),new O(23,46)),new H(30,new O(4,24),new O(31,25)),new H(30,new O(11,15),new O(31,16))),new he(29,Int32Array.from([6,30,54,78,102,126]),new H(30,new O(7,116),new O(7,117)),new H(28,new O(21,45),new O(7,46)),new H(30,new O(1,23),new O(37,24)),new H(30,new O(19,15),new O(26,16))),new he(30,Int32Array.from([6,26,52,78,104,130]),new H(30,new O(5,115),new O(10,116)),new H(28,new O(19,47),new O(10,48)),new H(30,new O(15,24),new O(25,25)),new H(30,new O(23,15),new O(25,16))),new he(31,Int32Array.from([6,30,56,82,108,134]),new H(30,new O(13,115),new O(3,116)),new H(28,new O(2,46),new O(29,47)),new H(30,new O(42,24),new O(1,25)),new H(30,new O(23,15),new O(28,16))),new he(32,Int32Array.from([6,34,60,86,112,138]),new H(30,new O(17,115)),new H(28,new O(10,46),new O(23,47)),new H(30,new O(10,24),new O(35,25)),new H(30,new O(19,15),new O(35,16))),new he(33,Int32Array.from([6,30,58,86,114,142]),new H(30,new O(17,115),new O(1,116)),new H(28,new O(14,46),new O(21,47)),new H(30,new O(29,24),new O(19,25)),new H(30,new O(11,15),new O(46,16))),new he(34,Int32Array.from([6,34,62,90,118,146]),new H(30,new O(13,115),new O(6,116)),new H(28,new O(14,46),new O(23,47)),new H(30,new O(44,24),new O(7,25)),new H(30,new O(59,16),new O(1,17))),new he(35,Int32Array.from([6,30,54,78,102,126,150]),new H(30,new O(12,121),new O(7,122)),new H(28,new O(12,47),new O(26,48)),new H(30,new O(39,24),new O(14,25)),new H(30,new O(22,15),new O(41,16))),new he(36,Int32Array.from([6,24,50,76,102,128,154]),new H(30,new O(6,121),new O(14,122)),new H(28,new O(6,47),new O(34,48)),new H(30,new O(46,24),new O(10,25)),new H(30,new O(2,15),new O(64,16))),new he(37,Int32Array.from([6,28,54,80,106,132,158]),new H(30,new O(17,122),new O(4,123)),new H(28,new O(29,46),new O(14,47)),new H(30,new O(49,24),new O(10,25)),new H(30,new O(24,15),new O(46,16))),new he(38,Int32Array.from([6,32,58,84,110,136,162]),new H(30,new O(4,122),new O(18,123)),new H(28,new O(13,46),new O(32,47)),new H(30,new O(48,24),new O(14,25)),new H(30,new O(42,15),new O(32,16))),new he(39,Int32Array.from([6,26,54,82,110,138,166]),new H(30,new O(20,117),new O(4,118)),new H(28,new O(40,47),new O(7,48)),new H(30,new O(43,24),new O(22,25)),new H(30,new O(10,15),new O(67,16))),new he(40,Int32Array.from([6,30,58,86,114,142,170]),new H(30,new O(19,118),new O(6,119)),new H(28,new O(18,47),new O(31,48)),new H(30,new O(34,24),new O(34,25)),new H(30,new O(20,15),new O(61,16)))];var At;(function(m){m[m.DATA_MASK_000=0]="DATA_MASK_000",m[m.DATA_MASK_001=1]="DATA_MASK_001",m[m.DATA_MASK_010=2]="DATA_MASK_010",m[m.DATA_MASK_011=3]="DATA_MASK_011",m[m.DATA_MASK_100=4]="DATA_MASK_100",m[m.DATA_MASK_101=5]="DATA_MASK_101",m[m.DATA_MASK_110=6]="DATA_MASK_110",m[m.DATA_MASK_111=7]="DATA_MASK_111"})(At||(At={}));class ar{constructor(i,o){this.value=i,this.isMasked=o}unmaskBitMatrix(i,o){for(let c=0;c(m+i&1)===0)],[At.DATA_MASK_001,new ar(At.DATA_MASK_001,(m,i)=>(m&1)===0)],[At.DATA_MASK_010,new ar(At.DATA_MASK_010,(m,i)=>i%3===0)],[At.DATA_MASK_011,new ar(At.DATA_MASK_011,(m,i)=>(m+i)%3===0)],[At.DATA_MASK_100,new ar(At.DATA_MASK_100,(m,i)=>(Math.floor(m/2)+Math.floor(i/3)&1)===0)],[At.DATA_MASK_101,new ar(At.DATA_MASK_101,(m,i)=>m*i%6===0)],[At.DATA_MASK_110,new ar(At.DATA_MASK_110,(m,i)=>m*i%6<3)],[At.DATA_MASK_111,new ar(At.DATA_MASK_111,(m,i)=>(m+i+m*i%3&1)===0)]]);class v1{constructor(i){const o=i.getHeight();if(o<21||(o&3)!==1)throw new U;this.bitMatrix=i}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let i=0;for(let l=0;l<6;l++)i=this.copyBit(l,8,i);i=this.copyBit(7,8,i),i=this.copyBit(8,8,i),i=this.copyBit(8,7,i);for(let l=5;l>=0;l--)i=this.copyBit(8,l,i);const o=this.bitMatrix.getHeight();let c=0;const u=o-7;for(let l=o-1;l>=u;l--)c=this.copyBit(8,l,c);for(let l=o-8;l=0;d--)for(let p=i-9;p>=u;p--)c=this.copyBit(p,d,c);let l=he.decodeVersionInformation(c);if(l!==null&&l.getDimensionForVersion()===i)return this.parsedVersion=l,l;c=0;for(let d=5;d>=0;d--)for(let p=i-9;p>=u;p--)c=this.copyBit(d,p,c);if(l=he.decodeVersionInformation(c),l!==null&&l.getDimensionForVersion()===i)return this.parsedVersion=l,l;throw new U}copyBit(i,o,c){return(this.isMirror?this.bitMatrix.get(o,i):this.bitMatrix.get(i,o))?c<<1|1:c<<1}readCodewords(){const i=this.readFormatInformation(),o=this.readVersion(),c=ar.values.get(i.getDataMask()),u=this.bitMatrix.getHeight();c.unmaskBitMatrix(this.bitMatrix,u);const l=o.buildFunctionPattern();let d=!0;const p=new Uint8Array(o.getTotalCodewords());let v=0,y=0,_=0;for(let I=u-1;I>0;I-=2){I===6&&I--;for(let S=0;S=0&&p[_].codewords.length!==y;)_--;_++;const I=y-u.getECCodewordsPerBlock();let S=0;for(let M=0;Mi.available())throw new U;const u=new Uint8Array(2*c);let l=0;for(;c>0;){const d=i.readBits(13);let p=d/96<<8&4294967295|d%96;p<959?p+=41377:p+=42657,u[l]=p>>8&255,u[l+1]=p&255,l+=2,c--}try{o.append(_e.decode(u,Z.GB2312))}catch(d){throw new U(d)}}static decodeKanjiSegment(i,o,c){if(c*13>i.available())throw new U;const u=new Uint8Array(2*c);let l=0;for(;c>0;){const d=i.readBits(13);let p=d/192<<8&4294967295|d%192;p<7936?p+=33088:p+=49472,u[l]=p>>8,u[l+1]=p,l+=2,c--}try{o.append(_e.decode(u,Z.SHIFT_JIS))}catch(d){throw new U(d)}}static decodeByteSegment(i,o,c,u,l,d){if(8*c>i.available())throw new U;const p=new Uint8Array(c);for(let y=0;y=rt.ALPHANUMERIC_CHARS.length)throw new U;return rt.ALPHANUMERIC_CHARS[i]}static decodeAlphanumericSegment(i,o,c,u){const l=o.length();for(;c>1;){if(i.available()<11)throw new U;const d=i.readBits(11);o.append(rt.toAlphaNumericChar(Math.floor(d/45))),o.append(rt.toAlphaNumericChar(d%45)),c-=2}if(c===1){if(i.available()<6)throw new U;o.append(rt.toAlphaNumericChar(i.readBits(6)))}if(u)for(let d=l;d=3;){if(i.available()<10)throw new U;const u=i.readBits(10);if(u>=1e3)throw new U;o.append(rt.toAlphaNumericChar(Math.floor(u/100))),o.append(rt.toAlphaNumericChar(Math.floor(u/10)%10)),o.append(rt.toAlphaNumericChar(u%10)),c-=3}if(c===2){if(i.available()<7)throw new U;const u=i.readBits(7);if(u>=100)throw new U;o.append(rt.toAlphaNumericChar(Math.floor(u/10))),o.append(rt.toAlphaNumericChar(u%10))}else if(c===1){if(i.available()<4)throw new U;const u=i.readBits(4);if(u>=10)throw new U;o.append(rt.toAlphaNumericChar(u))}}static parseECIValue(i){const o=i.readBits(8);if((o&128)===0)return o&127;if((o&192)===128){const c=i.readBits(8);return(o&63)<<8&4294967295|c}if((o&224)===192){const c=i.readBits(16);return(o&31)<<16&4294967295|c}throw new U}}rt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",rt.GB2312_SUBSET=1;class Pa{constructor(i){this.mirrored=i}isMirrored(){return this.mirrored}applyMirroredCorrection(i){if(!this.mirrored||i===null||i.length<3)return;const o=i[0];i[0]=i[2],i[2]=o}}class w1{constructor(){this.rsDecoder=new Cn(Me.QR_CODE_FIELD_256)}decodeBooleanArray(i,o){return this.decodeBitMatrix(le.parseFromBooleanArray(i),o)}decodeBitMatrix(i,o){const c=new v1(i);let u=null;try{return this.decodeBitMatrixParser(c,o)}catch(l){u=l}try{c.remask(),c.setMirror(!0),c.readVersion(),c.readFormatInformation(),c.mirror();const l=this.decodeBitMatrixParser(c,o);return l.setOther(new Pa(!0)),l}catch(l){throw u!==null?u:l}}decodeBitMatrixParser(i,o){const c=i.readVersion(),u=i.readFormatInformation().getErrorCorrectionLevel(),l=i.readCodewords(),d=Di.getDataBlocks(l,c,u);let p=0;for(const _ of d)p+=_.getNumDataCodewords();const v=new Uint8Array(p);let y=0;for(const _ of d){const I=_.getCodewords(),S=_.getNumDataCodewords();this.correctErrors(I,S);for(let R=0;R=c)return!1;return!0}crossCheckVertical(i,o,c,u){const l=this.image,d=l.getHeight(),p=this.crossCheckStateCount;p[0]=0,p[1]=0,p[2]=0;let v=i;for(;v>=0&&l.get(o,v)&&p[1]<=c;)p[1]++,v--;if(v<0||p[1]>c)return NaN;for(;v>=0&&!l.get(o,v)&&p[0]<=c;)p[0]++,v--;if(p[0]>c)return NaN;for(v=i+1;vc)return NaN;for(;vc)return NaN;const y=p[0]+p[1]+p[2];return 5*Math.abs(y-u)>=2*u?NaN:this.foundPatternCross(p)?Kn.centerFromEnd(p,v):NaN}handlePossibleCenter(i,o,c){const u=i[0]+i[1]+i[2],l=Kn.centerFromEnd(i,c),d=this.crossCheckVertical(o,l,2*i[1],u);if(!isNaN(d)){const p=(i[0]+i[1]+i[2])/3;for(const y of this.possibleCenters)if(y.aboutEquals(p,d,l))return y.combineEstimate(d,l,p);const v=new Mi(l,d,p);this.possibleCenters.push(v),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(v)}return null}}class Pi extends fe{constructor(i,o,c,u){super(i,o),this.estimatedModuleSize=c,this.count=u,u===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(i,o,c){if(Math.abs(o-this.getY())<=i&&Math.abs(c-this.getX())<=i){const u=Math.abs(i-this.estimatedModuleSize);return u<=1||u<=this.estimatedModuleSize}return!1}combineEstimate(i,o,c){const u=this.count+1,l=(this.count*this.getX()+o)/u,d=(this.count*this.getY()+i)/u,p=(this.count*this.estimatedModuleSize+c)/u;return new Pi(l,d,p,u)}}class A1{constructor(i){this.bottomLeft=i[0],this.topLeft=i[1],this.topRight=i[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class yt{constructor(i,o){this.image=i,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=o}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(i){const o=i!=null&&i.get(K.TRY_HARDER)!==void 0,c=i!=null&&i.get(K.PURE_BARCODE)!==void 0,u=this.image,l=u.getHeight(),d=u.getWidth();let p=Math.floor(3*l/(4*yt.MAX_MODULES));(py[2]&&(I+=B-y[2]-p,R=d-1)}else{y[0]=y[2],y[1]=y[3],y[2]=y[4],y[3]=1,y[4]=0,S=3;continue}S=0,y[0]=0,y[1]=0,y[2]=0,y[3]=0,y[4]=0}else y[0]=y[2],y[1]=y[3],y[2]=y[4],y[3]=1,y[4]=0,S=3;else y[++S]++;else y[S]++;yt.foundPatternCross(y)&&this.handlePossibleCenter(y,I,d,c)===!0&&(p=y[0],this.hasSkipped&&(v=this.haveMultiplyConfirmedCenters()))}const _=this.selectBestPatterns();return fe.orderBestPatterns(_),new A1(_)}static centerFromEnd(i,o){return o-i[4]-i[3]-i[2]/2}static foundPatternCross(i){let o=0;for(let l=0;l<5;l++){const d=i[l];if(d===0)return!1;o+=d}if(o<7)return!1;const c=o/7,u=c/2;return Math.abs(c-i[0])=d&&o>=d&&p.get(o-d,i-d);)l[2]++,d++;if(i=d&&o>=d&&!p.get(o-d,i-d)&&l[1]<=c;)l[1]++,d++;if(ic)return!1;for(;i>=d&&o>=d&&p.get(o-d,i-d)&&l[0]<=c;)l[0]++,d++;if(l[0]>c)return!1;const v=p.getHeight(),y=p.getWidth();for(d=1;i+d=v||o+d>=y)return!1;for(;i+d=v||o+d>=y||l[3]>=c)return!1;for(;i+d=c)return!1;const _=l[0]+l[1]+l[2]+l[3]+l[4];return Math.abs(_-u)<2*u&&yt.foundPatternCross(l)}crossCheckVertical(i,o,c,u){const l=this.image,d=l.getHeight(),p=this.getCrossCheckStateCount();let v=i;for(;v>=0&&l.get(o,v);)p[2]++,v--;if(v<0)return NaN;for(;v>=0&&!l.get(o,v)&&p[1]<=c;)p[1]++,v--;if(v<0||p[1]>c)return NaN;for(;v>=0&&l.get(o,v)&&p[0]<=c;)p[0]++,v--;if(p[0]>c)return NaN;for(v=i+1;v=c)return NaN;for(;v=c)return NaN;const y=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(y-u)>=2*u?NaN:yt.foundPatternCross(p)?yt.centerFromEnd(p,v):NaN}crossCheckHorizontal(i,o,c,u){const l=this.image,d=l.getWidth(),p=this.getCrossCheckStateCount();let v=i;for(;v>=0&&l.get(v,o);)p[2]++,v--;if(v<0)return NaN;for(;v>=0&&!l.get(v,o)&&p[1]<=c;)p[1]++,v--;if(v<0||p[1]>c)return NaN;for(;v>=0&&l.get(v,o)&&p[0]<=c;)p[0]++,v--;if(p[0]>c)return NaN;for(v=i+1;v=c)return NaN;for(;v=c)return NaN;const y=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(y-u)>=u?NaN:yt.foundPatternCross(p)?yt.centerFromEnd(p,v):NaN}handlePossibleCenter(i,o,c,u){const l=i[0]+i[1]+i[2]+i[3]+i[4];let d=yt.centerFromEnd(i,c),p=this.crossCheckVertical(o,Math.floor(d),i[2],l);if(!isNaN(p)&&(d=this.crossCheckHorizontal(Math.floor(d),Math.floor(p),i[2],l),!isNaN(d)&&(!u||this.crossCheckDiagonal(Math.floor(p),Math.floor(d),i[2],l)))){const v=l/7;let y=!1;const _=this.possibleCenters;for(let I=0,S=_.length;I=yt.CENTER_QUORUM)if(o==null)o=c;else return this.hasSkipped=!0,Math.floor((Math.abs(o.getX()-c.getX())-Math.abs(o.getY()-c.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let i=0,o=0;const c=this.possibleCenters.length;for(const d of this.possibleCenters)d.getCount()>=yt.CENTER_QUORUM&&(i++,o+=d.getEstimatedModuleSize());if(i<3)return!1;const u=o/c;let l=0;for(const d of this.possibleCenters)l+=Math.abs(d.getEstimatedModuleSize()-u);return l<=.05*o}selectBestPatterns(){const i=this.possibleCenters.length;if(i<3)throw new X;const o=this.possibleCenters;let c;if(i>3){let u=0,l=0;for(const v of this.possibleCenters){const y=v.getEstimatedModuleSize();u+=y,l+=y*y}c=u/i;let d=Math.sqrt(l/i-c*c);o.sort((v,y)=>{const _=Math.abs(y.getEstimatedModuleSize()-c),I=Math.abs(v.getEstimatedModuleSize()-c);return _I?1:0});const p=Math.max(.2*c,d);for(let v=0;v3;v++){const y=o[v];Math.abs(y.getEstimatedModuleSize()-c)>p&&(o.splice(v,1),v--)}}if(o.length>3){let u=0;for(const l of o)u+=l.getEstimatedModuleSize();c=u/o.length,o.sort((l,d)=>{if(d.getCount()===l.getCount()){const p=Math.abs(d.getEstimatedModuleSize()-c),v=Math.abs(l.getEstimatedModuleSize()-c);return pv?-1:0}else return d.getCount()-l.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]}}yt.CENTER_QUORUM=2,yt.MIN_SKIP=3,yt.MAX_MODULES=57;class mn{constructor(i){this.image=i}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(i){this.resultPointCallback=i==null?null:i.get(K.NEED_RESULT_POINT_CALLBACK);const c=new yt(this.image,this.resultPointCallback).find(i);return this.processFinderPatternInfo(c)}processFinderPatternInfo(i){const o=i.getTopLeft(),c=i.getTopRight(),u=i.getBottomLeft(),l=this.calculateModuleSize(o,c,u);if(l<1)throw new X("No pattern found in proccess finder.");const d=mn.computeDimension(o,c,u,l),p=he.getProvisionalVersionForDimension(d),v=p.getDimensionForVersion()-7;let y=null;if(p.getAlignmentPatternCenters().length>0){const R=c.getX()-o.getX()+u.getX(),M=c.getY()-o.getY()+u.getY(),B=1-3/v,V=Math.floor(o.getX()+B*(R-o.getX())),z=Math.floor(o.getY()+B*(M-o.getY()));for(let ee=4;ee<=16;ee<<=1)try{y=this.findAlignmentInRegion(l,V,z,ee);break}catch(te){if(!(te instanceof X))throw te}}const _=mn.createTransform(o,c,u,y,d),I=mn.sampleGrid(this.image,_,d);let S;return y===null?S=[u,o,c]:S=[u,o,c,y],new Wn(I,S)}static createTransform(i,o,c,u,l){const d=l-3.5;let p,v,y,_;return u!==null?(p=u.getX(),v=u.getY(),y=d-3,_=y):(p=o.getX()-i.getX()+c.getX(),v=o.getY()-i.getY()+c.getY(),y=d,_=d),hr.quadrilateralToQuadrilateral(3.5,3.5,d,3.5,y,_,3.5,d,i.getX(),i.getY(),o.getX(),o.getY(),p,v,c.getX(),c.getY())}static sampleGrid(i,o,c){return Dr.getInstance().sampleGridWithTransform(i,c,c,o)}static computeDimension(i,o,c,u){const l=Oe.round(fe.distance(i,o)/u),d=Oe.round(fe.distance(i,c)/u);let p=Math.floor((l+d)/2)+7;switch(p&3){case 0:p++;break;case 2:p--;break;case 3:throw new X("Dimensions could be not found.")}return p}calculateModuleSize(i,o,c){return(this.calculateModuleSizeOneWay(i,o)+this.calculateModuleSizeOneWay(i,c))/2}calculateModuleSizeOneWay(i,o){const c=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(i.getX()),Math.floor(i.getY()),Math.floor(o.getX()),Math.floor(o.getY())),u=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(o.getX()),Math.floor(o.getY()),Math.floor(i.getX()),Math.floor(i.getY()));return isNaN(c)?u/7:isNaN(u)?c/7:(c+u)/14}sizeOfBlackWhiteBlackRunBothWays(i,o,c,u){let l=this.sizeOfBlackWhiteBlackRun(i,o,c,u),d=1,p=i-(c-i);p<0?(d=i/(i-p),p=0):p>=this.image.getWidth()&&(d=(this.image.getWidth()-1-i)/(p-i),p=this.image.getWidth()-1);let v=Math.floor(o-(u-o)*d);return d=1,v<0?(d=o/(o-v),v=0):v>=this.image.getHeight()&&(d=(this.image.getHeight()-1-o)/(v-o),v=this.image.getHeight()-1),p=Math.floor(i+(p-i)*d),l+=this.sizeOfBlackWhiteBlackRun(i,o,p,v),l-1}sizeOfBlackWhiteBlackRun(i,o,c,u){const l=Math.abs(u-o)>Math.abs(c-i);if(l){let R=i;i=o,o=R,R=c,c=u,u=R}const d=Math.abs(c-i),p=Math.abs(u-o);let v=-d/2;const y=i0){if(M===u)break;M+=_,v-=d}}return I===2?Oe.distance(c+y,u,i,o):NaN}findAlignmentInRegion(i,o,c,u){const l=Math.floor(u*i),d=Math.max(0,o-l),p=Math.min(this.image.getWidth()-1,o+l);if(p-d=v||l>=d)throw new X;if(d-l!==v-p&&(v=p+(d-l),v>=i.getWidth()))throw new X;const y=Math.round((v-p+1)/u),_=Math.round((d-l+1)/u);if(y<=0||_<=0)throw new X;if(_!==y)throw new X;const I=Math.floor(u/2);l+=I,p+=I;const S=p+Math.floor((y-1)*u)-v;if(S>0){if(S>I)throw new X;p-=S}const R=l+Math.floor((_-1)*u)-d;if(R>0){if(R>I)throw new X;l-=R}const M=new le(y,_);for(let B=0;B<_;B++){const V=l+Math.floor(B*u);for(let z=0;z0;){const S=ye.findGuardPattern(i,l,--u,c,!1,d,y);if(S!=null)I=S;else{u++;break}}p[0]=new fe(I[0],u),p[1]=new fe(I[1],u),v=!0;break}}let _=u+1;if(v){let I=0,S=Int32Array.from([Math.trunc(p[0].getX()),Math.trunc(p[1].getX())]);for(;_ye.SKIPPED_ROW_COUNT_MAX)break;I++}}_-=I+1,p[2]=new fe(S[0],_),p[3]=new fe(S[1],_)}return _-u0&&y++I?_-I:I-_;if(S>c)return 1/0;v+=S}return v/l}}ye.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),ye.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),ye.MAX_AVG_VARIANCE=.42,ye.MAX_INDIVIDUAL_VARIANCE=.8,ye.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),ye.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),ye.MAX_PIXEL_DRIFT=3,ye.MAX_PATTERN_DRIFT=5,ye.SKIPPED_ROW_COUNT_MAX=25,ye.ROW_STEP=5,ye.BARCODE_MIN_HEIGHT=10;class St{constructor(i,o){if(o.length===0)throw new A;this.field=i;let c=o.length;if(c>1&&o[0]===0){let u=1;for(;uc.length){let d=o;o=c,c=d}let u=new Int32Array(c.length),l=c.length-o.length;T.arraycopy(c,0,u,0,l);for(let d=l;d=0;o--){let c=this.getCoefficient(o);c!==0&&(c<0?(i.append(" - "),c=-c):i.length()>0&&i.append(" + "),(o===0||c!==1)&&i.append(c),o!==0&&(o===1?i.append("x"):(i.append("x^"),i.append(o))))}return i.toString()}}class E1{add(i,o){return(i+o)%this.modulus}subtract(i,o){return(this.modulus+i-o)%this.modulus}exp(i){return this.expTable[i]}log(i){if(i===0)throw new A;return this.logTable[i]}inverse(i){if(i===0)throw new Gn;return this.expTable[this.modulus-this.logTable[i]-1]}multiply(i,o){return i===0||o===0?0:this.expTable[(this.logTable[i]+this.logTable[o])%(this.modulus-1)]}getSize(){return this.modulus}equals(i){return i===this}}class Bi extends E1{constructor(i,o){super(),this.modulus=i,this.expTable=new Int32Array(i),this.logTable=new Int32Array(i);let c=1;for(let u=0;u0;M--){let B=u.evaluateAt(this.field.exp(M));l[o-M]=B,B!==0&&(d=!0)}if(!d)return 0;let p=this.field.getOne();if(c!=null)for(const M of c){let B=this.field.exp(i.length-1-M),V=new St(this.field,new Int32Array([this.field.subtract(0,B),1]));p=p.multiply(V)}let v=new St(this.field,l),y=this.runEuclideanAlgorithm(this.field.buildMonomial(o,1),v,o),_=y[0],I=y[1],S=this.findErrorLocations(_),R=this.findErrorMagnitudes(I,_,S);for(let M=0;M=Math.round(c/2);){let S=u,R=d;if(u=l,d=p,u.isZero())throw C.getChecksumInstance();l=S;let M=this.field.getZero(),B=u.getCoefficient(u.getDegree()),V=this.field.inverse(B);for(;l.getDegree()>=u.getDegree()&&!l.isZero();){let z=l.getDegree()-u.getDegree(),ee=this.field.multiply(l.getCoefficient(l.getDegree()),V);M=M.add(this.field.buildMonomial(z,ee)),l=l.subtract(u.multiplyByMonomial(z,ee))}p=M.multiply(d).subtract(R).negative()}let v=p.getCoefficient(0);if(v===0)throw C.getChecksumInstance();let y=this.field.inverse(v),_=p.multiply(y),I=l.multiply(y);return[_,I]}findErrorLocations(i){let o=i.getDegree(),c=new Int32Array(o),u=0;for(let l=1;l0){let v=c?this.topLeft:this.topRight,y=Math.trunc(v.getY()-i);y<0&&(y=0);let _=new fe(v.getX(),y);c?u=_:d=_}if(o>0){let v=c?this.bottomLeft:this.bottomRight,y=Math.trunc(v.getY()+o);y>=this.image.getHeight()&&(y=this.image.getHeight()-1);let _=new fe(v.getX(),y);c?l=_:p=_}return new jr(this.image,u,l,d,p)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class C1{constructor(i,o,c,u){this.columnCount=i,this.errorCorrectionLevel=u,this.rowCountUpperPart=o,this.rowCountLowerPart=c,this.rowCount=o+c}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class In{constructor(){this.buffer=""}static form(i,o){let c=-1;function u(d,p,v,y,_,I){if(d==="%%")return"%";if(o[++c]===void 0)return;d=y?parseInt(y.substr(1)):void 0;let S=_?parseInt(_.substr(1)):void 0,R;switch(I){case"s":R=o[c];break;case"c":R=o[c][0];break;case"f":R=parseFloat(o[c]).toFixed(d);break;case"p":R=parseFloat(o[c]).toPrecision(d);break;case"e":R=parseFloat(o[c]).toExponential(d);break;case"x":R=parseInt(o[c]).toString(S||16);break;case"d":R=parseFloat(parseInt(o[c],S||10).toPrecision(d)).toFixed(0);break}R=typeof R=="object"?JSON.stringify(R):(+R).toString(S);let M=parseInt(v),B=v&&v[0]+""=="0"?"0":" ";for(;R.length=0&&(o=this.codewords[u],o!=null)||(u=this.imageRowToCodewordIndex(i)+c,uc,getValue:()=>u};l.getValue()>i?(i=l.getValue(),o=[],o.push(l.getKey())):l.getValue()===i&&o.push(l.getKey())}return we.toIntArray(o)}getConfidence(i){return this.values.get(i)}}class La extends Sn{constructor(i,o){super(i),this._isLeft=o}setRowNumbers(){for(let i of this.getCodewords())i!=null&&i.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(i){let o=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(o,i);let c=this.getBoundingBox(),u=this._isLeft?c.getTopLeft():c.getTopRight(),l=this._isLeft?c.getBottomLeft():c.getBottomRight(),d=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.imageRowToCodewordIndex(Math.trunc(l.getY())),v=-1,y=1,_=0;for(let I=d;I=i.getRowCount()||R>I)o[I]=null;else{let M;y>2?M=(y-2)*R:M=R;let B=M>=I;for(let V=1;V<=M&&!B;V++)B=o[I-V]!=null;B?o[I]=null:(v=S.getRowNumber(),_=1)}}}getRowHeights(){let i=this.getBarcodeMetadata();if(i==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(i);let o=new Int32Array(i.getRowCount());for(let c of this.getCodewords())if(c!=null){let u=c.getRowNumber();if(u>=o.length)continue;o[u]++}return o}adjustIncompleteIndicatorColumnRowNumbers(i){let o=this.getBoundingBox(),c=this._isLeft?o.getTopLeft():o.getTopRight(),u=this._isLeft?o.getBottomLeft():o.getBottomRight(),l=this.imageRowToCodewordIndex(Math.trunc(c.getY())),d=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.getCodewords(),v=-1;for(let y=l;y=i.getRowCount()?p[y]=null:v=_.getRowNumber())}}getBarcodeMetadata(){let i=this.getCodewords(),o=new bn,c=new bn,u=new bn,l=new bn;for(let p of i){if(p==null)continue;p.setRowNumberAsRowIndicatorColumn();let v=p.getValue()%30,y=p.getRowNumber();switch(this._isLeft||(y+=2),y%3){case 0:c.setValue(v*3+1);break;case 1:l.setValue(v/3),u.setValue(v%3);break;case 2:o.setValue(v+1);break}}if(o.getValue().length===0||c.getValue().length===0||u.getValue().length===0||l.getValue().length===0||o.getValue()[0]<1||c.getValue()[0]+u.getValue()[0]we.MAX_ROWS_IN_BARCODE)return null;let d=new C1(o.getValue()[0],c.getValue()[0],u.getValue()[0],l.getValue()[0]);return this.removeIncorrectCodewords(i,d),d}removeIncorrectCodewords(i,o){for(let c=0;co.getRowCount()){i[c]=null;continue}switch(this._isLeft||(d+=2),d%3){case 0:l*3+1!==o.getRowCountUpperPart()&&(i[c]=null);break;case 1:(Math.trunc(l/3)!==o.getErrorCorrectionLevel()||l%3!==o.getRowCountLowerPart())&&(i[c]=null);break;case 2:l+1!==o.getColumnCount()&&(i[c]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+` `+super.toString()}}class Tn{constructor(i,o){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=i,this.barcodeColumnCount=i.getColumnCount(),this.boundingBox=o,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let i=we.MAX_CODEWORDS_IN_BARCODE,o;do o=i,i=this.adjustRowNumbersAndGetCount();while(i>0&&i0&&l0&&(p[0]=c[o-1],p[4]=l[o-1],p[5]=d[o-1]),o>1&&(p[8]=c[o-2],p[10]=l[o-2],p[11]=d[o-2]),o>=1;c=o&1,Zt.RATIOS_TABLE[i]||(Zt.RATIOS_TABLE[i]=new Array(we.BARS_IN_MODULE)),Zt.RATIOS_TABLE[i][we.BARS_IN_MODULE-u-1]=Math.fround(l/we.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(i){let o=Zt.getDecodedCodewordValue(Zt.sampleBitCounts(i));return o!==-1?o:Zt.getClosestDecodedValue(i)}static sampleBitCounts(i){let o=Oe.sum(i),c=new Int32Array(we.BARS_IN_MODULE),u=0,l=0;for(let d=0;d1)for(let d=0;d=u)break}pnew Array(we.BARS_IN_MODULE));class Fa{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(i){this.segmentIndex=i}getFileId(){return this.fileId}setFileId(i){this.fileId=i}getOptionalData(){return this.optionalData}setOptionalData(i){this.optionalData=i}isLastSegment(){return this.lastSegment}setLastSegment(i){this.lastSegment=i}getSegmentCount(){return this.segmentCount}setSegmentCount(i){this.segmentCount=i}getSender(){return this.sender||null}setSender(i){this.sender=i}getAddressee(){return this.addressee||null}setAddressee(i){this.addressee=i}getFileName(){return this.fileName}setFileName(i){this.fileName=i}getFileSize(){return this.fileSize}setFileSize(i){this.fileSize=i}getChecksum(){return this.checksum}setChecksum(i){this.checksum=i}getTimestamp(){return this.timestamp}setTimestamp(i){this.timestamp=i}}class ka{static parseLong(i,o=void 0){return parseInt(i,o)}}class Ua extends g{}Ua.kind="NullPointerException";class _1{writeBytes(i){this.writeBytesOffset(i,0,i.length)}writeBytesOffset(i,o,c){if(i==null)throw new Ua;if(o<0||o>i.length||c<0||o+c>i.length||o+c<0)throw new P;if(c===0)return;for(let u=0;u0&&this.grow(i)}grow(i){let c=this.buf.length<<1;if(c-i<0&&(c=i),c<0){if(i<0)throw new m1;c=L.MAX_VALUE}this.buf=D.copyOfUint8Array(this.buf,c)}write(i){this.ensureCapacity(this.count+1),this.buf[this.count]=i,this.count+=1}writeBytesOffset(i,o,c){if(o<0||o>i.length||c<0||o+c-i.length>0)throw new P;this.ensureCapacity(this.count+c),T.arraycopy(i,o,this.buf,this.count,c),this.count+=c}writeTo(i){i.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return D.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(i){return i?typeof i=="string"?this.toString_string(i):this.toString_number(i):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(i){return new String(this.buf).toString()}toString_number(i){return new String(this.buf).toString()}close(){}}var Ge;(function(m){m[m.ALPHA=0]="ALPHA",m[m.LOWER=1]="LOWER",m[m.MIXED=2]="MIXED",m[m.PUNCT=3]="PUNCT",m[m.ALPHA_SHIFT=4]="ALPHA_SHIFT",m[m.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Ge||(Ge={}));function Va(){if(typeof window<"u")return window.BigInt||null;if(typeof ti<"u")return ti.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let qn;function Fr(m){if(typeof qn>"u"&&(qn=Va()),qn===null)throw new Error("BigInt is not supported!");return qn(m)}function S1(){let m=[];m[0]=Fr(1);let i=Fr(900);m[1]=i;for(let o=2;o<16;o++)m[o]=m[o-1]*i;return m}class W{static decode(i,o){let c=new ne(""),u=Y.ISO8859_1;c.enableDecoding(u);let l=1,d=i[l++],p=new Fa;for(;li[0])throw U.getFormatInstance();let u=new Int32Array(W.NUMBER_OF_SEQUENCE_CODEWORDS);for(let p=0;p0){for(let S=0;S<6;++S)d.write(Number(Fr(v)>>Fr(8*(5-S))));v=0,p=0}break}u===o[0]&&I0){for(let R=0;R<6;++R)d.write(Number(Fr(v)>>Fr(8*(5-R))));v=0,p=0}}break}return l.append(_e.decode(d.toByteArray(),c)),u}static numericCompaction(i,o,c){let u=0,l=!1,d=new Int32Array(W.MAX_NUMERIC_CODEWORDS);for(;o0&&(c.append(W.decodeBase900toBase10(d,u)),u=0)}return o}static decodeBase900toBase10(i,o){let c=Fr(0);for(let l=0;l@[\\]_\`~!\r ,: -.$/"|*()?{}'`,W.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",W.EXP900=Va()?S1():[],W.NUMBER_OF_SEQUENCE_CODEWORDS=2;class Ee{constructor(){}static decode(i,o,c,u,l,d,p){let v=new jr(i,o,c,u,l),y=null,_=null,I;for(let M=!0;;M=!1){if(o!=null&&(y=Ee.getRowIndicatorColumn(i,v,o,!0,d,p)),u!=null&&(_=Ee.getRowIndicatorColumn(i,v,u,!1,d,p)),I=Ee.merge(y,_),I==null)throw X.getNotFoundInstance();let B=I.getBoundingBox();if(M&&B!=null&&(B.getMinY()v.getMaxY()))v=B;else break}I.setBoundingBox(v);let S=I.getBarcodeColumnCount()+1;I.setDetectionResultColumn(0,y),I.setDetectionResultColumn(S,_);let R=y!=null;for(let M=1;M<=S;M++){let B=R?M:S-M;if(I.getDetectionResultColumn(B)!==void 0)continue;let V;B===0||B===S?V=new La(v,B===0):V=new Sn(v),I.setDetectionResultColumn(B,V);let z=-1,ee=z;for(let te=v.getMinY();te<=v.getMaxY();te++){if(z=Ee.getStartColumn(I,B,te,R),z<0||z>v.getMaxX()){if(ee===-1)continue;z=ee}let J=Ee.detectCodeword(i,v.getMinX(),v.getMaxX(),R,z,te,d,p);J!=null&&(V.setCodeword(te,J),ee=z,d=Math.min(d,J.getWidth()),p=Math.max(p,J.getWidth()))}}return Ee.createDecoderResult(I)}static merge(i,o){if(i==null&&o==null)return null;let c=Ee.getBarcodeMetadata(i,o);if(c==null)return null;let u=jr.merge(Ee.adjustBoundingBox(i),Ee.adjustBoundingBox(o));return new Tn(c,u)}static adjustBoundingBox(i){if(i==null)return null;let o=i.getRowHeights();if(o==null)return null;let c=Ee.getMax(o),u=0;for(let p of o)if(u+=c-p,p>0)break;let l=i.getCodewords();for(let p=0;u>0&&l[p]==null;p++)u--;let d=0;for(let p=o.length-1;p>=0&&(d+=c-o[p],!(o[p]>0));p--);for(let p=l.length-1;d>0&&l[p]==null;p--)d--;return i.getBoundingBox().addMissingRows(u,d,i.isLeft())}static getMax(i){let o=-1;for(let c of i)o=Math.max(o,c);return o}static getBarcodeMetadata(i,o){let c;if(i==null||(c=i.getBarcodeMetadata())==null)return o==null?null:o.getBarcodeMetadata();let u;return o==null||(u=o.getBarcodeMetadata())==null?c:c.getColumnCount()!==u.getColumnCount()&&c.getErrorCorrectionLevel()!==u.getErrorCorrectionLevel()&&c.getRowCount()!==u.getRowCount()?null:c}static getRowIndicatorColumn(i,o,c,u,l,d){let p=new La(o,u);for(let v=0;v<2;v++){let y=v===0?1:-1,_=Math.trunc(Math.trunc(c.getX()));for(let I=Math.trunc(Math.trunc(c.getY()));I<=o.getMaxY()&&I>=o.getMinY();I+=y){let S=Ee.detectCodeword(i,0,i.getWidth(),u,_,I,l,d);S!=null&&(p.setCodeword(I,S),u?_=S.getStartX():_=S.getEndX())}}return p}static adjustCodewordCount(i,o){let c=o[0][1],u=c.getValue(),l=i.getBarcodeColumnCount()*i.getBarcodeRowCount()-Ee.getNumberOfECCodeWords(i.getBarcodeECLevel());if(u.length===0){if(l<1||l>we.MAX_CODEWORDS_IN_BARCODE)throw X.getNotFoundInstance();c.setValue(l)}else u[0]!==l&&c.setValue(l)}static createDecoderResult(i){let o=Ee.createBarcodeMatrix(i);Ee.adjustCodewordCount(i,o);let c=new Array,u=new Int32Array(i.getBarcodeRowCount()*i.getBarcodeColumnCount()),l=[],d=new Array;for(let v=0;v0;){for(let v=0;vnew Array(i.getBarcodeColumnCount()+2));for(let u=0;u=0){if(d>=o.length)continue;o[d][c].setValue(l.getValue())}}}c++}return o}static isValidBarcodeColumn(i,o){return o>=0&&o<=i.getBarcodeColumnCount()+1}static getStartColumn(i,o,c,u){let l=u?1:-1,d=null;if(Ee.isValidBarcodeColumn(i,o-l)&&(d=i.getDetectionResultColumn(o-l).getCodeword(c)),d!=null)return u?d.getEndX():d.getStartX();if(d=i.getDetectionResultColumn(o).getCodewordNearby(c),d!=null)return u?d.getStartX():d.getEndX();if(Ee.isValidBarcodeColumn(i,o-l)&&(d=i.getDetectionResultColumn(o-l).getCodewordNearby(c)),d!=null)return u?d.getEndX():d.getStartX();let p=0;for(;Ee.isValidBarcodeColumn(i,o-l);){o-=l;for(let v of i.getDetectionResultColumn(o).getCodewords())if(v!=null)return(u?v.getEndX():v.getStartX())+l*p*(v.getEndX()-v.getStartX());p++}return u?i.getBoundingBox().getMinX():i.getBoundingBox().getMaxX()}static detectCodeword(i,o,c,u,l,d,p,v){l=Ee.adjustCodewordStartColumn(i,o,c,u,l,d);let y=Ee.getModuleBitCount(i,o,c,u,l,d);if(y==null)return null;let _,I=Oe.sum(y);if(u)_=l+I;else{for(let M=0;M=o)&&y=o:pEe.CODEWORD_SKEW_SIZE)return l;p+=v}v=-v,u=!u}return p}static checkCodewordSkew(i,o,c){return o-Ee.CODEWORD_SKEW_SIZE<=i&&i<=c+Ee.CODEWORD_SKEW_SIZE}static decodeCodewords(i,o,c){if(i.length===0)throw U.getFormatInstance();let u=1<c/2+Ee.MAX_ERRORS||c<0||c>Ee.MAX_EC_CODEWORDS)throw C.getChecksumInstance();return Ee.errorCorrection.decode(i,c,o)}static verifyCodewordCount(i,o){if(i.length<4)throw U.getFormatInstance();let c=i[0];if(c>i.length)throw U.getFormatInstance();if(c===0)if(o>=1;return o}static getCodewordBucketNumber(i){return i instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(i):this.getCodewordBucketNumber_number(i)}static getCodewordBucketNumber_number(i){return Ee.getCodewordBucketNumber(Ee.getBitCountForCodeword(i))}static getCodewordBucketNumber_Int32Array(i){return(i[0]-i[2]+i[4]-i[6]+9)%9}static toString(i){let o=new In;for(let c=0;cd)}static getMaxWidth(i,o){return i==null||o==null?0:Math.trunc(Math.abs(i.getX()-o.getX()))}static getMinWidth(i,o){return i==null||o==null?L.MAX_VALUE:Math.trunc(Math.abs(i.getX()-o.getX()))}static getMaxCodewordWidth(i){return Math.floor(Math.max(Math.max(bt.getMaxWidth(i[0],i[4]),bt.getMaxWidth(i[6],i[2])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN),Math.max(bt.getMaxWidth(i[1],i[5]),bt.getMaxWidth(i[7],i[3])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(i){return Math.floor(Math.min(Math.min(bt.getMinWidth(i[0],i[4]),bt.getMinWidth(i[6],i[2])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN),Math.min(bt.getMinWidth(i[1],i[5]),bt.getMinWidth(i[7],i[3])*we.MODULES_IN_CODEWORD/we.MODULES_IN_STOP_PATTERN)))}reset(){}}class Qn extends g{}Qn.kind="ReaderException";class Ha{constructor(i,o){this.verbose=i===!0,o&&this.setHints(o)}decode(i,o){return o&&this.setHints(o),this.decodeInternal(i)}decodeWithState(i){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(i)}setHints(i){this.hints=i;const o=!n(i)&&i.get(K.TRY_HARDER)===!0,c=n(i)?null:i.get(K.POSSIBLE_FORMATS),u=new Array;if(!n(c)){const l=c.some(d=>d===pe.UPC_A||d===pe.UPC_E||d===pe.EAN_13||d===pe.EAN_8||d===pe.CODABAR||d===pe.CODE_39||d===pe.CODE_93||d===pe.CODE_128||d===pe.ITF||d===pe.RSS_14||d===pe.RSS_EXPANDED);l&&!o&&u.push(new cn(i,this.verbose)),c.includes(pe.QR_CODE)&&u.push(new Lr),c.includes(pe.DATA_MATRIX)&&u.push(new Br),c.includes(pe.AZTEC)&&u.push(new zn),c.includes(pe.PDF_417)&&u.push(new bt),l&&o&&u.push(new cn(i,this.verbose))}u.length===0&&(o||u.push(new cn(i,this.verbose)),u.push(new Lr),u.push(new Br),u.push(new zn),u.push(new bt),o&&u.push(new cn(i,this.verbose))),this.readers=u}reset(){if(this.readers!==null)for(const i of this.readers)i.reset()}decodeInternal(i){if(this.readers===null)throw new Qn("No readers where selected, nothing can be read.");for(const o of this.readers)try{return o.decode(i,this.hints)}catch(c){if(c instanceof Qn)continue}throw new X("No MultiFormat Readers were able to detect the code.")}}class b1 extends Wr{constructor(i=null,o=500){const c=new Ha;c.setHints(i),super(c,o)}decodeBitmap(i){return this.reader.decodeWithState(i)}}class T1 extends Wr{constructor(i=500){super(new bt,i)}}class O1 extends Wr{constructor(i=500){super(new Lr,i)}}var Li;(function(m){m[m.ERROR_CORRECTION=0]="ERROR_CORRECTION",m[m.CHARACTER_SET=1]="CHARACTER_SET",m[m.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",m[m.MIN_SIZE=3]="MIN_SIZE",m[m.MAX_SIZE=4]="MAX_SIZE",m[m.MARGIN=5]="MARGIN",m[m.PDF417_COMPACT=6]="PDF417_COMPACT",m[m.PDF417_COMPACTION=7]="PDF417_COMPACTION",m[m.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",m[m.AZTEC_LAYERS=9]="AZTEC_LAYERS",m[m.QR_VERSION=10]="QR_VERSION"})(Li||(Li={}));var lt=Li;class Fi{constructor(i){this.field=i,this.cachedGenerators=[],this.cachedGenerators.push(new Wt(i,Int32Array.from([1])))}buildGenerator(i){const o=this.cachedGenerators;if(i>=o.length){let c=o[o.length-1];const u=this.field;for(let l=o.length;l<=i;l++){const d=c.multiply(new Wt(u,Int32Array.from([1,u.exp(l-1+u.getGeneratorBase())])));o.push(d),c=d}}return o[i]}encode(i,o){if(o===0)throw new A("No error correction bytes");const c=i.length-o;if(c<=0)throw new A("No data bytes provided");const u=this.buildGenerator(o),l=new Int32Array(c);T.arraycopy(i,0,l,0,c);let d=new Wt(this.field,l);d=d.multiplyByMonomial(o,1);const v=d.divide(u)[1].getCoefficients(),y=o-v.length;for(let _=0;_=5&&(c+=at.N1+(v-5)),v=1,y=I)}v>=5&&(c+=at.N1+(v-5))}return c}}at.N1=3,at.N2=3,at.N3=40,at.N4=10;class Jn{constructor(i,o){this.width=i,this.height=o;const c=new Array(o);for(let u=0;u!==o;u++)c[u]=new Uint8Array(i);this.bytes=c}getHeight(){return this.height}getWidth(){return this.width}get(i,o){return this.bytes[o][i]}getArray(){return this.bytes}setNumber(i,o,c){this.bytes[o][i]=c}setBoolean(i,o,c){this.bytes[o][i]=c?1:0}clear(i){for(const o of this.bytes)D.fill(o,i)}equals(i){if(!(i instanceof Jn))return!1;const o=i;if(this.width!==o.width||this.height!==o.height)return!1;for(let c=0,u=this.height;c> `),i.toString()}setMode(i){this.mode=i}setECLevel(i){this.ecLevel=i}setVersion(i){this.version=i}setMaskPattern(i){this.maskPattern=i}setMatrix(i){this.matrix=i}static isValidMaskPattern(i){return i>=0&&i0;){for(d===6&&(d-=1);p>=0&&p=c;)i^=o<=0)for(let v=0;v!==d;v++){const y=u[v];y>=0&&ve.isEmpty(o.get(y,p))&&ve.embedPositionAdjustmentPattern(y-2,p-2,o)}}}}ve.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])]),ve.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])]),ve.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])]),ve.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])]),ve.VERSION_INFO_POLY=7973,ve.TYPE_INFO_POLY=1335,ve.TYPE_INFO_MASK_PATTERN=21522;class N1{constructor(i,o){this.dataBytes=i,this.errorCorrectionBytes=o}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class qe{constructor(){}static calculateMaskPenalty(i){return at.applyMaskPenaltyRule1(i)+at.applyMaskPenaltyRule2(i)+at.applyMaskPenaltyRule3(i)+at.applyMaskPenaltyRule4(i)}static encode(i,o,c=null){let u=qe.DEFAULT_BYTE_MODE_ENCODING;const l=c!==null&&c.get(lt.CHARACTER_SET)!==void 0;l&&(u=c.get(lt.CHARACTER_SET).toString());const d=this.chooseMode(i,u),p=new k;if(d===de.BYTE&&(l||qe.DEFAULT_BYTE_MODE_ENCODING!==u)){const te=Y.getCharacterSetECIByName(u);te!==void 0&&this.appendECI(te,p)}this.appendModeInfo(d,p);const v=new k;this.appendBytes(i,d,v,u);let y;if(c!==null&&c.get(lt.QR_VERSION)!==void 0){const te=Number.parseInt(c.get(lt.QR_VERSION).toString(),10);y=he.getVersionForNumber(te);const J=this.calculateBitsNeeded(d,p,v,y);if(!this.willFit(J,y,o))throw new ze("Data too big for requested version")}else y=this.recommendVersion(o,d,p,v);const _=new k;_.appendBitArray(p);const I=d===de.BYTE?v.getSizeInBytes():i.length;this.appendLengthInfo(I,y,d,_),_.appendBitArray(v);const S=y.getECBlocksForLevel(o),R=y.getTotalCodewords()-S.getTotalECCodewords();this.terminateBits(R,_);const M=this.interleaveWithECBytes(_,y.getTotalCodewords(),R,S.getNumBlocks()),B=new Kr;B.setECLevel(o),B.setMode(d),B.setVersion(y);const V=y.getDimensionForVersion(),z=new Jn(V,V),ee=this.chooseMaskPattern(M,o,y,z);return B.setMaskPattern(ee),ve.buildMatrix(M,o,y,ee,z),B.setMatrix(z),B}static recommendVersion(i,o,c,u){const l=this.calculateBitsNeeded(o,c,u,he.getVersionForNumber(1)),d=this.chooseVersion(l,i),p=this.calculateBitsNeeded(o,c,u,d);return this.chooseVersion(p,i)}static calculateBitsNeeded(i,o,c,u){return o.getSize()+i.getCharacterCountBits(u)+c.getSize()}static getAlphanumericCode(i){return i159)&&(l<224||l>235))return!1}return!0}static chooseMaskPattern(i,o,c,u){let l=Number.MAX_SAFE_INTEGER,d=-1;for(let p=0;p=v}static terminateBits(i,o){const c=i*8;if(o.getSize()>c)throw new ze("data bits cannot fit in the QR Code"+o.getSize()+" > "+c);for(let d=0;d<4&&o.getSize()0)for(let d=u;d<8;d++)o.appendBit(!1);const l=i-o.getSizeInBytes();for(let d=0;d=c)throw new ze("Block ID too large");const p=i%c,v=c-p,y=Math.floor(i/c),_=y+1,I=Math.floor(o/c),S=I+1,R=y-I,M=_-S;if(R!==M)throw new ze("EC bytes mismatch");if(c!==v+p)throw new ze("RS blocks mismatch");if(i!==(I+R)*v+(S+M)*p)throw new ze("Total bytes mismatch");u=1<=0&&o<=9}static appendNumericBytes(i,o){const c=i.length;let u=0;for(;u=33088&&v<=40956?y=v-33088:v>=57408&&v<=60351&&(y=v-49472),y===-1)throw new ze("Invalid byte sequence");const _=(y>>8)*192+(y&255);o.appendBits(_,13)}}static appendECI(i,o){o.appendBits(de.ECI.getBits(),4),o.appendBits(i.getValue(),8)}}qe.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]),qe.DEFAULT_BYTE_MODE_ENCODING=Y.UTF8.getName();class qr{write(i,o,c,u=null){if(i.length===0)throw new A("Found empty contents");if(o<0||c<0)throw new A("Requested dimensions are too small: "+o+"x"+c);let l=je.L,d=qr.QUIET_ZONE_SIZE;u!==null&&(u.get(lt.ERROR_CORRECTION)!==void 0&&(l=je.fromString(u.get(lt.ERROR_CORRECTION).toString())),u.get(lt.MARGIN)!==void 0&&(d=Number.parseInt(u.get(lt.MARGIN).toString(),10)));const p=qe.encode(i,l,u);return this.renderResult(p,o,c,d)}writeToDom(i,o,c,u,l=null){typeof i=="string"&&(i=document.querySelector(i));const d=this.write(o,c,u,l);i&&i.appendChild(d)}renderResult(i,o,c,u){const l=i.getMatrix();if(l===null)throw new Ar;const d=l.getWidth(),p=l.getHeight(),v=d+u*2,y=p+u*2,_=Math.max(o,v),I=Math.max(c,y),S=Math.min(Math.floor(_/v),Math.floor(I/y)),R=Math.floor((_-d*S)/2),M=Math.floor((I-p*S)/2),B=this.createSVGElement(_,I);for(let V=0,z=M;Vo||l+p>c)throw new A("Crop rectangle does not fit within image data.");v&&this.reverseHorizontal(d,p)}getRow(i,o){if(i<0||i>=this.getHeight())throw new A("Requested row is outside the image: "+i);const c=this.getWidth();(o==null||o.length>16&255,R=I>>7&510,M=I&255;y[_]=(S+R+M)/4&255}this.luminances=y}else this.luminances=i;if(u===void 0&&(this.dataWidth=o),l===void 0&&(this.dataHeight=c),d===void 0&&(this.left=0),p===void 0&&(this.top=0),this.left+o>this.dataWidth||this.top+c>this.dataHeight)throw new A("Crop rectangle does not fit within image data.")}getRow(i,o){if(i<0||i>=this.getHeight())throw new A("Requested row is outside the image: "+i);const c=this.getWidth();(o==null||o.length"}}class Vi extends ln{constructor(i,o,c){super(i,0,0),this.binaryShiftStart=o,this.binaryShiftByteCount=c}appendTo(i,o){for(let c=0;c62?i.appendBits(this.binaryShiftByteCount-31,16):c===0?i.appendBits(Math.min(this.binaryShiftByteCount,31),5):i.appendBits(this.binaryShiftByteCount-31,5)),i.appendBits(o[this.binaryShiftStart+c],8)}addBinaryShift(i,o){return new Vi(this,i,o)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function M1(m,i,o){return new Vi(m,i,o)}function Nn(m,i,o){return new ln(m,i,o)}const P1=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],kr=0,$n=1,sr=2,za=3,mr=4,B1=new ln(null,0,0),Hi=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function L1(m){for(let i of m)D.fill(i,-1);return m[kr][mr]=0,m[$n][mr]=0,m[$n][kr]=28,m[za][mr]=0,m[sr][mr]=0,m[sr][kr]=15,m}const Ya=L1(D.createInt32Array(6,6));class Ir{constructor(i,o,c,u){this.token=i,this.mode=o,this.binaryShiftByteCount=c,this.bitCount=u}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(i,o){let c=this.bitCount,u=this.token;if(i!==this.mode){let d=Hi[this.mode][i];u=Nn(u,d&65535,d>>16),c+=d>>16}let l=i===sr?4:5;return u=Nn(u,o,l),new Ir(u,i,0,c+l)}shiftAndAppend(i,o){let c=this.token,u=this.mode===sr?4:5;return c=Nn(c,Ya[this.mode][i],u),c=Nn(c,o,5),new Ir(c,this.mode,0,this.bitCount+u+5)}addBinaryShiftChar(i){let o=this.token,c=this.mode,u=this.bitCount;if(this.mode===mr||this.mode===sr){let p=Hi[c][kr];o=Nn(o,p&65535,p>>16),u+=p>>16,c=kr}let l=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,d=new Ir(o,c,this.binaryShiftByteCount+1,u+l);return d.binaryShiftByteCount===2078&&(d=d.endBinaryShift(i+1)),d}endBinaryShift(i){if(this.binaryShiftByteCount===0)return this;let o=this.token;return o=M1(o,i-this.binaryShiftByteCount,this.binaryShiftByteCount),new Ir(o,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(i){let o=this.bitCount+(Hi[this.mode][i.mode]>>16);return this.binaryShiftByteCounti.binaryShiftByteCount&&i.binaryShiftByteCount>0&&(o+=10),o<=i.bitCount}toBitArray(i){let o=[];for(let u=this.endBinaryShift(i.length).token;u!==null;u=u.getPrevious())o.unshift(u);let c=new k;for(const u of o)u.appendTo(c,i);return c}toString(){return Z.format("%s bits=%d bytes=%d",P1[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(i){return i.binaryShiftByteCount>62?21:i.binaryShiftByteCount>31?20:i.binaryShiftByteCount>0?10:0}}Ir.INITIAL_STATE=new Ir(B1,kr,0,0);function F1(m){const i=Z.getCharCode(" "),o=Z.getCharCode("."),c=Z.getCharCode(",");m[kr][i]=1;const u=Z.getCharCode("Z"),l=Z.getCharCode("A");for(let S=l;S<=u;S++)m[kr][S]=S-l+2;m[$n][i]=1;const d=Z.getCharCode("z"),p=Z.getCharCode("a");for(let S=p;S<=d;S++)m[$n][S]=S-p+2;m[sr][i]=1;const v=Z.getCharCode("9"),y=Z.getCharCode("0");for(let S=y;S<=v;S++)m[sr][S]=S-y+2;m[sr][c]=12,m[sr][o]=13;const _=["\0"," ","","","","","","","\x07","\b"," ",` `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let S=0;S<_.length;S++)m[za][Z.getCharCode(_[S])]=S;const I=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let S=0;S0&&(m[mr][Z.getCharCode(I[S])]=S);return m}const Gi=F1(D.createInt32Array(5,256));class Rn{constructor(i){this.text=i}encode(){const i=Z.getCharCode(" "),o=Z.getCharCode(` `);let c=Wa.singletonList(Ir.INITIAL_STATE);for(let l=0;l0?(c=Rn.updateStateListForPair(c,l,d),l++):c=this.updateStateListForChar(c,l)}return Wa.min(c,(l,d)=>l.getBitCount()-d.getBitCount()).toBitArray(this.text)}updateStateListForChar(i,o){const c=[];for(let u of i)this.updateStateForChar(u,o,c);return Rn.simplifyStates(c)}updateStateForChar(i,o,c){let u=this.text[o]&255,l=Gi[i.getMode()][u]>0,d=null;for(let p=0;p<=mr;p++){let v=Gi[p][u];if(v>0){if(d==null&&(d=i.endBinaryShift(o)),!l||p===i.getMode()||p===sr){const y=d.latchAndAppend(p,v);c.push(y)}if(!l&&Ya[i.getMode()][p]>=0){const y=d.shiftAndAppend(p,v);c.push(y)}}}if(i.getBinaryShiftByteCount()>0||Gi[i.getMode()][u]===0){let p=i.addBinaryShiftChar(o);c.push(p)}}static updateStateListForPair(i,o,c){const u=[];for(let l of i)this.updateStateForPair(l,o,c,u);return this.simplifyStates(u)}static updateStateForPair(i,o,c,u){let l=i.endBinaryShift(o);if(u.push(l.latchAndAppend(mr,c)),i.getMode()!==mr&&u.push(l.shiftAndAppend(mr,c)),c===3||c===4){let d=l.latchAndAppend(sr,16-c).latchAndAppend(sr,1);u.push(d)}if(i.getBinaryShiftByteCount()>0){let d=i.addBinaryShiftChar(o).addBinaryShiftChar(o+1);u.push(d)}}static simplifyStates(i){let o=[];for(const c of i){let u=!0;for(const l of o){if(l.isBetterThanOrEqualTo(c)){u=!1;break}c.isBetterThanOrEqualTo(l)&&(o=o.filter(d=>d!==l))}u&&o.push(c)}return o}}class Ne{constructor(){}static encodeBytes(i){return Ne.encode(i,Ne.DEFAULT_EC_PERCENT,Ne.DEFAULT_AZTEC_LAYERS)}static encode(i,o,c){let u=new Rn(i).encode(),l=L.truncDivision(u.getSize()*o,100)+11,d=u.getSize()+l,p,v,y,_,I;if(c!==Ne.DEFAULT_AZTEC_LAYERS){if(p=c<0,v=Math.abs(c),v>(p?Ne.MAX_NB_BITS_COMPACT:Ne.MAX_NB_BITS))throw new A(Z.format("Illegal value %s for layers",c));y=Ne.totalBitsInLayer(v,p),_=Ne.WORD_SIZE[v];let J=y-y%_;if(I=Ne.stuffBits(u,_),I.getSize()+l>J)throw new A("Data to large for user specified layer");if(p&&I.getSize()>_*64)throw new A("Data to large for user specified layer")}else{_=0,I=null;for(let J=0;;J++){if(J>Ne.MAX_NB_BITS)throw new A("Data too large for an Aztec code");if(p=J<=3,v=p?J+1:J,y=Ne.totalBitsInLayer(v,p),d>y)continue;(I==null||_!==Ne.WORD_SIZE[v])&&(_=Ne.WORD_SIZE[v],I=Ne.stuffBits(u,_));let Se=y-y%_;if(!(p&&I.getSize()>_*64)&&I.getSize()+l<=Se)break}}let S=Ne.generateCheckWords(I,y,_),R=I.getSize()/_,M=Ne.generateModeMessage(p,v,R),B=(p?11:14)+v*4,V=new Int32Array(B),z;if(p){z=B;for(let J=0;J=u||i.get(d+v))&&(p|=1<0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]n&&(n=h,t=f)}if(!t)throw"No largest barcode found";return t},r.prototype.createBarcodeDetectorFormats=function(e){for(var t=[],n=0,a=e;n0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]=s&&(e.isClosed=!0,e.parentElement.removeChild(e.surface),t())})})},r.prototype.getCapabilities=function(){return new xs(this.getFirstTrackOrFail())},r})(),ps=(function(){function r(e){this.mediaStream=e}return r.prototype.render=function(e,t,n){return di(this,void 0,void 0,function(){return xi(this,function(a){return[2,gs.create(e,this.mediaStream,t,n)]})})},r.create=function(e){return di(this,void 0,void 0,function(){var t,n;return xi(this,function(a){switch(a.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return t={audio:!1,video:e},[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=a.sent(),[2,new r(n)]}})})},r})(),ao=function(r,e,t,n){function a(s){return s instanceof t?s:new t(function(f){f(s)})}return new(t||(t=Promise))(function(s,f){function h(w){try{g(n.next(w))}catch(A){f(A)}}function x(w){try{g(n.throw(w))}catch(A){f(A)}}function g(w){w.done?s(w.value):a(w.value).then(h,x)}g((n=n.apply(r,e||[])).next())})},oo=function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,f;return f={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function h(g){return function(w){return x([g,w])}}function x(g){if(n)throw new TypeError("Generator is already executing.");for(;f&&(f=0,g[0]&&(t=0)),t;)try{if(n=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,a=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]e&&(a.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),g=e),g};h(f.width),h(f.height),f.width=x(f.width)},r.prototype.validateQrboxConfig=function(e){if(typeof e!="number"&&typeof e!="function"&&(e.width===void 0||e.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},r.prototype.toQrdimensions=function(e,t,n){if(typeof n=="number")return{width:n,height:n};if(typeof n=="function")try{return n(e,t)}catch(a){throw new Error("qrbox config was passed as a function but it failed with unknown error"+a)}return n},r.prototype.setupUi=function(e,t,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(e,t,n);var a=Or(n.qrbox)?{width:e,height:t}:n.qrbox;this.validateQrboxConfig(a);var s=this.toQrdimensions(e,t,a);s.height>t&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var f=n.isShadedBoxEnabled()&&s.height<=t,h={x:0,y:0,width:e,height:t},x=f?this.getShadedRegionBounds(e,t,s):h,g=this.createCanvasElement(x.width,x.height),w={willReadFrequently:!0},A=g.getContext("2d",w);A.canvas.width=x.width,A.canvas.height=x.height,this.element.append(g),f&&this.possiblyInsertShadingElement(this.element,e,t,s),this.createScannerPausedUiElement(this.element),this.qrRegion=x,this.context=A,this.canvasElement=g},r.prototype.createScannerPausedUiElement=function(e){var t=document.createElement("div");t.innerText=gn.scannerPaused(),t.style.display="none",t.style.position="absolute",t.style.top="0px",t.style.zIndex="1",t.style.background="rgba(9, 9, 9, 0.46)",t.style.color="#FFECEC",t.style.textAlign="center",t.style.width="100%",e.appendChild(t),this.scannerPausedUiElement=t},r.prototype.scanContext=function(e,t){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(a){return e(a.text,$a.createFromQrcodeResult(a)),n.possiblyUpdateShaders(!0),!0}).catch(function(a){n.possiblyUpdateShaders(!1);var s=gn.codeParseError(a);return t(s,rs.createFrom(s)),!1})},r.prototype.foreverScan=function(e,t,n){var a=this;if(this.shouldScan&&this.renderedCamera){var s=this.renderedCamera.getSurface(),f=s.videoWidth/s.clientWidth,h=s.videoHeight/s.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var x=this.qrRegion.width*f,g=this.qrRegion.height*h,w=this.qrRegion.x*f,A=this.qrRegion.y*h;this.context.drawImage(s,w,A,x,g,0,0,this.qrRegion.width,this.qrRegion.height);var E=function(){a.foreverScanTimeout=setTimeout(function(){a.foreverScan(e,t,n)},a.getTimeoutFps(e.fps))};this.scanContext(t,n).then(function(C){!C&&e.disableFlip!==!0?(a.context.translate(a.context.canvas.width,0),a.context.scale(-1,1),a.scanContext(t,n).finally(function(){E()})):E()}).catch(function(C){a.logger.logError("Error happend while scanning context",C),E()})}},r.prototype.createVideoConstraints=function(e){if(typeof e=="string")return{deviceId:{exact:e}};if(typeof e=="object"){var t="facingMode",n="deviceId",a={user:!0,environment:!0},s="exact",f=function(b){if(b in a)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(b,"'")},h=Object.keys(e);if(h.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(h.length," keys");var x=Object.keys(e)[0];if(x!==t&&x!==n)throw"Only '".concat(t,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(x===t){var g=e.facingMode;if(typeof g=="string"){if(f(g))return{facingMode:g}}else if(typeof g=="object")if(s in g){if(f(g["".concat(s)]))return{facingMode:{exact:g["".concat(s)]}}}else throw"'facingMode' should be string or object with"+" ".concat(s," as key.");else{var w=typeof g;throw"Invalid type of 'facingMode' = ".concat(w)}}else{var A=e.deviceId;if(typeof A=="string")return{deviceId:A};if(typeof A=="object"){if(s in A)return{deviceId:{exact:A["".concat(s)]}};throw"'deviceId' should be string or object with"+" ".concat(s," as key.")}else{var E=typeof A;throw"Invalid type of 'deviceId' = ".concat(E)}}}var C=typeof e;throw"Invalid type of 'cameraIdOrConfig' = ".concat(C)},r.prototype.computeCanvasDrawConfig=function(e,t,n,a){if(e<=n&&t<=a){var s=(n-e)/2,f=(a-t)/2;return{x:s,y:f,width:e,height:t}}else{var h=e,x=t;return e>n&&(t=n/e*t,e=n),t>a&&(e=a/t*e,t=a),this.logger.log("Image downsampled from "+"".concat(h,"X").concat(x)+" to ".concat(e,"X").concat(t,".")),this.computeCanvasDrawConfig(e,t,n,a)}},r.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var e=document.getElementById(this.elementId);e&&(e.innerHTML="")},r.prototype.possiblyUpdateShaders=function(e){this.qrMatch!==e&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(t){t.style.backgroundColor=e?tr.BORDER_SHADER_MATCH_COLOR:tr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=e)},r.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},r.prototype.createCanvasElement=function(e,t,n){var a=e,s=t,f=document.createElement("canvas");return f.style.width="".concat(a,"px"),f.style.height="".concat(s,"px"),f.style.display="none",f.id=Or(n)?"qr-canvas":n,f},r.prototype.getShadedRegionBounds=function(e,t,n){if(n.width>e||n.height>t)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(e-n.width)/2,y:(t-n.height)/2,width:n.width,height:n.height}},r.prototype.possiblyInsertShadingElement=function(e,t,n,a){if(!(t-a.width<1||n-a.height<1)){var s=document.createElement("div");s.style.position="absolute";var f=(t-a.width)/2,h=(n-a.height)/2;if(s.style.borderLeft="".concat(f,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderRight="".concat(f,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderTop="".concat(h,"px solid rgba(0, 0, 0, 0.48)"),s.style.borderBottom="".concat(h,"px solid rgba(0, 0, 0, 0.48)"),s.style.boxSizing="border-box",s.style.top="0px",s.style.bottom="0px",s.style.left="0px",s.style.right="0px",s.id="".concat(tr.SHADED_REGION_ELEMENT_ID),t-a.width<11||n-a.height<11)this.hasBorderShaders=!1;else{var x=5,g=40;this.insertShaderBorders(s,g,x,-x,null,0,!0),this.insertShaderBorders(s,g,x,-x,null,0,!1),this.insertShaderBorders(s,g,x,null,-x,0,!0),this.insertShaderBorders(s,g,x,null,-x,0,!1),this.insertShaderBorders(s,x,g+x,-x,null,-x,!0),this.insertShaderBorders(s,x,g+x,null,-x,-x,!0),this.insertShaderBorders(s,x,g+x,-x,null,-x,!1),this.insertShaderBorders(s,x,g+x,null,-x,-x,!1),this.hasBorderShaders=!0}e.append(s)}},r.prototype.insertShaderBorders=function(e,t,n,a,s,f,h){var x=document.createElement("div");x.style.position="absolute",x.style.backgroundColor=tr.BORDER_SHADER_DEFAULT_COLOR,x.style.width="".concat(t,"px"),x.style.height="".concat(n,"px"),a!==null&&(x.style.top="".concat(a,"px")),s!==null&&(x.style.bottom="".concat(s,"px")),h?x.style.left="".concat(f,"px"):x.style.right="".concat(f,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(x),e.appendChild(x)},r.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},r.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},r.prototype.getTimeoutFps=function(e){return 1e3/e},r})(),co;(function(r){r[r.STATUS_DEFAULT=0]="STATUS_DEFAULT",r[r.STATUS_SUCCESS=1]="STATUS_SUCCESS",r[r.STATUS_WARNING=2]="STATUS_WARNING",r[r.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(co||(co={}));const Ss={props:{content:{type:Object,required:!0},uid:{type:String,required:!0},id:{type:String},wwElementState:{type:Object,required:!0},useForm:{type:Boolean,default:!0}},emits:["trigger-event","add-state","remove-state","update:content:effect","update:sidepanel-content"],setup(r,{emit:e}){const{value:t,setValue:n}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"code",type:"string",readonly:!0,defaultValue:""}),{value:a,setValue:s}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"cameras",type:"array",readonly:!0,defaultValue:[]}),f=Qt("pending"),h=Qt([]),{value:x,setValue:g}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"status",type:"string",readonly:!0,defaultValue:Xt(()=>f.value)}),{value:w,setValue:A}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"hasCamera",type:"boolean",readonly:!0,defaultValue:Xt(()=>{const k=r.content.cameraSelection;return(k==="custom"||!k)&&r.content.cameraName?!!h.value.find(K=>K.label===r.content.cameraName||K.id===r.content.cameraName)||!!r.content.cameraName:k==="user"||k==="environment"||!k})}),E=X1("_wwForm:useForm",()=>{}),C=Xt(()=>r.content.fieldName),b=Xt(()=>r.content.validation),T=Xt(()=>r.content.customValidation),P=Xt(()=>r.content.required);E(t,{fieldName:C,validation:b,customValidation:T,required:P,initialValue:Xt(()=>"")},{elementState:r.wwElementState,emit:e,sidepanelFormPath:"form",setValue:n});const F=Qt({status:x,value:t,hasCamera:w,cameras:a}),D={};return wwLib.wwElement.useRegisterElementLocalContext("qrScanner",F.value,D,'### QR Scanner local context\n\n#### Data available\n- `status`: Current scanning status ("pending", "scanning", "success", "error")\n- `value`: Last scanned QR code value\n- `hasCamera`: Boolean indicating if camera is available and configured\n- `cameras`: Array of available camera device names'),{codeValue:t,setCodeValue:n,camerasValue:a,setCamerasValue:s,lastCodeTimestamp:Qt(0),cameras:h,html5QrCode:Qt(void 0),resizeTimeout:Qt(void 0),scanningState:f}},computed:{elementId(){return this.id||`ww-input-qr-code-${this.uid}`},scanningStatus(){return this.scanningState},cameraConfig(){const r=this.content.cameraSelection;if((r==="custom"||!r)&&this.content.cameraName){const e=this.cameras.find(t=>t.label===this.content.cameraName||t.id===this.content.cameraName);return e?{type:"deviceId",value:e.id}:{type:"deviceId",value:this.content.cameraName}}return r==="user"?{type:"facingMode",value:"user"}:{type:"facingMode",value:"environment"}}},async mounted(){await this.init(),new ResizeObserver(e=>{clearTimeout(this.resizeTimeout),e[0].contentRect.width&&e[0].contentRect.height&&(this.resizeTimeout=setTimeout(async()=>{await this.refresh()},500))}).observe(this.$el)},async unmounted(){await this.stopScan()},watch:{async"content.cameraSelection"(r,e){e!==r&&await this.refresh()},async"content.cameraName"(r,e){e!==r&&await this.refresh()}},methods:{async init(){try{this.scanningState="pending",this.html5QrCode=new so(this.elementId),this.cameras=await so.getCameras(),this.cameras&&this.setCamerasValue(this.cameras.map(r=>r.label)),await this.startScan()}catch{this.scanningState="error"}},async refresh(){this.html5QrCode&&(await this.stopScan(),await this.startScan())},async stopScan(){var r;try{if(!this.html5QrCode)return;const e=this.html5QrCode.getState();e===2&&await this.html5QrCode.stop(),e!==1&&await this.html5QrCode.clear(),this.scanningState="pending"}catch(e){(r=e.message)!=null&&r.includes("Cannot clear while scan is ongoing")||(this.scanningState="error")}},async startScan(){var a;if(!this.html5QrCode||!((a=this.cameraConfig)!=null&&a.value))return;const r=this.$el.getBoundingClientRect();if(r.width===0||r.height===0)return;const e=r.width/(r.height||r.width*16/9);let t;const n={aspectRatio:isNaN(e)?9/16:e};this.cameraConfig.type==="facingMode"?t={facingMode:this.cameraConfig.value}:t=this.cameraConfig.value;try{this.scanningState="scanning";const s=this;await this.html5QrCode.start(t,n,(f,h)=>{const x=f;h.result.format.formatName==="QR_CODE"&&(Date.now()-s.lastCodeTimestamp<1e3&&x===s.codeValue?s.lastCodeTimestamp=Date.now():(s.lastCodeTimestamp=Date.now(),s.setCodeValue(x),s.scanningState="success",s.$emit("trigger-event",{name:"scan",event:{code:x}})))},f=>{f.includes("QR code found")||(this.scanningState="error")})}catch{this.scanningState="error"}}}},bs=["id"];function Ts(r,e,t,n,a,s){return fr(),Nr("div",{class:"ww-input-qr-code",id:s.elementId},null,8,bs)}const mu=vi(Ss,[["render",Ts],["__scopeId","data-v-655ba93e"]]);function Os(r,e){var t=Object.setPrototypeOf;t?t(r,e):r.__proto__=e}function Ns(r,e){e===void 0&&(e=r.constructor);var t=Error.captureStackTrace;t&&t(r,e)}var Rs=(function(){var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,s){a.__proto__=s}||function(a,s){for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(a[f]=s[f])},r(t,n)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Ds=(function(r){Rs(e,r);function e(t,n){var a=this.constructor,s=r.call(this,t,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),Os(s,a.prototype),Ns(s),s}return e})(Error),Ms=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),$t=(function(r){Ms(e,r);function e(t){t===void 0&&(t=void 0);var n=r.call(this,t)||this;return n.message=t,n}return e.prototype.getKind=function(){var t=this.constructor;return t.kind},e.kind="Exception",e})(Ds),Ps=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),pr=(function(r){Ps(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArgumentException",e})($t),Bs=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),xe=(function(r){Bs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IllegalArgumentException",e})($t),Ls=(function(){function r(e){if(this.binarizer=e,e===null)throw new xe("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(e,t){return this.binarizer.getBlackRow(e,t)},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(e,t,n,a){var s=this.binarizer.getLuminanceSource().crop(e,t,n,a);return new r(this.binarizer.createBinarizer(s))},r.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},r.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new r(this.binarizer.createBinarizer(e))},r.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new r(this.binarizer.createBinarizer(e))},r.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},r})(),Fs=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),_t=(function(r){Fs(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e})($t),ks=(function(){function r(e){this.source=e}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})(),Ke=(function(){function r(){}return r.arraycopy=function(e,t,n,a,s){for(;s--;)n[a++]=e[t++]},r.currentTimeMillis=function(){return Date.now()},r})(),Us=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),wa=(function(r){Us(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="IndexOutOfBoundsException",e})($t),Vs=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),fo=(function(r){Vs(e,r);function e(t,n){t===void 0&&(t=void 0),n===void 0&&(n=void 0);var a=r.call(this,n)||this;return a.index=t,a.message=n,a}return e.kind="ArrayIndexOutOfBoundsException",e})(wa),Hs=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pt=(function(){function r(){}return r.fill=function(e,t){for(var n=0,a=e.length;nn)throw new xe("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new fo(t);if(n>e)throw new fo(n)},r.asList=function(){for(var e=[],t=0;t>1,h=n(t,e[f]);if(h>0)a=f+1;else if(h<0)s=f-1;else return f}return-a-1},r.numberComparator=function(e,t){return e-t},r})(),Ie=(function(){function r(){}return r.numberOfTrailingZeros=function(e){var t;if(e===0)return 32;var n=31;return t=e<<16,t!==0&&(n-=16,e=t),t=e<<8,t!==0&&(n-=8,e=t),t=e<<4,t!==0&&(n-=4,e=t),t=e<<2,t!==0&&(n-=2,e=t),n-(e<<1>>>31)},r.numberOfLeadingZeros=function(e){if(e===0)return 32;var t=1;return e>>>16||(t+=16,e<<=16),e>>>24||(t+=8,e<<=8),e>>>28||(t+=4,e<<=4),e>>>30||(t+=2,e<<=2),t-=e>>>31,t},r.toHexString=function(e){return e.toString(16)},r.toBinaryString=function(e){return String(parseInt(String(e),2))},r.bitCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),e=e+(e>>>4)&252645135,e=e+(e>>>8),e=e+(e>>>16),e&63},r.truncDivision=function(e,t){return Math.trunc(e/t)},r.parseInt=function(e,t){return t===void 0&&(t=void 0),parseInt(e,t)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r})(),mt=(function(){function r(e,t){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,t==null?this.bits=r.makeArray(e):this.bits=t)}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(e){if(e>this.bits.length*32){var t=r.makeArray(e);Ke.arraycopy(this.bits,0,t,0,this.bits.length),this.bits=t}},r.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(e&31))!==0},r.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(e&31)},r.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(e&31)},r.prototype.getNextSet=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,a=Math.floor(e/32),s=n[a];s&=~((1<<(e&31))-1);for(var f=n.length;s===0;){if(++a===f)return t;s=n[a]}var h=a*32+Ie.numberOfTrailingZeros(s);return h>t?t:h},r.prototype.getNextUnset=function(e){var t=this.size;if(e>=t)return t;var n=this.bits,a=Math.floor(e/32),s=~n[a];s&=~((1<<(e&31))-1);for(var f=n.length;s===0;){if(++a===f)return t;s=~n[a]}var h=a*32+Ie.numberOfTrailingZeros(s);return h>t?t:h},r.prototype.setBulk=function(e,t){this.bits[Math.floor(e/32)]=t},r.prototype.setRange=function(e,t){if(tthis.size)throw new xe;if(t!==e){t--;for(var n=Math.floor(e/32),a=Math.floor(t/32),s=this.bits,f=n;f<=a;f++){var h=f>n?0:e&31,x=fthis.size)throw new xe;if(t===e)return!0;t--;for(var a=Math.floor(e/32),s=Math.floor(t/32),f=this.bits,h=a;h<=s;h++){var x=h>a?0:e&31,g=h32)throw new xe("Num bits must be between 0 and 32");this.ensureCapacity(this.size+t);for(var n=t;n>0;n--)this.appendBit((e>>n-1&1)===1)},r.prototype.appendBitArray=function(e){var t=e.size;this.ensureCapacity(this.size+t);for(var n=0;n>1&1431655765|(f&1431655765)<<1,f=f>>2&858993459|(f&858993459)<<2,f=f>>4&252645135|(f&252645135)<<4,f=f>>8&16711935|(f&16711935)<<8,f=f>>16&65535|(f&65535)<<16,e[t-s]=f}if(this.size!==n*32){for(var h=n*32-this.size,x=e[0]>>>h,s=1;s>>h}e[n-1]=x}this.bits=e},r.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.size===t.size&&pt.equals(this.bits,t.bits)},r.prototype.hashCode=function(){return 31*this.size+pt.hashCode(this.bits)},r.prototype.toString=function(){for(var e="",t=0,n=this.size;t=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ve;(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"})(Ve||(Ve={}));var gt=(function(){function r(e,t,n){for(var a,s,f=[],h=3;h=900)throw new re("incorect value");var t=r.VALUES_TO_ECI.get(e);if(t===void 0)throw new re("incorect value");return t},r.getCharacterSetECIByName=function(e){var t=r.NAME_TO_ECI.get(e);if(t===void 0)throw new re("incorect value");return t},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;return this.getName()===t.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(Ve.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(Ve.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(Ve.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(Ve.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(Ve.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(Ve.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(Ve.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(Ve.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(Ve.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(Ve.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(Ve.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(Ve.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(Ve.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(Ve.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(Ve.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(Ve.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(Ve.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(Ve.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(Ve.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(Ve.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(Ve.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(Ve.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(Ve.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(Ve.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(Ve.Big5,28,"Big5"),r.GB18030=new r(Ve.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(Ve.EUC_KR,30,"EUC_KR","EUC-KR"),r})(),Ws=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),fi=(function(r){Ws(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="UnsupportedOperationException",e})($t),lr=(function(){function r(){}return r.decode=function(e,t){var n=this.encodingName(t);return this.customDecoder?this.customDecoder(e,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(e,n):new TextDecoder(n).decode(e)},r.shouldDecodeOnFallback=function(e){return!r.isBrowser()&&e==="ISO-8859-1"},r.encode=function(e,t){var n=this.encodingName(t);return this.customEncoder?this.customEncoder(e,n):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(e){return typeof e=="string"?e:e.getName()},r.encodingCharacterSet=function(e){return e instanceof gt?e:gt.getCharacterSetECIByName(e)},r.decodeFallback=function(e,t){var n=this.encodingCharacterSet(t);if(r.isDecodeFallbackSupported(n)){for(var a="",s=0,f=e.length;s3&&e[0]===239&&e[1]===187&&e[2]===191,L=0;L0?(k&128)===0?f=!1:h--:(k&128)!==0&&((k&64)===0?f=!1:(h++,(k&32)===0?x++:(h++,(k&16)===0?g++:(h++,(k&8)===0?w++:f=!1))))),a&&(k>127&&k<160?a=!1:k>159&&(k<192||k===215||k===247)&&F++),s&&(A>0?k<64||k===127||k>252?s=!1:A--:k===128||k===160||k>239?s=!1:k>160&&k<224?(E++,b=0,C++,C>T&&(T=C)):k>127?(A++,C=0,b++,b>P&&(P=b)):(C=0,b=0))}return f&&h>0&&(f=!1),s&&A>0&&(s=!1),f&&(D||x+g+w>0)?r.UTF8:s&&(r.ASSUME_SHIFT_JIS||T>=3||P>=3)?r.SHIFT_JIS:a&&s?T===2&&E===2||F*10>=n?r.SHIFT_JIS:r.ISO88591:a?r.ISO88591:s?r.SHIFT_JIS:f?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(e){for(var t=[],n=1;nf){if(h===-1)h=s-f;else if(s-f!==h)throw new xe("row lengths do not match");f=s,x++}g++}else if(e.substring(g,g+t.length)===t)g+=t.length,a[s]=!0,s++;else if(e.substring(g,g+n.length)===n)g+=n.length,a[s]=!1,s++;else throw new xe("illegal character encountered: "+e.substring(g));if(s>f){if(h===-1)h=s-f;else if(s-f!==h)throw new xe("row lengths do not match");x++}for(var w=new r(h,x),A=0;A>>(e&31)&1)!==0},r.prototype.set=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295},r.prototype.unset=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)},r.prototype.flip=function(e,t){var n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295},r.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new xe("input matrix dimensions do not match");for(var t=new mt(Math.floor(this.width/32)+1),n=this.rowSize,a=this.bits,s=0,f=this.height;sthis.height||s>this.width)throw new xe("The region must fit inside the matrix");for(var h=this.rowSize,x=this.bits,g=t;gx&&(x=g),w*32h){for(var E=31;!(A>>>E);)E--;w*32+E>h&&(h=w*32+E)}}}return h=0&&t[n]===0;)n--;if(n<0)return null;for(var a=Math.floor(n/e),s=Math.floor(n%e)*32,f=t[n],h=31;!(f>>>h);)h--;return s+=h,Int32Array.from([s,a])},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(e){if(!(e instanceof r))return!1;var t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&pt.equals(this.bits,t.bits)},r.prototype.hashCode=function(){var e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+pt.hashCode(this.bits),e},r.prototype.toString=function(e,t,n){return e===void 0&&(e="X "),t===void 0&&(t=" "),n===void 0&&(n=` `),this.buildToString(e,t,n)},r.prototype.buildToString=function(e,t,n){for(var a=new Ce,s=0,f=this.height;s>e.LUMINANCE_SHIFT]++;var g=e.estimateBlackPoint(h);if(s<3)for(var x=0;x>e.LUMINANCE_SHIFT]++}for(var C=e.estimateBlackPoint(f),b=t.getMatrix(),h=0;hf&&(s=h,f=t[h]),t[h]>a&&(a=t[h]);for(var x=0,g=0,h=0;hg&&(x=h,g=A)}if(s>x){var E=s;s=x,x=E}if(x-s<=n/16)throw new j;for(var C=x-1,b=-1,h=x-1;h>s;h--){var T=h-s,A=T*T*(x-h)*(a-t[h]);A>b&&(C=h,b=A)}return C<=e.MINIMUM_DIMENSION&&a>=e.MINIMUM_DIMENSION){var s=t.getMatrix(),f=n>>e.BLOCK_SIZE_POWER;(n&e.BLOCK_SIZE_MASK)!==0&&f++;var h=a>>e.BLOCK_SIZE_POWER;(a&e.BLOCK_SIZE_MASK)!==0&&h++;var x=e.calculateBlackPoints(s,f,h,n,a),g=new br(n,a);e.calculateThresholdForBlock(s,f,h,n,a,x,g),this.matrix=g}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,n,a,s,f,h,x){for(var g=f-e.BLOCK_SIZE,w=s-e.BLOCK_SIZE,A=0;Ag&&(E=g);for(var C=e.cap(A,2,a-3),b=0;bw&&(T=w);for(var P=e.cap(b,2,n-3),F=0,D=-2;D<=2;D++){var L=h[C+D];F+=L[P-2]+L[P-1]+L[P]+L[P+1]+L[P+2]}var k=F/25;e.thresholdBlock(t,T,E,k,s,x)}}},e.cap=function(t,n,a){return ta?a:t},e.thresholdBlock=function(t,n,a,s,f,h){for(var x=0,g=a*f+n;xh&&(A=h);for(var E=0;Ex&&(C=x);for(var b=0,T=255,P=0,F=0,D=A*s+C;FP&&(P=k)}if(P-T>e.MIN_DYNAMIC_RANGE)for(F++,D+=s;F>e.BLOCK_SIZE_POWER*2;if(P-T<=e.MIN_DYNAMIC_RANGE&&(q=T/2,w>0&&E>0)){var K=(g[w-1][E]+2*g[w][E-1]+g[w-1][E-1])/4;T>10}s[h]=g}else for(var f=0,h=0,b=t.length;f>10}s[h]=255-g}return s},e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new xe("Requested row is outside the image: "+t);var a=this.getWidth(),s=t*a;return n===null?n=this.buffer.slice(s,s+a):(n.length0&&s[s.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},An=(function(){function r(e,t,n){t===void 0&&(t=500),this.reader=e,this.timeBetweenScansMillis=t,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(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return Vt(this,void 0,void 0,function(){var e,t,n,a,s,f,h,x,g,w,A,E;return Ht(this,function(C){switch(C.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:e=C.sent(),t=[];try{for(n=e0(e),a=n.next();!a.done;a=n.next())s=a.value,f=s.kind==="video"?"videoinput":s.kind,f==="videoinput"&&(h=s.deviceId||s.id,x=s.label||"Video device "+(t.length+1),g=s.groupId,w={deviceId:h,label:x,kind:f,groupId:g},t.push(w))}catch(b){A={error:b}}finally{try{a&&!a.done&&(E=n.return)&&E.call(n)}finally{if(A)throw A.error}}return[2,t]}})})},r.prototype.getVideoInputDevices=function(){return Vt(this,void 0,void 0,function(){var e;return Ht(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return e=t.sent(),[2,e.map(function(n){return new $s(n.deviceId,n.label)})]}})})},r.prototype.findDeviceById=function(e){return Vt(this,void 0,void 0,function(){var t;return Ht(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return t=n.sent(),t?[2,t.find(function(a){return a.deviceId===e})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(e,t){return Vt(this,void 0,void 0,function(){return Ht(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,t)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(e,t){return Vt(this,void 0,void 0,function(){var n,a;return Ht(this,function(s){switch(s.label){case 0:return this.reset(),e?n={deviceId:{exact:e}}:n={facingMode:"environment"},a={video:n},[4,this.decodeOnceFromConstraints(a,t)];case 1:return[2,s.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(e,t){return Vt(this,void 0,void 0,function(){var n;return Ht(this,function(a){switch(a.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return n=a.sent(),[4,this.decodeOnceFromStream(n,t)];case 2:return[2,a.sent()]}})})},r.prototype.decodeOnceFromStream=function(e,t){return Vt(this,void 0,void 0,function(){var n,a;return Ht(this,function(s){switch(s.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return n=s.sent(),[4,this.decodeOnce(n)];case 2:return a=s.sent(),[2,a]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(e,t,n){return Vt(this,void 0,void 0,function(){return Ht(this,function(a){switch(a.label){case 0:return[4,this.decodeFromVideoDevice(e,t,n)];case 1:return[2,a.sent()]}})})},r.prototype.decodeFromVideoDevice=function(e,t,n){return Vt(this,void 0,void 0,function(){var a,s;return Ht(this,function(f){switch(f.label){case 0:return e?a={deviceId:{exact:e}}:a={facingMode:"environment"},s={video:a},[4,this.decodeFromConstraints(s,t,n)];case 1:return[2,f.sent()]}})})},r.prototype.decodeFromConstraints=function(e,t,n){return Vt(this,void 0,void 0,function(){var a;return Ht(this,function(s){switch(s.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return a=s.sent(),[4,this.decodeFromStream(a,t,n)];case 2:return[2,s.sent()]}})})},r.prototype.decodeFromStream=function(e,t,n){return Vt(this,void 0,void 0,function(){var a;return Ht(this,function(s){switch(s.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,t)];case 1:return a=s.sent(),[4,this.decodeContinuously(a,n)];case 2:return[2,s.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(e,t){return Vt(this,void 0,void 0,function(){var n;return Ht(this,function(a){switch(a.label){case 0:return n=this.prepareVideoElement(t),this.addVideoSource(n,e),this.videoElement=n,this.stream=e,[4,this.playVideoOnLoadAsync(n)];case 1:return a.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(e){var t=this;return new Promise(function(n,a){return t.playVideoOnLoad(e,function(){return n()})})},r.prototype.playVideoOnLoad=function(e,t){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",t),this.tryPlayVideo(e)},r.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},r.prototype.tryPlayVideo=function(e){return Vt(this,void 0,void 0,function(){return Ht(this,function(t){switch(t.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,e.play()];case 2:return t.sent(),[3,4];case 3:return t.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(e,t){var n=document.getElementById(e);if(!n)throw new pr("element with id '"+e+"' not found");if(n.nodeName.toLowerCase()!==t.toLowerCase())throw new pr("element with id '"+e+"' must be an "+t+" element");return n},r.prototype.decodeFromImage=function(e,t){if(!e&&!t)throw new pr("either imageElement with a src set or an url must be provided");return t&&!e?this.decodeFromImageUrl(t):this.decodeFromImageElement(e)},r.prototype.decodeFromVideo=function(e,t){if(!e&&!t)throw new pr("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrl(t):this.decodeFromVideoElement(e)},r.prototype.decodeFromVideoContinuously=function(e,t,n){if(e===void 0&&t===void 0)throw new pr("Either an element with a src set or an URL must be provided");return t&&!e?this.decodeFromVideoUrlContinuously(t,n):this.decodeFromVideoElementContinuously(e,n)},r.prototype.decodeFromImageElement=function(e){if(!e)throw new pr("An image element must be provided.");this.reset();var t=this.prepareImageElement(e);this.imageElement=t;var n;return this.isImageLoaded(t)?n=this.decodeOnce(t,!1,!0):n=this._decodeOnLoadImage(t),n},r.prototype.decodeFromVideoElement=function(e){var t=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(t)},r.prototype.decodeFromVideoElementContinuously=function(e,t){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(n,t)},r.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new pr("A video element must be provided.");this.reset();var t=this.prepareVideoElement(e);return this.videoElement=t,t},r.prototype.decodeFromImageUrl=function(e){if(!e)throw new pr("An URL must be provided.");this.reset();var t=this.prepareImageElement();this.imageElement=t;var n=this._decodeOnLoadImage(t);return t.src=e,n},r.prototype.decodeFromVideoUrl=function(e){if(!e)throw new pr("An URL must be provided.");this.reset();var t=this.prepareVideoElement(),n=this.decodeFromVideoElement(t);return t.src=e,n},r.prototype.decodeFromVideoUrlContinuously=function(e,t){if(!e)throw new pr("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),a=this.decodeFromVideoElementContinuously(n,t);return n.src=e,a},r.prototype._decodeOnLoadImage=function(e){var t=this;return new Promise(function(n,a){t.imageLoadedListener=function(){return t.decodeOnce(e,!1,!0).then(n,a)},e.addEventListener("load",t.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(e){return Vt(this,void 0,void 0,function(){return Ht(this,function(t){switch(t.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return t.sent(),[4,this.decodeOnce(e)];case 2:return[2,t.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(e,t){return Vt(this,void 0,void 0,function(){return Ht(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),this.decodeContinuously(e,t),[2]}})})},r.prototype.isImageLoaded=function(e){return!(!e.complete||e.naturalWidth===0)},r.prototype.prepareImageElement=function(e){var t;return typeof e>"u"&&(t=document.createElement("img"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(t=e),t},r.prototype.prepareVideoElement=function(e){var t;return!e&&typeof document<"u"&&(t=document.createElement("video"),t.width=200,t.height=200),typeof e=="string"&&(t=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(t=e),t.setAttribute("autoplay","true"),t.setAttribute("muted","true"),t.setAttribute("playsinline","true"),t},r.prototype.decodeOnce=function(e,t,n){var a=this;t===void 0&&(t=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var s=function(f,h){if(a._stopAsyncDecode){h(new j("Video stream has ended before any code could be detected.")),a._stopAsyncDecode=void 0;return}try{var x=a.decode(e);f(x)}catch(E){var g=t&&E instanceof j,w=E instanceof _t||E instanceof re,A=w&&n;if(g||A)return setTimeout(s,a._timeBetweenDecodingAttempts,f,h);h(E)}};return new Promise(function(f,h){return s(f,h)})},r.prototype.decodeContinuously=function(e,t){var n=this;this._stopContinuousDecode=!1;var a=function(){if(n._stopContinuousDecode){n._stopContinuousDecode=void 0;return}try{var s=n.decode(e);t(s,null),setTimeout(a,n.timeBetweenScansMillis)}catch(x){t(null,x);var f=x instanceof _t||x instanceof re,h=x instanceof j;(f||h)&&setTimeout(a,n._timeBetweenDecodingAttempts)}};a()},r.prototype.decode=function(e){var t=this.createBinaryBitmap(e);return this.decodeBitmap(t)},r.prototype.createBinaryBitmap=function(e){this.getCaptureCanvasContext(e),e instanceof HTMLVideoElement?this.drawFrameOnCanvas(e):this.drawImageOnCanvas(e);var t=this.getCaptureCanvas(e),n=new Js(t),a=new Ks(n);return new Ls(a)},r.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var t=this.getCaptureCanvas(e),n=void 0;try{n=t.getContext("2d",{willReadFrequently:!0})}catch{n=t.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var t=this.createCaptureCanvas(e);this.captureCanvas=t}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.videoWidth,sHeight:e.videoHeight,dx:0,dy:0,dWidth:e.videoWidth,dHeight:e.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.drawImageOnCanvas=function(e,t,n){t===void 0&&(t={sx:0,sy:0,sWidth:e.naturalWidth,sHeight:e.naturalHeight,dx:0,dy:0,dWidth:e.naturalWidth,dHeight:e.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(e,t.sx,t.sy,t.sWidth,t.sHeight,t.dx,t.dy,t.dWidth,t.dHeight)},r.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},r.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var t=document.createElement("canvas"),n,a;return typeof e<"u"&&(e instanceof HTMLVideoElement?(n=e.videoWidth,a=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,a=e.naturalHeight||e.height)),t.style.width=n+"px",t.style.height=a+"px",t.width=n,t.height=a,t},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.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(e,t){try{e.srcObject=t}catch{e.src=URL.createObjectURL(t)}},r.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},r})(),Bt=(function(){function r(e,t,n,a,s,f){n===void 0&&(n=t==null?0:8*t.length),f===void 0&&(f=Ke.currentTimeMillis()),this.text=e,this.rawBytes=t,this.numBits=n,this.resultPoints=a,this.format=s,this.timestamp=f,this.text=e,this.rawBytes=t,n==null?this.numBits=t==null?0:8*t.length:this.numBits=n,this.resultPoints=a,this.format=s,this.resultMetadata=null,f==null?this.timestamp=Ke.currentTimeMillis():this.timestamp=f}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(e,t){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,t)},r.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},r.prototype.addResultPoints=function(e){var t=this.resultPoints;if(t===null)this.resultPoints=e;else if(e!==null&&e.length>0){var n=new Array(t.length+e.length);Ke.arraycopy(t,0,n,0,t.length),Ke.arraycopy(e,0,n,t.length,e.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r})(),ia;(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"})(ia||(ia={}));const se=ia;var aa;(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"})(aa||(aa={}));const Rt=aa;var Ai=(function(){function r(e,t,n,a,s,f){s===void 0&&(s=-1),f===void 0&&(f=-1),this.rawBytes=e,this.text=t,this.byteSegments=n,this.ecLevel=a,this.structuredAppendSequenceNumber=s,this.structuredAppendParity=f,this.numBits=e==null?0:8*e.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(e){this.numBits=e},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(e){this.errorsCorrected=e},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(e){this.erasures=e},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(e){this.other=e},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})(),Ln=(function(){function r(){}return r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new xe;return this.logTable[e]},r.addOrSubtract=function(e,t){return e^t},r})(),Gr=(function(){function r(e,t){if(t.length===0)throw new xe;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var a=1;an.length){var a=t;t=n,n=a}var s=new Int32Array(n.length),f=n.length-t.length;Ke.arraycopy(n,0,s,0,f);for(var h=f;h=e.getDegree()&&!a.isZero();){var h=a.getDegree()-e.getDegree(),x=t.multiply(a.getCoefficient(a.getDegree()),f),g=e.multiplyByMonomial(h,x),w=t.buildMonomial(h,x);n=n.addOrSubtract(w),a=a.addOrSubtract(g)}return[n,a]},r.prototype.toString=function(){for(var e="",t=this.getDegree();t>=0;t--){var n=this.getCoefficient(t);if(n!==0){if(n<0?(e+=" - ",n=-n):e.length>0&&(e+=" + "),t===0||n!==1){var a=this.field.log(n);a===0?e+="1":a===1?e+="a":(e+="a^",e+=a)}t!==0&&(t===1?e+="x":(e+="x^",e+=t))}}return e},r})(),t0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Ko=(function(r){t0(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ArithmeticException",e})($t),r0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Jt=(function(r){r0(e,r);function e(t,n,a){var s=r.call(this)||this;s.primitive=t,s.size=n,s.generatorBase=a;for(var f=new Int32Array(n),h=1,x=0;x=n&&(h^=t,h&=n-1);s.expTable=f;for(var g=new Int32Array(n),x=0;x=(n/2|0);){var w=f,A=x;if(f=h,x=g,f.isZero())throw new ri("r_{i-1} was zero");h=w;for(var E=s.getZero(),C=f.getCoefficient(f.getDegree()),b=s.inverse(C);h.getDegree()>=f.getDegree()&&!h.isZero();){var T=h.getDegree()-f.getDegree(),P=s.multiply(h.getCoefficient(h.getDegree()),b);E=E.addOrSubtract(s.buildMonomial(T,P)),h=h.addOrSubtract(f.multiplyByMonomial(T,P))}if(g=E.multiply(x).addOrSubtract(A),h.getDegree()>=f.getDegree())throw new Hn("Division algorithm failed to reduce polynomial?")}var F=g.getCoefficient(0);if(F===0)throw new ri("sigmaTilde(0) was zero");var D=s.inverse(F),L=g.multiplyScalar(D),k=h.multiplyScalar(D);return[L,k]},r.prototype.findErrorLocations=function(e){var t=e.getDegree();if(t===1)return Int32Array.from([e.getCoefficient(1)]);for(var n=new Int32Array(t),a=0,s=this.field,f=1;f1,b,b+n-1),b+=n-1;else for(var T=n-1;T>=0;--T)C[b++]=(E&1<=8?r.readCode(e,t,8):r.readCode(e,t,n)<<8-n},r.convertBoolArrayToByteArray=function(e){for(var t=new Uint8Array((e.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})(),De=(function(){function r(){}return r.round=function(e){return isNaN(e)?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},r.distance=function(e,t,n,a){var s=e-n,f=t-a;return Math.sqrt(s*s+f*f)},r.sum=function(e){for(var t=0,n=0,a=e.length;n!==a;n++){var s=e[n];t+=s}return t},r})(),oa=(function(){function r(){}return r.floatToIntBits=function(e){return e},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r})(),ce=(function(){function r(e,t){this.x=e,this.y=t}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(e){if(e instanceof r){var t=e;return this.x===t.x&&this.y===t.y}return!1},r.prototype.hashCode=function(){return 31*oa.floatToIntBits(this.x)+oa.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(e){var t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),a=this.distance(e[0],e[2]),s,f,h;if(n>=t&&n>=a?(f=e[0],s=e[1],h=e[2]):a>=n&&a>=t?(f=e[1],s=e[0],h=e[2]):(f=e[2],s=e[0],h=e[1]),this.crossProductZ(s,f,h)<0){var x=s;s=h,h=x}e[0]=s,e[1]=f,e[2]=h},r.distance=function(e,t){return De.distance(e.x,e.y,t.x,t.y)},r.crossProductZ=function(e,t,n){var a=t.x,s=t.y;return(n.x-a)*(e.y-s)-(n.y-s)*(e.x-a)},r})(),ya=(function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r})(),a0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),o0=(function(r){a0(e,r);function e(t,n,a,s,f){var h=r.call(this,t,n)||this;return h.compact=a,h.nbDatablocks=s,h.nbLayers=f,h}return e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e})(ya),sa=(function(){function r(e,t,n,a){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=r.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),a==null&&(a=e.getHeight()/2|0);var s=t/2|0;if(this.leftInit=n-s,this.rightInit=n+s,this.upInit=a-s,this.downInit=a+s,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new j}return r.prototype.detect=function(){for(var e=this.leftInit,t=this.rightInit,n=this.upInit,a=this.downInit,s=!1,f=!0,h=!1,x=!1,g=!1,w=!1,A=!1,E=this.width,C=this.height;f;){f=!1;for(var b=!0;(b||!x)&&t=E){s=!0;break}for(var T=!0;(T||!g)&&a=C){s=!0;break}for(var P=!0;(P||!w)&&e>=0;)P=this.containsBlackPoint(n,a,e,!1),P?(e--,f=!0,w=!0):w||e--;if(e<0){s=!0;break}for(var F=!0;(F||!A)&&n>=0;)F=this.containsBlackPoint(e,t,n,!0),F?(n--,f=!0,A=!0):A||n--;if(n<0){s=!0;break}f&&(h=!0)}if(!s&&h){for(var D=t-e,L=null,k=1;L===null&&kn||x<-1||x>a)throw new j;s=!1,h===-1?(t[f]=0,s=!0):h===n&&(t[f]=n-1,s=!0),x===-1?(t[f+1]=0,s=!0):x===a&&(t[f+1]=a-1,s=!0)}s=!0;for(var f=t.length-2;f>=0&&s;f-=2){var h=Math.floor(t[f]),x=Math.floor(t[f+1]);if(h<-1||h>n||x<-1||x>a)throw new j;s=!1,h===-1?(t[f]=0,s=!0):h===n&&(t[f]=n-1,s=!0),x===-1?(t[f+1]=0,s=!0):x===a&&(t[f+1]=a-1,s=!0)}},r})(),qo=(function(){function r(e,t,n,a,s,f,h,x,g){this.a11=e,this.a21=t,this.a31=n,this.a12=a,this.a22=s,this.a32=f,this.a13=h,this.a23=x,this.a33=g}return r.quadrilateralToQuadrilateral=function(e,t,n,a,s,f,h,x,g,w,A,E,C,b,T,P){var F=r.quadrilateralToSquare(e,t,n,a,s,f,h,x),D=r.squareToQuadrilateral(g,w,A,E,C,b,T,P);return D.times(F)},r.prototype.transformPoints=function(e){for(var t=e.length,n=this.a11,a=this.a12,s=this.a13,f=this.a21,h=this.a22,x=this.a23,g=this.a31,w=this.a32,A=this.a33,E=0;E>1&127):(a<<=10,a+=(f>>2&992)+(f>>1&31))}var h=this.getCorrectedParameterData(a,this.compact);this.compact?(this.nbLayers=(h>>6)+1,this.nbDataBlocks=(h&63)+1):(this.nbLayers=(h>>11)+1,this.nbDataBlocks=(h&2047)+1)},r.prototype.getRotation=function(e,t){var n=0;e.forEach(function(s,f,h){var x=(s>>t-2<<1)+(s&1);n=(n<<3)+x}),n=((n&1)<<11)+(n>>1);for(var a=0;a<4;a++)if(Ie.bitCount(n^this.EXPECTED_CORNER_BITS[a])<=2)return a;throw new j},r.prototype.getCorrectedParameterData=function(e,t){var n,a;t?(n=7,a=2):(n=10,a=4);for(var s=n-a,f=new Int32Array(n),h=n-1;h>=0;--h)f[h]=e&15,e>>=4;try{var x=new yi(Jt.AZTEC_PARAM);x.decode(f,s)}catch{throw new j}for(var g=0,h=0;h2){var A=this.distancePoint(w,h)*this.nbCenterLayers/(this.distancePoint(s,t)*(this.nbCenterLayers+2));if(A<.75||A>1.25||!this.isWhiteOrBlackRectangle(h,x,g,w))break}t=h,n=x,a=g,s=w,f=!f}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new j;this.compact=this.nbCenterLayers===5;var E=new ce(t.getX()+.5,t.getY()-.5),C=new ce(n.getX()+.5,n.getY()+.5),b=new ce(a.getX()-.5,a.getY()+.5),T=new ce(s.getX()-.5,s.getY()-.5);return this.expandSquare([E,C,b,T],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var e,t,n,a;try{var s=new sa(this.image).detect();e=s[0],t=s[1],n=s[2],a=s[3]}catch{var f=this.image.getWidth()/2,h=this.image.getHeight()/2;e=this.getFirstDifferent(new qt(f+7,h-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new qt(f+7,h+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new qt(f-7,h+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new qt(f-7,h-7),!1,-1,-1).toResultPoint()}var x=De.round((e.getX()+a.getX()+t.getX()+n.getX())/4),g=De.round((e.getY()+a.getY()+t.getY()+n.getY())/4);try{var s=new sa(this.image,15,x,g).detect();e=s[0],t=s[1],n=s[2],a=s[3]}catch{e=this.getFirstDifferent(new qt(x+7,g-7),!1,1,-1).toResultPoint(),t=this.getFirstDifferent(new qt(x+7,g+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new qt(x-7,g+7),!1,-1,1).toResultPoint(),a=this.getFirstDifferent(new qt(x-7,g-7),!1,-1,-1).toResultPoint()}return x=De.round((e.getX()+a.getX()+t.getX()+n.getX())/4),g=De.round((e.getY()+a.getY()+t.getY()+n.getY())/4),new qt(x,g)},r.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(e,t,n,a,s){var f=Ea.getInstance(),h=this.getDimension(),x=h/2-this.nbCenterLayers,g=h/2+this.nbCenterLayers;return f.sampleGrid(e,h,h,x,x,g,x,g,g,x,g,t.getX(),t.getY(),n.getX(),n.getY(),a.getX(),a.getY(),s.getX(),s.getY())},r.prototype.sampleLine=function(e,t,n){for(var a=0,s=this.distanceResultPoint(e,t),f=s/n,h=e.getX(),x=e.getY(),g=f*(t.getX()-e.getX())/s,w=f*(t.getY()-e.getY())/s,A=0;A.1&&E<.9?0:E<=.1===g?1:-1},r.prototype.getFirstDifferent=function(e,t,n,a){for(var s=e.getX()+n,f=e.getY()+a;this.isValid(s,f)&&this.image.get(s,f)===t;)s+=n,f+=a;for(s-=n,f-=a;this.isValid(s,f)&&this.image.get(s,f)===t;)s+=n;for(s-=n;this.isValid(s,f)&&this.image.get(s,f)===t;)f+=a;return f-=a,new qt(s,f)},r.prototype.expandSquare=function(e,t,n){var a=n/(2*t),s=e[0].getX()-e[2].getX(),f=e[0].getY()-e[2].getY(),h=(e[0].getX()+e[2].getX())/2,x=(e[0].getY()+e[2].getY())/2,g=new ce(h+a*s,x+a*f),w=new ce(h-a*s,x-a*f);s=e[1].getX()-e[3].getX(),f=e[1].getY()-e[3].getY(),h=(e[1].getX()+e[3].getX())/2,x=(e[1].getY()+e[3].getY())/2;var A=new ce(h+a*s,x+a*f),E=new ce(h-a*s,x-a*f),C=[g,A,w,E];return C},r.prototype.isValid=function(e,t){return e>=0&&e0&&t>(f?8:5)),x;f?x=a:x=15;for(var g=Math.trunc(a/2),w=0;w=a)break;try{s=e.getBlackRow(C,s)}catch{continue}for(var b=function(D){if(D===1&&(s.reverse(),t&&t.get(tt.NEED_RESULT_POINT_CALLBACK)===!0)){var L=new Map;t.forEach(function(K,U){return L.set(U,K)}),L.delete(tt.NEED_RESULT_POINT_CALLBACK),t=L}try{var k=T.decodeRow(C,s,t);if(D===1){k.putMetadata(Rt.ORIENTATION,180);var q=k.getResultPoints();q!==null&&(q[0]=new ce(n-q[0].getX()-1,q[0].getY()),q[1]=new ce(n-q[1].getX()-1,q[1].getY()))}return{value:k}}catch{}},T=this,P=0;P<2;P++){var F=b(P);if(typeof F=="object")return F.value}}throw new j},r.recordPattern=function(e,t,n){for(var a=n.length,s=0;s=f)throw new j;for(var h=!e.get(t),x=0,g=t;g0&&a>=0;)e.get(--t)!==s&&(a--,s=!s);if(a>=0)throw new j;r.recordPattern(e,t+1,n)},r.patternMatchVariance=function(e,t,n){for(var a=e.length,s=0,f=0,h=0;hE?A-E:E-A;if(C>n)return Number.POSITIVE_INFINITY;g+=C}return g/s},r})(),l0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),ho=(function(r){l0(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.findStartPattern=function(t){for(var n=t.getSize(),a=t.getNextSet(0),s=0,f=Int32Array.from([0,0,0,0,0,0]),h=a,x=!1,g=6,w=a;w=0&&t.isRange(Math.max(0,h-(w-h)/2),h,!1))return Int32Array.from([h,w,E]);h+=f[0]+f[1],f=f.slice(2,f.length-1),f[s-1]=0,f[s]=0,s--}else s++;f[s]=1,x=!x}throw new j},e.decodeCode=function(t,n,a){vt.recordPattern(t,a,n);for(var s=e.MAX_AVG_VARIANCE,f=-1,h=0;h=0)return f;throw new j},e.prototype.decodeRow=function(t,n,a){var s=a&&a.get(tt.ASSUME_GS1)===!0,f=e.findStartPattern(n),h=f[2],x=0,g=new Uint8Array(20);g[x++]=h;var w;switch(h){case e.CODE_START_A:w=e.CODE_CODE_A;break;case e.CODE_START_B:w=e.CODE_CODE_B;break;case e.CODE_START_C:w=e.CODE_CODE_C;break;default:throw new re}for(var A=!1,E=!1,C="",b=f[0],T=f[1],P=Int32Array.from([0,0,0,0,0,0]),F=0,D=0,L=h,k=0,q=!0,K=!1,U=!1;!A;){var $=E;switch(E=!1,F=D,D=e.decodeCode(n,P,T),g[x++]=D,D!==e.CODE_STOP&&(q=!0),D!==e.CODE_STOP&&(k++,L+=k*D),b=T,T+=P.reduce(function(ge,rr){return ge+rr},0),D){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new re}switch(w){case e.CODE_CODE_A:if(D<64)U===K?C+=String.fromCharCode(32+D):C+=String.fromCharCode(32+D+128),U=!1;else if(D<96)U===K?C+=String.fromCharCode(D-64):C+=String.fromCharCode(D+64),U=!1;else switch(D!==e.CODE_STOP&&(q=!1),D){case e.CODE_FNC_1:s&&(C.length===0?C+="]C1":C+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!K&&U?(K=!0,U=!1):K&&U?(K=!1,U=!1):U=!0;break;case e.CODE_SHIFT:E=!0,w=e.CODE_CODE_B;break;case e.CODE_CODE_B:w=e.CODE_CODE_B;break;case e.CODE_CODE_C:w=e.CODE_CODE_C;break;case e.CODE_STOP:A=!0;break}break;case e.CODE_CODE_B:if(D<96)U===K?C+=String.fromCharCode(32+D):C+=String.fromCharCode(32+D+128),U=!1;else switch(D!==e.CODE_STOP&&(q=!1),D){case e.CODE_FNC_1:s&&(C.length===0?C+="]C1":C+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!K&&U?(K=!0,U=!1):K&&U?(K=!1,U=!1):U=!0;break;case e.CODE_SHIFT:E=!0,w=e.CODE_CODE_A;break;case e.CODE_CODE_A:w=e.CODE_CODE_A;break;case e.CODE_CODE_C:w=e.CODE_CODE_C;break;case e.CODE_STOP:A=!0;break}break;case e.CODE_CODE_C:if(D<100)D<10&&(C+="0"),C+=D;else switch(D!==e.CODE_STOP&&(q=!1),D){case e.CODE_FNC_1:s&&(C.length===0?C+="]C1":C+="");break;case e.CODE_CODE_A:w=e.CODE_CODE_A;break;case e.CODE_CODE_B:w=e.CODE_CODE_B;break;case e.CODE_STOP:A=!0;break}break}$&&(w=w===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var Y=T-b;if(T=n.getNextUnset(T),!n.isRange(T,Math.min(n.getSize(),T+(T-b)/2),!1))throw new j;if(L-=k*F,L%103!==F)throw new _t;var ue=C.length;if(ue===0)throw new j;ue>0&&q&&(w===e.CODE_CODE_C?C=C.substring(0,ue-2):C=C.substring(0,ue-1));for(var _e=(f[1]+f[0])/2,Z=b+Y/2,ne=g.length,le=new Uint8Array(ne),X=0;X=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xo=(function(r){h0(e,r);function e(t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var a=r.call(this)||this;return a.usingCheckDigit=t,a.extendedMode=n,a.decodeRowResult="",a.counters=new Int32Array(9),a}return e.prototype.decodeRow=function(t,n,a){var s,f,h,x,g=this.counters;g.fill(0),this.decodeRowResult="";var w=e.findAsteriskPattern(n,g),A=n.getNextSet(w[1]),E=n.getSize(),C,b;do{e.recordPattern(n,A,g);var T=e.toNarrowWidePattern(g);if(T<0)throw new j;C=e.patternToChar(T),this.decodeRowResult+=C,b=A;try{for(var P=(s=void 0,Wi(g)),F=P.next();!F.done;F=P.next()){var D=F.value;A+=D}}catch(ne){s={error:ne}}finally{try{F&&!F.done&&(f=P.return)&&f.call(P)}finally{if(s)throw s.error}}A=n.getNextSet(A)}while(C!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var L=0;try{for(var k=Wi(g),q=k.next();!q.done;q=k.next()){var D=q.value;L+=D}}catch(ne){h={error:ne}}finally{try{q&&!q.done&&(x=k.return)&&x.call(k)}finally{if(h)throw h.error}}var K=A-b-L;if(A!==E&&K*2f&&(x=A)}}catch(T){n={error:T}}finally{try{w&&!w.done&&(a=g.return)&&a.call(g)}finally{if(n)throw n.error}}f=x,h=0;for(var E=0,C=0,b=0;bf&&(C|=1<0;b++){var A=t[b];if(A>f&&(h--,A*2>=E))return-1}return C}}while(h>3);return-1},e.patternToChar=function(t){for(var n=0;n="A"&&h<="Z")x=String.fromCharCode(h.charCodeAt(0)+32);else throw new re;break;case"$":if(h>="A"&&h<="Z")x=String.fromCharCode(h.charCodeAt(0)-64);else throw new re;break;case"%":if(h>="A"&&h<="E")x=String.fromCharCode(h.charCodeAt(0)-38);else if(h>="F"&&h<="J")x=String.fromCharCode(h.charCodeAt(0)-11);else if(h>="K"&&h<="O")x=String.fromCharCode(h.charCodeAt(0)+16);else if(h>="P"&&h<="T")x=String.fromCharCode(h.charCodeAt(0)+43);else if(h==="U")x="\0";else if(h==="V")x="@";else if(h==="W")x="`";else if(h==="X"||h==="Y"||h==="Z")x="";else throw new re;break;case"/":if(h>="A"&&h<="O")x=String.fromCharCode(h.charCodeAt(0)-32);else if(h==="Z")x=":";else throw new re;break}a+=x,s++}else a+=f}return a},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e})(vt),d0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),zi=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},go=(function(r){d0(e,r);function e(){var t=r.call(this)||this;return t.decodeRowResult="",t.counters=new Int32Array(6),t}return e.prototype.decodeRow=function(t,n,a){var s,f,h,x,g=this.findAsteriskPattern(n),w=n.getNextSet(g[1]),A=n.getSize(),E=this.counters;E.fill(0),this.decodeRowResult="";var C,b;do{e.recordPattern(n,w,E);var T=this.toPattern(E);if(T<0)throw new j;C=this.patternToChar(T),this.decodeRowResult+=C,b=w;try{for(var P=(s=void 0,zi(E)),F=P.next();!F.done;F=P.next()){var D=F.value;w+=D}}catch(Y){s={error:Y}}finally{try{F&&!F.done&&(f=P.return)&&f.call(P)}finally{if(s)throw s.error}}w=n.getNextSet(w)}while(C!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var L=0;try{for(var k=zi(E),q=k.next();!q.done;q=k.next()){var D=q.value;L+=D}}catch(Y){h={error:Y}}finally{try{q&&!q.done&&(x=k.return)&&x.call(k)}finally{if(h)throw h.error}}if(w===A||!n.get(w))throw new j;if(this.decodeRowResult.length<2)throw new j;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var K=this.decodeExtended(this.decodeRowResult),U=(g[1]+g[0])/2,$=b+L/2;return new Bt(K,null,0,[new ce(U,t),new ce($,t)],se.CODE_93,new Date().getTime())},e.prototype.findAsteriskPattern=function(t){var n=t.getSize(),a=t.getNextSet(0);this.counters.fill(0);for(var s=this.counters,f=a,h=!1,x=s.length,g=0,w=a;w4)return-1;if((A&1)===0)for(var C=0;C="a"&&f<="d"){if(s>=n-1)throw new re;var h=t.charAt(s+1),x="\0";switch(f){case"d":if(h>="A"&&h<="Z")x=String.fromCharCode(h.charCodeAt(0)+32);else throw new re;break;case"a":if(h>="A"&&h<="Z")x=String.fromCharCode(h.charCodeAt(0)-64);else throw new re;break;case"b":if(h>="A"&&h<="E")x=String.fromCharCode(h.charCodeAt(0)-38);else if(h>="F"&&h<="J")x=String.fromCharCode(h.charCodeAt(0)-11);else if(h>="K"&&h<="O")x=String.fromCharCode(h.charCodeAt(0)+16);else if(h>="P"&&h<="T")x=String.fromCharCode(h.charCodeAt(0)+43);else if(h==="U")x="\0";else if(h==="V")x="@";else if(h==="W")x="`";else if(h>="X"&&h<="Z")x="";else throw new re;break;case"c":if(h>="A"&&h<="O")x=String.fromCharCode(h.charCodeAt(0)-32);else if(h==="Z")x=":";else throw new re;break}a+=x,s++}else a+=f}return a},e.prototype.checkChecksums=function(t){var n=t.length;this.checkOneChecksum(t,n-2,20),this.checkOneChecksum(t,n-1,15)},e.prototype.checkOneChecksum=function(t,n,a){for(var s=1,f=0,h=n-1;h>=0;h--)f+=s*e.ALPHABET_STRING.indexOf(t.charAt(h)),++s>a&&(s=1);if(t.charAt(n)!==e.ALPHABET_STRING[f%47])throw new _t},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e})(vt),x0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),g0=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},po=(function(r){x0(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.narrowLineWidth=-1,t}return e.prototype.decodeRow=function(t,n,a){var s,f,h=this.decodeStart(n),x=this.decodeEnd(n),g=new Ce;e.decodeMiddle(n,h[1],x[0],g);var w=g.toString(),A=null;a!=null&&(A=a.get(tt.ALLOWED_LENGTHS)),A==null&&(A=e.DEFAULT_ALLOWED_LENGTHS);var E=w.length,C=!1,b=0;try{for(var T=g0(A),P=T.next();!P.done;P=T.next()){var F=P.value;if(E===F){C=!0;break}F>b&&(b=F)}}catch(k){s={error:k}}finally{try{P&&!P.done&&(f=T.return)&&f.call(T)}finally{if(s)throw s.error}}if(!C&&E>b&&(C=!0),!C)throw new re;var D=[new ce(h[1],t),new ce(x[0],t)],L=new Bt(w,null,0,D,se.ITF,new Date().getTime());return L},e.decodeMiddle=function(t,n,a,s){var f=new Int32Array(10),h=new Int32Array(5),x=new Int32Array(5);for(f.fill(0),h.fill(0),x.fill(0);n0&&s>=0&&!t.get(s);s--)a--;if(a!==0)throw new j},e.skipWhiteSpace=function(t){var n=t.getSize(),a=t.getNextSet(0);if(a===n)throw new j;return a},e.prototype.decodeEnd=function(t){t.reverse();try{var n=e.skipWhiteSpace(t),a=void 0;try{a=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[0])}catch(f){f instanceof j&&(a=e.findGuardPattern(t,n,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,a[0]);var s=a[0];return a[0]=t.getSize()-a[1],a[1]=t.getSize()-s,a}finally{t.reverse()}},e.findGuardPattern=function(t,n,a){var s=a.length,f=new Int32Array(s),h=t.getSize(),x=!1,g=0,w=n;f.fill(0);for(var A=n;A=0)return a%10;throw new j},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e})(vt),p0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),wn=(function(r){p0(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.decodeRowStringBuffer="",t}return e.findStartGuardPattern=function(t){for(var n=!1,a,s=0,f=Int32Array.from([0,0,0]);!n;){f=Int32Array.from([0,0,0]),a=e.findGuardPattern(t,s,!1,this.START_END_PATTERN,f);var h=a[0];s=a[1];var x=h-(s-h);x>=0&&(n=t.isRange(x,h,!1))}return a},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var a=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===a},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,a=0,s=n-1;s>=0;s-=2){var f=t.charAt(s).charCodeAt(0)-48;if(f<0||f>9)throw new re;a+=f}a*=3;for(var s=n-2;s>=0;s-=2){var f=t.charAt(s).charCodeAt(0)-48;if(f<0||f>9)throw new re;a+=f}return(1e3-a)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,n,a,s){return this.findGuardPattern(t,n,a,s,new Int32Array(s.length))},e.findGuardPattern=function(t,n,a,s,f){var h=t.getSize();n=a?t.getNextUnset(n):t.getNextSet(n);for(var x=0,g=n,w=s.length,A=a,E=n;E=0)return h;throw new j},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e})(vt),v0=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},w0=(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(e,t,n){var a=this.decodeRowStringBuffer,s=this.decodeMiddle(t,n,a),f=a.toString(),h=r.parseExtensionString(f),x=[new ce((n[0]+n[1])/2,e),new ce(s,e)],g=new Bt(f,null,0,x,se.UPC_EAN_EXTENSION,new Date().getTime());return h!=null&&g.putAllMetadata(h),g},r.prototype.decodeMiddle=function(e,t,n){var a,s,f=this.decodeMiddleCounters;f[0]=0,f[1]=0,f[2]=0,f[3]=0;for(var h=e.getSize(),x=t[1],g=0,w=0;w<5&&x=10&&(g|=1<<4-w),w!==4&&(x=e.getNextSet(x),x=e.getNextUnset(x))}if(n.length!==5)throw new j;var T=this.determineCheckDigit(g);if(r.extensionChecksum(n.toString())!==T)throw new j;return x},r.extensionChecksum=function(e){for(var t=e.length,n=0,a=t-2;a>=0;a-=2)n+=e.charAt(a).charCodeAt(0)-48;n*=3;for(var a=t-1;a>=0;a-=2)n+=e.charAt(a).charCodeAt(0)-48;return n*=3,n%10},r.prototype.determineCheckDigit=function(e){for(var t=0;t<10;t++)if(e===this.CHECK_DIGIT_ENCODINGS[t])return t;throw new j},r.parseExtensionString=function(e){if(e.length!==5)return null;var t=r.parseExtension5String(e);return t==null?null:new Map([[Rt.SUGGESTED_PRICE,t]])},r.parseExtension5String=function(e){var t;switch(e.charAt(0)){case"0":t="ยฃ";break;case"5":t="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}t="";break;default:t="";break}var n=parseInt(e.substring(1)),a=(n/100).toString(),s=n%100,f=s<10?"0"+s:s.toString();return t+a+"."+f},r})(),A0=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},y0=(function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(e,t,n){var a=this.decodeRowStringBuffer,s=this.decodeMiddle(t,n,a),f=a.toString(),h=r.parseExtensionString(f),x=[new ce((n[0]+n[1])/2,e),new ce(s,e)],g=new Bt(f,null,0,x,se.UPC_EAN_EXTENSION,new Date().getTime());return h!=null&&g.putAllMetadata(h),g},r.prototype.decodeMiddle=function(e,t,n){var a,s,f=this.decodeMiddleCounters;f[0]=0,f[1]=0,f[2]=0,f[3]=0;for(var h=e.getSize(),x=t[1],g=0,w=0;w<2&&x=10&&(g|=1<<1-w),w!==1&&(x=e.getNextSet(x),x=e.getNextUnset(x))}if(n.length!==2)throw new j;if(parseInt(n.toString())%4!==g)throw new j;return x},r.parseExtensionString=function(e){return e.length!==2?null:new Map([[Rt.ISSUE_NUMBER,parseInt(e)]])},r})(),E0=(function(){function r(){}return r.decodeRow=function(e,t,n){var a=wn.findGuardPattern(t,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{var s=new w0;return s.decodeRow(e,t,a)}catch{var f=new y0;return f.decodeRow(e,t,a)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r})(),C0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),xt=(function(r){C0(e,r);function e(){var t=r.call(this)||this;t.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(h){return Int32Array.from(h)});for(var n=10;n<20;n++){for(var a=e.L_PATTERNS[n-10],s=new Int32Array(a.length),f=0;f=n.getSize()||!n.isRange(b,T,!1))throw new j;var P=w.toString();if(P.length<8)throw new re;if(!e.checkChecksum(P))throw new _t;var F=(s[1]+s[0])/2,D=(E[1]+E[0])/2,L=this.getBarcodeFormat(),k=[new ce(F,t),new ce(D,t)],q=new Bt(P,null,0,k,L,new Date().getTime()),K=0;try{var U=E0.decodeRow(t,n,E[1]);q.putMetadata(Rt.UPC_EAN_EXTENSION,U.getText()),q.putAllMetadata(U.getResultMetadata()),q.addResultPoints(U.getResultPoints()),K=U.getText().length}catch{}var $=a==null?null:a.get(tt.ALLOWED_EAN_EXTENSIONS);if($!=null){var Y=!1;for(var ue in $)if(K.toString()===ue){Y=!0;break}if(!Y)throw new j}return L===se.EAN_13||se.UPC_A,q},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var n=t.length;if(n===0)return!1;var a=parseInt(t.charAt(n-1),10);return e.getStandardUPCEANChecksum(t.substring(0,n-1))===a},e.getStandardUPCEANChecksum=function(t){for(var n=t.length,a=0,s=n-1;s>=0;s-=2){var f=t.charAt(s).charCodeAt(0)-48;if(f<0||f>9)throw new re;a+=f}a*=3;for(var s=n-2;s>=0;s-=2){var f=t.charAt(s).charCodeAt(0)-48;if(f<0||f>9)throw new re;a+=f}return(1e3-a)%10},e.decodeEnd=function(t,n){return e.findGuardPattern(t,n,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e})(wn),_0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),vo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fa=(function(r){_0(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,a){var s,f,h,x,g=this.decodeMiddleCounters;g[0]=0,g[1]=0,g[2]=0,g[3]=0;for(var w=t.getSize(),A=n[1],E=0,C=0;C<6&&A=10&&(E|=1<<5-C)}a=e.determineFirstDigit(a,E);var D=xt.findGuardPattern(t,A,!0,xt.MIDDLE_PATTERN,new Int32Array(xt.MIDDLE_PATTERN.length).fill(0));A=D[1];for(var C=0;C<6&&A=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ao=(function(r){m0(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=Int32Array.from([0,0,0,0]),t}return e.prototype.decodeMiddle=function(t,n,a){var s,f,h,x,g=this.decodeMiddleCounters;g[0]=0,g[1]=0,g[2]=0,g[3]=0;for(var w=t.getSize(),A=n[1],E=0;E<4&&A=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Eo=(function(r){S0(e,r);function e(){var t=r.call(this)||this;return t.decodeMiddleCounters=new Int32Array(4),t}return e.prototype.decodeMiddle=function(t,n,a){var s,f,h=this.decodeMiddleCounters.map(function(P){return P});h[0]=0,h[1]=0,h[2]=0,h[3]=0;for(var x=t.getSize(),g=n[1],w=0,A=0;A<6&&g=10&&(w|=1<<5-A)}return e.determineNumSysAndCheckDigit(new Ce(a),w),g},e.prototype.decodeEnd=function(t,n){return e.findGuardPatternWithoutCounters(t,n,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return xt.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,n){for(var a=0;a<=1;a++)for(var s=0;s<10;s++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[a][s]){t.insert(0,"0"+a),t.append("0"+s);return}throw j.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return se.UPC_E},e.convertUPCEtoUPCA=function(t){var n=t.slice(1,7).split("").map(function(f){return f.charCodeAt(0)}),a=new Ce;a.append(t.charAt(0));var s=n[5];switch(s){case 0:case 1:case 2:a.appendChars(n,0,2),a.append(s),a.append("0000"),a.appendChars(n,2,3);break;case 3:a.appendChars(n,0,3),a.append("00000"),a.appendChars(n,3,2);break;case 4:a.appendChars(n,0,4),a.append("00000"),a.append(n[4]);break;default:a.appendChars(n,0,5),a.append("0000"),a.append(s);break}return t.length>=8&&a.append(t.charAt(7)),a.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e})(xt),T0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Co=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Yi=(function(r){T0(e,r);function e(t){var n=r.call(this)||this,a=t==null?null:t.get(tt.POSSIBLE_FORMATS),s=[];return a!=null&&(a.indexOf(se.EAN_13)>-1&&s.push(new fa),a.indexOf(se.UPC_A)>-1&&s.push(new yo),a.indexOf(se.EAN_8)>-1&&s.push(new Ao),a.indexOf(se.UPC_E)>-1&&s.push(new Eo)),s.length===0&&(s.push(new fa),s.push(new yo),s.push(new Ao),s.push(new Eo)),n.readers=s,n}return e.prototype.decodeRow=function(t,n,a){var s,f;try{for(var h=Co(this.readers),x=h.next();!x.done;x=h.next()){var g=x.value;try{var w=g.decodeRow(t,n,a),A=w.getBarcodeFormat()===se.EAN_13&&w.getText().charAt(0)==="0",E=a==null?null:a.get(tt.POSSIBLE_FORMATS),C=E==null||E.includes(se.UPC_A);if(A&&C){var b=w.getRawBytes(),T=new Bt(w.getText().substring(1),b,b?b.length:null,w.getResultPoints(),se.UPC_A);return T.putAllMetadata(w.getResultMetadata()),T}return w}catch{}}}catch(P){s={error:P}}finally{try{x&&!x.done&&(f=h.return)&&f.call(h)}finally{if(s)throw s.error}}throw new j},e.prototype.reset=function(){var t,n;try{for(var a=Co(this.readers),s=a.next();!s.done;s=a.next()){var f=s.value;f.reset()}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},e})(vt),O0=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),N0=(function(r){O0(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.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"},t}return e.prototype.decodeRow=function(t,n,a){var s=this.getValidRowData(n);if(!s)throw new j;var f=this.codaBarDecodeRow(s.row);if(!f)throw new j;return new Bt(f,null,0,[new ce(s.left,t),new ce(s.right,t)],se.CODABAR,new Date().getTime())},e.prototype.getValidRowData=function(t){var n=t.toArray(),a=n.indexOf(!0);if(a===-1)return null;var s=n.lastIndexOf(!0);if(s<=a)return null;n=n.slice(a,s+1);for(var f=[],h=n[0],x=1,g=1;g0;){var s=t.splice(0,8).splice(0,7),f=s.map(function(x){return x=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$r=(function(r){R0(e,r);function e(){var t=r.call(this)||this;return t.decodeFinderCounters=new Int32Array(4),t.dataCharacterCounters=new Int32Array(8),t.oddRoundingErrors=new Array(4),t.evenRoundingErrors=new Array(4),t.oddCounts=new Array(t.dataCharacterCounters.length/2),t.evenCounts=new Array(t.dataCharacterCounters.length/2),t}return e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,n){for(var a=0;as&&(s=n[f],a=f);t[a]++},e.decrement=function(t,n){for(var a=0,s=n[0],f=1;f=e.MIN_FINDER_PATTERN_RATIO&&h<=e.MAX_FINDER_PATTERN_RATIO){var x=Number.MAX_SAFE_INTEGER,g=Number.MIN_SAFE_INTEGER;try{for(var w=D0(t),A=w.next();!A.done;A=w.next()){var E=A.value;E>g&&(g=E),E=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pn=(function(){function r(){}return r.getRSSvalue=function(e,t,n){var a,s,f=0;try{for(var h=M0(e),x=h.next();!x.done;x=h.next()){var g=x.value;f+=g}}catch(D){a={error:D}}finally{try{x&&!x.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}for(var w=0,A=0,E=e.length,C=0;C=E-C-1&&(T-=r.combins(f-b-(E-C),E-C-2)),E-C-1>1){for(var P=0,F=f-b-(E-C-2);F>t;F--)P+=r.combins(f-b-F-1,E-C-3);T-=P*(E-1-C)}else f-b>t&&T--;w+=T}f-=b}return w},r.combins=function(e,t){var n,a;e-t>t?(a=t,n=e-t):(a=e-t,n=t);for(var s=1,f=1,h=e;h>n;h--)s*=h,f<=a&&(s/=f,f++);for(;f<=a;)s/=f,f++;return s},r})(),P0=(function(){function r(){}return r.buildBitArray=function(e){var t=e.length*2-1;e[e.length-1].getRightChar()==null&&(t-=1);for(var n=12*t,a=new mt(n),s=0,f=e[0],h=f.getRightChar().getValue(),x=11;x>=0;--x)(h&1<=0;--A)(w&1<=0;--A)(E&1<10||a<0||a>10)throw new re;return s.firstDigit=n,s.secondDigit=a,s}return e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return this.firstDigit*10+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e})(Ca),ni=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},k0=(function(){function r(){}return r.parseFieldsInGeneralPurpose=function(e){var t,n,a,s,f,h,x,g;if(!e)return null;if(e.length<2)throw new j;var w=e.substring(0,2);try{for(var A=ni(r.TWO_DIGIT_DATA_LENGTH),E=A.next();!E.done;E=A.next()){var C=E.value;if(C[0]===w)return C[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,C[2],e):r.processFixedAI(2,C[1],e)}}catch(K){t={error:K}}finally{try{E&&!E.done&&(n=A.return)&&n.call(A)}finally{if(t)throw t.error}}if(e.length<3)throw new j;var b=e.substring(0,3);try{for(var T=ni(r.THREE_DIGIT_DATA_LENGTH),P=T.next();!P.done;P=T.next()){var C=P.value;if(C[0]===b)return C[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,C[2],e):r.processFixedAI(3,C[1],e)}}catch(K){a={error:K}}finally{try{P&&!P.done&&(s=T.return)&&s.call(T)}finally{if(a)throw a.error}}try{for(var F=ni(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),D=F.next();!D.done;D=F.next()){var C=D.value;if(C[0]===b)return C[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,C[2],e):r.processFixedAI(4,C[1],e)}}catch(K){f={error:K}}finally{try{D&&!D.done&&(h=F.return)&&h.call(F)}finally{if(f)throw f.error}}if(e.length<4)throw new j;var L=e.substring(0,4);try{for(var k=ni(r.FOUR_DIGIT_DATA_LENGTH),q=k.next();!q.done;q=k.next()){var C=q.value;if(C[0]===L)return C[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,C[2],e):r.processFixedAI(4,C[1],e)}}catch(K){x={error:K}}finally{try{q&&!q.done&&(g=k.return)&&g.call(k)}finally{if(x)throw x.error}}throw new j},r.processFixedAI=function(e,t,n){if(n.lengththis.information.getSize())return e+4<=this.information.getSize();for(var t=e;tthis.information.getSize()){var t=this.extractNumericValueFromBitArray(e,4);return t===0?new xn(this.information.getSize(),xn.FNC1,xn.FNC1):new xn(this.information.getSize(),t-1,xn.FNC1)}var n=this.extractNumericValueFromBitArray(e,7),a=(n-8)/11,s=(n-8)%11;return new xn(e+7,a,s)},r.prototype.extractNumericValueFromBitArray=function(e,t){return r.extractNumericValueFromBitArray(this.information,e,t)},r.extractNumericValueFromBitArray=function(e,t,n){for(var a=0,s=0;sthis.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<116)return!0;if(e+8>this.information.getSize())return!1;var a=this.extractNumericValueFromBitArray(e,8);return a>=232&&a<253},r.prototype.decodeIsoIec646=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new gr(e+5,gr.FNC1);if(t>=5&&t<15)return new gr(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,7);if(n>=64&&n<90)return new gr(e+7,""+(n+1));if(n>=90&&n<116)return new gr(e+7,""+(n+7));var a=this.extractNumericValueFromBitArray(e,8),s;switch(a){case 232:s="!";break;case 233:s='"';break;case 234:s="%";break;case 235:s="&";break;case 236:s="'";break;case 237:s="(";break;case 238:s=")";break;case 239:s="*";break;case 240:s="+";break;case 241:s=",";break;case 242:s="-";break;case 243:s=".";break;case 244:s="/";break;case 245:s=":";break;case 246:s=";";break;case 247:s="<";break;case 248:s="=";break;case 249:s=">";break;case 250:s="?";break;case 251:s="_";break;case 252:s=" ";break;default:throw new re}return new gr(e+8,s)},r.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var t=this.extractNumericValueFromBitArray(e,5);if(t>=5&&t<16)return!0;if(e+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(e){var t=this.extractNumericValueFromBitArray(e,5);if(t===15)return new gr(e+5,gr.FNC1);if(t>=5&&t<15)return new gr(e+5,"0"+(t-5));var n=this.extractNumericValueFromBitArray(e,6);if(n>=32&&n<58)return new gr(e+6,""+(n+33));var a;switch(n){case 58:a="*";break;case 59:a=",";break;case 60:a="-";break;case 61:a=".";break;case 62:a="/";break;default:throw new Hn("Decoding invalid alphanumeric value: "+n)}return new gr(e+6,a)},r.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var t=0;t<5&&t+ethis.information.getSize())return!1;for(var t=e;tthis.information.getSize())return!1;for(var t=0;t<4&&t+e=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ic=(function(r){nc(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.pairs=new Array(e.MAX_PAIRS),t.rows=new Array,t.startEnd=[2],t}return e.prototype.decodeRow=function(t,n,a){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,n))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,n){for(var a=!1;!a;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,t))}catch(h){if(h instanceof j){if(!this.pairs.length)throw new j;a=!0}}if(this.checkChecksum())return this.pairs;var s;if(this.rows.length?s=!0:s=!1,this.storeRow(t,!1),s){var f=this.checkRowsBoolean(!1);if(f!=null||(f=this.checkRowsBoolean(!0),f!=null))return f}throw new j},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(a){console.log(a)}return t&&(this.rows=this.rows.reverse()),n},e.prototype.checkRows=function(t,n){for(var a,s,f=n;fh.length)){for(var x=!0,g=0;gt){f=h.isEquivalent(this.pairs);break}s=h.isEquivalent(this.pairs),a++}f||s||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(a,new rc(this.pairs,t,n)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,n){var a,s,f,h,x,g;try{for(var w=Vr(n),A=w.next();!A.done;A=w.next()){var E=A.value;if(E.getPairs().length!==t.length){var C=!0;try{for(var b=(f=void 0,Vr(E.getPairs())),T=b.next();!T.done;T=b.next()){var P=T.value,F=!1;try{for(var D=(x=void 0,Vr(t)),L=D.next();!L.done;L=D.next()){var k=L.value;if(_o.equals(P,k)){F=!0;break}}}catch(q){x={error:q}}finally{try{L&&!L.done&&(g=D.return)&&g.call(D)}finally{if(x)throw x.error}}F||(C=!1)}}catch(q){f={error:q}}finally{try{T&&!T.done&&(h=b.return)&&h.call(b)}finally{if(f)throw f.error}}}}}catch(q){a={error:q}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}},e.isPartialRow=function(t,n){var a,s,f,h,x,g;try{for(var w=Vr(n),A=w.next();!A.done;A=w.next()){var E=A.value,C=!0;try{for(var b=(f=void 0,Vr(t)),T=b.next();!T.done;T=b.next()){var P=T.value,F=!1;try{for(var D=(x=void 0,Vr(E.getPairs())),L=D.next();!L.done;L=D.next()){var k=L.value;if(P.equals(k)){F=!0;break}}}catch(q){x={error:q}}finally{try{L&&!L.done&&(g=D.return)&&g.call(D)}finally{if(x)throw x.error}}if(!F){C=!1;break}}}catch(q){f={error:q}}finally{try{T&&!T.done&&(h=b.return)&&h.call(b)}finally{if(f)throw f.error}}if(C)return!0}}catch(q){a={error:q}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var n=P0.buildBitArray(t),a=tc(n),s=a.parseInformation(),f=t[0].getFinderPattern().getResultPoints(),h=t[t.length-1].getFinderPattern().getResultPoints(),x=[f[0],f[1],h[0],h[1]];return new Bt(s,null,null,x,se.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),n=t.getLeftChar(),a=t.getRightChar();if(a===null)return!1;for(var s=a.getChecksumPortion(),f=2,h=1;h=0)h=a;else if(this.isEmptyPair(n))h=0;else{var x=n[n.length-1];h=x.getFinderPattern().getStartEnd()[1]}var g=n.length%2!==0;this.startFromEven&&(g=!g);for(var w=!1;h=0&&!t.get(x);)x--;x++,s=this.startEnd[0]-x,f=x,h=this.startEnd[1]}else f=this.startEnd[0],h=t.getNextUnset(this.startEnd[1]+1),s=h-this.startEnd[1];var g=this.getDecodeFinderCounters();Ke.arraycopy(g,0,g,1,g.length-1),g[0]=s;var w;try{w=this.parseFinderValue(g,e.FINDER_PATTERNS)}catch{return null}return new Qo(w,[f,h],f,h,n)},e.prototype.decodeDataCharacter=function(t,n,a,s){for(var f=this.getDataCharacterCounters(),h=0;h.3)throw new j;for(var b=this.getOddCounts(),T=this.getEvenCounts(),P=this.getOddRoundingErrors(),F=this.getEvenRoundingErrors(),x=0;x8){if(D>8.7)throw new j;L=8}var k=x/2;(x&1)===0?(b[k]=L,P[k]=D-L):(T[k]=L,F[k]=D-L)}this.adjustOddEvenCounts(A);for(var q=4*n.getValue()+(a?0:2)+(s?0:1)-1,K=0,U=0,x=b.length-1;x>=0;x--){if(e.isNotA1left(n,a,s)){var $=e.WEIGHTS[q][2*x];U+=b[x]*$}K+=b[x]}for(var Y=0,x=T.length-1;x>=0;x--)if(e.isNotA1left(n,a,s)){var $=e.WEIGHTS[q][2*x+1];Y+=T[x]*$}var ue=U+Y;if((K&1)!==0||K>13||K<4)throw new j;var _e=(13-K)/2,Z=e.SYMBOL_WIDEST[_e],ne=9-Z,le=pn.getRSSvalue(b,Z,!0),X=pn.getRSSvalue(T,ne,!1),me=e.EVEN_TOTAL_SUBSET[_e],ge=e.GSUM[_e],rr=le*me+X+ge;return new gi(rr,ue)},e.isNotA1left=function(t,n,a){return!(t.getValue()===0&&n&&a)},e.prototype.adjustOddEvenCounts=function(t){var n=De.sum(new Int32Array(this.getOddCounts())),a=De.sum(new Int32Array(this.getEvenCounts())),s=!1,f=!1;n>13?f=!0:n<4&&(s=!0);var h=!1,x=!1;a>13?x=!0:a<4&&(h=!0);var g=n+a-t,w=(n&1)===1,A=(a&1)===0;if(g===1)if(w){if(A)throw new j;f=!0}else{if(!A)throw new j;x=!0}else if(g===-1)if(w){if(A)throw new j;s=!0}else{if(!A)throw new j;h=!0}else if(g===0){if(w){if(!A)throw new j;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},mo=(function(r){sc(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.possibleLeftPairs=[],t.possibleRightPairs=[],t}return e.prototype.decodeRow=function(t,n,a){var s,f,h,x,g=this.decodePair(n,!1,t,a);e.addOrTally(this.possibleLeftPairs,g),n.reverse();var w=this.decodePair(n,!0,t,a);e.addOrTally(this.possibleRightPairs,w),n.reverse();try{for(var A=Zi(this.possibleLeftPairs),E=A.next();!E.done;E=A.next()){var C=E.value;if(C.getCount()>1)try{for(var b=(h=void 0,Zi(this.possibleRightPairs)),T=b.next();!T.done;T=b.next()){var P=T.value;if(P.getCount()>1&&e.checkChecksum(C,P))return e.constructResult(C,P)}}catch(F){h={error:F}}finally{try{T&&!T.done&&(x=b.return)&&x.call(b)}finally{if(h)throw h.error}}}}catch(F){s={error:F}}finally{try{E&&!E.done&&(f=A.return)&&f.call(A)}finally{if(s)throw s.error}}throw new j},e.addOrTally=function(t,n){var a,s;if(n!=null){var f=!1;try{for(var h=Zi(t),x=h.next();!x.done;x=h.next()){var g=x.value;if(g.getValue()===n.getValue()){g.incrementCount(),f=!0;break}}}catch(w){a={error:w}}finally{try{x&&!x.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}f||t.push(n)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,n){for(var a=4537077*t.getValue()+n.getValue(),s=new String(a).toString(),f=new Ce,h=13-s.length;h>0;h--)f.append("0");f.append(s);for(var x=0,h=0;h<13;h++){var g=f.charAt(h).charCodeAt(0)-48;x+=(h&1)===0?3*g:g}x=10-x%10,x===10&&(x=0),f.append(x.toString());var w=t.getFinderPattern().getResultPoints(),A=n.getFinderPattern().getResultPoints();return new Bt(f.toString(),null,0,[w[0],w[1],A[0],A[1]],se.RSS_14,new Date().getTime())},e.checkChecksum=function(t,n){var a=(t.getChecksumPortion()+16*n.getChecksumPortion())%79,s=9*t.getFinderPattern().getValue()+n.getFinderPattern().getValue();return s>72&&s--,s>8&&s--,a===s},e.prototype.decodePair=function(t,n,a,s){try{var f=this.findFinderPattern(t,n),h=this.parseFoundFinderPattern(t,a,n,f),x=s==null?null:s.get(tt.NEED_RESULT_POINT_CALLBACK);if(x!=null){var g=(f[0]+f[1])/2;n&&(g=t.getSize()-1-g),x.foundPossibleResultPoint(new ce(g,a))}var w=this.decodeDataCharacter(t,h,!0),A=this.decodeDataCharacter(t,h,!1);return new oc(1597*w.getValue()+A.getValue(),w.getChecksumPortion()+4*A.getChecksumPortion(),h)}catch{return null}},e.prototype.decodeDataCharacter=function(t,n,a){for(var s=this.getDataCharacterCounters(),f=0;f8&&(F=8);var D=Math.floor(h/2);(h&1)===0?(E[D]=F,b[D]=P-F):(C[D]=F,T[D]=P-F)}this.adjustOddEvenCounts(a,w);for(var L=0,k=0,h=E.length-1;h>=0;h--)k*=9,k+=E[h],L+=E[h];for(var q=0,K=0,h=C.length-1;h>=0;h--)q*=9,q+=C[h],K+=C[h];var U=k+3*q;if(a){if((L&1)!==0||L>12||L<4)throw new j;var $=(12-L)/2,Y=e.OUTSIDE_ODD_WIDEST[$],ue=9-Y,_e=pn.getRSSvalue(E,Y,!1),Z=pn.getRSSvalue(C,ue,!0),ne=e.OUTSIDE_EVEN_TOTAL_SUBSET[$],le=e.OUTSIDE_GSUM[$];return new gi(_e*ne+Z+le,U)}else{if((K&1)!==0||K>10||K<4)throw new j;var $=(10-K)/2,Y=e.INSIDE_ODD_WIDEST[$],ue=9-Y,_e=pn.getRSSvalue(E,Y,!0),Z=pn.getRSSvalue(C,ue,!1),X=e.INSIDE_ODD_TOTAL_SUBSET[$],le=e.INSIDE_GSUM[$];return new gi(Z*X+_e+le,U)}},e.prototype.findFinderPattern=function(t,n){var a=this.getDecodeFinderCounters();a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),f=!1,h=0;h=0&&f!==t.get(h);)h--;h++;var x=s[0]-h,g=this.getDecodeFinderCounters(),w=new Int32Array(g.length);Ke.arraycopy(g,0,w,1,g.length-1),w[0]=x;var A=this.parseFinderValue(w,e.FINDER_PATTERNS),E=h,C=s[1];return a&&(E=t.getSize()-1-E,C=t.getSize()-1-C),new Qo(A,[h,s[1]],E,C,n)},e.prototype.adjustOddEvenCounts=function(t,n){var a=De.sum(new Int32Array(this.getOddCounts())),s=De.sum(new Int32Array(this.getEvenCounts())),f=!1,h=!1,x=!1,g=!1;t?(a>12?h=!0:a<4&&(f=!0),s>12?g=!0:s<4&&(x=!0)):(a>11?h=!0:a<5&&(f=!0),s>10?g=!0:s<4&&(x=!0));var w=a+s-n,A=(a&1)===(t?1:0),E=(s&1)===1;if(w===1)if(A){if(E)throw new j;h=!0}else{if(!E)throw new j;g=!0}else if(w===-1)if(A){if(E)throw new j;f=!0}else{if(!E)throw new j;x=!0}else if(w===0){if(A){if(!E)throw new j;a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ue=(function(){function r(e,t,n){this.ecCodewords=e,this.ecBlocks=[t],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r})(),Le=(function(){function r(e,t){this.count=e,this.dataCodewords=t}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r})(),uc=(function(){function r(e,t,n,a,s,f){var h,x;this.versionNumber=e,this.symbolSizeRows=t,this.symbolSizeColumns=n,this.dataRegionSizeRows=a,this.dataRegionSizeColumns=s,this.ecBlocks=f;var g=0,w=f.getECCodewords(),A=f.getECBlocks();try{for(var E=Io(A),C=E.next();!C.done;C=E.next()){var b=C.value;g+=b.getCount()*(b.getDataCodewords()+w)}}catch(T){h={error:T}}finally{try{C&&!C.done&&(x=E.return)&&x.call(E)}finally{if(h)throw h.error}}this.totalCodewords=g}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(e,t){var n,a;if((e&1)!==0||(t&1)!==0)throw new re;try{for(var s=Io(r.VERSIONS),f=s.next();!f.done;f=s.next()){var h=f.value;if(h.symbolSizeRows===e&&h.symbolSizeColumns===t)return h}}catch(x){n={error:x}}finally{try{f&&!f.done&&(a=s.return)&&a.call(s)}finally{if(n)throw n.error}}throw new re},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new Ue(5,new Le(1,3))),new r(2,12,12,10,10,new Ue(7,new Le(1,5))),new r(3,14,14,12,12,new Ue(10,new Le(1,8))),new r(4,16,16,14,14,new Ue(12,new Le(1,12))),new r(5,18,18,16,16,new Ue(14,new Le(1,18))),new r(6,20,20,18,18,new Ue(18,new Le(1,22))),new r(7,22,22,20,20,new Ue(20,new Le(1,30))),new r(8,24,24,22,22,new Ue(24,new Le(1,36))),new r(9,26,26,24,24,new Ue(28,new Le(1,44))),new r(10,32,32,14,14,new Ue(36,new Le(1,62))),new r(11,36,36,16,16,new Ue(42,new Le(1,86))),new r(12,40,40,18,18,new Ue(48,new Le(1,114))),new r(13,44,44,20,20,new Ue(56,new Le(1,144))),new r(14,48,48,22,22,new Ue(68,new Le(1,174))),new r(15,52,52,24,24,new Ue(42,new Le(2,102))),new r(16,64,64,14,14,new Ue(56,new Le(2,140))),new r(17,72,72,16,16,new Ue(36,new Le(4,92))),new r(18,80,80,18,18,new Ue(48,new Le(4,114))),new r(19,88,88,20,20,new Ue(56,new Le(4,144))),new r(20,96,96,22,22,new Ue(68,new Le(4,174))),new r(21,104,104,24,24,new Ue(56,new Le(6,136))),new r(22,120,120,18,18,new Ue(68,new Le(6,175))),new r(23,132,132,20,20,new Ue(62,new Le(8,163))),new r(24,144,144,22,22,new Ue(62,new Le(8,156),new Le(2,155))),new r(25,8,18,6,16,new Ue(7,new Le(1,5))),new r(26,8,32,6,14,new Ue(11,new Le(1,10))),new r(27,12,26,10,24,new Ue(14,new Le(1,16))),new r(28,12,36,10,16,new Ue(18,new Le(1,22))),new r(29,16,36,14,16,new Ue(24,new Le(1,32))),new r(30,16,48,14,22,new Ue(28,new Le(1,49)))]},r.VERSIONS=r.buildVersions(),r})(),lc=(function(){function r(e){var t=e.getHeight();if(t<8||t>144||(t&1)!==0)throw new re;this.version=r.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new br(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(e){var t=e.getHeight(),n=e.getWidth();return uc.getVersionForDimensions(t,n)},r.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),t=0,n=4,a=0,s=this.mappingBitMatrix.getHeight(),f=this.mappingBitMatrix.getWidth(),h=!1,x=!1,g=!1,w=!1;do if(n===s&&a===0&&!h)e[t++]=this.readCorner1(s,f)&255,n-=2,a+=2,h=!0;else if(n===s-2&&a===0&&(f&3)!==0&&!x)e[t++]=this.readCorner2(s,f)&255,n-=2,a+=2,x=!0;else if(n===s+4&&a===2&&(f&7)===0&&!g)e[t++]=this.readCorner3(s,f)&255,n-=2,a+=2,g=!0;else if(n===s-2&&a===0&&(f&7)===4&&!w)e[t++]=this.readCorner4(s,f)&255,n-=2,a+=2,w=!0;else{do n=0&&!this.readMappingMatrix.get(a,n)&&(e[t++]=this.readUtah(n,a,s,f)&255),n-=2,a+=2;while(n>=0&&a=0&&a=0);n+=3,a+=1}while(n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hc=(function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t){var n,a,s,f,h=t.getECBlocks(),x=0,g=h.getECBlocks();try{for(var w=So(g),A=w.next();!A.done;A=w.next()){var E=A.value;x+=E.getCount()}}catch(le){n={error:le}}finally{try{A&&!A.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}var C=new Array(x),b=0;try{for(var T=So(g),P=T.next();!P.done;P=T.next())for(var E=P.value,F=0;F7?F-1:F;C[Z].codewords[ne]=e[U++]}if(U!==e.length)throw new xe;return C},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r})(),e1=(function(){function r(e){this.bytes=e,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(e){if(e<1||e>32||e>this.available())throw new xe(""+e);var t=0,n=this.bitOffset,a=this.byteOffset,s=this.bytes;if(n>0){var f=8-n,h=e>8-h<>x,e-=h,n+=h,n===8&&(n=0,a++)}if(e>0){for(;e>=8;)t=t<<8|s[a]&255,a++,e-=8;if(e>0){var x=8-e,g=255>>x<>x,n+=e}}return this.bitOffset=n,this.byteOffset=a,t},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r})(),ht;(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"})(ht||(ht={}));var dc=(function(){function r(){}return r.decode=function(e){var t=new e1(e),n=new Ce,a=new Ce,s=new Array,f=ht.ASCII_ENCODE;do if(f===ht.ASCII_ENCODE)f=this.decodeAsciiSegment(t,n,a);else{switch(f){case ht.C40_ENCODE:this.decodeC40Segment(t,n);break;case ht.TEXT_ENCODE:this.decodeTextSegment(t,n);break;case ht.ANSIX12_ENCODE:this.decodeAnsiX12Segment(t,n);break;case ht.EDIFACT_ENCODE:this.decodeEdifactSegment(t,n);break;case ht.BASE256_ENCODE:this.decodeBase256Segment(t,n,s);break;default:throw new re}f=ht.ASCII_ENCODE}while(f!==ht.PAD_ENCODE&&t.available()>0);return a.length()>0&&n.append(a.toString()),new Ai(e,n.toString(),s.length===0?null:s,null)},r.decodeAsciiSegment=function(e,t,n){var a=!1;do{var s=e.readBits(8);if(s===0)throw new re;if(s<=128)return a&&(s+=128),t.append(String.fromCharCode(s-1)),ht.ASCII_ENCODE;if(s===129)return ht.PAD_ENCODE;if(s<=229){var f=s-130;f<10&&t.append("0"),t.append(""+f)}else switch(s){case 230:return ht.C40_ENCODE;case 231:return ht.BASE256_ENCODE;case 232:t.append("");break;case 233:case 234:break;case 235:a=!0;break;case 236:t.append("[)>05"),n.insert(0,"");break;case 237:t.append("[)>06"),n.insert(0,"");break;case 238:return ht.ANSIX12_ENCODE;case 239:return ht.TEXT_ENCODE;case 240:return ht.EDIFACT_ENCODE;case 241:break;default:if(s!==254||e.available()!==0)throw new re;break}}while(e.available()>0);return ht.ASCII_ENCODE},r.decodeC40Segment=function(e,t){var n=!1,a=[],s=0;do{if(e.available()===8)return;var f=e.readBits(8);if(f===254)return;this.parseTwoBytes(f,e.readBits(8),a);for(var h=0;h<3;h++){var x=a[h];switch(s){case 0:if(x<3)s=x+1;else if(x0)},r.decodeTextSegment=function(e,t){var n=!1,a=[],s=0;do{if(e.available()===8)return;var f=e.readBits(8);if(f===254)return;this.parseTwoBytes(f,e.readBits(8),a);for(var h=0;h<3;h++){var x=a[h];switch(s){case 0:if(x<3)s=x+1;else if(x0)},r.decodeAnsiX12Segment=function(e,t){var n=[];do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),n);for(var s=0;s<3;s++){var f=n[s];switch(f){case 0:t.append("\r");break;case 1:t.append("*");break;case 2:t.append(">");break;case 3:t.append(" ");break;default:if(f<14)t.append(String.fromCharCode(f+44));else if(f<40)t.append(String.fromCharCode(f+51));else throw new re;break}}}while(e.available()>0)},r.parseTwoBytes=function(e,t,n){var a=(e<<8)+t-1,s=Math.floor(a/1600);n[0]=s,a-=s*1600,s=Math.floor(a/40),n[1]=s,n[2]=a-s*40},r.decodeEdifactSegment=function(e,t){do{if(e.available()<=16)return;for(var n=0;n<4;n++){var a=e.readBits(6);if(a===31){var s=8-e.getBitOffset();s!==8&&e.readBits(s);return}(a&32)===0&&(a|=64),t.append(String.fromCharCode(a))}}while(e.available()>0)},r.decodeBase256Segment=function(e,t,n){var a=1+e.getByteOffset(),s=this.unrandomize255State(e.readBits(8),a++),f;if(s===0?f=e.available()/8|0:s<250?f=s:f=250*(s-249)+this.unrandomize255State(e.readBits(8),a++),f<0)throw new re;for(var h=new Uint8Array(f),x=0;x=0?a:a+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","{","|","}","~",""],r})(),xc=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},gc=(function(){function r(){this.rsDecoder=new yi(Jt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(e){var t,n,a=new lc(e),s=a.getVersion(),f=a.readCodewords(),h=hc.getDataBlocks(f,s),x=0;try{for(var g=xc(h),w=g.next();!w.done;w=g.next()){var A=w.value;x+=A.getNumDataCodewords()}}catch(L){t={error:L}}finally{try{w&&!w.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}for(var E=new Uint8Array(x),C=h.length,b=0;bh&&(w=h,A[0]=t,A[1]=n,A[2]=a,A[3]=s),w>x&&(w=x,A[0]=n,A[1]=a,A[2]=s,A[3]=t),w>g&&(A[0]=a,A[1]=s,A[2]=t,A[3]=n),A},r.prototype.detectSolid2=function(e){var t=e[0],n=e[1],a=e[2],s=e[3],f=this.transitionsBetween(t,s),h=r.shiftPoint(n,a,(f+1)*4),x=r.shiftPoint(a,n,(f+1)*4),g=this.transitionsBetween(h,t),w=this.transitionsBetween(x,s);return gC?w:A},r.prototype.shiftToModuleCenter=function(e){var t=e[0],n=e[1],a=e[2],s=e[3],f=this.transitionsBetween(t,s)+1,h=this.transitionsBetween(a,s)+1,x=r.shiftPoint(t,n,h*4),g=r.shiftPoint(a,n,f*4);f=this.transitionsBetween(x,s)+1,h=this.transitionsBetween(g,s)+1,(f&1)===1&&(f+=1),(h&1)===1&&(h+=1);var w=(t.getX()+n.getX()+a.getX()+s.getX())/4,A=(t.getY()+n.getY()+a.getY()+s.getY())/4;t=r.moveAway(t,w,A),n=r.moveAway(n,w,A),a=r.moveAway(a,w,A),s=r.moveAway(s,w,A);var E,C;return x=r.shiftPoint(t,n,h*4),x=r.shiftPoint(x,s,f*4),E=r.shiftPoint(n,t,h*4),E=r.shiftPoint(E,a,f*4),g=r.shiftPoint(a,s,h*4),g=r.shiftPoint(g,n,f*4),C=r.shiftPoint(s,a,h*4),C=r.shiftPoint(C,t,f*4),[x,E,g,C]},r.prototype.isValid=function(e){return e.getX()>=0&&e.getX()0&&e.getY()Math.abs(s-n);if(h){var x=n;n=a,a=x,x=s,s=f,f=x}for(var g=Math.abs(s-n),w=Math.abs(f-a),A=-g/2,E=a0){if(F===f)break;F+=E,A-=g}}return b},r})(),ua=(function(){function r(){this.decoder=new gc}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n,a;if(t!=null&&t.has(tt.PURE_BARCODE)){var s=r.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(s),a=r.NO_POINTS}else{var f=new pc(e.getBlackMatrix()).detect();n=this.decoder.decode(f.getBits()),a=f.getPoints()}var h=n.getRawBytes(),x=new Bt(n.getText(),h,8*h.length,a,se.DATA_MATRIX,Ke.currentTimeMillis()),g=n.getByteSegments();g!=null&&x.putMetadata(Rt.BYTE_SEGMENTS,g);var w=n.getECLevel();return w!=null&&x.putMetadata(Rt.ERROR_CORRECTION_LEVEL,w),x},r.prototype.reset=function(){},r.extractPureBits=function(e){var t=e.getTopLeftOnBit(),n=e.getBottomRightOnBit();if(t==null||n==null)throw new j;var a=this.moduleSize(t,e),s=t[1],f=n[1],h=t[0],x=n[0],g=(x-h+1)/a,w=(f-s+1)/a;if(g<=0||w<=0)throw new j;var A=a/2;s+=A,h+=A;for(var E=new br(g,w),C=0;C=r.FOR_BITS.size)throw new xe;return r.FOR_BITS.get(e)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(vn.L,"L",1),r.M=new r(vn.M,"M",0),r.Q=new r(vn.Q,"Q",3),r.H=new r(vn.H,"H",2),r})(),Ac=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},t1=(function(){function r(e){this.errorCorrectionLevel=wc.forBits(e>>3&3),this.dataMask=e&7}return r.numBitsDiffering=function(e,t){return Ie.bitCount(e^t)},r.decodeFormatInformation=function(e,t){var n=r.doDecodeFormatInformation(e,t);return n!==null?n:r.doDecodeFormatInformation(e^r.FORMAT_INFO_MASK_QR,t^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(e,t){var n,a,s=Number.MAX_SAFE_INTEGER,f=0;try{for(var h=Ac(r.FORMAT_INFO_DECODE_LOOKUP),x=h.next();!x.done;x=h.next()){var g=x.value,w=g[0];if(w===e||w===t)return new r(g[1]);var A=r.numBitsDiffering(e,w);A=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},G=(function(){function r(e){for(var t=[],n=1;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rn=(function(){function r(e,t){for(var n,a,s=[],f=2;f40)throw new xe;return r.VERSIONS[e-1]},r.decodeVersionInformation=function(e){for(var t=Number.MAX_SAFE_INTEGER,n=0,a=0;a6&&(t.setRegion(e-11,0,3,6),t.setRegion(0,e-11,6,3)),t},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 G(7,new N(1,19)),new G(10,new N(1,16)),new G(13,new N(1,13)),new G(17,new N(1,9))),new r(2,Int32Array.from([6,18]),new G(10,new N(1,34)),new G(16,new N(1,28)),new G(22,new N(1,22)),new G(28,new N(1,16))),new r(3,Int32Array.from([6,22]),new G(15,new N(1,55)),new G(26,new N(1,44)),new G(18,new N(2,17)),new G(22,new N(2,13))),new r(4,Int32Array.from([6,26]),new G(20,new N(1,80)),new G(18,new N(2,32)),new G(26,new N(2,24)),new G(16,new N(4,9))),new r(5,Int32Array.from([6,30]),new G(26,new N(1,108)),new G(24,new N(2,43)),new G(18,new N(2,15),new N(2,16)),new G(22,new N(2,11),new N(2,12))),new r(6,Int32Array.from([6,34]),new G(18,new N(2,68)),new G(16,new N(4,27)),new G(24,new N(4,19)),new G(28,new N(4,15))),new r(7,Int32Array.from([6,22,38]),new G(20,new N(2,78)),new G(18,new N(4,31)),new G(18,new N(2,14),new N(4,15)),new G(26,new N(4,13),new N(1,14))),new r(8,Int32Array.from([6,24,42]),new G(24,new N(2,97)),new G(22,new N(2,38),new N(2,39)),new G(22,new N(4,18),new N(2,19)),new G(26,new N(4,14),new N(2,15))),new r(9,Int32Array.from([6,26,46]),new G(30,new N(2,116)),new G(22,new N(3,36),new N(2,37)),new G(20,new N(4,16),new N(4,17)),new G(24,new N(4,12),new N(4,13))),new r(10,Int32Array.from([6,28,50]),new G(18,new N(2,68),new N(2,69)),new G(26,new N(4,43),new N(1,44)),new G(24,new N(6,19),new N(2,20)),new G(28,new N(6,15),new N(2,16))),new r(11,Int32Array.from([6,30,54]),new G(20,new N(4,81)),new G(30,new N(1,50),new N(4,51)),new G(28,new N(4,22),new N(4,23)),new G(24,new N(3,12),new N(8,13))),new r(12,Int32Array.from([6,32,58]),new G(24,new N(2,92),new N(2,93)),new G(22,new N(6,36),new N(2,37)),new G(26,new N(4,20),new N(6,21)),new G(28,new N(7,14),new N(4,15))),new r(13,Int32Array.from([6,34,62]),new G(26,new N(4,107)),new G(22,new N(8,37),new N(1,38)),new G(24,new N(8,20),new N(4,21)),new G(22,new N(12,11),new N(4,12))),new r(14,Int32Array.from([6,26,46,66]),new G(30,new N(3,115),new N(1,116)),new G(24,new N(4,40),new N(5,41)),new G(20,new N(11,16),new N(5,17)),new G(24,new N(11,12),new N(5,13))),new r(15,Int32Array.from([6,26,48,70]),new G(22,new N(5,87),new N(1,88)),new G(24,new N(5,41),new N(5,42)),new G(30,new N(5,24),new N(7,25)),new G(24,new N(11,12),new N(7,13))),new r(16,Int32Array.from([6,26,50,74]),new G(24,new N(5,98),new N(1,99)),new G(28,new N(7,45),new N(3,46)),new G(24,new N(15,19),new N(2,20)),new G(30,new N(3,15),new N(13,16))),new r(17,Int32Array.from([6,30,54,78]),new G(28,new N(1,107),new N(5,108)),new G(28,new N(10,46),new N(1,47)),new G(28,new N(1,22),new N(15,23)),new G(28,new N(2,14),new N(17,15))),new r(18,Int32Array.from([6,30,56,82]),new G(30,new N(5,120),new N(1,121)),new G(26,new N(9,43),new N(4,44)),new G(28,new N(17,22),new N(1,23)),new G(28,new N(2,14),new N(19,15))),new r(19,Int32Array.from([6,30,58,86]),new G(28,new N(3,113),new N(4,114)),new G(26,new N(3,44),new N(11,45)),new G(26,new N(17,21),new N(4,22)),new G(26,new N(9,13),new N(16,14))),new r(20,Int32Array.from([6,34,62,90]),new G(28,new N(3,107),new N(5,108)),new G(26,new N(3,41),new N(13,42)),new G(30,new N(15,24),new N(5,25)),new G(28,new N(15,15),new N(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new G(28,new N(4,116),new N(4,117)),new G(26,new N(17,42)),new G(28,new N(17,22),new N(6,23)),new G(30,new N(19,16),new N(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new G(28,new N(2,111),new N(7,112)),new G(28,new N(17,46)),new G(30,new N(7,24),new N(16,25)),new G(24,new N(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new G(30,new N(4,121),new N(5,122)),new G(28,new N(4,47),new N(14,48)),new G(30,new N(11,24),new N(14,25)),new G(30,new N(16,15),new N(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new G(30,new N(6,117),new N(4,118)),new G(28,new N(6,45),new N(14,46)),new G(30,new N(11,24),new N(16,25)),new G(30,new N(30,16),new N(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new G(26,new N(8,106),new N(4,107)),new G(28,new N(8,47),new N(13,48)),new G(30,new N(7,24),new N(22,25)),new G(30,new N(22,15),new N(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new G(28,new N(10,114),new N(2,115)),new G(28,new N(19,46),new N(4,47)),new G(28,new N(28,22),new N(6,23)),new G(30,new N(33,16),new N(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new G(30,new N(8,122),new N(4,123)),new G(28,new N(22,45),new N(3,46)),new G(30,new N(8,23),new N(26,24)),new G(30,new N(12,15),new N(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new G(30,new N(3,117),new N(10,118)),new G(28,new N(3,45),new N(23,46)),new G(30,new N(4,24),new N(31,25)),new G(30,new N(11,15),new N(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new G(30,new N(7,116),new N(7,117)),new G(28,new N(21,45),new N(7,46)),new G(30,new N(1,23),new N(37,24)),new G(30,new N(19,15),new N(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new G(30,new N(5,115),new N(10,116)),new G(28,new N(19,47),new N(10,48)),new G(30,new N(15,24),new N(25,25)),new G(30,new N(23,15),new N(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new G(30,new N(13,115),new N(3,116)),new G(28,new N(2,46),new N(29,47)),new G(30,new N(42,24),new N(1,25)),new G(30,new N(23,15),new N(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new G(30,new N(17,115)),new G(28,new N(10,46),new N(23,47)),new G(30,new N(10,24),new N(35,25)),new G(30,new N(19,15),new N(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new G(30,new N(17,115),new N(1,116)),new G(28,new N(14,46),new N(21,47)),new G(30,new N(29,24),new N(19,25)),new G(30,new N(11,15),new N(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new G(30,new N(13,115),new N(6,116)),new G(28,new N(14,46),new N(23,47)),new G(30,new N(44,24),new N(7,25)),new G(30,new N(59,16),new N(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new G(30,new N(12,121),new N(7,122)),new G(28,new N(12,47),new N(26,48)),new G(30,new N(39,24),new N(14,25)),new G(30,new N(22,15),new N(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new G(30,new N(6,121),new N(14,122)),new G(28,new N(6,47),new N(34,48)),new G(30,new N(46,24),new N(10,25)),new G(30,new N(2,15),new N(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new G(30,new N(17,122),new N(4,123)),new G(28,new N(29,46),new N(14,47)),new G(30,new N(49,24),new N(10,25)),new G(30,new N(24,15),new N(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new G(30,new N(4,122),new N(18,123)),new G(28,new N(13,46),new N(32,47)),new G(30,new N(48,24),new N(14,25)),new G(30,new N(42,15),new N(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new G(30,new N(20,117),new N(4,118)),new G(28,new N(40,47),new N(7,48)),new G(30,new N(43,24),new N(22,25)),new G(30,new N(10,15),new N(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new G(30,new N(19,118),new N(6,119)),new G(28,new N(18,47),new N(31,48)),new G(30,new N(34,24),new N(34,25)),new G(30,new N(20,15),new N(61,16)))],r})(),Et;(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"})(Et||(Et={}));var bo=(function(){function r(e,t){this.value=e,this.isMasked=t}return r.prototype.unmaskBitMatrix=function(e,t){for(var n=0;n=0;n--)e=this.copyBit(8,n,e);for(var a=this.bitMatrix.getHeight(),s=0,f=a-7,n=a-1;n>=f;n--)s=this.copyBit(8,n,s);for(var t=a-8;t=0;s--)for(var f=e-9;f>=a;f--)n=this.copyBit(f,s,n);var h=rn.decodeVersionInformation(n);if(h!==null&&h.getDimensionForVersion()===e)return this.parsedVersion=h,h;n=0;for(var f=5;f>=0;f--)for(var s=e-9;s>=a;s--)n=this.copyBit(f,s,n);if(h=rn.decodeVersionInformation(n),h!==null&&h.getDimensionForVersion()===e)return this.parsedVersion=h,h;throw new re},r.prototype.copyBit=function(e,t,n){var a=this.isMirror?this.bitMatrix.get(t,e):this.bitMatrix.get(e,t);return a?n<<1|1:n<<1},r.prototype.readCodewords=function(){var e=this.readFormatInformation(),t=this.readVersion(),n=bo.values.get(e.getDataMask()),a=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,a);for(var s=t.buildFunctionPattern(),f=!0,h=new Uint8Array(t.getTotalCodewords()),x=0,g=0,w=0,A=a-1;A>0;A-=2){A===6&&A--;for(var E=0;E=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_c=(function(){function r(e,t){this.numDataCodewords=e,this.codewords=t}return r.getDataBlocks=function(e,t,n){var a,s,f,h;if(e.length!==t.getTotalCodewords())throw new xe;var x=t.getECBlocksForLevel(n),g=0,w=x.getECBlocks();try{for(var A=To(w),E=A.next();!E.done;E=A.next()){var C=E.value;g+=C.getCount()}}catch(ne){a={error:ne}}finally{try{E&&!E.done&&(s=A.return)&&s.call(A)}finally{if(a)throw a.error}}var b=new Array(g),T=0;try{for(var P=To(w),F=P.next();!F.done;F=P.next())for(var C=F.value,D=0;D=0;){var U=b[K].codewords.length;if(U===q)break;K--}K++;for(var $=q-x.getECCodewordsPerBlock(),Y=0,D=0;D<$;D++)for(var ue=0;uee.available())throw new re;for(var a=new Uint8Array(2*n),s=0;n>0;){var f=e.readBits(13),h=f/96<<8&4294967295|f%96;h<959?h+=41377:h+=42657,a[s]=h>>8&255,a[s+1]=h&255,s+=2,n--}try{t.append(lr.decode(a,Te.GB2312))}catch(x){throw new re(x)}},r.decodeKanjiSegment=function(e,t,n){if(n*13>e.available())throw new re;for(var a=new Uint8Array(2*n),s=0;n>0;){var f=e.readBits(13),h=f/192<<8&4294967295|f%192;h<7936?h+=33088:h+=49472,a[s]=h>>8,a[s+1]=h,s+=2,n--}try{t.append(lr.decode(a,Te.SHIFT_JIS))}catch(x){throw new re(x)}},r.decodeByteSegment=function(e,t,n,a,s,f){if(8*n>e.available())throw new re;for(var h=new Uint8Array(n),x=0;x=r.ALPHANUMERIC_CHARS.length)throw new re;return r.ALPHANUMERIC_CHARS[e]},r.decodeAlphanumericSegment=function(e,t,n,a){for(var s=t.length();n>1;){if(e.available()<11)throw new re;var f=e.readBits(11);t.append(r.toAlphaNumericChar(Math.floor(f/45))),t.append(r.toAlphaNumericChar(f%45)),n-=2}if(n===1){if(e.available()<6)throw new re;t.append(r.toAlphaNumericChar(e.readBits(6)))}if(a)for(var h=s;h=3;){if(e.available()<10)throw new re;var a=e.readBits(10);if(a>=1e3)throw new re;t.append(r.toAlphaNumericChar(Math.floor(a/100))),t.append(r.toAlphaNumericChar(Math.floor(a/10)%10)),t.append(r.toAlphaNumericChar(a%10)),n-=3}if(n===2){if(e.available()<7)throw new re;var s=e.readBits(7);if(s>=100)throw new re;t.append(r.toAlphaNumericChar(Math.floor(s/10))),t.append(r.toAlphaNumericChar(s%10))}else if(n===1){if(e.available()<4)throw new re;var f=e.readBits(4);if(f>=10)throw new re;t.append(r.toAlphaNumericChar(f))}},r.parseECIValue=function(e){var t=e.readBits(8);if((t&128)===0)return t&127;if((t&192)===128){var n=e.readBits(8);return(t&63)<<8&4294967295|n}if((t&224)===192){var a=e.readBits(16);return(t&31)<<16&4294967295|a}throw new re},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r})(),r1=(function(){function r(e){this.mirrored=e}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(e){if(!(!this.mirrored||e===null||e.length<3)){var t=e[0];e[0]=e[2],e[2]=t}},r})(),Oo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ic=(function(){function r(){this.rsDecoder=new yi(Jt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(e,t){return this.decodeBitMatrix(br.parseFromBooleanArray(e),t)},r.prototype.decodeBitMatrix=function(e,t){var n=new Cc(e),a=null;try{return this.decodeBitMatrixParser(n,t)}catch(f){a=f}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var s=this.decodeBitMatrixParser(n,t);return s.setOther(new r1(!0)),s}catch(f){throw a!==null?a:f}},r.prototype.decodeBitMatrixParser=function(e,t){var n,a,s,f,h=e.readVersion(),x=e.readFormatInformation().getErrorCorrectionLevel(),g=e.readCodewords(),w=_c.getDataBlocks(g,h,x),A=0;try{for(var E=Oo(w),C=E.next();!C.done;C=E.next()){var b=C.value;A+=b.getNumDataCodewords()}}catch(K){n={error:K}}finally{try{C&&!C.done&&(a=E.return)&&a.call(E)}finally{if(n)throw n.error}}var T=new Uint8Array(A),P=0;try{for(var F=Oo(w),D=F.next();!D.done;D=F.next()){var b=D.value,L=b.getCodewords(),k=b.getNumDataCodewords();this.correctErrors(L,k);for(var q=0;q=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Oc=(function(){function r(e,t,n,a,s,f,h){this.image=e,this.startX=t,this.startY=n,this.width=a,this.height=s,this.moduleSize=f,this.resultPointCallback=h,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var e=this.startX,t=this.height,n=this.width,a=e+n,s=this.startY+t/2,f=new Int32Array(3),h=this.image,x=0;x=n)return!1;return!0},r.prototype.crossCheckVertical=function(e,t,n,a){var s=this.image,f=s.getHeight(),h=this.crossCheckStateCount;h[0]=0,h[1]=0,h[2]=0;for(var x=e;x>=0&&s.get(t,x)&&h[1]<=n;)h[1]++,x--;if(x<0||h[1]>n)return NaN;for(;x>=0&&!s.get(t,x)&&h[0]<=n;)h[0]++,x--;if(h[0]>n)return NaN;for(x=e+1;xn)return NaN;for(;xn)return NaN;var g=h[0]+h[1]+h[2];return 5*Math.abs(g-a)>=2*a?NaN:this.foundPatternCross(h)?r.centerFromEnd(h,x):NaN},r.prototype.handlePossibleCenter=function(e,t,n){var a,s,f=e[0]+e[1]+e[2],h=r.centerFromEnd(e,n),x=this.crossCheckVertical(t,h,2*e[1],f);if(!isNaN(x)){var g=(e[0]+e[1]+e[2])/3;try{for(var w=Tc(this.possibleCenters),A=w.next();!A.done;A=w.next()){var E=A.value;if(E.aboutEquals(g,x,h))return E.combineEstimate(x,h,g)}}catch(b){a={error:b}}finally{try{A&&!A.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}var C=new bc(h,x,g);this.possibleCenters.push(C),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(C)}return null},r})(),Nc=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Rc=(function(r){Nc(e,r);function e(t,n,a,s){var f=r.call(this,t,n)||this;return f.estimatedModuleSize=a,f.count=s,s===void 0&&(f.count=1),f}return e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,n,a){if(Math.abs(n-this.getY())<=t&&Math.abs(a-this.getX())<=t){var s=Math.abs(t-this.estimatedModuleSize);return s<=1||s<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,n,a){var s=this.count+1,f=(this.count*this.getX()+n)/s,h=(this.count*this.getY()+t)/s,x=(this.count*this.estimatedModuleSize+a)/s;return new e(f,h,x,s)},e})(ce),Dc=(function(){function r(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r})(),Dn=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Mc=(function(){function r(e,t){this.image=e,this.resultPointCallback=t,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=t}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(e){var t=e!=null&&e.get(tt.TRY_HARDER)!==void 0,n=e!=null&&e.get(tt.PURE_BARCODE)!==void 0,a=this.image,s=a.getHeight(),f=a.getWidth(),h=Math.floor(3*s/(4*r.MAX_MODULES));(hg[2]&&(w+=b-g[2]-h,E=f-1)}else{g[0]=g[2],g[1]=g[3],g[2]=g[4],g[3]=1,g[4]=0,A=3;continue}A=0,g[0]=0,g[1]=0,g[2]=0,g[3]=0,g[4]=0}else g[0]=g[2],g[1]=g[3],g[2]=g[4],g[3]=1,g[4]=0,A=3;else g[++A]++;else g[A]++;if(r.foundPatternCross(g)){var C=this.handlePossibleCenter(g,w,f,n);C===!0&&(h=g[0],this.hasSkipped&&(x=this.haveMultiplyConfirmedCenters()))}}var T=this.selectBestPatterns();return ce.orderBestPatterns(T),new Dc(T)},r.centerFromEnd=function(e,t){return t-e[4]-e[3]-e[2]/2},r.foundPatternCross=function(e){for(var t=0,n=0;n<5;n++){var a=e[n];if(a===0)return!1;t+=a}if(t<7)return!1;var s=t/7,f=s/2;return Math.abs(s-e[0])=f&&t>=f&&h.get(t-f,e-f);)s[2]++,f++;if(e=f&&t>=f&&!h.get(t-f,e-f)&&s[1]<=n;)s[1]++,f++;if(en)return!1;for(;e>=f&&t>=f&&h.get(t-f,e-f)&&s[0]<=n;)s[0]++,f++;if(s[0]>n)return!1;var x=h.getHeight(),g=h.getWidth();for(f=1;e+f=x||t+f>=g)return!1;for(;e+f=x||t+f>=g||s[3]>=n)return!1;for(;e+f=n)return!1;var w=s[0]+s[1]+s[2]+s[3]+s[4];return Math.abs(w-a)<2*a&&r.foundPatternCross(s)},r.prototype.crossCheckVertical=function(e,t,n,a){for(var s=this.image,f=s.getHeight(),h=this.getCrossCheckStateCount(),x=e;x>=0&&s.get(t,x);)h[2]++,x--;if(x<0)return NaN;for(;x>=0&&!s.get(t,x)&&h[1]<=n;)h[1]++,x--;if(x<0||h[1]>n)return NaN;for(;x>=0&&s.get(t,x)&&h[0]<=n;)h[0]++,x--;if(h[0]>n)return NaN;for(x=e+1;x=n)return NaN;for(;x=n)return NaN;var g=h[0]+h[1]+h[2]+h[3]+h[4];return 5*Math.abs(g-a)>=2*a?NaN:r.foundPatternCross(h)?r.centerFromEnd(h,x):NaN},r.prototype.crossCheckHorizontal=function(e,t,n,a){for(var s=this.image,f=s.getWidth(),h=this.getCrossCheckStateCount(),x=e;x>=0&&s.get(x,t);)h[2]++,x--;if(x<0)return NaN;for(;x>=0&&!s.get(x,t)&&h[1]<=n;)h[1]++,x--;if(x<0||h[1]>n)return NaN;for(;x>=0&&s.get(x,t)&&h[0]<=n;)h[0]++,x--;if(h[0]>n)return NaN;for(x=e+1;x=n)return NaN;for(;x=n)return NaN;var g=h[0]+h[1]+h[2]+h[3]+h[4];return 5*Math.abs(g-a)>=a?NaN:r.foundPatternCross(h)?r.centerFromEnd(h,x):NaN},r.prototype.handlePossibleCenter=function(e,t,n,a){var s=e[0]+e[1]+e[2]+e[3]+e[4],f=r.centerFromEnd(e,n),h=this.crossCheckVertical(t,Math.floor(f),e[2],s);if(!isNaN(h)&&(f=this.crossCheckHorizontal(Math.floor(f),Math.floor(h),e[2],s),!isNaN(f)&&(!a||this.crossCheckDiagonal(Math.floor(h),Math.floor(f),e[2],s)))){for(var x=s/7,g=!1,w=this.possibleCenters,A=0,E=w.length;A=r.CENTER_QUORUM)if(a==null)a=h;else return this.hasSkipped=!0,Math.floor((Math.abs(a.getX()-h.getX())-Math.abs(a.getY()-h.getY()))/2)}}catch(x){e={error:x}}finally{try{f&&!f.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var e,t,n,a,s=0,f=0,h=this.possibleCenters.length;try{for(var x=Dn(this.possibleCenters),g=x.next();!g.done;g=x.next()){var w=g.value;w.getCount()>=r.CENTER_QUORUM&&(s++,f+=w.getEstimatedModuleSize())}}catch(T){e={error:T}}finally{try{g&&!g.done&&(t=x.return)&&t.call(x)}finally{if(e)throw e.error}}if(s<3)return!1;var A=f/h,E=0;try{for(var C=Dn(this.possibleCenters),b=C.next();!b.done;b=C.next()){var w=b.value;E+=Math.abs(w.getEstimatedModuleSize()-A)}}catch(T){n={error:T}}finally{try{b&&!b.done&&(a=C.return)&&a.call(C)}finally{if(n)throw n.error}}return E<=.05*f},r.prototype.selectBestPatterns=function(){var e,t,n,a,s=this.possibleCenters.length;if(s<3)throw new j;var f=this.possibleCenters,h;if(s>3){var x=0,g=0;try{for(var w=Dn(this.possibleCenters),A=w.next();!A.done;A=w.next()){var E=A.value,C=E.getEstimatedModuleSize();x+=C,g+=C*C}}catch(q){e={error:q}}finally{try{A&&!A.done&&(t=w.return)&&t.call(w)}finally{if(e)throw e.error}}h=x/s;var b=Math.sqrt(g/s-h*h);f.sort(function(q,K){var U=Math.abs(K.getEstimatedModuleSize()-h),$=Math.abs(q.getEstimatedModuleSize()-h);return U<$?-1:U>$?1:0});for(var T=Math.max(.2*h,b),P=0;P3;P++){var F=f[P];Math.abs(F.getEstimatedModuleSize()-h)>T&&(f.splice(P,1),P--)}}if(f.length>3){var x=0;try{for(var D=Dn(f),L=D.next();!L.done;L=D.next()){var k=L.value;x+=k.getEstimatedModuleSize()}}catch(K){n={error:K}}finally{try{L&&!L.done&&(a=D.return)&&a.call(D)}finally{if(n)throw n.error}}h=x/f.length,f.sort(function(K,U){if(U.getCount()===K.getCount()){var $=Math.abs(U.getEstimatedModuleSize()-h),Y=Math.abs(K.getEstimatedModuleSize()-h);return $Y?-1:0}else return U.getCount()-K.getCount()}),f.splice(3)}return[f[0],f[1],f[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r})(),Pc=(function(){function r(e){this.image=e}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(tt.NEED_RESULT_POINT_CALLBACK);var t=new Mc(this.image,this.resultPointCallback),n=t.find(e);return this.processFinderPatternInfo(n)},r.prototype.processFinderPatternInfo=function(e){var t=e.getTopLeft(),n=e.getTopRight(),a=e.getBottomLeft(),s=this.calculateModuleSize(t,n,a);if(s<1)throw new j("No pattern found in proccess finder.");var f=r.computeDimension(t,n,a,s),h=rn.getProvisionalVersionForDimension(f),x=h.getDimensionForVersion()-7,g=null;if(h.getAlignmentPatternCenters().length>0)for(var w=n.getX()-t.getX()+a.getX(),A=n.getY()-t.getY()+a.getY(),E=1-3/x,C=Math.floor(t.getX()+E*(w-t.getX())),b=Math.floor(t.getY()+E*(A-t.getY())),T=4;T<=16;T<<=1)try{g=this.findAlignmentInRegion(s,C,b,T);break}catch(L){if(!(L instanceof j))throw L}var P=r.createTransform(t,n,a,g,f),F=r.sampleGrid(this.image,P,f),D;return g===null?D=[a,t,n]:D=[a,t,n,g],new ya(F,D)},r.createTransform=function(e,t,n,a,s){var f=s-3.5,h,x,g,w;return a!==null?(h=a.getX(),x=a.getY(),g=f-3,w=g):(h=t.getX()-e.getX()+n.getX(),x=t.getY()-e.getY()+n.getY(),g=f,w=f),qo.quadrilateralToQuadrilateral(3.5,3.5,f,3.5,g,w,3.5,f,e.getX(),e.getY(),t.getX(),t.getY(),h,x,n.getX(),n.getY())},r.sampleGrid=function(e,t,n){var a=Ea.getInstance();return a.sampleGridWithTransform(e,n,n,t)},r.computeDimension=function(e,t,n,a){var s=De.round(ce.distance(e,t)/a),f=De.round(ce.distance(e,n)/a),h=Math.floor((s+f)/2)+7;switch(h&3){case 0:h++;break;case 2:h--;break;case 3:throw new j("Dimensions could be not found.")}return h},r.prototype.calculateModuleSize=function(e,t,n){return(this.calculateModuleSizeOneWay(e,t)+this.calculateModuleSizeOneWay(e,n))/2},r.prototype.calculateModuleSizeOneWay=function(e,t){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY())),a=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(n)?a/7:isNaN(a)?n/7:(n+a)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,t,n,a){var s=this.sizeOfBlackWhiteBlackRun(e,t,n,a),f=1,h=e-(n-e);h<0?(f=e/(e-h),h=0):h>=this.image.getWidth()&&(f=(this.image.getWidth()-1-e)/(h-e),h=this.image.getWidth()-1);var x=Math.floor(t-(a-t)*f);return f=1,x<0?(f=t/(t-x),x=0):x>=this.image.getHeight()&&(f=(this.image.getHeight()-1-t)/(x-t),x=this.image.getHeight()-1),h=Math.floor(e+(h-e)*f),s+=this.sizeOfBlackWhiteBlackRun(e,t,h,x),s-1},r.prototype.sizeOfBlackWhiteBlackRun=function(e,t,n,a){var s=Math.abs(a-t)>Math.abs(n-e);if(s){var f=e;e=t,t=f,f=n,n=a,a=f}for(var h=Math.abs(n-e),x=Math.abs(a-t),g=-h/2,w=e0){if(T===a)break;T+=A,g-=h}}return E===2?De.distance(n+w,a,e,t):NaN},r.prototype.findAlignmentInRegion=function(e,t,n,a){var s=Math.floor(a*e),f=Math.max(0,t-s),h=Math.min(this.image.getWidth()-1,t+s);if(h-f=x||s>=f)throw new j;if(f-s!==x-h&&(x=h+(f-s),x>=e.getWidth()))throw new j;var g=Math.round((x-h+1)/a),w=Math.round((f-s+1)/a);if(g<=0||w<=0)throw new j;if(w!==g)throw new j;var A=Math.floor(a/2);s+=A,h+=A;var E=h+Math.floor((g-1)*a)-x;if(E>0){if(E>A)throw new j;h-=E}var C=s+Math.floor((w-1)*a)-f;if(C>0){if(C>A)throw new j;s-=C}for(var b=new br(g,w),T=0;T=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Re=(function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(e){return De.sum(e)},r.toIntArray=function(e){var t,n;if(e==null||!e.length)return r.EMPTY_INT_ARRAY;var a=new Int32Array(e.length),s=0;try{for(var f=Bc(e),h=f.next();!h.done;h=f.next()){var x=h.value;a[s++]=x}}catch(g){t={error:g}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return a},r.getCodeword=function(e){var t=pt.binarySearch(r.SYMBOL_TABLE,e&262143);return t<0?-1:(r.CODEWORD_TABLE[t]-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})(),Lc=(function(){function r(e,t){this.bits=e,this.points=t}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r})(),Fc=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kc=(function(){function r(){}return r.detectMultiple=function(e,t,n){var a=e.getBlackMatrix(),s=r.detect(n,a);return s.length||(a=a.clone(),a.rotate180(),s=r.detect(n,a)),new Lc(a,s)},r.detect=function(e,t){for(var n,a,s=new Array,f=0,h=0,x=!1;f0;){var A=r.findGuardPattern(e,s,--a,n,!1,f,g);if(A!=null)w=A;else{a++;break}}h[0]=new ce(w[0],a),h[1]=new ce(w[1],a),x=!0;break}}var E=a+1;if(x){for(var C=0,A=Int32Array.from([Math.trunc(h[0].getX()),Math.trunc(h[1].getX())]);Er.SKIPPED_ROW_COUNT_MAX)break;C++}}E-=C+1,h[2]=new ce(A[0],E),h[3]=new ce(A[1],E)}return E-a0&&g++E?A-E:E-A;if(C>n)return 1/0;g+=C}return g/s},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})(),Uc=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},en=(function(){function r(e,t){if(t.length===0)throw new xe;this.field=e;var n=t.length;if(n>1&&t[0]===0){for(var a=1;an.length){var a=t;t=n,n=a}var s=new Int32Array(n.length),f=n.length-t.length;Ke.arraycopy(n,0,s,0,f);for(var h=f;h=0;t--){var n=this.getCoefficient(t);n!==0&&(n<0?(e.append(" - "),n=-n):e.length()>0&&e.append(" + "),(t===0||n!==1)&&e.append(n),t!==0&&(t===1?e.append("x"):(e.append("x^"),e.append(t))))}return e.toString()},r})(),Vc=(function(){function r(){}return r.prototype.add=function(e,t){return(e+t)%this.modulus},r.prototype.subtract=function(e,t){return(this.modulus+e-t)%this.modulus},r.prototype.exp=function(e){return this.expTable[e]},r.prototype.log=function(e){if(e===0)throw new xe;return this.logTable[e]},r.prototype.inverse=function(e){if(e===0)throw new Ko;return this.expTable[this.modulus-this.logTable[e]-1]},r.prototype.multiply=function(e,t){return e===0||t===0?0:this.expTable[(this.logTable[e]+this.logTable[t])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(e){return e===this},r})(),Hc=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Gc=(function(r){Hc(e,r);function e(t,n){var a=r.call(this)||this;a.modulus=t,a.expTable=new Int32Array(t),a.logTable=new Int32Array(t);for(var s=1,f=0;f=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wc=(function(){function r(){this.field=Gc.PDF417_GF}return r.prototype.decode=function(e,t,n){for(var a,s,f=new en(this.field,e),h=new Int32Array(t),x=!1,g=t;g>0;g--){var w=f.evaluateAt(this.field.exp(g));h[t-g]=w,w!==0&&(x=!0)}if(!x)return 0;var A=this.field.getOne();if(n!=null)try{for(var E=Xc(n),C=E.next();!C.done;C=E.next()){var b=C.value,T=this.field.exp(e.length-1-b),P=new en(this.field,new Int32Array([this.field.subtract(0,T),1]));A=A.multiply(P)}}catch($){a={error:$}}finally{try{C&&!C.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}for(var F=new en(this.field,h),D=this.runEuclideanAlgorithm(this.field.buildMonomial(t,1),F,t),L=D[0],k=D[1],q=this.findErrorLocations(L),K=this.findErrorMagnitudes(k,L,q),g=0;g=Math.round(n/2);){var g=s,w=h;if(s=f,h=x,s.isZero())throw _t.getChecksumInstance();f=g;for(var A=this.field.getZero(),E=s.getCoefficient(s.getDegree()),C=this.field.inverse(E);f.getDegree()>=s.getDegree()&&!f.isZero();){var b=f.getDegree()-s.getDegree(),T=this.field.multiply(f.getCoefficient(f.getDegree()),C);A=A.add(this.field.buildMonomial(b,T)),f=f.subtract(s.multiplyByMonomial(b,T))}x=A.multiply(h).subtract(w).negative()}var P=x.getCoefficient(0);if(P===0)throw _t.getChecksumInstance();var F=this.field.inverse(P),D=x.multiply(F),L=f.multiply(F);return[D,L]},r.prototype.findErrorLocations=function(e){for(var t=e.getDegree(),n=new Int32Array(t),a=0,s=1;s0){var x=n?this.topLeft:this.topRight,g=Math.trunc(x.getY()-e);g<0&&(g=0);var w=new ce(x.getX(),g);n?a=w:f=w}if(t>0){var A=n?this.bottomLeft:this.bottomRight,E=Math.trunc(A.getY()+t);E>=this.image.getHeight()&&(E=this.image.getHeight()-1);var C=new ce(A.getX(),E);n?s=C:h=C}return new r(this.image,a,s,f,h)},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})(),zc=(function(){function r(e,t,n,a){this.columnCount=e,this.errorCorrectionLevel=a,this.rowCountUpperPart=t,this.rowCountLowerPart=n,this.rowCount=t+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})(),_a=(function(){function r(){this.buffer=""}return r.form=function(e,t){var n=-1;function a(f,h,x,g,w,A){if(f==="%%")return"%";if(t[++n]!==void 0){f=g?parseInt(g.substr(1)):void 0;var E=w?parseInt(w.substr(1)):void 0,C;switch(A){case"s":C=t[n];break;case"c":C=t[n][0];break;case"f":C=parseFloat(t[n]).toFixed(f);break;case"p":C=parseFloat(t[n]).toPrecision(f);break;case"e":C=parseFloat(t[n]).toExponential(f);break;case"x":C=parseInt(t[n]).toString(E||16);break;case"d":C=parseFloat(parseInt(t[n],E||10).toPrecision(f)).toFixed(0);break}C=typeof C=="object"?JSON.stringify(C):(+C).toString(E);for(var b=parseInt(x),T=x&&x[0]+""=="0"?"0":" ";C.length=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n1=(function(){function r(e){this.boundingBox=new ha(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return r.prototype.getCodewordNearby=function(e){var t=this.getCodeword(e);if(t!=null)return t;for(var n=1;n=0&&(t=this.codewords[a],t!=null)||(a=this.imageRowToCodewordIndex(e)+n,a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jc=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),a,s=[],f;try{for(;(e===void 0||e-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(h){f={error:h}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(f)throw f.error}}return s},kn=(function(){function r(){this.values=new Map}return r.prototype.setValue=function(e){e=Math.trunc(e);var t=this.values.get(e);t==null&&(t=0),t++,this.values.set(e,t)},r.prototype.getValue=function(){var e,t,n=-1,a=new Array,s=function(A,E){var C={getKey:function(){return A},getValue:function(){return E}};C.getValue()>n?(n=C.getValue(),a=[],a.push(C.getKey())):C.getValue()===n&&a.push(C.getKey())};try{for(var f=Zc(this.values.entries()),h=f.next();!h.done;h=f.next()){var x=jc(h.value,2),g=x[0],w=x[1];s(g,w)}}catch(A){e={error:A}}finally{try{h&&!h.done&&(t=f.return)&&t.call(f)}finally{if(e)throw e.error}}return Re.toIntArray(a)},r.prototype.getConfidence=function(e){return this.values.get(e)},r})(),Kc=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),ji=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},No=(function(r){Kc(e,r);function e(t,n){var a=r.call(this,t)||this;return a._isLeft=n,a}return e.prototype.setRowNumbers=function(){var t,n;try{for(var a=ji(this.getCodewords()),s=a.next();!s.done;s=a.next()){var f=s.value;f!=null&&f.setRowNumberAsRowIndicatorColumn()}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,t);for(var a=this.getBoundingBox(),s=this._isLeft?a.getTopLeft():a.getTopRight(),f=this._isLeft?a.getBottomLeft():a.getBottomRight(),h=this.imageRowToCodewordIndex(Math.trunc(s.getY())),x=this.imageRowToCodewordIndex(Math.trunc(f.getY())),g=-1,w=1,A=0,E=h;E=t.getRowCount()||b>E)n[E]=null;else{var T=void 0;w>2?T=(w-2)*b:T=b;for(var P=T>=E,F=1;F<=T&&!P;F++)P=n[E-F]!=null;P?n[E]=null:(g=C.getRowNumber(),A=1)}}},e.prototype.getRowHeights=function(){var t,n,a=this.getBarcodeMetadata();if(a==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(a);var s=new Int32Array(a.getRowCount());try{for(var f=ji(this.getCodewords()),h=f.next();!h.done;h=f.next()){var x=h.value;if(x!=null){var g=x.getRowNumber();if(g>=s.length)continue;s[g]++}}}catch(w){t={error:w}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return s},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var n=this.getBoundingBox(),a=this._isLeft?n.getTopLeft():n.getTopRight(),s=this._isLeft?n.getBottomLeft():n.getBottomRight(),f=this.imageRowToCodewordIndex(Math.trunc(a.getY())),h=this.imageRowToCodewordIndex(Math.trunc(s.getY())),x=this.getCodewords(),g=-1,w=f;w=t.getRowCount()?x[w]=null:g=A.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,n,a=this.getCodewords(),s=new kn,f=new kn,h=new kn,x=new kn;try{for(var g=ji(a),w=g.next();!w.done;w=g.next()){var A=w.value;if(A!=null){A.setRowNumberAsRowIndicatorColumn();var E=A.getValue()%30,C=A.getRowNumber();switch(this._isLeft||(C+=2),C%3){case 0:f.setValue(E*3+1);break;case 1:x.setValue(E/3),h.setValue(E%3);break;case 2:s.setValue(E+1);break}}}}catch(T){t={error:T}}finally{try{w&&!w.done&&(n=g.return)&&n.call(g)}finally{if(t)throw t.error}}if(s.getValue().length===0||f.getValue().length===0||h.getValue().length===0||x.getValue().length===0||s.getValue()[0]<1||f.getValue()[0]+h.getValue()[0]Re.MAX_ROWS_IN_BARCODE)return null;var b=new zc(s.getValue()[0],f.getValue()[0],h.getValue()[0],x.getValue()[0]);return this.removeIncorrectCodewords(a,b),b},e.prototype.removeIncorrectCodewords=function(t,n){for(var a=0;an.getRowCount()){t[a]=null;continue}switch(this._isLeft||(h+=2),h%3){case 0:f*3+1!==n.getRowCountUpperPart()&&(t[a]=null);break;case 1:(Math.trunc(f/3)!==n.getErrorCorrectionLevel()||f%3!==n.getRowCountLowerPart())&&(t[a]=null);break;case 2:f+1!==n.getColumnCount()&&(t[a]=null);break}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+` `+r.prototype.toString.call(this)},e})(n1),qc=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Qc=(function(){function r(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,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 e=Re.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e0&&s0&&(g[0]=n[t-1],g[4]=h[t-1],g[5]=x[t-1]),t>1&&(g[8]=n[t-2],g[10]=h[t-2],g[11]=x[t-2]),t>=1;n=t&1,r.RATIOS_TABLE[e]||(r.RATIOS_TABLE[e]=new Array(Re.BARS_IN_MODULE)),r.RATIOS_TABLE[e][Re.BARS_IN_MODULE-a-1]=Math.fround(s/Re.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(e){var t=r.getDecodedCodewordValue(r.sampleBitCounts(e));return t!==-1?t:r.getClosestDecodedValue(e)},r.sampleBitCounts=function(e){for(var t=De.sum(e),n=new Int32Array(Re.BARS_IN_MODULE),a=0,s=0,f=0;f1)for(var a=0;a=s)break}xe.length||n<0||t+n>e.length||t+n<0)throw new wa;if(n===0)return;for(var a=0;a0&&this.grow(t)},e.prototype.grow=function(t){var n=this.buf.length,a=n<<1;if(a-t<0&&(a=t),a<0){if(t<0)throw new of;a=Ie.MAX_VALUE}this.buf=pt.copyOfUint8Array(this.buf,a)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,n,a){if(n<0||n>t.length||a<0||n+a-t.length>0)throw new wa;this.ensureCapacity(this.count+a),Ke.arraycopy(t,n,this.buf,this.count,a),this.count+=a},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return pt.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?typeof t=="string"?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e})(nf),Xe;(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"})(Xe||(Xe={}));function i1(){if(typeof window<"u")return window.BigInt||null;if(typeof ja<"u")return ja.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}var ii;function Hr(r){if(typeof ii>"u"&&(ii=i1()),ii===null)throw new Error("BigInt is not supported!");return ii(r)}function ff(){var r=[];r[0]=Hr(1);var e=Hr(900);r[1]=e;for(var t=2;t<16;t++)r[t]=r[t-1]*e;return r}var uf=(function(){function r(){}return r.decode=function(e,t){var n=new Ce(""),a=gt.ISO8859_1;n.enableDecoding(a);for(var s=1,f=e[s++],h=new ef;se[0])throw re.getFormatInstance();for(var a=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),s=0;s0){for(var E=0;E<6;++E)f.write(Number(Hr(x)>>Hr(8*(5-E))));x=0,h=0}break}a===t[0]&&A0){for(var E=0;E<6;++E)f.write(Number(Hr(x)>>Hr(8*(5-E))));x=0,h=0}}break}return s.append(lr.decode(f.toByteArray(),n)),a},r.numericCompaction=function(e,t,n){for(var a=0,s=!1,f=new Int32Array(r.MAX_NUMERIC_CODEWORDS);t0&&(n.append(r.decodeBase900toBase10(f,a)),a=0)}return t},r.decodeBase900toBase10=function(e,t){for(var n=Hr(0),a=0;a@[\\]_\`~!\r ,: -.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=i1()?ff():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r})(),Mn=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lf=(function(){function r(){}return r.decode=function(e,t,n,a,s,f,h){for(var x=new ha(e,t,n,a,s),g=null,w=null,A,E=!0;;E=!1){if(t!=null&&(g=r.getRowIndicatorColumn(e,x,t,!0,f,h)),a!=null&&(w=r.getRowIndicatorColumn(e,x,a,!1,f,h)),A=r.merge(g,w),A==null)throw j.getNotFoundInstance();var C=A.getBoundingBox();if(E&&C!=null&&(C.getMinY()x.getMaxY()))x=C;else break}A.setBoundingBox(x);var b=A.getBarcodeColumnCount()+1;A.setDetectionResultColumn(0,g),A.setDetectionResultColumn(b,w);for(var T=g!=null,P=1;P<=b;P++){var F=T?P:b-P;if(A.getDetectionResultColumn(F)===void 0){var D=void 0;F===0||F===b?D=new No(x,F===0):D=new n1(x),A.setDetectionResultColumn(F,D);for(var L=-1,k=L,q=x.getMinY();q<=x.getMaxY();q++){if(L=r.getStartColumn(A,F,q,T),L<0||L>x.getMaxX()){if(k===-1)continue;L=k}var K=r.detectCodeword(e,x.getMinX(),x.getMaxX(),T,L,q,f,h);K!=null&&(D.setCodeword(q,K),k=L,f=Math.min(f,K.getWidth()),h=Math.max(h,K.getWidth()))}}}return r.createDecoderResult(A)},r.merge=function(e,t){if(e==null&&t==null)return null;var n=r.getBarcodeMetadata(e,t);if(n==null)return null;var a=ha.merge(r.adjustBoundingBox(e),r.adjustBoundingBox(t));return new Qc(n,a)},r.adjustBoundingBox=function(e){var t,n;if(e==null)return null;var a=e.getRowHeights();if(a==null)return null;var s=r.getMax(a),f=0;try{for(var h=Mn(a),x=h.next();!x.done;x=h.next()){var g=x.value;if(f+=s-g,g>0)break}}catch(C){t={error:C}}finally{try{x&&!x.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}for(var w=e.getCodewords(),A=0;f>0&&w[A]==null;A++)f--;for(var E=0,A=a.length-1;A>=0&&(E+=s-a[A],!(a[A]>0));A--);for(var A=w.length-1;E>0&&w[A]==null;A--)E--;return e.getBoundingBox().addMissingRows(f,E,e.isLeft())},r.getMax=function(e){var t,n,a=-1;try{for(var s=Mn(e),f=s.next();!f.done;f=s.next()){var h=f.value;a=Math.max(a,h)}}catch(x){t={error:x}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return a},r.getBarcodeMetadata=function(e,t){var n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();var a;return t==null||(a=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==a.getColumnCount()&&n.getErrorCorrectionLevel()!==a.getErrorCorrectionLevel()&&n.getRowCount()!==a.getRowCount()?null:n},r.getRowIndicatorColumn=function(e,t,n,a,s,f){for(var h=new No(t,a),x=0;x<2;x++)for(var g=x===0?1:-1,w=Math.trunc(Math.trunc(n.getX())),A=Math.trunc(Math.trunc(n.getY()));A<=t.getMaxY()&&A>=t.getMinY();A+=g){var E=r.detectCodeword(e,0,e.getWidth(),a,w,A,s,f);E!=null&&(h.setCodeword(A,E),a?w=E.getStartX():w=E.getEndX())}return h},r.adjustCodewordCount=function(e,t){var n=t[0][1],a=n.getValue(),s=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-r.getNumberOfECCodeWords(e.getBarcodeECLevel());if(a.length===0){if(s<1||s>Re.MAX_CODEWORDS_IN_BARCODE)throw j.getNotFoundInstance();n.setValue(s)}else a[0]!==s&&n.setValue(s)},r.createDecoderResult=function(e){var t=r.createBarcodeMatrix(e);r.adjustCodewordCount(e,t);for(var n=new Array,a=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),s=[],f=new Array,h=0;h0;){for(var x=0;x=0){if(P>=f.length)continue;f[P][g].setValue(T.getValue())}}}}catch(F){a={error:F}}finally{try{b&&!b.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}g++}}catch(F){t={error:F}}finally{try{A&&!A.done&&(n=w.return)&&n.call(w)}finally{if(t)throw t.error}}return f},r.isValidBarcodeColumn=function(e,t){return t>=0&&t<=e.getBarcodeColumnCount()+1},r.getStartColumn=function(e,t,n,a){var s,f,h=a?1:-1,x=null;if(r.isValidBarcodeColumn(e,t-h)&&(x=e.getDetectionResultColumn(t-h).getCodeword(n)),x!=null)return a?x.getEndX():x.getStartX();if(x=e.getDetectionResultColumn(t).getCodewordNearby(n),x!=null)return a?x.getStartX():x.getEndX();if(r.isValidBarcodeColumn(e,t-h)&&(x=e.getDetectionResultColumn(t-h).getCodewordNearby(n)),x!=null)return a?x.getEndX():x.getStartX();for(var g=0;r.isValidBarcodeColumn(e,t-h);){t-=h;try{for(var w=(s=void 0,Mn(e.getDetectionResultColumn(t).getCodewords())),A=w.next();!A.done;A=w.next()){var E=A.value;if(E!=null)return(a?E.getEndX():E.getStartX())+h*g*(E.getEndX()-E.getStartX())}}catch(C){s={error:C}}finally{try{A&&!A.done&&(f=w.return)&&f.call(w)}finally{if(s)throw s.error}}g++}return a?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},r.detectCodeword=function(e,t,n,a,s,f,h,x){s=r.adjustCodewordStartColumn(e,t,n,a,s,f);var g=r.getModuleBitCount(e,t,n,a,s,f);if(g==null)return null;var w,A=De.sum(g);if(a)w=s+A;else{for(var E=0;E=t)&&g=t:hr.CODEWORD_SKEW_SIZE)return s;h+=x}x=-x,a=!a}return h},r.checkCodewordSkew=function(e,t,n){return t-r.CODEWORD_SKEW_SIZE<=e&&e<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(e,t,n){if(e.length===0)throw re.getFormatInstance();var a=1<n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw _t.getChecksumInstance();return r.errorCorrection.decode(e,n,t)},r.verifyCodewordCount=function(e,t){if(e.length<4)throw re.getFormatInstance();var n=e[0];if(n>e.length)throw re.getFormatInstance();if(n===0)if(t>=1;return t},r.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},r.getCodewordBucketNumber_number=function(e){return r.getCodewordBucketNumber(r.getBitCountForCodeword(e))},r.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},r.toString=function(e){for(var t=new _a,n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},da=(function(){function r(){}return r.prototype.decode=function(e,t){t===void 0&&(t=null);var n=r.decode(e,t,!1);if(n==null||n.length===0||n[0]==null)throw j.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(e,t){t===void 0&&(t=null);try{return r.decode(e,t,!0)}catch(n){throw n instanceof re||n instanceof _t?j.getNotFoundInstance():n}},r.decode=function(e,t,n){var a,s,f=new Array,h=kc.detectMultiple(e,t,n);try{for(var x=hf(h.getPoints()),g=x.next();!g.done;g=x.next()){var w=g.value,A=lf.decode(h.getBits(),w[4],w[5],w[6],w[7],r.getMinCodewordWidth(w),r.getMaxCodewordWidth(w)),E=new Bt(A.getText(),A.getRawBytes(),void 0,w,se.PDF_417);E.putMetadata(Rt.ERROR_CORRECTION_LEVEL,A.getECLevel());var C=A.getOther();C!=null&&E.putMetadata(Rt.PDF417_EXTRA_METADATA,C),f.push(E)}}catch(b){a={error:b}}finally{try{g&&!g.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}return f.map(function(b){return b})},r.getMaxWidth=function(e,t){return e==null||t==null?0:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMinWidth=function(e,t){return e==null||t==null?Ie.MAX_VALUE:Math.trunc(Math.abs(e.getX()-t.getX()))},r.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(r.getMaxWidth(e[0],e[4]),r.getMaxWidth(e[6],e[2])*Re.MODULES_IN_CODEWORD/Re.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(e[1],e[5]),r.getMaxWidth(e[7],e[3])*Re.MODULES_IN_CODEWORD/Re.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(r.getMinWidth(e[0],e[4]),r.getMinWidth(e[6],e[2])*Re.MODULES_IN_CODEWORD/Re.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(e[1],e[5]),r.getMinWidth(e[7],e[3])*Re.MODULES_IN_CODEWORD/Re.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r})(),df=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Do=(function(r){df(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.kind="ReaderException",e})($t),Mo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xf=(function(){function r(){}return r.prototype.decode=function(e,t){return this.setHints(t),this.decodeInternal(e)},r.prototype.decodeWithState=function(e){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(e)},r.prototype.setHints=function(e){this.hints=e;var t=e!=null&&e.get(tt.TRY_HARDER)!==void 0,n=e==null?null:e.get(tt.POSSIBLE_FORMATS),a=new Array;if(n!=null){var s=n.some(function(f){return f===se.UPC_A||f===se.UPC_E||f===se.EAN_13||f===se.EAN_8||f===se.CODABAR||f===se.CODE_39||f===se.CODE_93||f===se.CODE_128||f===se.ITF||f===se.RSS_14||f===se.RSS_EXPANDED});s&&!t&&a.push(new Fn(e)),n.includes(se.QR_CODE)&&a.push(new la),n.includes(se.DATA_MATRIX)&&a.push(new ua),n.includes(se.AZTEC)&&a.push(new ca),n.includes(se.PDF_417)&&a.push(new da),s&&t&&a.push(new Fn(e))}a.length===0&&(t||a.push(new Fn(e)),a.push(new la),a.push(new ua),a.push(new ca),a.push(new da),t&&a.push(new Fn(e))),this.readers=a},r.prototype.reset=function(){var e,t;if(this.readers!==null)try{for(var n=Mo(this.readers),a=n.next();!a.done;a=n.next()){var s=a.value;s.reset()}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},r.prototype.decodeInternal=function(e){var t,n;if(this.readers===null)throw new Do("No readers where selected, nothing can be read.");try{for(var a=Mo(this.readers),s=a.next();!s.done;s=a.next()){var f=s.value;try{return f.decode(e,this.hints)}catch(h){if(h instanceof Do)continue}}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}throw new j("No MultiFormat Readers were able to detect the code.")},r})(),gf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),pf=(function(r){gf(e,r);function e(t,n){t===void 0&&(t=null),n===void 0&&(n=500);var a=this,s=new xf;return s.setHints(t),a=r.call(this,s,n)||this,a}return e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e})(An),vf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})();(function(r){vf(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new da,t)||this}return e})(An);var wf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})();(function(r){wf(e,r);function e(t){return t===void 0&&(t=500),r.call(this,new la,t)||this}return e})(An);var xa;(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"})(xa||(xa={}));const ai=xa;var a1=(function(){function r(e){this.field=e,this.cachedGenerators=[],this.cachedGenerators.push(new Gr(e,Int32Array.from([1])))}return r.prototype.buildGenerator=function(e){var t=this.cachedGenerators;if(e>=t.length)for(var n=t[t.length-1],a=this.field,s=t.length;s<=e;s++){var f=n.multiply(new Gr(a,Int32Array.from([1,a.exp(s-1+a.getGeneratorBase())])));t.push(f),n=f}return t[e]},r.prototype.encode=function(e,t){if(t===0)throw new xe("No error correction bytes");var n=e.length-t;if(n<=0)throw new xe("No data bytes provided");var a=this.buildGenerator(t),s=new Int32Array(n);Ke.arraycopy(e,0,s,0,n);var f=new Gr(this.field,s);f=f.multiplyByMonomial(t,1);for(var h=f.divide(a)[1],x=h.getCoefficients(),g=t-x.length,w=0;w=5&&(n+=r.N1+(x-5)),x=1,g=A)}x>=5&&(n+=r.N1+(x-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r})(),Af=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yf=(function(){function r(e,t){this.width=e,this.height=t;for(var n=new Array(t),a=0;a!==t;a++)n[a]=new Uint8Array(e);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(e,t){return this.bytes[t][e]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(e,t,n){this.bytes[t][e]=n},r.prototype.setBoolean=function(e,t,n){this.bytes[t][e]=n?1:0},r.prototype.clear=function(e){var t,n;try{for(var a=Af(this.bytes),s=a.next();!s.done;s=a.next()){var f=s.value;pt.fill(f,e)}}catch(h){t={error:h}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},r.prototype.equals=function(e){if(!(e instanceof r))return!1;var t=e;if(this.width!==t.width||this.height!==t.height)return!1;for(var n=0,a=this.height;n> `),e.toString()},r.prototype.setMode=function(e){this.mode=e},r.prototype.setECLevel=function(e){this.ecLevel=e},r.prototype.setVersion=function(e){this.version=e},r.prototype.setMaskPattern=function(e){this.maskPattern=e},r.prototype.setMatrix=function(e){this.matrix=e},r.isValidMaskPattern=function(e){return e>=0&&e0;){for(f===6&&(f-=1);h>=0&&h=n;)e^=t<=0)for(var x=0;x!==f;x++){var g=a[x];g>=0&&r.isEmpty(t.get(g,h))&&r.embedPositionAdjustmentPattern(g-2,h-2,t)}}},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})(),Cf=(function(){function r(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r})(),Bo=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function r(){}return r.calculateMaskPenalty=function(e){return Un.applyMaskPenaltyRule1(e)+Un.applyMaskPenaltyRule2(e)+Un.applyMaskPenaltyRule3(e)+Un.applyMaskPenaltyRule4(e)},r.encode=function(e,t,n){n===void 0&&(n=null);var a=r.DEFAULT_BYTE_MODE_ENCODING,s=n!==null&&n.get(ai.CHARACTER_SET)!==void 0;s&&(a=n.get(ai.CHARACTER_SET).toString());var f=this.chooseMode(e,a),h=new mt;if(f===$e.BYTE&&(s||r.DEFAULT_BYTE_MODE_ENCODING!==a)){var x=gt.getCharacterSetECIByName(a);x!==void 0&&this.appendECI(x,h)}this.appendModeInfo(f,h);var g=new mt;this.appendBytes(e,f,g,a);var w;if(n!==null&&n.get(ai.QR_VERSION)!==void 0){var A=Number.parseInt(n.get(ai.QR_VERSION).toString(),10);w=rn.getVersionForNumber(A);var E=this.calculateBitsNeeded(f,h,g,w);if(!this.willFit(E,w,t))throw new Je("Data too big for requested version")}else w=this.recommendVersion(t,f,h,g);var C=new mt;C.appendBitArray(h);var b=f===$e.BYTE?g.getSizeInBytes():e.length;this.appendLengthInfo(b,w,f,C),C.appendBitArray(g);var T=w.getECBlocksForLevel(t),P=w.getTotalCodewords()-T.getTotalECCodewords();this.terminateBits(P,C);var F=this.interleaveWithECBytes(C,w.getTotalCodewords(),P,T.getNumBlocks()),D=new ga;D.setECLevel(t),D.setMode(f),D.setVersion(w);var L=w.getDimensionForVersion(),k=new yf(L,L),q=this.chooseMaskPattern(F,t,w,k);return D.setMaskPattern(q),Po.buildMatrix(F,t,w,q,k),D.setMatrix(k),D},r.recommendVersion=function(e,t,n,a){var s=this.calculateBitsNeeded(t,n,a,rn.getVersionForNumber(1)),f=this.chooseVersion(s,e),h=this.calculateBitsNeeded(t,n,a,f);return this.chooseVersion(h,e)},r.calculateBitsNeeded=function(e,t,n,a){return t.getSize()+e.getCharacterCountBits(a)+n.getSize()},r.getAlphanumericCode=function(e){return e159)&&(s<224||s>235))return!1}return!0},r.chooseMaskPattern=function(e,t,n,a){for(var s=Number.MAX_SAFE_INTEGER,f=-1,h=0;h=x},r.terminateBits=function(e,t){var n=e*8;if(t.getSize()>n)throw new Je("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(var a=0;a<4&&t.getSize()0)for(var a=s;a<8;a++)t.appendBit(!1);for(var f=e-t.getSizeInBytes(),a=0;a=n)throw new Je("Block ID too large");var h=e%n,x=n-h,g=Math.floor(e/n),w=g+1,A=Math.floor(t/n),E=A+1,C=g-A,b=w-E;if(C!==b)throw new Je("EC bytes mismatch");if(n!==x+h)throw new Je("RS blocks mismatch");if(e!==(A+C)*x+(E+b)*h)throw new Je("Total bytes mismatch");a=1<=0&&t<=9},r.appendNumericBytes=function(e,t){for(var n=e.length,a=0;a=33088&&x<=40956?g=x-33088:x>=57408&&x<=60351&&(g=x-49472),g===-1)throw new Je("Invalid byte sequence");var w=(g>>8)*192+(g&255);t.appendBits(w,13)}},r.appendECI=function(e,t){t.appendBits($e.ECI.getBits(),4),t.appendBits(e.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=gt.UTF8.getName(),r})();var _f=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})();(function(r){_f(e,r);function e(t,n,a,s,f,h,x,g){var w=r.call(this,h,x)||this;if(w.yuvData=t,w.dataWidth=n,w.dataHeight=a,w.left=s,w.top=f,s+h>n||f+x>a)throw new xe("Crop rectangle does not fit within image data.");return g&&w.reverseHorizontal(h,x),w}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new xe("Requested row is outside the image: "+t);var a=this.getWidth();(n==null||n.length>16&255,T=C>>7&510,P=C&255;A[E]=(b+T+P)/4&255}g.luminances=A}else g.luminances=t;if(s===void 0&&(g.dataWidth=n),f===void 0&&(g.dataHeight=a),h===void 0&&(g.left=0),x===void 0&&(g.top=0),g.left+n>g.dataWidth||g.top+a>g.dataHeight)throw new xe("Crop rectangle does not fit within image data.");return g}return e.prototype.getRow=function(t,n){if(t<0||t>=this.getHeight())throw new xe("Requested row is outside the image: "+t);var a=this.getWidth();(n==null||n.length=256&&(t^=Tf);return{LOG:r,ALOG:e}};pa=Of([],[]),pa.LOG;pa.ALOG;var Lo;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(Lo||(Lo={}));var Fo=129,o1=230,Nf=231,Rf=235,Df=236,Mf=237,Pf=238,Bf=239,Lf=240,Ki=254,Ff=254,ko="[)>05",Uo="[)>06",Vo="",He=0,Nt=1,Gt=2,dt=3,Ct=4,Pt=5,kf=(function(){function r(){}return r.prototype.getEncodingMode=function(){return He},r.prototype.encode=function(e){var t=wr.determineConsecutiveDigitCount(e.getMessage(),e.pos);if(t>=2)e.writeCodeword(this.encodeASCIIDigits(e.getMessage().charCodeAt(e.pos),e.getMessage().charCodeAt(e.pos+1))),e.pos+=2;else{var n=e.getCurrentChar(),a=wr.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode())switch(a){case Pt:e.writeCodeword(Nf),e.signalEncoderChange(Pt);return;case Nt:e.writeCodeword(o1),e.signalEncoderChange(Nt);return;case dt:e.writeCodeword(Pf),e.signalEncoderChange(dt);break;case Gt:e.writeCodeword(Bf),e.signalEncoderChange(Gt);break;case Ct:e.writeCodeword(Lf),e.signalEncoderChange(Ct);break;default:throw new Error("Illegal mode: "+a)}else wr.isExtendedASCII(n)?(e.writeCodeword(Rf),e.writeCodeword(n-128+1),e.pos++):(e.writeCodeword(n+1),e.pos++)}},r.prototype.encodeASCIIDigits=function(e,t){if(wr.isDigit(e)&&wr.isDigit(t)){var n=(e-48)*10+(t-48);return n+130}throw new Error("not digits: "+e+t)},r})(),Uf=(function(){function r(){}return r.prototype.getEncodingMode=function(){return Pt},r.prototype.encode=function(e){var t=new Ce;for(t.append(0);e.hasMoreCharacters();){var n=e.getCurrentChar();t.append(n),e.pos++;var a=wr.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(a!==this.getEncodingMode()){e.signalEncoderChange(He);break}}var s=t.length()-1,f=1,h=e.getCodewordCount()+s+f;e.updateSymbolInfo(h);var x=e.getSymbolInfo().getDataCapacity()-h>0;if(e.hasMoreCharacters()||x)if(s<=249)t.setCharAt(0,Te.getCharAt(s));else if(s<=1555)t.setCharAt(0,Te.getCharAt(Math.floor(s/250)+249)),t.insert(1,Te.getCharAt(s%250));else throw new Error("Message length not in valid ranges: "+s);for(var g=0,n=t.length();g3||g!==1))&&(e.pos=a)}t.length()>0&&e.writeCodeword(o1),this.handleEOD(e,t)},r.prototype.encode=function(e){for(var t=new Ce;e.hasMoreCharacters();){var n=e.getCurrentChar();e.pos++;var a=this.encodeChar(n,t),s=Math.floor(t.length()/3)*2,f=e.getCodewordCount()+s;e.updateSymbolInfo(f);var h=e.getSymbolInfo().getDataCapacity()-f;if(!e.hasMoreCharacters()){var x=new Ce;for(t.length()%3===2&&h!==2&&(a=this.backtrackOneCharacter(e,t,x,a));t.length()%3===1&&(a>3||h!==1);)a=this.backtrackOneCharacter(e,t,x,a);break}var g=t.length();if(g%3===0){var w=wr.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(w!==this.getEncodingMode()){e.signalEncoderChange(He);break}}}this.handleEOD(e,t)},r.prototype.backtrackOneCharacter=function(e,t,n,a){var s=t.length(),f=t.toString().substring(0,s-a);t.setLengthToZero(),t.append(f),e.pos--;var h=e.getCurrentChar();return a=this.encodeChar(h,n),e.resetSymbolInfo(),a},r.prototype.writeNextTriplet=function(e,t){e.writeCodewords(this.encodeToCodewords(t.toString()));var n=t.toString().substring(3);t.setLengthToZero(),t.append(n)},r.prototype.handleEOD=function(e,t){var n=Math.floor(t.length()/3*2),a=t.length()%3,s=e.getCodewordCount()+n;e.updateSymbolInfo(s);var f=e.getSymbolInfo().getDataCapacity()-s;if(a===2){for(t.append("\0");t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(Ki)}else if(f===1&&a===1){for(;t.length()>=3;)this.writeNextTriplet(e,t);e.hasMoreCharacters()&&e.writeCodeword(Ki),e.pos--}else if(a===0){for(;t.length()>=3;)this.writeNextTriplet(e,t);(f>0||e.hasMoreCharacters())&&e.writeCodeword(Ki)}else throw new Error("Unexpected case. Please report!");e.signalEncoderChange(He)},r.prototype.encodeChar=function(e,t){if(e===32)return t.append(3),1;if(e>=48&&e<=57)return t.append(e-48+4),1;if(e>=65&&e<=90)return t.append(e-65+14),1;if(e<32)return t.append(0),t.append(e),2;if(e<=47)return t.append(1),t.append(e-33),2;if(e<=64)return t.append(1),t.append(e-58+15),2;if(e<=95)return t.append(1),t.append(e-91+22),2;if(e<=127)return t.append(2),t.append(e-96),2;t.append("1");var n=2;return n+=this.encodeChar(e-128,t),n},r.prototype.encodeToCodewords=function(e){var t=1600*e.charCodeAt(0)+40*e.charCodeAt(1)+e.charCodeAt(2)+1,n=t/256,a=t%256,s=new Ce;return s.append(n),s.append(a),s.toString()},r})(),Vf=(function(){function r(){}return r.prototype.getEncodingMode=function(){return Ct},r.prototype.encode=function(e){for(var t=new Ce;e.hasMoreCharacters();){var n=e.getCurrentChar();this.encodeChar(n,t),e.pos++;var a=t.length();if(a>=4){e.writeCodewords(this.encodeToCodewords(t.toString()));var s=t.toString().substring(4);t.setLengthToZero(),t.append(s);var f=wr.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode());if(f!==this.getEncodingMode()){e.signalEncoderChange(He);break}}}t.append(Te.getCharAt(31)),this.handleEOD(e,t)},r.prototype.handleEOD=function(e,t){try{var n=t.length();if(n===0)return;if(n===1){e.updateSymbolInfo();var a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),s=e.getRemainingCharacters();if(s>a&&(e.updateSymbolInfo(e.getCodewordCount()+1),a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount()),s<=a&&a<=2)return}if(n>4)throw new Error("Count must not exceed 4");var f=n-1,h=this.encodeToCodewords(t.toString()),x=!e.hasMoreCharacters(),g=x&&f<=2;if(f<=2){e.updateSymbolInfo(e.getCodewordCount()+f);var a=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount();a>=3&&(g=!1,e.updateSymbolInfo(e.getCodewordCount()+h.length))}g?(e.resetSymbolInfo(),e.pos-=f):e.writeCodewords(h)}finally{e.signalEncoderChange(He)}},r.prototype.encodeChar=function(e,t){e>=32&&e<=63?t.append(e):e>=64&&e<=94?t.append(Te.getCharAt(e-64)):wr.illegalCharacter(Te.getCharAt(e))},r.prototype.encodeToCodewords=function(e){var t=e.length;if(t===0)throw new Error("StringBuilder must not be empty");var n=e.charAt(0).charCodeAt(0),a=t>=2?e.charAt(1).charCodeAt(0):0,s=t>=3?e.charAt(2).charCodeAt(0):0,f=t>=4?e.charAt(3).charCodeAt(0):0,h=(n<<18)+(a<<12)+(s<<6)+f,x=h>>16&255,g=h>>8&255,w=h&255,A=new Ce;return A.append(x),t>=2&&A.append(g),t>=3&&A.append(w),A.toString()},r})(),Hf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Gf=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fe=(function(){function r(e,t,n,a,s,f,h,x){h===void 0&&(h=0),x===void 0&&(x=0),this.rectangular=e,this.dataCapacity=t,this.errorCodewords=n,this.matrixWidth=a,this.matrixHeight=s,this.dataRegions=f,this.rsBlockData=h,this.rsBlockError=x}return r.lookup=function(e,t,n,a,s){var f,h;t===void 0&&(t=0),n===void 0&&(n=null),a===void 0&&(a=null),s===void 0&&(s=!0);try{for(var x=Gf(Wf),g=x.next();!g.done;g=x.next()){var w=g.value;if(!(t===1&&w.rectangular)&&!(t===2&&!w.rectangular)&&!(n!=null&&(w.getSymbolWidth()a.getWidth()||w.getSymbolHeight()>a.getHeight()))&&e<=w.dataCapacity)return w}}catch(A){f={error:A}}finally{try{g&&!g.done&&(h=x.return)&&h.call(x)}finally{if(f)throw f.error}}if(s)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+e);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(e){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(e){return this.rsBlockError},r})(),Xf=(function(r){Hf(e,r);function e(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return e.prototype.getInterleavedBlockCount=function(){return 10},e.prototype.getDataLengthForInterleavedBlock=function(t){return t<=8?156:155},e})(Fe),Wf=[new Fe(!1,3,5,8,8,1),new Fe(!1,5,7,10,10,1),new Fe(!0,5,7,16,6,1),new Fe(!1,8,10,12,12,1),new Fe(!0,10,11,14,6,2),new Fe(!1,12,12,14,14,1),new Fe(!0,16,14,24,10,1),new Fe(!1,18,14,16,16,1),new Fe(!1,22,18,18,18,1),new Fe(!0,22,18,16,10,2),new Fe(!1,30,20,20,20,1),new Fe(!0,32,24,16,14,2),new Fe(!1,36,24,22,22,1),new Fe(!1,44,28,24,24,1),new Fe(!0,49,28,22,14,2),new Fe(!1,62,36,14,14,4),new Fe(!1,86,42,16,16,4),new Fe(!1,114,48,18,18,4),new Fe(!1,144,56,20,20,4),new Fe(!1,174,68,22,22,4),new Fe(!1,204,84,24,24,4,102,42),new Fe(!1,280,112,14,14,16,140,56),new Fe(!1,368,144,16,16,16,92,36),new Fe(!1,456,192,18,18,16,114,48),new Fe(!1,576,224,20,20,16,144,56),new Fe(!1,696,272,22,22,16,174,68),new Fe(!1,816,336,24,24,16,136,56),new Fe(!1,1050,408,18,18,36,175,68),new Fe(!1,1304,496,20,20,36,163,62),new Xf],zf=(function(){function r(e){this.msg=e,this.pos=0,this.skipAtEnd=0;for(var t=e.split("").map(function(h){return h.charCodeAt(0)}),n=new Ce,a=0,s=t.length;athis.symbolInfo.getDataCapacity())&&(this.symbolInfo=Fe.lookup(e,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r})(),Yf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Zf=(function(r){Yf(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return dt},e.prototype.encode=function(t){for(var n=new Ce;t.hasMoreCharacters();){var a=t.getCurrentChar();t.pos++,this.encodeChar(a,n);var s=n.length();if(s%3===0){this.writeNextTriplet(t,n);var f=wr.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(f!==this.getEncodingMode()){t.signalEncoderChange(He);break}}}this.handleEOD(t,n)},e.prototype.encodeChar=function(t,n){switch(t){case 13:n.append(0);break;case 42:n.append(1);break;case 62:n.append(2);break;case 32:n.append(3);break;default:t>=48&&t<=57?n.append(t-48+4):t>=65&&t<=90?n.append(t-65+14):wr.illegalCharacter(Te.getCharAt(t));break}return 1},e.prototype.handleEOD=function(t,n){t.updateSymbolInfo();var a=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),s=n.length();t.pos-=s,(t.getRemainingCharacters()>1||a>1||t.getRemainingCharacters()!==a)&&t.writeCodeword(Ff),t.getNewEncoding()<0&&t.signalEncoderChange(He)},e})(ma),jf=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),Kf=(function(r){jf(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getEncodingMode=function(){return Gt},e.prototype.encodeChar=function(t,n){if(t===32)return n.append(3),1;if(t>=48&&t<=57)return n.append(t-48+4),1;if(t>=97&&t<=122)return n.append(t-97+14),1;if(t<32)return n.append(0),n.append(t),2;if(t<=47)return n.append(1),n.append(t-33),2;if(t<=64)return n.append(1),n.append(t-58+15),2;if(t>=91&&t<=95)return n.append(1),n.append(t-91+22),2;if(t===96)return n.append(2),n.append(0),2;if(t<=90)return n.append(2),n.append(t-65+1),2;if(t<=127)return n.append(2),n.append(t-123+27),2;n.append("1");var a=2;return a+=this.encodeChar(t-128,n),a},e})(ma),wr=(function(){function r(){}return r.randomize253State=function(e){var t=149*e%253+1,n=Fo+t;return n<=254?n:n-254},r.encodeHighLevel=function(e,t,n,a,s){t===void 0&&(t=0),n===void 0&&(n=null),a===void 0&&(a=null),s===void 0&&(s=!1);var f=new ma,h=[new kf,f,new Kf,new Zf,new Vf,new Uf],x=new zf(e);x.setSymbolShape(t),x.setSizeConstraints(n,a),e.startsWith(ko)&&e.endsWith(Vo)?(x.writeCodeword(Df),x.setSkipAtEnd(2),x.pos+=ko.length):e.startsWith(Uo)&&e.endsWith(Vo)&&(x.writeCodeword(Mf),x.setSkipAtEnd(2),x.pos+=Uo.length);var g=He;for(s&&(f.encodeMaximal(x),g=x.getNewEncoding(),x.resetEncoderSignal());x.hasMoreCharacters();)h[g].encode(x),x.getNewEncoding()>=0&&(g=x.getNewEncoding(),x.resetEncoderSignal());var w=x.getCodewordCount();x.updateSymbolInfo();var A=x.getSymbolInfo().getDataCapacity();w=e.length)return n;var a;n===He?a=[0,1,1,1,1,1.25]:(a=[1,2,2,2,2,2.25],a[n]=0);for(var s=0,f=new Uint8Array(6),h=[];;){if(t+s===e.length){pt.fill(f,0),pt.fill(h,0);var x=this.findMinimums(a,h,Ie.MAX_VALUE,f),g=this.getMinimumCount(f);if(h[He]===x)return He;if(g===1){if(f[Pt]>0)return Pt;if(f[Ct]>0)return Ct;if(f[Gt]>0)return Gt;if(f[dt]>0)return dt}return Nt}var w=e.charCodeAt(t+s);if(s++,this.isDigit(w)?a[He]+=.5:this.isExtendedASCII(w)?(a[He]=Math.ceil(a[He]),a[He]+=2):(a[He]=Math.ceil(a[He]),a[He]++),this.isNativeC40(w)?a[Nt]+=2/3:this.isExtendedASCII(w)?a[Nt]+=8/3:a[Nt]+=4/3,this.isNativeText(w)?a[Gt]+=2/3:this.isExtendedASCII(w)?a[Gt]+=8/3:a[Gt]+=4/3,this.isNativeX12(w)?a[dt]+=2/3:this.isExtendedASCII(w)?a[dt]+=13/3:a[dt]+=10/3,this.isNativeEDIFACT(w)?a[Ct]+=3/4:this.isExtendedASCII(w)?a[Ct]+=17/4:a[Ct]+=13/4,this.isSpecialB256(w)?a[Pt]+=4:a[Pt]++,s>=4){if(pt.fill(f,0),pt.fill(h,0),this.findMinimums(a,h,Ie.MAX_VALUE,f),h[He]f&&(n=f,pt.fill(a,0)),n===f&&(a[s]=a[s]+1)}return n},r.getMinimumCount=function(e){for(var t=0,n=0;n<6;n++)t+=e[n];return t||0},r.isDigit=function(e){return e>=48&&e<=57},r.isExtendedASCII=function(e){return e>=128&&e<=255},r.isNativeC40=function(e){return e===32||e>=48&&e<=57||e>=65&&e<=90},r.isNativeText=function(e){return e===32||e>=48&&e<=57||e>=97&&e<=122},r.isNativeX12=function(e){return this.isX12TermSep(e)||e===32||e>=48&&e<=57||e>=65&&e<=90},r.isX12TermSep=function(e){return e===13||e===42||e===62},r.isNativeEDIFACT=function(e){return e>=32&&e<=94},r.isSpecialB256=function(e){return!1},r.determineConsecutiveDigitCount=function(e,t){t===void 0&&(t=0);for(var n=e.length,a=t;a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ho=(function(){function r(e){this.charset=e,this.name=e.name}return r.prototype.canEncode=function(e){try{return lr.encode(e,this.charset)!=null}catch{return!1}},r})(),qf=(function(){function r(e,t,n){var a,s,f,h,x,g;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(Y){return new Ho(Sf.forName(Y))}),this.encoders=[];var w=[];w.push(new Ho(bf.ISO_8859_1));for(var A=t!=null&&t.name.startsWith("UTF"),E=0;E=this.bytes.length)return!1;for(var n=0;n=this.length())throw new Error(""+e);if(this.isECI(e))throw new Error("value at "+e+" is not a character but an ECI");return this.isFNC1(e)?this.fnc1:this.bytes[e]},r.prototype.subSequence=function(e,t){if(e<0||e>t||t>this.length())throw new Error(""+e);for(var n=new Ce,a=e;a=this.length())throw new Error(""+e);return this.bytes[e]>255&&this.bytes[e]<=999},r.prototype.isFNC1=function(e){if(e<0||e>=this.length())throw new Error(""+e);return this.bytes[e]===1e3},r.prototype.getECIValue=function(e){if(e<0||e>=this.length())throw new Error(""+e);if(!this.isECI(e))throw new Error("value at "+e+" is not an ECI but a character");return this.bytes[e]-256},r.prototype.addEdge=function(e,t,n){(e[t][n.encoderIndex]==null||e[t][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(e[t][n.encoderIndex]=n)},r.prototype.addEdges=function(e,t,n,a,s,f){var h=e.charAt(a).charCodeAt(0),x=0,g=t.length();t.getPriorityEncoderIndex()>=0&&(h===f||t.canEncode(h,t.getPriorityEncoderIndex()))&&(x=t.getPriorityEncoderIndex(),g=x+1);for(var w=x;w=0;f--)A.unshift(C[f]&255);var b=E.previous===null?0:E.previous.encoderIndex;b!==E.encoderIndex&&A.unshift(256+t.getECIValue(E.encoderIndex)),E=E.previous}for(var T=[],f=0;f"},e})(tu),nu=(function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},r(e,t)};return function(e,t){r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}})(),iu=(function(r){nu(e,r);function e(t,n,a){var s=r.call(this,t,0,0)||this;return s.binaryShiftStart=n,s.binaryShiftByteCount=a,s}return e.prototype.appendTo=function(t,n){for(var a=0;a62?t.appendBits(this.binaryShiftByteCount-31,16):a===0?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(n[this.binaryShiftStart+a],8)},e.prototype.addBinaryShift=function(t,n){return new e(this,t,n)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e})(Ia);function au(r,e,t){return new iu(r,e,t)}function Pn(r,e,t){return new Ia(r,e,t)}var ou=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Xr=0,pi=1,ur=2,s1=3,Sr=4,su=new Ia(null,0,0),Qi=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])],cu=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function fu(r){var e,t;try{for(var n=cu(r),a=n.next();!a.done;a=n.next()){var s=a.value;pt.fill(s,-1)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return r[Xr][Sr]=0,r[pi][Sr]=0,r[pi][Xr]=28,r[s1][Sr]=0,r[ur][Sr]=0,r[ur][Xr]=15,r}var c1=fu(pt.createInt32Array(6,6)),uu=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lu=(function(){function r(e,t,n,a){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=a}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(e,t){var n=this.bitCount,a=this.token;if(e!==this.mode){var s=Qi[this.mode][e];a=Pn(a,s&65535,s>>16),n+=s>>16}var f=e===ur?4:5;return a=Pn(a,t,f),new r(a,e,0,n+f)},r.prototype.shiftAndAppend=function(e,t){var n=this.token,a=this.mode===ur?4:5;return n=Pn(n,c1[this.mode][e],a),n=Pn(n,t,5),new r(n,this.mode,0,this.bitCount+a+5)},r.prototype.addBinaryShiftChar=function(e){var t=this.token,n=this.mode,a=this.bitCount;if(this.mode===Sr||this.mode===ur){var s=Qi[n][Xr];t=Pn(t,s&65535,s>>16),a+=s>>16,n=Xr}var f=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,h=new r(t,n,this.binaryShiftByteCount+1,a+f);return h.binaryShiftByteCount===2078&&(h=h.endBinaryShift(e+1)),h},r.prototype.endBinaryShift=function(e){if(this.binaryShiftByteCount===0)return this;var t=this.token;return t=au(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new r(t,this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(e){var t=this.bitCount+(Qi[this.mode][e.mode]>>16);return this.binaryShiftByteCounte.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount},r.prototype.toBitArray=function(e){for(var t,n,a=[],s=this.endBinaryShift(e.length).token;s!==null;s=s.getPrevious())a.unshift(s);var f=new mt;try{for(var h=uu(a),x=h.next();!x.done;x=h.next()){var g=x.value;g.appendTo(f,e)}}catch(w){t={error:w}}finally{try{x&&!x.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return f},r.prototype.toString=function(){return Te.format("%s bits=%d bytes=%d",ou[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(su,Xr,0,0),r})();function hu(r){var e=Te.getCharCode(" "),t=Te.getCharCode("."),n=Te.getCharCode(",");r[Xr][e]=1;for(var a=Te.getCharCode("Z"),s=Te.getCharCode("A"),f=s;f<=a;f++)r[Xr][f]=f-s+2;r[pi][e]=1;for(var h=Te.getCharCode("z"),x=Te.getCharCode("a"),f=x;f<=h;f++)r[pi][f]=f-x+2;r[ur][e]=1;for(var g=Te.getCharCode("9"),w=Te.getCharCode("0"),f=w;f<=g;f++)r[ur][f]=f-w+2;r[ur][n]=12,r[ur][t]=13;for(var A=["\0"," ","","","","","","","\x07","\b"," ",` `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],E=0;E","?","[","]","{","}"],E=0;E0&&(r[Sr][Te.getCharCode(C[E])]=E);return r}var Ji=hu(pt.createInt32Array(5,256)),oi=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")},du=(function(){function r(e){this.text=e}return r.prototype.encode=function(){for(var e=Te.getCharCode(" "),t=Te.getCharCode(` `),n=Wo.singletonList(lu.INITIAL_STATE),a=0;a0?(n=r.updateStateListForPair(n,a,s),a++):n=this.updateStateListForChar(n,a)}var h=Wo.min(n,function(x,g){return x.getBitCount()-g.getBitCount()});return h.toBitArray(this.text)},r.prototype.updateStateListForChar=function(e,t){var n,a,s=[];try{for(var f=oi(e),h=f.next();!h.done;h=f.next()){var x=h.value;this.updateStateForChar(x,t,s)}}catch(g){n={error:g}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(n)throw n.error}}return r.simplifyStates(s)},r.prototype.updateStateForChar=function(e,t,n){for(var a=this.text[t]&255,s=Ji[e.getMode()][a]>0,f=null,h=0;h<=Sr;h++){var x=Ji[h][a];if(x>0){if(f==null&&(f=e.endBinaryShift(t)),!s||h===e.getMode()||h===ur){var g=f.latchAndAppend(h,x);n.push(g)}if(!s&&c1[e.getMode()][h]>=0){var w=f.shiftAndAppend(h,x);n.push(w)}}}if(e.getBinaryShiftByteCount()>0||Ji[e.getMode()][a]===0){var A=e.addBinaryShiftChar(t);n.push(A)}},r.updateStateListForPair=function(e,t,n){var a,s,f=[];try{for(var h=oi(e),x=h.next();!x.done;x=h.next()){var g=x.value;this.updateStateForPair(g,t,n,f)}}catch(w){a={error:w}}finally{try{x&&!x.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}return this.simplifyStates(f)},r.updateStateForPair=function(e,t,n,a){var s=e.endBinaryShift(t);if(a.push(s.latchAndAppend(Sr,n)),e.getMode()!==Sr&&a.push(s.shiftAndAppend(Sr,n)),n===3||n===4){var f=s.latchAndAppend(ur,16-n).latchAndAppend(ur,1);a.push(f)}if(e.getBinaryShiftByteCount()>0){var h=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);a.push(h)}},r.simplifyStates=function(e){var t,n,a,s,f=[];try{for(var h=oi(e),x=h.next();!x.done;x=h.next()){var g=x.value,w=!0,A=function(P){if(P.isBetterThanOrEqualTo(g))return w=!1,"break";g.isBetterThanOrEqualTo(P)&&(f=f.filter(function(F){return F!==P}))};try{for(var E=(a=void 0,oi(f)),C=E.next();!C.done;C=E.next()){var b=C.value,T=A(b);if(T==="break")break}}catch(P){a={error:P}}finally{try{C&&!C.done&&(s=E.return)&&s.call(E)}finally{if(a)throw a.error}}w&&f.push(g)}}catch(P){t={error:P}}finally{try{x&&!x.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}return f},r})(),xu=function(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.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(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(){function r(){}return r.encodeBytes=function(e){return r.encode(e,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(e,t,n){var a=new du(e).encode(),s=Ie.truncDivision(a.getSize()*t,100)+11,f=a.getSize()+s,h,x,g,w,A;if(n!==r.DEFAULT_AZTEC_LAYERS){if(h=n<0,x=Math.abs(n),x>(h?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new xe(Te.format("Illegal value %s for layers",n));g=r.totalBitsInLayer(x,h),w=r.WORD_SIZE[x];var E=g-g%w;if(A=r.stuffBits(a,w),A.getSize()+s>E)throw new xe("Data to large for user specified layer");if(h&&A.getSize()>w*64)throw new xe("Data to large for user specified layer")}else{w=0,A=null;for(var C=0;;C++){if(C>r.MAX_NB_BITS)throw new xe("Data too large for an Aztec code");if(h=C<=3,x=h?C+1:C,g=r.totalBitsInLayer(x,h),!(f>g)){(A==null||w!==r.WORD_SIZE[x])&&(w=r.WORD_SIZE[x],A=r.stuffBits(a,w));var E=g-g%w;if(!(h&&A.getSize()>w*64)&&A.getSize()+s<=E)break}}}var b=r.generateCheckWords(A,g,w),T=A.getSize()/w,P=r.generateModeMessage(h,x,T),F=(h?11:14)+x*4,D=new Int32Array(F),L;if(h){L=F;for(var C=0;C=a||e.get(f+x))&&(h|=1<!1),n=Qt(null),a=Qt(null),s=Qt(""),f=Qt([]),h=Qt(!1),x=Qt(!1),g=Qt(!1),w=Qt(""),{setValue:A}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"currentCameraName",type:"string",defaultValue:""}),{setValue:E}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"cameraList",type:"array",defaultValue:[]}),{setValue:C}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"torchEnabled",type:"boolean",defaultValue:!1}),{setValue:b}=wwLib.wwVariable.useComponentVariable({uid:r.uid,name:"scannedValue",type:"string",defaultValue:""}),T=Xt(()=>{var Z;return{width:"100%",height:"100%",position:"relative",overflow:"hidden",backgroundColor:((Z=r.content)==null?void 0:Z.backgroundColor)||"#000000"}}),P=Xt(()=>{var Z;return{width:"100%",height:"100%",objectFit:((Z=r.content)==null?void 0:Z.objectFit)||"cover"}}),F=Xt(()=>{var ne,le,X,me;const Z=((ne=r.content)==null?void 0:ne.scanAreaSize)||"200px";return{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:Z,height:Z,border:`2px solid ${((le=r.content)==null?void 0:le.scanAreaColor)||"#00FF00"}`,boxShadow:`0 0 0 5000px ${((X=r.content)==null?void 0:X.scanAreaOverlay)||"rgba(0, 0, 0, 0.5)"}`,borderRadius:((me=r.content)==null?void 0:me.scanAreaBorderRadius)||"10px"}}),D=Xt(()=>{var Z;return((Z=r.content)==null?void 0:Z.showScanArea)!==!1}),L=Xt(()=>{var Z;return((Z=r.content)==null?void 0:Z.showLastResult)===!0}),k=Xt(()=>{var Z;return((Z=r.content)==null?void 0:Z.permissionMessage)||"Camera access is required to scan codes"}),q=Xt(()=>{var Z;return((Z=r.content)==null?void 0:Z.scanFrequency)||500}),K=()=>{var le;const Z=[],ne=((le=r.content)==null?void 0:le.formats)||["QR_CODE"];return ne.includes("QR_CODE")&&Z.push(se.QR_CODE),ne.includes("DATA_MATRIX")&&Z.push(se.DATA_MATRIX),ne.includes("CODE_39")&&Z.push(se.CODE_39),ne.includes("CODE_128")&&Z.push(se.CODE_128),ne.includes("EAN_13")&&Z.push(se.EAN_13),ne.includes("EAN_8")&&Z.push(se.EAN_8),ne.includes("ITF")&&Z.push(se.ITF),ne.includes("UPC_A")&&Z.push(se.UPC_A),ne.includes("UPC_E")&&Z.push(se.UPC_E),ne.includes("PDF_417")&&Z.push(se.PDF_417),ne.includes("AZTEC")&&Z.push(se.AZTEC),Z},U=async()=>{var Z;try{if(t.value)return;a.value=new pf,await navigator.mediaDevices.getUserMedia({video:!0}),h.value=!0;const ne=await a.value.listVideoInputDevices();f.value=ne||[],E(f.value.map(me=>({label:me.label,deviceId:me.deviceId})));const le=f.value.find(me=>/back|rear/i.test(me.label));s.value=le?le.deviceId:((Z=f.value[0])==null?void 0:Z.deviceId)||"";const X=f.value.find(me=>me.deviceId===s.value);A(X?X.label:""),await qa()}catch(ne){console.error("Camera init failed:",ne),h.value=!1}},$=async()=>{if(!(t.value||x.value||!a.value||!s.value))try{x.value=!0;const Z=new Map,ne=K();ne.length>0&&Z.set(tt.POSSIBLE_FORMATS,ne);let le=0;w.value="",b(""),await a.value.decodeFromVideoDevice(s.value,n.value,X=>{var me,ge;if(X&&X.getText()){const rr=Date.now();if(rr-le{var Z;a.value&&a.value.reset(),(Z=n.value)!=null&&Z.srcObject&&(n.value.srcObject.getTracks().forEach(X=>X.stop()),n.value.srcObject=null),x.value=!1,g.value=!1,C(!1)},ue=async()=>{if(t.value||!h.value||f.value.length<=1||(await qa(),!n.value))return;const ne=(f.value.findIndex(X=>X.deviceId===s.value)+1)%f.value.length;s.value=f.value[ne].deviceId;const le=f.value.find(X=>X.deviceId===s.value);A(le?le.label:""),x.value=!1,await a.value.decodeFromVideoDevice(s.value,n.value,X=>{var me;if(X&&X.getText()){const ge=X.getText();w.value=ge,b(ge),e("trigger-event",{name:"scan",event:{value:ge}}),((me=r.content)==null?void 0:me.continuousScan)!==!0&&Y()}}),x.value=!0},_e=async()=>{var Z,ne;if(!(t.value||!x.value||!n.value))try{const le=(Z=n.value.srcObject)==null?void 0:Z.getVideoTracks()[0];if(!((ne=le==null?void 0:le.getCapabilities)!=null&&ne.call(le).torch)){console.log("Torch not supported on this device");return}g.value=!g.value,C(g.value),await le.applyConstraints({advanced:[{torch:g.value}]})}catch(le){console.error("Error toggling torch:",le)}};return W1(()=>{var Z;return(Z=r.content)==null?void 0:Z.autoStart},Z=>{Z&&!x.value&&h.value&&!t.value&&$()}),z1(async()=>{var Z;await U(),(Z=r.content)!=null&&Z.autoStart&&!t.value&&$()}),Y1(()=>{Y()}),{videoElement:n,containerStyle:T,videoStyle:P,scanAreaStyle:F,isScanning:x,hasPermission:h,lastResult:w,showScanArea:D,showLastResult:L,permissionMessage:k,startScanning:$,stopScanning:Y,toggleCamera:ue,toggleTorch:_e}}},pu={key:1,class:"qr-code-scanner__result"},vu={key:2,class:"qr-code-scanner__permission-message"};function wu(r,e,t,n,a,s){return fr(),Nr("div",{class:"qr-code-scanner",style:Vn(n.containerStyle)},[ci("video",{ref:"videoElement",class:"qr-code-scanner__video",style:Vn(n.videoStyle),autoplay:"",muted:"",playsinline:""},null,4),n.isScanning&&n.showScanArea?(fr(),Nr("div",{key:0,class:"qr-code-scanner__scan-area",style:Vn(n.scanAreaStyle)},null,4)):tn("",!0),n.isScanning&&n.showLastResult&&n.lastResult?(fr(),Nr("div",pu,Ka(n.lastResult),1)):tn("",!0),n.hasPermission?tn("",!0):(fr(),Nr("div",vu,Ka(n.permissionMessage),1))],4)}const Iu=vi(gu,[["render",wu],["__scopeId","data-v-a9011397"]]),Au={topLeft:{"--justify":"flex-start","--align":"flex-start"},topMiddle:{"--justify":"flex-start","--align":"center"},topRight:{"--justify":"flex-start","--align":"flex-end"},middleLeft:{"--justify":"center","--align":"flex-start"},middle:{"--justify":"center","--align":"center"},middleRight:{"--justify":"center","--align":"flex-end"},bottomLeft:{"--justify":"flex-end","--align":"flex-start"},bottomMiddle:{"--justify":"flex-end","--align":"center"},bottomRight:{"--justify":"flex-end","--align":"flex-end"}},yu={props:{content:{type:Object,required:!0}},emits:["trigger-event","update:sidepanel-content"],computed:{isEditing(){return!1},show(){return this.content.display},backdropStyle(){return this.show&&this.content.backdrop?{"--backdropColor":this.content.backdropColor,"--backdropEvents":"auto",zIndex:this.content.zIndex}:{"--backdropColor":"transparent","--backdropEvents":"none",zIndex:this.content.zIndex}},modalContentStyle(){const r={"--transition":this.content.transition};return this.content.position!=="custom"?{...r,...Au[this.content.position]}:{...r,"--top":this.content.positionTop,"--left":this.content.positionLeft}}},watch:{}};function Eu(r,e,t,n,a,s){const f=si("wwLayout");return fr(),Nr("div",{class:"modal-container",style:Vn(s.backdropStyle),"ww-responsive":"modal-container",onMousedown:e[0]||(e[0]=j1(h=>r.$emit("trigger-event",{name:"backdropClick"}),["self"]))},[ta(Z1,{name:t.content.animation,mode:"out-in"},{default:zo(()=>[s.show?(fr(),ea(f,{key:0,class:$i(["modal-dropzone",t.content.position]),direction:"column",path:"modalContent",style:Vn(s.modalContentStyle),"ww-responsive":"modal-dropzone","inherit-from-element":["width"]},null,8,["class","style"])):tn("",!0)]),_:1},8,["name"])],36)}const Su=vi(yu,[["render",Eu],["__scopeId","data-v-f2e126dd"]]);export{mu as a,Iu as b,_u as e,Su as s};