diff --git a/dist/assets/index.26e8f481.js b/dist/assets/index.acdfd36c.js
similarity index 99%
rename from dist/assets/index.26e8f481.js
rename to dist/assets/index.acdfd36c.js
index a15ba08..eae93dc 100644
--- a/dist/assets/index.26e8f481.js
+++ b/dist/assets/index.acdfd36c.js
@@ -75,4 +75,4 @@ var k3=Object.defineProperty,x3=Object.defineProperties;var M3=Object.getOwnProp
 `),r.append(`>>
 `),r.toString()}setMode(r){this.mode=r}setECLevel(r){this.ecLevel=r}setVersion(r){this.version=r}setMaskPattern(r){this.maskPattern=r}setMatrix(r){this.matrix=r}static isValidMaskPattern(r){return r>=0&&r<si.NUM_MASK_PATTERNS}}si.NUM_MASK_PATTERNS=8;class vn extends f{}vn.kind="WriterException";class Lt{constructor(){}static clearMatrix(r){r.clear(255)}static buildMatrix(r,a,u,d,h){Lt.clearMatrix(h),Lt.embedBasicPatterns(u,h),Lt.embedTypeInfo(a,d,h),Lt.maybeEmbedVersionInfo(u,h),Lt.embedDataBits(r,d,h)}static embedBasicPatterns(r,a){Lt.embedPositionDetectionPatternsAndSeparators(a),Lt.embedDarkDotAtLeftBottomCorner(a),Lt.maybeEmbedPositionAdjustmentPatterns(r,a),Lt.embedTimingPatterns(a)}static embedTypeInfo(r,a,u){const d=new N;Lt.makeTypeInfoBits(r,a,d);for(let h=0,g=d.getSize();h<g;++h){const b=d.get(d.getSize()-1-h),C=Lt.TYPE_INFO_COORDINATES[h],A=C[0],L=C[1];if(u.setBoolean(A,L,b),h<8){const U=u.getWidth()-h-1,Z=8;u.setBoolean(U,Z,b)}else{const Z=u.getHeight()-7+(h-8);u.setBoolean(8,Z,b)}}}static maybeEmbedVersionInfo(r,a){if(r.getVersionNumber()<7)return;const u=new N;Lt.makeVersionInfoBits(r,u);let d=6*3-1;for(let h=0;h<6;++h)for(let g=0;g<3;++g){const b=u.get(d);d--,a.setBoolean(h,a.getHeight()-11+g,b),a.setBoolean(a.getHeight()-11+g,h,b)}}static embedDataBits(r,a,u){let d=0,h=-1,g=u.getWidth()-1,b=u.getHeight()-1;for(;g>0;){for(g===6&&(g-=1);b>=0&&b<u.getHeight();){for(let C=0;C<2;++C){const A=g-C;if(!Lt.isEmpty(u.get(A,b)))continue;let L;d<r.getSize()?(L=r.get(d),++d):L=!1,a!==255&&Ln.getDataMaskBit(a,A,b)&&(L=!L),u.setBoolean(A,b,L)}b+=h}h=-h,b+=h,g-=2}if(d!==r.getSize())throw new vn("Not all bits consumed: "+d+"/"+r.getSize())}static findMSBSet(r){return 32-_.numberOfLeadingZeros(r)}static calculateBCHCode(r,a){if(a===0)throw new m("0 polynomial");const u=Lt.findMSBSet(a);for(r<<=u-1;Lt.findMSBSet(r)>=u;)r^=a<<Lt.findMSBSet(r)-u;return r}static makeTypeInfoBits(r,a,u){if(!si.isValidMaskPattern(a))throw new vn("Invalid mask pattern");const d=r.getBits()<<3|a;u.appendBits(d,5);const h=Lt.calculateBCHCode(d,Lt.TYPE_INFO_POLY);u.appendBits(h,10);const g=new N;if(g.appendBits(Lt.TYPE_INFO_MASK_PATTERN,15),u.xor(g),u.getSize()!==15)throw new vn("should not happen but we got: "+u.getSize())}static makeVersionInfoBits(r,a){a.appendBits(r.getVersionNumber(),6);const u=Lt.calculateBCHCode(r.getVersionNumber(),Lt.VERSION_INFO_POLY);if(a.appendBits(u,12),a.getSize()!==18)throw new vn("should not happen but we got: "+a.getSize())}static isEmpty(r){return r===255}static embedTimingPatterns(r){for(let a=8;a<r.getWidth()-8;++a){const u=(a+1)%2;Lt.isEmpty(r.get(a,6))&&r.setNumber(a,6,u),Lt.isEmpty(r.get(6,a))&&r.setNumber(6,a,u)}}static embedDarkDotAtLeftBottomCorner(r){if(r.get(8,r.getHeight()-8)===0)throw new vn;r.setNumber(8,r.getHeight()-8,1)}static embedHorizontalSeparationPattern(r,a,u){for(let d=0;d<8;++d){if(!Lt.isEmpty(u.get(r+d,a)))throw new vn;u.setNumber(r+d,a,0)}}static embedVerticalSeparationPattern(r,a,u){for(let d=0;d<7;++d){if(!Lt.isEmpty(u.get(r,a+d)))throw new vn;u.setNumber(r,a+d,0)}}static embedPositionAdjustmentPattern(r,a,u){for(let d=0;d<5;++d){const h=Lt.POSITION_ADJUSTMENT_PATTERN[d];for(let g=0;g<5;++g)u.setNumber(r+g,a+d,h[g])}}static embedPositionDetectionPattern(r,a,u){for(let d=0;d<7;++d){const h=Lt.POSITION_DETECTION_PATTERN[d];for(let g=0;g<7;++g)u.setNumber(r+g,a+d,h[g])}}static embedPositionDetectionPatternsAndSeparators(r){const a=Lt.POSITION_DETECTION_PATTERN[0].length;Lt.embedPositionDetectionPattern(0,0,r),Lt.embedPositionDetectionPattern(r.getWidth()-a,0,r),Lt.embedPositionDetectionPattern(0,r.getWidth()-a,r);const u=8;Lt.embedHorizontalSeparationPattern(0,u-1,r),Lt.embedHorizontalSeparationPattern(r.getWidth()-u,u-1,r),Lt.embedHorizontalSeparationPattern(0,r.getWidth()-u,r);const d=7;Lt.embedVerticalSeparationPattern(d,0,r),Lt.embedVerticalSeparationPattern(r.getHeight()-d-1,0,r),Lt.embedVerticalSeparationPattern(d,r.getHeight()-d,r)}static maybeEmbedPositionAdjustmentPatterns(r,a){if(r.getVersionNumber()<2)return;const u=r.getVersionNumber()-1,d=Lt.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[u];for(let h=0,g=d.length;h!==g;h++){const b=d[h];if(b>=0)for(let C=0;C!==g;C++){const A=d[C];A>=0&&Lt.isEmpty(a.get(A,b))&&Lt.embedPositionAdjustmentPattern(A-2,b-2,a)}}}}Lt.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])]),Lt.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])]),Lt.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])]),Lt.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])]),Lt.VERSION_INFO_POLY=7973,Lt.TYPE_INFO_POLY=1335,Lt.TYPE_INFO_MASK_PATTERN=21522;class b3{constructor(r,a){this.dataBytes=r,this.errorCorrectionBytes=a}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Nn{constructor(){}static calculateMaskPenalty(r){return Ln.applyMaskPenaltyRule1(r)+Ln.applyMaskPenaltyRule2(r)+Ln.applyMaskPenaltyRule3(r)+Ln.applyMaskPenaltyRule4(r)}static encode(r,a,u=null){let d=Nn.DEFAULT_BYTE_MODE_ENCODING;const h=u!==null&&u.get(jn.CHARACTER_SET)!==void 0;h&&(d=u.get(jn.CHARACTER_SET).toString());const g=this.chooseMode(r,d),b=new N;if(g===Rt.BYTE&&(h||Nn.DEFAULT_BYTE_MODE_ENCODING!==d)){const ht=B.getCharacterSetECIByName(d);ht!==void 0&&this.appendECI(ht,b)}this.appendModeInfo(g,b);const C=new N;this.appendBytes(r,g,C,d);let A;if(u!==null&&u.get(jn.QR_VERSION)!==void 0){const ht=Number.parseInt(u.get(jn.QR_VERSION).toString(),10);A=xt.getVersionForNumber(ht);const lt=this.calculateBitsNeeded(g,b,C,A);if(!this.willFit(lt,A,a))throw new vn("Data too big for requested version")}else A=this.recommendVersion(a,g,b,C);const L=new N;L.appendBitArray(b);const U=g===Rt.BYTE?C.getSizeInBytes():r.length;this.appendLengthInfo(U,A,g,L),L.appendBitArray(C);const Z=A.getECBlocksForLevel(a),se=A.getTotalCodewords()-Z.getTotalECCodewords();this.terminateBits(se,L);const ye=this.interleaveWithECBytes(L,A.getTotalCodewords(),se,Z.getNumBlocks()),Ce=new si;Ce.setECLevel(a),Ce.setMode(g),Ce.setVersion(A);const Oe=A.getDimensionForVersion(),Ke=new Vu(Oe,Oe),ft=this.chooseMaskPattern(ye,a,A,Ke);return Ce.setMaskPattern(ft),Lt.buildMatrix(ye,a,A,ft,Ke),Ce.setMatrix(Ke),Ce}static recommendVersion(r,a,u,d){const h=this.calculateBitsNeeded(a,u,d,xt.getVersionForNumber(1)),g=this.chooseVersion(h,r),b=this.calculateBitsNeeded(a,u,d,g);return this.chooseVersion(b,r)}static calculateBitsNeeded(r,a,u,d){return a.getSize()+r.getCharacterCountBits(d)+u.getSize()}static getAlphanumericCode(r){return r<Nn.ALPHANUMERIC_TABLE.length?Nn.ALPHANUMERIC_TABLE[r]:-1}static chooseMode(r,a=null){if(B.SJIS.getName()===a&&this.isOnlyDoubleByteKanji(r))return Rt.KANJI;let u=!1,d=!1;for(let h=0,g=r.length;h<g;++h){const b=r.charAt(h);if(Nn.isDigit(b))u=!0;else if(this.getAlphanumericCode(b.charCodeAt(0))!==-1)d=!0;else return Rt.BYTE}return d?Rt.ALPHANUMERIC:u?Rt.NUMERIC:Rt.BYTE}static isOnlyDoubleByteKanji(r){let a;try{a=X.encode(r,B.SJIS)}catch{return!1}const u=a.length;if(u%2!==0)return!1;for(let d=0;d<u;d+=2){const h=a[d]&255;if((h<129||h>159)&&(h<224||h>235))return!1}return!0}static chooseMaskPattern(r,a,u,d){let h=Number.MAX_SAFE_INTEGER,g=-1;for(let b=0;b<si.NUM_MASK_PATTERNS;b++){Lt.buildMatrix(r,a,u,b,d);let C=this.calculateMaskPenalty(d);C<h&&(h=C,g=b)}return g}static chooseVersion(r,a){for(let u=1;u<=40;u++){const d=xt.getVersionForNumber(u);if(Nn.willFit(r,d,a))return d}throw new vn("Data too big")}static willFit(r,a,u){const d=a.getTotalCodewords(),g=a.getECBlocksForLevel(u).getTotalECCodewords(),b=d-g,C=(r+7)/8;return b>=C}static terminateBits(r,a){const u=r*8;if(a.getSize()>u)throw new vn("data bits cannot fit in the QR Code"+a.getSize()+" > "+u);for(let g=0;g<4&&a.getSize()<u;++g)a.appendBit(!1);const d=a.getSize()&7;if(d>0)for(let g=d;g<8;g++)a.appendBit(!1);const h=r-a.getSizeInBytes();for(let g=0;g<h;++g)a.appendBits((g&1)===0?236:17,8);if(a.getSize()!==u)throw new vn("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(r,a,u,d,h,g){if(d>=u)throw new vn("Block ID too large");const b=r%u,C=u-b,A=Math.floor(r/u),L=A+1,U=Math.floor(a/u),Z=U+1,se=A-U,ye=L-Z;if(se!==ye)throw new vn("EC bytes mismatch");if(u!==C+b)throw new vn("RS blocks mismatch");if(r!==(U+se)*C+(Z+ye)*b)throw new vn("Total bytes mismatch");d<C?(h[0]=U,g[0]=se):(h[0]=Z,g[0]=ye)}static interleaveWithECBytes(r,a,u,d){if(r.getSizeInBytes()!==u)throw new vn("Number of bits and data bytes does not match");let h=0,g=0,b=0;const C=new Array;for(let L=0;L<d;++L){const U=new Int32Array(1),Z=new Int32Array(1);Nn.getNumDataBytesAndNumECBytesForBlockID(a,u,d,L,U,Z);const se=U[0],ye=new Uint8Array(se);r.toBytes(8*h,ye,0,se);const Ce=Nn.generateECBytes(ye,Z[0]);C.push(new b3(ye,Ce)),g=Math.max(g,se),b=Math.max(b,Ce.length),h+=U[0]}if(u!==h)throw new vn("Data bytes does not match offset");const A=new N;for(let L=0;L<g;++L)for(const U of C){const Z=U.getDataBytes();L<Z.length&&A.appendBits(Z[L],8)}for(let L=0;L<b;++L)for(const U of C){const Z=U.getErrorCorrectionBytes();L<Z.length&&A.appendBits(Z[L],8)}if(a!==A.getSizeInBytes())throw new vn("Interleaving error: "+a+" and "+A.getSizeInBytes()+" differ.");return A}static generateECBytes(r,a){const u=r.length,d=new Int32Array(u+a);for(let g=0;g<u;g++)d[g]=r[g]&255;new mf(ot.QR_CODE_FIELD_256).encode(d,a);const h=new Uint8Array(a);for(let g=0;g<a;g++)h[g]=d[u+g];return h}static appendModeInfo(r,a){a.appendBits(r.getBits(),4)}static appendLengthInfo(r,a,u,d){const h=u.getCharacterCountBits(a);if(r>=1<<h)throw new vn(r+" is bigger than "+((1<<h)-1));d.appendBits(r,h)}static appendBytes(r,a,u,d){switch(a){case Rt.NUMERIC:Nn.appendNumericBytes(r,u);break;case Rt.ALPHANUMERIC:Nn.appendAlphanumericBytes(r,u);break;case Rt.BYTE:Nn.append8BitBytes(r,u,d);break;case Rt.KANJI:Nn.appendKanjiBytes(r,u);break;default:throw new vn("Invalid mode: "+a)}}static getDigit(r){return r.charCodeAt(0)-48}static isDigit(r){const a=Nn.getDigit(r);return a>=0&&a<=9}static appendNumericBytes(r,a){const u=r.length;let d=0;for(;d<u;){const h=Nn.getDigit(r.charAt(d));if(d+2<u){const g=Nn.getDigit(r.charAt(d+1)),b=Nn.getDigit(r.charAt(d+2));a.appendBits(h*100+g*10+b,10),d+=3}else if(d+1<u){const g=Nn.getDigit(r.charAt(d+1));a.appendBits(h*10+g,7),d+=2}else a.appendBits(h,4),d++}}static appendAlphanumericBytes(r,a){const u=r.length;let d=0;for(;d<u;){const h=Nn.getAlphanumericCode(r.charCodeAt(d));if(h===-1)throw new vn;if(d+1<u){const g=Nn.getAlphanumericCode(r.charCodeAt(d+1));if(g===-1)throw new vn;a.appendBits(h*45+g,11),d+=2}else a.appendBits(h,6),d++}}static append8BitBytes(r,a,u){let d;try{d=X.encode(r,u)}catch(h){throw new vn(h)}for(let h=0,g=d.length;h!==g;h++){const b=d[h];a.appendBits(b,8)}}static appendKanjiBytes(r,a){let u;try{u=X.encode(r,B.SJIS)}catch(h){throw new vn(h)}const d=u.length;for(let h=0;h<d;h+=2){const g=u[h]&255,b=u[h+1]&255,C=g<<8&4294967295|b;let A=-1;if(C>=33088&&C<=40956?A=C-33088:C>=57408&&C<=60351&&(A=C-49472),A===-1)throw new vn("Invalid byte sequence");const L=(A>>8)*192+(A&255);a.appendBits(L,13)}}static appendECI(r,a){a.appendBits(Rt.ECI.getBits(),4),a.appendBits(r.getValue(),8)}}Nn.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]),Nn.DEFAULT_BYTE_MODE_ENCODING=B.UTF8.getName();class ii{write(r,a,u,d=null){if(r.length===0)throw new m("Found empty contents");if(a<0||u<0)throw new m("Requested dimensions are too small: "+a+"x"+u);let h=Cn.L,g=ii.QUIET_ZONE_SIZE;d!==null&&(d.get(jn.ERROR_CORRECTION)!==void 0&&(h=Cn.fromString(d.get(jn.ERROR_CORRECTION).toString())),d.get(jn.MARGIN)!==void 0&&(g=Number.parseInt(d.get(jn.MARGIN).toString(),10)));const b=Nn.encode(r,h,d);return this.renderResult(b,a,u,g)}writeToDom(r,a,u,d,h=null){typeof r=="string"&&(r=document.querySelector(r));const g=this.write(a,u,d,h);r&&r.appendChild(g)}renderResult(r,a,u,d){const h=r.getMatrix();if(h===null)throw new de;const g=h.getWidth(),b=h.getHeight(),C=g+d*2,A=b+d*2,L=Math.max(a,C),U=Math.max(u,A),Z=Math.min(Math.floor(L/C),Math.floor(U/A)),se=Math.floor((L-g*Z)/2),ye=Math.floor((U-b*Z)/2),Ce=this.createSVGElement(L,U);for(let Oe=0,Ke=ye;Oe<b;Oe++,Ke+=Z)for(let ft=0,ht=se;ft<g;ft++,ht+=Z)if(h.get(ft,Oe)===1){const lt=this.createSvgRectElement(ht,Ke,Z,Z);Ce.appendChild(lt)}return Ce}createSVGElement(r,a){const u=document.createElementNS(ii.SVG_NS,"svg");return u.setAttributeNS(null,"height",r.toString()),u.setAttributeNS(null,"width",a.toString()),u}createSvgRectElement(r,a,u,d){const h=document.createElementNS(ii.SVG_NS,"rect");return h.setAttributeNS(null,"x",r.toString()),h.setAttributeNS(null,"y",a.toString()),h.setAttributeNS(null,"height",u.toString()),h.setAttributeNS(null,"width",d.toString()),h.setAttributeNS(null,"fill","#000000"),h}}ii.QUIET_ZONE_SIZE=4,ii.SVG_NS="http://www.w3.org/2000/svg";class ia{encode(r,a,u,d,h){if(r.length===0)throw new m("Found empty contents");if(a!==xe.QR_CODE)throw new m("Can only encode QR_CODE, but got "+a);if(u<0||d<0)throw new m(`Requested dimensions are too small: ${u}x${d}`);let g=Cn.L,b=ia.QUIET_ZONE_SIZE;h!==null&&(h.get(jn.ERROR_CORRECTION)!==void 0&&(g=Cn.fromString(h.get(jn.ERROR_CORRECTION).toString())),h.get(jn.MARGIN)!==void 0&&(b=Number.parseInt(h.get(jn.MARGIN).toString(),10)));const C=Nn.encode(r,g,h);return ia.renderResult(C,u,d,b)}static renderResult(r,a,u,d){const h=r.getMatrix();if(h===null)throw new de;const g=h.getWidth(),b=h.getHeight(),C=g+d*2,A=b+d*2,L=Math.max(a,C),U=Math.max(u,A),Z=Math.min(Math.floor(L/C),Math.floor(U/A)),se=Math.floor((L-g*Z)/2),ye=Math.floor((U-b*Z)/2),Ce=new G(L,U);for(let Oe=0,Ke=ye;Oe<b;Oe++,Ke+=Z)for(let ft=0,ht=se;ft<g;ft++,ht+=Z)h.get(ft,Oe)===1&&Ce.setRegion(ht,Ke,Z,Z);return Ce}}ia.QUIET_ZONE_SIZE=4;class w3{encode(r,a,u,d,h){let g;switch(a){case xe.QR_CODE:g=new ia;break;default:throw new m("No encoder available for format "+a)}return g.encode(r,a,u,d,h)}}class Hr extends V{constructor(r,a,u,d,h,g,b,C){if(super(g,b),this.yuvData=r,this.dataWidth=a,this.dataHeight=u,this.left=d,this.top=h,d+g>a||h+b>u)throw new m("Crop rectangle does not fit within image data.");C&&this.reverseHorizontal(g,b)}getRow(r,a){if(r<0||r>=this.getHeight())throw new m("Requested row is outside the image: "+r);const u=this.getWidth();(a==null||a.length<u)&&(a=new Uint8ClampedArray(u));const d=(r+this.top)*this.dataWidth+this.left;return E.arraycopy(this.yuvData,d,a,0,u),a}getMatrix(){const r=this.getWidth(),a=this.getHeight();if(r===this.dataWidth&&a===this.dataHeight)return this.yuvData;const u=r*a,d=new Uint8ClampedArray(u);let h=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return E.arraycopy(this.yuvData,h,d,0,u),d;for(let g=0;g<a;g++){const b=g*r;E.arraycopy(this.yuvData,h,d,b,r),h+=this.dataWidth}return d}isCropSupported(){return!0}crop(r,a,u,d){return new Hr(this.yuvData,this.dataWidth,this.dataHeight,this.left+r,this.top+a,u,d,!1)}renderThumbnail(){const r=this.getWidth()/Hr.THUMBNAIL_SCALE_FACTOR,a=this.getHeight()/Hr.THUMBNAIL_SCALE_FACTOR,u=new Int32Array(r*a),d=this.yuvData;let h=this.top*this.dataWidth+this.left;for(let g=0;g<a;g++){const b=g*r;for(let C=0;C<r;C++){const A=d[h+C*Hr.THUMBNAIL_SCALE_FACTOR]&255;u[b+C]=4278190080|A*65793}h+=this.dataWidth*Hr.THUMBNAIL_SCALE_FACTOR}return u}getThumbnailWidth(){return this.getWidth()/Hr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Hr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(r,a){const u=this.yuvData;for(let d=0,h=this.top*this.dataWidth+this.left;d<a;d++,h+=this.dataWidth){const g=h+r/2;for(let b=h,C=h+r-1;b<g;b++,C--){const A=u[b];u[b]=u[C],u[C]=A}}}invert(){return new q(this)}}Hr.THUMBNAIL_SCALE_FACTOR=2;class vf extends V{constructor(r,a,u,d,h,g,b){if(super(a,u),this.dataWidth=d,this.dataHeight=h,this.left=g,this.top=b,r.BYTES_PER_ELEMENT===4){const C=a*u,A=new Uint8ClampedArray(C);for(let L=0;L<C;L++){const U=r[L],Z=U>>16&255,se=U>>7&510,ye=U&255;A[L]=(Z+se+ye)/4&255}this.luminances=A}else this.luminances=r;if(d===void 0&&(this.dataWidth=a),h===void 0&&(this.dataHeight=u),g===void 0&&(this.left=0),b===void 0&&(this.top=0),this.left+a>this.dataWidth||this.top+u>this.dataHeight)throw new m("Crop rectangle does not fit within image data.")}getRow(r,a){if(r<0||r>=this.getHeight())throw new m("Requested row is outside the image: "+r);const u=this.getWidth();(a==null||a.length<u)&&(a=new Uint8ClampedArray(u));const d=(r+this.top)*this.dataWidth+this.left;return E.arraycopy(this.luminances,d,a,0,u),a}getMatrix(){const r=this.getWidth(),a=this.getHeight();if(r===this.dataWidth&&a===this.dataHeight)return this.luminances;const u=r*a,d=new Uint8ClampedArray(u);let h=this.top*this.dataWidth+this.left;if(r===this.dataWidth)return E.arraycopy(this.luminances,h,d,0,u),d;for(let g=0;g<a;g++){const b=g*r;E.arraycopy(this.luminances,h,d,b,r),h+=this.dataWidth}return d}isCropSupported(){return!0}crop(r,a,u,d){return new vf(this.luminances,u,d,this.dataWidth,this.dataHeight,this.left+r,this.top+a)}invert(){return new q(this)}}class E1 extends B{static forName(r){return this.getCharacterSetECIByName(r)}}class yf{}yf.ISO_8859_1=B.ISO8859_1;class S1{isCompact(){return this.compact}setCompact(r){this.compact=r}getSize(){return this.size}setSize(r){this.size=r}getLayers(){return this.layers}setLayers(r){this.layers=r}getCodeWords(){return this.codeWords}setCodeWords(r){this.codeWords=r}getMatrix(){return this.matrix}setMatrix(r){this.matrix=r}}class A1{static singletonList(r){return[r]}static min(r,a){return r.sort(a)[0]}}class C3{constructor(r){this.previous=r}getPrevious(){return this.previous}}class aa extends C3{constructor(r,a,u){super(r),this.value=a,this.bitCount=u}appendTo(r,a){r.appendBits(this.value,this.bitCount)}add(r,a){return new aa(this,r,a)}addBinaryShift(r,a){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new aa(this,r,a)}toString(){let r=this.value&(1<<this.bitCount)-1;return r|=1<<this.bitCount,"<"+_.toBinaryString(r|1<<this.bitCount).substring(1)+">"}}class bf extends aa{constructor(r,a,u){super(r,0,0),this.binaryShiftStart=a,this.binaryShiftByteCount=u}appendTo(r,a){for(let u=0;u<this.binaryShiftByteCount;u++)(u===0||u===31&&this.binaryShiftByteCount<=62)&&(r.appendBits(31,5),this.binaryShiftByteCount>62?r.appendBits(this.binaryShiftByteCount-31,16):u===0?r.appendBits(Math.min(this.binaryShiftByteCount,31),5):r.appendBits(this.binaryShiftByteCount-31,5)),r.appendBits(a[this.binaryShiftStart+u],8)}addBinaryShift(r,a){return new bf(this,r,a)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function E3(H,r,a){return new bf(H,r,a)}function ml(H,r,a){return new aa(H,r,a)}const S3=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],ks=0,Hu=1,or=2,T1=3,zr=4,A3=new aa(null,0,0),wf=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(9<<16)+(30<<4)+14,0,(5<<16)+30,(5<<16)+29,(10<<16)+(29<<5)+30]),Int32Array.from([(4<<16)+14,(9<<16)+(14<<5)+28,0,(9<<16)+(14<<5)+29,(14<<16)+(14<<10)+(29<<5)+30]),Int32Array.from([(5<<16)+29,(5<<16)+28,(10<<16)+(29<<5)+30,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,(10<<16)+(31<<5)+28,(10<<16)+(31<<5)+30,(10<<16)+(31<<5)+29,0])];function T3(H){for(let r of H)T.fill(r,-1);return H[ks][zr]=0,H[Hu][zr]=0,H[Hu][ks]=28,H[T1][zr]=0,H[or][zr]=0,H[or][ks]=15,H}const I1=T3(T.createInt32Array(6,6));class Ur{constructor(r,a,u,d){this.token=r,this.mode=a,this.binaryShiftByteCount=u,this.bitCount=d}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(r,a){let u=this.bitCount,d=this.token;if(r!==this.mode){let g=wf[this.mode][r];d=ml(d,g&65535,g>>16),u+=g>>16}let h=r===or?4:5;return d=ml(d,a,h),new Ur(d,r,0,u+h)}shiftAndAppend(r,a){let u=this.token,d=this.mode===or?4:5;return u=ml(u,I1[this.mode][r],d),u=ml(u,a,5),new Ur(u,this.mode,0,this.bitCount+d+5)}addBinaryShiftChar(r){let a=this.token,u=this.mode,d=this.bitCount;if(this.mode===zr||this.mode===or){let b=wf[u][ks];a=ml(a,b&65535,b>>16),d+=b>>16,u=ks}let h=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,g=new Ur(a,u,this.binaryShiftByteCount+1,d+h);return g.binaryShiftByteCount===2047+31&&(g=g.endBinaryShift(r+1)),g}endBinaryShift(r){if(this.binaryShiftByteCount===0)return this;let a=this.token;return a=E3(a,r-this.binaryShiftByteCount,this.binaryShiftByteCount),new Ur(a,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(r){let a=this.bitCount+(wf[this.mode][r.mode]>>16);return this.binaryShiftByteCount<r.binaryShiftByteCount?a+=Ur.calculateBinaryShiftCost(r)-Ur.calculateBinaryShiftCost(this):this.binaryShiftByteCount>r.binaryShiftByteCount&&r.binaryShiftByteCount>0&&(a+=10),a<=r.bitCount}toBitArray(r){let a=[];for(let d=this.endBinaryShift(r.length).token;d!==null;d=d.getPrevious())a.unshift(d);let u=new N;for(const d of a)d.appendTo(u,r);return u}toString(){return K.format("%s bits=%d bytes=%d",S3[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(r){return r.binaryShiftByteCount>62?21:r.binaryShiftByteCount>31?20:r.binaryShiftByteCount>0?10:0}}Ur.INITIAL_STATE=new Ur(A3,ks,0,0);function I3(H){const r=K.getCharCode(" "),a=K.getCharCode("."),u=K.getCharCode(",");H[ks][r]=1;const d=K.getCharCode("Z"),h=K.getCharCode("A");for(let Z=h;Z<=d;Z++)H[ks][Z]=Z-h+2;H[Hu][r]=1;const g=K.getCharCode("z"),b=K.getCharCode("a");for(let Z=b;Z<=g;Z++)H[Hu][Z]=Z-b+2;H[or][r]=1;const C=K.getCharCode("9"),A=K.getCharCode("0");for(let Z=A;Z<=C;Z++)H[or][Z]=Z-A+2;H[or][u]=12,H[or][a]=13;const L=["\0"," ","","","","","","","\x07","\b","	",`
 `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"];for(let Z=0;Z<L.length;Z++)H[T1][K.getCharCode(L[Z])]=Z;const U=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let Z=0;Z<U.length;Z++)K.getCharCode(U[Z])>0&&(H[zr][K.getCharCode(U[Z])]=Z);return H}const Cf=I3(T.createInt32Array(5,256));class vl{constructor(r){this.text=r}encode(){const r=K.getCharCode(" "),a=K.getCharCode(`
