@credenza3/scanner-lib 0.0.1 → 0.0.2
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.
- package/.turbo/turbo-build.log +30 -13
- package/dist/scanner.es.js +2922 -1593
- package/dist/scanner.umd.js +4 -3
- package/package.json +20 -20
package/dist/scanner.umd.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
(function(A,I){typeof exports=="object"&&typeof module<"u"?I(exports):typeof define=="function"&&define.amd?define(["exports"],I):(A=typeof globalThis<"u"?globalThis:A||self,I(A.CredenzaScanner={}))})(this,function(A){"use strict";var Yt=Object.defineProperty;var Jt=(A,I,N)=>I in A?Yt(A,I,{enumerable:!0,configurable:!0,writable:!0,value:N}):A[I]=N;var ve=(A,I,N)=>(Jt(A,typeof I!="symbol"?I+"":I,N),N);function I(){}function N(s){return s()}function xe(){return Object.create(null)}function J(s){s.forEach(N)}function le(s){return typeof s=="function"}function Ee(s,o){return s!=s?o==o:s!==o||s&&typeof s=="object"||typeof s=="function"}function Ke(s){return Object.keys(s).length===0}function de(s,o){s.appendChild(o)}function _e(s,o,a){const l=Ye(s);if(!l.getElementById(o)){const u=ne("style");u.id=o,u.textContent=a,Je(l,u)}}function Ye(s){if(!s)return document;const o=s.getRootNode?s.getRootNode():s.ownerDocument;return o&&o.host?o:s.ownerDocument}function Je(s,o){return de(s.head||s,o),o.sheet}function Ie(s,o,a){s.insertBefore(o,a||null)}function ue(s){s.parentNode&&s.parentNode.removeChild(s)}function ne(s){return document.createElement(s)}function et(s){return document.createTextNode(s)}function tt(){return et(" ")}function rt(s,o,a,l){return s.addEventListener(o,a,l),()=>s.removeEventListener(o,a,l)}function T(s,o,a){a==null?s.removeAttribute(o):s.getAttribute(o)!==a&&s.setAttribute(o,a)}function ot(s){return Array.from(s.childNodes)}let ee;function te(s){ee=s}function nt(){if(!ee)throw new Error("Function called outside component initialization");return ee}function at(s){nt().$$.on_destroy.push(s)}const X=[],Me=[];let V=[];const Se=[],it=Promise.resolve();let he=!1;function st(){he||(he=!0,it.then(Ae))}function fe(s){V.push(s)}const Be=new Set;let H=0;function Ae(){if(H!==0)return;const s=ee;do{try{for(;H<X.length;){const o=X[H];H++,te(o),ct(o.$$)}}catch(o){throw X.length=0,H=0,o}for(te(null),X.length=0,H=0;Me.length;)Me.pop()();for(let o=0;o<V.length;o+=1){const a=V[o];Be.has(a)||(Be.add(a),a())}V.length=0}while(X.length);for(;Se.length;)Se.pop()();he=!1,Be.clear(),te(s)}function ct(s){if(s.fragment!==null){s.update(),J(s.before_update);const o=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,o),s.after_update.forEach(fe)}}function lt(s){const o=[],a=[];V.forEach(l=>s.indexOf(l)===-1?o.push(l):a.push(l)),a.forEach(l=>l()),V=o}const ae=new Set;let j;function dt(){j={r:0,c:[],p:j}}function ut(){j.r||J(j.c),j=j.p}function re(s,o){s&&s.i&&(ae.delete(s),s.i(o))}function ke(s,o,a,l){if(s&&s.o){if(ae.has(s))return;ae.add(s),j.c.push(()=>{ae.delete(s),l&&(a&&s.d(1),l())}),s.o(o)}else l&&l()}function ht(s){s&&s.c()}function Le(s,o,a){const{fragment:l,after_update:u}=s.$$;l&&l.m(o,a),fe(()=>{const f=s.$$.on_mount.map(N).filter(le);s.$$.on_destroy?s.$$.on_destroy.push(...f):J(f),s.$$.on_mount=[]}),u.forEach(fe)}function Fe(s,o){const a=s.$$;a.fragment!==null&&(lt(a.after_update),J(a.on_destroy),a.fragment&&a.fragment.d(o),a.on_destroy=a.fragment=null,a.ctx=[])}function ft(s,o){s.$$.dirty[0]===-1&&(X.push(s),st(),s.$$.dirty.fill(0)),s.$$.dirty[o/31|0]|=1<<o%31}function Re(s,o,a,l,u,f,B=null,i=[-1]){const k=ee;te(s);const m=s.$$={fragment:null,ctx:[],props:f,update:I,not_equal:u,bound:xe(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(k?k.$$.context:[])),callbacks:xe(),dirty:i,skip_bound:!1,root:o.target||k.$$.root};B&&B(m.root);let w=!1;if(m.ctx=a?a(s,o.props||{},(C,p,...b)=>{const M=b.length?b[0]:p;return m.ctx&&u(m.ctx[C],m.ctx[C]=M)&&(!m.skip_bound&&m.bound[C]&&m.bound[C](M),w&&ft(s,C)),p}):[],m.update(),w=!0,J(m.before_update),m.fragment=l?l(m.ctx):!1,o.target){if(o.hydrate){const C=ot(o.target);m.fragment&&m.fragment.l(C),C.forEach(ue)}else m.fragment&&m.fragment.c();o.intro&&re(s.$$.fragment),Le(s,o.target,o.anchor),Ae()}te(k)}class Oe{constructor(){ve(this,"$$");ve(this,"$$set")}$destroy(){Fe(this,1),this.$destroy=I}$on(o,a){if(!le(a))return I;const l=this.$$.callbacks[o]||(this.$$.callbacks[o]=[]);return l.push(a),()=>{const u=l.indexOf(a);u!==-1&&l.splice(u,1)}}$set(o){this.$$set&&!Ke(o)&&(this.$$.skip_bound=!0,this.$$set(o),this.$$.skip_bound=!1)}}const Bt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Bt);function kt(s){_e(s,"svelte-1is2ll8",".cscanapp-close.svelte-1is2ll8{position:absolute;z-index:10;right:5px;top:5px;width:32px;height:32px;opacity:0.3;cursor:pointer}.cscanapp-close.svelte-1is2ll8:hover{opacity:1}.cscanapp-close.svelte-1is2ll8:before,.cscanapp-close.svelte-1is2ll8:after{position:absolute;left:15px;content:' ';height:33px;width:2px;background-color:#000}.cscanapp-close.svelte-1is2ll8:before{transform:rotate(45deg)}.cscanapp-close.svelte-1is2ll8:after{transform:rotate(-45deg)}")}function mt(s){let o,a,l;return{c(){o=ne("div"),T(o,"class","cscanapp-close svelte-1is2ll8"),T(o,"role","button"),T(o,"tabindex","0")},m(u,f){Ie(u,o,f),a||(l=rt(o,"click",function(){le(s[0])&&s[0].apply(this,arguments)}),a=!0)},p(u,[f]){s=u},i:I,o:I,d(u){u&&ue(o),a=!1,l()}}}function wt(s,o,a){let{close:l}=o;return s.$$set=u=>{"close"in u&&a(0,l=u.close)},[l]}class pt extends Oe{constructor(o){super(),Re(this,o,wt,mt,Ee,{close:0},kt)}}function gt(s){_e(s,"svelte-rajxqa",".cscanapp.svelte-rajxqa.svelte-rajxqa{position:relative;width:100%;height:100%;border-radius:inherit}.cscanapp.svelte-rajxqa video.svelte-rajxqa{width:100%;height:100%;object-fit:cover;position:absolute;border-radius:inherit;display:block}")}function Ue(s){let o,a;return o=new pt({props:{close:s[0]}}),{c(){ht(o.$$.fragment)},m(l,u){Le(o,l,u),a=!0},p(l,u){const f={};u&1&&(f.close=l[0]),o.$set(f)},i(l){a||(re(o.$$.fragment,l),a=!0)},o(l){ke(o.$$.fragment,l),a=!1},d(l){Fe(o,l)}}}function Ct(s){let o,a,l,u,f,B,i=s[1]&&Ue(s);return{c(){o=ne("div"),i&&i.c(),a=tt(),l=ne("video"),T(l,"id",u=s[2].VIDEO),T(l,"class","svelte-rajxqa"),T(o,"id",f=s[2].ROOT),T(o,"class","cscanapp svelte-rajxqa")},m(k,m){Ie(k,o,m),i&&i.m(o,null),de(o,a),de(o,l),B=!0},p(k,[m]){k[1]?i?(i.p(k,m),m&2&&re(i,1)):(i=Ue(k),i.c(),re(i,1),i.m(o,a)):i&&(dt(),ke(i,1,1,()=>{i=null}),ut()),(!B||m&4&&u!==(u=k[2].VIDEO))&&T(l,"id",u),(!B||m&4&&f!==(f=k[2].ROOT))&&T(o,"id",f)},i(k){B||(re(i),B=!0)},o(k){ke(i),B=!1},d(k){k&&ue(o),i&&i.d()}}}function yt(s,o,a){let{close:l}=o,{isCloseButton:u}=o,{scannerElements:f}=o;return at(l),s.$$set=B=>{"close"in B&&a(0,l=B.close),"isCloseButton"in B&&a(1,u=B.isCloseButton),"scannerElements"in B&&a(2,f=B.scannerElements)},[l,u,f]}class bt extends Oe{constructor(o){super(),Re(this,o,yt,Ct,Ee,{close:0,isCloseButton:1,scannerElements:2},gt)}}var G=(s=>(s.CAPTURE="capture",s.ERROR="error",s.CANCEL="cancel",s))(G||{}),ie=(s=>(s.ROOT="cscanapp",s.VIDEO="cscanappVideo",s))(ie||{}),me={},se={};se.byteLength=xt,se.toByteArray=_t,se.fromByteArray=St;for(var O=[],L=[],Pt=typeof Uint8Array<"u"?Uint8Array:Array,we="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=0,vt=we.length;Q<vt;++Q)O[Q]=we[Q],L[we.charCodeAt(Q)]=Q;L[45]=62,L[95]=63;function $e(s){var o=s.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var a=s.indexOf("=");a===-1&&(a=o);var l=a===o?0:4-a%4;return[a,l]}function xt(s){var o=$e(s),a=o[0],l=o[1];return(a+l)*3/4-l}function Et(s,o,a){return(o+a)*3/4-a}function _t(s){var o,a=$e(s),l=a[0],u=a[1],f=new Pt(Et(s,l,u)),B=0,i=u>0?l-4:l,k;for(k=0;k<i;k+=4)o=L[s.charCodeAt(k)]<<18|L[s.charCodeAt(k+1)]<<12|L[s.charCodeAt(k+2)]<<6|L[s.charCodeAt(k+3)],f[B++]=o>>16&255,f[B++]=o>>8&255,f[B++]=o&255;return u===2&&(o=L[s.charCodeAt(k)]<<2|L[s.charCodeAt(k+1)]>>4,f[B++]=o&255),u===1&&(o=L[s.charCodeAt(k)]<<10|L[s.charCodeAt(k+1)]<<4|L[s.charCodeAt(k+2)]>>2,f[B++]=o>>8&255,f[B++]=o&255),f}function It(s){return O[s>>18&63]+O[s>>12&63]+O[s>>6&63]+O[s&63]}function Mt(s,o,a){for(var l,u=[],f=o;f<a;f+=3)l=(s[f]<<16&16711680)+(s[f+1]<<8&65280)+(s[f+2]&255),u.push(It(l));return u.join("")}function St(s){for(var o,a=s.length,l=a%3,u=[],f=16383,B=0,i=a-l;B<i;B+=f)u.push(Mt(s,B,B+f>i?i:B+f));return l===1?(o=s[a-1],u.push(O[o>>2]+O[o<<4&63]+"==")):l===2&&(o=(s[a-2]<<8)+s[a-1],u.push(O[o>>10]+O[o>>4&63]+O[o<<2&63]+"=")),u.join("")}var pe={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */pe.read=function(s,o,a,l,u){var f,B,i=u*8-l-1,k=(1<<i)-1,m=k>>1,w=-7,C=a?u-1:0,p=a?-1:1,b=s[o+C];for(C+=p,f=b&(1<<-w)-1,b>>=-w,w+=i;w>0;f=f*256+s[o+C],C+=p,w-=8);for(B=f&(1<<-w)-1,f>>=-w,w+=l;w>0;B=B*256+s[o+C],C+=p,w-=8);if(f===0)f=1-m;else{if(f===k)return B?NaN:(b?-1:1)*(1/0);B=B+Math.pow(2,l),f=f-m}return(b?-1:1)*B*Math.pow(2,f-l)},pe.write=function(s,o,a,l,u,f){var B,i,k,m=f*8-u-1,w=(1<<m)-1,C=w>>1,p=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=l?0:f-1,M=l?1:-1,R=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(i=isNaN(o)?1:0,B=w):(B=Math.floor(Math.log(o)/Math.LN2),o*(k=Math.pow(2,-B))<1&&(B--,k*=2),B+C>=1?o+=p/k:o+=p*Math.pow(2,1-C),o*k>=2&&(B++,k/=2),B+C>=w?(i=0,B=w):B+C>=1?(i=(o*k-1)*Math.pow(2,u),B=B+C):(i=o*Math.pow(2,C-1)*Math.pow(2,u),B=0));u>=8;s[a+b]=i&255,b+=M,i/=256,u-=8);for(B=B<<u|i,m+=u;m>0;s[a+b]=B&255,b+=M,B/=256,m-=8);s[a+b-M]|=R*128};/*!
|
|
1
|
+
(function(ye,$e){typeof exports=="object"&&typeof module<"u"?$e(exports):typeof define=="function"&&define.amd?define(["exports"],$e):(ye=typeof globalThis<"u"?globalThis:ye||self,$e(ye.CredenzaScanner={}))})(this,(function(ye){"use strict";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");let Ae=!1,Tr=!1;function Or(){Ae=!0}Or();const Ur=2,Nr=4,Dr=8,qr=1,$r=2,q=Symbol(),zr="http://www.w3.org/1999/xhtml",Mt=!1;var jr=Array.isArray,Wr=Array.prototype.indexOf,Hr=Object.defineProperty,ze=Object.getOwnPropertyDescriptor,St=Object.getOwnPropertyDescriptors,Vr=Object.prototype,Xr=Array.prototype,rt=Object.getPrototypeOf;function Gr(o){return o()}function ot(o){for(var t=0;t<o.length;t++)o[t]()}function At(){var o,t,n=new Promise((a,c)=>{o=a,t=c});return{promise:n,resolve:o,reject:t}}const $=2,nt=4,it=8,re=16,oe=32,Ce=64,at=128,z=1024,H=2048,ne=4096,Q=8192,ie=16384,st=32768,Re=65536,Rt=1<<17,Yr=1<<18,je=1<<19,Ft=1<<20,G=256,We=512,He=32768,ct=1<<21,lt=1<<22,pe=1<<23,be=Symbol("$state"),Kr=Symbol("legacy props"),Pe=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Lt(o){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Qr(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Zr(o){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Jr(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function eo(o){throw new Error("https://svelte.dev/e/effect_orphan")}function to(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function ro(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function oo(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function no(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Tt(o){return o===this.v}function io(o,t){return o!=o?t==t:o!==t||o!==null&&typeof o=="object"||typeof o=="function"}function ao(o){return!io(o,this.v)}let D=null;function Ve(o){D=o}function so(o,t=!1,n){D={p:D,i:!1,c:null,e:null,s:o,x:null,l:Ae&&!t?{s:null,u:null,$:[]}:null}}function co(o){var t=D,n=t.e;if(n!==null){t.e=null;for(var a of n)Yt(a)}return t.i=!0,D=t.p,{}}function Fe(){return!Ae||D!==null&&D.l===null}let _e=[];function lo(){var o=_e;_e=[],ot(o)}function Ot(o){if(_e.length===0){var t=_e;queueMicrotask(()=>{t===_e&&lo()})}_e.push(o)}function uo(o){var t=I;if(t===null)return E.f|=pe,o;if((t.f&st)===0){if((t.f&at)===0)throw o;t.b.error(o)}else Xe(o,t)}function Xe(o,t){for(;t!==null;){if((t.f&at)!==0)try{t.b.error(o);return}catch(n){o=n}t=t.parent}throw o}const Ge=new Set;let U=null,K=null,ce=[],dt=null,ut=!1;class Le{committed=!1;current=new Map;previous=new Map;#t=new Set;#r=new Set;#e=0;#o=0;#i=null;#a=[];#s=[];skipped_effects=new Set;is_fork=!1;process(t){ce=[],this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const a of t)this.#c(a,n);this.is_fork||this.#l(),this.#o>0||this.is_fork?(this.#n(n.effects),this.#n(n.render_effects),this.#n(n.block_effects)):(U=null,Ut(n.render_effects),Ut(n.effects),this.#i?.resolve()),K=null}#c(t,n){t.f^=z;for(var a=t.first;a!==null;){var c=a.f,u=(c&(oe|Ce))!==0,f=u&&(c&z)!==0,l=f||(c&Q)!==0||this.skipped_effects.has(a);if((a.f&at)!==0&&a.b?.is_pending()&&(n={parent:n,effect:a,effects:[],render_effects:[],block_effects:[]}),!l&&a.fn!==null){u?a.f^=z:(c&nt)!==0?n.effects.push(a):Oe(a)&&((a.f&re)!==0&&n.block_effects.push(a),Ue(a));var B=a.first;if(B!==null){a=B;continue}}var m=a.parent;for(a=a.next;a===null&&m!==null;)m===n.effect&&(this.#n(n.effects),this.#n(n.render_effects),this.#n(n.block_effects),n=n.parent),a=m.next,m=m.parent}}#n(t){for(const n of t)((n.f&H)!==0?this.#a:this.#s).push(n),j(n,z)}capture(t,n){this.previous.has(t)||this.previous.set(t,n),this.current.set(t,t.v),K?.set(t,t.v)}activate(){U=this}deactivate(){U=null,K=null}flush(){if(this.activate(),ce.length>0){if(fo(),U!==null&&U!==this)return}else this.#e===0&&this.process([]);this.deactivate()}discard(){for(const t of this.#r)t(this);this.#r.clear()}#l(){if(this.#o===0){for(const t of this.#t)t();this.#t.clear()}this.#e===0&&this.#d()}#d(){if(Ge.size>1){this.previous.clear();var t=K,n=!0,a={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const c of Ge){if(c===this){n=!1;continue}const u=[];for(const[l,B]of this.current){if(c.current.has(l))if(n&&B!==c.current.get(l))c.current.set(l,B);else continue;u.push(l)}if(u.length===0)continue;const f=[...c.current.keys()].filter(l=>!this.current.has(l));if(f.length>0){const l=new Set,B=new Map;for(const m of u)Nt(m,f,l,B);if(ce.length>0){U=c,c.apply();for(const m of ce)c.#c(m,a);ce=[],c.deactivate()}}}U=null,K=t}this.committed=!0,Ge.delete(this)}increment(t){this.#e+=1,t&&(this.#o+=1)}decrement(t){this.#e-=1,t&&(this.#o-=1),this.revive()}revive(){for(const t of this.#a)j(t,H),we(t);for(const t of this.#s)j(t,ne),we(t);this.#a=[],this.#s=[],this.flush()}oncommit(t){this.#t.add(t)}ondiscard(t){this.#r.add(t)}settled(){return(this.#i??=At()).promise}static ensure(){if(U===null){const t=U=new Le;Ge.add(U),Le.enqueue(()=>{U===t&&t.flush()})}return U}static enqueue(t){Ot(t)}apply(){}}function fo(){var o=Ee;ut=!0;try{var t=0;for(rr(!0);ce.length>0;){var n=Le.ensure();if(t++>1e3){var a,c;ho()}n.process(ce),le.clear()}}finally{ut=!1,rr(o),dt=null}}function ho(){try{to()}catch(o){Xe(o,dt)}}let ae=null;function Ut(o){var t=o.length;if(t!==0){for(var n=0;n<t;){var a=o[n++];if((a.f&(ie|Q))===0&&Oe(a)&&(ae=new Set,Ue(a),a.deps===null&&a.first===null&&a.nodes_start===null&&(a.teardown===null&&a.ac===null?Jt(a):a.fn=null),ae?.size>0)){le.clear();for(const c of ae){if((c.f&(ie|Q))!==0)continue;const u=[c];let f=c.parent;for(;f!==null;)ae.has(f)&&(ae.delete(f),u.push(f)),f=f.parent;for(let l=u.length-1;l>=0;l--){const B=u[l];(B.f&(ie|Q))===0&&Ue(B)}}ae.clear()}}ae=null}}function Nt(o,t,n,a){if(!n.has(o)&&(n.add(o),o.reactions!==null))for(const c of o.reactions){const u=c.f;(u&$)!==0?Nt(c,t,n,a):(u&(lt|re))!==0&&(u&H)===0&&Dt(c,t,a)&&(j(c,H),we(c))}}function Dt(o,t,n){const a=n.get(o);if(a!==void 0)return a;if(o.deps!==null)for(const c of o.deps){if(t.includes(c))return!0;if((c.f&$)!==0&&Dt(c,t,n))return n.set(c,!0),!0}return n.set(o,!1),!1}function we(o){for(var t=dt=o;t.parent!==null;){t=t.parent;var n=t.f;if(ut&&t===I&&(n&re)!==0)return;if((n&(Ce|oe))!==0){if((n&z)===0)return;t.f^=z}}ce.push(t)}function Bo(o,t,n,a){const c=Fe()?ft:qt;if(n.length===0&&o.length===0){a(t.map(c));return}var u=U,f=I,l=mo();function B(){Promise.all(n.map(m=>ko(m))).then(m=>{l();try{a([...t.map(c),...m])}catch(w){(f.f&ie)===0&&Xe(w,f)}u?.deactivate(),Ye()}).catch(m=>{Xe(m,f)})}o.length>0?Promise.all(o).then(()=>{l();try{return B()}finally{u?.deactivate(),Ye()}}):B()}function mo(){var o=I,t=E,n=D,a=U;return function(u=!0){Be(o),J(t),Ve(n),u&&a?.activate()}}function Ye(){Be(null),J(null),Ve(null)}function ft(o){var t=$|H,n=E!==null&&(E.f&$)!==0?E:null;return I===null||n!==null&&(n.f&G)!==0?t|=G:I.f|=je,{ctx:D,deps:null,effects:null,equals:Tt,f:t,fn:o,reactions:null,rv:0,v:q,wv:0,parent:n??I,ac:null}}function ko(o,t){let n=I;n===null&&Qr();var a=n.b,c=void 0,u=Wt(q),f=!E,l=new Map;return Io(()=>{var B=At();c=B.promise;try{Promise.resolve(o()).then(B.resolve,B.reject).then(()=>{m===U&&m.committed&&m.deactivate(),Ye()})}catch(v){B.reject(v),Ye()}var m=U;if(f){var w=!a.is_pending();a.update_pending_count(1),m.increment(w),l.get(m)?.reject(Pe),l.delete(m),l.set(m,B)}const y=(v,p=void 0)=>{if(m.activate(),p)p!==Pe&&(u.f|=pe,mt(u,p));else{(u.f&pe)!==0&&(u.f^=pe),mt(u,v);for(const[g,C]of l){if(l.delete(g),g===m)break;C.reject(Pe)}}f&&(a.update_pending_count(-1),m.decrement(w))};B.promise.then(y,v=>y(null,v||"unknown"))}),Gt(()=>{for(const B of l.values())B.reject(Pe)}),new Promise(B=>{function m(w){function y(){w===c?B(u):m(c)}w.then(y,y)}m(c)})}function qt(o){const t=ft(o);return t.equals=ao,t}function $t(o){var t=o.effects;if(t!==null){o.effects=null;for(var n=0;n<t.length;n+=1)he(t[n])}}function po(o){for(var t=o.parent;t!==null;){if((t.f&$)===0)return t;t=t.parent}return null}function ht(o){var t,n=I;Be(po(o));try{o.f&=~He,$t(o),t=cr(o)}finally{Be(n)}return t}function zt(o){var t=ht(o);if(o.equals(t)||(o.v=t,o.wv=ar()),!ge)if(K!==null)K.set(o,o.v);else{var n=(me||(o.f&G)!==0)&&o.deps!==null?ne:z;j(o,n)}}let Bt=new Set;const le=new Map;let jt=!1;function Wt(o,t){var n={f:0,v:o,reactions:null,equals:Tt,rv:0,wv:0};return n}function de(o,t){const n=Wt(o);return Uo(n),n}function ue(o,t,n=!1){E!==null&&(!Z||(E.f&Rt)!==0)&&Fe()&&(E.f&($|re|lt|Rt))!==0&&!se?.includes(o)&&no();let a=n?xe(t):t;return mt(o,a)}function mt(o,t){if(!o.equals(t)){var n=o.v;ge?le.set(o,t):le.set(o,n),o.v=t;var a=Le.ensure();a.capture(o,n),(o.f&$)!==0&&((o.f&H)!==0&&ht(o),j(o,(o.f&G)===0?z:ne)),o.wv=ar(),Ht(o,H),Fe()&&I!==null&&(I.f&z)!==0&&(I.f&(oe|Ce))===0&&(Y===null?No([o]):Y.push(o)),!a.is_fork&&Bt.size>0&&!jt&&wo()}return t}function wo(){jt=!1;const o=Array.from(Bt);for(const t of o)(t.f&z)!==0&&j(t,ne),Oe(t)&&Ue(t);Bt.clear()}function kt(o){ue(o,o.v+1)}function Ht(o,t){var n=o.reactions;if(n!==null)for(var a=Fe(),c=n.length,u=0;u<c;u++){var f=n[u],l=f.f;if(!(!a&&f===I)){var B=(l&H)===0;B&&j(f,t),(l&$)!==0?(l&He)===0&&(f.f|=He,Ht(f,ne)):B&&((l&re)!==0&&ae!==null&&ae.add(f),we(f))}}}function xe(o){if(typeof o!="object"||o===null||be in o)return o;const t=rt(o);if(t!==Vr&&t!==Xr)return o;var n=new Map,a=jr(o),c=de(0),u=ve,f=l=>{if(ve===u)return l();var B=E,m=ve;J(null),ir(u);var w=l();return J(B),ir(m),w};return a&&n.set("length",de(o.length)),new Proxy(o,{defineProperty(l,B,m){(!("value"in m)||m.configurable===!1||m.enumerable===!1||m.writable===!1)&&ro();var w=n.get(B);return w===void 0?w=f(()=>{var y=de(m.value);return n.set(B,y),y}):ue(w,m.value,!0),!0},deleteProperty(l,B){var m=n.get(B);if(m===void 0){if(B in l){const w=f(()=>de(q));n.set(B,w),kt(c)}}else ue(m,q),kt(c);return!0},get(l,B,m){if(B===be)return o;var w=n.get(B),y=B in l;if(w===void 0&&(!y||ze(l,B)?.writable)&&(w=f(()=>{var p=xe(y?l[B]:q),g=de(p);return g}),n.set(B,w)),w!==void 0){var v=ee(w);return v===q?void 0:v}return Reflect.get(l,B,m)},getOwnPropertyDescriptor(l,B){var m=Reflect.getOwnPropertyDescriptor(l,B);if(m&&"value"in m){var w=n.get(B);w&&(m.value=ee(w))}else if(m===void 0){var y=n.get(B),v=y?.v;if(y!==void 0&&v!==q)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return m},has(l,B){if(B===be)return!0;var m=n.get(B),w=m!==void 0&&m.v!==q||Reflect.has(l,B);if(m!==void 0||I!==null&&(!w||ze(l,B)?.writable)){m===void 0&&(m=f(()=>{var v=w?xe(l[B]):q,p=de(v);return p}),n.set(B,m));var y=ee(m);if(y===q)return!1}return w},set(l,B,m,w){var y=n.get(B),v=B in l;if(a&&B==="length")for(var p=m;p<y.v;p+=1){var g=n.get(p+"");g!==void 0?ue(g,q):p in l&&(g=f(()=>de(q)),n.set(p+"",g))}if(y===void 0)(!v||ze(l,B)?.writable)&&(y=f(()=>de(void 0)),ue(y,xe(m)),n.set(B,y));else{v=y.v!==q;var C=f(()=>xe(m));ue(y,C)}var _=Reflect.getOwnPropertyDescriptor(l,B);if(_?.set&&_.set.call(w,m),!v){if(a&&typeof B=="string"){var M=n.get("length"),b=Number(B);Number.isInteger(b)&&b>=M.v&&ue(M,b+1)}kt(c)}return!0},ownKeys(l){ee(c);var B=Reflect.ownKeys(l).filter(y=>{var v=n.get(y);return v===void 0||v.v!==q});for(var[m,w]of n)w.v!==q&&!(m in l)&&B.push(m);return B},setPrototypeOf(){oo()}})}var go,vo,yo;function Vt(o=""){return document.createTextNode(o)}function pt(o){return vo.call(o)}function wt(o){return yo.call(o)}function Co(o,t){return pt(o)}function bo(o,t=1,n=!1){let a=o;for(;t--;)a=wt(a);return a}function Po(){return!1}function gt(o){var t=E,n=I;J(null),Be(null);try{return o()}finally{J(t),Be(n)}}function Xt(o){I===null&&E===null&&eo(),E!==null&&(E.f&G)!==0&&I===null&&Jr(),ge&&Zr()}function _o(o,t){var n=t.last;n===null?t.last=t.first=o:(n.next=o,o.prev=n,t.last=o)}function fe(o,t,n,a=!0){var c=I;c!==null&&(c.f&Q)!==0&&(o|=Q);var u={ctx:D,deps:null,nodes_start:null,nodes_end:null,f:o|H,first:null,fn:t,last:null,next:null,parent:c,b:c&&c.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Ue(u),u.f|=st}catch(B){throw he(u),B}else t!==null&&we(u);if(a){var f=u;if(n&&f.deps===null&&f.teardown===null&&f.nodes_start===null&&f.first===f.last&&(f.f&je)===0&&(f=f.first,(o&re)!==0&&(o&Re)!==0&&f!==null&&(f.f|=Re)),f!==null&&(f.parent=c,c!==null&&_o(f,c),E!==null&&(E.f&$)!==0&&(o&Ce)===0)){var l=E;(l.effects??=[]).push(f)}}return u}function Gt(o){const t=fe(it,null,!1);return j(t,z),t.teardown=o,t}function vt(o){Xt();var t=I.f,n=!E&&(t&oe)!==0&&(t&st)===0;if(n){var a=D;(a.e??=[]).push(o)}else return Yt(o)}function Yt(o){return fe(nt|Ft,o,!1)}function xo(o){return Xt(),fe(it|Ft,o,!0)}function Eo(o){return fe(nt,o,!1)}function Io(o){return fe(lt|je,o,!0)}function Mo(o,t=[],n=[],a=[]){Bo(a,t,n,c=>{fe(it,()=>o(...c.map(ee)),!0)})}function So(o,t=0){var n=fe(re|t,o,!0);return n}function Kt(o,t=!0){return fe(oe|je,o,!0,t)}function Qt(o){var t=o.teardown;if(t!==null){const n=ge,a=E;or(!0),J(null);try{t.call(null)}finally{or(n),J(a)}}}function Zt(o,t=!1){var n=o.first;for(o.first=o.last=null;n!==null;){const c=n.ac;c!==null&>(()=>{c.abort(Pe)});var a=n.next;(n.f&Ce)!==0?n.parent=null:he(n,t),n=a}}function Ao(o){for(var t=o.first;t!==null;){var n=t.next;(t.f&oe)===0&&he(t),t=n}}function he(o,t=!0){var n=!1;(t||(o.f&Yr)!==0)&&o.nodes_start!==null&&o.nodes_end!==null&&(Ro(o.nodes_start,o.nodes_end),n=!0),Zt(o,t&&!n),Ke(o,0),j(o,ie);var a=o.transitions;if(a!==null)for(const u of a)u.stop();Qt(o);var c=o.parent;c!==null&&c.first!==null&&Jt(o),o.next=o.prev=o.teardown=o.ctx=o.deps=o.fn=o.nodes_start=o.nodes_end=o.ac=null}function Ro(o,t){for(;o!==null;){var n=o===t?null:wt(o);o.remove(),o=n}}function Jt(o){var t=o.parent,n=o.prev,a=o.next;n!==null&&(n.next=a),a!==null&&(a.prev=n),t!==null&&(t.first===o&&(t.first=a),t.last===o&&(t.last=n))}function Fo(o,t,n=!0){var a=[];er(o,a,!0),Lo(a,()=>{n&&he(o),t&&t()})}function Lo(o,t){var n=o.length;if(n>0){var a=()=>--n||t();for(var c of o)c.out(a)}else t()}function er(o,t,n){if((o.f&Q)===0){if(o.f^=Q,o.transitions!==null)for(const f of o.transitions)(f.is_global||n)&&t.push(f);for(var a=o.first;a!==null;){var c=a.next,u=(a.f&Re)!==0||(a.f&oe)!==0&&(o.f&re)!==0;er(a,t,u?n:!1),a=c}}}function To(o){tr(o,!0)}function tr(o,t){if((o.f&Q)!==0){o.f^=Q,(o.f&z)===0&&(j(o,H),we(o));for(var n=o.first;n!==null;){var a=n.next,c=(n.f&Re)!==0||(n.f&oe)!==0;tr(n,c?t:!1),n=a}if(o.transitions!==null)for(const u of o.transitions)(u.is_global||t)&&u.in()}}function Oo(o,t){for(var n=o.nodes_start,a=o.nodes_end;n!==null;){var c=n===a?null:wt(n);t.append(n),n=c}}let Ee=!1;function rr(o){Ee=o}let ge=!1;function or(o){ge=o}let E=null,Z=!1;function J(o){E=o}let I=null;function Be(o){I=o}let se=null;function Uo(o){E!==null&&(se===null?se=[o]:se.push(o))}let W=null,X=0,Y=null;function No(o){Y=o}let nr=1,Te=0,ve=Te;function ir(o){ve=o}let me=!1;function ar(){return++nr}function Oe(o){var t=o.f;if((t&H)!==0)return!0;if((t&ne)!==0){var n=o.deps,a=(t&G)!==0;if(t&$&&(o.f&=~He),n!==null){var c,u,f=(t&We)!==0,l=a&&I!==null&&!me,B=n.length;if((f||l)&&(I===null||(I.f&ie)===0)){var m=o,w=m.parent;for(c=0;c<B;c++)u=n[c],(f||!u?.reactions?.includes(m))&&(u.reactions??=[]).push(m);f&&(m.f^=We),l&&w!==null&&(w.f&G)===0&&(m.f^=G)}for(c=0;c<B;c++)if(u=n[c],Oe(u)&&zt(u),u.wv>o.wv)return!0}(!a||I!==null&&!me)&&j(o,z)}return!1}function sr(o,t,n=!0){var a=o.reactions;if(a!==null&&!se?.includes(o))for(var c=0;c<a.length;c++){var u=a[c];(u.f&$)!==0?sr(u,t,!1):t===u&&(n?j(u,H):(u.f&z)!==0&&j(u,ne),we(u))}}function cr(o){var t=W,n=X,a=Y,c=E,u=me,f=se,l=D,B=Z,m=ve,w=o.f;W=null,X=0,Y=null,me=(w&G)!==0&&(Z||!Ee||E===null),E=(w&(oe|Ce))===0?o:null,se=null,Ve(o.ctx),Z=!1,ve=++Te,o.ac!==null&&(gt(()=>{o.ac.abort(Pe)}),o.ac=null);try{o.f|=ct;var y=o.fn,v=y(),p=o.deps;if(W!==null){var g;if(Ke(o,X),p!==null&&X>0)for(p.length=X+W.length,g=0;g<W.length;g++)p[X+g]=W[g];else o.deps=p=W;if(!me||(w&$)!==0&&o.reactions!==null)for(g=X;g<p.length;g++)(p[g].reactions??=[]).push(o)}else p!==null&&X<p.length&&(Ke(o,X),p.length=X);if(Fe()&&Y!==null&&!Z&&p!==null&&(o.f&($|ne|H))===0)for(g=0;g<Y.length;g++)sr(Y[g],o);return c!==null&&c!==o&&(Te++,Y!==null&&(a===null?a=Y:a.push(...Y))),(o.f&pe)!==0&&(o.f^=pe),v}catch(C){return uo(C)}finally{o.f^=ct,W=t,X=n,Y=a,E=c,me=u,se=f,Ve(l),Z=B,ve=m}}function Do(o,t){let n=t.reactions;if(n!==null){var a=Wr.call(n,o);if(a!==-1){var c=n.length-1;c===0?n=t.reactions=null:(n[a]=n[c],n.pop())}}n===null&&(t.f&$)!==0&&(W===null||!W.includes(t))&&(j(t,ne),(t.f&(G|We))===0&&(t.f^=We),$t(t),Ke(t,0))}function Ke(o,t){var n=o.deps;if(n!==null)for(var a=t;a<n.length;a++)Do(o,n[a])}function Ue(o){var t=o.f;if((t&ie)===0){j(o,z);var n=I,a=Ee;I=o,Ee=!0;try{(t&re)!==0?Ao(o):Zt(o),Qt(o);var c=cr(o);o.teardown=typeof c=="function"?c:null,o.wv=nr;var u;Mt&&Tr&&(o.f&H)!==0&&o.deps}finally{Ee=a,I=n}}}function ee(o){var t=o.f,n=(t&$)!==0;if(E!==null&&!Z){var a=I!==null&&(I.f&ie)!==0;if(!a&&!se?.includes(o)){var c=E.deps;if((E.f&ct)!==0)o.rv<Te&&(o.rv=Te,W===null&&c!==null&&c[X]===o?X++:W===null?W=[o]:(!me||!W.includes(o))&&W.push(o));else{(E.deps??=[]).push(o);var u=o.reactions;u===null?o.reactions=[E]:u.includes(E)||u.push(E)}}}else if(n&&o.deps===null&&o.effects===null){var f=o,l=f.parent;l!==null&&(l.f&G)===0&&(f.f^=G)}if(ge){if(le.has(o))return le.get(o);if(n){f=o;var B=f.v;return((f.f&z)===0&&f.reactions!==null||lr(f))&&(B=ht(f)),le.set(f,B),B}}else if(n){if(f=o,K?.has(f))return K.get(f);Oe(f)&&zt(f)}if(K?.has(o))return K.get(o);if((o.f&pe)!==0)throw o.v;return o.v}function lr(o){if(o.v===q)return!0;if(o.deps===null)return!1;for(const t of o.deps)if(le.has(t)||(t.f&$)!==0&&lr(t))return!0;return!1}function Ne(o){var t=Z;try{return Z=!0,o()}finally{Z=t}}const qo=-7169;function j(o,t){o.f=o.f&qo|t}function yt(o){if(!(typeof o!="object"||!o||o instanceof EventTarget)){if(be in o)Ct(o);else if(!Array.isArray(o))for(let t in o){const n=o[t];typeof n=="object"&&n&&be in n&&Ct(n)}}}function Ct(o,t=new Set){if(typeof o=="object"&&o!==null&&!(o instanceof EventTarget)&&!t.has(o)){t.add(o),o instanceof Date&&o.getTime();for(let a in o)try{Ct(o[a],t)}catch{}const n=rt(o);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const a=St(n);for(let c in a){const u=a[c].get;if(u)try{u.call(o)}catch{}}}}}function $o(o,t,n,a={}){function c(u){if(a.capture||jo.call(t,u),!u.cancelBubble)return gt(()=>n?.call(this,u))}return o.startsWith("pointer")||o.startsWith("touch")||o==="wheel"?Ot(()=>{t.addEventListener(o,c,a)}):t.addEventListener(o,c,a),c}function zo(o,t,n,a,c){var u={capture:a,passive:c},f=$o(o,t,n,u);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Gt(()=>{t.removeEventListener(o,f,u)})}let dr=null;function jo(o){var t=this,n=t.ownerDocument,a=o.type,c=o.composedPath?.()||[],u=c[0]||o.target;dr=o;var f=0,l=dr===o&&o.__root;if(l){var B=c.indexOf(l);if(B!==-1&&(t===document||t===window)){o.__root=t;return}var m=c.indexOf(t);if(m===-1)return;B<=m&&(f=B)}if(u=c[f]||o.target,u!==t){Hr(o,"currentTarget",{configurable:!0,get(){return u||n}});var w=E,y=I;J(null),Be(null);try{for(var v,p=[];u!==null;){var g=u.assignedSlot||u.parentNode||u.host||null;try{var C=u["__"+a];C!=null&&(!u.disabled||o.target===u)&&C.call(u,o)}catch(_){v?p.push(_):v=_}if(o.cancelBubble||g===t||g===null)break;u=g}if(v){for(let _ of p)queueMicrotask(()=>{throw _});throw v}}finally{o.__root=t,delete o.currentTarget,J(w),Be(y)}}}function Wo(o){var t=document.createElement("template");return t.innerHTML=o.replaceAll("<!>","<!---->"),t.content}function ur(o,t){var n=I;n.nodes_start===null&&(n.nodes_start=o,n.nodes_end=t)}function fr(o,t){var n=(t&qr)!==0,a=(t&$r)!==0,c,u=!o.startsWith("<!>");return()=>{c===void 0&&(c=Wo(u?o:"<!>"+o),n||(c=pt(c)));var f=a||go?document.importNode(c,!0):c.cloneNode(!0);if(n){var l=pt(f),B=f.lastChild;ur(l,B)}else ur(f,f);return f}}function hr(o,t){o!==null&&o.before(t)}class Ho{anchor;#t=new Map;#r=new Map;#e=new Map;#o=!0;constructor(t,n=!0){this.anchor=t,this.#o=n}#i=()=>{var t=U;if(this.#t.has(t)){var n=this.#t.get(t),a=this.#r.get(n);if(a)To(a);else{var c=this.#e.get(n);c&&(this.#r.set(n,c.effect),this.#e.delete(n),c.fragment.lastChild.remove(),this.anchor.before(c.fragment),a=c.effect)}for(const[u,f]of this.#t){if(this.#t.delete(u),u===t)break;const l=this.#e.get(f);l&&(he(l.effect),this.#e.delete(f))}for(const[u,f]of this.#r){if(u===n)continue;const l=()=>{if(Array.from(this.#t.values()).includes(u)){var m=document.createDocumentFragment();Oo(f,m),m.append(Vt()),this.#e.set(u,{effect:f,fragment:m})}else he(f);this.#r.delete(u)};this.#o||!a?Fo(f,l,!1):l()}}};#a=t=>{this.#t.delete(t);const n=Array.from(this.#t.values());for(const[a,c]of this.#e)n.includes(a)||(he(c.effect),this.#e.delete(a))};ensure(t,n){var a=U,c=Po();if(n&&!this.#r.has(t)&&!this.#e.has(t))if(c){var u=document.createDocumentFragment(),f=Vt();u.append(f),this.#e.set(t,{effect:Kt(()=>n(f)),fragment:u})}else this.#r.set(t,Kt(()=>n(this.anchor)));if(this.#t.set(a,t),c){for(const[l,B]of this.#r)l===t?a.skipped_effects.delete(B):a.skipped_effects.add(B);for(const[l,B]of this.#e)l===t?a.skipped_effects.delete(B.effect):a.skipped_effects.add(B.effect);a.oncommit(this.#i),a.ondiscard(this.#a)}else this.#i()}}function Vo(o){D===null&&Lt(),Ae&&D.l!==null?Go(D).m.push(o):vt(()=>{const t=Ne(o);if(typeof t=="function")return t})}function Xo(o){D===null&&Lt(),Vo(()=>()=>Ne(o))}function Go(o){var t=o.l;return t.u??={a:[],b:[],m:[]}}function Yo(o,t,n=!1){var a=new Ho(o),c=n?Re:0;function u(f,l){a.ensure(f,l)}So(()=>{var f=!1;t((l,B=!0)=>{f=!0,u(B,l)}),f||u(!1,null)},c)}function Br(o,t){Eo(()=>{var n=o.getRootNode(),a=n.host?n:n.head??n.ownerDocument.head;if(!a.querySelector("#"+t.hash)){const c=document.createElement("style");c.id=t.hash,c.textContent=t.code,a.appendChild(c)}})}const Ko=Symbol("is custom element"),Qo=Symbol("is html");function mr(o,t,n,a){var c=Zo(o);c[t]!==(c[t]=n)&&(n==null?o.removeAttribute(t):typeof n!="string"&&Jo(o).includes(t)?o[t]=n:o.setAttribute(t,n))}function Zo(o){return o.__attributes??={[Ko]:o.nodeName.includes("-"),[Qo]:o.namespaceURI===zr}}var kr=new Map;function Jo(o){var t=o.getAttribute("is")||o.nodeName,n=kr.get(t);if(n)return n;kr.set(t,n=[]);for(var a,c=o,u=Element.prototype;u!==c;){a=St(c);for(var f in a)a[f].set&&n.push(f);c=rt(c)}return n}function en(o=!1){const t=D,n=t.l.u;if(!n)return;let a=()=>yt(t.s);if(o){let c=0,u={};const f=ft(()=>{let l=!1;const B=t.s;for(const m in B)B[m]!==u[m]&&(u[m]=B[m],l=!0);return l&&c++,c});a=()=>ee(f)}n.b.length&&xo(()=>{pr(t,a),ot(n.b)}),vt(()=>{const c=Ne(()=>n.m.map(Gr));return()=>{for(const u of c)typeof u=="function"&&u()}}),n.a.length&&vt(()=>{pr(t,a),ot(n.a)})}function pr(o,t){if(o.l.s)for(const n of o.l.s)ee(n);t()}let Qe=!1;function tn(o){var t=Qe;try{return Qe=!1,[o(),Qe]}finally{Qe=t}}function Ze(o,t,n,a){var c=!Ae||(n&Ur)!==0,u=(n&Dr)!==0,f=a,l=!0,B=()=>(l&&(l=!1,f=a),f),m;{var w=be in o||Kr in o;m=ze(o,t)?.set??(w&&t in o?b=>o[t]=b:void 0)}var y,v=!1;[y,v]=tn(()=>o[t]);var p;if(c?p=()=>{var b=o[t];return b===void 0?B():(l=!0,b)}:p=()=>{var b=o[t];return b!==void 0&&(f=void 0),b===void 0?f:b},c&&(n&Nr)===0)return p;if(m){var g=o.$$legacy;return(function(b,A){return arguments.length>0?((!c||!A||g||v)&&m(A?p():b),b):p()})}var C=!1,_=qt(()=>(C=!1,p()));ee(_);var M=I;return(function(b,A){if(arguments.length>0){const O=A?ee(_):c&&u?xe(b):b;return ue(_,O),C=!0,f!==void 0&&(f=O),b}return ge&&C||(M.f&ie)!==0?_.v:ee(_)})}var rn=fr('<div class="cscanapp-close svelte-degygl" role="button" tabindex="0"></div>');const on={hash:"svelte-degygl",code:`.cscanapp-close.svelte-degygl {position:absolute;z-index:10;right:5px;top:5px;width:32px;height:32px;opacity:0.3;cursor:pointer;}.cscanapp-close.svelte-degygl:hover {opacity:1;}.cscanapp-close.svelte-degygl:before,
|
|
2
|
+
.cscanapp-close.svelte-degygl:after {position:absolute;left:15px;content:' ';height:33px;width:2px;background-color:#000;}.cscanapp-close.svelte-degygl:before {transform:rotate(45deg);}.cscanapp-close.svelte-degygl:after {transform:rotate(-45deg);}`};function nn(o,t){Br(o,on);let n=Ze(t,"close",8);var a=rn();zo("click",a,function(...c){n()?.apply(this,c)}),hr(o,a)}var an=fr('<div class="cscanapp svelte-168e0l4"><!> <video class="svelte-168e0l4"></video></div>',2);const sn={hash:"svelte-168e0l4",code:".cscanapp.svelte-168e0l4 {position:relative;width:100%;height:100%;border-radius:inherit;}.cscanapp.svelte-168e0l4 video:where(.svelte-168e0l4) {width:100%;height:100%;object-fit:cover;position:absolute;border-radius:inherit;display:block;}"};function cn(o,t){so(t,!1),Br(o,sn);let n=Ze(t,"close",8),a=Ze(t,"isCloseButton",8),c=Ze(t,"scannerElements",8);Xo(n()),en();var u=an(),f=Co(u);{var l=m=>{nn(m,{get close(){return n()}})};Yo(f,m=>{a()&&m(l)})}var B=bo(f,2);Mo(()=>{mr(u,"id",(yt(c()),Ne(()=>c().ROOT))),mr(B,"id",(yt(c()),Ne(()=>c().VIDEO)))}),hr(o,u),co()}var Ie=(o=>(o.CAPTURE="capture",o.ERROR="error",o.CANCEL="cancel",o))(Ie||{}),Je=(o=>(o.ROOT="cscanapp",o.VIDEO="cscanappVideo",o))(Je||{}),bt={},De={},wr;function ln(){if(wr)return De;wr=1,De.byteLength=l,De.toByteArray=m,De.fromByteArray=v;for(var o=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,u=a.length;c<u;++c)o[c]=a[c],t[a.charCodeAt(c)]=c;t[45]=62,t[95]=63;function f(p){var g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var C=p.indexOf("=");C===-1&&(C=g);var _=C===g?0:4-C%4;return[C,_]}function l(p){var g=f(p),C=g[0],_=g[1];return(C+_)*3/4-_}function B(p,g,C){return(g+C)*3/4-C}function m(p){var g,C=f(p),_=C[0],M=C[1],b=new n(B(p,_,M)),A=0,O=M>0?_-4:_,T;for(T=0;T<O;T+=4)g=t[p.charCodeAt(T)]<<18|t[p.charCodeAt(T+1)]<<12|t[p.charCodeAt(T+2)]<<6|t[p.charCodeAt(T+3)],b[A++]=g>>16&255,b[A++]=g>>8&255,b[A++]=g&255;return M===2&&(g=t[p.charCodeAt(T)]<<2|t[p.charCodeAt(T+1)]>>4,b[A++]=g&255),M===1&&(g=t[p.charCodeAt(T)]<<10|t[p.charCodeAt(T+1)]<<4|t[p.charCodeAt(T+2)]>>2,b[A++]=g>>8&255,b[A++]=g&255),b}function w(p){return o[p>>18&63]+o[p>>12&63]+o[p>>6&63]+o[p&63]}function y(p,g,C){for(var _,M=[],b=g;b<C;b+=3)_=(p[b]<<16&16711680)+(p[b+1]<<8&65280)+(p[b+2]&255),M.push(w(_));return M.join("")}function v(p){for(var g,C=p.length,_=C%3,M=[],b=16383,A=0,O=C-_;A<O;A+=b)M.push(y(p,A,A+b>O?O:A+b));return _===1?(g=p[C-1],M.push(o[g>>2]+o[g<<4&63]+"==")):_===2&&(g=(p[C-2]<<8)+p[C-1],M.push(o[g>>10]+o[g>>4&63]+o[g<<2&63]+"=")),M.join("")}return De}var et={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var gr;function dn(){return gr||(gr=1,et.read=function(o,t,n,a,c){var u,f,l=c*8-a-1,B=(1<<l)-1,m=B>>1,w=-7,y=n?c-1:0,v=n?-1:1,p=o[t+y];for(y+=v,u=p&(1<<-w)-1,p>>=-w,w+=l;w>0;u=u*256+o[t+y],y+=v,w-=8);for(f=u&(1<<-w)-1,u>>=-w,w+=a;w>0;f=f*256+o[t+y],y+=v,w-=8);if(u===0)u=1-m;else{if(u===B)return f?NaN:(p?-1:1)*(1/0);f=f+Math.pow(2,a),u=u-m}return(p?-1:1)*f*Math.pow(2,u-a)},et.write=function(o,t,n,a,c,u){var f,l,B,m=u*8-c-1,w=(1<<m)-1,y=w>>1,v=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:u-1,g=a?1:-1,C=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,f=w):(f=Math.floor(Math.log(t)/Math.LN2),t*(B=Math.pow(2,-f))<1&&(f--,B*=2),f+y>=1?t+=v/B:t+=v*Math.pow(2,1-y),t*B>=2&&(f++,B/=2),f+y>=w?(l=0,f=w):f+y>=1?(l=(t*B-1)*Math.pow(2,c),f=f+y):(l=t*Math.pow(2,y-1)*Math.pow(2,c),f=0));c>=8;o[n+p]=l&255,p+=g,l/=256,c-=8);for(f=f<<c|l,m+=c;m>0;o[n+p]=f&255,p+=g,f/=256,m-=8);o[n+p-g]|=C*128}),et}/*!
|
|
2
3
|
* The buffer module from node.js, for the browser.
|
|
3
4
|
*
|
|
4
5
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
6
|
* @license MIT
|
|
6
|
-
*/(function(s){const o=se,a=pe,l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=i,s.SlowBuffer=Z,s.INSPECT_MAX_BYTES=50;const u=2147483647;s.kMaxLength=u,i.TYPED_ARRAY_SUPPORT=f(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}});function B(r){if(r>u)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,i.prototype),e}function i(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(r)}return k(r,e,t)}i.poolSize=8192;function k(r,e,t){if(typeof r=="string")return p(r,e);if(ArrayBuffer.isView(r))return M(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if($(r,ArrayBuffer)||r&&$(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(r,SharedArrayBuffer)||r&&$(r.buffer,SharedArrayBuffer)))return R(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return i.from(n,e,t);const c=D(r);if(c)return c;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return i.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}i.from=function(r,e,t){return k(r,e,t)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array);function m(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function w(r,e,t){return m(r),r<=0?B(r):e!==void 0?typeof t=="string"?B(r).fill(e,t):B(r).fill(e):B(r)}i.alloc=function(r,e,t){return w(r,e,t)};function C(r){return m(r),B(r<0?0:F(r)|0)}i.allocUnsafe=function(r){return C(r)},i.allocUnsafeSlow=function(r){return C(r)};function p(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=q(r,e)|0;let n=B(t);const c=n.write(r,e);return c!==t&&(n=n.slice(0,c)),n}function b(r){const e=r.length<0?0:F(r.length)|0,t=B(e);for(let n=0;n<e;n+=1)t[n]=r[n]&255;return t}function M(r){if($(r,Uint8Array)){const e=new Uint8Array(r);return R(e.buffer,e.byteOffset,e.byteLength)}return b(r)}function R(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,i.prototype),n}function D(r){if(i.isBuffer(r)){const e=F(r.length)|0,t=B(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||Pe(r.length)?B(0):b(r);if(r.type==="Buffer"&&Array.isArray(r.data))return b(r.data)}function F(r){if(r>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return r|0}function Z(r){return+r!=r&&(r=0),i.alloc(+r)}i.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==i.prototype},i.compare=function(e,t){if($(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,c=t.length;for(let d=0,h=Math.min(n,c);d<h;++d)if(e[d]!==t[d]){n=e[d],c=t[d];break}return n<c?-1:c<n?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return i.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const c=i.allocUnsafe(t);let d=0;for(n=0;n<e.length;++n){let h=e[n];if($(h,Uint8Array))d+h.length>c.length?(i.isBuffer(h)||(h=i.from(h)),h.copy(c,d)):Uint8Array.prototype.set.call(c,h,d);else if(i.isBuffer(h))h.copy(c,d);else throw new TypeError('"list" argument must be an Array of Buffers');d+=h.length}return c};function q(r,e){if(i.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||$(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let c=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return be(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ze(r).length;default:if(c)return n?-1:be(r).length;e=(""+e).toLowerCase(),c=!0}}i.byteLength=q;function U(r,e,t){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return jt(this,e,t);case"utf8":case"utf-8":return qe(this,e,t);case"ascii":return qt(this,e,t);case"latin1":case"binary":return zt(this,e,t);case"base64":return Nt(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wt(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}i.prototype._isBuffer=!0;function W(r,e,t){const n=r[e];r[e]=r[t],r[t]=n}i.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)W(this,t,t+1);return this},i.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)W(this,t,t+3),W(this,t+1,t+2);return this},i.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)W(this,t,t+7),W(this,t+1,t+6),W(this,t+2,t+5),W(this,t+3,t+4);return this},i.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?qe(this,0,e):U.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:i.compare(this,e)===0},i.prototype.inspect=function(){let e="";const t=s.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},l&&(i.prototype[l]=i.prototype.inspect),i.prototype.compare=function(e,t,n,c,d){if($(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),t<0||n>e.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&t>=n)return 0;if(c>=d)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,c>>>=0,d>>>=0,this===e)return 0;let h=d-c,y=n-t;const x=Math.min(h,y),v=this.slice(c,d),E=e.slice(t,n);for(let P=0;P<x;++P)if(v[P]!==E[P]){h=v[P],y=E[P];break}return h<y?-1:y<h?1:0};function Ne(r,e,t,n,c){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Pe(t)&&(t=c?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(c)return-1;t=r.length-1}else if(t<0)if(c)t=0;else return-1;if(typeof e=="string"&&(e=i.from(e,n)),i.isBuffer(e))return e.length===0?-1:De(r,e,t,n,c);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):De(r,[e],t,n,c);throw new TypeError("val must be string, number or Buffer")}function De(r,e,t,n,c){let d=1,h=r.length,y=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;d=2,h/=2,y/=2,t/=2}function x(E,P){return d===1?E[P]:E.readUInt16BE(P*d)}let v;if(c){let E=-1;for(v=t;v<h;v++)if(x(r,v)===x(e,E===-1?0:v-E)){if(E===-1&&(E=v),v-E+1===y)return E*d}else E!==-1&&(v-=v-E),E=-1}else for(t+y>h&&(t=h-y),v=t;v>=0;v--){let E=!0;for(let P=0;P<y;P++)if(x(r,v+P)!==x(e,P)){E=!1;break}if(E)return v}return-1}i.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},i.prototype.indexOf=function(e,t,n){return Ne(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return Ne(this,e,t,n,!1)};function Rt(r,e,t,n){t=Number(t)||0;const c=r.length-t;n?(n=Number(n),n>c&&(n=c)):n=c;const d=e.length;n>d/2&&(n=d/2);let h;for(h=0;h<n;++h){const y=parseInt(e.substr(h*2,2),16);if(Pe(y))return h;r[t+h]=y}return h}function Ot(r,e,t,n){return ce(be(e,r.length-t),r,t,n)}function Ut(r,e,t,n){return ce(Gt(e),r,t,n)}function $t(r,e,t,n){return ce(Ze(e),r,t,n)}function Tt(r,e,t,n){return ce(Qt(e,r.length-t),r,t,n)}i.prototype.write=function(e,t,n,c){if(t===void 0)c="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")c=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,c===void 0&&(c="utf8")):(c=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const d=this.length-t;if((n===void 0||n>d)&&(n=d),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");let h=!1;for(;;)switch(c){case"hex":return Rt(this,e,t,n);case"utf8":case"utf-8":return Ot(this,e,t,n);case"ascii":case"latin1":case"binary":return Ut(this,e,t,n);case"base64":return $t(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Tt(this,e,t,n);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),h=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(r,e,t){return e===0&&t===r.length?o.fromByteArray(r):o.fromByteArray(r.slice(e,t))}function qe(r,e,t){t=Math.min(r.length,t);const n=[];let c=e;for(;c<t;){const d=r[c];let h=null,y=d>239?4:d>223?3:d>191?2:1;if(c+y<=t){let x,v,E,P;switch(y){case 1:d<128&&(h=d);break;case 2:x=r[c+1],(x&192)===128&&(P=(d&31)<<6|x&63,P>127&&(h=P));break;case 3:x=r[c+1],v=r[c+2],(x&192)===128&&(v&192)===128&&(P=(d&15)<<12|(x&63)<<6|v&63,P>2047&&(P<55296||P>57343)&&(h=P));break;case 4:x=r[c+1],v=r[c+2],E=r[c+3],(x&192)===128&&(v&192)===128&&(E&192)===128&&(P=(d&15)<<18|(x&63)<<12|(v&63)<<6|E&63,P>65535&&P<1114112&&(h=P))}}h===null?(h=65533,y=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),c+=y}return Dt(n)}const ze=4096;function Dt(r){const e=r.length;if(e<=ze)return String.fromCharCode.apply(String,r);let t="",n=0;for(;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=ze));return t}function qt(r,e,t){let n="";t=Math.min(r.length,t);for(let c=e;c<t;++c)n+=String.fromCharCode(r[c]&127);return n}function zt(r,e,t){let n="";t=Math.min(r.length,t);for(let c=e;c<t;++c)n+=String.fromCharCode(r[c]);return n}function jt(r,e,t){const n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);let c="";for(let d=e;d<t;++d)c+=Zt[r[d]];return c}function Wt(r,e,t){const n=r.slice(e,t);let c="";for(let d=0;d<n.length-1;d+=2)c+=String.fromCharCode(n[d]+n[d+1]*256);return c}i.prototype.slice=function(e,t){const n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);const c=this.subarray(e,t);return Object.setPrototypeOf(c,i.prototype),c};function _(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}i.prototype.readUintLE=i.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||_(e,t,this.length);let c=this[e],d=1,h=0;for(;++h<t&&(d*=256);)c+=this[e+h]*d;return c},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||_(e,t,this.length);let c=this[e+--t],d=1;for(;t>0&&(d*=256);)c+=this[e+--t]*d;return c},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e=e>>>0,t||_(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||_(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||_(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||_(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=z(function(e){e=e>>>0,Y(e,"offset");const t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);const c=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,d=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(c)+(BigInt(d)<<BigInt(32))}),i.prototype.readBigUInt64BE=z(function(e){e=e>>>0,Y(e,"offset");const t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);const c=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],d=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(c)<<BigInt(32))+BigInt(d)}),i.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||_(e,t,this.length);let c=this[e],d=1,h=0;for(;++h<t&&(d*=256);)c+=this[e+h]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*t)),c},i.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||_(e,t,this.length);let c=t,d=1,h=this[e+--c];for(;c>0&&(d*=256);)h+=this[e+--c]*d;return d*=128,h>=d&&(h-=Math.pow(2,8*t)),h},i.prototype.readInt8=function(e,t){return e=e>>>0,t||_(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,t){e=e>>>0,t||_(e,2,this.length);const n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},i.prototype.readInt16BE=function(e,t){e=e>>>0,t||_(e,2,this.length);const n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},i.prototype.readInt32LE=function(e,t){return e=e>>>0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e=e>>>0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=z(function(e){e=e>>>0,Y(e,"offset");const t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);const c=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(c)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),i.prototype.readBigInt64BE=z(function(e){e=e>>>0,Y(e,"offset");const t=this[e],n=this[e+7];(t===void 0||n===void 0)&&oe(e,this.length-8);const c=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(c)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),i.prototype.readFloatLE=function(e,t){return e=e>>>0,t||_(e,4,this.length),a.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e=e>>>0,t||_(e,4,this.length),a.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||_(e,8,this.length),a.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||_(e,8,this.length),a.read(this,e,!1,52,8)};function S(r,e,t,n,c,d){if(!i.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>c||e<d)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,n,c){if(e=+e,t=t>>>0,n=n>>>0,!c){const y=Math.pow(2,8*n)-1;S(this,e,t,n,y,0)}let d=1,h=0;for(this[t]=e&255;++h<n&&(d*=256);)this[t+h]=e/d&255;return t+n},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,t,n,c){if(e=+e,t=t>>>0,n=n>>>0,!c){const y=Math.pow(2,8*n)-1;S(this,e,t,n,y,0)}let d=n-1,h=1;for(this[t+d]=e&255;--d>=0&&(h*=256);)this[t+d]=e/h&255;return t+n},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,1,255,0),this[t]=e&255,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function je(r,e,t,n,c){Qe(e,n,c,r,t,7);let d=Number(e&BigInt(4294967295));r[t++]=d,d=d>>8,r[t++]=d,d=d>>8,r[t++]=d,d=d>>8,r[t++]=d;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,h=h>>8,r[t++]=h,t}function We(r,e,t,n,c){Qe(e,n,c,r,t,7);let d=Number(e&BigInt(4294967295));r[t+7]=d,d=d>>8,r[t+6]=d,d=d>>8,r[t+5]=d,d=d>>8,r[t+4]=d;let h=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=h,h=h>>8,r[t+2]=h,h=h>>8,r[t+1]=h,h=h>>8,r[t]=h,t+8}i.prototype.writeBigUInt64LE=z(function(e,t=0){return je(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=z(function(e,t=0){return We(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(e,t,n,c){if(e=+e,t=t>>>0,!c){const x=Math.pow(2,8*n-1);S(this,e,t,n,x-1,-x)}let d=0,h=1,y=0;for(this[t]=e&255;++d<n&&(h*=256);)e<0&&y===0&&this[t+d-1]!==0&&(y=1),this[t+d]=(e/h>>0)-y&255;return t+n},i.prototype.writeIntBE=function(e,t,n,c){if(e=+e,t=t>>>0,!c){const x=Math.pow(2,8*n-1);S(this,e,t,n,x-1,-x)}let d=n-1,h=1,y=0;for(this[t+d]=e&255;--d>=0&&(h*=256);)e<0&&y===0&&this[t+d+1]!==0&&(y=1),this[t+d]=(e/h>>0)-y&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||S(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},i.prototype.writeBigInt64LE=z(function(e,t=0){return je(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=z(function(e,t=0){return We(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Xe(r,e,t,n,c,d){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ve(r,e,t,n,c){return e=+e,t=t>>>0,c||Xe(r,e,t,4),a.write(r,e,t,n,23,4),t+4}i.prototype.writeFloatLE=function(e,t,n){return Ve(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return Ve(this,e,t,!1,n)};function He(r,e,t,n,c){return e=+e,t=t>>>0,c||Xe(r,e,t,8),a.write(r,e,t,n,52,8),t+8}i.prototype.writeDoubleLE=function(e,t,n){return He(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return He(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,c){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!c&&c!==0&&(c=this.length),t>=e.length&&(t=e.length),t||(t=0),c>0&&c<n&&(c=n),c===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-t<c-n&&(c=e.length-t+n);const d=c-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,c):Uint8Array.prototype.set.call(e,this.subarray(n,c),t),d},i.prototype.fill=function(e,t,n,c){if(typeof e=="string"){if(typeof t=="string"?(c=t,t=0,n=this.length):typeof n=="string"&&(c=n,n=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!i.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(e.length===1){const h=e.charCodeAt(0);(c==="utf8"&&h<128||c==="latin1")&&(e=h)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let d;if(typeof e=="number")for(d=t;d<n;++d)this[d]=e;else{const h=i.isBuffer(e)?e:i.from(e,c),y=h.length;if(y===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(d=0;d<n-t;++d)this[d+t]=h[d%y]}return this};const K={};function ye(r,e,t){K[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(c){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:c,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}ye("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ye("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),ye("ERR_OUT_OF_RANGE",function(r,e,t){let n=`The value of "${r}" is out of range.`,c=t;return Number.isInteger(t)&&Math.abs(t)>2**32?c=Ge(String(t)):typeof t=="bigint"&&(c=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(c=Ge(c)),c+="n"),n+=` It must be ${e}. Received ${c}`,n},RangeError);function Ge(r){let e="",t=r.length;const n=r[0]==="-"?1:0;for(;t>=n+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function Xt(r,e,t){Y(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&oe(e,r.length-(t+1))}function Qe(r,e,t,n,c,d){if(r>t||r<e){const h=typeof e=="bigint"?"n":"";let y;throw e===0||e===BigInt(0)?y=`>= 0${h} and < 2${h} ** ${(d+1)*8}${h}`:y=`>= -(2${h} ** ${(d+1)*8-1}${h}) and < 2 ** ${(d+1)*8-1}${h}`,new K.ERR_OUT_OF_RANGE("value",y,r)}Xt(n,c,d)}function Y(r,e){if(typeof r!="number")throw new K.ERR_INVALID_ARG_TYPE(e,"number",r)}function oe(r,e,t){throw Math.floor(r)!==r?(Y(r,t),new K.ERR_OUT_OF_RANGE("offset","an integer",r)):e<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,r)}const Vt=/[^+/0-9A-Za-z-_]/g;function Ht(r){if(r=r.split("=")[0],r=r.trim().replace(Vt,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function be(r,e){e=e||1/0;let t;const n=r.length;let c=null;const d=[];for(let h=0;h<n;++h){if(t=r.charCodeAt(h),t>55295&&t<57344){if(!c){if(t>56319){(e-=3)>-1&&d.push(239,191,189);continue}else if(h+1===n){(e-=3)>-1&&d.push(239,191,189);continue}c=t;continue}if(t<56320){(e-=3)>-1&&d.push(239,191,189),c=t;continue}t=(c-55296<<10|t-56320)+65536}else c&&(e-=3)>-1&&d.push(239,191,189);if(c=null,t<128){if((e-=1)<0)break;d.push(t)}else if(t<2048){if((e-=2)<0)break;d.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;d.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return d}function Gt(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Qt(r,e){let t,n,c;const d=[];for(let h=0;h<r.length&&!((e-=2)<0);++h)t=r.charCodeAt(h),n=t>>8,c=t%256,d.push(c),d.push(n);return d}function Ze(r){return o.toByteArray(Ht(r))}function ce(r,e,t,n){let c;for(c=0;c<n&&!(c+t>=e.length||c>=r.length);++c)e[c+t]=r[c];return c}function $(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function Pe(r){return r!==r}const Zt=function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const n=t*16;for(let c=0;c<16;++c)e[n+c]=r[t]+r[c]}return e}();function z(r){return typeof BigInt>"u"?Kt:r}function Kt(){throw new Error("BigInt not supported")}})(me);const At=s=>{const o=me.Buffer.from(s,"base64").toString("utf8"),a=me.Buffer.from(o,"binary").toString("base64");return s===a?o:s},Lt=async s=>{const o=At(s),a=JSON.parse(o);return{message:o,...a}};class g{constructor(o,a,l,u,f){this._legacyCanvasSize=g.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=o,this.$canvas=document.createElement("canvas"),l&&typeof l=="object"?this._onDecode=a:(console.warn(l||u||f?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=a),a=typeof l=="object"?l:{},this._onDecodeError=a.onDecodeError||(typeof l=="function"?l:this._onDecodeError),this._calculateScanRegion=a.calculateScanRegion||(typeof u=="function"?u:this._calculateScanRegion),this._preferredCamera=a.preferredCamera||f||this._preferredCamera,this._legacyCanvasSize=typeof l=="number"?l:typeof u=="number"?u:this._legacyCanvasSize,this._maxScansPerSecond=a.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),o.disablePictureInPicture=!0,o.playsInline=!0,o.muted=!0;let B=!1;if(o.hidden&&(o.hidden=!1,B=!0),document.body.contains(o)||(document.body.appendChild(o),B=!0),l=o.parentElement,a.highlightScanRegion||a.highlightCodeOutline){if(u=!!a.overlay,this.$overlay=a.overlay||document.createElement("div"),f=this.$overlay.style,f.position="absolute",f.display="none",f.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!u&&a.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}l.insertBefore(this.$overlay,this.$video.nextSibling)}a.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(o),requestAnimationFrame(()=>{let i=window.getComputedStyle(o);i.display==="none"&&(o.style.setProperty("display","block","important"),B=!0),i.visibility!=="visible"&&(o.style.setProperty("visibility","visible","important"),B=!0),B&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),o.style.opacity="0",o.style.width="0",o.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),o.addEventListener("play",this._onPlay),o.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=g.createQrEngine()}static set WORKER_PATH(o){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await g.listCameras(!1)).length}catch{return!1}}static async listCameras(o=!1){if(!navigator.mediaDevices)return[];let a=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(u=>u.kind==="videoinput"),l;try{o&&(await a()).every(u=>!u.label)&&(l=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await a()).map((u,f)=>({id:u.deviceId,label:u.label||(f===0?"Default Camera":`Camera ${f+1}`)}))}finally{l&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),g._stopVideoStream(l))}}async hasFlash(){let o;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;o=this.$video.srcObject}else o=(await this._getCameraStream()).stream;return"torch"in o.getVideoTracks()[0].getSettings()}catch{return!1}finally{o&&o!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),g._stopVideoStream(o))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(o){throw this._flashOn=!1,o}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),g._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:o,facingMode:a}=await this._getCameraStream();!this._active||this._paused?g._stopVideoStream(o):(this._setVideoMirror(a),this.$video.srcObject=o,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(o){if(!this._paused)throw this._active=!1,o}}stop(){this.pause(),this._active=!1}async pause(o=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let a=()=>{this.$video.srcObject instanceof MediaStream&&(g._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return o?(a(),!0):(await new Promise(l=>setTimeout(l,300)),this._paused?(a(),!0):!1)}async setCamera(o){o!==this._preferredCamera&&(this._preferredCamera=o,await this._restartVideoStream())}static async scanImage(o,a,l,u,f=!1,B=!1){let i,k=!1;a&&("scanRegion"in a||"qrEngine"in a||"canvas"in a||"disallowCanvasResizing"in a||"alsoTryWithoutScanRegion"in a||"returnDetailedScanResult"in a)?(i=a.scanRegion,l=a.qrEngine,u=a.canvas,f=a.disallowCanvasResizing||!1,B=a.alsoTryWithoutScanRegion||!1,k=!0):console.warn(a||l||u||f||B?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),a=!!l;try{let m,w;[l,m]=await Promise.all([l||g.createQrEngine(),g._loadImage(o)]),[u,w]=g._drawToCanvas(m,i,u,f);let C;if(l instanceof Worker){let p=l;a||g._postWorkerMessageSync(p,"inversionMode","both"),C=await new Promise((b,M)=>{let R,D,F,Z=-1;D=U=>{U.data.id===Z&&(p.removeEventListener("message",D),p.removeEventListener("error",F),clearTimeout(R),U.data.data!==null?b({data:U.data.data,cornerPoints:g._convertPoints(U.data.cornerPoints,i)}):M(g.NO_QR_CODE_FOUND))},F=U=>{p.removeEventListener("message",D),p.removeEventListener("error",F),clearTimeout(R),M("Scanner error: "+(U?U.message||U:"Unknown Error"))},p.addEventListener("message",D),p.addEventListener("error",F),R=setTimeout(()=>F("timeout"),1e4);let q=w.getImageData(0,0,u.width,u.height);Z=g._postWorkerMessageSync(p,"decode",q,[q.data.buffer])})}else C=await Promise.race([new Promise((p,b)=>window.setTimeout(()=>b("Scanner error: timeout"),1e4)),(async()=>{try{var[p]=await l.detect(u);if(!p)throw g.NO_QR_CODE_FOUND;return{data:p.rawValue,cornerPoints:g._convertPoints(p.cornerPoints,i)}}catch(b){if(p=b.message||b,/not implemented|service unavailable/.test(p))return g._disableBarcodeDetector=!0,g.scanImage(o,{scanRegion:i,canvas:u,disallowCanvasResizing:f,alsoTryWithoutScanRegion:B});throw`Scanner error: ${p}`}})()]);return k?C:C.data}catch(m){if(!i||!B)throw m;let w=await g.scanImage(o,{qrEngine:l,canvas:u,disallowCanvasResizing:f});return k?w:w.data}finally{a||g._postWorkerMessage(l,"close")}}setGrayscaleWeights(o,a,l,u=!0){g._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:o,green:a,blue:l,useIntegerApproximation:u})}setInversionMode(o){g._postWorkerMessage(this._qrEnginePromise,"inversionMode",o)}static async createQrEngine(o){if(o&&console.warn("Specifying a worker path is not required and not supported anymore."),o=()=>Promise.resolve().then(()=>Ft).then(l=>l.createWorker()),!(!g._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return o();let a=navigator.userAgentData;return a&&a.brands.some(({brand:l})=>/Chromium/i.test(l))&&/mac ?OS/i.test(a.platform)&&await a.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:l,platformVersion:u})=>/arm/i.test(l||"arm")&&13<=parseInt(u||"13")).catch(()=>!0)?o():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(o){let a=Math.round(.6666666666666666*Math.min(o.videoWidth,o.videoHeight));return{x:Math.round((o.videoWidth-a)/2),y:Math.round((o.videoHeight-a)/2),width:a,height:a,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var o=this.$video,a=o.videoWidth,l=o.videoHeight,u=o.offsetWidth,f=o.offsetHeight,B=o.offsetLeft,i=o.offsetTop,k=window.getComputedStyle(o),m=k.objectFit,w=a/l,C=u/f;switch(m){case"none":var p=a,b=l;break;case"fill":p=u,b=f;break;default:(m==="cover"?w>C:w<C)?(b=f,p=b*w):(p=u,b=p/w),m==="scale-down"&&(p=Math.min(p,a),b=Math.min(b,l))}var[M,R]=k.objectPosition.split(" ").map((F,Z)=>{const q=parseFloat(F);return F.endsWith("%")?(Z?f-b:u-p)*q/100:q});k=this._scanRegion.width||a,C=this._scanRegion.height||l,m=this._scanRegion.x||0;var D=this._scanRegion.y||0;w=this.$overlay.style,w.width=`${k/a*p}px`,w.height=`${C/l*b}px`,w.top=`${i+R+D/l*b}px`,l=/scaleX\(-1\)/.test(o.style.transform),w.left=`${B+(l?u-M-p:M)+(l?a-m-k:m)/a*p}px`,w.transform=o.style.transform}})}static _convertPoints(o,a){if(!a)return o;let l=a.x||0,u=a.y||0,f=a.width&&a.downScaledWidth?a.width/a.downScaledWidth:1;a=a.height&&a.downScaledHeight?a.height/a.downScaledHeight:1;for(let B of o)B.x=B.x*f+l,B.y=B.y*a+u;return o}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var o=Date.now()-this._lastScanTimestamp,a=1e3/this._maxScansPerSecond;o<a&&await new Promise(u=>setTimeout(u,a-o)),this._lastScanTimestamp=Date.now();try{var l=await g.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(u){if(!this._active)return;this._onDecodeError(u)}!g._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=g.createQrEngine()),l?(this._onDecode?this._onDecode(l):this._legacyOnDecode&&this._legacyOnDecode(l.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",l.cornerPoints.map(({x:u,y:f})=>`${u},${f}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(o){o!==g.NO_QR_CODE_FOUND&&console.log(o)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let o=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",a=[{width:{min:1024}},{width:{min:768}},{}],l=a.map(u=>Object.assign({},u,{[o]:{exact:this._preferredCamera}}));for(let u of[...l,...a])try{let f=await navigator.mediaDevices.getUserMedia({video:u,audio:!1}),B=this._getFacingMode(f)||(u.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:f,facingMode:B}}catch{}throw"Camera not found."}async _restartVideoStream(){let o=this._paused;await this.pause(!0)&&!o&&this._active&&await this.start()}static _stopVideoStream(o){for(let a of o.getTracks())a.stop(),o.removeTrack(a)}_setVideoMirror(o){this.$video.style.transform="scaleX("+(o==="user"?-1:1)+")"}_getFacingMode(o){return(o=o.getVideoTracks()[0])?/rear|back|environment/i.test(o.label)?"environment":/front|user|face/i.test(o.label)?"user":null:null}static _drawToCanvas(o,a,l,u=!1){l=l||document.createElement("canvas");let f=a&&a.x?a.x:0,B=a&&a.y?a.y:0,i=a&&a.width?a.width:o.videoWidth||o.width,k=a&&a.height?a.height:o.videoHeight||o.height;return u||(u=a&&a.downScaledWidth?a.downScaledWidth:i,a=a&&a.downScaledHeight?a.downScaledHeight:k,l.width!==u&&(l.width=u),l.height!==a&&(l.height=a)),a=l.getContext("2d",{alpha:!1}),a.imageSmoothingEnabled=!1,a.drawImage(o,f,B,i,k,0,0,l.width,l.height),[l,a]}static async _loadImage(o){if(o instanceof Image)return await g._awaitImageLoad(o),o;if(o instanceof HTMLVideoElement||o instanceof HTMLCanvasElement||o instanceof SVGImageElement||"OffscreenCanvas"in window&&o instanceof OffscreenCanvas||"ImageBitmap"in window&&o instanceof ImageBitmap)return o;if(o instanceof File||o instanceof Blob||o instanceof URL||typeof o=="string"){let a=new Image;a.src=o instanceof File||o instanceof Blob?URL.createObjectURL(o):o.toString();try{return await g._awaitImageLoad(a),a}finally{(o instanceof File||o instanceof Blob)&&URL.revokeObjectURL(a.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(o){o.complete&&o.naturalWidth!==0||await new Promise((a,l)=>{let u=f=>{o.removeEventListener("load",u),o.removeEventListener("error",u),f instanceof ErrorEvent?l("Image load error"):a()};o.addEventListener("load",u),o.addEventListener("error",u)})}static async _postWorkerMessage(o,a,l,u){return g._postWorkerMessageSync(await o,a,l,u)}static _postWorkerMessageSync(o,a,l,u){if(!(o instanceof Worker))return-1;let f=g._workerMessageId++;return o.postMessage({id:f,type:a,data:l},u),f}}g.DEFAULT_CANVAS_SIZE=400,g.NO_QR_CODE_FOUND="No QR code found",g._disableBarcodeDetector=!1,g._workerMessageId=0;const Ce=class Ce{constructor(o,a,l){this.events={};const u=document.querySelector(o.target);if(!u)throw new Error(`Target element '${o.target}' is not found`);this.targetElement=u,this.decode=a,this.scannerElements=l}async _initializeScanner(o,a=25){var l,u,f,B;try{if(!o){const i=await this.listVideoInputDevices();o=this._getMainCameraDeviceId(i)}this.qrScanner=new g(document.getElementById(`${this.scannerElements.VIDEO}`),async i=>{var k,m,w,C;if(this.previousScanText!==i.data)try{this.previousScanText=i.data,(m=(k=this.events)==null?void 0:k[G.CAPTURE])==null||m.call(k,await this.decode(i.data))}catch(p){(C=(w=this.events)==null?void 0:w[G.ERROR])==null||C.call(w,p)}},{returnDetailedScanResult:!0,maxScansPerSecond:a,preferredCamera:o,highlightScanRegion:!0,highlightCodeOutline:!0,onDecodeError:()=>{}}),await this.qrScanner.start()}catch(i){(u=(l=this.events)==null?void 0:l[G.ERROR])==null||u.call(l,i),(f=this.qrScanner)==null||f.stop(),(B=this.rootElement)==null||B.remove()}}async listVideoInputDevices(){return g.listCameras(!0)}_getMainCameraDeviceId(o){var u,f;if(!(o!=null&&o.length))throw new Error("No video input devices available");const a=["back","задня"],l=o.find(B=>{const i=B.label.toLowerCase();return i.includes(a[0])||i.includes(a[1])});return(l==null?void 0:l.id)||((u=o[1])==null?void 0:u.id)||((f=o[0])==null?void 0:f.id)}close(){var o,a,l,u;this.previousScanText=null,(a=(o=this.events)==null?void 0:o[G.CANCEL])==null||a.call(o),(l=this.qrScanner)==null||l.stop(),(u=this.rootElement)==null||u.remove()}on(o,a){this.events[o]=a}off(o){this.events[o]=void 0}};Ce.events=G;let ge=Ce;class Te extends ge{constructor(o){super(o,Lt,ie)}async scan({deviceId:o,maxScansPerSecond:a,isCloseButton:l}={}){var u,f;l===void 0&&(l=!0),(u=this.qrScanner)==null||u.stop(),(f=this.rootElement)==null||f.remove(),new bt({target:this.targetElement,props:{close:this.close.bind(this),isCloseButton:l,scannerElements:ie}}),this.rootElement=document.getElementById(ie.ROOT),await this._initializeScanner(o,a)}}typeof window<"u"&&(window.CredenzaScanner=Te);const Ft=Object.freeze(Object.defineProperty({__proto__:null,createWorker:()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
|
|
7
|
+
*/var vr;function un(){return vr||(vr=1,(function(o){const t=ln(),n=dn(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=l,o.SlowBuffer=b,o.INSPECT_MAX_BYTES=50;const c=2147483647;o.kMaxLength=c,l.TYPED_ARRAY_SUPPORT=u(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{const i=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(i,e),i.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function f(i){if(i>c)throw new RangeError('The value "'+i+'" is invalid for option "size"');const e=new Uint8Array(i);return Object.setPrototypeOf(e,l.prototype),e}function l(i,e,r){if(typeof i=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(i)}return B(i,e,r)}l.poolSize=8192;function B(i,e,r){if(typeof i=="string")return v(i,e);if(ArrayBuffer.isView(i))return g(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(te(i,ArrayBuffer)||i&&te(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(te(i,SharedArrayBuffer)||i&&te(i.buffer,SharedArrayBuffer)))return C(i,e,r);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const s=i.valueOf&&i.valueOf();if(s!=null&&s!==i)return l.from(s,e,r);const d=_(i);if(d)return d;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return l.from(i[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}l.from=function(i,e,r){return B(i,e,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function m(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function w(i,e,r){return m(i),i<=0?f(i):e!==void 0?typeof r=="string"?f(i).fill(e,r):f(i).fill(e):f(i)}l.alloc=function(i,e,r){return w(i,e,r)};function y(i){return m(i),f(i<0?0:M(i)|0)}l.allocUnsafe=function(i){return y(i)},l.allocUnsafeSlow=function(i){return y(i)};function v(i,e){if((typeof e!="string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=A(i,e)|0;let s=f(r);const d=s.write(i,e);return d!==r&&(s=s.slice(0,d)),s}function p(i){const e=i.length<0?0:M(i.length)|0,r=f(e);for(let s=0;s<e;s+=1)r[s]=i[s]&255;return r}function g(i){if(te(i,Uint8Array)){const e=new Uint8Array(i);return C(e.buffer,e.byteOffset,e.byteLength)}return p(i)}function C(i,e,r){if(e<0||i.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let s;return e===void 0&&r===void 0?s=new Uint8Array(i):r===void 0?s=new Uint8Array(i,e):s=new Uint8Array(i,e,r),Object.setPrototypeOf(s,l.prototype),s}function _(i){if(l.isBuffer(i)){const e=M(i.length)|0,r=f(e);return r.length===0||i.copy(r,0,0,e),r}if(i.length!==void 0)return typeof i.length!="number"||It(i.length)?f(0):p(i);if(i.type==="Buffer"&&Array.isArray(i.data))return p(i.data)}function M(i){if(i>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return i|0}function b(i){return+i!=i&&(i=0),l.alloc(+i)}l.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==l.prototype},l.compare=function(e,r){if(te(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),te(r,Uint8Array)&&(r=l.from(r,r.offset,r.byteLength)),!l.isBuffer(e)||!l.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let s=e.length,d=r.length;for(let h=0,k=Math.min(s,d);h<k;++h)if(e[h]!==r[h]){s=e[h],d=r[h];break}return s<d?-1:d<s?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return l.alloc(0);let s;if(r===void 0)for(r=0,s=0;s<e.length;++s)r+=e[s].length;const d=l.allocUnsafe(r);let h=0;for(s=0;s<e.length;++s){let k=e[s];if(te(k,Uint8Array))h+k.length>d.length?(l.isBuffer(k)||(k=l.from(k)),k.copy(d,h)):Uint8Array.prototype.set.call(d,k,h);else if(l.isBuffer(k))k.copy(d,h);else throw new TypeError('"list" argument must be an Array of Buffers');h+=k.length}return d};function A(i,e){if(l.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||te(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const r=i.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&r===0)return 0;let d=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Et(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Lr(i).length;default:if(d)return s?-1:Et(i).length;e=(""+e).toLowerCase(),d=!0}}l.byteLength=A;function O(i,e,r){let s=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(i||(i="utf8");;)switch(i){case"hex":return Pn(this,e,r);case"utf8":case"utf-8":return _r(this,e,r);case"ascii":return Cn(this,e,r);case"latin1":case"binary":return bn(this,e,r);case"base64":return vn(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _n(this,e,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),s=!0}}l.prototype._isBuffer=!0;function T(i,e,r){const s=i[e];i[e]=i[r],i[r]=s}l.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)T(this,r,r+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)T(this,r,r+3),T(this,r+1,r+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)T(this,r,r+7),T(this,r+1,r+6),T(this,r+2,r+5),T(this,r+3,r+4);return this},l.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?_r(this,0,e):O.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:l.compare(this,e)===0},l.prototype.inspect=function(){let e="";const r=o.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,r,s,d,h){if(te(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),s===void 0&&(s=e?e.length:0),d===void 0&&(d=0),h===void 0&&(h=this.length),r<0||s>e.length||d<0||h>this.length)throw new RangeError("out of range index");if(d>=h&&r>=s)return 0;if(d>=h)return-1;if(r>=s)return 1;if(r>>>=0,s>>>=0,d>>>=0,h>>>=0,this===e)return 0;let k=h-d,x=s-r;const F=Math.min(k,x),R=this.slice(d,h),L=e.slice(r,s);for(let S=0;S<F;++S)if(R[S]!==L[S]){k=R[S],x=L[S];break}return k<x?-1:x<k?1:0};function br(i,e,r,s,d){if(i.length===0)return-1;if(typeof r=="string"?(s=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,It(r)&&(r=d?0:i.length-1),r<0&&(r=i.length+r),r>=i.length){if(d)return-1;r=i.length-1}else if(r<0)if(d)r=0;else return-1;if(typeof e=="string"&&(e=l.from(e,s)),l.isBuffer(e))return e.length===0?-1:Pr(i,e,r,s,d);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?d?Uint8Array.prototype.indexOf.call(i,e,r):Uint8Array.prototype.lastIndexOf.call(i,e,r):Pr(i,[e],r,s,d);throw new TypeError("val must be string, number or Buffer")}function Pr(i,e,r,s,d){let h=1,k=i.length,x=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(i.length<2||e.length<2)return-1;h=2,k/=2,x/=2,r/=2}function F(L,S){return h===1?L[S]:L.readUInt16BE(S*h)}let R;if(d){let L=-1;for(R=r;R<k;R++)if(F(i,R)===F(e,L===-1?0:R-L)){if(L===-1&&(L=R),R-L+1===x)return L*h}else L!==-1&&(R-=R-L),L=-1}else for(r+x>k&&(r=k-x),R=r;R>=0;R--){let L=!0;for(let S=0;S<x;S++)if(F(i,R+S)!==F(e,S)){L=!1;break}if(L)return R}return-1}l.prototype.includes=function(e,r,s){return this.indexOf(e,r,s)!==-1},l.prototype.indexOf=function(e,r,s){return br(this,e,r,s,!0)},l.prototype.lastIndexOf=function(e,r,s){return br(this,e,r,s,!1)};function mn(i,e,r,s){r=Number(r)||0;const d=i.length-r;s?(s=Number(s),s>d&&(s=d)):s=d;const h=e.length;s>h/2&&(s=h/2);let k;for(k=0;k<s;++k){const x=parseInt(e.substr(k*2,2),16);if(It(x))return k;i[r+k]=x}return k}function kn(i,e,r,s){return tt(Et(e,i.length-r),i,r,s)}function pn(i,e,r,s){return tt(Mn(e),i,r,s)}function wn(i,e,r,s){return tt(Lr(e),i,r,s)}function gn(i,e,r,s){return tt(Sn(e,i.length-r),i,r,s)}l.prototype.write=function(e,r,s,d){if(r===void 0)d="utf8",s=this.length,r=0;else if(s===void 0&&typeof r=="string")d=r,s=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(s)?(s=s>>>0,d===void 0&&(d="utf8")):(d=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const h=this.length-r;if((s===void 0||s>h)&&(s=h),e.length>0&&(s<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");let k=!1;for(;;)switch(d){case"hex":return mn(this,e,r,s);case"utf8":case"utf-8":return kn(this,e,r,s);case"ascii":case"latin1":case"binary":return pn(this,e,r,s);case"base64":return wn(this,e,r,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gn(this,e,r,s);default:if(k)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),k=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function vn(i,e,r){return e===0&&r===i.length?t.fromByteArray(i):t.fromByteArray(i.slice(e,r))}function _r(i,e,r){r=Math.min(i.length,r);const s=[];let d=e;for(;d<r;){const h=i[d];let k=null,x=h>239?4:h>223?3:h>191?2:1;if(d+x<=r){let F,R,L,S;switch(x){case 1:h<128&&(k=h);break;case 2:F=i[d+1],(F&192)===128&&(S=(h&31)<<6|F&63,S>127&&(k=S));break;case 3:F=i[d+1],R=i[d+2],(F&192)===128&&(R&192)===128&&(S=(h&15)<<12|(F&63)<<6|R&63,S>2047&&(S<55296||S>57343)&&(k=S));break;case 4:F=i[d+1],R=i[d+2],L=i[d+3],(F&192)===128&&(R&192)===128&&(L&192)===128&&(S=(h&15)<<18|(F&63)<<12|(R&63)<<6|L&63,S>65535&&S<1114112&&(k=S))}}k===null?(k=65533,x=1):k>65535&&(k-=65536,s.push(k>>>10&1023|55296),k=56320|k&1023),s.push(k),d+=x}return yn(s)}const xr=4096;function yn(i){const e=i.length;if(e<=xr)return String.fromCharCode.apply(String,i);let r="",s=0;for(;s<e;)r+=String.fromCharCode.apply(String,i.slice(s,s+=xr));return r}function Cn(i,e,r){let s="";r=Math.min(i.length,r);for(let d=e;d<r;++d)s+=String.fromCharCode(i[d]&127);return s}function bn(i,e,r){let s="";r=Math.min(i.length,r);for(let d=e;d<r;++d)s+=String.fromCharCode(i[d]);return s}function Pn(i,e,r){const s=i.length;(!e||e<0)&&(e=0),(!r||r<0||r>s)&&(r=s);let d="";for(let h=e;h<r;++h)d+=An[i[h]];return d}function _n(i,e,r){const s=i.slice(e,r);let d="";for(let h=0;h<s.length-1;h+=2)d+=String.fromCharCode(s[h]+s[h+1]*256);return d}l.prototype.slice=function(e,r){const s=this.length;e=~~e,r=r===void 0?s:~~r,e<0?(e+=s,e<0&&(e=0)):e>s&&(e=s),r<0?(r+=s,r<0&&(r=0)):r>s&&(r=s),r<e&&(r=e);const d=this.subarray(e,r);return Object.setPrototypeOf(d,l.prototype),d};function N(i,e,r){if(i%1!==0||i<0)throw new RangeError("offset is not uint");if(i+e>r)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(e,r,s){e=e>>>0,r=r>>>0,s||N(e,r,this.length);let d=this[e],h=1,k=0;for(;++k<r&&(h*=256);)d+=this[e+k]*h;return d},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,r,s){e=e>>>0,r=r>>>0,s||N(e,r,this.length);let d=this[e+--r],h=1;for(;r>0&&(h*=256);)d+=this[e+--r]*h;return d},l.prototype.readUint8=l.prototype.readUInt8=function(e,r){return e=e>>>0,r||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=ke(function(e){e=e>>>0,Se(e,"offset");const r=this[e],s=this[e+7];(r===void 0||s===void 0)&&qe(e,this.length-8);const d=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,h=this[++e]+this[++e]*2**8+this[++e]*2**16+s*2**24;return BigInt(d)+(BigInt(h)<<BigInt(32))}),l.prototype.readBigUInt64BE=ke(function(e){e=e>>>0,Se(e,"offset");const r=this[e],s=this[e+7];(r===void 0||s===void 0)&&qe(e,this.length-8);const d=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],h=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s;return(BigInt(d)<<BigInt(32))+BigInt(h)}),l.prototype.readIntLE=function(e,r,s){e=e>>>0,r=r>>>0,s||N(e,r,this.length);let d=this[e],h=1,k=0;for(;++k<r&&(h*=256);)d+=this[e+k]*h;return h*=128,d>=h&&(d-=Math.pow(2,8*r)),d},l.prototype.readIntBE=function(e,r,s){e=e>>>0,r=r>>>0,s||N(e,r,this.length);let d=r,h=1,k=this[e+--d];for(;d>0&&(h*=256);)k+=this[e+--d]*h;return h*=128,k>=h&&(k-=Math.pow(2,8*r)),k},l.prototype.readInt8=function(e,r){return e=e>>>0,r||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},l.prototype.readInt16LE=function(e,r){e=e>>>0,r||N(e,2,this.length);const s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},l.prototype.readInt16BE=function(e,r){e=e>>>0,r||N(e,2,this.length);const s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},l.prototype.readInt32LE=function(e,r){return e=e>>>0,r||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,r){return e=e>>>0,r||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=ke(function(e){e=e>>>0,Se(e,"offset");const r=this[e],s=this[e+7];(r===void 0||s===void 0)&&qe(e,this.length-8);const d=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(s<<24);return(BigInt(d)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),l.prototype.readBigInt64BE=ke(function(e){e=e>>>0,Se(e,"offset");const r=this[e],s=this[e+7];(r===void 0||s===void 0)&&qe(e,this.length-8);const d=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(d)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s)}),l.prototype.readFloatLE=function(e,r){return e=e>>>0,r||N(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,r){return e=e>>>0,r||N(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||N(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||N(e,8,this.length),n.read(this,e,!1,52,8)};function V(i,e,r,s,d,h){if(!l.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>d||e<h)throw new RangeError('"value" argument is out of bounds');if(r+s>i.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,r,s,d){if(e=+e,r=r>>>0,s=s>>>0,!d){const x=Math.pow(2,8*s)-1;V(this,e,r,s,x,0)}let h=1,k=0;for(this[r]=e&255;++k<s&&(h*=256);)this[r+k]=e/h&255;return r+s},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,r,s,d){if(e=+e,r=r>>>0,s=s>>>0,!d){const x=Math.pow(2,8*s)-1;V(this,e,r,s,x,0)}let h=s-1,k=1;for(this[r+h]=e&255;--h>=0&&(k*=256);)this[r+h]=e/k&255;return r+s},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,1,255,0),this[r]=e&255,r+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Er(i,e,r,s,d){Fr(e,s,d,i,r,7);let h=Number(e&BigInt(4294967295));i[r++]=h,h=h>>8,i[r++]=h,h=h>>8,i[r++]=h,h=h>>8,i[r++]=h;let k=Number(e>>BigInt(32)&BigInt(4294967295));return i[r++]=k,k=k>>8,i[r++]=k,k=k>>8,i[r++]=k,k=k>>8,i[r++]=k,r}function Ir(i,e,r,s,d){Fr(e,s,d,i,r,7);let h=Number(e&BigInt(4294967295));i[r+7]=h,h=h>>8,i[r+6]=h,h=h>>8,i[r+5]=h,h=h>>8,i[r+4]=h;let k=Number(e>>BigInt(32)&BigInt(4294967295));return i[r+3]=k,k=k>>8,i[r+2]=k,k=k>>8,i[r+1]=k,k=k>>8,i[r]=k,r+8}l.prototype.writeBigUInt64LE=ke(function(e,r=0){return Er(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=ke(function(e,r=0){return Ir(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,r,s,d){if(e=+e,r=r>>>0,!d){const F=Math.pow(2,8*s-1);V(this,e,r,s,F-1,-F)}let h=0,k=1,x=0;for(this[r]=e&255;++h<s&&(k*=256);)e<0&&x===0&&this[r+h-1]!==0&&(x=1),this[r+h]=(e/k>>0)-x&255;return r+s},l.prototype.writeIntBE=function(e,r,s,d){if(e=+e,r=r>>>0,!d){const F=Math.pow(2,8*s-1);V(this,e,r,s,F-1,-F)}let h=s-1,k=1,x=0;for(this[r+h]=e&255;--h>=0&&(k*=256);)e<0&&x===0&&this[r+h+1]!==0&&(x=1),this[r+h]=(e/k>>0)-x&255;return r+s},l.prototype.writeInt8=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},l.prototype.writeInt16LE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},l.prototype.writeInt16BE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},l.prototype.writeInt32LE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},l.prototype.writeInt32BE=function(e,r,s){return e=+e,r=r>>>0,s||V(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},l.prototype.writeBigInt64LE=ke(function(e,r=0){return Er(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=ke(function(e,r=0){return Ir(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Mr(i,e,r,s,d,h){if(r+s>i.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Sr(i,e,r,s,d){return e=+e,r=r>>>0,d||Mr(i,e,r,4),n.write(i,e,r,s,23,4),r+4}l.prototype.writeFloatLE=function(e,r,s){return Sr(this,e,r,!0,s)},l.prototype.writeFloatBE=function(e,r,s){return Sr(this,e,r,!1,s)};function Ar(i,e,r,s,d){return e=+e,r=r>>>0,d||Mr(i,e,r,8),n.write(i,e,r,s,52,8),r+8}l.prototype.writeDoubleLE=function(e,r,s){return Ar(this,e,r,!0,s)},l.prototype.writeDoubleBE=function(e,r,s){return Ar(this,e,r,!1,s)},l.prototype.copy=function(e,r,s,d){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(s||(s=0),!d&&d!==0&&(d=this.length),r>=e.length&&(r=e.length),r||(r=0),d>0&&d<s&&(d=s),d===s||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),e.length-r<d-s&&(d=e.length-r+s);const h=d-s;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,s,d):Uint8Array.prototype.set.call(e,this.subarray(s,d),r),h},l.prototype.fill=function(e,r,s,d){if(typeof e=="string"){if(typeof r=="string"?(d=r,r=0,s=this.length):typeof s=="string"&&(d=s,s=this.length),d!==void 0&&typeof d!="string")throw new TypeError("encoding must be a string");if(typeof d=="string"&&!l.isEncoding(d))throw new TypeError("Unknown encoding: "+d);if(e.length===1){const k=e.charCodeAt(0);(d==="utf8"&&k<128||d==="latin1")&&(e=k)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<s)throw new RangeError("Out of range index");if(s<=r)return this;r=r>>>0,s=s===void 0?this.length:s>>>0,e||(e=0);let h;if(typeof e=="number")for(h=r;h<s;++h)this[h]=e;else{const k=l.isBuffer(e)?e:l.from(e,d),x=k.length;if(x===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(h=0;h<s-r;++h)this[h+r]=k[h%x]}return this};const Me={};function xt(i,e,r){Me[i]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(d){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:d,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}xt("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),xt("ERR_INVALID_ARG_TYPE",function(i,e){return`The "${i}" argument must be of type number. Received type ${typeof e}`},TypeError),xt("ERR_OUT_OF_RANGE",function(i,e,r){let s=`The value of "${i}" is out of range.`,d=r;return Number.isInteger(r)&&Math.abs(r)>2**32?d=Rr(String(r)):typeof r=="bigint"&&(d=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(d=Rr(d)),d+="n"),s+=` It must be ${e}. Received ${d}`,s},RangeError);function Rr(i){let e="",r=i.length;const s=i[0]==="-"?1:0;for(;r>=s+4;r-=3)e=`_${i.slice(r-3,r)}${e}`;return`${i.slice(0,r)}${e}`}function xn(i,e,r){Se(e,"offset"),(i[e]===void 0||i[e+r]===void 0)&&qe(e,i.length-(r+1))}function Fr(i,e,r,s,d,h){if(i>r||i<e){const k=typeof e=="bigint"?"n":"";let x;throw e===0||e===BigInt(0)?x=`>= 0${k} and < 2${k} ** ${(h+1)*8}${k}`:x=`>= -(2${k} ** ${(h+1)*8-1}${k}) and < 2 ** ${(h+1)*8-1}${k}`,new Me.ERR_OUT_OF_RANGE("value",x,i)}xn(s,d,h)}function Se(i,e){if(typeof i!="number")throw new Me.ERR_INVALID_ARG_TYPE(e,"number",i)}function qe(i,e,r){throw Math.floor(i)!==i?(Se(i,r),new Me.ERR_OUT_OF_RANGE("offset","an integer",i)):e<0?new Me.ERR_BUFFER_OUT_OF_BOUNDS:new Me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,i)}const En=/[^+/0-9A-Za-z-_]/g;function In(i){if(i=i.split("=")[0],i=i.trim().replace(En,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function Et(i,e){e=e||1/0;let r;const s=i.length;let d=null;const h=[];for(let k=0;k<s;++k){if(r=i.charCodeAt(k),r>55295&&r<57344){if(!d){if(r>56319){(e-=3)>-1&&h.push(239,191,189);continue}else if(k+1===s){(e-=3)>-1&&h.push(239,191,189);continue}d=r;continue}if(r<56320){(e-=3)>-1&&h.push(239,191,189),d=r;continue}r=(d-55296<<10|r-56320)+65536}else d&&(e-=3)>-1&&h.push(239,191,189);if(d=null,r<128){if((e-=1)<0)break;h.push(r)}else if(r<2048){if((e-=2)<0)break;h.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;h.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;h.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return h}function Mn(i){const e=[];for(let r=0;r<i.length;++r)e.push(i.charCodeAt(r)&255);return e}function Sn(i,e){let r,s,d;const h=[];for(let k=0;k<i.length&&!((e-=2)<0);++k)r=i.charCodeAt(k),s=r>>8,d=r%256,h.push(d),h.push(s);return h}function Lr(i){return t.toByteArray(In(i))}function tt(i,e,r,s){let d;for(d=0;d<s&&!(d+r>=e.length||d>=i.length);++d)e[d+r]=i[d];return d}function te(i,e){return i instanceof e||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===e.name}function It(i){return i!==i}const An=(function(){const i="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const s=r*16;for(let d=0;d<16;++d)e[s+d]=i[r]+i[d]}return e})();function ke(i){return typeof BigInt>"u"?Rn:i}function Rn(){throw new Error("BigInt not supported")}})(bt)),bt}var yr=un();const fn=o=>{const t=yr.Buffer.from(o,"base64").toString("utf8"),n=yr.Buffer.from(t,"binary").toString("base64");return o===n?t:o},hn=async o=>{const t=fn(o),n=JSON.parse(t);return{message:t,...n}};class P{constructor(t,n,a,c,u){this._legacyCanvasSize=P.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),a&&typeof a=="object"?this._onDecode=n:(console.warn(a||c||u?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof a=="object"?a:{},this._onDecodeError=n.onDecodeError||(typeof a=="function"?a:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof c=="function"?c:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||u||this._preferredCamera,this._legacyCanvasSize=typeof a=="number"?a:typeof c=="number"?c:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let f=!1;if(t.hidden&&(t.hidden=!1,f=!0),document.body.contains(t)||(document.body.appendChild(t),f=!0),a=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(c=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),u=this.$overlay.style,u.position="absolute",u.display="none",u.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!c&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}a.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame(()=>{let l=window.getComputedStyle(t);l.display==="none"&&(t.style.setProperty("display","block","important"),f=!0),l.visibility!=="visible"&&(t.style.setProperty("visibility","visible","important"),f=!0),f&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=P.createQrEngine()}static set WORKER_PATH(t){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await P.listCameras(!1)).length}catch{return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(c=>c.kind==="videoinput"),a;try{t&&(await n()).every(c=>!c.label)&&(a=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((c,u)=>({id:c.deviceId,label:c.label||(u===0?"Default Camera":`Camera ${u+1}`)}))}finally{a&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),P._stopVideoStream(a))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch{return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),P._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(t){throw this._flashOn=!1,t}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),P._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?P._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(t){if(!this._paused)throw this._active=!1,t}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(P._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise(a=>setTimeout(a,300)),this._paused?(n(),!0):!1)}async setCamera(t){t!==this._preferredCamera&&(this._preferredCamera=t,await this._restartVideoStream())}static async scanImage(t,n,a,c,u=!1,f=!1){let l,B=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(l=n.scanRegion,a=n.qrEngine,c=n.canvas,u=n.disallowCanvasResizing||!1,f=n.alsoTryWithoutScanRegion||!1,B=!0):console.warn(n||a||c||u||f?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!a;try{let m,w;[a,m]=await Promise.all([a||P.createQrEngine(),P._loadImage(t)]),[c,w]=P._drawToCanvas(m,l,c,u);let y;if(a instanceof Worker){let v=a;n||P._postWorkerMessageSync(v,"inversionMode","both"),y=await new Promise((p,g)=>{let C,_,M,b=-1;_=O=>{O.data.id===b&&(v.removeEventListener("message",_),v.removeEventListener("error",M),clearTimeout(C),O.data.data!==null?p({data:O.data.data,cornerPoints:P._convertPoints(O.data.cornerPoints,l)}):g(P.NO_QR_CODE_FOUND))},M=O=>{v.removeEventListener("message",_),v.removeEventListener("error",M),clearTimeout(C),g("Scanner error: "+(O?O.message||O:"Unknown Error"))},v.addEventListener("message",_),v.addEventListener("error",M),C=setTimeout(()=>M("timeout"),1e4);let A=w.getImageData(0,0,c.width,c.height);b=P._postWorkerMessageSync(v,"decode",A,[A.data.buffer])})}else y=await Promise.race([new Promise((v,p)=>window.setTimeout(()=>p("Scanner error: timeout"),1e4)),(async()=>{try{var[v]=await a.detect(c);if(!v)throw P.NO_QR_CODE_FOUND;return{data:v.rawValue,cornerPoints:P._convertPoints(v.cornerPoints,l)}}catch(p){if(v=p.message||p,/not implemented|service unavailable/.test(v))return P._disableBarcodeDetector=!0,P.scanImage(t,{scanRegion:l,canvas:c,disallowCanvasResizing:u,alsoTryWithoutScanRegion:f});throw`Scanner error: ${v}`}})()]);return B?y:y.data}catch(m){if(!l||!f)throw m;let w=await P.scanImage(t,{qrEngine:a,canvas:c,disallowCanvasResizing:u});return B?w:w.data}finally{n||P._postWorkerMessage(a,"close")}}setGrayscaleWeights(t,n,a,c=!0){P._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:n,blue:a,useIntegerApproximation:c})}setInversionMode(t){P._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>Promise.resolve().then(()=>Bn).then(a=>a.createWorker()),!(!P._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return t();let n=navigator.userAgentData;return n&&n.brands.some(({brand:a})=>/Chromium/i.test(a))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:a,platformVersion:c})=>/arm/i.test(a||"arm")&&13<=parseInt(c||"13")).catch(()=>!0)?t():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(t){let n=Math.round(.6666666666666666*Math.min(t.videoWidth,t.videoHeight));return{x:Math.round((t.videoWidth-n)/2),y:Math.round((t.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var t=this.$video,n=t.videoWidth,a=t.videoHeight,c=t.offsetWidth,u=t.offsetHeight,f=t.offsetLeft,l=t.offsetTop,B=window.getComputedStyle(t),m=B.objectFit,w=n/a,y=c/u;switch(m){case"none":var v=n,p=a;break;case"fill":v=c,p=u;break;default:(m==="cover"?w>y:w<y)?(p=u,v=p*w):(v=c,p=v/w),m==="scale-down"&&(v=Math.min(v,n),p=Math.min(p,a))}var[g,C]=B.objectPosition.split(" ").map((M,b)=>{const A=parseFloat(M);return M.endsWith("%")?(b?u-p:c-v)*A/100:A});B=this._scanRegion.width||n,y=this._scanRegion.height||a,m=this._scanRegion.x||0;var _=this._scanRegion.y||0;w=this.$overlay.style,w.width=`${B/n*v}px`,w.height=`${y/a*p}px`,w.top=`${l+C+_/a*p}px`,a=/scaleX\(-1\)/.test(t.style.transform),w.left=`${f+(a?c-g-v:g)+(a?n-m-B:m)/n*v}px`,w.transform=t.style.transform}})}static _convertPoints(t,n){if(!n)return t;let a=n.x||0,c=n.y||0,u=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let f of t)f.x=f.x*u+a,f.y=f.y*n+c;return t}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise(c=>setTimeout(c,n-t)),this._lastScanTimestamp=Date.now();try{var a=await P.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(c){if(!this._active)return;this._onDecodeError(c)}!P._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=P.createQrEngine()),a?(this._onDecode?this._onDecode(a):this._legacyOnDecode&&this._legacyOnDecode(a.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",a.cornerPoints.map(({x:c,y:u})=>`${c},${u}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(t){t!==P.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let t=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],a=n.map(c=>Object.assign({},c,{[t]:{exact:this._preferredCamera}}));for(let c of[...a,...n])try{let u=await navigator.mediaDevices.getUserMedia({video:c,audio:!1}),f=this._getFacingMode(u)||(c.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:u,facingMode:f}}catch{}throw"Camera not found."}async _restartVideoStream(){let t=this._paused;await this.pause(!0)&&!t&&this._active&&await this.start()}static _stopVideoStream(t){for(let n of t.getTracks())n.stop(),t.removeTrack(n)}_setVideoMirror(t){this.$video.style.transform="scaleX("+(t==="user"?-1:1)+")"}_getFacingMode(t){return(t=t.getVideoTracks()[0])?/rear|back|environment/i.test(t.label)?"environment":/front|user|face/i.test(t.label)?"user":null:null}static _drawToCanvas(t,n,a,c=!1){a=a||document.createElement("canvas");let u=n&&n.x?n.x:0,f=n&&n.y?n.y:0,l=n&&n.width?n.width:t.videoWidth||t.width,B=n&&n.height?n.height:t.videoHeight||t.height;return c||(c=n&&n.downScaledWidth?n.downScaledWidth:l,n=n&&n.downScaledHeight?n.downScaledHeight:B,a.width!==c&&(a.width=c),a.height!==n&&(a.height=n)),n=a.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(t,u,f,l,B,0,0,a.width,a.height),[a,n]}static async _loadImage(t){if(t instanceof Image)return await P._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(t instanceof File||t instanceof Blob||t instanceof URL||typeof t=="string"){let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await P._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(t){t.complete&&t.naturalWidth!==0||await new Promise((n,a)=>{let c=u=>{t.removeEventListener("load",c),t.removeEventListener("error",c),u instanceof ErrorEvent?a("Image load error"):n()};t.addEventListener("load",c),t.addEventListener("error",c)})}static async _postWorkerMessage(t,n,a,c){return P._postWorkerMessageSync(await t,n,a,c)}static _postWorkerMessageSync(t,n,a,c){if(!(t instanceof Worker))return-1;let u=P._workerMessageId++;return t.postMessage({id:u,type:n,data:a},c),u}}P.DEFAULT_CANVAS_SIZE=400,P.NO_QR_CODE_FOUND="No QR code found",P._disableBarcodeDetector=!1,P._workerMessageId=0;const _t=class _t{constructor(t,n,a){this.events={};const c=document.querySelector(t.target);if(!c)throw new Error(`Target element '${t.target}' is not found`);this.targetElement=c,this.decode=n,this.scannerElements=a}async _initializeScanner(t,n=25){try{if(!t){const a=await this.listVideoInputDevices();t=this._getMainCameraDeviceId(a)}this.qrScanner=new P(document.getElementById(`${this.scannerElements.VIDEO}`),async a=>{if(this.previousScanText!==a.data)try{this.previousScanText=a.data,this.events?.[Ie.CAPTURE]?.(await this.decode(a.data))}catch(c){this.events?.[Ie.ERROR]?.(c)}},{returnDetailedScanResult:!0,maxScansPerSecond:n,preferredCamera:t,highlightScanRegion:!0,highlightCodeOutline:!0,onDecodeError:()=>{}}),await this.qrScanner.start()}catch(a){this.events?.[Ie.ERROR]?.(a),this.qrScanner?.stop(),this.rootElement?.remove()}}async listVideoInputDevices(){return P.listCameras(!0)}_getMainCameraDeviceId(t){if(!t?.length)throw new Error("No video input devices available");const n=["back","задня"];return t.find(c=>{const u=c.label.toLowerCase();return u.includes(n[0])||u.includes(n[1])})?.id||t[1]?.id||t[0]?.id}close(){this.previousScanText=null,this.events?.[Ie.CANCEL]?.(),this.qrScanner?.stop(),this.rootElement?.remove()}on(t,n){this.events[t]=n}off(t){this.events[t]=void 0}};_t.events=Ie;let Pt=_t;class Cr extends Pt{constructor(t){super(t,hn,Je)}async scan({deviceId:t,maxScansPerSecond:n,isCloseButton:a}={}){a===void 0&&(a=!0),this.qrScanner?.stop(),this.rootElement?.remove(),new cn({target:this.targetElement,props:{close:this.close.bind(this),isCloseButton:a,scannerElements:Je}}),this.rootElement=document.getElementById(Je.ROOT),await this._initializeScanner(t,n)}}typeof window<"u"&&(window.CredenzaScanner=Cr);const Bn=Object.freeze(Object.defineProperty({__proto__:null,createWorker:()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
|
|
7
8
|
class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
|
|
8
9
|
class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
|
|
9
10
|
this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");
|
|
@@ -100,4 +101,4 @@ u.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.cre
|
|
|
100
101
|
y:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};
|
|
101
102
|
self.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;
|
|
102
103
|
break;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}
|
|
103
|
-
`]),{type:"application/javascript"}))},Symbol.toStringTag,{value:"Module"}));
|
|
104
|
+
`]),{type:"application/javascript"}))},Symbol.toStringTag,{value:"Module"}));ye.Scanner=Cr,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credenza3/scanner-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Credenza Scanner Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -19,29 +19,29 @@
|
|
|
19
19
|
"author": "Dmitry Fokin",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
23
|
-
"@types/jest": "^
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"eslint": "^9.
|
|
26
|
-
"eslint-plugin-svelte": "^
|
|
27
|
-
"husky": "^9.
|
|
28
|
-
"jest": "^
|
|
29
|
-
"prettier": "^3.2
|
|
30
|
-
"prettier-plugin-svelte": "^3.
|
|
31
|
-
"sass": "^1.
|
|
32
|
-
"svelte-preprocess": "^
|
|
33
|
-
"ts-jest": "^29.
|
|
34
|
-
"typescript": "^5.
|
|
35
|
-
"typescript-eslint": "^
|
|
36
|
-
"vite": "^
|
|
37
|
-
"vite-plugin-dts": "^
|
|
22
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
23
|
+
"@types/jest": "^30.0.0",
|
|
24
|
+
"@types/node": "^24.9.2",
|
|
25
|
+
"eslint": "^9.38.0",
|
|
26
|
+
"eslint-plugin-svelte": "^3.13.0",
|
|
27
|
+
"husky": "^9.1.7",
|
|
28
|
+
"jest": "^30.2.0",
|
|
29
|
+
"prettier": "^3.6.2",
|
|
30
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
31
|
+
"sass": "^1.93.2",
|
|
32
|
+
"svelte-preprocess": "^6.0.3",
|
|
33
|
+
"ts-jest": "^29.4.5",
|
|
34
|
+
"typescript": "^5.9.3",
|
|
35
|
+
"typescript-eslint": "^8.46.2",
|
|
36
|
+
"vite": "^7.1.12",
|
|
37
|
+
"vite-plugin-dts": "^4.5.4"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"svelte": "^
|
|
40
|
+
"svelte": "^5.43.2"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
44
|
-
"pnpm": ">=
|
|
43
|
+
"node": ">=22",
|
|
44
|
+
"pnpm": ">=10"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "vite build"
|