import{p as _,H as l,a as b}from"./html5-qrcode-scanner.Dcv2t2Uk.js";import{s as x,e as S,c as w,j as C,d as m,f as i,i as k,n as d,p as v,q as A}from"./scheduler.NvvBUJNK.js";import{S as T,i as E}from"./index.BjobFbD-.js";import{p as H}from"./0.CMTQMBFK.js";const O=s=>{const t=new TextEncoder().encode(s),e=_.deflate(t);return btoa(String.fromCharCode(...new Uint8Array(e)))},Q=s=>{const t=atob(s),e=t.length,o=new Uint8Array(e);for(let r=0;r<e;r++)o[r]=t.charCodeAt(r);return _.inflate(o,{to:"string"})};function q(s){let t;return{c(){t=S("div"),this.h()},l(e){t=w(e,"DIV",{monitor:!0,id:!0,style:!0}),C(t).forEach(m),this.h()},h(){i(t,"monitor","barcode vision"),i(t,"id","barcode_vision"),i(t,"style",s[0])},m(e,o){k(e,t,o)},p:d,i:d,o:d,d(e){e&&m(t)}}}function D(s,t,e){let{found:o=()=>{}}=t,{styles:c={}}=t,r=H(Object.assign({},{height:"400px",width:"100%","max-width":"600px",margin:"0 auto"},c));const u=async(n,y)=>{const g=Q(n);o({hexadecimal_string:g,decodedText:n,decodedResult:y})},f=function(){console.log("on_error",arguments)};let a;const h=()=>{const n={fps:10,qrbox:{width:500,height:500},formatsToSupport:[l.QR_CODE,l.AZTEC]};a=new b("barcode_vision",n),a.render(u,f)},p=()=>{a&&a.pause()};return v(async()=>{h()}),A(async()=>{if(a)try{a.clear()}catch(n){console.error(n)}}),s.$$set=n=>{"found"in n&&e(1,o=n.found),"styles"in n&&e(2,c=n.styles)},[r,o,c,p]}class R extends T{constructor(t){super(),E(this,t,D,q,x,{found:1,styles:2,stop_the_scan:3})}get stop_the_scan(){return this.$$.ctx[3]}}export{R as T,O as p,Q as u};
//# sourceMappingURL=Trinket.CLS7uY5T.js.map