-`);let u=A1.singletonList(Ur.INITIAL_STATE);for(let h=0;h<this.text.length;h++){let g,b=h+1<this.text.length?this.text[h+1]:0;switch(this.text[h]){case K.getCharCode("\r"):g=b===a?2:0;break;case K.getCharCode("."):g=b===r?3:0;break;case K.getCharCode(","):g=b===r?4:0;break;case K.getCharCode(":"):g=b===r?5:0;break;default:g=0}g>0?(u=vl.updateStateListForPair(u,h,g),h++):u=this.updateStateListForChar(u,h)}return A1.min(u,(h,g)=>h.getBitCount()-g.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,a){const u=[];for(let d of r)this.updateStateForChar(d,a,u);return vl.simplifyStates(u)}updateStateForChar(r,a,u){let d=this.text[a]&255,h=Cf[r.getMode()][d]>0,g=null;for(let b=0;b<=zr;b++){let C=Cf[b][d];if(C>0){if(g==null&&(g=r.endBinaryShift(a)),!h||b===r.getMode()||b===or){const A=g.latchAndAppend(b,C);u.push(A)}if(!h&&I1[r.getMode()][b]>=0){const A=g.shiftAndAppend(b,C);u.push(A)}}}if(r.getBinaryShiftByteCount()>0||Cf[r.getMode()][d]===0){let b=r.addBinaryShiftChar(a);u.push(b)}}static updateStateListForPair(r,a,u){const d=[];for(let h of r)this.updateStateForPair(h,a,u,d);return this.simplifyStates(d)}static updateStateForPair(r,a,u,d){let h=r.endBinaryShift(a);if(d.push(h.latchAndAppend(zr,u)),r.getMode()!==zr&&d.push(h.shiftAndAppend(zr,u)),u===3||u===4){let g=h.latchAndAppend(or,16-u).latchAndAppend(or,1);d.push(g)}if(r.getBinaryShiftByteCount()>0){let g=r.addBinaryShiftChar(a).addBinaryShiftChar(a+1);d.push(g)}}static simplifyStates(r){let a=[];for(const u of r){let d=!0;for(const h of a){if(h.isBetterThanOrEqualTo(u)){d=!1;break}u.isBetterThanOrEqualTo(h)&&(a=a.filter(g=>g!==h))}d&&a.push(u)}return a}}class dn{constructor(){}static encodeBytes(r){return dn.encode(r,dn.DEFAULT_EC_PERCENT,dn.DEFAULT_AZTEC_LAYERS)}static encode(r,a,u){let d=new vl(r).encode(),h=_.truncDivision(d.getSize()*a,100)+11,g=d.getSize()+h,b,C,A,L,U;if(u!==dn.DEFAULT_AZTEC_LAYERS){if(b=u<0,C=Math.abs(u),C>(b?dn.MAX_NB_BITS_COMPACT:dn.MAX_NB_BITS))throw new m(K.format("Illegal value %s for layers",u));A=dn.totalBitsInLayer(C,b),L=dn.WORD_SIZE[C];let lt=A-A%L;if(U=dn.stuffBits(d,L),U.getSize()+h>lt)throw new m("Data to large for user specified layer");if(b&&U.getSize()>L*64)throw new m("Data to large for user specified layer")}else{L=0,U=null;for(let lt=0;;lt++){if(lt>dn.MAX_NB_BITS)throw new m("Data too large for an Aztec code");if(b=lt<=3,C=b?lt+1:lt,A=dn.totalBitsInLayer(C,b),g>A)continue;(U==null||L!==dn.WORD_SIZE[C])&&(L=dn.WORD_SIZE[C],U=dn.stuffBits(d,L));let rn=A-A%L;if(!(b&&U.getSize()>L*64)&&U.getSize()+h<=rn)break}}let Z=dn.generateCheckWords(U,A,L),se=U.getSize()/L,ye=dn.generateModeMessage(b,C,se),Ce=(b?11:14)+C*4,Oe=new Int32Array(Ce),Ke;if(b){Ke=Ce;for(let lt=0;lt<Oe.length;lt++)Oe[lt]=lt}else{Ke=Ce+1+2*_.truncDivision(_.truncDivision(Ce,2)-1,15);let lt=_.truncDivision(Ce,2),rn=_.truncDivision(Ke,2);for(let qt=0;qt<lt;qt++){let _o=qt+_.truncDivision(qt,15);Oe[lt-qt-1]=rn-_o-1,Oe[lt+qt]=rn+_o+1}}let ft=new G(Ke);for(let lt=0,rn=0;lt<C;lt++){let qt=(C-lt)*4+(b?9:12);for(let _o=0;_o<qt;_o++){let Er=_o*2;for(let No=0;No<2;No++)Z.get(rn+Er+No)&&ft.set(Oe[lt*2+No],Oe[lt*2+_o]),Z.get(rn+qt*2+Er+No)&&ft.set(Oe[lt*2+_o],Oe[Ce-1-lt*2-No]),Z.get(rn+qt*4+Er+No)&&ft.set(Oe[Ce-1-lt*2-No],Oe[Ce-1-lt*2-_o]),Z.get(rn+qt*6+Er+No)&&ft.set(Oe[Ce-1-lt*2-_o],Oe[lt*2+No])}rn+=qt*8}if(dn.drawModeMessage(ft,b,Ke,ye),b)dn.drawBullsEye(ft,_.truncDivision(Ke,2),5);else{dn.drawBullsEye(ft,_.truncDivision(Ke,2),7);for(let lt=0,rn=0;lt<_.truncDivision(Ce,2)-1;lt+=15,rn+=16)for(let qt=_.truncDivision(Ke,2)&1;qt<Ke;qt+=2)ft.set(_.truncDivision(Ke,2)-rn,qt),ft.set(_.truncDivision(Ke,2)+rn,qt),ft.set(qt,_.truncDivision(Ke,2)-rn),ft.set(qt,_.truncDivision(Ke,2)+rn)}let ht=new S1;return ht.setCompact(b),ht.setSize(Ke),ht.setLayers(C),ht.setCodeWords(se),ht.setMatrix(ft),ht}static drawBullsEye(r,a,u){for(let d=0;d<u;d+=2)for(let h=a-d;h<=a+d;h++)r.set(h,a-d),r.set(h,a+d),r.set(a-d,h),r.set(a+d,h);r.set(a-u,a-u),r.set(a-u+1,a-u),r.set(a-u,a-u+1),r.set(a+u,a-u),r.set(a+u,a-u+1),r.set(a+u,a+u-1)}static generateModeMessage(r,a,u){let d=new N;return r?(d.appendBits(a-1,2),d.appendBits(u-1,6),d=dn.generateCheckWords(d,28,4)):(d.appendBits(a-1,5),d.appendBits(u-1,11),d=dn.generateCheckWords(d,40,4)),d}static drawModeMessage(r,a,u,d){let h=_.truncDivision(u,2);if(a)for(let g=0;g<7;g++){let b=h-3+g;d.get(g)&&r.set(b,h-5),d.get(g+7)&&r.set(h+5,b),d.get(20-g)&&r.set(b,h+5),d.get(27-g)&&r.set(h-5,b)}else for(let g=0;g<10;g++){let b=h-5+g+_.truncDivision(g,5);d.get(g)&&r.set(b,h-7),d.get(g+10)&&r.set(h+7,b),d.get(29-g)&&r.set(b,h+7),d.get(39-g)&&r.set(h-7,b)}}static generateCheckWords(r,a,u){let d=r.getSize()/u,h=new mf(dn.getGF(u)),g=_.truncDivision(a,u),b=dn.bitsToWords(r,u,g);h.encode(b,g-d);let C=a%u,A=new N;A.appendBits(0,C);for(const L of Array.from(b))A.appendBits(L,u);return A}static bitsToWords(r,a,u){let d=new Int32Array(u),h,g;for(h=0,g=r.getSize()/a;h<g;h++){let b=0;for(let C=0;C<a;C++)b|=r.get(h*a+C)?1<<a-C-1:0;d[h]=b}return d}static getGF(r){switch(r){case 4:return ot.AZTEC_PARAM;case 6:return ot.AZTEC_DATA_6;case 8:return ot.AZTEC_DATA_8;case 10:return ot.AZTEC_DATA_10;case 12:return ot.AZTEC_DATA_12;default:throw new m("Unsupported word size "+r)}}static stuffBits(r,a){let u=new N,d=r.getSize(),h=(1<<a)-2;for(let g=0;g<d;g+=a){let b=0;for(let C=0;C<a;C++)(g+C>=d||r.get(g+C))&&(b|=1<<a-1-C);(b&h)===h?(u.appendBits(b&h,a),g--):(b&h)===0?(u.appendBits(b|1,a),g--):u.appendBits(b,a)}return u}static totalBitsInLayer(r,a){return((a?88:112)+16*r)*r}}dn.DEFAULT_EC_PERCENT=33,dn.DEFAULT_AZTEC_LAYERS=0,dn.MAX_NB_BITS=32,dn.MAX_NB_BITS_COMPACT=4,dn.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class zu{encode(r,a,u,d){return this.encodeWithHints(r,a,u,d,null)}encodeWithHints(r,a,u,d,h){let g=yf.ISO_8859_1,b=dn.DEFAULT_EC_PERCENT,C=dn.DEFAULT_AZTEC_LAYERS;return h!=null&&(h.has(jn.CHARACTER_SET)&&(g=E1.forName(h.get(jn.CHARACTER_SET).toString())),h.has(jn.ERROR_CORRECTION)&&(b=_.parseInt(h.get(jn.ERROR_CORRECTION).toString())),h.has(jn.AZTEC_LAYERS)&&(C=_.parseInt(h.get(jn.AZTEC_LAYERS).toString()))),zu.encodeLayers(r,a,u,d,g,b,C)}static encodeLayers(r,a,u,d,h,g,b){if(a!==xe.AZTEC)throw new m("Can only encode AZTEC, but got "+a);let C=dn.encode(K.getBytes(r,h),g,b);return zu.renderResult(C,u,d)}static renderResult(r,a,u){let d=r.getMatrix();if(d==null)throw new de;let h=d.getWidth(),g=d.getHeight(),b=Math.max(a,h),C=Math.max(u,g),A=Math.min(b/h,C/g),L=(b-h*A)/2,U=(C-g*A)/2,Z=new G(b,C);for(let se=0,ye=U;se<g;se++,ye+=A)for(let Ce=0,Oe=L;Ce<h;Ce++,Oe+=A)d.get(Ce,se)&&Z.setRegion(Oe,ye,A,A);return Z}}n.ArgumentException=p,n.ArithmeticException=mt,n.AztecCode=S1,n.AztecCodeReader=Fe,n.AztecCodeWriter=zu,n.AztecDecoder=ke,n.AztecDetector=we,n.AztecDetectorResult=Te,n.AztecEncoder=dn,n.AztecHighLevelEncoder=vl,n.AztecPoint=tt,n.BarcodeFormat=xe,n.Binarizer=w,n.BinaryBitmap=y,n.BitArray=N,n.BitMatrix=G,n.BitSource=cf,n.BrowserAztecCodeReader=_e,n.BrowserBarcodeReader=o3,n.BrowserCodeReader=Se,n.BrowserDatamatrixCodeReader=s3,n.BrowserMultiFormatReader=m3,n.BrowserPDF417Reader=v3,n.BrowserQRCodeReader=y3,n.BrowserQRCodeSvgWriter=ii,n.CharacterSetECI=B,n.ChecksumException=v,n.Code128Reader=Le,n.Code39Reader=Mt,n.DataMatrixDecodedBitStreamParser=Ts,n.DataMatrixReader=Is,n.DecodeHintType=D,n.DecoderResult=We,n.DefaultGridSampler=pt,n.DetectorResult=ge,n.EAN13Reader=go,n.EncodeHintType=jn,n.Exception=f,n.FormatException=x,n.GenericGF=ot,n.GenericGFPoly=Ze,n.GlobalHistogramBinarizer=ee,n.GridSampler=he,n.GridSamplerInstance=At,n.HTMLCanvasElementLuminanceSource=ce,n.HybridBinarizer=j,n.ITFReader=Nt,n.IllegalArgumentException=m,n.IllegalStateException=de,n.InvertedLuminanceSource=q,n.LuminanceSource=V,n.MathUtils=Ve,n.MultiFormatOneDReader=ra,n.MultiFormatReader=C1,n.MultiFormatWriter=w3,n.NotFoundException=z,n.OneDReader=Ye,n.PDF417DecodedBitStreamParser=je,n.PDF417DecoderErrorCorrection=g1,n.PDF417Reader=no,n.PDF417ResultMetadata=v1,n.PerspectiveTransform=He,n.PlanarYUVLuminanceSource=Hr,n.QRCodeByteMatrix=Vu,n.QRCodeDataMask=tr,n.QRCodeDecodedBitStreamParser=Mn,n.QRCodeDecoderErrorCorrectionLevel=Cn,n.QRCodeDecoderFormatInformation=ho,n.QRCodeEncoder=Nn,n.QRCodeEncoderQRCode=si,n.QRCodeMaskUtil=Ln,n.QRCodeMatrixUtil=Lt,n.QRCodeMode=Rt,n.QRCodeReader=_s,n.QRCodeVersion=xt,n.QRCodeWriter=ia,n.RGBLuminanceSource=vf,n.RSS14Reader=Rn,n.RSSExpandedReader=nt,n.ReaderException=Fu,n.ReedSolomonDecoder=Ne,n.ReedSolomonEncoder=mf,n.ReedSolomonException=te,n.Result=Ee,n.ResultMetadataType=Me,n.ResultPoint=re,n.StringUtils=K,n.UnsupportedOperationException=Y,n.VideoInputDevice=ue,n.WhiteRectangleDetector=Je,n.WriterException=vn,n.ZXingArrays=T,n.ZXingCharset=E1,n.ZXingInteger=_,n.ZXingStandardCharsets=yf,n.ZXingStringBuilder=J,n.ZXingStringEncoding=X,n.ZXingSystem=E,Object.defineProperty(n,"__esModule",{value:!0})})})(Sn,Sn.exports);var ene=MC(Sn.exports),tne=D3({__proto__:null,default:ene},[Sn.exports]),nne=function(){function e(t,n,o){if(this.formatMap=new Map([[Et.QR_CODE,Sn.exports.BarcodeFormat.QR_CODE],[Et.AZTEC,Sn.exports.BarcodeFormat.AZTEC],[Et.CODABAR,Sn.exports.BarcodeFormat.CODABAR],[Et.CODE_39,Sn.exports.BarcodeFormat.CODE_39],[Et.CODE_93,Sn.exports.BarcodeFormat.CODE_93],[Et.CODE_128,Sn.exports.BarcodeFormat.CODE_128],[Et.DATA_MATRIX,Sn.exports.BarcodeFormat.DATA_MATRIX],[Et.MAXICODE,Sn.exports.BarcodeFormat.MAXICODE],[Et.ITF,Sn.exports.BarcodeFormat.ITF],[Et.EAN_13,Sn.exports.BarcodeFormat.EAN_13],[Et.EAN_8,Sn.exports.BarcodeFormat.EAN_8],[Et.PDF_417,Sn.exports.BarcodeFormat.PDF_417],[Et.RSS_14,Sn.exports.BarcodeFormat.RSS_14],[Et.RSS_EXPANDED,Sn.exports.BarcodeFormat.RSS_EXPANDED],[Et.UPC_A,Sn.exports.BarcodeFormat.UPC_A],[Et.UPC_E,Sn.exports.BarcodeFormat.UPC_E],[Et.UPC_EAN_EXTENSION,Sn.exports.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!tne)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var s=this.createZXingFormats(t),i=new Map;i.set(Sn.exports.DecodeHintType.POSSIBLE_FORMATS,s),this.hints=i}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,s){try{o(n.decode(t))}catch(i){s(i)}})},e.prototype.decode=function(t){var n=new Sn.exports.MultiFormatReader(this.verbose,this.hints),o=new Sn.exports.HTMLCanvasElementLuminanceSource(t),s=new Sn.exports.BinaryBitmap(new Sn.exports.HybridBinarizer(o)),i=n.decode(s);return{text:i.text,format:GS.create(this.toHtml5QrcodeSupportedFormats(i.format))}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,s){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have "+t;return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,s=t;o<s.length;o++){var i=s[o];this.formatMap.has(i)?n.push(this.formatMap.get(i)):this.logger.logError(i+" is not supported byZXingHtml5QrcodeShim")}return n},e}(),one=globalThis&&globalThis.__awaiter||function(e,t,n,o){function s(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function c(m){try{p(o.next(m))}catch(y){l(y)}}function f(m){try{p(o.throw(m))}catch(y){l(y)}}function p(m){m.done?i(m.value):s(m.value).then(c,f)}p((o=o.apply(e,t||[])).next())})},rne=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,s,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(p){return function(m){return f([p,m])}}function f(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,s&&(i=p[0]&2?s.return:p[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,p[1])).done)return i;switch(s=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,s=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],s=0}finally{o=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},$y=function(){function e(t,n,o){if(this.formatMap=new Map([[Et.QR_CODE,"qr_code"],[Et.AZTEC,"aztec"],[Et.CODABAR,"codabar"],[Et.CODE_39,"code_39"],[Et.CODE_93,"code_93"],[Et.CODE_128,"code_128"],[Et.DATA_MATRIX,"data_matrix"],[Et.ITF,"itf"],[Et.EAN_13,"ean_13"],[Et.EAN_8,"ean_8"],[Et.PDF_417,"pdf417"],[Et.UPC_A,"upc_a"],[Et.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var s=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(s),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t!="undefined"},e.prototype.decodeAsync=function(t){return one(this,void 0,void 0,function(){var n,o;return rne(this,function(s){switch(s.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=s.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:GS.create(this.toHtml5QrcodeSupportedFormats(o.format))}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,s=0,i=t;s<i.length;s++){var l=i[s],c=l.boundingBox.width*l.boundingBox.height;c>o&&(o=c,n=l)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,s=t;o<s.length;o++){var i=s[o];this.formatMap.has(i)?n.push(this.formatMap.get(i)):this.logger.warn(i+" is not supported byBarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have "+t;return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,s){t.set(n,o)}),t},e}(),sne=function(){function e(t,n,o,s){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.verbose=n,s.useBarCodeDetectorIfSupported===!0&&$y.isSupported()?this.decoder=new $y(t,n,o):this.decoder=new nne(t,n,o)}return e.prototype.decodeAsync=function(t){var n=this,o=performance.now();return this.decoder.decodeAsync(t).finally(function(){if(n.verbose){var s=performance.now()-o;n.executionResults.push(s),n.executions++,n.possiblyFlushPerformanceReport()}})},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var s=o[n];t+=s}var i=t/this.executionResults.length;console.log(i+" ms for "+this.executionResults.length+" last runs."),this.executions=0,this.executionResults=[]}},e}(),ine=function(){function e(){}return e.createExperimentalFeaturesConfig=function(t){return t?(t.useBarCodeDetectorIfSupported!==!0&&(t.useBarCodeDetectorIfSupported=!1),t):{useBarCodeDetectorIfSupported:!1}},e}(),Pn;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(Pn||(Pn={}));var ane=function(){function e(){this.state=Pn.NOT_STARTED,this.onGoingTransactionNewState=Pn.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===Pn.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Pn.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===Pn.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Pn.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Pn.UNKNOWN)throw"Cannnot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case Pn.UNKNOWN:throw"Transition from unknown is not allowed";case Pn.NOT_STARTED:this.failIfNewStateIs(t,[Pn.PAUSED]);break;case Pn.SCANNING:break;case Pn.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,s=n;o<s.length;o++){var i=s[o];if(t===i)throw"Cannot transition from "+this.state+" to "+t}},e}(),lne=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===Pn.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==Pn.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Pn.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===Pn.PAUSED},e}(),une=function(){function e(){}return e.create=function(){return new lne(new ane)},e}(),cne=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(o[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),sr=function(e){cne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(Gr),dne=function(){function e(t,n){this.logger=n,this.fps=sr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=sr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?ZS.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!Aa(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),Ry=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.videoElement=null,this.localMediaStream=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id="+t+" not found";this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(this.verbose=n.verbose===!0,o=n.experimentalFeatures),this.logger=new qS(this.verbose),this.qrcode=new sne(this.getSupportedFormats(n),this.verbose,this.logger,ine.createExperimentalFeaturesConfig(o)),this.foreverScanTimeout,this.localMediaStream,this.shouldScan=!0,this.stateManagerProxy=une.create()}return e.prototype.start=function(t,n,o,s){if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";s||(s=this.verbose?this.logger.log:function(){});var i=dne.create(n,this.logger);this.clearElement();var l=!1;i.videoConstraints&&(i.isMediaStreamConstraintsValid()?l=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=l;i.isShadedBoxEnabled();var f=document.getElementById(this.elementId),p=f.clientWidth?f.clientWidth:sr.DEFAULT_WIDTH;f.style.position="relative",this.shouldScan=!0,this.element=f;var m=this,y=this.stateManagerProxy.startTransition(Pn.SCANNING);return new Promise(function(v,w){var E=c?i.videoConstraints:m.createVideoConstraints(t);if(!E){y.cancel(),w("videoConstraints should be defined");return}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!1,video:E}).then(function(I){m.onMediaStreamReceived(I,i,c,p,o,s).then(function(S){y.execute(),m.isScanning=!0,v(null)}).catch(function(S){y.cancel(),w(S)})}).catch(function(I){y.cancel(),w(Nl.errorGettingUserMedia(I))}):(y.cancel(),w(Nl.cameraStreamingNotSupported()))})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Pn.PAUSED),this.showPausedState(),(Aa(t)||t!==!0)&&(t=!1),t&&this.videoElement&&this.videoElement.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.videoElement)throw"VideoElement doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(Pn.SCANNING),t.hidePausedState()},o=this.videoElement.paused;if(!o){n();return}var s=function(){var i;setTimeout(n,200),(i=t.videoElement)===null||i===void 0||i.removeEventListener("playing",s)};this.videoElement.addEventListener("playing",s),this.videoElement.play()},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(Pn.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(!!t.element){var s=document.getElementById(sr.SHADED_REGION_ELEMENT_ID);s&&t.element.removeChild(s)}};return new Promise(function(s,i){var l=function(){t.localMediaStream=null,t.element&&(t.element.removeChild(t.videoElement),t.element.removeChild(t.canvasElement)),o(),t.qrRegion&&(t.qrRegion=null),t.context&&(t.context=null),n.execute(),t.hidePausedState(),t.isScanning=!1,s()};t.localMediaStream||l();var c=t.localMediaStream.getVideoTracks().length,f=0;t.localMediaStream.getVideoTracks().forEach(function(p){t.localMediaStream.removeTrack(p),p.stop(),++f,f>=c&&l()})})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Aa(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(s,i){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var l=new Image;l.onload=function(){var c=l.width,f=l.height,p=document.getElementById(o.elementId),m=p.clientWidth?p.clientWidth:sr.DEFAULT_WIDTH,y=Math.max(p.clientHeight?p.clientHeight:f,sr.FILE_SCAN_MIN_HEIGHT),v=o.computeCanvasDrawConfig(c,f,m,y);if(n){var w=o.createCanvasElement(m,y,"qr-canvas-visible");w.style.display="inline-block",p.appendChild(w);var E=w.getContext("2d");if(!E)throw"Unable to get 2d context from canvas";E.canvas.width=m,E.canvas.height=y,E.drawImage(l,0,0,c,f,v.x,v.y,v.width,v.height)}var I=o.createCanvasElement(v.width,v.height);p.appendChild(I);var S=I.getContext("2d");if(!S)throw"Unable to get 2d context from canvas";S.canvas.width=v.width,S.canvas.height=v.height,S.drawImage(l,0,0,c,f,0,0,v.width,v.height);try{o.qrcode.decodeAsync(I).then(function(T){s(Oy.createFromQrcodeResult(T))}).catch(i)}catch(T){i("QR code parse error, error = "+T)}},l.onerror=i,l.onabort=i,l.onstalled=i,l.onsuspend=i,l.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;if(MediaStreamTrack&&t.getSources)return e.getCamerasFromMediaStreamTrack();var n=function(){if(location.protocol==="https:")return!0;var s=location.host.split(":")[0];return s==="127.0.0.1"||s==="localhost"},o=Nl.unableToQuerySupportedDevices();return n()||(o=Nl.insecureContextCameraQueryError()),Promise.reject(o)},e.prototype.getRunningTrackCapabilities=function(){if(this.localMediaStream==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";var t=this.localMediaStream.getVideoTracks()[0];return t.getCapabilities()},e.prototype.applyVideoConstraints=function(t){var n=this;if(t){if(!ZS.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";if(this.localMediaStream===null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";return new Promise(function(o,s){if("aspectRatio"in t){s("Chaning 'aspectRatio' in run-time is not yet supported.");return}var i=n.localMediaStream.getVideoTracks()[0];i.applyConstraints(t).then(function(l){o(l)}).catch(function(l){s(l)})})},e.getCamerasFromMediaDevices=function(){return new Promise(function(t,n){navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(o){var s=function(i){for(var l=i.getVideoTracks(),c=0,f=l;c<f.length;c++){var p=f[c];p.enabled=!1,p.stop(),i.removeTrack(p)}};navigator.mediaDevices.enumerateDevices().then(function(i){for(var l=[],c=0,f=i;c<f.length;c++){var p=f[c];p.kind==="videoinput"&&l.push({id:p.deviceId,label:p.label})}s(o),t(l)}).catch(function(i){n(i.name+" : "+i.message)})}).catch(function(o){n(o.name+" : "+o.message)})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(i){for(var l=[],c=0,f=i;c<f.length;c++){var p=f[c];p.kind==="video"&&l.push({id:p.id,label:p.label})}t(l)},s=MediaStreamTrack;s.getSources(o)})},e.prototype.getSupportedFormats=function(t){var n=[Et.QR_CODE,Et.AZTEC,Et.CODABAR,Et.CODE_39,Et.CODE_93,Et.CODE_128,Et.DATA_MATRIX,Et.MAXICODE,Et.ITF,Et.EAN_13,Et.EAN_8,Et.PDF_417,Et.RSS_14,Et.RSS_EXPANDED,Et.UPC_A,Et.UPC_E,Et.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],s=0,i=t.formatsToSupport;s<i.length;s++){var l=i[s];Jte(l)?o.push(l):this.logger.warn("Invalid format: "+l+" passed in config, ignoring.")}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.validateQrboxSize=function(t,n,o){var s=this,i=o.qrbox;this.validateQrboxConfig(i);var l=this.toQrdimensions(t,n,i),c=function(p){if(p<sr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+(" "+sr.MIN_QR_BOX_SIZE+"px.")},f=function(p){return p>t&&(s.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."),p=t),p};c(l.width),c(l.height),l.width=f(l.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(s){throw new Error("qrbox config was passed as a function but it failed with unknown error"+s)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var s=Aa(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(s);var i=this.toQrdimensions(t,n,s);i.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var l=o.isShadedBoxEnabled()&&i.height<=n,c={x:0,y:0,width:t,height:n},f=l?this.getShadedRegionBounds(t,n,i):c,p=this.createCanvasElement(f.width,f.height),m=p.getContext("2d");m.canvas.width=f.width,m.canvas.height=f.height,this.element.append(p),l&&this.possiblyInsertShadingElement(this.element,t,n,i),this.createScannerPausedUiElement(this.element),this.qrRegion=f,this.context=m,this.canvasElement=p},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText="Scanner paused",n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="yellow",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(s){return t(s.text,Oy.createFromQrcodeResult(s)),o.possiblyUpdateShaders(!0),!0}).catch(function(s){o.possiblyUpdateShaders(!1);var i=Nl.codeParseError(s);return n(i,XS.createFrom(i)),!1})},e.prototype.foreverScan=function(t,n,o){var s=this;if(!!this.shouldScan&&!!this.localMediaStream){var i=this.videoElement,l=i.videoWidth/i.clientWidth,c=i.videoHeight/i.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var f=this.qrRegion.width*l,p=this.qrRegion.height*c,m=this.qrRegion.x*l,y=this.qrRegion.y*c;this.context.drawImage(i,m,y,f,p,0,0,this.qrRegion.width,this.qrRegion.height);var v=function(){s.foreverScanTimeout=setTimeout(function(){s.foreverScan(t,n,o)},s.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(w){!w&&t.disableFlip!==!0?(s.context.translate(s.context.canvas.width,0),s.context.scale(-1,1),s.scanContext(n,o).finally(function(){v()})):v()}).catch(function(w){s.logger.logError("Error happend while scanning context",w),v()})}},e.prototype.onMediaStreamReceived=function(t,n,o,s,i,l){var c=this,f=this;return new Promise(function(p,m){var y=function(){var E=c.createVideoElement(s);f.element.append(E),E.onabort=m,E.onerror=m;var I=function(){var S=E.clientWidth,T=E.clientHeight;f.setupUi(S,T,n),f.foreverScan(n,i,l),E.removeEventListener("playing",I),p(null)};E.addEventListener("playing",I),E.srcObject=t,E.play(),f.videoElement=E};if(f.localMediaStream=t,o||!n.aspectRatio)y();else{var v={aspectRatio:n.aspectRatio},w=t.getVideoTracks()[0];w.applyConstraints(v).then(function(E){return y()}).catch(function(E){f.logger.logErrors(["[Html5Qrcode] Constriants could not be satisfied, ignoring constraints",E]),y()})}})},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",s={user:!0,environment:!0},i="exact",l=function(E){if(E in s)return!0;throw"config has invalid 'facingMode' value = "+("'"+E+"'")},c=Object.keys(t);if(c.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+(" if passed as an object, found "+c.length+" keys");var f=Object.keys(t)[0];if(f!==n&&f!==o)throw"Only '"+n+"' and '"+o+"'  are supported for 'cameraIdOrConfig'";if(f===n){var p=t.facingMode;if(typeof p=="string"){if(l(p))return{facingMode:p}}else if(typeof p=="object")if(i in p){if(l(p[""+i]))return{facingMode:{exact:p[""+i]}}}else throw"'facingMode' should be string or object with"+(" "+i+" as key.");else{var m=typeof p;throw"Invalid type of 'facingMode' = "+m}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(i in y)return{deviceId:{exact:y[""+i]}};throw"'deviceId' should be string or object with"+(" "+i+" as key.")}else{var v=typeof y;throw"Invalid type of 'deviceId' = "+v}}}var w=typeof t;throw"Invalid type of 'cameraIdOrConfig' = "+w},e.prototype.computeCanvasDrawConfig=function(t,n,o,s){if(t<=o&&n<=s){var i=(o-t)/2,l=(s-n)/2;return{x:i,y:l,width:t,height:n}}else{var c=t,f=n;return t>o&&(n=o/t*n,t=o),n>s&&(t=s/n*t,n=s),this.logger.log("Image downsampled from "+(c+"X"+f)+(" to "+t+"X"+n+".")),this.computeCanvasDrawConfig(t,n,o,s)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width=t+"px",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?sr.BORDER_SHADER_MATCH_COLOR:sr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var s=t,i=n,l=document.createElement("canvas");return l.style.width=s+"px",l.style.height=i+"px",l.style.display="none",l.id=Aa(o)?"qr-canvas":o,l},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,s){if(!(n-s.width<1||o-s.height<1)){var i=document.createElement("div");i.style.position="absolute";var l=(n-s.width)/2,c=(o-s.height)/2;if(i.style.borderLeft=l+"px solid #0000007a",i.style.borderRight=l+"px solid #0000007a",i.style.borderTop=c+"px solid #0000007a",i.style.borderBottom=c+"px solid #0000007a",i.style.boxSizing="border-box",i.style.top="0px",i.style.bottom="0px",i.style.left="0px",i.style.right="0px",i.id=""+sr.SHADED_REGION_ELEMENT_ID,n-s.width<11||o-s.height<11)this.hasBorderShaders=!1;else{var f=5,p=40;this.insertShaderBorders(i,p,f,-f,0,!0),this.insertShaderBorders(i,p,f,-f,0,!1),this.insertShaderBorders(i,p,f,s.height+f,0,!0),this.insertShaderBorders(i,p,f,s.height+f,0,!1),this.insertShaderBorders(i,f,p+f,-f,-f,!0),this.insertShaderBorders(i,f,p+f,s.height+f-p,-f,!0),this.insertShaderBorders(i,f,p+f,-f,-f,!1),this.insertShaderBorders(i,f,p+f,s.height+f-p,-f,!1),this.hasBorderShaders=!0}t.append(i)}},e.prototype.insertShaderBorders=function(t,n,o,s,i,l){var c=document.createElement("div");c.style.position="absolute",c.style.backgroundColor=sr.BORDER_SHADER_DEFAULT_COLOR,c.style.width=n+"px",c.style.height=o+"px",c.style.top=s+"px",l?c.style.left=i+"px":c.style.right=i+"px",this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(c),t.appendChild(c)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),f1="data:image/svg+xml;base64,",fne=f1+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZX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zEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",pne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",Py=function(){function e(){}return e.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},e}(),gne=function(){function e(){this.data=Py.createDefault();var t=localStorage.getItem(e.LOCAL_STORAGE_KEY);t?this.data=JSON.parse(t):this.reset()}return e.prototype.hasCameraPermissions=function(){return this.data.hasPermission},e.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},e.prototype.setHasPermission=function(t){this.data.hasPermission=t,this.flush()},e.prototype.setLastUsedCameraId=function(t){this.data.lastUsedCameraId=t,this.flush()},e.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},e.prototype.reset=function(){this.data=Py.createDefault(),this.flush()},e.prototype.flush=function(){localStorage.setItem(e.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},e.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",e}(),mne=function(){function e(){this.infoDiv=document.createElement("div")}return e.prototype.renderInto=function(t){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid silver",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(248 248 248)",this.infoDiv.innerText=Dy.builtUsing();var n=document.createElement("a");n.innerText="html5-qrcode",n.href="https://github.com/mebjas/html5-qrcode",n.target="new",this.infoDiv.appendChild(n);var o=document.createElement("br"),s=document.createElement("br");this.infoDiv.appendChild(o),this.infoDiv.appendChild(s);var i=document.createElement("a");i.innerText=Dy.reportIssues(),i.href="https://github.com/mebjas/html5-qrcode/issues",i.target="new",this.infoDiv.appendChild(i),t.appendChild(this.infoDiv)},e.prototype.show=function(){this.infoDiv.style.display="block"},e.prototype.hide=function(){this.infoDiv.style.display="none"},e}(),vne=function(){function e(t,n){this.isShowingInfoIcon=!0,this.onTapIn=t,this.onTapOut=n,this.infoIcon=document.createElement("img")}return e.prototype.renderInto=function(t){var n=this;this.infoIcon.alt="Info icon",this.infoIcon.src=Ly,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(o){return n.onHoverIn()},this.infoIcon.onmouseout=function(o){return n.onHoverOut()},this.infoIcon.onclick=function(o){return n.onClick()},t.appendChild(this.infoIcon)},e.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},e.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},e.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src=pne,this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=Ly,this.infoIcon.style.opacity="0.6")},e}(),yne=function(){function e(){var t=this;this.infoDiv=new mne,this.infoIcon=new vne(function(){t.infoDiv.show()},function(){t.infoDiv.hide()})}return e.prototype.renderInto=function(t){this.infoDiv.renderInto(t),this.infoIcon.renderInto(t)},e}(),By=function(){function e(){}return e.hasCameraPermissions=function(){return new Promise(function(t,n){navigator.mediaDevices.enumerateDevices().then(function(o){o.forEach(function(s){s.kind==="videoinput"&&s.label&&t(!0)}),t(!1)})})},e}(),rs=function(){function e(t){this.supportedScanTypes=this.validateAndReturnScanTypes(t)}return e.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},e.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},e.prototype.isCameraScanRequired=function(){for(var t=0,n=this.supportedScanTypes;t<n.length;t++){var o=n[t];if(e.isCameraScanType(o))return!0}return!1},e.isCameraScanType=function(t){return t===Zs.SCAN_TYPE_CAMERA},e.isFileScanType=function(t){return t===Zs.SCAN_TYPE_FILE},e.prototype.validateAndReturnScanTypes=function(t){if(!t||t.length===0)return Gr.DEFAULT_SUPPORTED_SCAN_TYPE;var n=Gr.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(t.length>n)throw"Max "+n+" values expected for supportedScanTypes";for(var o=0,s=t;o<s.length;o++){var i=s[o];if(!Gr.DEFAULT_SUPPORTED_SCAN_TYPE.includes(i))throw"Unsupported scan type "+i}return t},e}(),ir;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(ir||(ir={}));function bne(e){return{fps:e.fps,qrbox:e.qrbox,aspectRatio:e.aspectRatio,disableFlip:e.disableFlip,videoConstraints:e.videoConstraints}}function wne(e,t){return{formatsToSupport:e.formatsToSupport,experimentalFeatures:e.experimentalFeatures,verbose:t}}var Cne=function(){function e(t,n,o){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.elementId=t,this.config=this.createConfig(n),this.verbose=o===!0,!document.getElementById(t))throw"HTML Element with id="+t+" not found";this.scanTypeSelector=new rs(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new qS(this.verbose),this.persistedDataManager=new gne,n.rememberLastUsedCamera!==!0&&this.persistedDataManager.reset()}return e.prototype.render=function(t,n){var o=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(i,l){if(t)t(i,l);else{if(o.lastMatchFound===i)return;o.lastMatchFound=i,o.setHeaderMessage(Ar.lastMatch(i),ir.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(i,l){n&&n(i,l)};var s=document.getElementById(this.elementId);if(!s)throw"HTML Element with id="+this.elementId+" not found";s.innerHTML="",this.createBasicLayout(s),this.html5Qrcode=new Ry(this.getScanRegionId(),wne(this.config,this.verbose))},e.prototype.pause=function(t){if(!this.html5Qrcode)throw"Code scanner not initialized.";(Aa(t)||t!==!0)&&(t=!1),this.html5Qrcode.pause(t)},e.prototype.resume=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";this.html5Qrcode.resume()},e.prototype.getState=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getState()},e.prototype.clear=function(){var t=this,n=function(){var o=document.getElementById(t.elementId);o&&(o.innerHTML="",t.resetBasicLayout(o))};return this.html5Qrcode?new Promise(function(o,s){if(!t.html5Qrcode){o();return}t.html5Qrcode.isScanning?t.html5Qrcode.stop().then(function(i){if(!t.html5Qrcode){o();return}t.html5Qrcode.clear(),n(),o()}).catch(function(i){t.verbose&&t.logger.logError("Unable to stop qrcode scanner",i),s(i)}):(t.html5Qrcode.clear(),n())}):Promise.resolve()},e.prototype.getRunningTrackCapabilities=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getRunningTrackCapabilities()},e.prototype.applyVideoConstraints=function(t){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.applyVideoConstraints(t)},e.prototype.createConfig=function(t){return t?(t.fps||(t.fps=Gr.SCAN_DEFAULT_FPS),t.rememberLastUsedCamera!==!Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED&&(t.rememberLastUsedCamera=Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED),t):{fps:Gr.SCAN_DEFAULT_FPS,rememberLastUsedCamera:Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:Gr.DEFAULT_SUPPORTED_SCAN_TYPE}},e.prototype.createBasicLayout=function(t){t.style.position="relative",t.style.padding="0px",t.style.border="1px solid silver",this.createHeader(t);var n=document.createElement("div"),o=this.getScanRegionId();n.id=o,n.style.width="100%",n.style.minHeight="100px",n.style.textAlign="center",t.appendChild(n),rs.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var s=document.createElement("div"),i=this.getDashboardId();s.id=i,s.style.width="100%",t.appendChild(s),this.setupInitialDashboard(s)},e.prototype.resetBasicLayout=function(t){t.style.border="none"},e.prototype.setupInitialDashboard=function(t){this.createSection(t),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},e.prototype.createHeader=function(t){var n=document.createElement("div");n.style.textAlign="left",n.style.margin="0px",t.appendChild(n);var o=new yne;o.renderInto(n);var s=document.createElement("div");s.id=this.getHeaderMessageContainerId(),s.style.display="none",s.style.textAlign="center",s.style.fontSize="14px",s.style.padding="2px 10px",s.style.margin="4px",s.style.borderTop="1px solid #f6f6f6",n.appendChild(s)},e.prototype.createSection=function(t){var n=document.createElement("div");n.id=this.getDashboardSectionId(),n.style.width="100%",n.style.padding="10px 0px 10px 0px",n.style.textAlign="left",t.appendChild(n)},e.prototype.createCameraListUi=function(t,n,o){var s=this;s.setHeaderMessage(Ar.cameraPermissionRequesting());var i=function(){o||s.createPermissionButton(t,n)};Ry.getCameras().then(function(l){s.persistedDataManager.setHasPermission(!0),s.resetHeaderMessage(),l&&l.length>0?(t.removeChild(n),s.renderCameraSelection(l)):(s.setHeaderMessage(Ar.noCameraFound(),ir.STATUS_WARNING),i())}).catch(function(l){s.persistedDataManager.setHasPermission(!1),o?o.disabled=!1:i(),s.setHeaderMessage(l,ir.STATUS_WARNING)})},e.prototype.createPermissionButton=function(t,n){var o=this,s=document.createElement("button");s.id=this.getCameraPermissionButtonId(),s.innerText=Ar.cameraPermissionTitle(),s.addEventListener("click",function(){s.disabled=!0,o.createCameraListUi(t,n,s)}),n.appendChild(s)},e.prototype.createPermissionsUi=function(t,n){var o=this;if(rs.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()){By.hasCameraPermissions().then(function(s){s?o.createCameraListUi(t,n):(o.persistedDataManager.setHasPermission(!1),o.createPermissionButton(t,n))}).catch(function(s){o.persistedDataManager.setHasPermission(!1),o.createPermissionButton(t,n)});return}this.createPermissionButton(t,n)},e.prototype.createSectionControlPanel=function(){var t=document.getElementById(this.getDashboardSectionId()),n=document.createElement("div");t.appendChild(n);var o=document.createElement("div");o.id=this.getDashboardSectionCameraScanRegionId(),o.style.display=rs.isCameraScanType(this.currentScanType)?"block":"none",n.appendChild(o);var s=document.createElement("div");s.style.textAlign="center",o.appendChild(s),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(o,s),this.renderFileScanUi(n)},e.prototype.renderFileScanUi=function(t){var n=this,o=document.createElement("div");o.id=this.getDashboardSectionFileScanRegionId(),o.style.textAlign="center",o.style.display=rs.isCameraScanType(this.currentScanType)?"none":"block",t.appendChild(o);var s=document.createElement("input");s.id=this.getFileScanInputId(),s.accept="image/*",s.type="file",s.style.width="200px",s.disabled=rs.isCameraScanType(this.currentScanType);var i=document.createElement("span");i.innerText=" Select Image",o.appendChild(s),o.appendChild(i),s.addEventListener("change",function(l){if(!n.html5Qrcode)throw"html5Qrcode not defined";if(!(l==null||l.target==null)&&!!rs.isFileScanType(n.currentScanType)&&l.target.files.length!==0){var c=l.target.files[0];n.html5Qrcode.scanFileV2(c,!0).then(function(f){n.resetHeaderMessage(),n.qrCodeSuccessCallback(f.decodedText,f)}).catch(function(f){n.setHeaderMessage(f,ir.STATUS_WARNING),n.qrCodeErrorCallback(f,XS.createFrom(f))})}})},e.prototype.renderCameraSelection=function(t){var n=this,o=this,s=document.getElementById(this.getDashboardSectionCameraScanRegionId());s.style.textAlign="center";var i=document.createElement("span");i.style.marginRight="10px";var l=t.length,c=document.createElement("select");if(l===1)c.style.display="none";else{var f=Ar.selectCamera();i.innerText=f+" ("+t.length+")  "}c.id=this.getCameraSelectionId();for(var p=[],m=0,y=t;m<y.length;m++){var v=y[m],w=v.id,E=v.label==null?w:v.label,I=document.createElement("option");I.value=w,I.innerText=E,p.push(I),c.appendChild(I)}i.appendChild(c),s.appendChild(i);var S=document.createElement("span"),T=document.createElement("button");T.innerText=Ar.scanButtonStartScanningText(),S.appendChild(T);var _=document.createElement("button");_.innerText=Ar.scanButtonStopScanningText(),_.style.display="none",_.disabled=!0,S.appendChild(_),s.appendChild(S);var N=function(B){B||(T.style.display="none"),T.innerText=Ar.scanButtonStartScanningText(),T.style.opacity="1",T.disabled=!1,B&&(T.style.display="inline-block")};if(T.addEventListener("click",function(B){T.innerText=Ar.scanButtonScanningStarting(),c.disabled=!0,T.disabled=!0,T.style.opacity="0.5",n.scanTypeSelector.hasMoreThanOneScanType()&&o.showHideScanTypeSwapLink(!1),o.resetHeaderMessage();var Y=c.value;o.persistedDataManager.setLastUsedCameraId(Y),o.html5Qrcode.start(Y,bne(o.config),o.qrCodeSuccessCallback,o.qrCodeErrorCallback).then(function(X){_.disabled=!1,_.style.display="inline-block",N(!1)}).catch(function(X){o.showHideScanTypeSwapLink(!0),c.disabled=!1,N(!0),o.setHeaderMessage(X,ir.STATUS_WARNING)})}),l===1&&T.click(),_.addEventListener("click",function(B){if(!o.html5Qrcode)throw"html5Qrcode not defined";_.disabled=!0,o.html5Qrcode.stop().then(function(Y){n.scanTypeSelector.hasMoreThanOneScanType()&&o.showHideScanTypeSwapLink(!0),c.disabled=!1,T.disabled=!1,_.style.display="none",T.style.display="inline-block",o.insertCameraScanImageToScanRegion()}).catch(function(Y){_.disabled=!1,o.setHeaderMessage(Y,ir.STATUS_WARNING)})}),o.persistedDataManager.getLastUsedCameraId()){for(var O=o.persistedDataManager.getLastUsedCameraId(),D=!1,x=0,R=p;x<R.length;x++){var I=R[x];if(I.value===O){D=!0;break}}D?(c.value=O,T.click()):o.persistedDataManager.resetLastUsedCameraId()}},e.prototype.createSectionSwap=function(){var t=this,n=Ar.textIfCameraScanSelected(),o=Ar.textIfFileScanSelected(),s=document.getElementById(this.getDashboardSectionId()),i=document.createElement("div");i.style.textAlign="center";var l=document.createElement("a");l.style.textDecoration="underline",l.id=this.getDashboardSectionSwapLinkId(),l.innerText=rs.isCameraScanType(this.currentScanType)?n:o,l.addEventListener("click",function(){if(!t.sectionSwapAllowed){t.verbose&&t.logger.logError("Section swap called when not allowed");return}t.resetHeaderMessage(),t.getFileScanInput().value="",t.sectionSwapAllowed=!1,rs.isCameraScanType(t.currentScanType)?(t.clearScanRegion(),t.getFileScanInput().disabled=!1,t.getCameraScanRegion().style.display="none",t.getFileScanRegion().style.display="block",l.innerText=o,t.currentScanType=Zs.SCAN_TYPE_FILE,t.insertFileScanImageToScanRegion()):(t.clearScanRegion(),t.getFileScanInput().disabled=!0,t.getCameraScanRegion().style.display="block",t.getFileScanRegion().style.display="none",l.innerText=n,t.currentScanType=Zs.SCAN_TYPE_CAMERA,t.insertCameraScanImageToScanRegion(),t.startCameraScanIfPermissionExistsOnSwap()),t.sectionSwapAllowed=!0}),i.appendChild(l),s.appendChild(i)},e.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var t=this,n=this;if(this.persistedDataManager.hasCameraPermissions()){By.hasCameraPermissions().then(function(o){if(o){var s=document.getElementById(n.getCameraPermissionButtonId());if(!s)throw t.logger.logError("Permission button not found, fail;"),"Permission button not found";s.click()}else n.persistedDataManager.setHasPermission(!1)}).catch(function(o){n.persistedDataManager.setHasPermission(!1)});return}},e.prototype.resetHeaderMessage=function(){var t=document.getElementById(this.getHeaderMessageContainerId());t.style.display="none"},e.prototype.setHeaderMessage=function(t,n){n||(n=ir.STATUS_DEFAULT);var o=this.getHeaderMessageDiv();switch(o.innerText=t,o.style.display="block",n){case ir.STATUS_SUCCESS:o.style.background="#6aaf5042",o.style.color="#477735";break;case ir.STATUS_WARNING:o.style.background="#cb243124",o.style.color="#cb2431";break;case ir.STATUS_DEFAULT:default:o.style.background="#00000000",o.style.color="rgb(17, 17, 17)";break}},e.prototype.showHideScanTypeSwapLink=function(t){t!==!0&&(t=!1),this.sectionSwapAllowed=t,this.getDashboardSectionSwapLink().style.display=t?"inline-block":"none"},e.prototype.insertCameraScanImageToScanRegion=function(){var t=this,n=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){n.innerHTML="<br>",n.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(o){n.innerHTML="<br>",n.appendChild(t.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=fne},e.prototype.insertFileScanImageToScanRegion=function(){var t=this,n=document.getElementById(this.getScanRegionId());if(this.fileScanImage){n.innerHTML="<br>",n.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(o){n.innerHTML="<br>",n.appendChild(t.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=hne},e.prototype.clearScanRegion=function(){var t=document.getElementById(this.getScanRegionId());t.innerHTML=""},e.prototype.getDashboardSectionId=function(){return this.elementId+"__dashboard_section"},e.prototype.getDashboardSectionCameraScanRegionId=function(){return this.elementId+"__dashboard_section_csr"},e.prototype.getDashboardSectionFileScanRegionId=function(){return this.elementId+"__dashboard_section_fsr"},e.prototype.getDashboardSectionSwapLinkId=function(){return this.elementId+"__dashboard_section_swaplink"},e.prototype.getScanRegionId=function(){return this.elementId+"__scan_region"},e.prototype.getDashboardId=function(){return this.elementId+"__dashboard"},e.prototype.getFileScanInputId=function(){return this.elementId+"__filescan_input"},e.prototype.getStatusSpanId=function(){return this.elementId+"__status_span"},e.prototype.getHeaderMessageContainerId=function(){return this.elementId+"__header_message"},e.prototype.getCameraSelectionId=function(){return this.elementId+"__camera_selection"},e.prototype.getCameraPermissionButtonId=function(){return this.elementId+"__camera_permission_button"},e.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},e.prototype.getFileScanRegion=function(){return document.getElementById(this.getDashboardSectionFileScanRegionId())},e.prototype.getFileScanInput=function(){return document.getElementById(this.getFileScanInputId())},e.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},e.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},e}();const Ene={id:"qr-code-full-region"},Sne=ve({props:{qrbox:null,fps:null},emits:["decodedCode"],setup(e,{emit:t}){const n=e;var o={fps:n.fps?n.fps:10};let s="";n.qrbox&&(o.qrbox=n.qrbox);let i=null;function l(p,m){s!==p&&(s=p,t("decodedCode",p,m))}function c(p,m){}async function f(){await dt(),i=new Cne("qr-code-full-region",o,void 0),i.render(l,c)}return f(),(p,m)=>(M(),W("div",Ene))}}),Ane=Ht(" \u4EBA\u6578\uFF1A "),Tne={id:"section",class:"section",style:{width:"70%",margin:"auto"}},Ine=Ht("\u6309\u6211\u50B3\u9001\u7C21\u8A0A "),_ne=ve({setup(e){let t=F(""),n=F(1),o=F("");var s=navigator.userAgent,i=s.indexOf("Android")>-1||s.indexOf("Adr")>-1,l=!!s.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);const c=function(y,v){y.includes("1922:")?f(y):t.value=`\u5167\u5BB9:${y}`};function f(y){let w=y.split("1922:")[1];t.value=`\u5167\u5BB9:${w}`,o.value=w;let E=document.getElementById("Btn_Open");E.style.display="inline",p()}function p(){let y="";n.value>1&&(y=`+${n.value-1}`),i?window.open(`sms:1922?&amp;body=${o.value}${y}`,"_self"):l?window.open(`sms:1922&body=${o.value}${y}`,"_self"):alert(`sms:1922&body=${o.value}${y}`)}async function m(){await dt();let y=document.getElementById("Btn_Open");if(y.style.display="none",!i&&!l){let v=document.getElementById("section");v.style.width="500px"}}return m(),(y,v)=>{const w=Ae("el-input-number"),E=Ae("el-button");return M(),W(at,null,[Q("div",null,[Ane,le(w,{modelValue:k(n),"onUpdate:modelValue":v[0]||(v[0]=I=>wn(n)?n.value=I:n=I),min:1,size:"large"},null,8,["modelValue"])]),Q("div",Tne,[le(Sne,{qrbox:200,fps:10,onDecodedCode:c})]),Q("div",null,Pe(k(t)),1),le(E,{id:"Btn_Open",type:"success",onClick:v[1]||(v[1]=()=>{p()}),size:"large",round:""},{default:ae(()=>[Ine]),_:1})],64)}}}),Nne=ve({setup(e){return(t,n)=>(M(),me(_ne))}});X2(Nne).use(Zte,{locale:Qte}).mount("#app")});export default kne();
+`);let u=A1.singletonList(Ur.INITIAL_STATE);for(let h=0;h<this.text.length;h++){let g,b=h+1<this.text.length?this.text[h+1]:0;switch(this.text[h]){case K.getCharCode("\r"):g=b===a?2:0;break;case K.getCharCode("."):g=b===r?3:0;break;case K.getCharCode(","):g=b===r?4:0;break;case K.getCharCode(":"):g=b===r?5:0;break;default:g=0}g>0?(u=vl.updateStateListForPair(u,h,g),h++):u=this.updateStateListForChar(u,h)}return A1.min(u,(h,g)=>h.getBitCount()-g.getBitCount()).toBitArray(this.text)}updateStateListForChar(r,a){const u=[];for(let d of r)this.updateStateForChar(d,a,u);return vl.simplifyStates(u)}updateStateForChar(r,a,u){let d=this.text[a]&255,h=Cf[r.getMode()][d]>0,g=null;for(let b=0;b<=zr;b++){let C=Cf[b][d];if(C>0){if(g==null&&(g=r.endBinaryShift(a)),!h||b===r.getMode()||b===or){const A=g.latchAndAppend(b,C);u.push(A)}if(!h&&I1[r.getMode()][b]>=0){const A=g.shiftAndAppend(b,C);u.push(A)}}}if(r.getBinaryShiftByteCount()>0||Cf[r.getMode()][d]===0){let b=r.addBinaryShiftChar(a);u.push(b)}}static updateStateListForPair(r,a,u){const d=[];for(let h of r)this.updateStateForPair(h,a,u,d);return this.simplifyStates(d)}static updateStateForPair(r,a,u,d){let h=r.endBinaryShift(a);if(d.push(h.latchAndAppend(zr,u)),r.getMode()!==zr&&d.push(h.shiftAndAppend(zr,u)),u===3||u===4){let g=h.latchAndAppend(or,16-u).latchAndAppend(or,1);d.push(g)}if(r.getBinaryShiftByteCount()>0){let g=r.addBinaryShiftChar(a).addBinaryShiftChar(a+1);d.push(g)}}static simplifyStates(r){let a=[];for(const u of r){let d=!0;for(const h of a){if(h.isBetterThanOrEqualTo(u)){d=!1;break}u.isBetterThanOrEqualTo(h)&&(a=a.filter(g=>g!==h))}d&&a.push(u)}return a}}class dn{constructor(){}static encodeBytes(r){return dn.encode(r,dn.DEFAULT_EC_PERCENT,dn.DEFAULT_AZTEC_LAYERS)}static encode(r,a,u){let d=new vl(r).encode(),h=_.truncDivision(d.getSize()*a,100)+11,g=d.getSize()+h,b,C,A,L,U;if(u!==dn.DEFAULT_AZTEC_LAYERS){if(b=u<0,C=Math.abs(u),C>(b?dn.MAX_NB_BITS_COMPACT:dn.MAX_NB_BITS))throw new m(K.format("Illegal value %s for layers",u));A=dn.totalBitsInLayer(C,b),L=dn.WORD_SIZE[C];let lt=A-A%L;if(U=dn.stuffBits(d,L),U.getSize()+h>lt)throw new m("Data to large for user specified layer");if(b&&U.getSize()>L*64)throw new m("Data to large for user specified layer")}else{L=0,U=null;for(let lt=0;;lt++){if(lt>dn.MAX_NB_BITS)throw new m("Data too large for an Aztec code");if(b=lt<=3,C=b?lt+1:lt,A=dn.totalBitsInLayer(C,b),g>A)continue;(U==null||L!==dn.WORD_SIZE[C])&&(L=dn.WORD_SIZE[C],U=dn.stuffBits(d,L));let rn=A-A%L;if(!(b&&U.getSize()>L*64)&&U.getSize()+h<=rn)break}}let Z=dn.generateCheckWords(U,A,L),se=U.getSize()/L,ye=dn.generateModeMessage(b,C,se),Ce=(b?11:14)+C*4,Oe=new Int32Array(Ce),Ke;if(b){Ke=Ce;for(let lt=0;lt<Oe.length;lt++)Oe[lt]=lt}else{Ke=Ce+1+2*_.truncDivision(_.truncDivision(Ce,2)-1,15);let lt=_.truncDivision(Ce,2),rn=_.truncDivision(Ke,2);for(let qt=0;qt<lt;qt++){let _o=qt+_.truncDivision(qt,15);Oe[lt-qt-1]=rn-_o-1,Oe[lt+qt]=rn+_o+1}}let ft=new G(Ke);for(let lt=0,rn=0;lt<C;lt++){let qt=(C-lt)*4+(b?9:12);for(let _o=0;_o<qt;_o++){let Er=_o*2;for(let No=0;No<2;No++)Z.get(rn+Er+No)&&ft.set(Oe[lt*2+No],Oe[lt*2+_o]),Z.get(rn+qt*2+Er+No)&&ft.set(Oe[lt*2+_o],Oe[Ce-1-lt*2-No]),Z.get(rn+qt*4+Er+No)&&ft.set(Oe[Ce-1-lt*2-No],Oe[Ce-1-lt*2-_o]),Z.get(rn+qt*6+Er+No)&&ft.set(Oe[Ce-1-lt*2-_o],Oe[lt*2+No])}rn+=qt*8}if(dn.drawModeMessage(ft,b,Ke,ye),b)dn.drawBullsEye(ft,_.truncDivision(Ke,2),5);else{dn.drawBullsEye(ft,_.truncDivision(Ke,2),7);for(let lt=0,rn=0;lt<_.truncDivision(Ce,2)-1;lt+=15,rn+=16)for(let qt=_.truncDivision(Ke,2)&1;qt<Ke;qt+=2)ft.set(_.truncDivision(Ke,2)-rn,qt),ft.set(_.truncDivision(Ke,2)+rn,qt),ft.set(qt,_.truncDivision(Ke,2)-rn),ft.set(qt,_.truncDivision(Ke,2)+rn)}let ht=new S1;return ht.setCompact(b),ht.setSize(Ke),ht.setLayers(C),ht.setCodeWords(se),ht.setMatrix(ft),ht}static drawBullsEye(r,a,u){for(let d=0;d<u;d+=2)for(let h=a-d;h<=a+d;h++)r.set(h,a-d),r.set(h,a+d),r.set(a-d,h),r.set(a+d,h);r.set(a-u,a-u),r.set(a-u+1,a-u),r.set(a-u,a-u+1),r.set(a+u,a-u),r.set(a+u,a-u+1),r.set(a+u,a+u-1)}static generateModeMessage(r,a,u){let d=new N;return r?(d.appendBits(a-1,2),d.appendBits(u-1,6),d=dn.generateCheckWords(d,28,4)):(d.appendBits(a-1,5),d.appendBits(u-1,11),d=dn.generateCheckWords(d,40,4)),d}static drawModeMessage(r,a,u,d){let h=_.truncDivision(u,2);if(a)for(let g=0;g<7;g++){let b=h-3+g;d.get(g)&&r.set(b,h-5),d.get(g+7)&&r.set(h+5,b),d.get(20-g)&&r.set(b,h+5),d.get(27-g)&&r.set(h-5,b)}else for(let g=0;g<10;g++){let b=h-5+g+_.truncDivision(g,5);d.get(g)&&r.set(b,h-7),d.get(g+10)&&r.set(h+7,b),d.get(29-g)&&r.set(b,h+7),d.get(39-g)&&r.set(h-7,b)}}static generateCheckWords(r,a,u){let d=r.getSize()/u,h=new mf(dn.getGF(u)),g=_.truncDivision(a,u),b=dn.bitsToWords(r,u,g);h.encode(b,g-d);let C=a%u,A=new N;A.appendBits(0,C);for(const L of Array.from(b))A.appendBits(L,u);return A}static bitsToWords(r,a,u){let d=new Int32Array(u),h,g;for(h=0,g=r.getSize()/a;h<g;h++){let b=0;for(let C=0;C<a;C++)b|=r.get(h*a+C)?1<<a-C-1:0;d[h]=b}return d}static getGF(r){switch(r){case 4:return ot.AZTEC_PARAM;case 6:return ot.AZTEC_DATA_6;case 8:return ot.AZTEC_DATA_8;case 10:return ot.AZTEC_DATA_10;case 12:return ot.AZTEC_DATA_12;default:throw new m("Unsupported word size "+r)}}static stuffBits(r,a){let u=new N,d=r.getSize(),h=(1<<a)-2;for(let g=0;g<d;g+=a){let b=0;for(let C=0;C<a;C++)(g+C>=d||r.get(g+C))&&(b|=1<<a-1-C);(b&h)===h?(u.appendBits(b&h,a),g--):(b&h)===0?(u.appendBits(b|1,a),g--):u.appendBits(b,a)}return u}static totalBitsInLayer(r,a){return((a?88:112)+16*r)*r}}dn.DEFAULT_EC_PERCENT=33,dn.DEFAULT_AZTEC_LAYERS=0,dn.MAX_NB_BITS=32,dn.MAX_NB_BITS_COMPACT=4,dn.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class zu{encode(r,a,u,d){return this.encodeWithHints(r,a,u,d,null)}encodeWithHints(r,a,u,d,h){let g=yf.ISO_8859_1,b=dn.DEFAULT_EC_PERCENT,C=dn.DEFAULT_AZTEC_LAYERS;return h!=null&&(h.has(jn.CHARACTER_SET)&&(g=E1.forName(h.get(jn.CHARACTER_SET).toString())),h.has(jn.ERROR_CORRECTION)&&(b=_.parseInt(h.get(jn.ERROR_CORRECTION).toString())),h.has(jn.AZTEC_LAYERS)&&(C=_.parseInt(h.get(jn.AZTEC_LAYERS).toString()))),zu.encodeLayers(r,a,u,d,g,b,C)}static encodeLayers(r,a,u,d,h,g,b){if(a!==xe.AZTEC)throw new m("Can only encode AZTEC, but got "+a);let C=dn.encode(K.getBytes(r,h),g,b);return zu.renderResult(C,u,d)}static renderResult(r,a,u){let d=r.getMatrix();if(d==null)throw new de;let h=d.getWidth(),g=d.getHeight(),b=Math.max(a,h),C=Math.max(u,g),A=Math.min(b/h,C/g),L=(b-h*A)/2,U=(C-g*A)/2,Z=new G(b,C);for(let se=0,ye=U;se<g;se++,ye+=A)for(let Ce=0,Oe=L;Ce<h;Ce++,Oe+=A)d.get(Ce,se)&&Z.setRegion(Oe,ye,A,A);return Z}}n.ArgumentException=p,n.ArithmeticException=mt,n.AztecCode=S1,n.AztecCodeReader=Fe,n.AztecCodeWriter=zu,n.AztecDecoder=ke,n.AztecDetector=we,n.AztecDetectorResult=Te,n.AztecEncoder=dn,n.AztecHighLevelEncoder=vl,n.AztecPoint=tt,n.BarcodeFormat=xe,n.Binarizer=w,n.BinaryBitmap=y,n.BitArray=N,n.BitMatrix=G,n.BitSource=cf,n.BrowserAztecCodeReader=_e,n.BrowserBarcodeReader=o3,n.BrowserCodeReader=Se,n.BrowserDatamatrixCodeReader=s3,n.BrowserMultiFormatReader=m3,n.BrowserPDF417Reader=v3,n.BrowserQRCodeReader=y3,n.BrowserQRCodeSvgWriter=ii,n.CharacterSetECI=B,n.ChecksumException=v,n.Code128Reader=Le,n.Code39Reader=Mt,n.DataMatrixDecodedBitStreamParser=Ts,n.DataMatrixReader=Is,n.DecodeHintType=D,n.DecoderResult=We,n.DefaultGridSampler=pt,n.DetectorResult=ge,n.EAN13Reader=go,n.EncodeHintType=jn,n.Exception=f,n.FormatException=x,n.GenericGF=ot,n.GenericGFPoly=Ze,n.GlobalHistogramBinarizer=ee,n.GridSampler=he,n.GridSamplerInstance=At,n.HTMLCanvasElementLuminanceSource=ce,n.HybridBinarizer=j,n.ITFReader=Nt,n.IllegalArgumentException=m,n.IllegalStateException=de,n.InvertedLuminanceSource=q,n.LuminanceSource=V,n.MathUtils=Ve,n.MultiFormatOneDReader=ra,n.MultiFormatReader=C1,n.MultiFormatWriter=w3,n.NotFoundException=z,n.OneDReader=Ye,n.PDF417DecodedBitStreamParser=je,n.PDF417DecoderErrorCorrection=g1,n.PDF417Reader=no,n.PDF417ResultMetadata=v1,n.PerspectiveTransform=He,n.PlanarYUVLuminanceSource=Hr,n.QRCodeByteMatrix=Vu,n.QRCodeDataMask=tr,n.QRCodeDecodedBitStreamParser=Mn,n.QRCodeDecoderErrorCorrectionLevel=Cn,n.QRCodeDecoderFormatInformation=ho,n.QRCodeEncoder=Nn,n.QRCodeEncoderQRCode=si,n.QRCodeMaskUtil=Ln,n.QRCodeMatrixUtil=Lt,n.QRCodeMode=Rt,n.QRCodeReader=_s,n.QRCodeVersion=xt,n.QRCodeWriter=ia,n.RGBLuminanceSource=vf,n.RSS14Reader=Rn,n.RSSExpandedReader=nt,n.ReaderException=Fu,n.ReedSolomonDecoder=Ne,n.ReedSolomonEncoder=mf,n.ReedSolomonException=te,n.Result=Ee,n.ResultMetadataType=Me,n.ResultPoint=re,n.StringUtils=K,n.UnsupportedOperationException=Y,n.VideoInputDevice=ue,n.WhiteRectangleDetector=Je,n.WriterException=vn,n.ZXingArrays=T,n.ZXingCharset=E1,n.ZXingInteger=_,n.ZXingStandardCharsets=yf,n.ZXingStringBuilder=J,n.ZXingStringEncoding=X,n.ZXingSystem=E,Object.defineProperty(n,"__esModule",{value:!0})})})(Sn,Sn.exports);var ene=MC(Sn.exports),tne=D3({__proto__:null,default:ene},[Sn.exports]),nne=function(){function e(t,n,o){if(this.formatMap=new Map([[Et.QR_CODE,Sn.exports.BarcodeFormat.QR_CODE],[Et.AZTEC,Sn.exports.BarcodeFormat.AZTEC],[Et.CODABAR,Sn.exports.BarcodeFormat.CODABAR],[Et.CODE_39,Sn.exports.BarcodeFormat.CODE_39],[Et.CODE_93,Sn.exports.BarcodeFormat.CODE_93],[Et.CODE_128,Sn.exports.BarcodeFormat.CODE_128],[Et.DATA_MATRIX,Sn.exports.BarcodeFormat.DATA_MATRIX],[Et.MAXICODE,Sn.exports.BarcodeFormat.MAXICODE],[Et.ITF,Sn.exports.BarcodeFormat.ITF],[Et.EAN_13,Sn.exports.BarcodeFormat.EAN_13],[Et.EAN_8,Sn.exports.BarcodeFormat.EAN_8],[Et.PDF_417,Sn.exports.BarcodeFormat.PDF_417],[Et.RSS_14,Sn.exports.BarcodeFormat.RSS_14],[Et.RSS_EXPANDED,Sn.exports.BarcodeFormat.RSS_EXPANDED],[Et.UPC_A,Sn.exports.BarcodeFormat.UPC_A],[Et.UPC_E,Sn.exports.BarcodeFormat.UPC_E],[Et.UPC_EAN_EXTENSION,Sn.exports.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!tne)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=n,this.logger=o;var s=this.createZXingFormats(t),i=new Map;i.set(Sn.exports.DecodeHintType.POSSIBLE_FORMATS,s),this.hints=i}return e.prototype.decodeAsync=function(t){var n=this;return new Promise(function(o,s){try{o(n.decode(t))}catch(i){s(i)}})},e.prototype.decode=function(t){var n=new Sn.exports.MultiFormatReader(this.verbose,this.hints),o=new Sn.exports.HTMLCanvasElementLuminanceSource(t),s=new Sn.exports.BinaryBitmap(new Sn.exports.HybridBinarizer(o)),i=n.decode(s);return{text:i.text,format:GS.create(this.toHtml5QrcodeSupportedFormats(i.format))}},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,s){t.set(n,o)}),t},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have "+t;return this.reverseFormatMap.get(t)},e.prototype.createZXingFormats=function(t){for(var n=[],o=0,s=t;o<s.length;o++){var i=s[o];this.formatMap.has(i)?n.push(this.formatMap.get(i)):this.logger.logError(i+" is not supported byZXingHtml5QrcodeShim")}return n},e}(),one=globalThis&&globalThis.__awaiter||function(e,t,n,o){function s(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function c(m){try{p(o.next(m))}catch(y){l(y)}}function f(m){try{p(o.throw(m))}catch(y){l(y)}}function p(m){m.done?i(m.value):s(m.value).then(c,f)}p((o=o.apply(e,t||[])).next())})},rne=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,s,i,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(p){return function(m){return f([p,m])}}function f(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,s&&(i=p[0]&2?s.return:p[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,p[1])).done)return i;switch(s=0,i&&(p=[p[0]&2,i.value]),p[0]){case 0:case 1:i=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,s=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!i||p[1]>i[0]&&p[1]<i[3])){n.label=p[1];break}if(p[0]===6&&n.label<i[1]){n.label=i[1],i=p;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(p);break}i[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(m){p=[6,m],s=0}finally{o=i=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},$y=function(){function e(t,n,o){if(this.formatMap=new Map([[Et.QR_CODE,"qr_code"],[Et.AZTEC,"aztec"],[Et.CODABAR,"codabar"],[Et.CODE_39,"code_39"],[Et.CODE_93,"code_93"],[Et.CODE_128,"code_128"],[Et.DATA_MATRIX,"data_matrix"],[Et.ITF,"itf"],[Et.EAN_13,"ean_13"],[Et.EAN_8,"ean_8"],[Et.PDF_417,"pdf417"],[Et.UPC_A,"upc_a"],[Et.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=o;var s=this.createBarcodeDetectorFormats(t);if(this.detector=new BarcodeDetector(s),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var t=new BarcodeDetector({formats:["qr_code"]});return typeof t!="undefined"},e.prototype.decodeAsync=function(t){return one(this,void 0,void 0,function(){var n,o;return rne(this,function(s){switch(s.label){case 0:return[4,this.detector.detect(t)];case 1:if(n=s.sent(),!n||n.length===0)throw"No barcode or QR code detected.";return o=this.selectLargestBarcode(n),[2,{text:o.rawValue,format:GS.create(this.toHtml5QrcodeSupportedFormats(o.format))}]}})})},e.prototype.selectLargestBarcode=function(t){for(var n=null,o=0,s=0,i=t;s<i.length;s++){var l=i[s],c=l.boundingBox.width*l.boundingBox.height;c>o&&(o=c,n=l)}if(!n)throw"No largest barcode found";return n},e.prototype.createBarcodeDetectorFormats=function(t){for(var n=[],o=0,s=t;o<s.length;o++){var i=s[o];this.formatMap.has(i)?n.push(this.formatMap.get(i)):this.logger.warn(i+" is not supported byBarcodeDetectorDelegate")}return{formats:n}},e.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have "+t;return this.reverseFormatMap.get(t)},e.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(n,o,s){t.set(n,o)}),t},e}(),sne=function(){function e(t,n,o,s){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.verbose=n,s.useBarCodeDetectorIfSupported===!0&&$y.isSupported()?this.decoder=new $y(t,n,o):this.decoder=new nne(t,n,o)}return e.prototype.decodeAsync=function(t){var n=this,o=performance.now();return this.decoder.decodeAsync(t).finally(function(){if(n.verbose){var s=performance.now()-o;n.executionResults.push(s),n.executions++,n.possiblyFlushPerformanceReport()}})},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,n=0,o=this.executionResults;n<o.length;n++){var s=o[n];t+=s}var i=t/this.executionResults.length;console.log(i+" ms for "+this.executionResults.length+" last runs."),this.executions=0,this.executionResults=[]}},e}(),ine=function(){function e(){}return e.createExperimentalFeaturesConfig=function(t){return t?(t.useBarCodeDetectorIfSupported!==!0&&(t.useBarCodeDetectorIfSupported=!1),t):{useBarCodeDetectorIfSupported:!1}},e}(),Pn;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(Pn||(Pn={}));var ane=function(){function e(){this.state=Pn.NOT_STARTED,this.onGoingTransactionNewState=Pn.UNKNOWN}return e.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},e.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===Pn.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Pn.UNKNOWN,this.directTransition(t)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===Pn.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Pn.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Pn.UNKNOWN)throw"Cannnot transition to a new state, already under transition"},e.prototype.validateTransition=function(t){switch(this.state){case Pn.UNKNOWN:throw"Transition from unknown is not allowed";case Pn.NOT_STARTED:this.failIfNewStateIs(t,[Pn.PAUSED]);break;case Pn.SCANNING:break;case Pn.PAUSED:break}},e.prototype.failIfNewStateIs=function(t,n){for(var o=0,s=n;o<s.length;o++){var i=s[o];if(t===i)throw"Cannot transition from "+this.state+" to "+t}},e}(),lne=function(){function e(t){this.stateManager=t}return e.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},e.prototype.directTransition=function(t){this.stateManager.directTransition(t)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===Pn.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==Pn.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Pn.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===Pn.PAUSED},e}(),une=function(){function e(){}return e.create=function(){return new lne(new ane)},e}(),cne=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,s){o.__proto__=s}||function(o,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(o[i]=s[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}(),sr=function(e){cne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.DEFAULT_WIDTH=300,t.DEFAULT_WIDTH_OFFSET=2,t.FILE_SCAN_MIN_HEIGHT=300,t.MIN_QR_BOX_SIZE=50,t.SHADED_LEFT=1,t.SHADED_RIGHT=2,t.SHADED_TOP=3,t.SHADED_BOTTOM=4,t.SHADED_REGION_ELEMENT_ID="qr-shaded-region",t.VERBOSE=!1,t.BORDER_SHADER_DEFAULT_COLOR="#ffffff",t.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",t}(Gr),dne=function(){function e(t,n){this.logger=n,this.fps=sr.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=t.disableFlip===!0,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=sr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?ZS.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!Aa(this.qrbox)},e.create=function(t,n){return new e(t,n)},e}(),Ry=function(){function e(t,n){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.videoElement=null,this.localMediaStream=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id="+t+" not found";this.elementId=t,this.verbose=!1;var o;typeof n=="boolean"?this.verbose=n===!0:n&&(this.verbose=n.verbose===!0,o=n.experimentalFeatures),this.logger=new qS(this.verbose),this.qrcode=new sne(this.getSupportedFormats(n),this.verbose,this.logger,ine.createExperimentalFeaturesConfig(o)),this.foreverScanTimeout,this.localMediaStream,this.shouldScan=!0,this.stateManagerProxy=une.create()}return e.prototype.start=function(t,n,o,s){if(!t)throw"cameraIdOrConfig is required";if(!o||typeof o!="function")throw"qrCodeSuccessCallback is required and should be a function.";s||(s=this.verbose?this.logger.log:function(){});var i=dne.create(n,this.logger);this.clearElement();var l=!1;i.videoConstraints&&(i.isMediaStreamConstraintsValid()?l=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=l;i.isShadedBoxEnabled();var f=document.getElementById(this.elementId),p=f.clientWidth?f.clientWidth:sr.DEFAULT_WIDTH;f.style.position="relative",this.shouldScan=!0,this.element=f;var m=this,y=this.stateManagerProxy.startTransition(Pn.SCANNING);return new Promise(function(v,w){var E=c?i.videoConstraints:m.createVideoConstraints(t);if(!E){y.cancel(),w("videoConstraints should be defined");return}navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!1,video:E}).then(function(I){m.onMediaStreamReceived(I,i,c,p,o,s).then(function(S){y.execute(),m.isScanning=!0,v(null)}).catch(function(S){y.cancel(),w(S)})}).catch(function(I){y.cancel(),w(Nl.errorGettingUserMedia(I))}):(y.cancel(),w(Nl.cameraStreamingNotSupported()))})},e.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Pn.PAUSED),this.showPausedState(),(Aa(t)||t!==!0)&&(t=!1),t&&this.videoElement&&this.videoElement.pause()},e.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.videoElement)throw"VideoElement doesn't exist while trying resume()";var t=this,n=function(){t.stateManagerProxy.directTransition(Pn.SCANNING),t.hidePausedState()},o=this.videoElement.paused;if(!o){n();return}var s=function(){var i;setTimeout(n,200),(i=t.videoElement)===null||i===void 0||i.removeEventListener("playing",s)};this.videoElement.addEventListener("playing",s),this.videoElement.play()},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var n=this.stateManagerProxy.startTransition(Pn.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var o=function(){if(!!t.element){var s=document.getElementById(sr.SHADED_REGION_ELEMENT_ID);s&&t.element.removeChild(s)}};return new Promise(function(s,i){var l=function(){t.localMediaStream=null,t.element&&(t.element.removeChild(t.videoElement),t.element.removeChild(t.canvasElement)),o(),t.qrRegion&&(t.qrRegion=null),t.context&&(t.context=null),n.execute(),t.hidePausedState(),t.isScanning=!1,s()};t.localMediaStream||l();var c=t.localMediaStream.getVideoTracks().length,f=0;t.localMediaStream.getVideoTracks().forEach(function(p){t.localMediaStream.removeTrack(p),p.stop(),++f,f>=c&&l()})})},e.prototype.scanFile=function(t,n){return this.scanFileV2(t,n).then(function(o){return o.decodedText})},e.prototype.scanFileV2=function(t,n){var o=this;if(!t||!(t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Aa(n)&&(n=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(s,i){o.possiblyCloseLastScanImageFile(),o.clearElement(),o.lastScanImageFile=URL.createObjectURL(t);var l=new Image;l.onload=function(){var c=l.width,f=l.height,p=document.getElementById(o.elementId),m=p.clientWidth?p.clientWidth:sr.DEFAULT_WIDTH,y=Math.max(p.clientHeight?p.clientHeight:f,sr.FILE_SCAN_MIN_HEIGHT),v=o.computeCanvasDrawConfig(c,f,m,y);if(n){var w=o.createCanvasElement(m,y,"qr-canvas-visible");w.style.display="inline-block",p.appendChild(w);var E=w.getContext("2d");if(!E)throw"Unable to get 2d context from canvas";E.canvas.width=m,E.canvas.height=y,E.drawImage(l,0,0,c,f,v.x,v.y,v.width,v.height)}var I=o.createCanvasElement(v.width,v.height);p.appendChild(I);var S=I.getContext("2d");if(!S)throw"Unable to get 2d context from canvas";S.canvas.width=v.width,S.canvas.height=v.height,S.drawImage(l,0,0,c,f,0,0,v.width,v.height);try{o.qrcode.decodeAsync(I).then(function(T){s(Oy.createFromQrcodeResult(T))}).catch(i)}catch(T){i("QR code parse error, error = "+T)}},l.onerror=i,l.onabort=i,l.onstalled=i,l.onsuspend=i,l.src=URL.createObjectURL(t)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var t=MediaStreamTrack;if(MediaStreamTrack&&t.getSources)return e.getCamerasFromMediaStreamTrack();var n=function(){if(location.protocol==="https:")return!0;var s=location.host.split(":")[0];return s==="127.0.0.1"||s==="localhost"},o=Nl.unableToQuerySupportedDevices();return n()||(o=Nl.insecureContextCameraQueryError()),Promise.reject(o)},e.prototype.getRunningTrackCapabilities=function(){if(this.localMediaStream==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";var t=this.localMediaStream.getVideoTracks()[0];return t.getCapabilities()},e.prototype.applyVideoConstraints=function(t){var n=this;if(t){if(!ZS.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";if(this.localMediaStream===null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";if(this.localMediaStream.getVideoTracks().length===0)throw"No video tracks found";return new Promise(function(o,s){if("aspectRatio"in t){s("Chaning 'aspectRatio' in run-time is not yet supported.");return}var i=n.localMediaStream.getVideoTracks()[0];i.applyConstraints(t).then(function(l){o(l)}).catch(function(l){s(l)})})},e.getCamerasFromMediaDevices=function(){return new Promise(function(t,n){navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(o){var s=function(i){for(var l=i.getVideoTracks(),c=0,f=l;c<f.length;c++){var p=f[c];p.enabled=!1,p.stop(),i.removeTrack(p)}};navigator.mediaDevices.enumerateDevices().then(function(i){for(var l=[],c=0,f=i;c<f.length;c++){var p=f[c];p.kind==="videoinput"&&l.push({id:p.deviceId,label:p.label})}s(o),t(l)}).catch(function(i){n(i.name+" : "+i.message)})}).catch(function(o){n(o.name+" : "+o.message)})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,n){var o=function(i){for(var l=[],c=0,f=i;c<f.length;c++){var p=f[c];p.kind==="video"&&l.push({id:p.id,label:p.label})}t(l)},s=MediaStreamTrack;s.getSources(o)})},e.prototype.getSupportedFormats=function(t){var n=[Et.QR_CODE,Et.AZTEC,Et.CODABAR,Et.CODE_39,Et.CODE_93,Et.CODE_128,Et.DATA_MATRIX,Et.MAXICODE,Et.ITF,Et.EAN_13,Et.EAN_8,Et.PDF_417,Et.RSS_14,Et.RSS_EXPANDED,Et.UPC_A,Et.UPC_E,Et.UPC_EAN_EXTENSION];if(!t||typeof t=="boolean"||!t.formatsToSupport)return n;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(t.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var o=[],s=0,i=t.formatsToSupport;s<i.length;s++){var l=i[s];Jte(l)?o.push(l):this.logger.warn("Invalid format: "+l+" passed in config, ignoring.")}if(o.length===0)throw"None of formatsToSupport match supported values.";return o},e.prototype.validateQrboxSize=function(t,n,o){var s=this,i=o.qrbox;this.validateQrboxConfig(i);var l=this.toQrdimensions(t,n,i),c=function(p){if(p<sr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+(" "+sr.MIN_QR_BOX_SIZE+"px.")},f=function(p){return p>t&&(s.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."),p=t),p};c(l.width),c(l.height),l.width=f(l.width)},e.prototype.validateQrboxConfig=function(t){if(typeof t!="number"&&typeof t!="function"&&(t.width===void 0||t.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(t,n,o){if(typeof o=="number")return{width:o,height:o};if(typeof o=="function")try{return o(t,n)}catch(s){throw new Error("qrbox config was passed as a function but it failed with unknown error"+s)}return o},e.prototype.setupUi=function(t,n,o){o.isShadedBoxEnabled()&&this.validateQrboxSize(t,n,o);var s=Aa(o.qrbox)?{width:t,height:n}:o.qrbox;this.validateQrboxConfig(s);var i=this.toQrdimensions(t,n,s);i.height>n&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var l=o.isShadedBoxEnabled()&&i.height<=n,c={x:0,y:0,width:t,height:n},f=l?this.getShadedRegionBounds(t,n,i):c,p=this.createCanvasElement(f.width,f.height),m=p.getContext("2d");m.canvas.width=f.width,m.canvas.height=f.height,this.element.append(p),l&&this.possiblyInsertShadingElement(this.element,t,n,i),this.createScannerPausedUiElement(this.element),this.qrRegion=f,this.context=m,this.canvasElement=p},e.prototype.createScannerPausedUiElement=function(t){var n=document.createElement("div");n.innerText="Scanner paused",n.style.display="none",n.style.position="absolute",n.style.top="0px",n.style.zIndex="1",n.style.background="yellow",n.style.textAlign="center",n.style.width="100%",t.appendChild(n),this.scannerPausedUiElement=n},e.prototype.scanContext=function(t,n){var o=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(s){return t(s.text,Oy.createFromQrcodeResult(s)),o.possiblyUpdateShaders(!0),!0}).catch(function(s){o.possiblyUpdateShaders(!1);var i=Nl.codeParseError(s);return n(i,XS.createFrom(i)),!1})},e.prototype.foreverScan=function(t,n,o){var s=this;if(!!this.shouldScan&&!!this.localMediaStream){var i=this.videoElement,l=i.videoWidth/i.clientWidth,c=i.videoHeight/i.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var f=this.qrRegion.width*l,p=this.qrRegion.height*c,m=this.qrRegion.x*l,y=this.qrRegion.y*c;this.context.drawImage(i,m,y,f,p,0,0,this.qrRegion.width,this.qrRegion.height);var v=function(){s.foreverScanTimeout=setTimeout(function(){s.foreverScan(t,n,o)},s.getTimeoutFps(t.fps))};this.scanContext(n,o).then(function(w){!w&&t.disableFlip!==!0?(s.context.translate(s.context.canvas.width,0),s.context.scale(-1,1),s.scanContext(n,o).finally(function(){v()})):v()}).catch(function(w){s.logger.logError("Error happend while scanning context",w),v()})}},e.prototype.onMediaStreamReceived=function(t,n,o,s,i,l){var c=this,f=this;return new Promise(function(p,m){var y=function(){var E=c.createVideoElement(s);f.element.append(E),E.onabort=m,E.onerror=m;var I=function(){var S=E.clientWidth,T=E.clientHeight;f.setupUi(S,T,n),f.foreverScan(n,i,l),E.removeEventListener("playing",I),p(null)};E.addEventListener("playing",I),E.srcObject=t,E.play(),f.videoElement=E};if(f.localMediaStream=t,o||!n.aspectRatio)y();else{var v={aspectRatio:n.aspectRatio},w=t.getVideoTracks()[0];w.applyConstraints(v).then(function(E){return y()}).catch(function(E){f.logger.logErrors(["[Html5Qrcode] Constriants could not be satisfied, ignoring constraints",E]),y()})}})},e.prototype.createVideoConstraints=function(t){if(typeof t=="string")return{deviceId:{exact:t}};if(typeof t=="object"){var n="facingMode",o="deviceId",s={user:!0,environment:!0},i="exact",l=function(E){if(E in s)return!0;throw"config has invalid 'facingMode' value = "+("'"+E+"'")},c=Object.keys(t);if(c.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+(" if passed as an object, found "+c.length+" keys");var f=Object.keys(t)[0];if(f!==n&&f!==o)throw"Only '"+n+"' and '"+o+"'  are supported for 'cameraIdOrConfig'";if(f===n){var p=t.facingMode;if(typeof p=="string"){if(l(p))return{facingMode:p}}else if(typeof p=="object")if(i in p){if(l(p[""+i]))return{facingMode:{exact:p[""+i]}}}else throw"'facingMode' should be string or object with"+(" "+i+" as key.");else{var m=typeof p;throw"Invalid type of 'facingMode' = "+m}}else{var y=t.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(i in y)return{deviceId:{exact:y[""+i]}};throw"'deviceId' should be string or object with"+(" "+i+" as key.")}else{var v=typeof y;throw"Invalid type of 'deviceId' = "+v}}}var w=typeof t;throw"Invalid type of 'cameraIdOrConfig' = "+w},e.prototype.computeCanvasDrawConfig=function(t,n,o,s){if(t<=o&&n<=s){var i=(o-t)/2,l=(s-n)/2;return{x:i,y:l,width:t,height:n}}else{var c=t,f=n;return t>o&&(n=o/t*n,t=o),n>s&&(t=s/n*t,n=s),this.logger.log("Image downsampled from "+(c+"X"+f)+(" to "+t+"X"+n+".")),this.computeCanvasDrawConfig(t,n,o,s)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},e.prototype.createVideoElement=function(t){var n=document.createElement("video");return n.style.width=t+"px",n.muted=!0,n.setAttribute("muted","true"),n.playsInline=!0,n},e.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(n){n.style.backgroundColor=t?sr.BORDER_SHADER_MATCH_COLOR:sr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(t,n,o){var s=t,i=n,l=document.createElement("canvas");return l.style.width=s+"px",l.style.height=i+"px",l.style.display="none",l.id=Aa(o)?"qr-canvas":o,l},e.prototype.getShadedRegionBounds=function(t,n,o){if(o.width>t||o.height>n)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-o.width)/2,y:(n-o.height)/2,width:o.width,height:o.height}},e.prototype.possiblyInsertShadingElement=function(t,n,o,s){if(!(n-s.width<1||o-s.height<1)){var i=document.createElement("div");i.style.position="absolute";var l=(n-s.width)/2,c=(o-s.height)/2;if(i.style.borderLeft=l+"px solid #0000007a",i.style.borderRight=l+"px solid #0000007a",i.style.borderTop=c+"px solid #0000007a",i.style.borderBottom=c+"px solid #0000007a",i.style.boxSizing="border-box",i.style.top="0px",i.style.bottom="0px",i.style.left="0px",i.style.right="0px",i.id=""+sr.SHADED_REGION_ELEMENT_ID,n-s.width<11||o-s.height<11)this.hasBorderShaders=!1;else{var f=5,p=40;this.insertShaderBorders(i,p,f,-f,0,!0),this.insertShaderBorders(i,p,f,-f,0,!1),this.insertShaderBorders(i,p,f,s.height+f,0,!0),this.insertShaderBorders(i,p,f,s.height+f,0,!1),this.insertShaderBorders(i,f,p+f,-f,-f,!0),this.insertShaderBorders(i,f,p+f,s.height+f-p,-f,!0),this.insertShaderBorders(i,f,p+f,-f,-f,!1),this.insertShaderBorders(i,f,p+f,s.height+f-p,-f,!1),this.hasBorderShaders=!0}t.append(i)}},e.prototype.insertShaderBorders=function(t,n,o,s,i,l){var c=document.createElement("div");c.style.position="absolute",c.style.backgroundColor=sr.BORDER_SHADER_DEFAULT_COLOR,c.style.width=n+"px",c.style.height=o+"px",c.style.top=s+"px",l?c.style.left=i+"px":c.style.right=i+"px",this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(c),t.appendChild(c)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(t){return 1e3/t},e}(),f1="data:image/svg+xml;base64,",fne=f1+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIge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MTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",pne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",Py=function(){function e(){}return e.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},e}(),gne=function(){function e(){this.data=Py.createDefault();var t=localStorage.getItem(e.LOCAL_STORAGE_KEY);t?this.data=JSON.parse(t):this.reset()}return e.prototype.hasCameraPermissions=function(){return this.data.hasPermission},e.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},e.prototype.setHasPermission=function(t){this.data.hasPermission=t,this.flush()},e.prototype.setLastUsedCameraId=function(t){this.data.lastUsedCameraId=t,this.flush()},e.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},e.prototype.reset=function(){this.data=Py.createDefault(),this.flush()},e.prototype.flush=function(){localStorage.setItem(e.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},e.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",e}(),mne=function(){function e(){this.infoDiv=document.createElement("div")}return e.prototype.renderInto=function(t){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid silver",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(248 248 248)",this.infoDiv.innerText=Dy.builtUsing();var n=document.createElement("a");n.innerText="html5-qrcode",n.href="https://github.com/mebjas/html5-qrcode",n.target="new",this.infoDiv.appendChild(n);var o=document.createElement("br"),s=document.createElement("br");this.infoDiv.appendChild(o),this.infoDiv.appendChild(s);var i=document.createElement("a");i.innerText=Dy.reportIssues(),i.href="https://github.com/mebjas/html5-qrcode/issues",i.target="new",this.infoDiv.appendChild(i),t.appendChild(this.infoDiv)},e.prototype.show=function(){this.infoDiv.style.display="block"},e.prototype.hide=function(){this.infoDiv.style.display="none"},e}(),vne=function(){function e(t,n){this.isShowingInfoIcon=!0,this.onTapIn=t,this.onTapOut=n,this.infoIcon=document.createElement("img")}return e.prototype.renderInto=function(t){var n=this;this.infoIcon.alt="Info icon",this.infoIcon.src=Ly,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(o){return n.onHoverIn()},this.infoIcon.onmouseout=function(o){return n.onHoverOut()},this.infoIcon.onclick=function(o){return n.onClick()},t.appendChild(this.infoIcon)},e.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},e.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},e.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src=pne,this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=Ly,this.infoIcon.style.opacity="0.6")},e}(),yne=function(){function e(){var t=this;this.infoDiv=new mne,this.infoIcon=new vne(function(){t.infoDiv.show()},function(){t.infoDiv.hide()})}return e.prototype.renderInto=function(t){this.infoDiv.renderInto(t),this.infoIcon.renderInto(t)},e}(),By=function(){function e(){}return e.hasCameraPermissions=function(){return new Promise(function(t,n){navigator.mediaDevices.enumerateDevices().then(function(o){o.forEach(function(s){s.kind==="videoinput"&&s.label&&t(!0)}),t(!1)})})},e}(),rs=function(){function e(t){this.supportedScanTypes=this.validateAndReturnScanTypes(t)}return e.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},e.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},e.prototype.isCameraScanRequired=function(){for(var t=0,n=this.supportedScanTypes;t<n.length;t++){var o=n[t];if(e.isCameraScanType(o))return!0}return!1},e.isCameraScanType=function(t){return t===Zs.SCAN_TYPE_CAMERA},e.isFileScanType=function(t){return t===Zs.SCAN_TYPE_FILE},e.prototype.validateAndReturnScanTypes=function(t){if(!t||t.length===0)return Gr.DEFAULT_SUPPORTED_SCAN_TYPE;var n=Gr.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(t.length>n)throw"Max "+n+" values expected for supportedScanTypes";for(var o=0,s=t;o<s.length;o++){var i=s[o];if(!Gr.DEFAULT_SUPPORTED_SCAN_TYPE.includes(i))throw"Unsupported scan type "+i}return t},e}(),ir;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(ir||(ir={}));function bne(e){return{fps:e.fps,qrbox:e.qrbox,aspectRatio:e.aspectRatio,disableFlip:e.disableFlip,videoConstraints:e.videoConstraints}}function wne(e,t){return{formatsToSupport:e.formatsToSupport,experimentalFeatures:e.experimentalFeatures,verbose:t}}var Cne=function(){function e(t,n,o){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.elementId=t,this.config=this.createConfig(n),this.verbose=o===!0,!document.getElementById(t))throw"HTML Element with id="+t+" not found";this.scanTypeSelector=new rs(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new qS(this.verbose),this.persistedDataManager=new gne,n.rememberLastUsedCamera!==!0&&this.persistedDataManager.reset()}return e.prototype.render=function(t,n){var o=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(i,l){if(t)t(i,l);else{if(o.lastMatchFound===i)return;o.lastMatchFound=i,o.setHeaderMessage(Ar.lastMatch(i),ir.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(i,l){n&&n(i,l)};var s=document.getElementById(this.elementId);if(!s)throw"HTML Element with id="+this.elementId+" not found";s.innerHTML="",this.createBasicLayout(s),this.html5Qrcode=new Ry(this.getScanRegionId(),wne(this.config,this.verbose))},e.prototype.pause=function(t){if(!this.html5Qrcode)throw"Code scanner not initialized.";(Aa(t)||t!==!0)&&(t=!1),this.html5Qrcode.pause(t)},e.prototype.resume=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";this.html5Qrcode.resume()},e.prototype.getState=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getState()},e.prototype.clear=function(){var t=this,n=function(){var o=document.getElementById(t.elementId);o&&(o.innerHTML="",t.resetBasicLayout(o))};return this.html5Qrcode?new Promise(function(o,s){if(!t.html5Qrcode){o();return}t.html5Qrcode.isScanning?t.html5Qrcode.stop().then(function(i){if(!t.html5Qrcode){o();return}t.html5Qrcode.clear(),n(),o()}).catch(function(i){t.verbose&&t.logger.logError("Unable to stop qrcode scanner",i),s(i)}):(t.html5Qrcode.clear(),n())}):Promise.resolve()},e.prototype.getRunningTrackCapabilities=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.getRunningTrackCapabilities()},e.prototype.applyVideoConstraints=function(t){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode.applyVideoConstraints(t)},e.prototype.createConfig=function(t){return t?(t.fps||(t.fps=Gr.SCAN_DEFAULT_FPS),t.rememberLastUsedCamera!==!Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED&&(t.rememberLastUsedCamera=Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED),t):{fps:Gr.SCAN_DEFAULT_FPS,rememberLastUsedCamera:Gr.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:Gr.DEFAULT_SUPPORTED_SCAN_TYPE}},e.prototype.createBasicLayout=function(t){t.style.position="relative",t.style.padding="0px",t.style.border="1px solid silver",this.createHeader(t);var n=document.createElement("div"),o=this.getScanRegionId();n.id=o,n.style.width="100%",n.style.minHeight="100px",n.style.textAlign="center",t.appendChild(n),rs.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var s=document.createElement("div"),i=this.getDashboardId();s.id=i,s.style.width="100%",t.appendChild(s),this.setupInitialDashboard(s)},e.prototype.resetBasicLayout=function(t){t.style.border="none"},e.prototype.setupInitialDashboard=function(t){this.createSection(t),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},e.prototype.createHeader=function(t){var n=document.createElement("div");n.style.textAlign="left",n.style.margin="0px",t.appendChild(n);var o=new yne;o.renderInto(n);var s=document.createElement("div");s.id=this.getHeaderMessageContainerId(),s.style.display="none",s.style.textAlign="center",s.style.fontSize="14px",s.style.padding="2px 10px",s.style.margin="4px",s.style.borderTop="1px solid #f6f6f6",n.appendChild(s)},e.prototype.createSection=function(t){var n=document.createElement("div");n.id=this.getDashboardSectionId(),n.style.width="100%",n.style.padding="10px 0px 10px 0px",n.style.textAlign="left",t.appendChild(n)},e.prototype.createCameraListUi=function(t,n,o){var s=this;s.setHeaderMessage(Ar.cameraPermissionRequesting());var i=function(){o||s.createPermissionButton(t,n)};Ry.getCameras().then(function(l){s.persistedDataManager.setHasPermission(!0),s.resetHeaderMessage(),l&&l.length>0?(t.removeChild(n),s.renderCameraSelection(l)):(s.setHeaderMessage(Ar.noCameraFound(),ir.STATUS_WARNING),i())}).catch(function(l){s.persistedDataManager.setHasPermission(!1),o?o.disabled=!1:i(),s.setHeaderMessage(l,ir.STATUS_WARNING)})},e.prototype.createPermissionButton=function(t,n){var o=this,s=document.createElement("button");s.id=this.getCameraPermissionButtonId(),s.innerText=Ar.cameraPermissionTitle(),s.addEventListener("click",function(){s.disabled=!0,o.createCameraListUi(t,n,s)}),n.appendChild(s)},e.prototype.createPermissionsUi=function(t,n){var o=this;if(rs.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()){By.hasCameraPermissions().then(function(s){s?o.createCameraListUi(t,n):(o.persistedDataManager.setHasPermission(!1),o.createPermissionButton(t,n))}).catch(function(s){o.persistedDataManager.setHasPermission(!1),o.createPermissionButton(t,n)});return}this.createPermissionButton(t,n)},e.prototype.createSectionControlPanel=function(){var t=document.getElementById(this.getDashboardSectionId()),n=document.createElement("div");t.appendChild(n);var o=document.createElement("div");o.id=this.getDashboardSectionCameraScanRegionId(),o.style.display=rs.isCameraScanType(this.currentScanType)?"block":"none",n.appendChild(o);var s=document.createElement("div");s.style.textAlign="center",o.appendChild(s),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(o,s),this.renderFileScanUi(n)},e.prototype.renderFileScanUi=function(t){var n=this,o=document.createElement("div");o.id=this.getDashboardSectionFileScanRegionId(),o.style.textAlign="center",o.style.display=rs.isCameraScanType(this.currentScanType)?"none":"block",t.appendChild(o);var s=document.createElement("input");s.id=this.getFileScanInputId(),s.accept="image/*",s.type="file",s.style.width="200px",s.disabled=rs.isCameraScanType(this.currentScanType);var i=document.createElement("span");i.innerText=" Select Image",o.appendChild(s),o.appendChild(i),s.addEventListener("change",function(l){if(!n.html5Qrcode)throw"html5Qrcode not defined";if(!(l==null||l.target==null)&&!!rs.isFileScanType(n.currentScanType)&&l.target.files.length!==0){var c=l.target.files[0];n.html5Qrcode.scanFileV2(c,!0).then(function(f){n.resetHeaderMessage(),n.qrCodeSuccessCallback(f.decodedText,f)}).catch(function(f){n.setHeaderMessage(f,ir.STATUS_WARNING),n.qrCodeErrorCallback(f,XS.createFrom(f))})}})},e.prototype.renderCameraSelection=function(t){var n=this,o=this,s=document.getElementById(this.getDashboardSectionCameraScanRegionId());s.style.textAlign="center";var i=document.createElement("span");i.style.marginRight="10px";var l=t.length,c=document.createElement("select");if(l===1)c.style.display="none";else{var f=Ar.selectCamera();i.innerText=f+" ("+t.length+")  "}c.id=this.getCameraSelectionId();for(var p=[],m=0,y=t;m<y.length;m++){var v=y[m],w=v.id,E=v.label==null?w:v.label,I=document.createElement("option");I.value=w,I.innerText=E,p.push(I),c.appendChild(I)}i.appendChild(c),s.appendChild(i);var S=document.createElement("span"),T=document.createElement("button");T.innerText=Ar.scanButtonStartScanningText(),S.appendChild(T);var _=document.createElement("button");_.innerText=Ar.scanButtonStopScanningText(),_.style.display="none",_.disabled=!0,S.appendChild(_),s.appendChild(S);var N=function(B){B||(T.style.display="none"),T.innerText=Ar.scanButtonStartScanningText(),T.style.opacity="1",T.disabled=!1,B&&(T.style.display="inline-block")};if(T.addEventListener("click",function(B){T.innerText=Ar.scanButtonScanningStarting(),c.disabled=!0,T.disabled=!0,T.style.opacity="0.5",n.scanTypeSelector.hasMoreThanOneScanType()&&o.showHideScanTypeSwapLink(!1),o.resetHeaderMessage();var Y=c.value;o.persistedDataManager.setLastUsedCameraId(Y),o.html5Qrcode.start(Y,bne(o.config),o.qrCodeSuccessCallback,o.qrCodeErrorCallback).then(function(X){_.disabled=!1,_.style.display="inline-block",N(!1)}).catch(function(X){o.showHideScanTypeSwapLink(!0),c.disabled=!1,N(!0),o.setHeaderMessage(X,ir.STATUS_WARNING)})}),l===1&&T.click(),_.addEventListener("click",function(B){if(!o.html5Qrcode)throw"html5Qrcode not defined";_.disabled=!0,o.html5Qrcode.stop().then(function(Y){n.scanTypeSelector.hasMoreThanOneScanType()&&o.showHideScanTypeSwapLink(!0),c.disabled=!1,T.disabled=!1,_.style.display="none",T.style.display="inline-block",o.insertCameraScanImageToScanRegion()}).catch(function(Y){_.disabled=!1,o.setHeaderMessage(Y,ir.STATUS_WARNING)})}),o.persistedDataManager.getLastUsedCameraId()){for(var O=o.persistedDataManager.getLastUsedCameraId(),D=!1,x=0,R=p;x<R.length;x++){var I=R[x];if(I.value===O){D=!0;break}}D?(c.value=O,T.click()):o.persistedDataManager.resetLastUsedCameraId()}},e.prototype.createSectionSwap=function(){var t=this,n=Ar.textIfCameraScanSelected(),o=Ar.textIfFileScanSelected(),s=document.getElementById(this.getDashboardSectionId()),i=document.createElement("div");i.style.textAlign="center";var l=document.createElement("a");l.style.textDecoration="underline",l.id=this.getDashboardSectionSwapLinkId(),l.innerText=rs.isCameraScanType(this.currentScanType)?n:o,l.addEventListener("click",function(){if(!t.sectionSwapAllowed){t.verbose&&t.logger.logError("Section swap called when not allowed");return}t.resetHeaderMessage(),t.getFileScanInput().value="",t.sectionSwapAllowed=!1,rs.isCameraScanType(t.currentScanType)?(t.clearScanRegion(),t.getFileScanInput().disabled=!1,t.getCameraScanRegion().style.display="none",t.getFileScanRegion().style.display="block",l.innerText=o,t.currentScanType=Zs.SCAN_TYPE_FILE,t.insertFileScanImageToScanRegion()):(t.clearScanRegion(),t.getFileScanInput().disabled=!0,t.getCameraScanRegion().style.display="block",t.getFileScanRegion().style.display="none",l.innerText=n,t.currentScanType=Zs.SCAN_TYPE_CAMERA,t.insertCameraScanImageToScanRegion(),t.startCameraScanIfPermissionExistsOnSwap()),t.sectionSwapAllowed=!0}),i.appendChild(l),s.appendChild(i)},e.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var t=this,n=this;if(this.persistedDataManager.hasCameraPermissions()){By.hasCameraPermissions().then(function(o){if(o){var s=document.getElementById(n.getCameraPermissionButtonId());if(!s)throw t.logger.logError("Permission button not found, fail;"),"Permission button not found";s.click()}else n.persistedDataManager.setHasPermission(!1)}).catch(function(o){n.persistedDataManager.setHasPermission(!1)});return}},e.prototype.resetHeaderMessage=function(){var t=document.getElementById(this.getHeaderMessageContainerId());t.style.display="none"},e.prototype.setHeaderMessage=function(t,n){n||(n=ir.STATUS_DEFAULT);var o=this.getHeaderMessageDiv();switch(o.innerText=t,o.style.display="block",n){case ir.STATUS_SUCCESS:o.style.background="#6aaf5042",o.style.color="#477735";break;case ir.STATUS_WARNING:o.style.background="#cb243124",o.style.color="#cb2431";break;case ir.STATUS_DEFAULT:default:o.style.background="#00000000",o.style.color="rgb(17, 17, 17)";break}},e.prototype.showHideScanTypeSwapLink=function(t){t!==!0&&(t=!1),this.sectionSwapAllowed=t,this.getDashboardSectionSwapLink().style.display=t?"inline-block":"none"},e.prototype.insertCameraScanImageToScanRegion=function(){var t=this,n=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){n.innerHTML="<br>",n.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(o){n.innerHTML="<br>",n.appendChild(t.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=fne},e.prototype.insertFileScanImageToScanRegion=function(){var t=this,n=document.getElementById(this.getScanRegionId());if(this.fileScanImage){n.innerHTML="<br>",n.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(o){n.innerHTML="<br>",n.appendChild(t.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=hne},e.prototype.clearScanRegion=function(){var t=document.getElementById(this.getScanRegionId());t.innerHTML=""},e.prototype.getDashboardSectionId=function(){return this.elementId+"__dashboard_section"},e.prototype.getDashboardSectionCameraScanRegionId=function(){return this.elementId+"__dashboard_section_csr"},e.prototype.getDashboardSectionFileScanRegionId=function(){return this.elementId+"__dashboard_section_fsr"},e.prototype.getDashboardSectionSwapLinkId=function(){return this.elementId+"__dashboard_section_swaplink"},e.prototype.getScanRegionId=function(){return this.elementId+"__scan_region"},e.prototype.getDashboardId=function(){return this.elementId+"__dashboard"},e.prototype.getFileScanInputId=function(){return this.elementId+"__filescan_input"},e.prototype.getStatusSpanId=function(){return this.elementId+"__status_span"},e.prototype.getHeaderMessageContainerId=function(){return this.elementId+"__header_message"},e.prototype.getCameraSelectionId=function(){return this.elementId+"__camera_selection"},e.prototype.getCameraPermissionButtonId=function(){return this.elementId+"__camera_permission_button"},e.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},e.prototype.getFileScanRegion=function(){return document.getElementById(this.getDashboardSectionFileScanRegionId())},e.prototype.getFileScanInput=function(){return document.getElementById(this.getFileScanInputId())},e.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},e.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},e}();const Ene={id:"qr-code-full-region"},Sne=ve({props:{qrbox:null,fps:null},emits:["decodedCode"],setup(e,{emit:t}){const n=e;var o={fps:n.fps?n.fps:10};let s="";n.qrbox&&(o.qrbox=n.qrbox);let i=null;function l(p,m){s!==p&&(s=p,t("decodedCode",p,m))}function c(p,m){}async function f(){await dt(),i=new Cne("qr-code-full-region",o,void 0),i.render(l,c)}return f(),(p,m)=>(M(),W("div",Ene))}}),Ane=Ht(" \u4EBA\u6578\uFF1A "),Tne={id:"section",class:"section",style:{width:"70%",margin:"auto"}},Ine=Ht("\u6309\u6211\u50B3\u9001\u7C21\u8A0A "),_ne=ve({setup(e){let t=F("\u5167\u5BB9:"),n=F(1),o=F("");var s=navigator.userAgent,i=s.indexOf("Android")>-1||s.indexOf("Adr")>-1,l=!!s.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);function c(v,w){v.includes("1922:")?p(v):t.value=`\u5167\u5BB9:${v}`}function f(v){let w="";n.value>1&&(w=`+${n.value-1}`),t.value=`\u5167\u5BB9:${o.value}${w}`}function p(v){let w="";n.value>1&&(w=`+${n.value-1}`);let I=v.split("1922:")[1];o.value=I,t.value=`\u5167\u5BB9:${o.value}${w}`;let S=document.getElementById("Btn_Open");S.style.display="inline",m()}function m(){let v="";n.value>1&&(v=`+${n.value-1}`),i?window.open(`sms:1922?&amp;body=${o.value}${v}`,"_self"):l?window.open(`sms:1922&body=${o.value}${v}`,"_self"):alert(`sms:1922&body=${o.value}${v}`)}async function y(){await dt();let v=document.getElementById("Btn_Open");if(v.style.display="none",!i&&!l){let w=document.getElementById("section");w.style.width="500px"}}return y(),(v,w)=>{const E=Ae("el-input-number"),I=Ae("el-button");return M(),W(at,null,[Q("div",null,[Ane,le(E,{modelValue:k(n),"onUpdate:modelValue":w[0]||(w[0]=S=>wn(n)?n.value=S:n=S),min:1,size:"large",onChange:f},null,8,["modelValue"])]),Q("div",Tne,[le(Sne,{qrbox:200,fps:10,onDecodedCode:c})]),Q("div",null,Pe(k(t)),1),le(I,{id:"Btn_Open",type:"success",onClick:w[1]||(w[1]=()=>{m()}),size:"large",round:""},{default:ae(()=>[Ine]),_:1})],64)}}}),Nne=ve({setup(e){return(t,n)=>(M(),me(_ne))}});X2(Nne).use(Zte,{locale:Qte}).mount("#app")});export default kne();
diff --git a/dist/index.html b/dist/index.html
index e63c1a5..8beb4d9 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -6,8 +6,8 @@
     <link rel="icon" href="./favicon.ico" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>HTML5 QR Code with Vue js</title>
-  <script type="module" crossorigin src="./assets/index.26e8f481.js"></script>
+    <title>建喵防疫實聯制</title>
+  <script type="module" crossorigin src="./assets/index.acdfd36c.js"></script>
   <link rel="stylesheet" href="./assets/index.376fffd7.css">
 </head>
 
diff --git a/index.html b/index.html
index 852ec15..4278888 100644
--- a/index.html
+++ b/index.html
@@ -6,7 +6,7 @@
     <link rel="icon" href="/favicon.ico" />
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-    <title>HTML5 QR Code with Vue js</title>
+    <title>建喵防疫實聯制</title>
 </head>
 
 <body>
diff --git a/src/components/QRCode.vue b/src/components/QRCode.vue
index 7f96128..a735f86 100644
--- a/src/components/QRCode.vue
+++ b/src/components/QRCode.vue
@@ -4,7 +4,7 @@ import QRCodeScanner from './QRCodeScanner.vue';
 
 // defineProps<{ msg: string }>()
 
-let result = ref('');
+let result = ref('內容:');
 let count = ref(1);
 let smscontent = ref('');
 
@@ -12,7 +12,7 @@ var u = navigator.userAgent;
 var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
 var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
 
-const decodedCode = function (decodedText: string, decodedResult: any) {
+function decodedCode(decodedText: string, decodedResult: any) {
     // console.log(`Scan result ${decodedText}`, decodedResult);
     if (decodedText.includes('1922:')) {
         smsto1922(decodedText);
@@ -21,11 +21,23 @@ const decodedCode = function (decodedText: string, decodedResult: any) {
     }
 }
 
+function changecount(value: number) {
+    let addcount = "";
+    if (count.value > 1) {
+        addcount = `+${count.value - 1}`;
+    }
+    result.value = `內容:${smscontent.value}${addcount}`;
+}
+
 function smsto1922(decodedText: string) {
+    let addcount = "";
+    if (count.value > 1) {
+        addcount = `+${count.value - 1}`;
+    }
     let contents = decodedText.split('1922:');
     let sms = contents[1];
-    result.value = `內容:${sms}`;
     smscontent.value = sms;
+    result.value = `內容:${smscontent.value}${addcount}`;
     let Btn_Open = document.getElementById("Btn_Open")!;
     Btn_Open.style.display = "inline";
     OnclickOpen();
@@ -63,7 +75,7 @@ onLoad();
 <template>
     <div>
         人數:
-        <el-input-number v-model="count" :min="1" size="large" />
+        <el-input-number v-model="count" :min="1" size="large" @change="changecount" />
     </div>
     <div id="section" class="section" style="width: 70%; margin: auto;">
         <QRCodeScanner :qrbox="200" :fps="10" @decodedCode="decodedCode">