@inno_user/inno_clouds_lib 9.4.4 → 9.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31254,6 +31254,10 @@ const Na = bp(5), Lm = async (i, o) => {
|
|
|
31254
31254
|
} }), Yp = (i, o = 10) => new Promise((s) => {
|
|
31255
31255
|
let c = 0, d = 0, f = 0;
|
|
31256
31256
|
const g = () => {
|
|
31257
|
+
if (!i || i.scrollSize === void 0) {
|
|
31258
|
+
s();
|
|
31259
|
+
return;
|
|
31260
|
+
}
|
|
31257
31261
|
const p = i.scrollSize;
|
|
31258
31262
|
p === f && p > 0 ? c++ : (c = 0) && (f = p), d++, c >= 2 || d >= o ? s() : requestAnimationFrame(g);
|
|
31259
31263
|
};
|
|
@@ -31263,12 +31267,12 @@ function Gm(i, o) {
|
|
|
31263
31267
|
const s = (o == null ? void 0 : o.align) ?? "start";
|
|
31264
31268
|
let c = !1;
|
|
31265
31269
|
const d = le(null), f = le(!1), g = le("measure"), p = _e(() => Fs(i).length), w = _e(() => g.value === "measure" || g.value === "virtual" ? 1 : 5), x = _e(() => Array.from({ length: p.value * w.value }, (D, H) => H)), _ = async () => {
|
|
31266
|
-
if (d.value && (g.value = "measure", c = !1, f.value = !1, await un(), g.value
|
|
31267
|
-
if (
|
|
31270
|
+
if (d.value && (g.value = "measure", c = !1, f.value = !1, await un(), !(!d.value || g.value !== "measure") && (await Yp(d.value), !!d.value))) {
|
|
31271
|
+
if (f.value = d.value.scrollSize > d.value.viewportSize, !f.value) {
|
|
31268
31272
|
c = !1;
|
|
31269
31273
|
return;
|
|
31270
31274
|
}
|
|
31271
|
-
c = !0, g.value = (o == null ? void 0 : o.mode) || "loop", await un(), d.value.scrollToIndex(p.value * 3, { align: s });
|
|
31275
|
+
c = !0, g.value = (o == null ? void 0 : o.mode) || "loop", await un(), d.value && d.value.scrollToIndex(p.value * 3, { align: s });
|
|
31272
31276
|
}
|
|
31273
31277
|
}, v = (D) => g.value === "measure" ? D : p.value === 0 ? 0 : D % p.value, I = (D, H) => {
|
|
31274
31278
|
d.value && d.value.scrollToIndex(D, H);
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
`),e.toString()}setMode(e){this.mode=e}setECLevel(e){this.ecLevel=e}setVersion(e){this.version=e}setMaskPattern(e){this.maskPattern=e}setMatrix(e){this.matrix=e}static isValidMaskPattern(e){return e>=0&&e<ar.NUM_MASK_PATTERNS}}ar.NUM_MASK_PATTERNS=8;class ot extends p{}ot.kind="WriterException";class ke{constructor(){}static clearMatrix(e){e.clear(255)}static buildMatrix(e,t,n,r,a){ke.clearMatrix(a),ke.embedBasicPatterns(n,a),ke.embedTypeInfo(t,r,a),ke.maybeEmbedVersionInfo(n,a),ke.embedDataBits(e,r,a)}static embedBasicPatterns(e,t){ke.embedPositionDetectionPatternsAndSeparators(t),ke.embedDarkDotAtLeftBottomCorner(t),ke.maybeEmbedPositionAdjustmentPatterns(e,t),ke.embedTimingPatterns(t)}static embedTypeInfo(e,t,n){const r=new P;ke.makeTypeInfoBits(e,t,r);for(let a=0,c=r.getSize();a<c;++a){const d=r.get(r.getSize()-1-a),g=ke.TYPE_INFO_COORDINATES[a],w=g[0],E=g[1];if(n.setBoolean(w,E,d),a<8){const A=n.getWidth()-a-1;n.setBoolean(A,8,d)}else{const I=n.getHeight()-7+(a-8);n.setBoolean(8,I,d)}}}static maybeEmbedVersionInfo(e,t){if(e.getVersionNumber()<7)return;const n=new P;ke.makeVersionInfoBits(e,n);let r=6*3-1;for(let a=0;a<6;++a)for(let c=0;c<3;++c){const d=n.get(r);r--,t.setBoolean(a,t.getHeight()-11+c,d),t.setBoolean(t.getHeight()-11+c,a,d)}}static embedDataBits(e,t,n){let r=0,a=-1,c=n.getWidth()-1,d=n.getHeight()-1;for(;c>0;){for(c===6&&(c-=1);d>=0&&d<n.getHeight();){for(let g=0;g<2;++g){const w=c-g;if(!ke.isEmpty(n.get(w,d)))continue;let E;r<e.getSize()?(E=e.get(r),++r):E=!1,t!==255&&_t.getDataMaskBit(t,w,d)&&(E=!E),n.setBoolean(w,d,E)}d+=a}a=-a,d+=a,c-=2}if(r!==e.getSize())throw new ot("Not all bits consumed: "+r+"/"+e.getSize())}static findMSBSet(e){return 32-O.numberOfLeadingZeros(e)}static calculateBCHCode(e,t){if(t===0)throw new y("0 polynomial");const n=ke.findMSBSet(t);for(e<<=n-1;ke.findMSBSet(e)>=n;)e^=t<<ke.findMSBSet(e)-n;return e}static makeTypeInfoBits(e,t,n){if(!ar.isValidMaskPattern(t))throw new ot("Invalid mask pattern");const r=e.getBits()<<3|t;n.appendBits(r,5);const a=ke.calculateBCHCode(r,ke.TYPE_INFO_POLY);n.appendBits(a,10);const c=new P;if(c.appendBits(ke.TYPE_INFO_MASK_PATTERN,15),n.xor(c),n.getSize()!==15)throw new ot("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(e,t){t.appendBits(e.getVersionNumber(),6);const n=ke.calculateBCHCode(e.getVersionNumber(),ke.VERSION_INFO_POLY);if(t.appendBits(n,12),t.getSize()!==18)throw new ot("should not happen but we got: "+t.getSize())}static isEmpty(e){return e===255}static embedTimingPatterns(e){for(let t=8;t<e.getWidth()-8;++t){const n=(t+1)%2;ke.isEmpty(e.get(t,6))&&e.setNumber(t,6,n),ke.isEmpty(e.get(6,t))&&e.setNumber(6,t,n)}}static embedDarkDotAtLeftBottomCorner(e){if(e.get(8,e.getHeight()-8)===0)throw new ot;e.setNumber(8,e.getHeight()-8,1)}static embedHorizontalSeparationPattern(e,t,n){for(let r=0;r<8;++r){if(!ke.isEmpty(n.get(e+r,t)))throw new ot;n.setNumber(e+r,t,0)}}static embedVerticalSeparationPattern(e,t,n){for(let r=0;r<7;++r){if(!ke.isEmpty(n.get(e,t+r)))throw new ot;n.setNumber(e,t+r,0)}}static embedPositionAdjustmentPattern(e,t,n){for(let r=0;r<5;++r){const a=ke.POSITION_ADJUSTMENT_PATTERN[r];for(let c=0;c<5;++c)n.setNumber(e+c,t+r,a[c])}}static embedPositionDetectionPattern(e,t,n){for(let r=0;r<7;++r){const a=ke.POSITION_DETECTION_PATTERN[r];for(let c=0;c<7;++c)n.setNumber(e+c,t+r,a[c])}}static embedPositionDetectionPatternsAndSeparators(e){const t=ke.POSITION_DETECTION_PATTERN[0].length;ke.embedPositionDetectionPattern(0,0,e),ke.embedPositionDetectionPattern(e.getWidth()-t,0,e),ke.embedPositionDetectionPattern(0,e.getWidth()-t,e);const n=8;ke.embedHorizontalSeparationPattern(0,n-1,e),ke.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e),ke.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);const r=7;ke.embedVerticalSeparationPattern(r,0,e),ke.embedVerticalSeparationPattern(e.getHeight()-r-1,0,e),ke.embedVerticalSeparationPattern(r,e.getHeight()-r,e)}static maybeEmbedPositionAdjustmentPatterns(e,t){if(e.getVersionNumber()<2)return;const n=e.getVersionNumber()-1,r=ke.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let a=0,c=r.length;a!==c;a++){const d=r[a];if(d>=0)for(let g=0;g!==c;g++){const w=r[g];w>=0&&ke.isEmpty(t.get(w,d))&&ke.embedPositionAdjustmentPattern(w-2,d-2,t)}}}}ke.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])]),ke.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])]),ke.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])]),ke.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])]),ke.VERSION_INFO_POLY=7973,ke.TYPE_INFO_POLY=1335,ke.TYPE_INFO_MASK_PATTERN=21522;class Ng{constructor(e,t){this.dataBytes=e,this.errorCorrectionBytes=t}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class dt{constructor(){}static calculateMaskPenalty(e){return _t.applyMaskPenaltyRule1(e)+_t.applyMaskPenaltyRule2(e)+_t.applyMaskPenaltyRule3(e)+_t.applyMaskPenaltyRule4(e)}static encode(e,t,n=null){let r=dt.DEFAULT_BYTE_MODE_ENCODING;const a=n!==null&&n.get(Nt.CHARACTER_SET)!==void 0;a&&(r=n.get(Nt.CHARACTER_SET).toString());const c=this.chooseMode(e,r),d=new P;if(c===Ne.BYTE&&(a||dt.DEFAULT_BYTE_MODE_ENCODING!==r)){const de=j.getCharacterSetECIByName(r);de!==void 0&&this.appendECI(de,d)}this.appendModeInfo(c,d);const g=new P;this.appendBytes(e,c,g,r);let w;if(n!==null&&n.get(Nt.QR_VERSION)!==void 0){const de=Number.parseInt(n.get(Nt.QR_VERSION).toString(),10);w=Se.getVersionForNumber(de);const ce=this.calculateBitsNeeded(c,d,g,w);if(!this.willFit(ce,w,t))throw new ot("Data too big for requested version")}else w=this.recommendVersion(t,c,d,g);const E=new P;E.appendBitArray(d);const A=c===Ne.BYTE?g.getSizeInBytes():e.length;this.appendLengthInfo(A,w,c,E),E.appendBitArray(g);const I=w.getECBlocksForLevel(t),R=w.getTotalCodewords()-I.getTotalECCodewords();this.terminateBits(R,E);const D=this.interleaveWithECBytes(E,w.getTotalCodewords(),R,I.getNumBlocks()),F=new ar;F.setECLevel(t),F.setMode(c),F.setVersion(w);const Y=w.getDimensionForVersion(),te=new Oi(Y,Y),ue=this.chooseMaskPattern(D,t,w,te);return F.setMaskPattern(ue),ke.buildMatrix(D,t,w,ue,te),F.setMatrix(te),F}static recommendVersion(e,t,n,r){const a=this.calculateBitsNeeded(t,n,r,Se.getVersionForNumber(1)),c=this.chooseVersion(a,e),d=this.calculateBitsNeeded(t,n,r,c);return this.chooseVersion(d,e)}static calculateBitsNeeded(e,t,n,r){return t.getSize()+e.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(e){return e<dt.ALPHANUMERIC_TABLE.length?dt.ALPHANUMERIC_TABLE[e]:-1}static chooseMode(e,t=null){if(j.SJIS.getName()===t&&this.isOnlyDoubleByteKanji(e))return Ne.KANJI;let n=!1,r=!1;for(let a=0,c=e.length;a<c;++a){const d=e.charAt(a);if(dt.isDigit(d))n=!0;else if(this.getAlphanumericCode(d.charCodeAt(0))!==-1)r=!0;else return Ne.BYTE}return r?Ne.ALPHANUMERIC:n?Ne.NUMERIC:Ne.BYTE}static isOnlyDoubleByteKanji(e){let t;try{t=oe.encode(e,j.SJIS)}catch{return!1}const n=t.length;if(n%2!==0)return!1;for(let r=0;r<n;r+=2){const a=t[r]&255;if((a<129||a>159)&&(a<224||a>235))return!1}return!0}static chooseMaskPattern(e,t,n,r){let a=Number.MAX_SAFE_INTEGER,c=-1;for(let d=0;d<ar.NUM_MASK_PATTERNS;d++){ke.buildMatrix(e,t,n,d,r);let g=this.calculateMaskPenalty(r);g<a&&(a=g,c=d)}return c}static chooseVersion(e,t){for(let n=1;n<=40;n++){const r=Se.getVersionForNumber(n);if(dt.willFit(e,r,t))return r}throw new ot("Data too big")}static willFit(e,t,n){const r=t.getTotalCodewords(),c=t.getECBlocksForLevel(n).getTotalECCodewords(),d=r-c,g=(e+7)/8;return d>=g}static terminateBits(e,t){const n=e*8;if(t.getSize()>n)throw new ot("data bits cannot fit in the QR Code"+t.getSize()+" > "+n);for(let c=0;c<4&&t.getSize()<n;++c)t.appendBit(!1);const r=t.getSize()&7;if(r>0)for(let c=r;c<8;c++)t.appendBit(!1);const a=e-t.getSizeInBytes();for(let c=0;c<a;++c)t.appendBits(c&1?17:236,8);if(t.getSize()!==n)throw new ot("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(e,t,n,r,a,c){if(r>=n)throw new ot("Block ID too large");const d=e%n,g=n-d,w=Math.floor(e/n),E=w+1,A=Math.floor(t/n),I=A+1,R=w-A,D=E-I;if(R!==D)throw new ot("EC bytes mismatch");if(n!==g+d)throw new ot("RS blocks mismatch");if(e!==(A+R)*g+(I+D)*d)throw new ot("Total bytes mismatch");r<g?(a[0]=A,c[0]=R):(a[0]=I,c[0]=D)}static interleaveWithECBytes(e,t,n,r){if(e.getSizeInBytes()!==n)throw new ot("Number of bits and data bytes does not match");let a=0,c=0,d=0;const g=new Array;for(let E=0;E<r;++E){const A=new Int32Array(1),I=new Int32Array(1);dt.getNumDataBytesAndNumECBytesForBlockID(t,n,r,E,A,I);const R=A[0],D=new Uint8Array(R);e.toBytes(8*a,D,0,R);const F=dt.generateECBytes(D,I[0]);g.push(new Ng(D,F)),c=Math.max(c,R),d=Math.max(d,F.length),a+=A[0]}if(n!==a)throw new ot("Data bytes does not match offset");const w=new P;for(let E=0;E<c;++E)for(const A of g){const I=A.getDataBytes();E<I.length&&w.appendBits(I[E],8)}for(let E=0;E<d;++E)for(const A of g){const I=A.getErrorCorrectionBytes();E<I.length&&w.appendBits(I[E],8)}if(t!==w.getSizeInBytes())throw new ot("Interleaving error: "+t+" and "+w.getSizeInBytes()+" differ.");return w}static generateECBytes(e,t){const n=e.length,r=new Int32Array(n+t);for(let c=0;c<n;c++)r[c]=e[c]&255;new Do(Te.QR_CODE_FIELD_256).encode(r,t);const a=new Uint8Array(t);for(let c=0;c<t;c++)a[c]=r[n+c];return a}static appendModeInfo(e,t){t.appendBits(e.getBits(),4)}static appendLengthInfo(e,t,n,r){const a=n.getCharacterCountBits(t);if(e>=1<<a)throw new ot(e+" is bigger than "+((1<<a)-1));r.appendBits(e,a)}static appendBytes(e,t,n,r){switch(t){case Ne.NUMERIC:dt.appendNumericBytes(e,n);break;case Ne.ALPHANUMERIC:dt.appendAlphanumericBytes(e,n);break;case Ne.BYTE:dt.append8BitBytes(e,n,r);break;case Ne.KANJI:dt.appendKanjiBytes(e,n);break;default:throw new ot("Invalid mode: "+t)}}static getDigit(e){return e.charCodeAt(0)-48}static isDigit(e){const t=dt.getDigit(e);return t>=0&&t<=9}static appendNumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const a=dt.getDigit(e.charAt(r));if(r+2<n){const c=dt.getDigit(e.charAt(r+1)),d=dt.getDigit(e.charAt(r+2));t.appendBits(a*100+c*10+d,10),r+=3}else if(r+1<n){const c=dt.getDigit(e.charAt(r+1));t.appendBits(a*10+c,7),r+=2}else t.appendBits(a,4),r++}}static appendAlphanumericBytes(e,t){const n=e.length;let r=0;for(;r<n;){const a=dt.getAlphanumericCode(e.charCodeAt(r));if(a===-1)throw new ot;if(r+1<n){const c=dt.getAlphanumericCode(e.charCodeAt(r+1));if(c===-1)throw new ot;t.appendBits(a*45+c,11),r+=2}else t.appendBits(a,6),r++}}static append8BitBytes(e,t,n){let r;try{r=oe.encode(e,n)}catch(a){throw new ot(a)}for(let a=0,c=r.length;a!==c;a++){const d=r[a];t.appendBits(d,8)}}static appendKanjiBytes(e,t){let n;try{n=oe.encode(e,j.SJIS)}catch(a){throw new ot(a)}const r=n.length;for(let a=0;a<r;a+=2){const c=n[a]&255,d=n[a+1]&255,g=c<<8&4294967295|d;let w=-1;if(g>=33088&&g<=40956?w=g-33088:g>=57408&&g<=60351&&(w=g-49472),w===-1)throw new ot("Invalid byte sequence");const E=(w>>8)*192+(w&255);t.appendBits(E,13)}}static appendECI(e,t){t.appendBits(Ne.ECI.getBits(),4),t.appendBits(e.getValue(),8)}}dt.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]),dt.DEFAULT_BYTE_MODE_ENCODING=j.UTF8.getName();class lr{write(e,t,n,r=null){if(e.length===0)throw new y("Found empty contents");if(t<0||n<0)throw new y("Requested dimensions are too small: "+t+"x"+n);let a=ct.L,c=lr.QUIET_ZONE_SIZE;r!==null&&(r.get(Nt.ERROR_CORRECTION)!==void 0&&(a=ct.fromString(r.get(Nt.ERROR_CORRECTION).toString())),r.get(Nt.MARGIN)!==void 0&&(c=Number.parseInt(r.get(Nt.MARGIN).toString(),10)));const d=dt.encode(e,a,r);return this.renderResult(d,t,n,c)}writeToDom(e,t,n,r,a=null){typeof e=="string"&&(e=document.querySelector(e));const c=this.write(t,n,r,a);e&&e.appendChild(c)}renderResult(e,t,n,r){const a=e.getMatrix();if(a===null)throw new Ue;const c=a.getWidth(),d=a.getHeight(),g=c+r*2,w=d+r*2,E=Math.max(t,g),A=Math.max(n,w),I=Math.min(Math.floor(E/g),Math.floor(A/w)),R=Math.floor((E-c*I)/2),D=Math.floor((A-d*I)/2),F=this.createSVGElement(E,A);for(let Y=0,te=D;Y<d;Y++,te+=I)for(let ue=0,de=R;ue<c;ue++,de+=I)if(a.get(ue,Y)===1){const ce=this.createSvgRectElement(de,te,I,I);F.appendChild(ce)}return F}createSVGElement(e,t){const n=document.createElementNS(lr.SVG_NS,"svg");return n.setAttributeNS(null,"height",e.toString()),n.setAttributeNS(null,"width",t.toString()),n}createSvgRectElement(e,t,n,r){const a=document.createElementNS(lr.SVG_NS,"rect");return a.setAttributeNS(null,"x",e.toString()),a.setAttributeNS(null,"y",t.toString()),a.setAttributeNS(null,"height",n.toString()),a.setAttributeNS(null,"width",r.toString()),a.setAttributeNS(null,"fill","#000000"),a}}lr.QUIET_ZONE_SIZE=4,lr.SVG_NS="http://www.w3.org/2000/svg";class Ir{encode(e,t,n,r,a){if(e.length===0)throw new y("Found empty contents");if(t!==xe.QR_CODE)throw new y("Can only encode QR_CODE, but got "+t);if(n<0||r<0)throw new y(`Requested dimensions are too small: ${n}x${r}`);let c=ct.L,d=Ir.QUIET_ZONE_SIZE;a!==null&&(a.get(Nt.ERROR_CORRECTION)!==void 0&&(c=ct.fromString(a.get(Nt.ERROR_CORRECTION).toString())),a.get(Nt.MARGIN)!==void 0&&(d=Number.parseInt(a.get(Nt.MARGIN).toString(),10)));const g=dt.encode(e,c,a);return Ir.renderResult(g,n,r,d)}static renderResult(e,t,n,r){const a=e.getMatrix();if(a===null)throw new Ue;const c=a.getWidth(),d=a.getHeight(),g=c+r*2,w=d+r*2,E=Math.max(t,g),A=Math.max(n,w),I=Math.min(Math.floor(E/g),Math.floor(A/w)),R=Math.floor((E-c*I)/2),D=Math.floor((A-d*I)/2),F=new W(E,A);for(let Y=0,te=D;Y<d;Y++,te+=I)for(let ue=0,de=R;ue<c;ue++,de+=I)a.get(ue,Y)===1&&F.setRegion(de,te,I,I);return F}}Ir.QUIET_ZONE_SIZE=4;class Tg{encode(e,t,n,r,a){let c;switch(t){case xe.QR_CODE:c=new Ir;break;default:throw new y("No encoder available for format "+t)}return c.encode(e,t,n,r,a)}}class Tn extends q{constructor(e,t,n,r,a,c,d,g){if(super(c,d),this.yuvData=e,this.dataWidth=t,this.dataHeight=n,this.left=r,this.top=a,r+c>t||a+d>n)throw new y("Crop rectangle does not fit within image data.");g&&this.reverseHorizontal(c,d)}getRow(e,t){if(e<0||e>=this.getHeight())throw new y("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return L.arraycopy(this.yuvData,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.yuvData;const n=e*t,r=new Uint8ClampedArray(n);let a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return L.arraycopy(this.yuvData,a,r,0,n),r;for(let c=0;c<t;c++){const d=c*e;L.arraycopy(this.yuvData,a,r,d,e),a+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new Tn(this.yuvData,this.dataWidth,this.dataHeight,this.left+e,this.top+t,n,r,!1)}renderThumbnail(){const e=this.getWidth()/Tn.THUMBNAIL_SCALE_FACTOR,t=this.getHeight()/Tn.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(e*t),r=this.yuvData;let a=this.top*this.dataWidth+this.left;for(let c=0;c<t;c++){const d=c*e;for(let g=0;g<e;g++){const w=r[a+g*Tn.THUMBNAIL_SCALE_FACTOR]&255;n[d+g]=4278190080|w*65793}a+=this.dataWidth*Tn.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/Tn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Tn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(e,t){const n=this.yuvData;for(let r=0,a=this.top*this.dataWidth+this.left;r<t;r++,a+=this.dataWidth){const c=a+e/2;for(let d=a,g=a+e-1;d<c;d++,g--){const w=n[d];n[d]=n[g],n[g]=w}}}invert(){return new $(this)}}Tn.THUMBNAIL_SCALE_FACTOR=2;class Po extends q{constructor(e,t,n,r,a,c,d){if(super(t,n),this.dataWidth=r,this.dataHeight=a,this.left=c,this.top=d,e.BYTES_PER_ELEMENT===4){const g=t*n,w=new Uint8ClampedArray(g);for(let E=0;E<g;E++){const A=e[E],I=A>>16&255,R=A>>7&510,D=A&255;w[E]=(I+R+D)/4&255}this.luminances=w}else this.luminances=e;if(r===void 0&&(this.dataWidth=t),a===void 0&&(this.dataHeight=n),c===void 0&&(this.left=0),d===void 0&&(this.top=0),this.left+t>this.dataWidth||this.top+n>this.dataHeight)throw new y("Crop rectangle does not fit within image data.")}getRow(e,t){if(e<0||e>=this.getHeight())throw new y("Requested row is outside the image: "+e);const n=this.getWidth();(t==null||t.length<n)&&(t=new Uint8ClampedArray(n));const r=(e+this.top)*this.dataWidth+this.left;return L.arraycopy(this.luminances,r,t,0,n),t}getMatrix(){const e=this.getWidth(),t=this.getHeight();if(e===this.dataWidth&&t===this.dataHeight)return this.luminances;const n=e*t,r=new Uint8ClampedArray(n);let a=this.top*this.dataWidth+this.left;if(e===this.dataWidth)return L.arraycopy(this.luminances,a,r,0,n),r;for(let c=0;c<t;c++){const d=c*e;L.arraycopy(this.luminances,a,r,d,e),a+=this.dataWidth}return r}isCropSupported(){return!0}crop(e,t,n,r){return new Po(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+e,this.top+t)}invert(){return new $(this)}}class Za extends j{static forName(e){return this.getCharacterSetECIByName(e)}}class Lo{}Lo.ISO_8859_1=j.ISO8859_1;class Ya{isCompact(){return this.compact}setCompact(e){this.compact=e}getSize(){return this.size}setSize(e){this.size=e}getLayers(){return this.layers}setLayers(e){this.layers=e}getCodeWords(){return this.codeWords}setCodeWords(e){this.codeWords=e}getMatrix(){return this.matrix}setMatrix(e){this.matrix=e}}class $a{static singletonList(e){return[e]}static min(e,t){return e.sort(t)[0]}}class kg{constructor(e){this.previous=e}getPrevious(){return this.previous}}class Sr extends kg{constructor(e,t,n){super(e),this.value=t,this.bitCount=n}appendTo(e,t){e.appendBits(this.value,this.bitCount)}add(e,t){return new Sr(this,e,t)}addBinaryShift(e,t){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Sr(this,e,t)}toString(){let e=this.value&(1<<this.bitCount)-1;return e|=1<<this.bitCount,"<"+O.toBinaryString(e|1<<this.bitCount).substring(1)+">"}}class Fo extends Sr{constructor(e,t,n){super(e,0,0),this.binaryShiftStart=t,this.binaryShiftByteCount=n}appendTo(e,t){for(let n=0;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(e.appendBits(31,5),this.binaryShiftByteCount>62?e.appendBits(this.binaryShiftByteCount-31,16):n===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(t[this.binaryShiftStart+n],8)}addBinaryShift(e,t){return new Fo(this,e,t)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function Rg(b,e,t){return new Fo(b,e,t)}function $r(b,e,t){return new Sr(b,e,t)}const Og=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],qn=0,Bi=1,dn=2,Ka=3,kn=4,Bg=new Sr(null,0,0),Vo=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function Mg(b){for(let e of b)B.fill(e,-1);return b[qn][kn]=0,b[Bi][kn]=0,b[Bi][qn]=28,b[Ka][kn]=0,b[dn][kn]=0,b[dn][qn]=15,b}const Qa=Mg(B.createInt32Array(6,6));class Rn{constructor(e,t,n,r){this.token=e,this.mode=t,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(e,t){let n=this.bitCount,r=this.token;if(e!==this.mode){let c=Vo[this.mode][e];r=$r(r,c&65535,c>>16),n+=c>>16}let a=e===dn?4:5;return r=$r(r,t,a),new Rn(r,e,0,n+a)}shiftAndAppend(e,t){let n=this.token,r=this.mode===dn?4:5;return n=$r(n,Qa[this.mode][e],r),n=$r(n,t,5),new Rn(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(e){let t=this.token,n=this.mode,r=this.bitCount;if(this.mode===kn||this.mode===dn){let d=Vo[n][qn];t=$r(t,d&65535,d>>16),r+=d>>16,n=qn}let a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,c=new Rn(t,n,this.binaryShiftByteCount+1,r+a);return c.binaryShiftByteCount===2078&&(c=c.endBinaryShift(e+1)),c}endBinaryShift(e){if(this.binaryShiftByteCount===0)return this;let t=this.token;return t=Rg(t,e-this.binaryShiftByteCount,this.binaryShiftByteCount),new Rn(t,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(e){let t=this.bitCount+(Vo[this.mode][e.mode]>>16);return this.binaryShiftByteCount<e.binaryShiftByteCount?t+=Rn.calculateBinaryShiftCost(e)-Rn.calculateBinaryShiftCost(this):this.binaryShiftByteCount>e.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(t+=10),t<=e.bitCount}toBitArray(e){let t=[];for(let r=this.endBinaryShift(e.length).token;r!==null;r=r.getPrevious())t.unshift(r);let n=new P;for(const r of t)r.appendTo(n,e);return n}toString(){return ne.format("%s bits=%d bytes=%d",Og[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(e){return e.binaryShiftByteCount>62?21:e.binaryShiftByteCount>31?20:e.binaryShiftByteCount>0?10:0}}Rn.INITIAL_STATE=new Rn(Bg,qn,0,0);function vg(b){const e=ne.getCharCode(" "),t=ne.getCharCode("."),n=ne.getCharCode(",");b[qn][e]=1;const r=ne.getCharCode("Z"),a=ne.getCharCode("A");for(let I=a;I<=r;I++)b[qn][I]=I-a+2;b[Bi][e]=1;const c=ne.getCharCode("z"),d=ne.getCharCode("a");for(let I=d;I<=c;I++)b[Bi][I]=I-d+2;b[dn][e]=1;const g=ne.getCharCode("9"),w=ne.getCharCode("0");for(let I=w;I<=g;I++)b[dn][I]=I-w+2;b[dn][n]=12,b[dn][t]=13;const E=["\0"," ","","","","","","","\x07","\b"," ",`
|
|
29
29
|
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let I=0;I<E.length;I++)b[Ka][ne.getCharCode(E[I])]=I;const A=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let I=0;I<A.length;I++)ne.getCharCode(A[I])>0&&(b[kn][ne.getCharCode(A[I])]=I);return b}const Uo=vg(B.createInt32Array(5,256));class Kr{constructor(e){this.text=e}encode(){const e=ne.getCharCode(" "),t=ne.getCharCode(`
|
|
30
30
|
`);let n=$a.singletonList(Rn.INITIAL_STATE);for(let a=0;a<this.text.length;a++){let c,d=a+1<this.text.length?this.text[a+1]:0;switch(this.text[a]){case ne.getCharCode("\r"):c=d===t?2:0;break;case ne.getCharCode("."):c=d===e?3:0;break;case ne.getCharCode(","):c=d===e?4:0;break;case ne.getCharCode(":"):c=d===e?5:0;break;default:c=0}c>0?(n=Kr.updateStateListForPair(n,a,c),a++):n=this.updateStateListForChar(n,a)}return $a.min(n,(a,c)=>a.getBitCount()-c.getBitCount()).toBitArray(this.text)}updateStateListForChar(e,t){const n=[];for(let r of e)this.updateStateForChar(r,t,n);return Kr.simplifyStates(n)}updateStateForChar(e,t,n){let r=this.text[t]&255,a=Uo[e.getMode()][r]>0,c=null;for(let d=0;d<=kn;d++){let g=Uo[d][r];if(g>0){if(c==null&&(c=e.endBinaryShift(t)),!a||d===e.getMode()||d===dn){const w=c.latchAndAppend(d,g);n.push(w)}if(!a&&Qa[e.getMode()][d]>=0){const w=c.shiftAndAppend(d,g);n.push(w)}}}if(e.getBinaryShiftByteCount()>0||Uo[e.getMode()][r]===0){let d=e.addBinaryShiftChar(t);n.push(d)}}static updateStateListForPair(e,t,n){const r=[];for(let a of e)this.updateStateForPair(a,t,n,r);return this.simplifyStates(r)}static updateStateForPair(e,t,n,r){let a=e.endBinaryShift(t);if(r.push(a.latchAndAppend(kn,n)),e.getMode()!==kn&&r.push(a.shiftAndAppend(kn,n)),n===3||n===4){let c=a.latchAndAppend(dn,16-n).latchAndAppend(dn,1);r.push(c)}if(e.getBinaryShiftByteCount()>0){let c=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);r.push(c)}}static simplifyStates(e){let t=[];for(const n of e){let r=!0;for(const a of t){if(a.isBetterThanOrEqualTo(n)){r=!1;break}n.isBetterThanOrEqualTo(a)&&(t=t.filter(c=>c!==a))}r&&t.push(n)}return t}}class Ke{constructor(){}static encodeBytes(e){return Ke.encode(e,Ke.DEFAULT_EC_PERCENT,Ke.DEFAULT_AZTEC_LAYERS)}static encode(e,t,n){let r=new Kr(e).encode(),a=O.truncDivision(r.getSize()*t,100)+11,c=r.getSize()+a,d,g,w,E,A;if(n!==Ke.DEFAULT_AZTEC_LAYERS){if(d=n<0,g=Math.abs(n),g>(d?Ke.MAX_NB_BITS_COMPACT:Ke.MAX_NB_BITS))throw new y(ne.format("Illegal value %s for layers",n));w=Ke.totalBitsInLayer(g,d),E=Ke.WORD_SIZE[g];let ce=w-w%E;if(A=Ke.stuffBits(r,E),A.getSize()+a>ce)throw new y("Data to large for user specified layer");if(d&&A.getSize()>E*64)throw new y("Data to large for user specified layer")}else{E=0,A=null;for(let ce=0;;ce++){if(ce>Ke.MAX_NB_BITS)throw new y("Data too large for an Aztec code");if(d=ce<=3,g=d?ce+1:ce,w=Ke.totalBitsInLayer(g,d),c>w)continue;(A==null||E!==Ke.WORD_SIZE[g])&&(E=Ke.WORD_SIZE[g],A=Ke.stuffBits(r,E));let Xe=w-w%E;if(!(d&&A.getSize()>E*64)&&A.getSize()+a<=Xe)break}}let I=Ke.generateCheckWords(A,w,E),R=A.getSize()/E,D=Ke.generateModeMessage(d,g,R),F=(d?11:14)+g*4,Y=new Int32Array(F),te;if(d){te=F;for(let ce=0;ce<Y.length;ce++)Y[ce]=ce}else{te=F+1+2*O.truncDivision(O.truncDivision(F,2)-1,15);let ce=O.truncDivision(F,2),Xe=O.truncDivision(te,2);for(let Pe=0;Pe<ce;Pe++){let $t=Pe+O.truncDivision(Pe,15);Y[ce-Pe-1]=Xe-$t-1,Y[ce+Pe]=Xe+$t+1}}let ue=new W(te);for(let ce=0,Xe=0;ce<g;ce++){let Pe=(g-ce)*4+(d?9:12);for(let $t=0;$t<Pe;$t++){let _n=$t*2;for(let Kt=0;Kt<2;Kt++)I.get(Xe+_n+Kt)&&ue.set(Y[ce*2+Kt],Y[ce*2+$t]),I.get(Xe+Pe*2+_n+Kt)&&ue.set(Y[ce*2+$t],Y[F-1-ce*2-Kt]),I.get(Xe+Pe*4+_n+Kt)&&ue.set(Y[F-1-ce*2-Kt],Y[F-1-ce*2-$t]),I.get(Xe+Pe*6+_n+Kt)&&ue.set(Y[F-1-ce*2-$t],Y[ce*2+Kt])}Xe+=Pe*8}if(Ke.drawModeMessage(ue,d,te,D),d)Ke.drawBullsEye(ue,O.truncDivision(te,2),5);else{Ke.drawBullsEye(ue,O.truncDivision(te,2),7);for(let ce=0,Xe=0;ce<O.truncDivision(F,2)-1;ce+=15,Xe+=16)for(let Pe=O.truncDivision(te,2)&1;Pe<te;Pe+=2)ue.set(O.truncDivision(te,2)-Xe,Pe),ue.set(O.truncDivision(te,2)+Xe,Pe),ue.set(Pe,O.truncDivision(te,2)-Xe),ue.set(Pe,O.truncDivision(te,2)+Xe)}let de=new Ya;return de.setCompact(d),de.setSize(te),de.setLayers(g),de.setCodeWords(R),de.setMatrix(ue),de}static drawBullsEye(e,t,n){for(let r=0;r<n;r+=2)for(let a=t-r;a<=t+r;a++)e.set(a,t-r),e.set(a,t+r),e.set(t-r,a),e.set(t+r,a);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)}static generateModeMessage(e,t,n){let r=new P;return e?(r.appendBits(t-1,2),r.appendBits(n-1,6),r=Ke.generateCheckWords(r,28,4)):(r.appendBits(t-1,5),r.appendBits(n-1,11),r=Ke.generateCheckWords(r,40,4)),r}static drawModeMessage(e,t,n,r){let a=O.truncDivision(n,2);if(t)for(let c=0;c<7;c++){let d=a-3+c;r.get(c)&&e.set(d,a-5),r.get(c+7)&&e.set(a+5,d),r.get(20-c)&&e.set(d,a+5),r.get(27-c)&&e.set(a-5,d)}else for(let c=0;c<10;c++){let d=a-5+c+O.truncDivision(c,5);r.get(c)&&e.set(d,a-7),r.get(c+10)&&e.set(a+7,d),r.get(29-c)&&e.set(d,a+7),r.get(39-c)&&e.set(a-7,d)}}static generateCheckWords(e,t,n){let r=e.getSize()/n,a=new Do(Ke.getGF(n)),c=O.truncDivision(t,n),d=Ke.bitsToWords(e,n,c);a.encode(d,c-r);let g=t%n,w=new P;w.appendBits(0,g);for(const E of Array.from(d))w.appendBits(E,n);return w}static bitsToWords(e,t,n){let r=new Int32Array(n),a,c;for(a=0,c=e.getSize()/t;a<c;a++){let d=0;for(let g=0;g<t;g++)d|=e.get(a*t+g)?1<<t-g-1:0;r[a]=d}return r}static getGF(e){switch(e){case 4:return Te.AZTEC_PARAM;case 6:return Te.AZTEC_DATA_6;case 8:return Te.AZTEC_DATA_8;case 10:return Te.AZTEC_DATA_10;case 12:return Te.AZTEC_DATA_12;default:throw new y("Unsupported word size "+e)}}static stuffBits(e,t){let n=new P,r=e.getSize(),a=(1<<t)-2;for(let c=0;c<r;c+=t){let d=0;for(let g=0;g<t;g++)(c+g>=r||e.get(c+g))&&(d|=1<<t-1-g);(d&a)===a?(n.appendBits(d&a,t),c--):d&a?n.appendBits(d,t):(n.appendBits(d|1,t),c--)}return n}static totalBitsInLayer(e,t){return((t?88:112)+16*e)*e}}Ke.DEFAULT_EC_PERCENT=33,Ke.DEFAULT_AZTEC_LAYERS=0,Ke.MAX_NB_BITS=32,Ke.MAX_NB_BITS_COMPACT=4,Ke.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 Mi{encode(e,t,n,r){return this.encodeWithHints(e,t,n,r,null)}encodeWithHints(e,t,n,r,a){let c=Lo.ISO_8859_1,d=Ke.DEFAULT_EC_PERCENT,g=Ke.DEFAULT_AZTEC_LAYERS;return a!=null&&(a.has(Nt.CHARACTER_SET)&&(c=Za.forName(a.get(Nt.CHARACTER_SET).toString())),a.has(Nt.ERROR_CORRECTION)&&(d=O.parseInt(a.get(Nt.ERROR_CORRECTION).toString())),a.has(Nt.AZTEC_LAYERS)&&(g=O.parseInt(a.get(Nt.AZTEC_LAYERS).toString()))),Mi.encodeLayers(e,t,n,r,c,d,g)}static encodeLayers(e,t,n,r,a,c,d){if(t!==xe.AZTEC)throw new y("Can only encode AZTEC, but got "+t);let g=Ke.encode(ne.getBytes(e,a),c,d);return Mi.renderResult(g,n,r)}static renderResult(e,t,n){let r=e.getMatrix();if(r==null)throw new Ue;let a=r.getWidth(),c=r.getHeight(),d=Math.max(t,a),g=Math.max(n,c),w=Math.min(d/a,g/c),E=(d-a*w)/2,A=(g-c*w)/2,I=new W(d,g);for(let R=0,D=A;R<c;R++,D+=w)for(let F=0,Y=E;F<a;F++,Y+=w)r.get(F,R)&&I.setRegion(Y,D,w,w);return I}}i.AbstractExpandedDecoder=Io,i.ArgumentException=C,i.ArithmeticException=kt,i.AztecCode=Ya,i.AztecCodeReader=_r,i.AztecCodeWriter=Mi,i.AztecDecoder=$e,i.AztecDetector=Un,i.AztecDetectorResult=Ai,i.AztecEncoder=Ke,i.AztecHighLevelEncoder=Kr,i.AztecPoint=At,i.BarcodeFormat=xe,i.Binarizer=k,i.BinaryBitmap=N,i.BitArray=P,i.BitMatrix=W,i.BitSource=ko,i.BrowserAztecCodeReader=Gr,i.BrowserBarcodeReader=dg,i.BrowserCodeReader=Ee,i.BrowserDatamatrixCodeReader=hg,i.BrowserMultiFormatReader=Ag,i.BrowserPDF417Reader=Ig,i.BrowserQRCodeReader=Sg,i.BrowserQRCodeSvgWriter=lr,i.CharacterSetECI=j,i.ChecksumException=M,i.Code128Reader=ee,i.Code39Reader=ae,i.DataMatrixDecodedBitStreamParser=Gn,i.DataMatrixReader=Wn,i.DecodeHintType=Z,i.DecoderResult=Ae,i.DefaultGridSampler=Ii,i.DetectorResult=rr,i.EAN13Reader=Be,i.EncodeHintType=Nt,i.Exception=p,i.FormatException=H,i.GenericGF=Te,i.GenericGFPoly=Qe,i.GlobalHistogramBinarizer=z,i.GridSampler=Hr,i.GridSamplerInstance=In,i.HTMLCanvasElementLuminanceSource=re,i.HybridBinarizer=X,i.ITFReader=ye,i.IllegalArgumentException=y,i.IllegalStateException=Ue,i.InvertedLuminanceSource=$,i.LuminanceSource=q,i.MathUtils=Me,i.MultiFormatOneDReader=br,i.MultiFormatReader=qa,i.MultiFormatWriter=Tg,i.NotFoundException=S,i.OneDReader=mt,i.PDF417DecodedBitStreamParser=J,i.PDF417DecoderErrorCorrection=za,i.PDF417Reader=vt,i.PDF417ResultMetadata=Ga,i.PerspectiveTransform=tn,i.PlanarYUVLuminanceSource=Tn,i.QRCodeByteMatrix=Oi,i.QRCodeDataMask=cn,i.QRCodeDecodedBitStreamParser=pt,i.QRCodeDecoderErrorCorrectionLevel=ct,i.QRCodeDecoderFormatInformation=Ft,i.QRCodeEncoder=dt,i.QRCodeEncoderQRCode=ar,i.QRCodeMaskUtil=_t,i.QRCodeMatrixUtil=ke,i.QRCodeMode=Ne,i.QRCodeReader=Xn,i.QRCodeVersion=Se,i.QRCodeWriter=Ir,i.RGBLuminanceSource=Po,i.RSS14Reader=wt,i.RSSExpandedReader=le,i.ReaderException=Ri,i.ReedSolomonDecoder=lt,i.ReedSolomonEncoder=Do,i.ReedSolomonException=Ie,i.Result=me,i.ResultMetadataType=He,i.ResultPoint=we,i.StringUtils=ne,i.UnsupportedOperationException=se,i.VideoInputDevice=he,i.WhiteRectangleDetector=xn,i.WriterException=ot,i.ZXingArrays=B,i.ZXingCharset=Za,i.ZXingInteger=O,i.ZXingStandardCharsets=Lo,i.ZXingStringBuilder=U,i.ZXingStringEncoding=oe,i.ZXingSystem=L,i.createAbstractExpandedDecoder=Va,Object.defineProperty(i,"__esModule",{value:!0})})})(xo,xo.exports);var ut=xo.exports;const jh=nl({__proto__:null,default:Zs(ut)},[ut]);var wa=function(){function o(s,i,u){if(this.formatMap=new Map([[pe.QR_CODE,ut.BarcodeFormat.QR_CODE],[pe.AZTEC,ut.BarcodeFormat.AZTEC],[pe.CODABAR,ut.BarcodeFormat.CODABAR],[pe.CODE_39,ut.BarcodeFormat.CODE_39],[pe.CODE_93,ut.BarcodeFormat.CODE_93],[pe.CODE_128,ut.BarcodeFormat.CODE_128],[pe.DATA_MATRIX,ut.BarcodeFormat.DATA_MATRIX],[pe.MAXICODE,ut.BarcodeFormat.MAXICODE],[pe.ITF,ut.BarcodeFormat.ITF],[pe.EAN_13,ut.BarcodeFormat.EAN_13],[pe.EAN_8,ut.BarcodeFormat.EAN_8],[pe.PDF_417,ut.BarcodeFormat.PDF_417],[pe.RSS_14,ut.BarcodeFormat.RSS_14],[pe.RSS_EXPANDED,ut.BarcodeFormat.RSS_EXPANDED],[pe.UPC_A,ut.BarcodeFormat.UPC_A],[pe.UPC_E,ut.BarcodeFormat.UPC_E],[pe.UPC_EAN_EXTENSION,ut.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!jh)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=i,this.logger=u;var f=this.createZXingFormats(s),h=new Map;h.set(ut.DecodeHintType.POSSIBLE_FORMATS,f),h.set(ut.DecodeHintType.TRY_HARDER,!1),this.hints=h}return o.prototype.decodeAsync=function(s){var i=this;return new Promise(function(u,f){try{u(i.decode(s))}catch(h){f(h)}})},o.prototype.decode=function(s){var i=new ut.MultiFormatReader(this.verbose,this.hints),u=new ut.HTMLCanvasElementLuminanceSource(s),f=new ut.BinaryBitmap(new ut.HybridBinarizer(u)),h=i.decode(f);return{text:h.text,format:ma.create(this.toHtml5QrcodeSupportedFormats(h.format)),debugData:this.createDebugData()}},o.prototype.createReverseFormatMap=function(){var s=new Map;return this.formatMap.forEach(function(i,u,f){s.set(i,u)}),s},o.prototype.toHtml5QrcodeSupportedFormats=function(s){if(!this.reverseFormatMap.has(s))throw"reverseFormatMap doesn't have ".concat(s);return this.reverseFormatMap.get(s)},o.prototype.createZXingFormats=function(s){for(var i=[],u=0,f=s;u<f.length;u++){var h=f[u];this.formatMap.has(h)?i.push(this.formatMap.get(h)):this.logger.logError("".concat(h," is not supported by")+"ZXingHtml5QrcodeShim")}return i},o.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},o}(),qh=function(o,s,i,u){function f(h){return h instanceof i?h:new i(function(m){m(h)})}return new(i||(i=Promise))(function(h,m){function x(C){try{p(u.next(C))}catch(y){m(y)}}function _(C){try{p(u.throw(C))}catch(y){m(y)}}function p(C){C.done?h(C.value):f(C.value).then(x,_)}p((u=u.apply(o,s||[])).next())})},Zh=function(o,s){var i={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},u,f,h,m;return m={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function x(p){return function(C){return _([p,C])}}function _(p){if(u)throw new TypeError("Generator is already executing.");for(;m&&(m=0,p[0]&&(i=0)),i;)try{if(u=1,f&&(h=p[0]&2?f.return:p[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,p[1])).done)return h;switch(f=0,h&&(p=[p[0]&2,h.value]),p[0]){case 0:case 1:h=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,f=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(h=i.trys,!(h=h.length>0&&h[h.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){i.label=p[1];break}if(p[0]===6&&i.label<h[1]){i.label=h[1],h=p;break}if(h&&i.label<h[2]){i.label=h[2],i.ops.push(p);break}h[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(o,i)}catch(C){p=[6,C],f=0}finally{u=h=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},_a=function(){function o(s,i,u){if(this.formatMap=new Map([[pe.QR_CODE,"qr_code"],[pe.AZTEC,"aztec"],[pe.CODABAR,"codabar"],[pe.CODE_39,"code_39"],[pe.CODE_93,"code_93"],[pe.CODE_128,"code_128"],[pe.DATA_MATRIX,"data_matrix"],[pe.ITF,"itf"],[pe.EAN_13,"ean_13"],[pe.EAN_8,"ean_8"],[pe.PDF_417,"pdf417"],[pe.UPC_A,"upc_a"],[pe.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!o.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=i,this.logger=u;var f=this.createBarcodeDetectorFormats(s);if(this.detector=new BarcodeDetector(f),!this.detector)throw"BarcodeDetector detector not supported"}return o.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var s=new BarcodeDetector({formats:["qr_code"]});return typeof s<"u"},o.prototype.decodeAsync=function(s){return qh(this,void 0,void 0,function(){var i,u;return Zh(this,function(f){switch(f.label){case 0:return[4,this.detector.detect(s)];case 1:if(i=f.sent(),!i||i.length===0)throw"No barcode or QR code detected.";return u=this.selectLargestBarcode(i),[2,{text:u.rawValue,format:ma.create(this.toHtml5QrcodeSupportedFormats(u.format)),debugData:this.createDebugData()}]}})})},o.prototype.selectLargestBarcode=function(s){for(var i=null,u=0,f=0,h=s;f<h.length;f++){var m=h[f],x=m.boundingBox.width*m.boundingBox.height;x>u&&(u=x,i=m)}if(!i)throw"No largest barcode found";return i},o.prototype.createBarcodeDetectorFormats=function(s){for(var i=[],u=0,f=s;u<f.length;u++){var h=f[u];this.formatMap.has(h)?i.push(this.formatMap.get(h)):this.logger.warn("".concat(h," is not supported by")+"BarcodeDetectorDelegate")}return{formats:i}},o.prototype.toHtml5QrcodeSupportedFormats=function(s){if(!this.reverseFormatMap.has(s))throw"reverseFormatMap doesn't have ".concat(s);return this.reverseFormatMap.get(s)},o.prototype.createReverseFormatMap=function(){var s=new Map;return this.formatMap.forEach(function(i,u,f){s.set(i,u)}),s},o.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},o}(),Ca=function(o,s,i,u){function f(h){return h instanceof i?h:new i(function(m){m(h)})}return new(i||(i=Promise))(function(h,m){function x(C){try{p(u.next(C))}catch(y){m(y)}}function _(C){try{p(u.throw(C))}catch(y){m(y)}}function p(C){C.done?h(C.value):f(C.value).then(x,_)}p((u=u.apply(o,s||[])).next())})},Ea=function(o,s){var i={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},u,f,h,m;return m={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function x(p){return function(C){return _([p,C])}}function _(p){if(u)throw new TypeError("Generator is already executing.");for(;m&&(m=0,p[0]&&(i=0)),i;)try{if(u=1,f&&(h=p[0]&2?f.return:p[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,p[1])).done)return h;switch(f=0,h&&(p=[p[0]&2,h.value]),p[0]){case 0:case 1:h=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,f=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(h=i.trys,!(h=h.length>0&&h[h.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){i.label=p[1];break}if(p[0]===6&&i.label<h[1]){i.label=h[1],h=p;break}if(h&&i.label<h[2]){i.label=h[2],i.ops.push(p);break}h[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(o,i)}catch(C){p=[6,C],f=0}finally{u=h=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Yh=function(){function o(s,i,u,f){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=u,i&&_a.isSupported()?(this.primaryDecoder=new _a(s,u,f),this.secondaryDecoder=new wa(s,u,f)):this.primaryDecoder=new wa(s,u,f)}return o.prototype.decodeAsync=function(s){return Ca(this,void 0,void 0,function(){var i;return Ea(this,function(u){switch(u.label){case 0:i=performance.now(),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(s)];case 2:return[2,u.sent()];case 3:return this.possiblyLogPerformance(i),[7];case 4:return[2]}})})},o.prototype.decodeRobustlyAsync=function(s){return Ca(this,void 0,void 0,function(){var i,u;return Ea(this,function(f){switch(f.label){case 0:i=performance.now(),f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(s)];case 2:return[2,f.sent()];case 3:if(u=f.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(s)];throw u;case 4:return this.possiblyLogPerformance(i),[7];case 5:return[2]}})})},o.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},o.prototype.possiblyLogPerformance=function(s){if(this.verbose){var i=performance.now()-s;this.executionResults.push(i),this.executions++,this.possiblyFlushPerformanceReport()}},o.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var s=0,i=0,u=this.executionResults;i<u.length;i++){var f=u[i];s+=f}var h=s/this.executionResults.length;console.log("".concat(h," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},o}(),wo=function(){var o=function(s,i){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(u[h]=f[h])},o(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");o(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}}(),_i=function(o,s,i,u){function f(h){return h instanceof i?h:new i(function(m){m(h)})}return new(i||(i=Promise))(function(h,m){function x(C){try{p(u.next(C))}catch(y){m(y)}}function _(C){try{p(u.throw(C))}catch(y){m(y)}}function p(C){C.done?h(C.value):f(C.value).then(x,_)}p((u=u.apply(o,s||[])).next())})},Ci=function(o,s){var i={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},u,f,h,m;return m={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function x(p){return function(C){return _([p,C])}}function _(p){if(u)throw new TypeError("Generator is already executing.");for(;m&&(m=0,p[0]&&(i=0)),i;)try{if(u=1,f&&(h=p[0]&2?f.return:p[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,p[1])).done)return h;switch(f=0,h&&(p=[p[0]&2,h.value]),p[0]){case 0:case 1:h=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,f=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(h=i.trys,!(h=h.length>0&&h[h.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){i.label=p[1];break}if(p[0]===6&&i.label<h[1]){i.label=h[1],h=p;break}if(h&&i.label<h[2]){i.label=h[2],i.ops.push(p);break}h[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(o,i)}catch(C){p=[6,C],f=0}finally{u=h=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},ya=function(){function o(s,i){this.name=s,this.track=i}return o.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},o.prototype.apply=function(s){var i={};i[this.name]=s;var u={advanced:[i]};return this.track.applyConstraints(u)},o.prototype.value=function(){var s=this.track.getSettings();if(this.name in s){var i=s[this.name];return i}return null},o}(),$h=function(o){wo(s,o);function s(i,u){return o.call(this,i,u)||this}return s.prototype.min=function(){return this.getCapabilities().min},s.prototype.max=function(){return this.getCapabilities().max},s.prototype.step=function(){return this.getCapabilities().step},s.prototype.apply=function(i){var u={};u[this.name]=i;var f={advanced:[u]};return this.track.applyConstraints(f)},s.prototype.getCapabilities=function(){this.failIfNotSupported();var i=this.track.getCapabilities(),u=i[this.name];return{min:u.min,max:u.max,step:u.step}},s.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},s}(ya),Kh=function(o){wo(s,o);function s(i){return o.call(this,"zoom",i)||this}return s}($h),Qh=function(o){wo(s,o);function s(i){return o.call(this,"torch",i)||this}return s}(ya),Jh=function(){function o(s){this.track=s}return o.prototype.zoomFeature=function(){return new Kh(this.track)},o.prototype.torchFeature=function(){return new Qh(this.track)},o}(),e2=function(){function o(s,i,u){this.isClosed=!1,this.parentElement=s,this.mediaStream=i,this.callbacks=u,this.surface=this.createVideoElement(this.parentElement.clientWidth),s.append(this.surface)}return o.prototype.createVideoElement=function(s){var i=document.createElement("video");return i.style.width="".concat(s,"px"),i.style.display="block",i.muted=!0,i.setAttribute("muted","true"),i.playsInline=!0,i},o.prototype.setupSurface=function(){var s=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var i=function(){var u=s.surface.clientWidth,f=s.surface.clientHeight;s.callbacks.onRenderSurfaceReady(u,f),s.surface.removeEventListener("playing",i)};this.surface.addEventListener("playing",i),this.surface.srcObject=this.mediaStream,this.surface.play()},o.create=function(s,i,u,f){return _i(this,void 0,void 0,function(){var h,m;return Ci(this,function(x){switch(x.label){case 0:return h=new o(s,i,f),u.aspectRatio?(m={aspectRatio:u.aspectRatio},[4,h.getFirstTrackOrFail().applyConstraints(m)]):[3,2];case 1:x.sent(),x.label=2;case 2:return h.setupSurface(),[2,h]}})})},o.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},o.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},o.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},o.prototype.resume=function(s){this.failIfClosed();var i=this,u=function(){setTimeout(s,200),i.surface.removeEventListener("playing",u)};this.surface.addEventListener("playing",u),this.surface.play()},o.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},o.prototype.getSurface=function(){return this.failIfClosed(),this.surface},o.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},o.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},o.prototype.applyVideoConstraints=function(s){return _i(this,void 0,void 0,function(){return Ci(this,function(i){if("aspectRatio"in s)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(s)]})})},o.prototype.close=function(){if(this.isClosed)return Promise.resolve();var s=this;return new Promise(function(i,u){var f=s.mediaStream.getVideoTracks(),h=f.length,m=0;s.mediaStream.getVideoTracks().forEach(function(x){s.mediaStream.removeTrack(x),x.stop(),++m,m>=h&&(s.isClosed=!0,s.parentElement.removeChild(s.surface),i())})})},o.prototype.getCapabilities=function(){return new Jh(this.getFirstTrackOrFail())},o}(),t2=function(){function o(s){this.mediaStream=s}return o.prototype.render=function(s,i,u){return _i(this,void 0,void 0,function(){return Ci(this,function(f){return[2,e2.create(s,this.mediaStream,i,u)]})})},o.create=function(s){return _i(this,void 0,void 0,function(){var i,u;return Ci(this,function(f){switch(f.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return i={audio:!1,video:s},[4,navigator.mediaDevices.getUserMedia(i)];case 1:return u=f.sent(),[2,new o(u)]}})})},o}(),ba=function(o,s,i,u){function f(h){return h instanceof i?h:new i(function(m){m(h)})}return new(i||(i=Promise))(function(h,m){function x(C){try{p(u.next(C))}catch(y){m(y)}}function _(C){try{p(u.throw(C))}catch(y){m(y)}}function p(C){C.done?h(C.value):f(C.value).then(x,_)}p((u=u.apply(o,s||[])).next())})},Aa=function(o,s){var i={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},u,f,h,m;return m={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function x(p){return function(C){return _([p,C])}}function _(p){if(u)throw new TypeError("Generator is already executing.");for(;m&&(m=0,p[0]&&(i=0)),i;)try{if(u=1,f&&(h=p[0]&2?f.return:p[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,p[1])).done)return h;switch(f=0,h&&(p=[p[0]&2,h.value]),p[0]){case 0:case 1:h=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,f=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(h=i.trys,!(h=h.length>0&&h[h.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){i.label=p[1];break}if(p[0]===6&&i.label<h[1]){i.label=h[1],h=p;break}if(h&&i.label<h[2]){i.label=h[2],i.ops.push(p);break}h[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(o,i)}catch(C){p=[6,C],f=0}finally{u=h=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},n2=function(){function o(){}return o.failIfNotSupported=function(){return ba(this,void 0,void 0,function(){return Aa(this,function(s){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new o]})})},o.prototype.create=function(s){return ba(this,void 0,void 0,function(){return Aa(this,function(i){return[2,t2.create(s)]})})},o}(),r2=function(o,s,i,u){function f(h){return h instanceof i?h:new i(function(m){m(h)})}return new(i||(i=Promise))(function(h,m){function x(C){try{p(u.next(C))}catch(y){m(y)}}function _(C){try{p(u.throw(C))}catch(y){m(y)}}function p(C){C.done?h(C.value):f(C.value).then(x,_)}p((u=u.apply(o,s||[])).next())})},i2=function(o,s){var i={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},u,f,h,m;return m={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function x(p){return function(C){return _([p,C])}}function _(p){if(u)throw new TypeError("Generator is already executing.");for(;m&&(m=0,p[0]&&(i=0)),i;)try{if(u=1,f&&(h=p[0]&2?f.return:p[0]?f.throw||((h=f.return)&&h.call(f),0):f.next)&&!(h=h.call(f,p[1])).done)return h;switch(f=0,h&&(p=[p[0]&2,h.value]),p[0]){case 0:case 1:h=p;break;case 4:return i.label++,{value:p[1],done:!1};case 5:i.label++,f=p[1],p=[0];continue;case 7:p=i.ops.pop(),i.trys.pop();continue;default:if(h=i.trys,!(h=h.length>0&&h[h.length-1])&&(p[0]===6||p[0]===2)){i=0;continue}if(p[0]===3&&(!h||p[1]>h[0]&&p[1]<h[3])){i.label=p[1];break}if(p[0]===6&&i.label<h[1]){i.label=h[1],h=p;break}if(h&&i.label<h[2]){i.label=h[2],i.ops.push(p);break}h[2]&&i.ops.pop(),i.trys.pop();continue}p=s.call(o,i)}catch(C){p=[6,C],f=0}finally{u=h=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},o2=function(){function o(){}return o.retrieve=function(){if(navigator.mediaDevices)return o.getCamerasFromMediaDevices();var s=MediaStreamTrack;return MediaStreamTrack&&s.getSources?o.getCamerasFromMediaStreamTrack():o.rejectWithError()},o.rejectWithError=function(){var s=xr.unableToQuerySupportedDevices();return o.isHttpsOrLocalhost()||(s=xr.insecureContextCameraQueryError()),Promise.reject(s)},o.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var s=location.host.split(":")[0];return s==="127.0.0.1"||s==="localhost"},o.getCamerasFromMediaDevices=function(){return r2(this,void 0,void 0,function(){var s,i,u,f,h,m,x;return i2(this,function(_){switch(_.label){case 0:return s=function(p){for(var C=p.getVideoTracks(),y=0,N=C;y<N.length;y++){var M=N[y];M.enabled=!1,M.stop(),p.removeTrack(M)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return i=_.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(u=_.sent(),f=[],h=0,m=u;h<m.length;h++)x=m[h],x.kind==="videoinput"&&f.push({id:x.deviceId,label:x.label});return s(i),[2,f]}})})},o.getCamerasFromMediaStreamTrack=function(){return new Promise(function(s,i){var u=function(h){for(var m=[],x=0,_=h;x<_.length;x++){var p=_[x];p.kind==="video"&&m.push({id:p.id,label:p.label})}s(m)},f=MediaStreamTrack;f.getSources(u)})},o}(),xt;(function(o){o[o.UNKNOWN=0]="UNKNOWN",o[o.NOT_STARTED=1]="NOT_STARTED",o[o.SCANNING=2]="SCANNING",o[o.PAUSED=3]="PAUSED"})(xt||(xt={}));var s2=function(){function o(){this.state=xt.NOT_STARTED,this.onGoingTransactionNewState=xt.UNKNOWN}return o.prototype.directTransition=function(s){this.failIfTransitionOngoing(),this.validateTransition(s),this.state=s},o.prototype.startTransition=function(s){return this.failIfTransitionOngoing(),this.validateTransition(s),this.onGoingTransactionNewState=s,this},o.prototype.execute=function(){if(this.onGoingTransactionNewState===xt.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var s=this.onGoingTransactionNewState;this.onGoingTransactionNewState=xt.UNKNOWN,this.directTransition(s)},o.prototype.cancel=function(){if(this.onGoingTransactionNewState===xt.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=xt.UNKNOWN},o.prototype.getState=function(){return this.state},o.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==xt.UNKNOWN)throw"Cannot transition to a new state, already under transition"},o.prototype.validateTransition=function(s){switch(this.state){case xt.UNKNOWN:throw"Transition from unknown is not allowed";case xt.NOT_STARTED:this.failIfNewStateIs(s,[xt.PAUSED]);break;case xt.SCANNING:break;case xt.PAUSED:break}},o.prototype.failIfNewStateIs=function(s,i){for(var u=0,f=i;u<f.length;u++){var h=f[u];if(s===h)throw"Cannot transition from ".concat(this.state," to ").concat(s)}},o}(),a2=function(){function o(s){this.stateManager=s}return o.prototype.startTransition=function(s){return this.stateManager.startTransition(s)},o.prototype.directTransition=function(s){this.stateManager.directTransition(s)},o.prototype.getState=function(){return this.stateManager.getState()},o.prototype.canScanFile=function(){return this.stateManager.getState()===xt.NOT_STARTED},o.prototype.isScanning=function(){return this.stateManager.getState()!==xt.NOT_STARTED},o.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===xt.SCANNING},o.prototype.isPaused=function(){return this.stateManager.getState()===xt.PAUSED},o}(),l2=function(){function o(){}return o.create=function(){return new a2(new s2)},o}(),c2=function(){var o=function(s,i){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,f){u.__proto__=f}||function(u,f){for(var h in f)Object.prototype.hasOwnProperty.call(f,h)&&(u[h]=f[h])},o(s,i)};return function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");o(s,i);function u(){this.constructor=s}s.prototype=i===null?Object.create(i):(u.prototype=i.prototype,new u)}}(),en=function(o){c2(s,o);function s(){return o!==null&&o.apply(this,arguments)||this}return s.DEFAULT_WIDTH=300,s.DEFAULT_WIDTH_OFFSET=2,s.FILE_SCAN_MIN_HEIGHT=300,s.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,s.MIN_QR_BOX_SIZE=50,s.SHADED_LEFT=1,s.SHADED_RIGHT=2,s.SHADED_TOP=3,s.SHADED_BOTTOM=4,s.SHADED_REGION_ELEMENT_ID="qr-shaded-region",s.VERBOSE=!1,s.BORDER_SHADER_DEFAULT_COLOR="#ffffff",s.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",s}(Gh),u2=function(){function o(s,i){this.logger=i,this.fps=en.SCAN_DEFAULT_FPS,s?(s.fps&&(this.fps=s.fps),this.disableFlip=s.disableFlip===!0,this.qrbox=s.qrbox,this.aspectRatio=s.aspectRatio,this.videoConstraints=s.videoConstraints):this.disableFlip=en.DEFAULT_DISABLE_FLIP}return o.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?xa.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},o.prototype.isShadedBoxEnabled=function(){return!Dn(this.qrbox)},o.create=function(s,i){return new o(s,i)},o}(),Ia=function(){function o(s,i){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(s))throw"HTML Element with id=".concat(s," not found");this.elementId=s,this.verbose=!1;var u;typeof i=="boolean"?this.verbose=i===!0:i&&(u=i,this.verbose=u.verbose===!0,u.experimentalFeatures),this.logger=new Xh(this.verbose),this.qrcode=new Yh(this.getSupportedFormats(i),this.getUseBarCodeDetectorIfSupported(u),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=l2.create()}return o.prototype.start=function(s,i,u,f){var h=this;if(!s)throw"cameraIdOrConfig is required";if(!u||typeof u!="function")throw"qrCodeSuccessCallback is required and should be a function.";var m;f?m=f:m=this.verbose?this.logger.log:function(){};var x=u2.create(i,this.logger);this.clearElement();var _=!1;x.videoConstraints&&(x.isMediaStreamConstraintsValid()?_=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var p=_,C=document.getElementById(this.elementId);C.clientWidth?C.clientWidth:en.DEFAULT_WIDTH,C.style.position="relative",this.shouldScan=!0,this.element=C;var y=this,N=this.stateManagerProxy.startTransition(xt.SCANNING);return new Promise(function(M,k){var L=p?x.videoConstraints:y.createVideoConstraints(s);if(!L){N.cancel(),k("videoConstraints should be defined");return}var v={};(!p||x.aspectRatio)&&(v.aspectRatio=x.aspectRatio);var V={onRenderSurfaceReady:function(B,O){y.setupUi(B,O,x),y.isScanning=!0,y.foreverScan(x,u,m)}};n2.failIfNotSupported().then(function(B){B.create(L).then(function(O){return O.render(h.element,v,V).then(function(P){y.renderedCamera=P,N.execute(),M(null)}).catch(function(P){N.cancel(),k(P)})}).catch(function(O){N.cancel(),k(xr.errorGettingUserMedia(O))})}).catch(function(B){N.cancel(),k(xr.cameraStreamingNotSupported())})})},o.prototype.pause=function(s){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(xt.PAUSED),this.showPausedState(),(Dn(s)||s!==!0)&&(s=!1),s&&this.renderedCamera&&this.renderedCamera.pause()},o.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var s=this,i=function(){s.stateManagerProxy.directTransition(xt.SCANNING),s.hidePausedState()};if(!this.renderedCamera.isPaused()){i();return}this.renderedCamera.resume(function(){i()})},o.prototype.getState=function(){return this.stateManagerProxy.getState()},o.prototype.stop=function(){var s=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var i=this.stateManagerProxy.startTransition(xt.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var u=function(){if(s.element){var h=document.getElementById(en.SHADED_REGION_ELEMENT_ID);h&&s.element.removeChild(h)}},f=this;return this.renderedCamera.close().then(function(){return f.renderedCamera=null,f.element&&(f.element.removeChild(f.canvasElement),f.canvasElement=null),u(),f.qrRegion&&(f.qrRegion=null),f.context&&(f.context=null),i.execute(),f.hidePausedState(),f.isScanning=!1,Promise.resolve()})},o.prototype.scanFile=function(s,i){return this.scanFileV2(s,i).then(function(u){return u.decodedText})},o.prototype.scanFileV2=function(s,i){var u=this;if(!s||!(s instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Dn(i)&&(i=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(f,h){u.possiblyCloseLastScanImageFile(),u.clearElement(),u.lastScanImageFile=URL.createObjectURL(s);var m=new Image;m.onload=function(){var x=m.width,_=m.height,p=document.getElementById(u.elementId),C=p.clientWidth?p.clientWidth:en.DEFAULT_WIDTH,y=Math.max(p.clientHeight?p.clientHeight:_,en.FILE_SCAN_MIN_HEIGHT),N=u.computeCanvasDrawConfig(x,_,C,y);if(i){var M=u.createCanvasElement(C,y,"qr-canvas-visible");M.style.display="inline-block",p.appendChild(M);var k=M.getContext("2d");if(!k)throw"Unable to get 2d context from canvas";k.canvas.width=C,k.canvas.height=y,k.drawImage(m,0,0,x,_,N.x,N.y,N.width,N.height)}var L=en.FILE_SCAN_HIDDEN_CANVAS_PADDING,v=Math.max(m.width,N.width),V=Math.max(m.height,N.height),B=v+2*L,O=V+2*L,P=u.createCanvasElement(B,O);p.appendChild(P);var G=P.getContext("2d");if(!G)throw"Unable to get 2d context from canvas";G.canvas.width=B,G.canvas.height=O,G.drawImage(m,0,0,x,_,L,L,v,V);try{u.qrcode.decodeRobustlyAsync(P).then(function(Z){f(pa.createFromQrcodeResult(Z))}).catch(h)}catch(Z){h("QR code parse error, error = ".concat(Z))}},m.onerror=h,m.onabort=h,m.onstalled=h,m.onsuspend=h,m.src=URL.createObjectURL(s)})},o.prototype.clear=function(){this.clearElement()},o.getCameras=function(){return o2.retrieve()},o.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},o.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},o.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},o.prototype.applyVideoConstraints=function(s){if(s){if(!xa.isMediaStreamConstraintsValid(s,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(s)},o.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},o.prototype.getSupportedFormats=function(s){var i=[pe.QR_CODE,pe.AZTEC,pe.CODABAR,pe.CODE_39,pe.CODE_93,pe.CODE_128,pe.DATA_MATRIX,pe.MAXICODE,pe.ITF,pe.EAN_13,pe.EAN_8,pe.PDF_417,pe.RSS_14,pe.RSS_EXPANDED,pe.UPC_A,pe.UPC_E,pe.UPC_EAN_EXTENSION];if(!s||typeof s=="boolean"||!s.formatsToSupport)return i;if(!Array.isArray(s.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(s.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var u=[],f=0,h=s.formatsToSupport;f<h.length;f++){var m=h[f];Hh(m)?u.push(m):this.logger.warn("Invalid format: ".concat(m," passed in config, ignoring."))}if(u.length===0)throw"None of formatsToSupport match supported values.";return u},o.prototype.getUseBarCodeDetectorIfSupported=function(s){if(Dn(s))return!0;if(!Dn(s.useBarCodeDetectorIfSupported))return s.useBarCodeDetectorIfSupported!==!1;if(Dn(s.experimentalFeatures))return!0;var i=s.experimentalFeatures;return Dn(i.useBarCodeDetectorIfSupported)?!0:i.useBarCodeDetectorIfSupported!==!1},o.prototype.validateQrboxSize=function(s,i,u){var f=this,h=u.qrbox;this.validateQrboxConfig(h);var m=this.toQrdimensions(s,i,h),x=function(p){if(p<en.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(en.MIN_QR_BOX_SIZE,"px.")},_=function(p){return p>s&&(f.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=s),p};x(m.width),x(m.height),m.width=_(m.width)},o.prototype.validateQrboxConfig=function(s){if(typeof s!="number"&&typeof s!="function"&&(s.width===void 0||s.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},o.prototype.toQrdimensions=function(s,i,u){if(typeof u=="number")return{width:u,height:u};if(typeof u=="function")try{return u(s,i)}catch(f){throw new Error("qrbox config was passed as a function but it failed with unknown error"+f)}return u},o.prototype.setupUi=function(s,i,u){u.isShadedBoxEnabled()&&this.validateQrboxSize(s,i,u);var f=Dn(u.qrbox)?{width:s,height:i}:u.qrbox;this.validateQrboxConfig(f);var h=this.toQrdimensions(s,i,f);h.height>i&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var m=u.isShadedBoxEnabled()&&h.height<=i,x={x:0,y:0,width:s,height:i},_=m?this.getShadedRegionBounds(s,i,h):x,p=this.createCanvasElement(_.width,_.height),C={willReadFrequently:!0},y=p.getContext("2d",C);y.canvas.width=_.width,y.canvas.height=_.height,this.element.append(p),m&&this.possiblyInsertShadingElement(this.element,s,i,h),this.createScannerPausedUiElement(this.element),this.qrRegion=_,this.context=y,this.canvasElement=p},o.prototype.createScannerPausedUiElement=function(s){var i=document.createElement("div");i.innerText=xr.scannerPaused(),i.style.display="none",i.style.position="absolute",i.style.top="0px",i.style.zIndex="1",i.style.background="rgba(9, 9, 9, 0.46)",i.style.color="#FFECEC",i.style.textAlign="center",i.style.width="100%",s.appendChild(i),this.scannerPausedUiElement=i},o.prototype.scanContext=function(s,i){var u=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(f){return s(f.text,pa.createFromQrcodeResult(f)),u.possiblyUpdateShaders(!0),!0}).catch(function(f){u.possiblyUpdateShaders(!1);var h=xr.codeParseError(f);return i(h,Wh.createFrom(h)),!1})},o.prototype.foreverScan=function(s,i,u){var f=this;if(this.shouldScan&&this.renderedCamera){var h=this.renderedCamera.getSurface(),m=h.videoWidth/h.clientWidth,x=h.videoHeight/h.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var _=this.qrRegion.width*m,p=this.qrRegion.height*x,C=this.qrRegion.x*m,y=this.qrRegion.y*x;this.context.drawImage(h,C,y,_,p,0,0,this.qrRegion.width,this.qrRegion.height);var N=function(){f.foreverScanTimeout=setTimeout(function(){f.foreverScan(s,i,u)},f.getTimeoutFps(s.fps))};this.scanContext(i,u).then(function(M){!M&&s.disableFlip!==!0?(f.context.translate(f.context.canvas.width,0),f.context.scale(-1,1),f.scanContext(i,u).finally(function(){N()})):N()}).catch(function(M){f.logger.logError("Error happend while scanning context",M),N()})}},o.prototype.createVideoConstraints=function(s){if(typeof s=="string")return{deviceId:{exact:s}};if(typeof s=="object"){var i="facingMode",u="deviceId",f={user:!0,environment:!0},h="exact",m=function(k){if(k in f)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(k,"'")},x=Object.keys(s);if(x.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(x.length," keys");var _=Object.keys(s)[0];if(_!==i&&_!==u)throw"Only '".concat(i,"' and '").concat(u,"' ")+" are supported for 'cameraIdOrConfig'";if(_===i){var p=s.facingMode;if(typeof p=="string"){if(m(p))return{facingMode:p}}else if(typeof p=="object")if(h in p){if(m(p["".concat(h)]))return{facingMode:{exact:p["".concat(h)]}}}else throw"'facingMode' should be string or object with"+" ".concat(h," as key.");else{var C=typeof p;throw"Invalid type of 'facingMode' = ".concat(C)}}else{var y=s.deviceId;if(typeof y=="string")return{deviceId:y};if(typeof y=="object"){if(h in y)return{deviceId:{exact:y["".concat(h)]}};throw"'deviceId' should be string or object with"+" ".concat(h," as key.")}else{var N=typeof y;throw"Invalid type of 'deviceId' = ".concat(N)}}}var M=typeof s;throw"Invalid type of 'cameraIdOrConfig' = ".concat(M)},o.prototype.computeCanvasDrawConfig=function(s,i,u,f){if(s<=u&&i<=f){var h=(u-s)/2,m=(f-i)/2;return{x:h,y:m,width:s,height:i}}else{var x=s,_=i;return s>u&&(i=u/s*i,s=u),i>f&&(s=f/i*s,i=f),this.logger.log("Image downsampled from "+"".concat(x,"X").concat(_)+" to ".concat(s,"X").concat(i,".")),this.computeCanvasDrawConfig(s,i,u,f)}},o.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var s=document.getElementById(this.elementId);s&&(s.innerHTML="")},o.prototype.possiblyUpdateShaders=function(s){this.qrMatch!==s&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(i){i.style.backgroundColor=s?en.BORDER_SHADER_MATCH_COLOR:en.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=s)},o.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},o.prototype.createCanvasElement=function(s,i,u){var f=s,h=i,m=document.createElement("canvas");return m.style.width="".concat(f,"px"),m.style.height="".concat(h,"px"),m.style.display="none",m.id=Dn(u)?"qr-canvas":u,m},o.prototype.getShadedRegionBounds=function(s,i,u){if(u.width>s||u.height>i)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(s-u.width)/2,y:(i-u.height)/2,width:u.width,height:u.height}},o.prototype.possiblyInsertShadingElement=function(s,i,u,f){if(!(i-f.width<1||u-f.height<1)){var h=document.createElement("div");h.style.position="absolute";var m=(i-f.width)/2,x=(u-f.height)/2;if(h.style.borderLeft="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),h.style.borderRight="".concat(m,"px solid rgba(0, 0, 0, 0.48)"),h.style.borderTop="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),h.style.borderBottom="".concat(x,"px solid rgba(0, 0, 0, 0.48)"),h.style.boxSizing="border-box",h.style.top="0px",h.style.bottom="0px",h.style.left="0px",h.style.right="0px",h.id="".concat(en.SHADED_REGION_ELEMENT_ID),i-f.width<11||u-f.height<11)this.hasBorderShaders=!1;else{var _=5,p=40;this.insertShaderBorders(h,p,_,-_,null,0,!0),this.insertShaderBorders(h,p,_,-_,null,0,!1),this.insertShaderBorders(h,p,_,null,-_,0,!0),this.insertShaderBorders(h,p,_,null,-_,0,!1),this.insertShaderBorders(h,_,p+_,-_,null,-_,!0),this.insertShaderBorders(h,_,p+_,null,-_,-_,!0),this.insertShaderBorders(h,_,p+_,-_,null,-_,!1),this.insertShaderBorders(h,_,p+_,null,-_,-_,!1),this.hasBorderShaders=!0}s.append(h)}},o.prototype.insertShaderBorders=function(s,i,u,f,h,m,x){var _=document.createElement("div");_.style.position="absolute",_.style.backgroundColor=en.BORDER_SHADER_DEFAULT_COLOR,_.style.width="".concat(i,"px"),_.style.height="".concat(u,"px"),f!==null&&(_.style.top="".concat(f,"px")),h!==null&&(_.style.bottom="".concat(h,"px")),x?_.style.left="".concat(m,"px"):_.style.right="".concat(m,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(_),s.appendChild(_)},o.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},o.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},o.prototype.getTimeoutFps=function(s){return 1e3/s},o}(),Sa;(function(o){o[o.STATUS_DEFAULT=0]="STATUS_DEFAULT",o[o.STATUS_SUCCESS=1]="STATUS_SUCCESS",o[o.STATUS_WARNING=2]="STATUS_WARNING",o[o.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Sa||(Sa={}));const d2={width:"38",height:"38",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"none"},f2=["stroke"],h2=["stroke"],g2=["stroke"],m2=["stroke"],p2=["stroke"],x2=l.defineComponent({__name:"QR",props:{color:{type:String,required:!1,default:"#FFFFFF"}},setup(o){return(s,i)=>(l.openBlock(),l.createElementBlock("svg",d2,[l.createElementVNode("path",{d:"M11 11H7V7h4ZM17 7h-2v2h2ZM13 17h4v-4h-4ZM7 17h2v-2H7Z",stroke:o.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,8,f2),l.createElementVNode("path",{d:"M8 3H4a1 1 0 0 0-1 1V8",stroke:o.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,8,h2),l.createElementVNode("path",{d:"M21 8V4a1 1 0 0 0-1-1H16",stroke:o.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,8,g2),l.createElementVNode("path",{d:"M3 16v4a1 1 0 0 0 1 1H8",stroke:o.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,8,m2),l.createElementVNode("path",{d:"M16 21h4a1 1 0 0 0 1-1V16",stroke:o.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5"},null,8,p2)]))}}),_o={back:["Задняя","Задней","Зад","e pasme","rear","back","atzekoa","задні","отзад","pozadi","cefn","hátulsó","traseira","achterkant","όπισθεν","bag","דערציען","cúil","aftan","trasero","posteriore","posterior","aizmugure","galinis","задниот дел","wara","hinteren","bak","tył","tyl","traseira","spate","задњи","zadný","zadaj","задній","takaosa","arrière","straga","zadní","bak","tagumine","environment","arxa","թիկունք","পিছনে","နောက်ဘက်","ở phía sau","უკანა","પાછળ","артқы","ಹಿಂದಿನ","後部","后部","뒤쪽","ខាងក្រោយ","ຫລັງ","പുറകിലുള്ള","मागील","арын","पछाडि","පසුපස","пушти","หลัง","பின்புறம்","వెనుక","arka","orqa","پیچھے","पिछला","qab","後方","مؤخرة","חלק אחורי","عقب","agter","ngemuva","azụ","leyin","kamorao","gadaale","nyuma","baya","kumbuyo","belakang","aoriana","belakang","muri","luyo","likuran","mburi","dèyè","tergo","malantaŭo"],front:["FaceTime","Передняя","përpara","front","aurrean","пярэдні","отпред","front","blaen","elülső","diante","voorkant","εμπρός","foran","פראָנט","tosaigh","framan","frente","davanti","davant","priekšā","priekyje","напред","quddiem","Vorderseite","front","przód","frente","față","фронт","vpredu","spredaj","перед","edessä","devant","ispred","přední","främre","ees","ön","ճակատ","সামনে","ရှေ့","đằng trước","წინა","આગળ","алдыңғы","ಮುಂಭಾಗ","正面","正面","앞쪽","ខាងមុខ","ດ້ານໜ້າ","മുന്നിൽ","समोर","урд","अगाडि","ඉදිරිපස","пеш","ด้านหน้า","முன்","ముందు","ön","old","سامنے","सामने","pem hauv ntej","フロント","أمام","חֲזִית","جلو","voor","ngaphambili","n'ihu","iwaju","ka pele","hore","mbele","gaba","kutsogolo","depan","anoloana","hadapan","mua","atubangan","harap","ngarep","devan","front","fronto"]},w2={key:0,class:"qr_text"},_2=l.defineComponent({__name:"QrCameraScanner",props:{axiosInstanceGet:{type:[Function,Object]},is_toggleAffiliation:{type:Boolean},is_notification:{type:Boolean},notificationData:{},tableData:{},isQr:{type:[Boolean,null]},takeDataTable:{type:Function}},emits:["update:tableData","update:notificationData","update:is_notification","update:is_toggleAffiliation"],setup(o,{emit:s}){const i=o;let u=null;const f=l.ref(!1),h=l.ref(!1),m=l.ref(!1),x=l.ref(!1);let _=null;const p=yt(),{itemThemes:C}=_e.storeToRefs(p),y=s,N=V=>V.replace(/^[\s\S]*?((?:tel|sms|smsto|mailto|callto|facetime|viber|whatsapp):)?[\s\S]*?(%2B)?[\s\S]*?/i,(B,O,P)=>P?"+":""),M=async(V,B)=>{var Z,H,ie;if(console.log(V,B),x.value)return;i.isQr||(x.value=!0),v();const O=/[?&]table_id=([a-zA-Z0-9-]+)/,P=V.match(O),G=V.match(/\/([a-f0-9\-]{36})\?/);if(i.isQr){if(P&&G)return(Z=i.takeDataTable)==null?void 0:Z.call(i,G[1],P[1],"qr");{const j=localStorage.getItem("orgID");if(j){const se=await i.axiosInstanceGet.get(`org_unit/${j}/table`,{params:{external_link:V}}).then(oe=>{var ne,U;return((ne=oe.data)==null?void 0:ne.length)>0?(U=oe.data[0])==null?void 0:U.id:null}).catch(()=>null);if(se)return(H=i.takeDataTable)==null?void 0:H.call(i,j,se)}}y("update:is_notification",!0),y("update:notificationData",{textNotification:"Стол не найден"}),y("update:tableData",null),y("update:is_toggleAffiliation",!0)}else{const j=new yn,se=V||B.text,oe=N(se);try{await j.authorizeByCard(oe);const ne=await j.getProfile();y("update:is_notification",!0),y("update:notificationData",{textNotification:`Здравствуйте, ${ne.first_name}
|
|
31
|
-
Баланс: ${ne.balance}`})}catch(ne){y("update:is_notification",!0),y("update:notificationData",{textNotification:((ie=ne.response)==null?void 0:ie.user_friendly_message)||"Карта не найдена"})}finally{m.value=!0,_&&clearTimeout(_),_=setTimeout(()=>{m.value=!1},2e3),x.value=!1}}};window.debugScan=M;const k=()=>{},L=async()=>{if(!(f.value||u!=null&&u.isScanning||m.value))try{f.value=!0;try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(Z=>Z.stop())}catch{y("update:is_notification",!0),y("update:notificationData",{textNotification:"Разрешите доступ к камере"}),f.value=!1,y("update:is_toggleAffiliation",!0);return}u=new Ia("reader");const V=await Ia.getCameras();if(!V||V.length===0){console.error("Камеры не найдены"),f.value=!1;return}let B;if(i.isQr)B=V.find(G=>_o.back.some(Z=>new RegExp(Z,"i").test(G.label))),B||(B=V.find(G=>_o.front.some(Z=>new RegExp(Z,"i").test(G.label))));else if(B=V.find(G=>_o.front.some(Z=>new RegExp(Z,"i").test(G.label))),B||(B=V.find(G=>new RegExp("amera","i").test(G.label))),!B){y("update:is_notification",!0),y("update:notificationData",{textNotification:"Не найдена фронтальная камера. Для сканирования карт нужна фронтальная камера."}),f.value=!1,y("update:is_toggleAffiliation",!0);return}const O=i.isQr?[pe.QR_CODE]:[pe.QR_CODE,pe.PDF_417,pe.EAN_13,pe.EAN_8,pe.CODE_128],P={fps:60,qrbox:{width:320,height:500}};await u.start(B.id,P,M,k,void 0,O),h.value=!0}catch(V){y("update:is_notification",!0),y("update:notificationData",{textNotification:"Разрешите доступ к камере для сканирования"}),console.error("Ошибка доступа к камере:",V),f.value=!1,h.value=!1,y("update:is_toggleAffiliation",!0)}},v=async()=>{if(u&&u.isScanning)try{await u.stop(),f.value=!1,u=null}catch(V){console.error("Ошибка остановки камеры:",V)}else f.value=!1,u=null,y("update:is_toggleAffiliation",!0);h.value=!1};return l.onUnmounted(()=>{f.value&&v(),_&&(clearTimeout(_),_=null),x.value=!1,m.value=!1,h.value=!1}),(V,B)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.withDirectives(l.createElementVNode("div",{class:"blackWindow",onClick:v},[B[0]||(B[0]=l.createElementVNode("div",{id:"reader"},null,-1)),h.value&&!o.isQr?(l.openBlock(),l.createElementBlock("p",w2,"Наведите QR на камеру")):l.createCommentVNode("",!0)],512),[[l.vShow,f.value]])])),l.createVNode(x2,{color:o.isQr?void 0:"#FFFFFF",onClick:L},null,8,["color"])]))}}),Co=_e.defineStore("modulesLib",()=>{const o=l.ref(!1),s=l.ref({textNotification:""});return{is_notification_lib:o,notificationData_lib:s,showNotification:u=>{o.value=!0,s.value.textNotification=u}}}),Ei=Symbol("clickOutside"),C2={mounted(o,s){o[Ei]=i=>{o.contains(i.target)||s.value(i)},document.addEventListener("click",o[Ei])},unmounted(o){o[Ei]&&document.removeEventListener("click",o[Ei])}};class E2{constructor(s){je(this,"value");je(this,"next");this.value=s}}class y2{constructor(){vi(this,jt);vi(this,Vn);vi(this,tr);this.clear()}enqueue(s){const i=new E2(s);fn(this,jt)?(fn(this,Vn).next=i,On(this,Vn,i)):(On(this,jt,i),On(this,Vn,i)),zo(this,tr)._++}dequeue(){const s=fn(this,jt);if(s)return On(this,jt,fn(this,jt).next),zo(this,tr)._--,fn(this,jt)||On(this,Vn,void 0),s.value}peek(){if(fn(this,jt))return fn(this,jt).value}clear(){On(this,jt,void 0),On(this,Vn,void 0),On(this,tr,0)}get size(){return fn(this,tr)}*[Symbol.iterator](){let s=fn(this,jt);for(;s;)yield s.value,s=s.next}*drain(){for(;fn(this,jt);)yield this.dequeue()}}jt=new WeakMap,Vn=new WeakMap,tr=new WeakMap;function b2(o){Na(o);const s=new y2;let i=0;const u=()=>{i<o&&s.size>0&&(i++,s.dequeue()())},f=()=>{i--,u()},h=async(_,p,C)=>{const y=(async()=>_(...C))();p(y);try{await y}catch{}f()},m=(_,p,C)=>{new Promise(y=>{s.enqueue(y)}).then(h.bind(void 0,_,p,C)),i<o&&u()},x=(_,...p)=>new Promise(C=>{m(_,C,p)});return Object.defineProperties(x,{activeCount:{get:()=>i},pendingCount:{get:()=>s.size},clearQueue:{value(){s.clear()}},concurrency:{get:()=>o,set(_){Na(_),o=_,queueMicrotask(()=>{for(;i<o&&s.size>0;)u()})}},map:{async value(_,p){const C=Array.from(_,(y,N)=>this(p,y,N));return Promise.all(C)}}}),x}function Na(o){if(!((Number.isInteger(o)||o===Number.POSITIVE_INFINITY)&&o>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let Xt=null;const Ta=b2(5),A2=async(o,s)=>{Xt&&T2();const i=at(),u=yt(),f=Co(),h=Tt(),{itemThemes:m}=_e.storeToRefs(u),{displayCards:x}=_e.storeToRefs(i),{is_notification_lib:_,notificationData_lib:p}=_e.storeToRefs(f),{stateCard:C,openProduct:y}=_e.storeToRefs(h),N=yn.create();await I2(o),Xt=ri(`wss://${s}/ws/org-unit/${o}/`,{heartbeatTimeout:3e4}),Xt.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",o,")")),Xt.on("error",M=>console.warn("WebSocket ошибка:",M)),Xt.on("close",()=>console.warn("Realtime WebSocket закрыт")),Xt.on("message",async M=>{try{if(M.type)return;m.value.kiosk_hide_menu_update_notification||(p.value.textNotification="Мы обновили меню");const k=M.params||M,L=k.active_groups||[],v=k.updated_groups||[],V=k.updated_product_groups||[],B=await Yn(),O=new Set(L.map(oe=>oe)),P=new Map(x.value.map(oe=>[oe.id,oe])),G=[],Z=B.transaction("groups","readwrite");let ie=await Z.objectStore("groups").openCursor();for(;ie;){const oe=ie.key;!O.has(oe)&&oe!==o&&(G.push(oe),await ie.delete(),P.delete(oe)),ie=await ie.continue()}await Z.done,x.value=Array.from(P.values()),G.length>0&&await S2(O);const j=[...v.map(oe=>Ta(async()=>{const[ne,U]=await Promise.all([N.getGroupByID(oe),N.loadGroupProducts(oe)]);ne.products=U,P.set(oe,ne),await kr(oe,ne),await Ra(ne,U,!0)})),...V.map(oe=>Ta(async()=>{const[ne,U]=await Promise.all([N.getGroupByID(oe),N.loadGroupProducts(oe)]);ne.products=U,P.set(oe,ne),await kr(oe,ne),await Ra(ne,U,!0),await N2(U,oe)}))];await Promise.all(j),x.value=Array.from(P.values()),await Cl(o,x),p.value.textNotification.length>1&&(_.value=!0);const se=C.value.openCard;if(se!=null&&se.id){const oe=new Set(se.groups??[]),ne=new Set;let U=!1;for(const S of P.values()){const z=S==null?void 0:S.products;if(!Array.isArray(z))continue;const X=z.find(q=>(q==null?void 0:q.id)===se.id);if((X==null?void 0:X.adult)===!0){y.value={id:null,visible:!1},h.reset();return}X&&(S==null?void 0:S.id)!=null&&(ne.add(S.id),(v.includes(S.id)||V.includes(S.id))&&(U=!0))}if(ne.size===0){y.value={id:null,visible:!1},h.reset();return}(!(oe.size===ne.size&&[...oe].every(S=>ne.has(S)))||U)&&await N.getSingleProduct(se==null?void 0:se.id)}}catch(k){console.error("ошибка обновления indexedDB [updateIndexedDB]",k)}}),Xt.connect()},I2=async o=>{try{const s=at(),i=await Hi(o);i!=null&&i.data&&(s.displayCards=i.data)}catch(s){console.error("Ошибка загрузки кэша групп:",s)}},ka=async o=>{const s=at(),i=Co(),u=Tt(),{stateCard:f,openProduct:h}=_e.storeToRefs(u),{cartProducts_lib:m}=_e.storeToRefs(s),x=m.value,_=[],p=[],C=f.value.openCard;for(const y of x)o(y)?(_.push(y),(y.id===(C==null?void 0:C.id)||C!=null&&C.adult)&&(h.value={id:null,visible:!1})):p.push(y);if(_.length>0){const y=_.map(N=>N.name).slice(0,3).join(", ");i.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${y}${_.length>3?` и ещё ${_.length-3}`:""}`,m.value=p,s.updateCartInLocalStorage()}},S2=async o=>{await ka(s=>{var i;return(i=s.groups)!=null&&i.length?!s.groups.some(u=>o.has(u)):!0})},N2=async(o,s)=>{const i=at(),u=new Set(o.filter(f=>!f.adult||i.is18Allowed).map(f=>f.id));await ka(f=>{var h;return(h=f.groups)!=null&&h.includes(s)?!u.has(f.id):!1})},Ra=async(o,s,i=!0)=>{if(o.video_link&&yi(o.video_link,`${o.id}_video`,i),o.image_link&&yi(o.image_link,`${o.id}_image`,i),s!=null&&s.length)for(const u of s)u.video_link&&yi(u.video_link,`${u.id}_video`,i),u.image_link&&yi(u.image_link,`${u.id}_image`,i)},yi=async(o,s,i=!1)=>{try{const u=ti();if(!i){const m=await cr(s);if(m){u.updateCacheFromBlob(s,m),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:m}}));return}}const f=await fetch(o);if(!f.ok)throw new Error("Network error");const h=await f.blob();if(h.size===0)throw new Error("Empty blob");await Gi(s,h),u.updateCacheFromBlob(s,h),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:h}}))}catch(u){console.warn(`[MediaCache] Failed for ${s}:`,u)}},T2=()=>{Xt&&(Xt.off("open"),Xt.off("message"),Xt.off("error"),Xt.off("close"),Xt.close(!0),Xt=null)},k2={key:0,class:"valentine-hearts"},R2=l.defineComponent({__name:"FallingHearts",props:{symbols:{default:()=>["❤","♥","💕"]},max:{default:15},interval:{default:1500}},setup(o){const s=o,i=Vt.useDocumentVisibility(),u=Vt.useMediaQuery("(prefers-reduced-motion: reduce)"),f=l.ref([]);let h=null;const m=(C,y)=>Math.random()*(y-C)+C,x=()=>{if(u.value||f.value.length>=s.max)return;const C=s.symbols[Math.floor(Math.random()*s.symbols.length)],y=m(18,26),N=m(5,95),M=m(10,18),k=m(0,.3),L=m(.6,.9),v=Math.floor(m(1,6)),B={id:crypto.randomUUID(),icon:C,style:{left:`${N}%`,fontSize:`${y}px`,color:`rgba(255, 105, 180, ${L})`,animationName:`heartFall${v}`,animationDuration:`${M}s`,animationDelay:`${k}s`}};f.value.push(B);const P=setTimeout(()=>{f.value=f.value.filter(G=>G.id!==B.id),clearTimeout(P)},(k+M+1)*1e3)},_=()=>{if(!u.value){for(let C=0;C<3;C++){const y=setTimeout(()=>{x(),clearTimeout(y)},C*200)}h=setInterval(x,s.interval)}},p=()=>{h&&(clearInterval(h),h=null),f.value=[]};return l.onMounted(()=>{u.value||_()}),l.onUnmounted(()=>{p()}),l.watch(i,(C,y)=>{C==="visible"&&y==="hidden"&&_(),C==="hidden"&&y==="visible"&&p()}),(C,y)=>l.unref(u)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",k2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,N=>(l.openBlock(),l.createElementBlock("span",{key:N.id,class:"heart",style:l.normalizeStyle(N.style)},l.toDisplayString(N.icon),5))),128))]))}}),O2=["src"],B2=l.defineComponent({__name:"BasketImage",props:{id:{},fallback:{}},setup(o){const s=o,{mediaUrl:i}=vn(()=>s.id,()=>s.fallback);return(u,f)=>(l.openBlock(),l.createElementBlock("img",{src:l.unref(i)||""},null,8,O2))}}),M2={class:"button_price_bg"},v2={class:"wrapper_container_price_bg"},D2={class:"button_price"},P2={key:0,class:"image_product_container"},L2=l.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(o){const s=at(),{isDesktop:i}=bn(),{totalPrice_lib:u,cartProducts_lib:f}=_e.storeToRefs(s),h=l.computed(()=>{var m;return(m=f.value)!=null&&m.length,f.value.slice(0,3).map(x=>({id:`${x.id}_image`,fallback:x.image_link}))});return(m,x)=>(l.openBlock(),l.createElementBlock("div",M2,[l.createElementVNode("div",v2,[l.createElementVNode("div",D2,[l.unref(u)>0&&h.value.length>0?(l.openBlock(),l.createElementBlock("div",P2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,_=>(l.openBlock(),l.createElementBlock("div",{key:_.id,class:"filter_image_product"},[l.createVNode(B2,{id:_.id,fallback:_.fallback,class:"img_product"},null,8,["id","fallback"])]))),128))])):l.createCommentVNode("",!0),l.createVNode(l.unref(Et.motion).div,{class:"button_default_main",whilePress:l.unref(i)?{}:{scale:.92},onClick:x[0]||(x[0]=_=>m.$emit("goToCart"))},{default:l.withCtx(()=>[x[2]||(x[2]=l.createElementVNode("div",{class:"icont_cart"},null,-1)),l.createElementVNode("p",null,[l.createVNode(Ut,{price:l.unref(u),fixedFloat:2},null,8,["price"]),x[1]||(x[1]=l.createTextVNode(" ₽",-1))])]),_:1},8,["whilePress"])])])]))}}),Ur=null,{min:er,max:pn,abs:Oa,floor:F2}=Math,Ba=(o,s,i)=>er(i,pn(s,o)),Ma=o=>[...o].sort((s,i)=>s-i),V2=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)},Eo=()=>{let o;return[new Promise(s=>{o=s}),o]},va=o=>{let s;return()=>(o&&(s=o(),o=void 0),s)},zr=(o,s,i)=>{const u=i?"unshift":"push";for(let f=0;f<s;f++)o[u](-1);return o},Da=(o,s)=>{const i=o.t[s];return i===-1?o.o:i},U2=(o,s,i)=>{const u=o.t[s]===-1;return o.t[s]=i,o.i=er(s,o.i),u},bi=(o,s)=>{if(!o.l)return 0;if(o.i>=s)return o.u[s];o.i<0&&(o.u[0]=0,o.i=0);let i=o.i,u=o.u[i];for(;i<s;)u+=Da(o,i),o.u[++i]=u;return o.i=s,u},wr=(o,s,i=0,u=o.l-1)=>{let f=i;for(;i<=u;){const h=F2((i+u)/2);bi(o,h)<=s?(f=h,i=h+1):u=h-1}return Ba(f,0,o.l-1)},Pa=(o,s,i)=>{const u=s-o.l;return o.i=i?-1:er(s-1,o.i),o.l=s,u>0?(zr(o.u,u),zr(o.t,u,i),o.o*u):(o.u.splice(u),(i?o.t.splice(0,-u):o.t.splice(u)).reduce((f,h)=>f-(h===-1?o.o:h),0))},z2=o=>o.documentElement,H2=o=>o.ownerDocument,G2=o=>o.defaultView,La=va(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),W2=va(()=>"scrollBehavior"in z2(document).style),X2=(o,s=40,i=0,u,f=!1)=>{let h=!!i,m=1,x=0,_=0,p=0,C=0,y=0,N=0,M=0,k=0,L=Ur,v=[0,h?pn(i-1,0):-1],V=0,B=!1;const O=((U,W,S)=>({o:W,t:S?zr(S.slice(0,er(U,S.length)),pn(0,U-S.length)):zr([],U),l:U,i:-1,u:zr([],U+1)}))(o,u?u[1]:s,u&&u[0]),P=new Set,G=()=>p-_,Z=()=>G()+y+C,H=(U,W)=>((S,z,X,q)=>{if(q=er(q,S.l-1),bi(S,q)<=z){const $=wr(S,X,q);return[wr(S,z,q,$),$]}{const $=wr(S,z,void 0,q);return[$,wr(S,X,$)]}})(O,U,W,v[0]),ie=()=>bi(O,O.l),j=(U,W)=>{const S=bi(O,U)-y;return W?ie()-S-se(U):S},se=U=>Da(O,U),oe=(U,W=-1)=>O.t[U]===W,ne=U=>{U&&(La()&&M!==0||L&&k===1?y+=U:C+=U)};return{p:()=>{P.clear()},h:()=>m,m:()=>(U=>[U.t.slice(),U.o])(O),v:(U=200)=>{if(!B||h)return v;let W,S;if(N)[W,S]=v;else{let z=pn(0,Z()),X=z+x;f||(U=pn(0,U),M!==1&&(z-=U),M!==2&&(X+=U)),[W,S]=v=H(pn(0,z),pn(0,X)),L&&(W=er(W,L[0]),S=pn(S,L[1]))}return[pn(W,0),er(S,O.l-1)]},S:U=>wr(O,U-_),I:oe,O:j,k:se,j:()=>O.l,N:()=>p,B:()=>M!==0,T:()=>x,q:()=>_,M:ie,P:()=>(N=C,C=0,[N,k===2]),R:(U,W)=>{const S=[U,W];return P.add(S),()=>{P.delete(S)}},A:(U,W)=>{let S,z,X=0;switch(U){case 1:{if(W===p&&k===0)break;const q=N;N=0;const $=W-p,re=Oa($);q&&re<Oa(q)+1||k!==0||(M=$<0?2:1),h&&(h=!1),p=W,X=4;const he=G();he>=-x&&he<=ie()&&(X+=1,z=re>x);break}case 2:X=8,M!==0&&(S=!0,X+=1),M=0,k=0,L=Ur;break;case 3:{const q=W.filter(([$,re])=>!oe($,re));if(!q.length)break;ne(q.reduce(($,[re,he])=>((k===2||(L&&k===1?re<L[0]:j(re+(M===0&&k===0?1:0))<G()))&&($+=he-se(re)),$),0));for(const[$,re]of q){const he=se($),fe=U2(O,$,re);f&&(V+=fe?re:re-he)}f&&x&&V>x&&(ne((($,re)=>{let he=0;const fe=[];$.t.forEach((He,Ae)=>{He!==-1&&(fe.push(He),Ae<re&&he++)}),$.i=-1;const Ee=Ma(fe),me=Ee.length,Ve=me/2|0,xe=me%2==0?(Ee[Ve-1]+Ee[Ve])/2:Ee[Ve],ht=$.o;return(($.o=xe)-ht)*pn(re-he,0)})(O,wr(O,Z()))),f=!1),X=3,z=!0;break}case 4:x!==W&&(x||(B=z=!0),x=W,X=3);break;case 5:W[1]?(ne(Pa(O,W[0],!0)),k=2,X=1):(Pa(O,W[0]),X=1);break;case 6:_=W;break;case 7:k=1;break;case 8:L=H(W,W+x),X=1}X&&(m=1+(2147483647&m),S&&y&&(C+=y,y=0),P.forEach(([q,$])=>{X&q&&$(z)}))}}},yo=setTimeout,bo=(o,s)=>s?-o:o,j2=(o,s,i,u,f,h)=>{const m=Date.now;let x=0,_=!1,p=!1,C=!1,y=!1;const N=(()=>{let V;const B=()=>{V!=Ur&&clearTimeout(V)},O=()=>{B(),V=yo(()=>{V=Ur,(()=>{if(_||p)return _=!1,void N();C=!1,o.A(2)})()},150)};return O.C=B,O})(),M=()=>{x=m(),C&&(y=!0),o.A(1,u()),N()},k=V=>{if(_||!o.B()||V.ctrlKey)return;const B=m()-x;150>B&&50<B&&(i?V.deltaX:V.deltaY)&&(_=!0)},L=()=>{p=!0,C=y=!1},v=()=>{p=!1,La()&&(C=!0)};return s.addEventListener("scroll",M),s.addEventListener("wheel",k,{passive:!0}),s.addEventListener("touchstart",L,{passive:!0}),s.addEventListener("touchend",v,{passive:!0}),{H:()=>{s.removeEventListener("scroll",M),s.removeEventListener("wheel",k),s.removeEventListener("touchstart",L),s.removeEventListener("touchend",v),N.C()},V:()=>{const[V,B]=o.P();V&&(f(V,B,y),y=!1,B&&o.T()>o.M()&&o.A(1,u()))}}},q2=(o,s,i)=>{let u;return[async(f,h)=>{if(!await s())return;u&&u();const m=()=>{const[x,_]=Eo();return u=()=>{_(!1)},o.T()&&yo(u,150),[x,o.R(2,()=>{_(!0)})]};if(h&&W2())o.A(8,f()),V2(async()=>{for(;;){let x=!0;for(let[C,y]=o.v();C<=y;C++)if(o.I(C)){x=!1;break}if(x)break;const[_,p]=m();try{if(!await _)return}finally{p()}}o.A(7),i(f(),h)});else for(;;){const[x,_]=m();try{if(o.A(7),i(f()),!await x)return}finally{_()}}},()=>{u&&u()}]},Z2=o=>{let s;return{F(i){(s||(s=new(G2(H2(i))).ResizeObserver(o))).observe(i)},J(i){s.unobserve(i)},H(){s&&s.disconnect()}}},Y2=l.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(o){const s=l.ref(),i=l.computed(()=>o.L.value&&o.W.O(o.D,o.K)),u=l.computed(()=>o.L.value&&o.W.I(o.D));return l.watch(()=>s.value&&o.D,(f,h,m)=>{m(o.Y(s.value,o.D))},{flush:"post"}),()=>{var f;const{X:h,U:m,G:x,Z:_}=o,p=u.value,{style:C,...y}=(f=o.ee)!==null&&f!==void 0?f:{},N={contain:"layout style",position:p&&x?void 0:"absolute",[m?"height":"width"]:"100%",[m?"top":"left"]:"0px",[m?"left":"top"]:i.value+"px",visibility:!p||x?void 0:"hidden",...C};return m&&(N.display="inline-flex"),l.createVNode(_,l.mergeProps({ref:s,style:N},y),typeof(M=h)=="function"||Object.prototype.toString.call(M)==="[object Object]"&&!l.isVNode(M)?h:{default:()=>[h],_:2},16,["style"]);var M}}}),$2=(o,s)=>{const i=o.key;return i??"_"+s},K2=(o,s)=>o[0]===s[0]&&o[1]===s[1],Fa=l.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(o,{emit:s,expose:i,slots:u}){let f=!!o.ssrCount;const h=o.horizontal,m=l.ref(),x=X2(o.data.length,o.itemSize,o.ssrCount,o.cache,!o.itemSize),_=((k,L)=>{let v;const V=L?"width":"height",B=new WeakMap,O=Z2(P=>{const G=[];for(const{target:Z,contentRect:H}of P)if(Z.offsetParent)if(Z===v)k.A(4,H[V]);else{const ie=B.get(Z);ie!=Ur&&G.push([ie,H[V]])}G.length&&k.A(3,G)});return{te(P){O.F(v=P)},re:(P,G)=>(B.set(P,G),O.F(P),()=>{B.delete(P),O.J(P)}),p:O.H}})(x,h),p=((k,L)=>{let v,V,B=Eo(),O=!1;const P=L?"scrollLeft":"scrollTop",G=L?"overflowX":"overflowY",[Z,H]=q2(k,()=>B[0],(ie,j)=>{ie=bo(ie,O),j?v.scrollTo({[L?"left":"top"]:ie,behavior:"smooth"}):v[P]=ie});return{oe(ie){v=ie,L&&(O=getComputedStyle(ie).direction==="rtl"),V=j2(k,ie,L,()=>bo(ie[P],O),(j,se,oe)=>{if(oe){const ne=ie.style,U=ne[G];ne[G]="hidden",yo(()=>{ne[G]=U})}ie[P]=bo(k.N()+j,O),se&&H()}),B[1](!0)},p(){V&&V.H(),B[1](!1),B=Eo()},ne:()=>O,se(ie){Z(()=>ie)},ie(ie){ie+=k.N(),Z(()=>ie)},le(ie,{align:j,smooth:se,offset:oe=0}={}){if(ie=Ba(ie,0,k.j()-1),j==="nearest"){const ne=k.O(ie),U=k.N();if(ne<U)j="start";else{if(!(ne+k.k(ie)>U+k.T()))return;j="end"}}Z(()=>oe+k.q()+k.O(ie)+(j==="end"?k.k(ie)-k.T():j==="center"?(k.k(ie)-k.T())/2:0),se)},ce:()=>{V&&V.V()}}})(x,h),C=l.ref(x.h());x.R(1,()=>{C.value=x.h()}),x.R(4,()=>{s("scroll",x.N())}),x.R(8,()=>{s("scrollEnd")});const y=l.computed(k=>{C.value;const L=x.v(o.bufferSize);return k&&K2(k,L)?k:L}),N=l.computed(()=>C.value&&x.B()),M=l.computed(()=>C.value&&x.M());return l.onMounted(()=>{f=!1;const k=requestAnimationFrame(()=>{const L=v=>{_.te(v),p.oe(v)};o.scrollRef?L(o.scrollRef):L(m.value.parentElement)});l.onUnmounted(()=>{cancelAnimationFrame(k)})}),l.onUnmounted(()=>{x.p(),_.p(),p.p()}),l.watch(()=>o.data.length,k=>{x.A(5,[k,o.shift])}),l.watch(()=>o.startMargin,k=>{x.A(6,k)},{immediate:!0}),l.watch([C],()=>{p.ce()},{flush:"post"}),i({get cache(){return x.m()},get scrollOffset(){return x.N()},get scrollSize(){return(k=>pn(k.M(),k.T()))(x)},get viewportSize(){return x.T()},findItemIndex:x.S,getItemOffset:x.O,getItemSize:x.k,scrollToIndex:p.le,scrollTo:p.se,scrollBy:p.ie}),()=>{const k=o.as,L=o.item,v=M.value,V=p.ne(),B=!h&&V?"unshift":"push",O=[],P=Z=>{var H;const ie=u.default({item:o.data[Z],index:Z})[0];return l.createVNode(Y2,{key:$2(ie,Z),L:C,W:x,Y:_.re,D:Z,X:ie,U:h,K:V,G:f,Z:L,ee:(H=o.itemProps)===null||H===void 0?void 0:H.call(o,{item:o.data[Z],index:Z})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(o.keepMounted){const Z=new Set(o.keepMounted);for(let[H,ie]=y.value;H<=ie;H++)Z.add(H);Ma([...Z]).forEach(H=>{O[B](P(H))})}else for(let[Z,H]=y.value;Z<=H;Z++)O[B](P(Z));return l.createVNode(k,{ref:m,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:h?v+"px":"100%",height:h?"100%":v+"px",pointerEvents:N.value?"none":void 0}},typeof(G=O)=="function"||Object.prototype.toString.call(G)==="[object Object]"&&!l.isVNode(G)?O:{default:()=>[O],_:2},8,["style"]);var G}}}),Q2=l.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(o,{emit:s,expose:i,slots:u}){const f=o.horizontal,h=_=>{s("scroll",_)},m=()=>{s("scrollEnd")},x=l.ref();return i({get cache(){return x.value.cache},get scrollOffset(){return x.value.scrollOffset},get scrollSize(){return x.value.scrollSize},get viewportSize(){return x.value.viewportSize},findItemIndex:(..._)=>x.value.findItemIndex(..._),getItemOffset:(..._)=>x.value.getItemOffset(..._),getItemSize:(..._)=>x.value.getItemSize(..._),scrollToIndex:(..._)=>x.value.scrollToIndex(..._),scrollTo:(..._)=>x.value.scrollTo(..._),scrollBy:(..._)=>x.value.scrollBy(..._)}),()=>{return l.createVNode("div",{style:{display:f?"inline-block":"block",[f?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[l.createVNode(Fa,{ref:x,data:o.data,bufferSize:o.bufferSize,itemSize:o.itemSize,itemProps:o.itemProps,shift:o.shift,ssrCount:o.ssrCount,horizontal:f,keepMounted:o.keepMounted,cache:o.cache,onScroll:h,onScrollEnd:m},(_=u,typeof _=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!l.isVNode(_)?u:{default:()=>[u],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var _}}}),J2=(o,s=10)=>new Promise(i=>{let u=0,f=0,h=0;const m=()=>{const x=o.scrollSize;x===h&&x>0?u++:(u=0)&&(h=x),f++,u>=2||f>=s?i():requestAnimationFrame(m)};requestAnimationFrame(m)});function eg(o,s){const i=(s==null?void 0:s.align)??"start";let u=!1;const f=l.ref(null),h=l.ref(!1),m=l.ref("measure"),x=l.computed(()=>l.toValue(o).length),_=l.computed(()=>m.value==="measure"||m.value==="virtual"?1:5),p=l.computed(()=>Array.from({length:x.value*_.value},(v,V)=>V)),C=async()=>{if(f.value&&(m.value="measure",u=!1,h.value=!1,await l.nextTick(),m.value==="measure")){if(await J2(f.value),h.value=f.value.scrollSize>f.value.viewportSize,!h.value){u=!1;return}u=!0,m.value=(s==null?void 0:s.mode)||"loop",await l.nextTick(),f.value.scrollToIndex(x.value*3,{align:i})}},y=v=>m.value==="measure"?v:x.value===0?0:v%x.value,N=(v,V)=>{f.value&&f.value.scrollToIndex(v,V)},M=(v,V)=>!u||m.value!=="loop"?V:V+Math.round((v-V)/x.value)*x.value,k=v=>{if(!u||m.value!=="loop"||!f.value)return;const V=x.value-1,B=x.value*4;if(v<V)return N(x.value*3-1,{align:"start"});if(v>=B)return N(x.value*3,{align:"start"})},L=()=>{if(!f.value||!u)return;const v=f.value.findItemIndex(f.value.scrollOffset);k(v)};return l.onMounted(C),l.onUnmounted(()=>f.value=null),l.watch(x,()=>l.nextTick(C)),{listRef:f,items:p,hasScroll:h,realIndex:y,findNearestIndex:M,scrollToIndex:N,init:C,onScroll:L}}const tg=Object.prototype.toString,ng=o=>tg.call(o)==="[object Error]",rg=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),ig=o=>{if(!(o&&ng(o)&&o.name==="TypeError"&&typeof o.message=="string"))return!1;const{message:i,stack:u}=o;return i==="Load failed"?u===void 0||"__sentry_captured__"in o:i.startsWith("error sending request for url")||i==="Failed to fetch"||i.startsWith("Failed to fetch (")&&i.endsWith(")")?!0:rg.has(i)},og={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},sg=o=>{var i;const s=Object.assign({},og,o);if(s.pinch&&(document.addEventListener("touchstart",u=>u.touches.length>1&&u.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",u=>u.preventDefault(),{passive:!1})),s.doubleTap){let u=0;document.addEventListener("touchend",f=>{const h=Date.now();h-u<=250&&f.preventDefault(),u=h},{passive:!1})}s.wheel&&document.addEventListener("wheel",u=>(u.ctrlKey||u.metaKey)&&u.preventDefault(),{passive:!1}),(i=s.buttons)!=null&&i.length&&document.addEventListener("keydown",u=>(u.ctrlKey||u.metaKey)&&s.buttons.includes(u.key)&&u.preventDefault())};Object.defineProperty(ge,"useRoute",{enumerable:!0,get:()=>Oe.useRoute}),Object.defineProperty(ge,"useRouter",{enumerable:!0,get:()=>Oe.useRouter}),ge.BasketButton=L2,ge.BottomSheet=co,ge.ButtonDefault=on,ge.CardMain=fa,ge.CardProductPage=d0,ge.CardReader=sa,ge.CartBox=oa,ge.CartPage=Kf,ge.DrumItem=kh,ge.FallingHearts=R2,ge.GroupMain=bh,ge.InitConnection=yn,ge.ModalWindows=zh,ge.NotificationWindow=pi,ge.PopupWindowDefault=ia,ge.PricePrerender=ur,ge.QrCameraScanner=_2,ge.Recommendation=Lh,ge.RetryPage=lh,ge.TagsMain=Ih,ge.VList=Q2,ge.Virtualizer=Fa,ge.clearAllProductDB=yl,ge.clearLocalStorage=dr,ge.getCachedGroup=Hi,ge.getCachedProduct=Yo,ge.getWebSocketInstance=ri,ge.initPinia=rl,ge.initRouter=ol,ge.isNetworkError=ig,ge.parseTheme=Ks,ge.preventZoom=sg,ge.updateIndexedDB=A2,ge.useCachedMedia=vn,ge.useCardLibStore=Tt,ge.useCartLibStore=bt,ge.useImageCacheStore=ti,ge.useMainLibStore=at,ge.useModal=da,ge.useModalStore=uo,ge.useModulesLibStore=Co,ge.usePdf=bn,ge.useThemeStore=yt,ge.useVirtuaLoop=eg,ge.vClickOutside=C2,ge.vDragScroll=Lr,ge.vMuted=Vr,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|
|
31
|
+
Баланс: ${ne.balance}`})}catch(ne){y("update:is_notification",!0),y("update:notificationData",{textNotification:((ie=ne.response)==null?void 0:ie.user_friendly_message)||"Карта не найдена"})}finally{m.value=!0,_&&clearTimeout(_),_=setTimeout(()=>{m.value=!1},2e3),x.value=!1}}};window.debugScan=M;const k=()=>{},L=async()=>{if(!(f.value||u!=null&&u.isScanning||m.value))try{f.value=!0;try{(await navigator.mediaDevices.getUserMedia({video:!0})).getTracks().forEach(Z=>Z.stop())}catch{y("update:is_notification",!0),y("update:notificationData",{textNotification:"Разрешите доступ к камере"}),f.value=!1,y("update:is_toggleAffiliation",!0);return}u=new Ia("reader");const V=await Ia.getCameras();if(!V||V.length===0){console.error("Камеры не найдены"),f.value=!1;return}let B;if(i.isQr)B=V.find(G=>_o.back.some(Z=>new RegExp(Z,"i").test(G.label))),B||(B=V.find(G=>_o.front.some(Z=>new RegExp(Z,"i").test(G.label))));else if(B=V.find(G=>_o.front.some(Z=>new RegExp(Z,"i").test(G.label))),B||(B=V.find(G=>new RegExp("amera","i").test(G.label))),!B){y("update:is_notification",!0),y("update:notificationData",{textNotification:"Не найдена фронтальная камера. Для сканирования карт нужна фронтальная камера."}),f.value=!1,y("update:is_toggleAffiliation",!0);return}const O=i.isQr?[pe.QR_CODE]:[pe.QR_CODE,pe.PDF_417,pe.EAN_13,pe.EAN_8,pe.CODE_128],P={fps:60,qrbox:{width:320,height:500}};await u.start(B.id,P,M,k,void 0,O),h.value=!0}catch(V){y("update:is_notification",!0),y("update:notificationData",{textNotification:"Разрешите доступ к камере для сканирования"}),console.error("Ошибка доступа к камере:",V),f.value=!1,h.value=!1,y("update:is_toggleAffiliation",!0)}},v=async()=>{if(u&&u.isScanning)try{await u.stop(),f.value=!1,u=null}catch(V){console.error("Ошибка остановки камеры:",V)}else f.value=!1,u=null,y("update:is_toggleAffiliation",!0);h.value=!1};return l.onUnmounted(()=>{f.value&&v(),_&&(clearTimeout(_),_=null),x.value=!1,m.value=!1,h.value=!1}),(V,B)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.withDirectives(l.createElementVNode("div",{class:"blackWindow",onClick:v},[B[0]||(B[0]=l.createElementVNode("div",{id:"reader"},null,-1)),h.value&&!o.isQr?(l.openBlock(),l.createElementBlock("p",w2,"Наведите QR на камеру")):l.createCommentVNode("",!0)],512),[[l.vShow,f.value]])])),l.createVNode(x2,{color:o.isQr?void 0:"#FFFFFF",onClick:L},null,8,["color"])]))}}),Co=_e.defineStore("modulesLib",()=>{const o=l.ref(!1),s=l.ref({textNotification:""});return{is_notification_lib:o,notificationData_lib:s,showNotification:u=>{o.value=!0,s.value.textNotification=u}}}),Ei=Symbol("clickOutside"),C2={mounted(o,s){o[Ei]=i=>{o.contains(i.target)||s.value(i)},document.addEventListener("click",o[Ei])},unmounted(o){o[Ei]&&document.removeEventListener("click",o[Ei])}};class E2{constructor(s){je(this,"value");je(this,"next");this.value=s}}class y2{constructor(){vi(this,jt);vi(this,Vn);vi(this,tr);this.clear()}enqueue(s){const i=new E2(s);fn(this,jt)?(fn(this,Vn).next=i,On(this,Vn,i)):(On(this,jt,i),On(this,Vn,i)),zo(this,tr)._++}dequeue(){const s=fn(this,jt);if(s)return On(this,jt,fn(this,jt).next),zo(this,tr)._--,fn(this,jt)||On(this,Vn,void 0),s.value}peek(){if(fn(this,jt))return fn(this,jt).value}clear(){On(this,jt,void 0),On(this,Vn,void 0),On(this,tr,0)}get size(){return fn(this,tr)}*[Symbol.iterator](){let s=fn(this,jt);for(;s;)yield s.value,s=s.next}*drain(){for(;fn(this,jt);)yield this.dequeue()}}jt=new WeakMap,Vn=new WeakMap,tr=new WeakMap;function b2(o){Na(o);const s=new y2;let i=0;const u=()=>{i<o&&s.size>0&&(i++,s.dequeue()())},f=()=>{i--,u()},h=async(_,p,C)=>{const y=(async()=>_(...C))();p(y);try{await y}catch{}f()},m=(_,p,C)=>{new Promise(y=>{s.enqueue(y)}).then(h.bind(void 0,_,p,C)),i<o&&u()},x=(_,...p)=>new Promise(C=>{m(_,C,p)});return Object.defineProperties(x,{activeCount:{get:()=>i},pendingCount:{get:()=>s.size},clearQueue:{value(){s.clear()}},concurrency:{get:()=>o,set(_){Na(_),o=_,queueMicrotask(()=>{for(;i<o&&s.size>0;)u()})}},map:{async value(_,p){const C=Array.from(_,(y,N)=>this(p,y,N));return Promise.all(C)}}}),x}function Na(o){if(!((Number.isInteger(o)||o===Number.POSITIVE_INFINITY)&&o>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let Xt=null;const Ta=b2(5),A2=async(o,s)=>{Xt&&T2();const i=at(),u=yt(),f=Co(),h=Tt(),{itemThemes:m}=_e.storeToRefs(u),{displayCards:x}=_e.storeToRefs(i),{is_notification_lib:_,notificationData_lib:p}=_e.storeToRefs(f),{stateCard:C,openProduct:y}=_e.storeToRefs(h),N=yn.create();await I2(o),Xt=ri(`wss://${s}/ws/org-unit/${o}/`,{heartbeatTimeout:3e4}),Xt.on("open",()=>console.warn("Realtime WebSocket подключён (pointId:",o,")")),Xt.on("error",M=>console.warn("WebSocket ошибка:",M)),Xt.on("close",()=>console.warn("Realtime WebSocket закрыт")),Xt.on("message",async M=>{try{if(M.type)return;m.value.kiosk_hide_menu_update_notification||(p.value.textNotification="Мы обновили меню");const k=M.params||M,L=k.active_groups||[],v=k.updated_groups||[],V=k.updated_product_groups||[],B=await Yn(),O=new Set(L.map(oe=>oe)),P=new Map(x.value.map(oe=>[oe.id,oe])),G=[],Z=B.transaction("groups","readwrite");let ie=await Z.objectStore("groups").openCursor();for(;ie;){const oe=ie.key;!O.has(oe)&&oe!==o&&(G.push(oe),await ie.delete(),P.delete(oe)),ie=await ie.continue()}await Z.done,x.value=Array.from(P.values()),G.length>0&&await S2(O);const j=[...v.map(oe=>Ta(async()=>{const[ne,U]=await Promise.all([N.getGroupByID(oe),N.loadGroupProducts(oe)]);ne.products=U,P.set(oe,ne),await kr(oe,ne),await Ra(ne,U,!0)})),...V.map(oe=>Ta(async()=>{const[ne,U]=await Promise.all([N.getGroupByID(oe),N.loadGroupProducts(oe)]);ne.products=U,P.set(oe,ne),await kr(oe,ne),await Ra(ne,U,!0),await N2(U,oe)}))];await Promise.all(j),x.value=Array.from(P.values()),await Cl(o,x),p.value.textNotification.length>1&&(_.value=!0);const se=C.value.openCard;if(se!=null&&se.id){const oe=new Set(se.groups??[]),ne=new Set;let U=!1;for(const S of P.values()){const z=S==null?void 0:S.products;if(!Array.isArray(z))continue;const X=z.find(q=>(q==null?void 0:q.id)===se.id);if((X==null?void 0:X.adult)===!0){y.value={id:null,visible:!1},h.reset();return}X&&(S==null?void 0:S.id)!=null&&(ne.add(S.id),(v.includes(S.id)||V.includes(S.id))&&(U=!0))}if(ne.size===0){y.value={id:null,visible:!1},h.reset();return}(!(oe.size===ne.size&&[...oe].every(S=>ne.has(S)))||U)&&await N.getSingleProduct(se==null?void 0:se.id)}}catch(k){console.error("ошибка обновления indexedDB [updateIndexedDB]",k)}}),Xt.connect()},I2=async o=>{try{const s=at(),i=await Hi(o);i!=null&&i.data&&(s.displayCards=i.data)}catch(s){console.error("Ошибка загрузки кэша групп:",s)}},ka=async o=>{const s=at(),i=Co(),u=Tt(),{stateCard:f,openProduct:h}=_e.storeToRefs(u),{cartProducts_lib:m}=_e.storeToRefs(s),x=m.value,_=[],p=[],C=f.value.openCard;for(const y of x)o(y)?(_.push(y),(y.id===(C==null?void 0:C.id)||C!=null&&C.adult)&&(h.value={id:null,visible:!1})):p.push(y);if(_.length>0){const y=_.map(N=>N.name).slice(0,3).join(", ");i.notificationData_lib.textNotification=`Некоторые позиции стали недоступны и были убраны из заказа: ${y}${_.length>3?` и ещё ${_.length-3}`:""}`,m.value=p,s.updateCartInLocalStorage()}},S2=async o=>{await ka(s=>{var i;return(i=s.groups)!=null&&i.length?!s.groups.some(u=>o.has(u)):!0})},N2=async(o,s)=>{const i=at(),u=new Set(o.filter(f=>!f.adult||i.is18Allowed).map(f=>f.id));await ka(f=>{var h;return(h=f.groups)!=null&&h.includes(s)?!u.has(f.id):!1})},Ra=async(o,s,i=!0)=>{if(o.video_link&&yi(o.video_link,`${o.id}_video`,i),o.image_link&&yi(o.image_link,`${o.id}_image`,i),s!=null&&s.length)for(const u of s)u.video_link&&yi(u.video_link,`${u.id}_video`,i),u.image_link&&yi(u.image_link,`${u.id}_image`,i)},yi=async(o,s,i=!1)=>{try{const u=ti();if(!i){const m=await cr(s);if(m){u.updateCacheFromBlob(s,m),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:m}}));return}}const f=await fetch(o);if(!f.ok)throw new Error("Network error");const h=await f.blob();if(h.size===0)throw new Error("Empty blob");await Gi(s,h),u.updateCacheFromBlob(s,h),window.dispatchEvent(new CustomEvent("image-cached",{detail:{id:s,blob:h}}))}catch(u){console.warn(`[MediaCache] Failed for ${s}:`,u)}},T2=()=>{Xt&&(Xt.off("open"),Xt.off("message"),Xt.off("error"),Xt.off("close"),Xt.close(!0),Xt=null)},k2={key:0,class:"valentine-hearts"},R2=l.defineComponent({__name:"FallingHearts",props:{symbols:{default:()=>["❤","♥","💕"]},max:{default:15},interval:{default:1500}},setup(o){const s=o,i=Vt.useDocumentVisibility(),u=Vt.useMediaQuery("(prefers-reduced-motion: reduce)"),f=l.ref([]);let h=null;const m=(C,y)=>Math.random()*(y-C)+C,x=()=>{if(u.value||f.value.length>=s.max)return;const C=s.symbols[Math.floor(Math.random()*s.symbols.length)],y=m(18,26),N=m(5,95),M=m(10,18),k=m(0,.3),L=m(.6,.9),v=Math.floor(m(1,6)),B={id:crypto.randomUUID(),icon:C,style:{left:`${N}%`,fontSize:`${y}px`,color:`rgba(255, 105, 180, ${L})`,animationName:`heartFall${v}`,animationDuration:`${M}s`,animationDelay:`${k}s`}};f.value.push(B);const P=setTimeout(()=>{f.value=f.value.filter(G=>G.id!==B.id),clearTimeout(P)},(k+M+1)*1e3)},_=()=>{if(!u.value){for(let C=0;C<3;C++){const y=setTimeout(()=>{x(),clearTimeout(y)},C*200)}h=setInterval(x,s.interval)}},p=()=>{h&&(clearInterval(h),h=null),f.value=[]};return l.onMounted(()=>{u.value||_()}),l.onUnmounted(()=>{p()}),l.watch(i,(C,y)=>{C==="visible"&&y==="hidden"&&_(),C==="hidden"&&y==="visible"&&p()}),(C,y)=>l.unref(u)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",k2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,N=>(l.openBlock(),l.createElementBlock("span",{key:N.id,class:"heart",style:l.normalizeStyle(N.style)},l.toDisplayString(N.icon),5))),128))]))}}),O2=["src"],B2=l.defineComponent({__name:"BasketImage",props:{id:{},fallback:{}},setup(o){const s=o,{mediaUrl:i}=vn(()=>s.id,()=>s.fallback);return(u,f)=>(l.openBlock(),l.createElementBlock("img",{src:l.unref(i)||""},null,8,O2))}}),M2={class:"button_price_bg"},v2={class:"wrapper_container_price_bg"},D2={class:"button_price"},P2={key:0,class:"image_product_container"},L2=l.defineComponent({__name:"BasketButton",emits:["goToCart"],setup(o){const s=at(),{isDesktop:i}=bn(),{totalPrice_lib:u,cartProducts_lib:f}=_e.storeToRefs(s),h=l.computed(()=>{var m;return(m=f.value)!=null&&m.length,f.value.slice(0,3).map(x=>({id:`${x.id}_image`,fallback:x.image_link}))});return(m,x)=>(l.openBlock(),l.createElementBlock("div",M2,[l.createElementVNode("div",v2,[l.createElementVNode("div",D2,[l.unref(u)>0&&h.value.length>0?(l.openBlock(),l.createElementBlock("div",P2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,_=>(l.openBlock(),l.createElementBlock("div",{key:_.id,class:"filter_image_product"},[l.createVNode(B2,{id:_.id,fallback:_.fallback,class:"img_product"},null,8,["id","fallback"])]))),128))])):l.createCommentVNode("",!0),l.createVNode(l.unref(Et.motion).div,{class:"button_default_main",whilePress:l.unref(i)?{}:{scale:.92},onClick:x[0]||(x[0]=_=>m.$emit("goToCart"))},{default:l.withCtx(()=>[x[2]||(x[2]=l.createElementVNode("div",{class:"icont_cart"},null,-1)),l.createElementVNode("p",null,[l.createVNode(Ut,{price:l.unref(u),fixedFloat:2},null,8,["price"]),x[1]||(x[1]=l.createTextVNode(" ₽",-1))])]),_:1},8,["whilePress"])])])]))}}),Ur=null,{min:er,max:pn,abs:Oa,floor:F2}=Math,Ba=(o,s,i)=>er(i,pn(s,o)),Ma=o=>[...o].sort((s,i)=>s-i),V2=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)},Eo=()=>{let o;return[new Promise(s=>{o=s}),o]},va=o=>{let s;return()=>(o&&(s=o(),o=void 0),s)},zr=(o,s,i)=>{const u=i?"unshift":"push";for(let f=0;f<s;f++)o[u](-1);return o},Da=(o,s)=>{const i=o.t[s];return i===-1?o.o:i},U2=(o,s,i)=>{const u=o.t[s]===-1;return o.t[s]=i,o.i=er(s,o.i),u},bi=(o,s)=>{if(!o.l)return 0;if(o.i>=s)return o.u[s];o.i<0&&(o.u[0]=0,o.i=0);let i=o.i,u=o.u[i];for(;i<s;)u+=Da(o,i),o.u[++i]=u;return o.i=s,u},wr=(o,s,i=0,u=o.l-1)=>{let f=i;for(;i<=u;){const h=F2((i+u)/2);bi(o,h)<=s?(f=h,i=h+1):u=h-1}return Ba(f,0,o.l-1)},Pa=(o,s,i)=>{const u=s-o.l;return o.i=i?-1:er(s-1,o.i),o.l=s,u>0?(zr(o.u,u),zr(o.t,u,i),o.o*u):(o.u.splice(u),(i?o.t.splice(0,-u):o.t.splice(u)).reduce((f,h)=>f-(h===-1?o.o:h),0))},z2=o=>o.documentElement,H2=o=>o.ownerDocument,G2=o=>o.defaultView,La=va(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>0),W2=va(()=>"scrollBehavior"in z2(document).style),X2=(o,s=40,i=0,u,f=!1)=>{let h=!!i,m=1,x=0,_=0,p=0,C=0,y=0,N=0,M=0,k=0,L=Ur,v=[0,h?pn(i-1,0):-1],V=0,B=!1;const O=((U,W,S)=>({o:W,t:S?zr(S.slice(0,er(U,S.length)),pn(0,U-S.length)):zr([],U),l:U,i:-1,u:zr([],U+1)}))(o,u?u[1]:s,u&&u[0]),P=new Set,G=()=>p-_,Z=()=>G()+y+C,H=(U,W)=>((S,z,X,q)=>{if(q=er(q,S.l-1),bi(S,q)<=z){const $=wr(S,X,q);return[wr(S,z,q,$),$]}{const $=wr(S,z,void 0,q);return[$,wr(S,X,$)]}})(O,U,W,v[0]),ie=()=>bi(O,O.l),j=(U,W)=>{const S=bi(O,U)-y;return W?ie()-S-se(U):S},se=U=>Da(O,U),oe=(U,W=-1)=>O.t[U]===W,ne=U=>{U&&(La()&&M!==0||L&&k===1?y+=U:C+=U)};return{p:()=>{P.clear()},h:()=>m,m:()=>(U=>[U.t.slice(),U.o])(O),v:(U=200)=>{if(!B||h)return v;let W,S;if(N)[W,S]=v;else{let z=pn(0,Z()),X=z+x;f||(U=pn(0,U),M!==1&&(z-=U),M!==2&&(X+=U)),[W,S]=v=H(pn(0,z),pn(0,X)),L&&(W=er(W,L[0]),S=pn(S,L[1]))}return[pn(W,0),er(S,O.l-1)]},S:U=>wr(O,U-_),I:oe,O:j,k:se,j:()=>O.l,N:()=>p,B:()=>M!==0,T:()=>x,q:()=>_,M:ie,P:()=>(N=C,C=0,[N,k===2]),R:(U,W)=>{const S=[U,W];return P.add(S),()=>{P.delete(S)}},A:(U,W)=>{let S,z,X=0;switch(U){case 1:{if(W===p&&k===0)break;const q=N;N=0;const $=W-p,re=Oa($);q&&re<Oa(q)+1||k!==0||(M=$<0?2:1),h&&(h=!1),p=W,X=4;const he=G();he>=-x&&he<=ie()&&(X+=1,z=re>x);break}case 2:X=8,M!==0&&(S=!0,X+=1),M=0,k=0,L=Ur;break;case 3:{const q=W.filter(([$,re])=>!oe($,re));if(!q.length)break;ne(q.reduce(($,[re,he])=>((k===2||(L&&k===1?re<L[0]:j(re+(M===0&&k===0?1:0))<G()))&&($+=he-se(re)),$),0));for(const[$,re]of q){const he=se($),fe=U2(O,$,re);f&&(V+=fe?re:re-he)}f&&x&&V>x&&(ne((($,re)=>{let he=0;const fe=[];$.t.forEach((He,Ae)=>{He!==-1&&(fe.push(He),Ae<re&&he++)}),$.i=-1;const Ee=Ma(fe),me=Ee.length,Ve=me/2|0,xe=me%2==0?(Ee[Ve-1]+Ee[Ve])/2:Ee[Ve],ht=$.o;return(($.o=xe)-ht)*pn(re-he,0)})(O,wr(O,Z()))),f=!1),X=3,z=!0;break}case 4:x!==W&&(x||(B=z=!0),x=W,X=3);break;case 5:W[1]?(ne(Pa(O,W[0],!0)),k=2,X=1):(Pa(O,W[0]),X=1);break;case 6:_=W;break;case 7:k=1;break;case 8:L=H(W,W+x),X=1}X&&(m=1+(2147483647&m),S&&y&&(C+=y,y=0),P.forEach(([q,$])=>{X&q&&$(z)}))}}},yo=setTimeout,bo=(o,s)=>s?-o:o,j2=(o,s,i,u,f,h)=>{const m=Date.now;let x=0,_=!1,p=!1,C=!1,y=!1;const N=(()=>{let V;const B=()=>{V!=Ur&&clearTimeout(V)},O=()=>{B(),V=yo(()=>{V=Ur,(()=>{if(_||p)return _=!1,void N();C=!1,o.A(2)})()},150)};return O.C=B,O})(),M=()=>{x=m(),C&&(y=!0),o.A(1,u()),N()},k=V=>{if(_||!o.B()||V.ctrlKey)return;const B=m()-x;150>B&&50<B&&(i?V.deltaX:V.deltaY)&&(_=!0)},L=()=>{p=!0,C=y=!1},v=()=>{p=!1,La()&&(C=!0)};return s.addEventListener("scroll",M),s.addEventListener("wheel",k,{passive:!0}),s.addEventListener("touchstart",L,{passive:!0}),s.addEventListener("touchend",v,{passive:!0}),{H:()=>{s.removeEventListener("scroll",M),s.removeEventListener("wheel",k),s.removeEventListener("touchstart",L),s.removeEventListener("touchend",v),N.C()},V:()=>{const[V,B]=o.P();V&&(f(V,B,y),y=!1,B&&o.T()>o.M()&&o.A(1,u()))}}},q2=(o,s,i)=>{let u;return[async(f,h)=>{if(!await s())return;u&&u();const m=()=>{const[x,_]=Eo();return u=()=>{_(!1)},o.T()&&yo(u,150),[x,o.R(2,()=>{_(!0)})]};if(h&&W2())o.A(8,f()),V2(async()=>{for(;;){let x=!0;for(let[C,y]=o.v();C<=y;C++)if(o.I(C)){x=!1;break}if(x)break;const[_,p]=m();try{if(!await _)return}finally{p()}}o.A(7),i(f(),h)});else for(;;){const[x,_]=m();try{if(o.A(7),i(f()),!await x)return}finally{_()}}},()=>{u&&u()}]},Z2=o=>{let s;return{F(i){(s||(s=new(G2(H2(i))).ResizeObserver(o))).observe(i)},J(i){s.unobserve(i)},H(){s&&s.disconnect()}}},Y2=l.defineComponent({props:{L:{type:Object,required:!0},W:{type:Object,required:!0},X:{type:Object,required:!0},Y:{type:Function,required:!0},D:{type:Number,required:!0},U:{type:Boolean},G:{type:Boolean},K:{type:Boolean},Z:{type:String,required:!0},ee:Object},setup(o){const s=l.ref(),i=l.computed(()=>o.L.value&&o.W.O(o.D,o.K)),u=l.computed(()=>o.L.value&&o.W.I(o.D));return l.watch(()=>s.value&&o.D,(f,h,m)=>{m(o.Y(s.value,o.D))},{flush:"post"}),()=>{var f;const{X:h,U:m,G:x,Z:_}=o,p=u.value,{style:C,...y}=(f=o.ee)!==null&&f!==void 0?f:{},N={contain:"layout style",position:p&&x?void 0:"absolute",[m?"height":"width"]:"100%",[m?"top":"left"]:"0px",[m?"left":"top"]:i.value+"px",visibility:!p||x?void 0:"hidden",...C};return m&&(N.display="inline-flex"),l.createVNode(_,l.mergeProps({ref:s,style:N},y),typeof(M=h)=="function"||Object.prototype.toString.call(M)==="[object Object]"&&!l.isVNode(M)?h:{default:()=>[h],_:2},16,["style"]);var M}}}),$2=(o,s)=>{const i=o.key;return i??"_"+s},K2=(o,s)=>o[0]===s[0]&&o[1]===s[1],Fa=l.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,startMargin:{type:Number,default:0},ssrCount:Number,scrollRef:Object,as:{type:String,default:"div"},item:{type:String,default:"div"},itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(o,{emit:s,expose:i,slots:u}){let f=!!o.ssrCount;const h=o.horizontal,m=l.ref(),x=X2(o.data.length,o.itemSize,o.ssrCount,o.cache,!o.itemSize),_=((k,L)=>{let v;const V=L?"width":"height",B=new WeakMap,O=Z2(P=>{const G=[];for(const{target:Z,contentRect:H}of P)if(Z.offsetParent)if(Z===v)k.A(4,H[V]);else{const ie=B.get(Z);ie!=Ur&&G.push([ie,H[V]])}G.length&&k.A(3,G)});return{te(P){O.F(v=P)},re:(P,G)=>(B.set(P,G),O.F(P),()=>{B.delete(P),O.J(P)}),p:O.H}})(x,h),p=((k,L)=>{let v,V,B=Eo(),O=!1;const P=L?"scrollLeft":"scrollTop",G=L?"overflowX":"overflowY",[Z,H]=q2(k,()=>B[0],(ie,j)=>{ie=bo(ie,O),j?v.scrollTo({[L?"left":"top"]:ie,behavior:"smooth"}):v[P]=ie});return{oe(ie){v=ie,L&&(O=getComputedStyle(ie).direction==="rtl"),V=j2(k,ie,L,()=>bo(ie[P],O),(j,se,oe)=>{if(oe){const ne=ie.style,U=ne[G];ne[G]="hidden",yo(()=>{ne[G]=U})}ie[P]=bo(k.N()+j,O),se&&H()}),B[1](!0)},p(){V&&V.H(),B[1](!1),B=Eo()},ne:()=>O,se(ie){Z(()=>ie)},ie(ie){ie+=k.N(),Z(()=>ie)},le(ie,{align:j,smooth:se,offset:oe=0}={}){if(ie=Ba(ie,0,k.j()-1),j==="nearest"){const ne=k.O(ie),U=k.N();if(ne<U)j="start";else{if(!(ne+k.k(ie)>U+k.T()))return;j="end"}}Z(()=>oe+k.q()+k.O(ie)+(j==="end"?k.k(ie)-k.T():j==="center"?(k.k(ie)-k.T())/2:0),se)},ce:()=>{V&&V.V()}}})(x,h),C=l.ref(x.h());x.R(1,()=>{C.value=x.h()}),x.R(4,()=>{s("scroll",x.N())}),x.R(8,()=>{s("scrollEnd")});const y=l.computed(k=>{C.value;const L=x.v(o.bufferSize);return k&&K2(k,L)?k:L}),N=l.computed(()=>C.value&&x.B()),M=l.computed(()=>C.value&&x.M());return l.onMounted(()=>{f=!1;const k=requestAnimationFrame(()=>{const L=v=>{_.te(v),p.oe(v)};o.scrollRef?L(o.scrollRef):L(m.value.parentElement)});l.onUnmounted(()=>{cancelAnimationFrame(k)})}),l.onUnmounted(()=>{x.p(),_.p(),p.p()}),l.watch(()=>o.data.length,k=>{x.A(5,[k,o.shift])}),l.watch(()=>o.startMargin,k=>{x.A(6,k)},{immediate:!0}),l.watch([C],()=>{p.ce()},{flush:"post"}),i({get cache(){return x.m()},get scrollOffset(){return x.N()},get scrollSize(){return(k=>pn(k.M(),k.T()))(x)},get viewportSize(){return x.T()},findItemIndex:x.S,getItemOffset:x.O,getItemSize:x.k,scrollToIndex:p.le,scrollTo:p.se,scrollBy:p.ie}),()=>{const k=o.as,L=o.item,v=M.value,V=p.ne(),B=!h&&V?"unshift":"push",O=[],P=Z=>{var H;const ie=u.default({item:o.data[Z],index:Z})[0];return l.createVNode(Y2,{key:$2(ie,Z),L:C,W:x,Y:_.re,D:Z,X:ie,U:h,K:V,G:f,Z:L,ee:(H=o.itemProps)===null||H===void 0?void 0:H.call(o,{item:o.data[Z],index:Z})},null,8,["L","W","Y","D","X","U","K","G","Z","ee"])};if(o.keepMounted){const Z=new Set(o.keepMounted);for(let[H,ie]=y.value;H<=ie;H++)Z.add(H);Ma([...Z]).forEach(H=>{O[B](P(H))})}else for(let[Z,H]=y.value;Z<=H;Z++)O[B](P(Z));return l.createVNode(k,{ref:m,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:h?v+"px":"100%",height:h?"100%":v+"px",pointerEvents:N.value?"none":void 0}},typeof(G=O)=="function"||Object.prototype.toString.call(G)==="[object Object]"&&!l.isVNode(G)?O:{default:()=>[O],_:2},8,["style"]);var G}}}),Q2=l.defineComponent({props:{data:{type:Array,required:!0},bufferSize:Number,itemSize:Number,shift:Boolean,horizontal:Boolean,ssrCount:Number,itemProps:Function,keepMounted:Array,cache:Object},emits:["scroll","scrollEnd"],setup(o,{emit:s,expose:i,slots:u}){const f=o.horizontal,h=_=>{s("scroll",_)},m=()=>{s("scrollEnd")},x=l.ref();return i({get cache(){return x.value.cache},get scrollOffset(){return x.value.scrollOffset},get scrollSize(){return x.value.scrollSize},get viewportSize(){return x.value.viewportSize},findItemIndex:(..._)=>x.value.findItemIndex(..._),getItemOffset:(..._)=>x.value.getItemOffset(..._),getItemSize:(..._)=>x.value.getItemSize(..._),scrollToIndex:(..._)=>x.value.scrollToIndex(..._),scrollTo:(..._)=>x.value.scrollTo(..._),scrollBy:(..._)=>x.value.scrollBy(..._)}),()=>{return l.createVNode("div",{style:{display:f?"inline-block":"block",[f?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%"}},[l.createVNode(Fa,{ref:x,data:o.data,bufferSize:o.bufferSize,itemSize:o.itemSize,itemProps:o.itemProps,shift:o.shift,ssrCount:o.ssrCount,horizontal:f,keepMounted:o.keepMounted,cache:o.cache,onScroll:h,onScrollEnd:m},(_=u,typeof _=="function"||Object.prototype.toString.call(_)==="[object Object]"&&!l.isVNode(_)?u:{default:()=>[u],_:2}),8,["data","bufferSize","itemSize","itemProps","shift","ssrCount","horizontal","keepMounted","cache","onScroll","onScrollEnd"])],4);var _}}}),J2=(o,s=10)=>new Promise(i=>{let u=0,f=0,h=0;const m=()=>{if(!o||o.scrollSize===void 0){i();return}const x=o.scrollSize;x===h&&x>0?u++:(u=0)&&(h=x),f++,u>=2||f>=s?i():requestAnimationFrame(m)};requestAnimationFrame(m)});function eg(o,s){const i=(s==null?void 0:s.align)??"start";let u=!1;const f=l.ref(null),h=l.ref(!1),m=l.ref("measure"),x=l.computed(()=>l.toValue(o).length),_=l.computed(()=>m.value==="measure"||m.value==="virtual"?1:5),p=l.computed(()=>Array.from({length:x.value*_.value},(v,V)=>V)),C=async()=>{if(f.value&&(m.value="measure",u=!1,h.value=!1,await l.nextTick(),!(!f.value||m.value!=="measure")&&(await J2(f.value),!!f.value))){if(h.value=f.value.scrollSize>f.value.viewportSize,!h.value){u=!1;return}u=!0,m.value=(s==null?void 0:s.mode)||"loop",await l.nextTick(),f.value&&f.value.scrollToIndex(x.value*3,{align:i})}},y=v=>m.value==="measure"?v:x.value===0?0:v%x.value,N=(v,V)=>{f.value&&f.value.scrollToIndex(v,V)},M=(v,V)=>!u||m.value!=="loop"?V:V+Math.round((v-V)/x.value)*x.value,k=v=>{if(!u||m.value!=="loop"||!f.value)return;const V=x.value-1,B=x.value*4;if(v<V)return N(x.value*3-1,{align:"start"});if(v>=B)return N(x.value*3,{align:"start"})},L=()=>{if(!f.value||!u)return;const v=f.value.findItemIndex(f.value.scrollOffset);k(v)};return l.onMounted(C),l.onUnmounted(()=>f.value=null),l.watch(x,()=>l.nextTick(C)),{listRef:f,items:p,hasScroll:h,realIndex:y,findNearestIndex:M,scrollToIndex:N,init:C,onScroll:L}}const tg=Object.prototype.toString,ng=o=>tg.call(o)==="[object Error]",rg=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]),ig=o=>{if(!(o&&ng(o)&&o.name==="TypeError"&&typeof o.message=="string"))return!1;const{message:i,stack:u}=o;return i==="Load failed"?u===void 0||"__sentry_captured__"in o:i.startsWith("error sending request for url")||i==="Failed to fetch"||i.startsWith("Failed to fetch (")&&i.endsWith(")")?!0:rg.has(i)},og={pinch:!0,doubleTap:!0,wheel:!0,buttons:["+","-","=","0"]},sg=o=>{var i;const s=Object.assign({},og,o);if(s.pinch&&(document.addEventListener("touchstart",u=>u.touches.length>1&&u.preventDefault(),{passive:!1}),document.addEventListener("gesturestart",u=>u.preventDefault(),{passive:!1})),s.doubleTap){let u=0;document.addEventListener("touchend",f=>{const h=Date.now();h-u<=250&&f.preventDefault(),u=h},{passive:!1})}s.wheel&&document.addEventListener("wheel",u=>(u.ctrlKey||u.metaKey)&&u.preventDefault(),{passive:!1}),(i=s.buttons)!=null&&i.length&&document.addEventListener("keydown",u=>(u.ctrlKey||u.metaKey)&&s.buttons.includes(u.key)&&u.preventDefault())};Object.defineProperty(ge,"useRoute",{enumerable:!0,get:()=>Oe.useRoute}),Object.defineProperty(ge,"useRouter",{enumerable:!0,get:()=>Oe.useRouter}),ge.BasketButton=L2,ge.BottomSheet=co,ge.ButtonDefault=on,ge.CardMain=fa,ge.CardProductPage=d0,ge.CardReader=sa,ge.CartBox=oa,ge.CartPage=Kf,ge.DrumItem=kh,ge.FallingHearts=R2,ge.GroupMain=bh,ge.InitConnection=yn,ge.ModalWindows=zh,ge.NotificationWindow=pi,ge.PopupWindowDefault=ia,ge.PricePrerender=ur,ge.QrCameraScanner=_2,ge.Recommendation=Lh,ge.RetryPage=lh,ge.TagsMain=Ih,ge.VList=Q2,ge.Virtualizer=Fa,ge.clearAllProductDB=yl,ge.clearLocalStorage=dr,ge.getCachedGroup=Hi,ge.getCachedProduct=Yo,ge.getWebSocketInstance=ri,ge.initPinia=rl,ge.initRouter=ol,ge.isNetworkError=ig,ge.parseTheme=Ks,ge.preventZoom=sg,ge.updateIndexedDB=A2,ge.useCachedMedia=vn,ge.useCardLibStore=Tt,ge.useCartLibStore=bt,ge.useImageCacheStore=ti,ge.useMainLibStore=at,ge.useModal=da,ge.useModalStore=uo,ge.useModulesLibStore=Co,ge.usePdf=bn,ge.useThemeStore=yt,ge.useVirtuaLoop=eg,ge.vClickOutside=C2,ge.vDragScroll=Lr,ge.vMuted=Vr,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|