12 |
- import{u as ke,s as J}from"./store-F66kEjW2.js";import{e as pt,f as wt,C as Ct,d as De,a2 as Te,K as Rt,j as kt,L as ee,u as z,i as Z,t as ot,m as Ee,y as Se}from"./vue-A59npLRR.js";import{_ as he}from"./index-EwE51S_X.js";import{s as Ie}from"./index-3qA-WN0K.js";import"./echarts-cxb9vJr1.js";function $t(i){return i===""?i:i==="true"||i=="1"}function Le(i,t){return new Promise((e,r)=>{var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=new FileReader;o.onloadend=function(){e(o.result)},o.readAsArrayBuffer(n.response)},n.open("GET",i),n.send()})}function it(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function re(i,t){for(var e="",r=0,n=-1,o=0,s,a=0;a<=i.length;++a){if(a<i.length)s=i.charCodeAt(a);else{if(s===47)break;s=47}if(s===47){if(!(n===a-1||o===1))if(n!==a-1&&o===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,o=0;continue}}else if(e.length===2||e.length===1){e="",r=0,n=a,o=0;continue}}t&&(e.length>0?e+="/..":e="..",r=2)}else e.length>0?e+="/"+i.slice(n+1,a):e=i.slice(n+1,a),r=a-n-1;n=a,o=0}else s===46&&o!==-1?++o:o=-1}return e}function Me(i,t){var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+i+r:r}var vt={resolve:function(){for(var t="",e=!1,r,n=arguments.length-1;n>=-1&&!e;n--){var o;n>=0?o=arguments[n]:(r===void 0&&(r=process.cwd()),o=r),it(o),o.length!==0&&(t=o+"/"+t,e=o.charCodeAt(0)===47)}return t=re(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(it(t),t.length===0)return".";var e=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=re(t,!e),t.length===0&&!e&&(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return it(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];it(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":vt.normalize(t)},relative:function(t,e){if(it(t),it(e),t===e||(t=vt.resolve(t),e=vt.resolve(e),t===e))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var n=t.length,o=n-r,s=1;s<e.length&&e.charCodeAt(s)===47;++s);for(var a=e.length,l=a-s,c=o<l?o:l,u=-1,h=0;h<=c;++h){if(h===c){if(l>c){if(e.charCodeAt(s+h)===47)return e.slice(s+h+1);if(h===0)return e.slice(s+h)}else o>c&&(t.charCodeAt(r+h)===47?u=h:h===0&&(u=0));break}var b=t.charCodeAt(r+h),x=e.charCodeAt(s+h);if(b!==x)break;b===47&&(u=h)}var k="";for(h=r+u+1;h<=n;++h)(h===n||t.charCodeAt(h)===47)&&(k.length===0?k+="..":k+="/..");return k.length>0?k+e.slice(s+u):(s+=u,e.charCodeAt(s)===47&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(it(t),t.length===0)return".";for(var e=t.charCodeAt(0),r=e===47,n=-1,o=!0,s=t.length-1;s>=1;--s)if(e=t.charCodeAt(s),e===47){if(!o){n=s;break}}else o=!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');it(t);var r=0,n=-1,o=!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(!o){r=s+1;break}}else l===-1&&(o=!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(!o){r=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":t.slice(r,n)}},extname:function(t){it(t);for(var e=-1,r=0,n=-1,o=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!o){r=a+1;break}continue}n===-1&&(o=!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 Me("/",t)},parse:function(t){it(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var r=t.charCodeAt(0),n=r===47,o;n?(e.root="/",o=1):o=0;for(var s=-1,a=0,l=-1,c=!0,u=t.length-1,h=0;u>=o;--u){if(r=t.charCodeAt(u),r===47){if(!c){a=u+1;break}continue}l===-1&&(c=!1,l=u+1),r===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||l===-1||h===0||h===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};vt.posix=vt;const Fe=vt.extname,de=vt.basename;class Ne{constructor(){let t=typeof global>"u",e="image/png",r="image/jpeg",n="image/jpeg",o="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:o}:{png:e,jpg:r,jpeg:n,pdf:s,svg:a},mimes:t?{[e]:"png",[r]:"jpg",[o]:"webp"}:{[e]:"png",[r]:"jpg",[s]:"pdf",[a]:"svg"}})}toMime(t){return this.formats[(t||"").replace(/^\./,"").toLowerCase()]}fromMime(t){return this.mimes[t]}}function Oe(i,{filename:t="",extension:e="",format:D,page:n,quality:o,matte:s,density:a,outline:l,archive:x}={}){var{fromMime:u,toMime:h,expected:b}=new Ne,x=x||"canvas",k=D||e.replace(/@\d+x$/i,"")||Fe(t),D=u(h(k)||k),U=h(D),g=i.length;if(!k)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!D)throw new Error(`Unsupported file format "${k}" (expected ${b})`);if(!g)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let p,A,d=t.replace(/{(\d*)}/g,(m,w)=>(A=!0,w=parseInt(w,10),p=isFinite(w)?w:isFinite(p)?p:-1,"{}")),y=n>0?n-1:n<0?g+n:void 0;if(isFinite(y)&&y<0||y>=g)throw new RangeError(g==1?`Canvas only has a ‘page 1’ (${y} is out of bounds)`:`Canvas has pages 1–${g} (${y} is out of bounds)`);if(i=isFinite(y)?[i[y]]:A||D=="pdf"?i:i.slice(-1),o===void 0)o=.92;else if(typeof o!="number"||!isFinite(o)||o<0||o>1)throw new TypeError("The quality option must be an number in the 0.0–1.0 range");if(a===void 0){let m=(e||de(t,k)).match(/@(\d+)x$/i);a=m?parseInt(m[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:D=="svg"&&(l=!!l),{filename:t,pattern:d,format:D,mime:U,pages:i,padding:p,quality:o,matte:s,density:a,outline:l,archive:x}}class It{static for(t){return new It().append(t).get()}constructor(){this.crc=-1}get(){return~this.crc}append(t){for(var e=this.crc|0,r=this.table,n=0,o=t.length|0;n<o;n++)e=e>>>8^r[(e^t[n])&255];return this.crc=e,this}}It.prototype.table=(()=>{var i,t,e,r=[];for(i=0;i<256;i++){for(e=i,t=0;t<8;t++)e=e&1?e>>>1^3988292384:e>>>1;r[i]=e}return r})();function zt(i){let t=new Uint8Array(i),e=new DataView(t.buffer),r={array:t,view:e,size:i,set8(n,o){return e.setUint8(n,o),r},set16(n,o){return e.setUint16(n,o,!0),r},set32(n,o){return e.setUint32(n,o,!0),r},bytes(n,o){return t.set(o,n),r}};return r}class Lt{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=Lt.encoder.encode(`${this.directory}/${r?"":t}`),o=new Uint8Array(r?0:await e.arrayBuffer()),s=30+n.length,a=s+o.length,l=16,{offset:c}=this,u=zt(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,It.for(o)).set32(14,o.length).set32(18,o.length).set16(22,n.length);c+=s;let h=zt(s+o.length+l).set32(0,67324752).bytes(4,u.array).bytes(30,n).bytes(s,o);c+=o.length,h.set32(a,134695760).bytes(a+4,u.array.slice(10,22)),c+=l,this.files.push({offset:c,folder:r,name:n,header:u,payload:h}),this.offset=c}toBuffer(){let t=this.files.reduce((h,{name:b})=>46+b.length+h,0),e=zt(t+22),r=0;for(var{offset:n,name:o,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,o),r+=46+o.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:u}of this.files)l.set(u.array,c),c+=u.size;return l.set(e.array,c),l}get blob(){return new Blob([this.toBuffer()],{type:"application/zip"})}}Lt.encoder=new TextEncoder;const Xt=(i,t,e,r)=>{if(r){let{width:n,height:o}=i,s=Object.assign(document.createElement("canvas"),{width:n,height:o}),a=s.getContext("2d");a.fillStyle=r,a.fillRect(0,0,n,o),a.drawImage(i,0,0),i=s}return new Promise((n,o)=>i.toBlob(n,t,e))},Re=(...i)=>Xt(...i).then(t=>t.arrayBuffer()),$e=async(i,t,e,r,n)=>{ge(n,await Xt(i,t,e,r))},ze=async(i,t,e,r,n,o,s)=>{let a=u=>o.replace("{}",String(u+1).padStart(s,"0")),l=de(n,".zip")||"archive",c=new Lt(l);await Promise.all(i.map(async(u,h)=>{let b=a(h);await c.add(b,await Xt(u,t,e,r))})),ge(`${l}.zip`,c.blob)},ge=(i,t)=>{const e=window.URL.createObjectURL(t),r=document.createElement("a");r.style.display="none",r.href=e,r.setAttribute("download",i),typeof r.download>"u"&&r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>window.URL.revokeObjectURL(e),100)},Ue=(i,t,e)=>i.map(r=>{if(t==1&&!e)return r.canvas;let n=document.createElement("canvas"),o=n.getContext("2d"),s=r.canvas?r.canvas:r;return n.width=s.width*t,n.height=s.height*t,e&&(o.fillStyle=e,o.fillRect(0,0,n.width,n.height)),o.scale(t,t),o.drawImage(s,0,0),n}),je={asBuffer:Re,asDownload:$e,asZipDownload:ze,atScale:Ue,options:Oe},{asBuffer:Ut,asDownload:Ge,asZipDownload:He,atScale:jt,options:Gt}=je,ne=Symbol.for("toDataURL"),Ke=i=>new Promise((t,e)=>Object.assign(new pe,{crossOrigin:"Anonymous",onload:t,onerror:e,src:i}));let Xe=class{constructor(t,e){let r=document.createElement("canvas"),n=[];Object.defineProperty(r,"async",{value:!0,writable:!1,enumerable:!0});for(var[o,s]of Object.entries({png:()=>Ut(r,"image/png"),jpg:()=>Ut(r,"image/jpeg"),pages:()=>n.concat(r).map(a=>a.getContext("2d"))}))Object.defineProperty(r,o,{get:s});return Object.assign(r,{width:t,height:e,newPage(...a){var{width:c,height:u}=r,l=Object.assign(document.createElement("canvas"),{width:c,height:u});l.getContext("2d").drawImage(r,0,0),n.push(l);var[c,u]=a.length?a:[c,u];return Object.assign(r,{width:c,height:u}).getContext("2d")},saveAs(a,l){l=typeof l=="number"?{quality:l}:l;let c=Gt(this.pages,{filename:a,...l}),{pattern:u,padding:h,mime:b,quality:x,matte:k,density:D,archive:U}=c,g=jt(c.pages,D);return h==null?Ge(g[0],b,x,k,a):He(g,b,x,k,U,u,h)},toBuffer(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Gt(this.pages,{extension:a,...l}),{mime:u,quality:h,matte:b,pages:x,density:k}=c,D=jt(x,k,b)[0];return Ut(D,u,h,b)},[ne]:r.toDataURL.bind(r),toDataURL(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Gt(this.pages,{extension:a,...l}),{mime:u,quality:h,matte:b,pages:x,density:k}=c,D=jt(x,k,b)[0],U=D[D===r?ne:"toDataURL"](u,h);return Promise.resolve(U)}})}};const{CanvasRenderingContext2D:Ze,CanvasGradient:Ve,CanvasPattern:Je,Image:pe,ImageData:We,Path2D:qe,DOMMatrix:Ye,DOMRect:Qe,DOMPoint:tr}=window,er={Canvas:Xe,loadImage:Ke,CanvasRenderingContext2D:Ze,CanvasGradient:Ve,CanvasPattern:Je,Image:pe,ImageData:We,Path2D:qe,DOMMatrix:Ye,DOMRect:Qe,DOMPoint:tr},_t=(i,t,e={},r=e)=>{if(Array.isArray(t))t.forEach(n=>_t(i,n,e,r));else if(typeof t=="function")t(i,e,r,_t);else{const n=Object.keys(t)[0];Array.isArray(t[n])?(r[n]={},_t(i,t[n],e,r[n])):r[n]=t[n](i,e,r,_t)}return e},bt=(i,t)=>(e,r,n,o)=>{t(e,r,n)&&o(e,i,r,n)},rr=(i,t)=>(e,r,n,o)=>{const s=[];let a=e.pos;for(;t(e,r,n);){const l={};if(o(e,i,r,l),e.pos===a)break;a=e.pos,s.push(l)}return s},nr=i=>({data:i,pos:0}),tt=()=>i=>i.data[i.pos++],me=(i=0)=>t=>t.data[t.pos+i],at=i=>t=>t.data.subarray(t.pos,t.pos+=i),Mt=i=>t=>t.data.subarray(t.pos,t.pos+i),Ht=i=>t=>Array.from(at(i)(t)).map(e=>String.fromCharCode(e)).join(""),mt=i=>t=>{const e=at(2)(t);return i?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]},ve=(i,t)=>(e,r,n)=>{const o=typeof t=="function"?t(e,r,n):t,s=at(i),a=new Array(o);for(var l=0;l<o;l++)a[l]=s(e);return a},or=(i,t,e)=>{for(var r=0,n=0;n<e;n++)r+=i[t+n]&&2**(e-n-1);return r},Zt=i=>t=>{const e=tt()(t),r=new Array(8);for(var n=0;n<8;n++)r[7-n]=!!(e&1<<n);return Object.keys(i).reduce((o,s)=>{const a=i[s];return a.length?o[s]=or(r,a.index,a.length):o[s]=r[a.index],o},{})};var Ft={blocks:i=>{const e=[],r=i.data.length;for(var n=0,o=tt()(i);o!==0&&o;o=tt()(i)){if(i.pos+o>=r){const c=r-i.pos;e.push(at(c)(i)),n+=c;break}e.push(at(o)(i)),n+=o}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 ir=bt({gce:[{codes:at(2)},{byteSize:tt()},{extras:Zt({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:mt(!0)},{transparentColorIndex:tt()},{terminator:tt()}]},i=>{var t=Mt(2)(i);return t[0]===33&&t[1]===249}),sr=bt({image:[{code:tt()},{descriptor:[{left:mt(!0)},{top:mt(!0)},{width:mt(!0)},{height:mt(!0)},{lct:Zt({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},bt({lct:ve(3,(i,t,e)=>Math.pow(2,e.descriptor.lct.size+1))},(i,t,e)=>e.descriptor.lct.exists),{data:[{minCodeSize:tt()},Ft]}]},i=>me()(i)===44),ar=bt({text:[{codes:at(2)},{blockSize:tt()},{preData:(i,t,e)=>at(e.text.blockSize)(i)},Ft]},i=>{var t=Mt(2)(i);return t[0]===33&&t[1]===1}),lr=bt({application:[{codes:at(2)},{blockSize:tt()},{id:(i,t,e)=>Ht(e.blockSize)(i)},Ft]},i=>{var t=Mt(2)(i);return t[0]===33&&t[1]===255}),cr=bt({comment:[{codes:at(2)},Ft]},i=>{var t=Mt(2)(i);return t[0]===33&&t[1]===254}),fr=[{header:[{signature:Ht(3)},{version:Ht(3)}]},{lsd:[{width:mt(!0)},{height:mt(!0)},{gct:Zt({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:tt()},{pixelAspectRatio:tt()}]},bt({gct:ve(3,(i,t)=>Math.pow(2,t.lsd.gct.size+1))},(i,t)=>t.lsd.gct.exists),{frames:rr([ir,lr,cr,sr,ar],i=>{var t=me()(i);return t===33||t===44})}],ur=(i,t)=>{const e=new Array(i.length),r=i.length/t,n=function(u,h){const b=i.slice(h*t,(h+1)*t);e.splice.apply(e,[u*t,t].concat(b))},o=[0,4,2,1],s=[8,8,4,2];for(var a=0,l=0;l<4;l++)for(var c=o[l];c<r;c+=s[l])n(c,a),a++;return e},hr=(i,t,e)=>{const o=e;var s,a,l,c,u,h,b,y,x,k,d,D,m,w,T,P;const U=new Array(e),g=new Array(4096),p=new Array(4096),A=new Array(4097);for(D=i,a=1<<D,u=a+1,s=a+2,b=-1,c=D+1,l=(1<<c)-1,x=0;x<a;x++)g[x]=0,p[x]=x;var d,y,m,w,P,T;for(d=y=m=w=P=T=0,k=0;k<o;){if(w===0){if(y<c){d+=t[T]<<y,y+=8,T++;continue}if(x=d&l,d>>=c,y-=c,x>s||x==u)break;if(x==a){c=D+1,l=(1<<c)-1,s=a+2,b=-1;continue}if(b==-1){A[w++]=p[x],b=x,m=x;continue}for(h=x,x==s&&(A[w++]=m,x=b);x>a;)A[w++]=p[x],x=g[x];m=p[x]&255,A[w++]=m,s<4096&&(g[s]=b,p[s]=m,s++,!(s&l)&&s<4096&&(c++,l+=s)),b=h}w--,U[P++]=A[w],k++}for(k=P;k<o;k++)U[k]=0;return U},dr=i=>{const t=new Uint8Array(i);return _t(nr(t),fr)},gr=i=>{const t=i.pixels.length,e=new Uint8ClampedArray(t*4);for(var r=0;r<t;r++){const n=r*4,o=i.pixels[r],s=i.colorTable[o];e[n]=s[0],e[n+1]=s[1],e[n+2]=s[2],e[n+3]=o!==i.transparentIndex?255:0}return e},pr=(i,t,e)=>{if(!i.image){console.warn("gif frame does not have associated image.");return}const{image:r}=i,n=r.descriptor.width*r.descriptor.height;var o=hr(r.data.minCodeSize,r.data.blocks,n);r.descriptor.lct.interlaced&&(o=ur(o,r.descriptor.width));const s={pixels:o,dims:{top:i.image.descriptor.top,left:i.image.descriptor.left,width:i.image.descriptor.width,height:i.image.descriptor.height}};return r.descriptor.lct&&r.descriptor.lct.exists?s.colorTable=r.lct:s.colorTable=t,i.gce&&(s.delay=(i.gce.delay||10)*10,s.disposalType=i.gce.extras.disposal,i.gce.extras.transparentColorGiven&&(s.transparentIndex=i.gce.transparentColorIndex)),e&&(s.patch=gr(s)),s},mr=(i,t)=>i.frames.filter(e=>e.image).map(e=>pr(e,i.gct,t));function vr(i,t,e){const r=be(t),n=i-1;let o=0;switch(e){case W.L:o=st[n][0];break;case W.M:o=st[n][1];break;case W.Q:o=st[n][2];break;case W.H:o=st[n][3];break}return r<=o}function br(i,t){for(var e=1,r=be(i),n=0,o=st.length;n<o;n++){var s=0;switch(t){case W.L:s=st[n][0];break;case W.M:s=st[n][1];break;case W.Q:s=st[n][2];break;case W.H:s=st[n][3];break}if(r<=s)break;e++}if(e>st.length)throw new Error("Too long data");return e}function be(i){var t=encodeURI(i).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(i)?3:0)}class yr{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 o=[],s=this.data.charCodeAt(r);s>65536?(o[0]=240|(s&1835008)>>>18,o[1]=128|(s&258048)>>>12,o[2]=128|(s&4032)>>>6,o[3]=128|s&63):s>2048?(o[0]=224|(s&61440)>>>12,o[1]=128|(s&4032)>>>6,o[2]=128|s&63):s>128?(o[0]=192|(s&1984)>>>6,o[1]=128|s&63):o[0]=s,e.push(o)}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=W.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=br(t,this.errorCorrectLevel);else{if(this.typeNumber>40)throw new Error(`Invalid QR version: ${this.typeNumber}`);if(!vr(this.typeNumber,t,this.errorCorrectLevel))throw new Error(`Data is too long for QR version: ${this.typeNumber}`)}const e=new yr(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=L.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=L.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let r=0;r<t.length;r++){const n=t[e],o=t[r];if(this.modules[n][o]==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][o+a]=!0:this.modules[n+s][o+a]=!1}}setupTypeNumber(t){const e=L.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=L.getBCHTypeInfo(r);for(var o=0;o<15;o++){var s=!t&&(n>>o&1)==1;o<6?this.modules[o][8]=s:o<8?this.modules[o+1][8]=s:this.modules[this.moduleCount-15+o][8]=s}for(var o=0;o<15;o++){var s=!t&&(n>>o&1)==1;o<8?this.modules[8][this.moduleCount-o-1]=s:o<9?this.modules[8][15-o-1+1]=s:this.modules[8][15-o-1]=s}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let r=-1,n=this.moduleCount-1,o=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]>>>o&1)==1),L.getMask(e,n,a-l)&&(c=!c),this.modules[n][a-l]=c,o--,o==-1&&(s++,o=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}static createData(t,e,r){const n=ft.getRSBlocks(t,e),o=new wr;for(var s=0;s<r.length;s++){const l=r[s];o.put(l.mode,4),o.put(l.getLength(),L.getLengthInBits(l.mode,t)),l.write(o)}let a=0;for(var s=0;s<n.length;s++)a+=n[s].dataCount;if(o.getLengthInBits()>a*8)throw new Error(`code length overflow. (${o.getLengthInBits()}>${a*8})`);for(o.getLengthInBits()+4<=a*8&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=a*8||(o.put(dt.PAD0,8),o.getLengthInBits()>=a*8));)o.put(dt.PAD1,8);return dt.createBytes(o,n)}static createBytes(t,e){let r=0,n=0,o=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,k=e[l].totalCount-x;n=Math.max(n,x),o=Math.max(o,k),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 D=L.getErrorCorrectPolynomial(k),g=new xt(s[l],D.getLength()-1).mod(D);a[l]=new Array(D.getLength()-1);for(var c=0;c<a[l].length;c++){const A=c+g.getLength()-a[l].length;a[l][c]=A>=0?g.get(A):0}}let u=0;for(var c=0;c<e.length;c++)u+=e[c].totalCount;const h=new Array(u);let b=0;for(var c=0;c<n;c++)for(var l=0;l<e.length;l++)c<s[l].length&&(h[b++]=s[l][c]);for(var c=0;c<o;c++)for(var l=0;l<e.length;l++)c<a[l].length&&(h[b++]=a[l][c]);return h}}dt.PAD0=236;dt.PAD1=17;const W={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 L{static getBCHTypeInfo(t){let e=t<<10;for(;L.getBCHDigit(e)-L.getBCHDigit(L.G15)>=0;)e^=L.G15<<L.getBCHDigit(e)-L.getBCHDigit(L.G15);return(t<<10|e)^L.G15_MASK}static getBCHTypeNumber(t){let e=t<<12;for(;L.getBCHDigit(e)-L.getBCHDigit(L.G18)>=0;)e^=L.G18<<L.getBCHDigit(e)-L.getBCHDigit(L.G18);return t<<12|e}static getBCHDigit(t){let e=0;for(;t!=0;)e++,t>>>=1;return e}static getPatternPosition(t){return L.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 xt([1],0);for(let r=0;r<t;r++)e=e.multiply(new xt([1,G.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 o=0;o<e;o++){let l=0;const c=t.isDark(n,o);for(let u=-1;u<=1;u++)if(!(n+u<0||e<=n+u))for(let h=-1;h<=1;h++)o+h<0||e<=o+h||u==0&&h==0||c==t.isDark(n+u,o+h)&&l++;l>5&&(r+=3+l-5)}for(var n=0;n<e-1;n++)for(var o=0;o<e-1;o++){let u=0;t.isDark(n,o)&&u++,t.isDark(n+1,o)&&u++,t.isDark(n,o+1)&&u++,t.isDark(n+1,o+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<e;n++)for(var o=0;o<e-6;o++)t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(r+=40);for(var o=0;o<e;o++)for(var n=0;n<e-6;n++)t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(r+=40);let s=0;for(var o=0;o<e;o++)for(var n=0;n<e;n++)t.isDark(n,o)&&s++;const a=Math.abs(100*s/e/e-50)/5;return r+=a*10,r}}L.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]];L.G15=1335;L.G18=7973;L.G15_MASK=21522;class G{static glog(t){if(t<1)throw new Error(`glog(${t})`);return G.LOG_TABLE[t]}static gexp(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return G.EXP_TABLE[t]}}G.EXP_TABLE=new Array(256);G.LOG_TABLE=new Array(256);G._constructor=function(){for(var i=0;i<8;i++)G.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)G.EXP_TABLE[i]=G.EXP_TABLE[i-4]^G.EXP_TABLE[i-5]^G.EXP_TABLE[i-6]^G.EXP_TABLE[i-8];for(var i=0;i<255;i++)G.LOG_TABLE[G.EXP_TABLE[i]]=i}();class xt{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]^=G.gexp(G.glog(this.get(r))+G.glog(t.get(n)));return new xt(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=G.glog(this.get(0))-G.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]^=G.gexp(G.glog(t.get(n))+e);return new xt(r,0).mod(t)}}class ft{constructor(t,e){this.totalCount=t,this.dataCount=e}static getRSBlocks(t,e){const r=ft.getRsBlockTable(t,e);if(r==null)throw new Error(`bad rs block @ typeNumber:${t}/errorCorrectLevel:${e}`);const n=r.length/3,o=[];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 u=0;u<a;u++)o.push(new ft(l,c))}return o}static getRsBlockTable(t,e){switch(e){case W.L:return ft.RS_BLOCK_TABLE[(t-1)*4+0];case W.M:return ft.RS_BLOCK_TABLE[(t-1)*4+1];case W.Q:return ft.RS_BLOCK_TABLE[(t-1)*4+2];case W.H:return ft.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}ft.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 Cr=100,X=256,oe=X-1,ht=4,ye=16,Vt=1<<ye,we=10,Jt=10,xr=Vt>>Jt,Ar=Vt<<we-Jt,Pr=X>>3,Kt=6,_r=1<<Kt,Br=Pr*_r,kr=30,Ce=10,Dt=1<<Ce,xe=8,ie=1<<xe,Dr=Ce+xe,yt=1<<Dr,se=499,ae=491,le=487,Ae=503,Tr=3*Ae;function Er(i,t){var e,r,n,o,s;function a(){e=[],r=new Int32Array(256),n=new Int32Array(X),o=new Int32Array(X),s=new Int32Array(X>>3);var g,p;for(g=0;g<X;g++)p=(g<<ht+8)/X,e[g]=new Float64Array([p,p,p,0]),o[g]=Vt/X,n[g]=0}function l(){for(var g=0;g<X;g++)e[g][0]>>=ht,e[g][1]>>=ht,e[g][2]>>=ht,e[g][3]=g}function c(g,p,A,d,y){e[p][0]-=g*(e[p][0]-A)/Dt,e[p][1]-=g*(e[p][1]-d)/Dt,e[p][2]-=g*(e[p][2]-y)/Dt}function u(g,p,A,d,y){for(var m=Math.abs(p-g),w=Math.min(p+g,X),P=p+1,T=p-1,M=1,f,F;P<w||T>m;)F=s[M++],P<w&&(f=e[P++],f[0]-=F*(f[0]-A)/yt,f[1]-=F*(f[1]-d)/yt,f[2]-=F*(f[2]-y)/yt),T>m&&(f=e[T--],f[0]-=F*(f[0]-A)/yt,f[1]-=F*(f[1]-d)/yt,f[2]-=F*(f[2]-y)/yt)}function h(g,p,A){var d=2147483647,y=d,m=-1,w=m,P,T,M,f,F;for(P=0;P<X;P++)T=e[P],M=Math.abs(T[0]-g)+Math.abs(T[1]-p)+Math.abs(T[2]-A),M<d&&(d=M,m=P),f=M-(n[P]>>ye-ht),f<y&&(y=f,w=P),F=o[P]>>Jt,o[P]-=F,n[P]+=F<<we;return o[m]+=xr,n[m]-=Ar,w}function b(){var g,p,A,d,y,m,w=0,P=0;for(g=0;g<X;g++){for(A=e[g],y=g,m=A[1],p=g+1;p<X;p++)d=e[p],d[1]<m&&(y=p,m=d[1]);if(d=e[y],g!=y&&(p=d[0],d[0]=A[0],A[0]=p,p=d[1],d[1]=A[1],A[1]=p,p=d[2],d[2]=A[2],A[2]=p,p=d[3],d[3]=A[3],A[3]=p),m!=w){for(r[w]=P+g>>1,p=w+1;p<m;p++)r[p]=g;w=m,P=g}}for(r[w]=P+oe>>1,p=w+1;p<256;p++)r[p]=oe}function x(g,p,A){for(var d,y,m,w=1e3,P=-1,T=r[p],M=T-1;T<X||M>=0;)T<X&&(y=e[T],m=y[1]-p,m>=w?T=X:(T++,m<0&&(m=-m),d=y[0]-g,d<0&&(d=-d),m+=d,m<w&&(d=y[2]-A,d<0&&(d=-d),m+=d,m<w&&(w=m,P=y[3])))),M>=0&&(y=e[M],m=p-y[1],m>=w?M=-1:(M--,m<0&&(m=-m),d=y[0]-g,d<0&&(d=-d),m+=d,m<w&&(d=y[2]-A,d<0&&(d=-d),m+=d,m<w&&(w=m,P=y[3]))));return P}function k(){var g,p=i.length,A=30+(t-1)/3,d=p/(3*t),y=~~(d/Cr),m=Dt,w=Br,P=w>>Kt;for(P<=1&&(P=0),g=0;g<P;g++)s[g]=m*((P*P-g*g)*ie/(P*P));var T;p<Tr?(t=1,T=3):p%se!==0?T=3*se:p%ae!==0?T=3*ae:p%le!==0?T=3*le:T=3*Ae;var M,f,F,C,N=0;for(g=0;g<d;)if(M=(i[N]&255)<<ht,f=(i[N+1]&255)<<ht,F=(i[N+2]&255)<<ht,C=h(M,f,F),c(m,C,M,f,F),P!==0&&u(P,C,M,f,F),N+=T,N>=p&&(N-=p),g++,y===0&&(y=1),g%y===0)for(m-=m/A,w-=w/kr,P=w>>Kt,P<=1&&(P=0),C=0;C<P;C++)s[C]=m*((P*P-C*C)*ie/(P*P))}function D(){a(),k(),l(),b()}this.buildColormap=D;function U(){for(var g=[],p=[],A=0;A<X;A++)p[e[A][3]]=A;for(var d=0,y=0;y<X;y++){var m=p[y];g[d++]=e[m][0],g[d++]=e[m][1],g[d++]=e[m][2]}return g}this.getColormap=U,this.lookupRGB=x}var ce=-1,Tt=12,Pt=5003,Sr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function Ir(i,t,e,r){var n=Math.max(2,r),o=new Uint8Array(256),s=new Int32Array(Pt),a=new Int32Array(Pt),l,c=0,u,h=0,b,x=!1,k,D,U,g,p,A;function d(C,N){o[u++]=C,u>=254&&T(N)}function y(C){m(Pt),h=D+2,x=!0,F(D,C)}function m(C){for(var N=0;N<C;++N)s[N]=-1}function w(C,N){var v,gt,j,et,ut,H,rt;for(k=C,x=!1,A=k,b=M(A),D=1<<C-1,U=D+1,h=D+2,u=0,et=f(),rt=0,v=Pt;v<65536;v*=2)++rt;rt=8-rt,H=Pt,m(H),F(D,N);t:for(;(gt=f())!=ce;){if(v=(gt<<Tt)+et,j=gt<<rt^et,s[j]===v){et=a[j];continue}else if(s[j]>=0){ut=H-j,j===0&&(ut=1);do if((j-=ut)<0&&(j+=H),s[j]===v){et=a[j];continue t}while(s[j]>=0)}F(et,N),et=gt,h<1<<Tt?(a[j]=h++,s[j]=v):y(N)}F(et,N),F(U,N)}function P(C){C.writeByte(n),g=i*t,p=0,w(n+1,C),C.writeByte(0)}function T(C){u>0&&(C.writeByte(u),C.writeBytes(o,0,u),u=0)}function M(C){return(1<<C)-1}function f(){if(g===0)return ce;--g;var C=e[p++];return C&255}function F(C,N){for(l&=Sr[c],c>0?l|=C<<c:l=C,c+=A;c>=8;)d(l&255,N),l>>=8,c-=8;if((h>b||x)&&(x?(b=M(A=k),x=!1):(++A,A==Tt?b=1<<Tt:b=M(A))),C==U){for(;c>0;)d(l&255,N),l>>=8,c-=8;T(N)}}this.encode=P}function q(){this.page=-1,this.pages=[],this.newPage()}q.pageSize=4096;q.charMap={};for(var Et=0;Et<256;Et++)q.charMap[Et]=String.fromCharCode(Et);q.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(q.pageSize),this.cursor=0};q.prototype.getData=function(){for(var i="",t=0;t<this.pages.length;t++)for(var e=0;e<q.pageSize;e++)i+=q.charMap[this.pages[t][e]];return i};q.prototype.toFlattenUint8Array=function(){const i=[];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));i.push(r)}else i.push(this.pages[t]);const e=new Uint8Array(i.reduce((r,n)=>r+n.length,0));return i.reduce((r,n)=>(e.set(n,r),r+n.length),0),e};q.prototype.writeByte=function(i){this.cursor>=q.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=i};q.prototype.writeUTFBytes=function(i){for(var t=i.length,e=0;e<t;e++)this.writeByte(i.charCodeAt(e))};q.prototype.writeBytes=function(i,t,e){for(var r=e||i.length,n=t||0;n<r;n++)this.writeByte(i[n])};function O(i,t){this.width=~~i,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 q}O.prototype.setDelay=function(i){this.delay=Math.round(i/10)};O.prototype.setFrameRate=function(i){this.delay=Math.round(100/i)};O.prototype.setDispose=function(i){i>=0&&(this.dispose=i)};O.prototype.setRepeat=function(i){this.repeat=i};O.prototype.setTransparent=function(i){this.transparent=i};O.prototype.addFrame=function(i){this.image=i,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};O.prototype.finish=function(){this.out.writeByte(59)};O.prototype.setQuality=function(i){i<1&&(i=1),this.sample=i};O.prototype.setDither=function(i){i===!0&&(i="FloydSteinberg"),this.dither=i};O.prototype.setGlobalPalette=function(i){this.globalPalette=i};O.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};O.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};O.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new Er(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))};O.prototype.indexPixels=function(i){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}};O.prototype.ditherPixels=function(i,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(!i||!e[i])throw"Unknown dithering kernel: "+i;var r=e[i],n=0,o=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<o;c++){t&&(l=l*-1);for(var u=l==1?0:s-1,h=l==1?s:0;u!==h;u+=l){n=c*s+u;var b=n*3,x=a[b],k=a[b+1],D=a[b+2];b=this.findClosestRGB(x,k,D),this.usedEntry[b]=!0,this.indexedPixels[n]=b,b*=3;for(var U=this.colorTab[b],g=this.colorTab[b+1],p=this.colorTab[b+2],A=x-U,d=k-g,y=D-p,m=l==1?0:r.length-1,w=l==1?r.length:0;m!==w;m+=l){var P=r[m][1],T=r[m][2];if(P+u>=0&&P+u<s&&T+c>=0&&T+c<o){var M=r[m][0];b=n+P+T*s,b*=3,a[b]=Math.max(0,Math.min(255,a[b]+A*M)),a[b+1]=Math.max(0,Math.min(255,a[b+1]+d*M)),a[b+2]=Math.max(0,Math.min(255,a[b+2]+y*M))}}}}};O.prototype.findClosest=function(i,t){return this.findClosestRGB((i&16711680)>>16,(i&65280)>>8,i&255,t)};O.prototype.findClosestRGB=function(i,t,e,r){if(this.colorTab===null)return-1;if(this.neuQuant&&!r)return this.neuQuant.lookupRGB(i,t,e);for(var n=0,o=256*256*256,s=this.colorTab.length,a=0,l=0;a<s;l++){var c=i-(this.colorTab[a++]&255),u=t-(this.colorTab[a++]&255),h=e-(this.colorTab[a++]&255),b=c*c+u*u+h*h;(!r||this.usedEntry[l])&&b<o&&(o=b,n=l)}return n};O.prototype.getImagePixels=function(){var i=this.width,t=this.height;this.pixels=new Uint8Array(i*t*3);for(var e=this.image,r=0,n=0,o=0;o<t;o++)for(var s=0;s<i;s++)this.pixels[n++]=e[r++],this.pixels[n++]=e[r++],this.pixels[n++]=e[r++],r++};O.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4);var i,t;this.transparent===null?(i=0,t=0):(i=1,t=2),this.dispose>=0&&(t=this.dispose&7),t<<=2,this.out.writeByte(0|t|0|i),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};O.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)};O.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)};O.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)};O.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var i=3*256-this.colorTab.length,t=0;t<i;t++)this.out.writeByte(0)};O.prototype.writeShort=function(i){this.out.writeByte(i&255),this.out.writeByte(i>>8&255)};O.prototype.writePixels=function(){var i=new Ir(this.width,this.height,this.indexedPixels,this.colorDepth);i.encode(this.out)};O.prototype.stream=function(){return this.out};var Lr=function(i,t,e,r){function n(o){return o instanceof e?o:new e(function(s){s(o)})}return new(e||(e=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(h){s(h)}}function l(u){try{c(r.throw(u))}catch(h){s(h)}}function c(u){u.done?o(u.value):n(u.value).then(a,l)}c((r=r.apply(i,t||[])).next())})};const{Canvas:lt}=er,St=.4;function fe(i){if(!i)return;function t(e){e.onload=null,e.onerror=null}return new Promise(function(e,r){if(i.slice(0,4)=="data"){let o=new Image;o.onload=function(){e(o),t(o)},o.onerror=function(){r("Image load error"),t(o)},o.src=i;return}let n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){e(n)},n.onerror=function(){r("Image load error")},n.src=i})}class I{constructor(t){const e=Object.assign({},t);if(Object.keys(I.defaultOptions).forEach(r=>{r in e||Object.defineProperty(e,r,{value:I.defaultOptions[r],enumerable:!0,writable:!0})}),e.components?typeof e.components=="object"&&Object.keys(I.defaultComponentOptions).forEach(r=>{r in e.components?Object.defineProperty(e.components,r,{value:Object.assign(Object.assign({},I.defaultComponentOptions[r]),e.components[r]),enumerable:!0,writable:!0}):Object.defineProperty(e.components,r,{value:I.defaultComponentOptions[r],enumerable:!0,writable:!0})}):e.components=I.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,o,s){t.beginPath(),t.moveTo(e,r),t.arcTo(e+n,r,e+n,r+o,s),t.arcTo(e+n,r+o,e,r+o,s),t.arcTo(e,r+o,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,o,s=-4;const a={r:0,g:0,b:0};let l=0;o=t.naturalHeight||t.height,n=t.naturalWidth||t.width;const u=new lt(n,o).getContext("2d");if(!u)return r;u.drawImage(t,0,0);let h;try{h=u.getImageData(0,0,n,o)}catch{return r}for(;(s+=5*4)<h.data.length;)h.data[s]>200||h.data[s+1]>200||h.data[s+2]>200||(++l,a.r+=h.data[s],a.g+=h.data[s+1],a.b+=h.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,o=0,s=1){t.fillRect((e+o)*n,(r+o)*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,o=0,s=1,a,l){const c=t.fillStyle;t.fillStyle=a,new Array(4).fill(0).map((u,h)=>{I._drawDot(t,e-2+h,r-2,n,o,s),I._drawDot(t,e+2,r-2+h,n,o,s),I._drawDot(t,e+2-h,r+2,n,o,s),I._drawDot(t,e-2,r+2-h,n,o,s)}),I._drawDot(t,e,r,n,o,s),l||(t.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((u,h)=>{I._drawDot(t,e-1+h,r-1,n,o,s),I._drawDot(t,e+1,r-1+h,n,o,s),I._drawDot(t,e+1-h,r+1,n,o,s),I._drawDot(t,e-1,r+1-h,n,o,s)})),t.fillStyle=c}_draw(){var t,e,r,n,o,s,a,l,c,u,h,b,x,k,D,U,g,p,A;return Lr(this,void 0,void 0,function*(){const d=(t=this.qrCode)===null||t===void 0?void 0:t.moduleCount,y=this.options.size;let m=this.options.margin;(m<0||m*2>=y)&&(m=0);const w=Math.ceil(m),P=y-2*m,T=this.options.whiteMargin,M=this.options.backgroundDimming,f=Math.ceil(P/d),F=f*d,C=F+2*w,N=new lt(C,C),v=N.getContext("2d");this._clear(),v.save(),v.translate(w,w);const gt=new lt(C,C),j=gt.getContext("2d");let et=null,ut=[];if(this.options.gifBackground){const _=dr(this.options.gifBackground);if(et=_,ut=mr(_,!0),this.options.autoColor){let B=0,E=0,S=0,K=0;for(let R=0;R<ut[0].colorTable.length;R++){const $=ut[0].colorTable[R];$[0]>200||$[1]>200||$[2]>200||$[0]===0&&$[1]===0&&$[2]===0||(K++,B+=$[0],E+=$[1],S+=$[2])}B=~~(B/K),E=~~(E/K),S=~~(S/K),this.options.colorDark=`rgb(${B},${E},${S})`}}else if(this.options.backgroundImage){const _=yield fe(this.options.backgroundImage);if(this.options.autoColor){const B=I._getAverageRGB(_);this.options.colorDark=`rgb(${B.r},${B.g},${B.b})`}j.drawImage(_,0,0,_.width,_.height,0,0,C,C),j.rect(0,0,C,C),j.fillStyle=M,j.fill()}else j.rect(0,0,C,C),j.fillStyle=this.options.colorLight,j.fill();const H=L.getPatternPosition(this.qrCode.typeNumber),rt=((r=(e=this.options.components)===null||e===void 0?void 0:e.data)===null||r===void 0?void 0:r.scale)||St,Wt=(1-rt)*.5;for(let _=0;_<d;_++)for(let B=0;B<d;B++){const E=this.qrCode.isDark(_,B),S=B<8&&(_<8||_>=d-8)||B>=d-8&&_<8,K=_==6&&B>=8&&B<=d-8||B==6&&_>=8&&_<=d-8;let R=S||K;for(let V=1;V<H.length-1;V++)R=R||_>=H[V]-2&&_<=H[V]+2&&B>=H[V]-2&&B<=H[V]+2;const $=B*f+(R?0:Wt*f),nt=_*f+(R?0:Wt*f);if(v.strokeStyle=E?this.options.colorDark:this.options.colorLight,v.lineWidth=.5,v.fillStyle=E?this.options.colorDark:this.options.colorLight,H.length===0)R||v.fillRect($,nt,(R?1:rt)*f,(R?1:rt)*f);else{const V=B<d-4&&B>=d-4-5&&_<d-4&&_>=d-4-5;!R&&!V&&v.fillRect($,nt,(R?1:rt)*f,(R?1:rt)*f)}}const Q=H[H.length-1],Pe=this.options.colorLight;if(v.fillStyle=Pe,v.fillRect(0,0,8*f,8*f),v.fillRect(0,(d-8)*f,8*f,8*f),v.fillRect((d-8)*f,0,8*f,8*f),!((o=(n=this.options.components)===null||n===void 0?void 0:n.timing)===null||o===void 0)&&o.protectors&&(v.fillRect(8*f,6*f,(d-8-8)*f,f),v.fillRect(6*f,8*f,f,(d-8-8)*f)),!((a=(s=this.options.components)===null||s===void 0?void 0:s.cornerAlignment)===null||a===void 0)&&a.protectors&&I._drawAlignProtector(v,Q,Q,f),!((c=(l=this.options.components)===null||l===void 0?void 0:l.alignment)===null||c===void 0)&&c.protectors)for(let _=0;_<H.length;_++)for(let B=0;B<H.length;B++){const E=H[B],S=H[_];if(!(E===6&&(S===6||S===Q))){if(S===6&&(E===6||E===Q))continue;if(E===Q&&S===Q)continue;I._drawAlignProtector(v,E,S,f)}}v.fillStyle=this.options.colorDark,v.fillRect(0,0,7*f,f),v.fillRect((d-7)*f,0,7*f,f),v.fillRect(0,6*f,7*f,f),v.fillRect((d-7)*f,6*f,7*f,f),v.fillRect(0,(d-7)*f,7*f,f),v.fillRect(0,(d-7+6)*f,7*f,f),v.fillRect(0,0,f,7*f),v.fillRect(6*f,0,f,7*f),v.fillRect((d-7)*f,0,f,7*f),v.fillRect((d-7+6)*f,0,f,7*f),v.fillRect(0,(d-7)*f,f,7*f),v.fillRect(6*f,(d-7)*f,f,7*f),v.fillRect(2*f,2*f,3*f,3*f),v.fillRect((d-7+2)*f,2*f,3*f,3*f),v.fillRect(2*f,(d-7+2)*f,3*f,3*f);const Nt=((h=(u=this.options.components)===null||u===void 0?void 0:u.timing)===null||h===void 0?void 0:h.scale)||St,qt=(1-Nt)*.5;for(let _=0;_<d-8;_+=2)I._drawDot(v,8+_,6,f,qt,Nt),I._drawDot(v,6,8+_,f,qt,Nt);const Yt=((x=(b=this.options.components)===null||b===void 0?void 0:b.cornerAlignment)===null||x===void 0?void 0:x.scale)||St,_e=(1-Yt)*.5;I._drawAlign(v,Q,Q,f,_e,Yt,this.options.colorDark,((D=(k=this.options.components)===null||k===void 0?void 0:k.cornerAlignment)===null||D===void 0?void 0:D.protectors)||!1);const Qt=((g=(U=this.options.components)===null||U===void 0?void 0:U.alignment)===null||g===void 0?void 0:g.scale)||St,Be=(1-Qt)*.5;for(let _=0;_<H.length;_++)for(let B=0;B<H.length;B++){const E=H[B],S=H[_];if(!(E===6&&(S===6||S===Q))){if(S===6&&(E===6||E===Q))continue;if(E===Q&&S===Q)continue;I._drawAlign(v,E,S,f,Be,Qt,this.options.colorDark,((A=(p=this.options.components)===null||p===void 0?void 0:p.alignment)===null||A===void 0?void 0:A.protectors)||!1)}}if(T&&(v.fillStyle=this.options.backgroundColor,v.fillRect(-w,-w,C,w),v.fillRect(-w,F,C,w),v.fillRect(F,-w,w,C),v.fillRect(-w,-w,w,C)),this.options.logoImage){const _=yield fe(this.options.logoImage);let B=this.options.logoScale,E=this.options.logoMargin,S=this.options.logoCornerRadius;(B<=0||B>=1)&&(B=.2),E<0&&(E=0),S<0&&(S=0);const K=F*B,R=.5*(C-K),$=R;v.restore(),v.fillStyle=this.options.logoBackgroundColor,v.save(),I._prepareRoundedCornerClip(v,R-E,$-E,K+2*E,K+2*E,S+E),v.clip();const nt=v.globalCompositeOperation;v.globalCompositeOperation="destination-out",v.fill(),v.globalCompositeOperation=nt,v.restore(),v.save(),I._prepareRoundedCornerClip(v,R,$,K,K,S),v.clip(),v.drawImage(_,R,$,K,K),v.restore(),v.save(),v.translate(w,w)}if(et){let _,B,E,S,K,R;if(ut.forEach(function($){_||(_=new O(y,y),_.setDelay($.delay),_.setRepeat(0));const{width:nt,height:V}=$.dims;B||(B=new lt(nt,V),E=B.getContext("2d"),E.rect(0,0,B.width,B.height),E.fillStyle="#ffffff",E.fill()),(!S||!R||nt!==S.width||V!==S.height)&&(S=new lt(nt,V),K=S.getContext("2d"),R=K.createImageData(nt,V)),R.data.set($.patch),K.putImageData(R,0,0),E.drawImage(S.getContext("2d").canvas,$.dims.left,$.dims.top);const Bt=new lt(C,C),At=Bt.getContext("2d");At.drawImage(B.getContext("2d").canvas,0,0,C,C),At.rect(0,0,C,C),At.fillStyle=M,At.fill(),At.drawImage(N.getContext("2d").canvas,0,0,C,C);const Ot=new lt(y,y),te=Ot.getContext("2d");te.drawImage(Bt.getContext("2d").canvas,0,0,y,y),_.addFrame(te.getImageData(0,0,Ot.width,Ot.height).data)}),!_)throw new Error("No frames.");if(_.finish(),ue(this.canvas)){const nt=_.stream().toFlattenUint8Array().reduce((V,Bt)=>V+String.fromCharCode(Bt),"");return Promise.resolve(`data:image/gif;base64,${window.btoa(nt)}`)}return Promise.resolve(Buffer.from(_.stream().toFlattenUint8Array()))}else{j.drawImage(N.getContext("2d").canvas,0,0,C,C),v.drawImage(gt.getContext("2d").canvas,-w,-w,C,C);const _=new lt(y,y);_.getContext("2d").drawImage(N.getContext("2d").canvas,0,0,y,y),this.canvas=_;const E=this.options.gifBackground?"gif":"png";return ue(this.canvas)?Promise.resolve(this.canvas.toDataURL(E)):Promise.resolve(this.canvas.toBuffer(E))}})}}I.CorrectLevel=W;I.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}};I.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:W.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:I.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"};function ue(i){try{return i instanceof HTMLElement}catch{return typeof i=="object"&&i.nodeType===1&&typeof i.style=="object"&&typeof i.ownerDocument=="object"}}const Mr={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 Le(this.gifBgSrc),r=this.logoSrc;this.render(void 0,r,e);return}const i=this.bgSrc,t=this.logoSrc;this.render(i,t)},async render(i,t,e){const r=this;new I({gifBackground:e,text:r.text,size:r.size,margin:r.margin,colorDark:r.colorDark,colorLight:r.colorLight,backgroundColor:r.backgroundColor,backgroundImage:i,backgroundDimming:r.backgroundDimming,logoImage:t,logoScale:r.logoScale,logoBackgroundColor:r.logoBackgroundColor,correctLevel:r.correctLevel,logoMargin:r.logoMargin,logoCornerRadius:r.logoCornerRadius,whiteMargin:$t(r.whiteMargin),dotScale:r.dotScale,autoColor:$t(r.autoColor),binarize:$t(r.binarize),binarizeThreshold:r.binarizeThreshold,components:r.components}).draw().then(n=>{this.imgUrl=n,r.callback&&r.callback(n,r.qid)})}}},Fr=["src"];function Nr(i,t,e,r,n,o){return e.bindElement?(pt(),wt("img",{key:0,style:{display:"inline-block"},src:n.imgUrl},null,8,Fr)):Ct("",!0)}const Or=he(Mr,[["render",Nr]]),Rr={class:"header-box"},$r=["src"],zr={class:"pay-box"},Ur={class:"left"},jr={class:"order-info"},Gr={class:"order-info-items"},Hr={class:"order-info-items"},Kr={class:"order-info-items"},Xr={class:"order-info-items"},Zr={class:"rmb-symbol"},Vr={class:"amount"},Jr={class:"pay_qr"},Wr=["srcdoc"],qr={key:2,class:"pay-success"},Yr={class:"qr-tips-content"},Qr={key:0},tn={key:1},en={class:"right"},rn=["src"],nn=De({__name:"pay",setup(i){const{t}=Te(),e=ke();return(r,n)=>{const o=Rt("Icon"),s=Rt("el-alert"),a=Rt("el-dialog");return pt(),wt("div",null,[kt(a,{modelValue:z(J).dialog.pay,"onUpdate:modelValue":n[0]||(n[0]=l=>z(J).dialog.pay=l),"close-on-press-escape":!1,"close-on-click-modal":!1,"destroy-on-close":!0,class:"pay-dialog",top:"20vh",width:"680px"},{default:ee(()=>[Z("div",null,[Z("div",Rr,[Z("img",{class:"pay-logo",src:"https://buildadmin.com/static/images/"+(z(J).common.payType=="wx"?"wechat-pay.png":"alipay.png"),alt:""},null,8,$r)]),Z("div",zr,[Z("div",Ur,[Z("div",jr,[Z("div",Gr,ot(z(t)("module.Order title"))+":"+ot(z(J).payInfo.info.title),1),Z("div",Hr,ot(z(t)("module.Order No"))+":"+ot(z(J).payInfo.info.sn),1),Z("div",Kr,ot(z(t)("module.Purchase user"))+":"+ot(z(Ie)(z(e))),1),Z("div",Xr,[Z("span",null,ot(z(t)("module.Order price"))+":",1),Z("span",Zr,[Ee(" ¥"),Z("span",Vr,ot(z(J).payInfo.info.amount),1)])])]),Z("div",Jr,[z(J).common.payType=="wx"?(pt(),Se(Or,{key:0,text:z(J).payInfo.pay.code_url,size:220,margin:0},null,8,["text"])):Ct("",!0),z(J).common.payType=="zfb"?(pt(),wt("iframe",{key:1,srcdoc:z(J).payInfo.pay.code_url,frameborder:"no",border:"0",marginwidth:"0",marginheight:"0",scrolling:"no",width:"220",height:"220",style:{overflow:"hidden"}},`
- `,8,Wr)):Ct("",!0),z(J).payInfo.pay.status=="success"?(pt(),wt("div",qr,[kt(o,{name:"fa fa-check",color:"var(--el-color-success)",size:"30"})])):Ct("",!0)]),kt(s,{class:"qr-tips",closable:!1,type:"success",center:""},{default:ee(()=>[Z("div",Yr,[kt(o,{color:"var(--el-color-success)",name:z(J).common.payType=="wx"?"fa fa-wechat":"fa fa-buysellads"},null,8,["name"]),z(J).common.payType=="wx"?(pt(),wt("span",Qr,ot(z(t)("module.Use WeChat to scan QR code for payment")),1)):Ct("",!0),z(J).common.payType=="zfb"?(pt(),wt("span",tn,ot(z(t)("module.Use Alipay to scan QR code for payment")),1)):Ct("",!0)])]),_:1})]),Z("div",en,[Z("img",{class:"pay-logo",src:"https://buildadmin.com/static/images/screenshot-"+(z(J).common.payType=="wx"?"wechat.png":"alipay.png"),alt:""},null,8,rn)])])])]),_:1},8,["modelValue"])])}}}),un=he(nn,[["__scopeId","data-v-301cdfd8"]]);export{un as default};
|