vue-qr.e5ef1511.js 57 KB

1
  1. import{ap as ye,aC as Ce,a_ as xe,f as Lt,N as Se,W as Wt,S as je,o as nt,c as pt,R as _t,a2 as W,k as I,_ as Pe,a5 as Ae,ab as Ge,r as zt,O as Ue,C as He,bg as Ke,y as it,j as Xe,n as Pt,a as xt,a4 as ae,m as kt,w as jt,a1 as Ze,B as Gt,b as le,aw as Ve,bh as We,t as Ut,d as ce,ar as Je,as as Ye}from"./entry.b59333b6.js";import{u as qe}from"./index.712aa735.js";import{_ as Qe}from"./_plugin-vue_export-helper.c27b6911.js";const tr=ye({space:{type:[Number,String],default:""},active:{type:Number,default:0},direction:{type:String,default:"horizontal",values:["horizontal","vertical"]},alignCenter:{type:Boolean},simple:{type:Boolean},finishStatus:{type:String,values:["wait","process","finish","error","success"],default:"finish"},processStatus:{type:String,values:["wait","process","finish","error","success"],default:"process"}}),er={[Ce]:(o,t)=>[o,t].every(xe)},rr=Lt({name:"ElSteps"}),nr=Lt({...rr,props:tr,emits:er,setup(o,{emit:t}){const e=o,r=Se("steps"),{children:n,addChild:i,removeChild:s}=qe(Ae(),"ElStep");return Wt(n,()=>{n.value.forEach((a,l)=>{a.setIndex(l)})}),je("ElSteps",{props:e,steps:n,addStep:i,removeStep:s}),Wt(()=>e.active,(a,l)=>{t(Ce,a,l)}),(a,l)=>(nt(),pt("div",{class:W([I(r).b(),I(r).m(a.simple?"simple":a.direction)])},[_t(a.$slots,"default")],2))}});var ir=Pe(nr,[["__file","steps.vue"]]);const or=ye({title:{type:String,default:""},icon:{type:Ge},description:{type:String,default:""},status:{type:String,values:["","wait","process","finish","error","success"],default:""}}),sr=Lt({name:"ElStep"}),ar=Lt({...sr,props:or,setup(o){const t=o,e=Se("step"),r=zt(-1),n=zt({}),i=zt(""),s=Ue("ElSteps"),a=Ae();He(()=>{Wt([()=>s.props.active,()=>s.props.processStatus,()=>s.props.finishStatus],([h])=>{g(h)},{immediate:!0})}),Ke(()=>{s.removeStep(w.uid)});const l=it(()=>t.status||i.value),c=it(()=>{const h=s.steps.value[r.value-1];return h?h.currentStatus:"wait"}),f=it(()=>s.props.alignCenter),d=it(()=>s.props.direction==="vertical"),m=it(()=>s.props.simple),x=it(()=>s.steps.value.length),B=it(()=>{var h;return((h=s.steps.value[x.value-1])==null?void 0:h.uid)===(a==null?void 0:a.uid)}),k=it(()=>m.value?"":s.props.space),$=it(()=>[e.b(),e.is(m.value?"simple":s.props.direction),e.is("flex",B.value&&!k.value&&!f.value),e.is("center",f.value&&!d.value&&!m.value)]),p=it(()=>{const h={flexBasis:xe(k.value)?`${k.value}px`:k.value?k.value:`${100/(x.value-(f.value?0:1))}%`};return d.value||B.value&&(h.maxWidth=`${100/x.value}%`),h}),v=h=>{r.value=h},P=h=>{const b=h==="wait",S={transitionDelay:`${b?"-":""}${150*r.value}ms`},E=h===s.props.processStatus||b?0:100;S.borderWidth=E&&!m.value?"1px":0,S[s.props.direction==="vertical"?"height":"width"]=`${E}%`,n.value=S},g=h=>{h>r.value?i.value=s.props.finishStatus:h===r.value&&c.value!=="error"?i.value=s.props.processStatus:i.value="wait";const b=s.steps.value[r.value-1];b&&b.calcProgress(i.value)},w=Xe({uid:a.uid,currentStatus:l,setIndex:v,calcProgress:P});return s.addStep(w),(h,b)=>(nt(),pt("div",{style:ae(I(p)),class:W(I($))},[Pt(" icon & line "),xt("div",{class:W([I(e).e("head"),I(e).is(I(l))])},[I(m)?Pt("v-if",!0):(nt(),pt("div",{key:0,class:W(I(e).e("line"))},[xt("i",{class:W(I(e).e("line-inner")),style:ae(n.value)},null,6)],2)),xt("div",{class:W([I(e).e("icon"),I(e).is(h.icon||h.$slots.icon?"icon":"text")])},[_t(h.$slots,"icon",{},()=>[h.icon?(nt(),kt(I(Gt),{key:0,class:W(I(e).e("icon-inner"))},{default:jt(()=>[(nt(),kt(Ze(h.icon)))]),_:1},8,["class"])):I(l)==="success"?(nt(),kt(I(Gt),{key:1,class:W([I(e).e("icon-inner"),I(e).is("status")])},{default:jt(()=>[le(I(Ve))]),_:1},8,["class"])):I(l)==="error"?(nt(),kt(I(Gt),{key:2,class:W([I(e).e("icon-inner"),I(e).is("status")])},{default:jt(()=>[le(I(We))]),_:1},8,["class"])):I(m)?Pt("v-if",!0):(nt(),pt("div",{key:3,class:W(I(e).e("icon-inner"))},Ut(r.value+1),3))])],2)],2),Pt(" title & description "),xt("div",{class:W(I(e).e("main"))},[xt("div",{class:W([I(e).e("title"),I(e).is(I(l))])},[_t(h.$slots,"title",{},()=>[ce(Ut(h.title),1)])],2),I(m)?(nt(),pt("div",{key:0,class:W(I(e).e("arrow"))},null,2)):(nt(),pt("div",{key:1,class:W([I(e).e("description"),I(e).is(I(l))])},[_t(h.$slots,"description",{},()=>[ce(Ut(h.description),1)])],2))],2)],6))}});var Be=Pe(ar,[["__file","item.vue"]]);const vn=Je(ir,{Step:Be}),mn=Ye(Be);function Ht(o){return o===""?o:o==="true"||o=="1"}function lr(o,t){return new Promise((e,r)=>{var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var i=new FileReader;i.onloadend=function(){e(i.result)},i.readAsArrayBuffer(n.response)},n.open("GET",o),n.send()})}function ot(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function ue(o,t){for(var e="",r=0,n=-1,i=0,s,a=0;a<=o.length;++a){if(a<o.length)s=o.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(n===a-1||i===1))if(n!==a-1&&i===2){if(e.length<2||r!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){var l=e.lastIndexOf("/");if(l!==e.length-1){l===-1?(e="",r=0):(e=e.slice(0,l),r=e.length-1-e.lastIndexOf("/")),n=a,i=0;continue}}else if(e.length===2||e.length===1){e="",r=0,n=a,i=0;continue}}t&&(e.length>0?e+="/..":e="..",r=2)}else e.length>0?e+="/"+o.slice(n+1,a):e=o.slice(n+1,a),r=a-n-1;n=a,i=0}else s===46&&i!==-1?++i:i=-1}return e}function cr(o,t){var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+o+r:r}var mt={resolve:function(){for(var t="",e=!1,r,n=arguments.length-1;n>=-1&&!e;n--){var i;n>=0?i=arguments[n]:(r===void 0&&(r=process.cwd()),i=r),ot(i),i.length!==0&&(t=i+"/"+t,e=i.charCodeAt(0)===47)}return t=ue(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(ot(t),t.length===0)return".";var e=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=ue(t,!e),t.length===0&&!e&&(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return ot(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];ot(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":mt.normalize(t)},relative:function(t,e){if(ot(t),ot(e),t===e||(t=mt.resolve(t),e=mt.resolve(e),t===e))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var n=t.length,i=n-r,s=1;s<e.length&&e.charCodeAt(s)===47;++s);for(var a=e.length,l=a-s,c=i<l?i:l,f=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(e.charCodeAt(s+d)===47)return e.slice(s+d+1);if(d===0)return e.slice(s+d)}else i>c&&(t.charCodeAt(r+d)===47?f=d:d===0&&(f=0));break}var m=t.charCodeAt(r+d),x=e.charCodeAt(s+d);if(m!==x)break;m===47&&(f=d)}var B="";for(d=r+f+1;d<=n;++d)(d===n||t.charCodeAt(d)===47)&&(B.length===0?B+="..":B+="/..");return B.length>0?B+e.slice(s+f):(s+=f,e.charCodeAt(s)===47&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(ot(t),t.length===0)return".";for(var e=t.charCodeAt(0),r=e===47,n=-1,i=!0,s=t.length-1;s>=1;--s)if(e=t.charCodeAt(s),e===47){if(!i){n=s;break}}else i=!1;return n===-1?r?"/":".":r&&n===1?"//":t.slice(0,n)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');ot(t);var r=0,n=-1,i=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(s=t.length-1;s>=0;--s){var c=t.charCodeAt(s);if(c===47){if(!i){r=s+1;break}}else l===-1&&(i=!1,l=s+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(n=s):(a=-1,n=l))}return r===n?n=l:n===-1&&(n=t.length),t.slice(r,n)}else{for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!i){r=s+1;break}}else n===-1&&(i=!1,n=s+1);return n===-1?"":t.slice(r,n)}},extname:function(t){ot(t);for(var e=-1,r=0,n=-1,i=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!i){r=a+1;break}continue}n===-1&&(i=!1,n=a+1),l===46?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||n===-1||s===0||s===1&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return cr("/",t)},parse:function(t){ot(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var r=t.charCodeAt(0),n=r===47,i;n?(e.root="/",i=1):i=0;for(var s=-1,a=0,l=-1,c=!0,f=t.length-1,d=0;f>=i;--f){if(r=t.charCodeAt(f),r===47){if(!c){a=f+1;break}continue}l===-1&&(c=!1,l=f+1),r===46?s===-1?s=f:d!==1&&(d=1):s!==-1&&(d=-1)}return s===-1||l===-1||d===0||d===1&&s===l-1&&s===a+1?l!==-1&&(a===0&&n?e.base=e.name=t.slice(1,l):e.base=e.name=t.slice(a,l)):(a===0&&n?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};mt.posix=mt;const ur=mt.extname,ke=mt.basename;class fr{constructor(){let t=(()=>typeof global>"u")(),e="image/png",r="image/jpeg",n="image/jpeg",i="image/webp",s="application/pdf",a="image/svg+xml";Object.assign(this,{toMime:this.toMime.bind(this),fromMime:this.fromMime.bind(this),expected:t?'"png", "jpg", or "webp"':'"png", "jpg", "pdf", or "svg"',formats:t?{png:e,jpg:r,jpeg:n,webp:i}:{png:e,jpg:r,jpeg:n,pdf:s,svg:a},mimes:t?{[e]:"png",[r]:"jpg",[i]:"webp"}:{[e]:"png",[r]:"jpg",[s]:"pdf",[a]:"svg"}})}toMime(t){return this.formats[(t||"").replace(/^\./,"").toLowerCase()]}fromMime(t){return this.mimes[t]}}function hr(o,{filename:t="",extension:e="",format:k,page:n,quality:i,matte:s,density:a,outline:l,archive:x}={}){var{fromMime:f,toMime:d,expected:m}=new fr,x=x||"canvas",B=k||e.replace(/@\d+x$/i,"")||ur(t),k=f(d(B)||B),$=d(k),p=o.length;if(!B)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!k)throw new Error(`Unsupported file format "${B}" (expected ${m})`);if(!p)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let v,P,g=t.replace(/{(\d*)}/g,(h,b)=>(P=!0,b=parseInt(b,10),v=isFinite(b)?b:isFinite(v)?v:-1,"{}")),w=n>0?n-1:n<0?p+n:void 0;if(isFinite(w)&&w<0||w>=p)throw new RangeError(p==1?`Canvas only has a ‘page 1’ (${w} is out of bounds)`:`Canvas has pages 1–${p} (${w} is out of bounds)`);if(o=isFinite(w)?[o[w]]:P||k=="pdf"?o:o.slice(-1),i===void 0)i=.92;else if(typeof i!="number"||!isFinite(i)||i<0||i>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(a===void 0){let h=(e||ke(t,B)).match(/@(\d+)x$/i);a=h?parseInt(h[1],10):1}else if(typeof a!="number"||!Number.isInteger(a)||a<1)throw new TypeError("The density option must be a non-negative integer");return l===void 0?l=!0:k=="svg"&&(l=!!l),{filename:t,pattern:g,format:k,mime:$,pages:o,padding:v,quality:i,matte:s,density:a,outline:l,archive:x}}class Mt{static for(t){return new Mt().append(t).get()}constructor(){this.crc=-1}get(){return~this.crc}append(t){for(var e=this.crc|0,r=this.table,n=0,i=t.length|0;n<i;n++)e=e>>>8^r[(e^t[n])&255];return this.crc=e,this}}Mt.prototype.table=(()=>{var o,t,e,r=[];for(o=0;o<256;o++){for(e=o,t=0;t<8;t++)e=e&1?e>>>1^3988292384:e>>>1;r[o]=e}return r})();function Kt(o){let t=new Uint8Array(o),e=new DataView(t.buffer),r={array:t,view:e,size:o,set8(n,i){return e.setUint8(n,i),r},set16(n,i){return e.setUint16(n,i,!0),r},set32(n,i){return e.setUint32(n,i,!0),r},bytes(n,i){return t.set(i,n),r}};return r}class Ft{constructor(t){let e=new Date;Object.assign(this,{directory:t,offset:0,files:[],time:(e.getHours()<<6|e.getMinutes())<<5|e.getSeconds()/2,date:(e.getFullYear()-1980<<4|e.getMonth()+1)<<5|e.getDate()}),this.add(t)}async add(t,e){let r=!e,n=Ft.encoder.encode(`${this.directory}/${r?"":t}`),i=new Uint8Array(r?0:await e.arrayBuffer()),s=30+n.length,a=s+i.length,l=16,{offset:c}=this,f=Kt(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,Mt.for(i)).set32(14,i.length).set32(18,i.length).set16(22,n.length);c+=s;let d=Kt(s+i.length+l).set32(0,67324752).bytes(4,f.array).bytes(30,n).bytes(s,i);c+=i.length,d.set32(a,134695760).bytes(a+4,f.array.slice(10,22)),c+=l,this.files.push({offset:c,folder:r,name:n,header:f,payload:d}),this.offset=c}toBuffer(){let t=this.files.reduce((d,{name:m})=>46+m.length+d,0),e=Kt(t+22),r=0;for(var{offset:n,name:i,header:s,folder:a}of this.files)e.set32(r,33639248).set16(r+4,20).bytes(r+6,s.array).set8(r+38,a?16:0).set32(r+42,n).bytes(r+46,i),r+=46+i.length;e.set32(r,101010256).set16(r+8,this.files.length).set16(r+10,this.files.length).set32(r+12,t).set32(r+16,this.offset);let l=new Uint8Array(this.offset+e.size),c=0;for(var{payload:f}of this.files)l.set(f.array,c),c+=f.size;return l.set(e.array,c),l}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}}Ft.encoder=new TextEncoder;const qt=(o,t,e,r)=>{if(r){let{width:n,height:i}=o,s=Object.assign(document.createElement("canvas"),{width:n,height:i}),a=s.getContext("2d");a.fillStyle=r,a.fillRect(0,0,n,i),a.drawImage(o,0,0),o=s}return new Promise((n,i)=>o.toBlob(n,t,e))},dr=(...o)=>qt(...o).then(t=>t.arrayBuffer()),gr=async(o,t,e,r,n)=>{De(n,await qt(o,t,e,r))},pr=async(o,t,e,r,n,i,s)=>{let a=f=>i.replace("{}",String(f+1).padStart(s,"0")),l=ke(n,".zip")||"archive",c=new Ft(l);await Promise.all(o.map(async(f,d)=>{let m=a(d);await c.add(m,await qt(f,t,e,r))})),De(`${l}.zip`,c.blob)},De=(o,t)=>{const e=window.URL.createObjectURL(t),r=document.createElement("a");r.style.display="none",r.href=e,r.setAttribute("download",o),typeof r.download>"u"&&r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>window.URL.revokeObjectURL(e),100)},vr=(o,t,e)=>o.map(r=>{if(t==1&&!e)return r.canvas;let n=document.createElement("canvas"),i=n.getContext("2d"),s=r.canvas?r.canvas:r;return n.width=s.width*t,n.height=s.height*t,e&&(i.fillStyle=e,i.fillRect(0,0,n.width,n.height)),i.scale(t,t),i.drawImage(s,0,0),n}),mr={asBuffer:dr,asDownload:gr,asZipDownload:pr,atScale:vr,options:hr},{asBuffer:Xt,asDownload:br,asZipDownload:wr,atScale:Zt,options:Vt}=mr,fe=Symbol.for("toDataURL"),yr=o=>new Promise((t,e)=>Object.assign(new Ee,{crossOrigin:"Anonymous",onload:t,onerror:e,src:o}));let Cr=class{constructor(t,e){let r=document.createElement("canvas"),n=[];Object.defineProperty(r,"async",{value:!0,writable:!1,enumerable:!0});for(var[i,s]of Object.entries({png:()=>Xt(r,"image/png"),jpg:()=>Xt(r,"image/jpeg"),pages:()=>n.concat(r).map(a=>a.getContext("2d"))}))Object.defineProperty(r,i,{get:s});return Object.assign(r,{width:t,height:e,newPage(...a){var{width:c,height:f}=r,l=Object.assign(document.createElement("canvas"),{width:c,height:f});l.getContext("2d").drawImage(r,0,0),n.push(l);var[c,f]=a.length?a:[c,f];return Object.assign(r,{width:c,height:f}).getContext("2d")},saveAs(a,l){l=typeof l=="number"?{quality:l}:l;let c=Vt(this.pages,{filename:a,...l}),{pattern:f,padding:d,mime:m,quality:x,matte:B,density:k,archive:$}=c,p=Zt(c.pages,k);return d==null?br(p[0],m,x,B,a):wr(p,m,x,B,$,f,d)},toBuffer(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Vt(this.pages,{extension:a,...l}),{mime:f,quality:d,matte:m,pages:x,density:B}=c,k=Zt(x,B,m)[0];return Xt(k,f,d,m)},[fe]:r.toDataURL.bind(r),toDataURL(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Vt(this.pages,{extension:a,...l}),{mime:f,quality:d,matte:m,pages:x,density:B}=c,k=Zt(x,B,m)[0],$=k[k===r?fe:"toDataURL"](f,d);return Promise.resolve($)}})}};const{CanvasRenderingContext2D:xr,CanvasGradient:Sr,CanvasPattern:Pr,Image:Ee,ImageData:Ar,Path2D:Br,DOMMatrix:kr,DOMRect:Dr,DOMPoint:Er}=window,Tr={Canvas:Cr,loadImage:yr,CanvasRenderingContext2D:xr,CanvasGradient:Sr,CanvasPattern:Pr,Image:Ee,ImageData:Ar,Path2D:Br,DOMMatrix:kr,DOMRect:Dr,DOMPoint:Er},At=(o,t,e={},r=e)=>{if(Array.isArray(t))t.forEach(n=>At(o,n,e,r));else if(typeof t=="function")t(o,e,r,At);else{const n=Object.keys(t)[0];Array.isArray(t[n])?(r[n]={},At(o,t[n],e,r[n])):r[n]=t[n](o,e,r,At)}return e},bt=(o,t)=>(e,r,n,i)=>{t(e,r,n)&&i(e,o,r,n)},Ir=(o,t)=>(e,r,n,i)=>{const s=[];let a=e.pos;for(;t(e,r,n);){const l={};if(i(e,o,r,l),e.pos===a)break;a=e.pos,s.push(l)}return s},_r=o=>({data:o,pos:0}),Q=()=>o=>o.data[o.pos++],Te=(o=0)=>t=>t.data[t.pos+o],at=o=>t=>t.data.subarray(t.pos,t.pos+=o),Nt=o=>t=>t.data.subarray(t.pos,t.pos+o),Jt=o=>t=>Array.from(at(o)(t)).map(e=>String.fromCharCode(e)).join(""),vt=o=>t=>{const e=at(2)(t);return o?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]},Ie=(o,t)=>(e,r,n)=>{const i=typeof t=="function"?t(e,r,n):t,s=at(o),a=new Array(i);for(var l=0;l<i;l++)a[l]=s(e);return a},Lr=(o,t,e)=>{for(var r=0,n=0;n<e;n++)r+=o[t+n]&&2**(e-n-1);return r},Qt=o=>t=>{const e=Q()(t),r=new Array(8);for(var n=0;n<8;n++)r[7-n]=!!(e&1<<n);return Object.keys(o).reduce((i,s)=>{const a=o[s];return a.length?i[s]=Lr(r,a.index,a.length):i[s]=r[a.index],i},{})};var Ot={blocks:o=>{const e=[],r=o.data.length;for(var n=0,i=Q()(o);i!==0&&i;i=Q()(o)){if(o.pos+i>=r){const c=r-o.pos;e.push(at(c)(o)),n+=c;break}e.push(at(i)(o)),n+=i}const s=new Uint8Array(n);for(var a=0,l=0;l<e.length;l++)s.set(e[l],a),a+=e[l].length;return s}};const Mr=bt({gce:[{codes:at(2)},{byteSize:Q()},{extras:Qt({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:vt(!0)},{transparentColorIndex:Q()},{terminator:Q()}]},o=>{var t=Nt(2)(o);return t[0]===33&&t[1]===249}),Fr=bt({image:[{code:Q()},{descriptor:[{left:vt(!0)},{top:vt(!0)},{width:vt(!0)},{height:vt(!0)},{lct:Qt({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},bt({lct:Ie(3,(o,t,e)=>Math.pow(2,e.descriptor.lct.size+1))},(o,t,e)=>e.descriptor.lct.exists),{data:[{minCodeSize:Q()},Ot]}]},o=>Te()(o)===44),Nr=bt({text:[{codes:at(2)},{blockSize:Q()},{preData:(o,t,e)=>at(e.text.blockSize)(o)},Ot]},o=>{var t=Nt(2)(o);return t[0]===33&&t[1]===1}),Or=bt({application:[{codes:at(2)},{blockSize:Q()},{id:(o,t,e)=>Jt(e.blockSize)(o)},Ot]},o=>{var t=Nt(2)(o);return t[0]===33&&t[1]===255}),Rr=bt({comment:[{codes:at(2)},Ot]},o=>{var t=Nt(2)(o);return t[0]===33&&t[1]===254}),$r=[{header:[{signature:Jt(3)},{version:Jt(3)}]},{lsd:[{width:vt(!0)},{height:vt(!0)},{gct:Qt({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:Q()},{pixelAspectRatio:Q()}]},bt({gct:Ie(3,(o,t)=>Math.pow(2,t.lsd.gct.size+1))},(o,t)=>t.lsd.gct.exists),{frames:Ir([Mr,Or,Rr,Fr,Nr],o=>{var t=Te()(o);return t===33||t===44})}],zr=(o,t)=>{const e=new Array(o.length),r=o.length/t,n=function(f,d){const m=o.slice(d*t,(d+1)*t);e.splice.apply(e,[f*t,t].concat(m))},i=[0,4,2,1],s=[8,8,4,2];for(var a=0,l=0;l<4;l++)for(var c=i[l];c<r;c+=s[l])n(c,a),a++;return e},jr=(o,t,e)=>{const i=e;var s,a,l,c,f,d,m,w,x,B,g,k,h,b,E,S;const $=new Array(e),p=new Array(4096),v=new Array(4096),P=new Array(4096+1);for(k=o,a=1<<k,f=a+1,s=a+2,m=-1,c=k+1,l=(1<<c)-1,x=0;x<a;x++)p[x]=0,v[x]=x;var g,w,h,b,S,E;for(g=w=h=b=S=E=0,B=0;B<i;){if(b===0){if(w<c){g+=t[E]<<w,w+=8,E++;continue}if(x=g&l,g>>=c,w-=c,x>s||x==f)break;if(x==a){c=k+1,l=(1<<c)-1,s=a+2,m=-1;continue}if(m==-1){P[b++]=v[x],m=x,h=x;continue}for(d=x,x==s&&(P[b++]=h,x=m);x>a;)P[b++]=v[x],x=p[x];h=v[x]&255,P[b++]=h,s<4096&&(p[s]=m,v[s]=h,s++,!(s&l)&&s<4096&&(c++,l+=s)),m=d}b--,$[S++]=P[b],B++}for(B=S;B<i;B++)$[B]=0;return $},Gr=o=>{const t=new Uint8Array(o);return At(_r(t),$r)},Ur=o=>{const t=o.pixels.length,e=new Uint8ClampedArray(t*4);for(var r=0;r<t;r++){const n=r*4,i=o.pixels[r],s=o.colorTable[i];e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=i!==o.transparentIndex?255:0}return e},Hr=(o,t,e)=>{if(!o.image){console.warn("gif frame does not have associated image.");return}const{image:r}=o,n=r.descriptor.width*r.descriptor.height;var i=jr(r.data.minCodeSize,r.data.blocks,n);r.descriptor.lct.interlaced&&(i=zr(i,r.descriptor.width));const s={pixels:i,dims:{top:o.image.descriptor.top,left:o.image.descriptor.left,width:o.image.descriptor.width,height:o.image.descriptor.height}};return r.descriptor.lct&&r.descriptor.lct.exists?s.colorTable=r.lct:s.colorTable=t,o.gce&&(s.delay=(o.gce.delay||10)*10,s.disposalType=o.gce.extras.disposal,o.gce.extras.transparentColorGiven&&(s.transparentIndex=o.gce.transparentColorIndex)),e&&(s.patch=Ur(s)),s},Kr=(o,t)=>o.frames.filter(e=>e.image).map(e=>Hr(e,o.gct,t));function Xr(o,t,e){const r=_e(t),n=o-1;let i=0;switch(e){case V.L:i=st[n][0];break;case V.M:i=st[n][1];break;case V.Q:i=st[n][2];break;case V.H:i=st[n][3];break}return r<=i}function Zr(o,t){for(var e=1,r=_e(o),n=0,i=st.length;n<i;n++){var s=0;switch(t){case V.L:s=st[n][0];break;case V.M:s=st[n][1];break;case V.Q:s=st[n][2];break;case V.H:s=st[n][3];break}if(r<=s)break;e++}if(e>st.length)throw new Error("Too long data");return e}function _e(o){var t=encodeURI(o).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(o)?3:0)}class Vr{constructor(t){this.mode=Y.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;const e=[];for(let r=0,n=this.data.length;r<n;r++){const i=[],s=this.data.charCodeAt(r);s>65536?(i[0]=240|(s&1835008)>>>18,i[1]=128|(s&258048)>>>12,i[2]=128|(s&4032)>>>6,i[3]=128|s&63):s>2048?(i[0]=224|(s&61440)>>>12,i[1]=128|(s&4032)>>>6,i[2]=128|s&63):s>128?(i[0]=192|(s&1984)>>>6,i[1]=128|s&63):i[0]=s,e.push(i)}this.parsedData=Array.prototype.concat.apply([],e),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}getLength(){return this.parsedData.length}write(t){for(let e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}}class dt{constructor(t=-1,e=V.L){this.moduleCount=0,this.dataList=[],this.typeNumber=t,this.errorCorrectLevel=e,this.moduleCount=0,this.dataList=[]}addData(t){if(this.typeNumber<=0)this.typeNumber=Zr(t,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error(`Invalid QR version: ${this.typeNumber}`);if(!Xr(this.typeNumber,t,this.errorCorrectLevel))throw new Error(`Data is too long for QR version: ${this.typeNumber}`)}const e=new Vr(t);this.dataList.push(e),this.dataCache=void 0}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(`${t},${e}`);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=dt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)}getBestMaskPattern(){if(Number.isInteger(this.maskPattern)&&Object.values(ct).includes(this.maskPattern))return this.maskPattern;let t=0,e=0;for(let r=0;r<8;r++){this.makeImpl(!0,r);const n=M.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=M.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let r=0;r<t.length;r++){const n=t[e],i=t[r];if(this.modules[n][i]==null)for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}}setupTypeNumber(t){const e=M.getBCHTypeNumber(this.typeNumber);for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}}setupTypeInfo(t,e){const r=this.errorCorrectLevel<<3|e,n=M.getBCHTypeInfo(r);for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let r=-1,n=this.moduleCount-1,i=7,s=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let l=0;l<2;l++)if(this.modules[n][a-l]==null){let c=!1;s<t.length&&(c=(t[s]>>>i&1)==1),M.getMask(e,n,a-l)&&(c=!c),this.modules[n][a-l]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}static createData(t,e,r){const n=ut.getRSBlocks(t,e),i=new Wr;for(var s=0;s<r.length;s++){const l=r[s];i.put(l.mode,4),i.put(l.getLength(),M.getLengthInBits(l.mode,t)),l.write(i)}let a=0;for(var s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error(`code length overflow. (${i.getLengthInBits()}>${a*8})`);for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(dt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(dt.PAD1,8);return dt.createBytes(i,n)}static createBytes(t,e){let r=0,n=0,i=0;const s=new Array(e.length),a=new Array(e.length);for(var l=0;l<e.length;l++){const x=e[l].dataCount,B=e[l].totalCount-x;n=Math.max(n,x),i=Math.max(i,B),s[l]=new Array(x);for(var c=0;c<s[l].length;c++)s[l][c]=255&t.buffer[c+r];r+=x;const k=M.getErrorCorrectPolynomial(B),p=new yt(s[l],k.getLength()-1).mod(k);a[l]=new Array(k.getLength()-1);for(var c=0;c<a[l].length;c++){const P=c+p.getLength()-a[l].length;a[l][c]=P>=0?p.get(P):0}}let f=0;for(var c=0;c<e.length;c++)f+=e[c].totalCount;const d=new Array(f);let m=0;for(var c=0;c<n;c++)for(var l=0;l<e.length;l++)c<s[l].length&&(d[m++]=s[l][c]);for(var c=0;c<i;c++)for(var l=0;l<e.length;l++)c<a[l].length&&(d[m++]=a[l][c]);return d}}dt.PAD0=236;dt.PAD1=17;const V={L:1,M:0,Q:3,H:2},Y={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ct={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};class M{static getBCHTypeInfo(t){let e=t<<10;for(;M.getBCHDigit(e)-M.getBCHDigit(M.G15)>=0;)e^=M.G15<<M.getBCHDigit(e)-M.getBCHDigit(M.G15);return(t<<10|e)^M.G15_MASK}static getBCHTypeNumber(t){let e=t<<12;for(;M.getBCHDigit(e)-M.getBCHDigit(M.G18)>=0;)e^=M.G18<<M.getBCHDigit(e)-M.getBCHDigit(M.G18);return t<<12|e}static getBCHDigit(t){let e=0;for(;t!=0;)e++,t>>>=1;return e}static getPatternPosition(t){return M.PATTERN_POSITION_TABLE[t-1]}static getMask(t,e,r){switch(t){case ct.PATTERN000:return(e+r)%2==0;case ct.PATTERN001:return e%2==0;case ct.PATTERN010:return r%3==0;case ct.PATTERN011:return(e+r)%3==0;case ct.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case ct.PATTERN101:return e*r%2+e*r%3==0;case ct.PATTERN110:return(e*r%2+e*r%3)%2==0;case ct.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error(`bad maskPattern:${t}`)}}static getErrorCorrectPolynomial(t){let e=new yt([1],0);for(let r=0;r<t;r++)e=e.multiply(new yt([1,U.gexp(r)],0));return e}static getLengthInBits(t,e){if(1<=e&&e<10)switch(t){case Y.MODE_NUMBER:return 10;case Y.MODE_ALPHA_NUM:return 9;case Y.MODE_8BIT_BYTE:return 8;case Y.MODE_KANJI:return 8;default:throw new Error(`mode:${t}`)}else if(e<27)switch(t){case Y.MODE_NUMBER:return 12;case Y.MODE_ALPHA_NUM:return 11;case Y.MODE_8BIT_BYTE:return 16;case Y.MODE_KANJI:return 10;default:throw new Error(`mode:${t}`)}else if(e<41)switch(t){case Y.MODE_NUMBER:return 14;case Y.MODE_ALPHA_NUM:return 13;case Y.MODE_8BIT_BYTE:return 16;case Y.MODE_KANJI:return 12;default:throw new Error(`mode:${t}`)}else throw new Error(`type:${e}`)}static getLostPoint(t){const e=t.getModuleCount();let r=0;for(var n=0;n<e;n++)for(var i=0;i<e;i++){let l=0;const c=t.isDark(n,i);for(let f=-1;f<=1;f++)if(!(n+f<0||e<=n+f))for(let d=-1;d<=1;d++)i+d<0||e<=i+d||f==0&&d==0||c==t.isDark(n+f,i+d)&&l++;l>5&&(r+=3+l-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){let f=0;t.isDark(n,i)&&f++,t.isDark(n+1,i)&&f++,t.isDark(n,i+1)&&f++,t.isDark(n+1,i+1)&&f++,(f==0||f==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);let s=0;for(var i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&s++;const a=Math.abs(100*s/e/e-50)/5;return r+=a*10,r}}M.PATTERN_POSITION_TABLE=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]];M.G15=1335;M.G18=7973;M.G15_MASK=21522;class U{static glog(t){if(t<1)throw new Error(`glog(${t})`);return U.LOG_TABLE[t]}static gexp(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return U.EXP_TABLE[t]}}U.EXP_TABLE=new Array(256);U.LOG_TABLE=new Array(256);U._constructor=function(){for(var o=0;o<8;o++)U.EXP_TABLE[o]=1<<o;for(var o=8;o<256;o++)U.EXP_TABLE[o]=U.EXP_TABLE[o-4]^U.EXP_TABLE[o-5]^U.EXP_TABLE[o-6]^U.EXP_TABLE[o-8];for(var o=0;o<255;o++)U.LOG_TABLE[U.EXP_TABLE[o]]=o}();class yt{constructor(t,e){if(t.length==null)throw new Error(`${t.length}/${e}`);let r=0;for(;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(let n=0;n<t.length-r;n++)this.num[n]=t[n+r]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let r=0;r<this.getLength();r++)for(let n=0;n<t.getLength();n++)e[r+n]^=U.gexp(U.glog(this.get(r))+U.glog(t.get(n)));return new yt(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=U.glog(this.get(0))-U.glog(t.get(0)),r=new Array(this.getLength());for(var n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=U.gexp(U.glog(t.get(n))+e);return new yt(r,0).mod(t)}}class ut{constructor(t,e){this.totalCount=t,this.dataCount=e}static getRSBlocks(t,e){const r=ut.getRsBlockTable(t,e);if(r==null)throw new Error(`bad rs block @ typeNumber:${t}/errorCorrectLevel:${e}`);const n=r.length/3,i=[];for(let s=0;s<n;s++){const a=r[s*3+0],l=r[s*3+1],c=r[s*3+2];for(let f=0;f<a;f++)i.push(new ut(l,c))}return i}static getRsBlockTable(t,e){switch(e){case V.L:return ut.RS_BLOCK_TABLE[(t-1)*4+0];case V.M:return ut.RS_BLOCK_TABLE[(t-1)*4+1];case V.Q:return ut.RS_BLOCK_TABLE[(t-1)*4+2];case V.H:return ut.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}ut.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];class Wr{constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}const st=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];var Jr=100,X=256,he=X-1,ht=4,Le=16,te=1<<Le,Me=10,ee=10,Yr=te>>ee,qr=te<<Me-ee,Qr=X>>3,Yt=6,tn=1<<Yt,en=Qr*tn,rn=30,Fe=10,Dt=1<<Fe,Ne=8,de=1<<Ne,nn=Fe+Ne,wt=1<<nn,ge=499,pe=491,ve=487,Oe=503,on=3*Oe;function sn(o,t){var e,r,n,i,s;function a(){e=[],r=new Int32Array(256),n=new Int32Array(X),i=new Int32Array(X),s=new Int32Array(X>>3);var p,v;for(p=0;p<X;p++)v=(p<<ht+8)/X,e[p]=new Float64Array([v,v,v,0]),i[p]=te/X,n[p]=0}function l(){for(var p=0;p<X;p++)e[p][0]>>=ht,e[p][1]>>=ht,e[p][2]>>=ht,e[p][3]=p}function c(p,v,P,g,w){e[v][0]-=p*(e[v][0]-P)/Dt,e[v][1]-=p*(e[v][1]-g)/Dt,e[v][2]-=p*(e[v][2]-w)/Dt}function f(p,v,P,g,w){for(var h=Math.abs(v-p),b=Math.min(v+p,X),S=v+1,E=v-1,F=1,u,N;S<b||E>h;)N=s[F++],S<b&&(u=e[S++],u[0]-=N*(u[0]-P)/wt,u[1]-=N*(u[1]-g)/wt,u[2]-=N*(u[2]-w)/wt),E>h&&(u=e[E--],u[0]-=N*(u[0]-P)/wt,u[1]-=N*(u[1]-g)/wt,u[2]-=N*(u[2]-w)/wt)}function d(p,v,P){var g=2147483647,w=g,h=-1,b=h,S,E,F,u,N;for(S=0;S<X;S++)E=e[S],F=Math.abs(E[0]-p)+Math.abs(E[1]-v)+Math.abs(E[2]-P),F<g&&(g=F,h=S),u=F-(n[S]>>Le-ht),u<w&&(w=u,b=S),N=i[S]>>ee,i[S]-=N,n[S]+=N<<Me;return i[h]+=Yr,n[h]-=qr,b}function m(){var p,v,P,g,w,h,b=0,S=0;for(p=0;p<X;p++){for(P=e[p],w=p,h=P[1],v=p+1;v<X;v++)g=e[v],g[1]<h&&(w=v,h=g[1]);if(g=e[w],p!=w&&(v=g[0],g[0]=P[0],P[0]=v,v=g[1],g[1]=P[1],P[1]=v,v=g[2],g[2]=P[2],P[2]=v,v=g[3],g[3]=P[3],P[3]=v),h!=b){for(r[b]=S+p>>1,v=b+1;v<h;v++)r[v]=p;b=h,S=p}}for(r[b]=S+he>>1,v=b+1;v<256;v++)r[v]=he}function x(p,v,P){for(var g,w,h,b=1e3,S=-1,E=r[v],F=E-1;E<X||F>=0;)E<X&&(w=e[E],h=w[1]-v,h>=b?E=X:(E++,h<0&&(h=-h),g=w[0]-p,g<0&&(g=-g),h+=g,h<b&&(g=w[2]-P,g<0&&(g=-g),h+=g,h<b&&(b=h,S=w[3])))),F>=0&&(w=e[F],h=v-w[1],h>=b?F=-1:(F--,h<0&&(h=-h),g=w[0]-p,g<0&&(g=-g),h+=g,h<b&&(g=w[2]-P,g<0&&(g=-g),h+=g,h<b&&(b=h,S=w[3]))));return S}function B(){var p,v=o.length,P=30+(t-1)/3,g=v/(3*t),w=~~(g/Jr),h=Dt,b=en,S=b>>Yt;for(S<=1&&(S=0),p=0;p<S;p++)s[p]=h*((S*S-p*p)*de/(S*S));var E;v<on?(t=1,E=3):v%ge!==0?E=3*ge:v%pe!==0?E=3*pe:v%ve!==0?E=3*ve:E=3*Oe;var F,u,N,C,O=0;for(p=0;p<g;)if(F=(o[O]&255)<<ht,u=(o[O+1]&255)<<ht,N=(o[O+2]&255)<<ht,C=d(F,u,N),c(h,C,F,u,N),S!==0&&f(S,C,F,u,N),O+=E,O>=v&&(O-=v),p++,w===0&&(w=1),p%w===0)for(h-=h/P,b-=b/rn,S=b>>Yt,S<=1&&(S=0),C=0;C<S;C++)s[C]=h*((S*S-C*C)*de/(S*S))}function k(){a(),B(),l(),m()}this.buildColormap=k;function $(){for(var p=[],v=[],P=0;P<X;P++)v[e[P][3]]=P;for(var g=0,w=0;w<X;w++){var h=v[w];p[g++]=e[h][0],p[g++]=e[h][1],p[g++]=e[h][2]}return p}this.getColormap=$,this.lookupRGB=x}var me=-1,Et=12,St=5003,an=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function ln(o,t,e,r){var n=Math.max(2,r),i=new Uint8Array(256),s=new Int32Array(St),a=new Int32Array(St),l,c=0,f,d=0,m,x=!1,B,k,$,p,v,P;function g(C,O){i[f++]=C,f>=254&&E(O)}function w(C){h(St),d=k+2,x=!0,N(k,C)}function h(C){for(var O=0;O<C;++O)s[O]=-1}function b(C,O){var y,gt,G,tt,ft,H,et;for(B=C,x=!1,P=B,m=F(P),k=1<<C-1,$=k+1,d=k+2,f=0,tt=u(),et=0,y=St;y<65536;y*=2)++et;et=8-et,H=St,h(H),N(k,O);t:for(;(gt=u())!=me;){if(y=(gt<<Et)+tt,G=gt<<et^tt,s[G]===y){tt=a[G];continue}else if(s[G]>=0){ft=H-G,G===0&&(ft=1);do if((G-=ft)<0&&(G+=H),s[G]===y){tt=a[G];continue t}while(s[G]>=0)}N(tt,O),tt=gt,d<1<<Et?(a[G]=d++,s[G]=y):w(O)}N(tt,O),N($,O)}function S(C){C.writeByte(n),p=o*t,v=0,b(n+1,C),C.writeByte(0)}function E(C){f>0&&(C.writeByte(f),C.writeBytes(i,0,f),f=0)}function F(C){return(1<<C)-1}function u(){if(p===0)return me;--p;var C=e[v++];return C&255}function N(C,O){for(l&=an[c],c>0?l|=C<<c:l=C,c+=P;c>=8;)g(l&255,O),l>>=8,c-=8;if((d>m||x)&&(x?(m=F(P=B),x=!1):(++P,P==Et?m=1<<Et:m=F(P))),C==$){for(;c>0;)g(l&255,O),l>>=8,c-=8;E(O)}}this.encode=S}function J(){this.page=-1,this.pages=[],this.newPage()}J.pageSize=4096;J.charMap={};for(var Tt=0;Tt<256;Tt++)J.charMap[Tt]=String.fromCharCode(Tt);J.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(J.pageSize),this.cursor=0};J.prototype.getData=function(){for(var o="",t=0;t<this.pages.length;t++)for(var e=0;e<J.pageSize;e++)o+=J.charMap[this.pages[t][e]];return o};J.prototype.toFlattenUint8Array=function(){const o=[];for(var t=0;t<this.pages.length;t++)if(t===this.pages.length-1){const r=Uint8Array.from(this.pages[t].slice(0,this.cursor));o.push(r)}else o.push(this.pages[t]);const e=new Uint8Array(o.reduce((r,n)=>r+n.length,0));return o.reduce((r,n)=>(e.set(n,r),r+n.length),0),e};J.prototype.writeByte=function(o){this.cursor>=J.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=o};J.prototype.writeUTFBytes=function(o){for(var t=o.length,e=0;e<t;e++)this.writeByte(o.charCodeAt(e))};J.prototype.writeBytes=function(o,t,e){for(var r=e||o.length,n=t||0;n<r;n++)this.writeByte(o[n])};function R(o,t){this.width=~~o,this.height=~~t,this.transparent=null,this.transIndex=0,this.repeat=-1,this.delay=0,this.image=null,this.pixels=null,this.indexedPixels=null,this.colorDepth=null,this.colorTab=null,this.neuQuant=null,this.usedEntry=new Array,this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.dither=!1,this.globalPalette=!1,this.out=new J}R.prototype.setDelay=function(o){this.delay=Math.round(o/10)};R.prototype.setFrameRate=function(o){this.delay=Math.round(100/o)};R.prototype.setDispose=function(o){o>=0&&(this.dispose=o)};R.prototype.setRepeat=function(o){this.repeat=o};R.prototype.setTransparent=function(o){this.transparent=o};R.prototype.addFrame=function(o){this.image=o,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),this.globalPalette===!0&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),!this.firstFrame&&!this.globalPalette&&this.writePalette(),this.writePixels(),this.firstFrame=!1};R.prototype.finish=function(){this.out.writeByte(59)};R.prototype.setQuality=function(o){o<1&&(o=1),this.sample=o};R.prototype.setDither=function(o){o===!0&&(o="FloydSteinberg"),this.dither=o};R.prototype.setGlobalPalette=function(o){this.globalPalette=o};R.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};R.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};R.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new sn(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,this.transparent!==null&&(this.transIndex=this.findClosest(this.transparent,!0))};R.prototype.indexPixels=function(o){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);for(var e=0,r=0;r<t;r++){var n=this.findClosestRGB(this.pixels[e++]&255,this.pixels[e++]&255,this.pixels[e++]&255);this.usedEntry[n]=!0,this.indexedPixels[r]=n}};R.prototype.ditherPixels=function(o,t){var e={FalseFloydSteinberg:[[.375,1,0],[.375,0,1],[.25,1,1]],FloydSteinberg:[[.4375,1,0],[.1875,-1,1],[.3125,0,1],[.0625,1,1]],Stucki:[[.19047619047619047,1,0],[.09523809523809523,2,0],[.047619047619047616,-2,1],[.09523809523809523,-1,1],[.19047619047619047,0,1],[.09523809523809523,1,1],[.047619047619047616,2,1],[.023809523809523808,-2,2],[.047619047619047616,-1,2],[.09523809523809523,0,2],[.047619047619047616,1,2],[.023809523809523808,2,2]],Atkinson:[[.125,1,0],[.125,2,0],[.125,-1,1],[.125,0,1],[.125,1,1],[.125,0,2]]};if(!o||!e[o])throw"Unknown dithering kernel: "+o;var r=e[o],n=0,i=this.height,s=this.width,a=this.pixels,l=t?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var c=0;c<i;c++){t&&(l=l*-1);for(var f=l==1?0:s-1,d=l==1?s:0;f!==d;f+=l){n=c*s+f;var m=n*3,x=a[m],B=a[m+1],k=a[m+2];m=this.findClosestRGB(x,B,k),this.usedEntry[m]=!0,this.indexedPixels[n]=m,m*=3;for(var $=this.colorTab[m],p=this.colorTab[m+1],v=this.colorTab[m+2],P=x-$,g=B-p,w=k-v,h=l==1?0:r.length-1,b=l==1?r.length:0;h!==b;h+=l){var S=r[h][1],E=r[h][2];if(S+f>=0&&S+f<s&&E+c>=0&&E+c<i){var F=r[h][0];m=n+S+E*s,m*=3,a[m]=Math.max(0,Math.min(255,a[m]+P*F)),a[m+1]=Math.max(0,Math.min(255,a[m+1]+g*F)),a[m+2]=Math.max(0,Math.min(255,a[m+2]+w*F))}}}}};R.prototype.findClosest=function(o,t){return this.findClosestRGB((o&16711680)>>16,(o&65280)>>8,o&255,t)};R.prototype.findClosestRGB=function(o,t,e,r){if(this.colorTab===null)return-1;if(this.neuQuant&&!r)return this.neuQuant.lookupRGB(o,t,e);for(var n=0,i=256*256*256,s=this.colorTab.length,a=0,l=0;a<s;l++){var c=o-(this.colorTab[a++]&255),f=t-(this.colorTab[a++]&255),d=e-(this.colorTab[a++]&255),m=c*c+f*f+d*d;(!r||this.usedEntry[l])&&m<i&&(i=m,n=l)}return n};R.prototype.getImagePixels=function(){var o=this.width,t=this.height;this.pixels=new Uint8Array(o*t*3);for(var e=this.image,r=0,n=0,i=0;i<t;i++)for(var s=0;s<o;s++)this.pixels[n++]=e[r++],this.pixels[n++]=e[r++],this.pixels[n++]=e[r++],r++};R.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4);var o,t;this.transparent===null?(o=0,t=0):(o=1,t=2),this.dispose>=0&&(t=this.dispose&7),t<<=2,this.out.writeByte(0|t|0|o),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};R.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)};R.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)};R.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)};R.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var o=3*256-this.colorTab.length,t=0;t<o;t++)this.out.writeByte(0)};R.prototype.writeShort=function(o){this.out.writeByte(o&255),this.out.writeByte(o>>8&255)};R.prototype.writePixels=function(){var o=new ln(this.width,this.height,this.indexedPixels,this.colorDepth);o.encode(this.out)};R.prototype.stream=function(){return this.out};var cn=globalThis&&globalThis.__awaiter||function(o,t,e,r){function n(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function a(f){try{c(r.next(f))}catch(d){s(d)}}function l(f){try{c(r.throw(f))}catch(d){s(d)}}function c(f){f.done?i(f.value):n(f.value).then(a,l)}c((r=r.apply(o,t||[])).next())})};const{Canvas:lt}=Tr,It=.4;function be(o){if(!o)return;function t(e){e.onload=null,e.onerror=null}return new Promise(function(e,r){if(o.slice(0,4)=="data"){let i=new Image;i.onload=function(){e(i),t(i)},i.onerror=function(){r("Image load error"),t(i)},i.src=o;return}let n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){e(n)},n.onerror=function(){r("Image load error")},n.src=o})}class L{constructor(t){const e=Object.assign({},t);if(Object.keys(L.defaultOptions).forEach(r=>{r in e||Object.defineProperty(e,r,{value:L.defaultOptions[r],enumerable:!0,writable:!0})}),e.components?typeof e.components=="object"&&Object.keys(L.defaultComponentOptions).forEach(r=>{r in e.components?Object.defineProperty(e.components,r,{value:Object.assign(Object.assign({},L.defaultComponentOptions[r]),e.components[r]),enumerable:!0,writable:!0}):Object.defineProperty(e.components,r,{value:L.defaultComponentOptions[r],enumerable:!0,writable:!0})}):e.components=L.defaultComponentOptions,e.dotScale!==null&&e.dotScale!==void 0){if(e.dotScale<=0||e.dotScale>1)throw new Error("dotScale should be in range (0, 1].");e.components.data.scale=e.dotScale,e.components.timing.scale=e.dotScale,e.components.alignment.scale=e.dotScale}this.options=e,this.canvas=new lt(t.size,t.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new dt(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}draw(){return new Promise(t=>this._draw().then(t))}_clear(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)}static _prepareRoundedCornerClip(t,e,r,n,i,s){t.beginPath(),t.moveTo(e,r),t.arcTo(e+n,r,e+n,r+i,s),t.arcTo(e+n,r+i,e,r+i,s),t.arcTo(e,r+i,e,r,s),t.arcTo(e,r,e+n,r,s),t.closePath()}static _getAverageRGB(t){const r={r:0,g:0,b:0};let n,i,s=-4;const a={r:0,g:0,b:0};let l=0;i=t.naturalHeight||t.height,n=t.naturalWidth||t.width;const f=new lt(n,i).getContext("2d");if(!f)return r;f.drawImage(t,0,0);let d;try{d=f.getImageData(0,0,n,i)}catch{return r}for(;(s+=5*4)<d.data.length;)d.data[s]>200||d.data[s+1]>200||d.data[s+2]>200||(++l,a.r+=d.data[s],a.g+=d.data[s+1],a.b+=d.data[s+2]);return a.r=~~(a.r/l),a.g=~~(a.g/l),a.b=~~(a.b/l),a}static _drawDot(t,e,r,n,i=0,s=1){t.fillRect((e+i)*n,(r+i)*n,s*n,s*n)}static _drawAlignProtector(t,e,r,n){t.clearRect((e-2)*n,(r-2)*n,5*n,5*n),t.fillRect((e-2)*n,(r-2)*n,5*n,5*n)}static _drawAlign(t,e,r,n,i=0,s=1,a,l){const c=t.fillStyle;t.fillStyle=a,new Array(4).fill(0).map((f,d)=>{L._drawDot(t,e-2+d,r-2,n,i,s),L._drawDot(t,e+2,r-2+d,n,i,s),L._drawDot(t,e+2-d,r+2,n,i,s),L._drawDot(t,e-2,r+2-d,n,i,s)}),L._drawDot(t,e,r,n,i,s),l||(t.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((f,d)=>{L._drawDot(t,e-1+d,r-1,n,i,s),L._drawDot(t,e+1,r-1+d,n,i,s),L._drawDot(t,e+1-d,r+1,n,i,s),L._drawDot(t,e-1,r+1-d,n,i,s)})),t.fillStyle=c}_draw(){var t,e,r,n,i,s,a,l,c,f,d,m,x,B,k,$,p,v,P;return cn(this,void 0,void 0,function*(){const g=(t=this.qrCode)===null||t===void 0?void 0:t.moduleCount,w=this.options.size;let h=this.options.margin;(h<0||h*2>=w)&&(h=0);const b=Math.ceil(h),S=w-2*h,E=this.options.whiteMargin,F=this.options.backgroundDimming,u=Math.ceil(S/g),N=u*g,C=N+2*b,O=new lt(C,C),y=O.getContext("2d");this._clear(),y.save(),y.translate(b,b);const gt=new lt(C,C),G=gt.getContext("2d");let tt=null,ft=[];if(this.options.gifBackground){const A=Gr(this.options.gifBackground);if(tt=A,ft=Kr(A,!0),this.options.autoColor){let D=0,T=0,_=0,K=0;for(let z=0;z<ft[0].colorTable.length;z++){const j=ft[0].colorTable[z];j[0]>200||j[1]>200||j[2]>200||j[0]===0&&j[1]===0&&j[2]===0||(K++,D+=j[0],T+=j[1],_+=j[2])}D=~~(D/K),T=~~(T/K),_=~~(_/K),this.options.colorDark=`rgb(${D},${T},${_})`}}else if(this.options.backgroundImage){const A=yield be(this.options.backgroundImage);if(this.options.autoColor){const D=L._getAverageRGB(A);this.options.colorDark=`rgb(${D.r},${D.g},${D.b})`}G.drawImage(A,0,0,A.width,A.height,0,0,C,C),G.rect(0,0,C,C),G.fillStyle=F,G.fill()}else G.rect(0,0,C,C),G.fillStyle=this.options.colorLight,G.fill();const H=M.getPatternPosition(this.qrCode.typeNumber),et=((r=(e=this.options.components)===null||e===void 0?void 0:e.data)===null||r===void 0?void 0:r.scale)||It,re=(1-et)*.5;for(let A=0;A<g;A++)for(let D=0;D<g;D++){const T=this.qrCode.isDark(A,D),_=D<8&&(A<8||A>=g-8)||D>=g-8&&A<8,K=A==6&&D>=8&&D<=g-8||D==6&&A>=8&&A<=g-8;let z=_||K;for(let Z=1;Z<H.length-1;Z++)z=z||A>=H[Z]-2&&A<=H[Z]+2&&D>=H[Z]-2&&D<=H[Z]+2;const j=D*u+(z?0:re*u),rt=A*u+(z?0:re*u);if(y.strokeStyle=T?this.options.colorDark:this.options.colorLight,y.lineWidth=.5,y.fillStyle=T?this.options.colorDark:this.options.colorLight,H.length===0)z||y.fillRect(j,rt,(z?1:et)*u,(z?1:et)*u);else{const Z=D<g-4&&D>=g-4-5&&A<g-4&&A>=g-4-5;!z&&!Z&&y.fillRect(j,rt,(z?1:et)*u,(z?1:et)*u)}}const q=H[H.length-1],Re=this.options.colorLight;if(y.fillStyle=Re,y.fillRect(0,0,8*u,8*u),y.fillRect(0,(g-8)*u,8*u,8*u),y.fillRect((g-8)*u,0,8*u,8*u),!((i=(n=this.options.components)===null||n===void 0?void 0:n.timing)===null||i===void 0)&&i.protectors&&(y.fillRect(8*u,6*u,(g-8-8)*u,u),y.fillRect(6*u,8*u,u,(g-8-8)*u)),!((a=(s=this.options.components)===null||s===void 0?void 0:s.cornerAlignment)===null||a===void 0)&&a.protectors&&L._drawAlignProtector(y,q,q,u),!((c=(l=this.options.components)===null||l===void 0?void 0:l.alignment)===null||c===void 0)&&c.protectors)for(let A=0;A<H.length;A++)for(let D=0;D<H.length;D++){const T=H[D],_=H[A];if(!(T===6&&(_===6||_===q))){if(_===6&&(T===6||T===q))continue;if(T===q&&_===q)continue;L._drawAlignProtector(y,T,_,u)}}y.fillStyle=this.options.colorDark,y.fillRect(0,0,7*u,u),y.fillRect((g-7)*u,0,7*u,u),y.fillRect(0,6*u,7*u,u),y.fillRect((g-7)*u,6*u,7*u,u),y.fillRect(0,(g-7)*u,7*u,u),y.fillRect(0,(g-7+6)*u,7*u,u),y.fillRect(0,0,u,7*u),y.fillRect(6*u,0,u,7*u),y.fillRect((g-7)*u,0,u,7*u),y.fillRect((g-7+6)*u,0,u,7*u),y.fillRect(0,(g-7)*u,u,7*u),y.fillRect(6*u,(g-7)*u,u,7*u),y.fillRect(2*u,2*u,3*u,3*u),y.fillRect((g-7+2)*u,2*u,3*u,3*u),y.fillRect(2*u,(g-7+2)*u,3*u,3*u);const Rt=((d=(f=this.options.components)===null||f===void 0?void 0:f.timing)===null||d===void 0?void 0:d.scale)||It,ne=(1-Rt)*.5;for(let A=0;A<g-8;A+=2)L._drawDot(y,8+A,6,u,ne,Rt),L._drawDot(y,6,8+A,u,ne,Rt);const ie=((x=(m=this.options.components)===null||m===void 0?void 0:m.cornerAlignment)===null||x===void 0?void 0:x.scale)||It,$e=(1-ie)*.5;L._drawAlign(y,q,q,u,$e,ie,this.options.colorDark,((k=(B=this.options.components)===null||B===void 0?void 0:B.cornerAlignment)===null||k===void 0?void 0:k.protectors)||!1);const oe=((p=($=this.options.components)===null||$===void 0?void 0:$.alignment)===null||p===void 0?void 0:p.scale)||It,ze=(1-oe)*.5;for(let A=0;A<H.length;A++)for(let D=0;D<H.length;D++){const T=H[D],_=H[A];if(!(T===6&&(_===6||_===q))){if(_===6&&(T===6||T===q))continue;if(T===q&&_===q)continue;L._drawAlign(y,T,_,u,ze,oe,this.options.colorDark,((P=(v=this.options.components)===null||v===void 0?void 0:v.alignment)===null||P===void 0?void 0:P.protectors)||!1)}}if(E&&(y.fillStyle=this.options.backgroundColor,y.fillRect(-b,-b,C,b),y.fillRect(-b,N,C,b),y.fillRect(N,-b,b,C),y.fillRect(-b,-b,b,C)),this.options.logoImage){const A=yield be(this.options.logoImage);let D=this.options.logoScale,T=this.options.logoMargin,_=this.options.logoCornerRadius;(D<=0||D>=1)&&(D=.2),T<0&&(T=0),_<0&&(_=0);const K=N*D,z=.5*(C-K),j=z;y.restore(),y.fillStyle=this.options.logoBackgroundColor,y.save(),L._prepareRoundedCornerClip(y,z-T,j-T,K+2*T,K+2*T,_+T),y.clip();const rt=y.globalCompositeOperation;y.globalCompositeOperation="destination-out",y.fill(),y.globalCompositeOperation=rt,y.restore(),y.save(),L._prepareRoundedCornerClip(y,z,j,K,K,_),y.clip(),y.drawImage(A,z,j,K,K),y.restore(),y.save(),y.translate(b,b)}if(tt){let A,D,T,_,K,z;if(ft.forEach(function(j){A||(A=new R(w,w),A.setDelay(j.delay),A.setRepeat(0));const{width:rt,height:Z}=j.dims;D||(D=new lt(rt,Z),T=D.getContext("2d"),T.rect(0,0,D.width,D.height),T.fillStyle="#ffffff",T.fill()),(!_||!z||rt!==_.width||Z!==_.height)&&(_=new lt(rt,Z),K=_.getContext("2d"),z=K.createImageData(rt,Z)),z.data.set(j.patch),K.putImageData(z,0,0),T.drawImage(_.getContext("2d").canvas,j.dims.left,j.dims.top);const Bt=new lt(C,C),Ct=Bt.getContext("2d");Ct.drawImage(D.getContext("2d").canvas,0,0,C,C),Ct.rect(0,0,C,C),Ct.fillStyle=F,Ct.fill(),Ct.drawImage(O.getContext("2d").canvas,0,0,C,C);const $t=new lt(w,w),se=$t.getContext("2d");se.drawImage(Bt.getContext("2d").canvas,0,0,w,w),A.addFrame(se.getImageData(0,0,$t.width,$t.height).data)}),!A)throw new Error("No frames.");if(A.finish(),we(this.canvas)){const rt=A.stream().toFlattenUint8Array().reduce((Z,Bt)=>Z+String.fromCharCode(Bt),"");return Promise.resolve(`data:image/gif;base64,${window.btoa(rt)}`)}return Promise.resolve(Buffer.from(A.stream().toFlattenUint8Array()))}else{G.drawImage(O.getContext("2d").canvas,0,0,C,C),y.drawImage(gt.getContext("2d").canvas,-b,-b,C,C);const A=new lt(w,w);A.getContext("2d").drawImage(O.getContext("2d").canvas,0,0,w,w),this.canvas=A;const T=this.options.gifBackground?"gif":"png";return we(this.canvas)?Promise.resolve(this.canvas.toDataURL(T)):Promise.resolve(this.canvas.toBuffer(T))}})}}L.CorrectLevel=V;L.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}};L.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:V.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:L.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"};function we(o){try{return o instanceof HTMLElement}catch{return typeof o=="object"&&o.nodeType===1&&typeof o.style=="object"&&typeof o.ownerDocument=="object"}}const un={props:{text:{type:String,required:!0},qid:{type:String},correctLevel:{type:Number,default:1},size:{type:Number,default:200},margin:{type:Number,default:20},colorDark:{type:String,default:"#000000"},colorLight:{type:String,default:"#FFFFFF"},bgSrc:{type:String,default:void 0},background:{type:String,default:"rgba(0,0,0,0)"},backgroundDimming:{type:String,default:"rgba(0,0,0,0)"},logoSrc:{type:String,default:void 0},logoBackgroundColor:{type:String,default:"rgba(255,255,255,1)"},gifBgSrc:{type:String,default:void 0},logoScale:{type:Number,default:.2},logoMargin:{type:Number,default:0},logoCornerRadius:{type:Number,default:8},whiteMargin:{type:[Boolean,String],default:!0},dotScale:{type:Number,default:1},autoColor:{type:[Boolean,String],default:!0},binarize:{type:[Boolean,String],default:!1},binarizeThreshold:{type:Number,default:128},callback:{type:Function,default:function(){}},bindElement:{type:Boolean,default:!0},backgroundColor:{type:String,default:"#FFFFFF"},components:{default:function(){return{data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}}}}},name:"vue-qr",data(){return{imgUrl:""}},watch:{$props:{deep:!0,handler(){this.main()}}},mounted(){this.main()},methods:{async main(){if(this.gifBgSrc){const e=await lr(this.gifBgSrc),r=this.logoSrc;this.render(void 0,r,e);return}const o=this.bgSrc,t=this.logoSrc;this.render(o,t)},async render(o,t,e){const r=this;new L({gifBackground:e,text:r.text,size:r.size,margin:r.margin,colorDark:r.colorDark,colorLight:r.colorLight,backgroundColor:r.backgroundColor,backgroundImage:o,backgroundDimming:r.backgroundDimming,logoImage:t,logoScale:r.logoScale,logoBackgroundColor:r.logoBackgroundColor,correctLevel:r.correctLevel,logoMargin:r.logoMargin,logoCornerRadius:r.logoCornerRadius,whiteMargin:Ht(r.whiteMargin),dotScale:r.dotScale,autoColor:Ht(r.autoColor),binarize:Ht(r.binarize),binarizeThreshold:r.binarizeThreshold,components:r.components}).draw().then(n=>{this.imgUrl=n,r.callback&&r.callback(n,r.qid)})}}},fn=["src"];function hn(o,t,e,r,n,i){return e.bindElement?(nt(),pt("img",{key:0,style:{display:"inline-block"},src:n.imgUrl},null,8,fn)):Pt("",!0)}const wn=Qe(un,[["render",hn]]);export{mn as E,vn as a,wn as v};