import{l as be,f as ye,j as Ce,k as Ae,v as Pe,b as ot,m as Be,w as De}from"./@vue_runtime-core@3.5.12-rIgKm_Vg.js";import{k as qt}from"./@vue_reactivity@3.5.12-Bs6EYLxJ.js";const ke={maskColor:{type:String,default:"rgba(255, 255, 255, 0.96)"},watchText:{type:Boolean,default:!0},status:{type:String},errorDescription:{type:[String,Object],default:"二维码已过期"},errorActionDescription:{type:String,default:"重新加载"},text:{type:String,required:!0},size:{type:Number,default:160},margin:{type:Number,default:12},correctLevel:{type:Number,default:1,validator:o=>[0,1,2,3].includes(o)},maskPattern:{type:Number},version:{type:Number},components:{type:Object,default:()=>({data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}})},colorDark:{type:String,default:"#000000"},colorLight:{type:String,default:"#ffffff"},autoColor:{type:Boolean,default:!0},backgroundImage:{type:String},backgroundDimming:{type:String,default:"rgba(0, 0, 0, 0)"},gifBackgroundURL:{type:String},gifBackground:{type:ArrayBuffer},whiteMargin:{type:Boolean,default:!0},logoImage:{type:String},logoScale:{type:Number,default:.4},logoMargin:{type:Number,default:6},logoCornerRadius:{type:Number,default:8},dotScale:{type:Number,default:1},onSuccess:{type:[Function,Array],default:null},onError:{type:[Function,Array],default:null},onReload:{type:[Function,Array],default:null}};function Te(o,t,e){const r=ne(t),i=o-1;let n=0;switch(e){case Z.L:n=rt[i][0];break;case Z.M:n=rt[i][1];break;case Z.Q:n=rt[i][2];break;case Z.H:n=rt[i][3];break}return r<=n}function Ee(o,t){for(var e=1,r=ne(o),i=0,n=rt.length;irt.length)throw new Error("Too long data");return e}function ne(o){var t=encodeURI(o).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(o)?3:0)}class Ie{constructor(t){this.mode=V.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;const e=[];for(let r=0,i=this.data.length;r65536?(n[0]=240|(s&1835008)>>>18,n[1]=128|(s&258048)>>>12,n[2]=128|(s&4032)>>>6,n[3]=128|s&63):s>2048?(n[0]=224|(s&61440)>>>12,n[1]=128|(s&4032)>>>6,n[2]=128|s&63):s>128?(n[0]=192|(s&1984)>>>6,n[1]=128|s&63):n[0]=s,e.push(n)}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;e40)throw new Error(`Invalid QR version: ${this.typeNumber}`);if(!Te(this.typeNumber,t,this.errorCorrectLevel))throw new Error(`Data is too long for QR version: ${this.typeNumber}`)}const e=new Ie(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=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=ht.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 i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=r&&r<=6&&(i==0||i==6)||0<=i&&i<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=i&&i<=4?this.modules[t+r][e+i]=!0:this.modules[t+r][e+i]=!1)}getBestMaskPattern(){if(Number.isInteger(this.maskPattern)&&Object.values(st).includes(this.maskPattern))return this.maskPattern;let t=0,e=0;for(let r=0;r<8;r++){this.makeImpl(!0,r);const i=L.getLostPoint(this);(r==0||t>i)&&(t=i,e=r)}return e}setupTimingPattern(){for(let t=8;t>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=i}for(var r=0;r<18;r++){var i=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=i}}setupTypeInfo(t,e){const r=this.errorCorrectLevel<<3|e,i=L.getBCHTypeInfo(r);for(var n=0;n<15;n++){var s=!t&&(i>>n&1)==1;n<6?this.modules[n][8]=s:n<8?this.modules[n+1][8]=s:this.modules[this.moduleCount-15+n][8]=s}for(var n=0;n<15;n++){var s=!t&&(i>>n&1)==1;n<8?this.modules[8][this.moduleCount-n-1]=s:n<9?this.modules[8][15-n-1+1]=s:this.modules[8][15-n-1]=s}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let r=-1,i=this.moduleCount-1,n=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[i][a-l]==null){let c=!1;s>>n&1)==1),L.getMask(e,i,a-l)&&(c=!c),this.modules[i][a-l]=c,n--,n==-1&&(s++,n=7)}if(i+=r,i<0||this.moduleCount<=i){i-=r,r=-r;break}}}static createData(t,e,r){const i=at.getRSBlocks(t,e),n=new xe;for(var s=0;sa*8)throw new Error(`code length overflow. (${n.getLengthInBits()}>${a*8})`);for(n.getLengthInBits()+4<=a*8&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=a*8||(n.put(ht.PAD0,8),n.getLengthInBits()>=a*8));)n.put(ht.PAD1,8);return ht.createBytes(n,i)}static createBytes(t,e){let r=0,i=0,n=0;const s=new Array(e.length),a=new Array(e.length);for(var l=0;l=0?g.get(P):0}}let u=0;for(var c=0;c=0;)e^=L.G15<=0;)e^=L.G18<>>=1;return e}static getPatternPosition(t){return L.PATTERN_POSITION_TABLE[t-1]}static getMask(t,e,r){switch(t){case st.PATTERN000:return(e+r)%2==0;case st.PATTERN001:return e%2==0;case st.PATTERN010:return r%3==0;case st.PATTERN011:return(e+r)%3==0;case st.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case st.PATTERN101:return e*r%2+e*r%3==0;case st.PATTERN110:return(e*r%2+e*r%3)%2==0;case st.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error(`bad maskPattern:${t}`)}}static getErrorCorrectPolynomial(t){let e=new vt([1],0);for(let r=0;r5&&(r+=3+l-5)}for(var i=0;i=256;)t-=255;return j.EXP_TABLE[t]}}j.EXP_TABLE=new Array(256);j.LOG_TABLE=new Array(256);j._constructor=function(){for(var o=0;o<8;o++)j.EXP_TABLE[o]=1<>>7-t%8&1)==1}put(t,e){for(let r=0;r>>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 rt=[[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]];function et(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function Vt(o,t){for(var e="",r=0,i=-1,n=0,s,a=0;a<=o.length;++a){if(a2){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("/")),i=a,n=0;continue}}else if(e.length===2||e.length===1){e="",r=0,i=a,n=0;continue}}t&&(e.length>0?e+="/..":e="..",r=2)}else e.length>0?e+="/"+o.slice(i+1,a):e=o.slice(i+1,a),r=a-i-1;i=a,n=0}else s===46&&n!==-1?++n:n=-1}return e}function Se(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 dt={resolve:function(){for(var t="",e=!1,r,i=arguments.length-1;i>=-1&&!e;i--){var n;i>=0?n=arguments[i]:(r===void 0&&(r=process.cwd()),n=r),et(n),n.length!==0&&(t=n+"/"+t,e=n.charCodeAt(0)===47)}return t=Vt(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(et(t),t.length===0)return".";var e=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=Vt(t,!e),t.length===0&&!e&&(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return et(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":dt.normalize(t)},relative:function(t,e){if(et(t),et(e),t===e||(t=dt.resolve(t),e=dt.resolve(e),t===e))return"";for(var r=1;rc){if(e.charCodeAt(s+f)===47)return e.slice(s+f+1);if(f===0)return e.slice(s+f)}else n>c&&(t.charCodeAt(r+f)===47?u=f:f===0&&(u=0));break}var v=t.charCodeAt(r+f),A=e.charCodeAt(s+f);if(v!==A)break;v===47&&(u=f)}var k="";for(f=r+u+1;f<=i;++f)(f===i||t.charCodeAt(f)===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(et(t),t.length===0)return".";for(var e=t.charCodeAt(0),r=e===47,i=-1,n=!0,s=t.length-1;s>=1;--s)if(e=t.charCodeAt(s),e===47){if(!n){i=s;break}}else n=!1;return i===-1?r?"/":".":r&&i===1?"//":t.slice(0,i)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');et(t);var r=0,i=-1,n=!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(!n){r=s+1;break}}else l===-1&&(n=!1,l=s+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(i=s):(a=-1,i=l))}return r===i?i=l:i===-1&&(i=t.length),t.slice(r,i)}else{for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!n){r=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":t.slice(r,i)}},extname:function(t){et(t);for(var e=-1,r=0,i=-1,n=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!n){r=a+1;break}continue}i===-1&&(n=!1,i=a+1),l===46?e===-1?e=a:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===r+1?"":t.slice(e,i)},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 Se("/",t)},parse:function(t){et(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var r=t.charCodeAt(0),i=r===47,n;i?(e.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,c=!0,u=t.length-1,f=0;u>=n;--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:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||l===-1||f===0||f===1&&s===l-1&&s===a+1?l!==-1&&(a===0&&i?e.base=e.name=t.slice(1,l):e.base=e.name=t.slice(a,l)):(a===0&&i?(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):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};dt.posix=dt;const _e=dt.extname,se=dt.basename;class Le{constructor(){let t=typeof global>"u",e="image/png",r="image/jpeg",i="image/jpeg",n="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:i,webp:n}:{png:e,jpg:r,jpeg:i,pdf:s,svg:a},mimes:t?{[e]:"png",[r]:"jpg",[n]:"webp"}:{[e]:"png",[r]:"jpg",[s]:"pdf",[a]:"svg"}})}toMime(t){return this.formats[(t||"").replace(/^\./,"").toLowerCase()]}fromMime(t){return this.mimes[t]}}function Me(o,{filename:t="",extension:e="",format:T,page:i,quality:n,matte:s,density:a,outline:l,archive:A}={}){var{fromMime:u,toMime:f,expected:v}=new Le,A=A||"canvas",k=T||e.replace(/@\d+x$/i,"")||_e(t),T=u(f(k)||k),M=f(T),g=o.length;if(!k)throw new Error("Cannot determine image format (use a filename extension or 'format' argument)");if(!T)throw new Error(`Unsupported file format "${k}" (expected ${v})`);if(!g)throw new RangeError("Canvas has no associated contexts (try calling getContext or newPage first)");let p,P,d=t.replace(/{(\d*)}/g,(m,y)=>(P=!0,y=parseInt(y,10),p=isFinite(y)?y:isFinite(p)?p:-1,"{}")),b=i>0?i-1:i<0?g+i:void 0;if(isFinite(b)&&b<0||b>=g)throw new RangeError(g==1?`Canvas only has a ‘page 1’ (${b} is out of bounds)`:`Canvas has pages 1–${g} (${b} is out of bounds)`);if(o=isFinite(b)?[o[b]]:P||T=="pdf"?o:o.slice(-1),n===void 0)n=.92;else if(typeof n!="number"||!isFinite(n)||n<0||n>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||se(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:T=="svg"&&(l=!!l),{filename:t,pattern:d,format:T,mime:M,pages:o,padding:p,quality:n,matte:s,density:a,outline:l,archive:A}}class kt{static for(t){return new kt().append(t).get()}constructor(){this.crc=-1}get(){return~this.crc}append(t){for(var e=this.crc|0,r=this.table,i=0,n=t.length|0;i>>8^r[(e^t[i])&255];return this.crc=e,this}}kt.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 _t(o){let t=new Uint8Array(o),e=new DataView(t.buffer),r={array:t,view:e,size:o,set8(i,n){return e.setUint8(i,n),r},set16(i,n){return e.setUint16(i,n,!0),r},set32(i,n){return e.setUint32(i,n,!0),r},bytes(i,n){return t.set(n,i),r}};return r}class Tt{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,i=Tt.encoder.encode(`${this.directory}/${r?"":t}`),n=new Uint8Array(r?0:await e.arrayBuffer()),s=30+i.length,a=s+n.length,l=16,{offset:c}=this,u=_t(26).set32(0,134742036).set16(6,this.time).set16(8,this.date).set32(10,kt.for(n)).set32(14,n.length).set32(18,n.length).set16(22,i.length);c+=s;let f=_t(s+n.length+l).set32(0,67324752).bytes(4,u.array).bytes(30,i).bytes(s,n);c+=n.length,f.set32(a,134695760).bytes(a+4,u.array.slice(10,22)),c+=l,this.files.push({offset:c,folder:r,name:i,header:u,payload:f}),this.offset=c}toBuffer(){let t=this.files.reduce((f,{name:v})=>46+v.length+f,0),e=_t(t+22),r=0;for(var{offset:i,name:n,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,i).bytes(r+46,n),r+=46+n.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"})}}Tt.encoder=new TextEncoder;const Ft=(o,t,e,r)=>{if(r){let{width:i,height:n}=o,s=Object.assign(document.createElement("canvas"),{width:i,height:n}),a=s.getContext("2d");a.fillStyle=r,a.fillRect(0,0,i,n),a.drawImage(o,0,0),o=s}return new Promise((i,n)=>o.toBlob(i,t,e))},Re=(...o)=>Ft(...o).then(t=>t.arrayBuffer()),Ne=async(o,t,e,r,i)=>{ae(i,await Ft(o,t,e,r))},Oe=async(o,t,e,r,i,n,s)=>{let a=u=>n.replace("{}",String(u+1).padStart(s,"0")),l=se(i,".zip")||"archive",c=new Tt(l);await Promise.all(o.map(async(u,f)=>{let v=a(f);await c.add(v,await Ft(u,t,e,r))})),ae(`${l}.zip`,c.blob)},ae=(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)},$e=(o,t,e)=>o.map(r=>{if(t==1&&!e)return r.canvas;let i=document.createElement("canvas"),n=i.getContext("2d"),s=r.canvas?r.canvas:r;return i.width=s.width*t,i.height=s.height*t,e&&(n.fillStyle=e,n.fillRect(0,0,i.width,i.height)),n.scale(t,t),n.drawImage(s,0,0),i}),Fe={asBuffer:Re,asDownload:Ne,asZipDownload:Oe,atScale:$e,options:Me},{asBuffer:Lt,asDownload:Ue,asZipDownload:Ge,atScale:Mt,options:Rt}=Fe,Jt=Symbol.for("toDataURL"),je=o=>new Promise((t,e)=>Object.assign(new le,{crossOrigin:"Anonymous",onload:t,onerror:e,src:o}));let ze=class{constructor(t,e){let r=document.createElement("canvas"),i=[];Object.defineProperty(r,"async",{value:!0,writable:!1,enumerable:!0});for(var[n,s]of Object.entries({png:()=>Lt(r,"image/png"),jpg:()=>Lt(r,"image/jpeg"),pages:()=>i.concat(r).map(a=>a.getContext("2d"))}))Object.defineProperty(r,n,{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),i.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=Rt(this.pages,{filename:a,...l}),{pattern:u,padding:f,mime:v,quality:A,matte:k,density:T,archive:M}=c,g=Mt(c.pages,T);return f==null?Ue(g[0],v,A,k,a):Ge(g,v,A,k,M,u,f)},toBuffer(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Rt(this.pages,{extension:a,...l}),{mime:u,quality:f,matte:v,pages:A,density:k}=c,T=Mt(A,k,v)[0];return Lt(T,u,f,v)},[Jt]:r.toDataURL.bind(r),toDataURL(a="png",l={}){l=typeof l=="number"?{quality:l}:l;let c=Rt(this.pages,{extension:a,...l}),{mime:u,quality:f,matte:v,pages:A,density:k}=c,T=Mt(A,k,v)[0],M=T[T===r?Jt:"toDataURL"](u,f);return Promise.resolve(M)}})}};const{CanvasRenderingContext2D:He,CanvasGradient:Ke,CanvasPattern:Xe,Image:le,ImageData:Ze,Path2D:qe,DOMMatrix:Ve,DOMRect:Je,DOMPoint:We}=window,Ye={Canvas:ze,loadImage:je,CanvasRenderingContext2D:He,CanvasGradient:Ke,CanvasPattern:Xe,Image:le,ImageData:Ze,Path2D:qe,DOMMatrix:Ve,DOMRect:Je,DOMPoint:We},bt=(o,t,e={},r=e)=>{if(Array.isArray(t))t.forEach(i=>bt(o,i,e,r));else if(typeof t=="function")t(o,e,r,bt);else{const i=Object.keys(t)[0];Array.isArray(t[i])?(r[i]={},bt(o,t[i],e,r[i])):r[i]=t[i](o,e,r,bt)}return e},gt=(o,t)=>(e,r,i,n)=>{t(e,r,i)&&n(e,o,r,i)},Qe=(o,t)=>(e,r,i,n)=>{const s=[];let a=e.pos;for(;t(e,r,i);){const l={};if(n(e,o,r,l),e.pos===a)break;a=e.pos,s.push(l)}return s},tr=o=>({data:o,pos:0}),W=()=>o=>o.data[o.pos++],ce=(o=0)=>t=>t.data[t.pos+o],it=o=>t=>t.data.subarray(t.pos,t.pos+=o),Et=o=>t=>t.data.subarray(t.pos,t.pos+o),Ot=o=>t=>Array.from(it(o)(t)).map(e=>String.fromCharCode(e)).join(""),ft=o=>t=>{const e=it(2)(t);return(e[1]<<8)+e[0]},he=(o,t)=>(e,r,i)=>{const n=typeof t=="function"?t(e,r,i):t,s=it(o),a=new Array(n);for(var l=0;l{for(var r=0,i=0;it=>{const e=W()(t),r=new Array(8);for(var i=0;i<8;i++)r[7-i]=!!(e&1<{const a=o[s];return a.length?n[s]=er(r,a.index,a.length):n[s]=r[a.index],n},{})};var It={blocks:o=>{const e=[],r=o.data.length;for(var i=0,n=W()(o);n!==0&&n;n=W()(o)){if(o.pos+n>=r){const c=r-o.pos;e.push(it(c)(o)),i+=c;break}e.push(it(n)(o)),i+=n}const s=new Uint8Array(i);for(var a=0,l=0;l{var t=Et(2)(o);return t[0]===33&&t[1]===249}),ir=gt({image:[{code:W()},{descriptor:[{left:ft()},{top:ft()},{width:ft()},{height:ft()},{lct:Ut({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},gt({lct:he(3,(o,t,e)=>Math.pow(2,e.descriptor.lct.size+1))},(o,t,e)=>e.descriptor.lct.exists),{data:[{minCodeSize:W()},It]}]},o=>ce()(o)===44),or=gt({text:[{codes:it(2)},{blockSize:W()},{preData:(o,t,e)=>it(e.text.blockSize)(o)},It]},o=>{var t=Et(2)(o);return t[0]===33&&t[1]===1}),nr=gt({application:[{codes:it(2)},{blockSize:W()},{id:(o,t,e)=>Ot(e.blockSize)(o)},It]},o=>{var t=Et(2)(o);return t[0]===33&&t[1]===255}),sr=gt({comment:[{codes:it(2)},It]},o=>{var t=Et(2)(o);return t[0]===33&&t[1]===254}),ar=[{header:[{signature:Ot(3)},{version:Ot(3)}]},{lsd:[{width:ft()},{height:ft()},{gct:Ut({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:W()},{pixelAspectRatio:W()}]},gt({gct:he(3,(o,t)=>Math.pow(2,t.lsd.gct.size+1))},(o,t)=>t.lsd.gct.exists),{frames:Qe([rr,nr,sr,ir,or],o=>{var t=ce()(o);return t===33||t===44})}],lr=(o,t)=>{const e=new Array(o.length),r=o.length/t,i=function(u,f){const v=o.slice(f*t,(f+1)*t);e.splice.apply(e,[u*t,t].concat(v))},n=[0,4,2,1],s=[8,8,4,2];for(var a=0,l=0;l<4;l++)for(var c=n[l];c{const n=e;var s,a,l,c,u,f,v,b,A,k,d,T,m,y,I,B;const M=new Array(e),g=new Array(4096),p=new Array(4096),P=new Array(4097);for(T=o,a=1<>=c,b-=c,A>s||A==u)break;if(A==a){c=T+1,l=(1<a;)P[y++]=p[A],A=g[A];m=p[A]&255,P[y++]=m,s<4096&&(g[s]=v,p[s]=m,s++,!(s&l)&&s<4096&&(c++,l+=s)),v=f}y--,M[B++]=P[y],k++}for(k=B;k{const t=new Uint8Array(o);return bt(tr(t),ar)},ur=o=>{const t=o.pixels.length,e=new Uint8ClampedArray(t*4);for(var r=0;r{if(!o.image){console.warn("gif frame does not have associated image.");return}const{image:r}=o,i=r.descriptor.width*r.descriptor.height;var n=cr(r.data.minCodeSize,r.data.blocks,i);r.descriptor.lct.interlaced&&(n=lr(n,r.descriptor.width));const s={pixels:n,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)),s.patch=ur(s),s},dr=(o,t)=>o.frames.filter(e=>e.image).map(e=>fr(e,o.gct));var gr=100,K=256,Wt=K-1,ct=4,ue=16,Gt=1<>jt,vr=Gt<>3,$t=6,wr=1<<$t,br=mr*wr,yr=30,de=10,Ct=1<>3);var g,p;for(g=0;g>=ct,e[g][1]>>=ct,e[g][2]>>=ct,e[g][3]=g}function c(g,p,P,d,b){e[p][0]-=g*(e[p][0]-P)/Ct,e[p][1]-=g*(e[p][1]-d)/Ct,e[p][2]-=g*(e[p][2]-b)/Ct}function u(g,p,P,d,b){for(var m=Math.abs(p-g),y=Math.min(p+g,K),B=p+1,I=p-1,R=1,h,N;Bm;)N=s[R++],Bm&&(h=e[I--],h[0]-=N*(h[0]-P)/pt,h[1]-=N*(h[1]-d)/pt,h[2]-=N*(h[2]-b)/pt)}function f(g,p,P){var d=2147483647,b=d,m=-1,y=m,B,I,R,h,N;for(B=0;B>ue-ct),h>jt,n[B]-=N,i[B]+=N<>1,p=y+1;p>1,p=y+1;p<256;p++)r[p]=Wt}function A(g,p,P){for(var d,b,m,y=1e3,B=-1,I=r[p],R=I-1;I=0;)I=y?I=K:(I++,m<0&&(m=-m),d=b[0]-g,d<0&&(d=-d),m+=d,m=0&&(b=e[R],m=p-b[1],m>=y?R=-1:(R--,m<0&&(m=-m),d=b[0]-g,d<0&&(d=-d),m+=d,m>$t;for(B<=1&&(B=0),g=0;g=p&&(O-=p),g++,b===0&&(b=1),g%b===0)for(m-=m/P,y-=y/yr,B=y>>$t,B<=1&&(B=0),C=0;C=254&&I(O)}function b(C){m(wt),f=T+2,A=!0,N(T,C)}function m(C){for(var O=0;O=0){lt=z-G,G===0&&(lt=1);do if((G-=lt)<0&&(G+=z),s[G]===w){Y=a[G];continue t}while(s[G]>=0)}N(Y,O),Y=ut,f<1<0&&(C.writeByte(u),C.writeBytes(n,0,u),u=0)}function R(C){return(1<0?l|=C<=8;)d(l&255,O),l>>=8,c-=8;if((f>v||A)&&(A?(v=R(P=k),A=!1):(++P,P==At?v=1<0;)d(l&255,O),l>>=8,c-=8;I(O)}}this.encode=B}function q(){this.page=-1,this.pages=[],this.newPage()}q.pageSize=4096;q.charMap={};for(var Pt=0;Pt<256;Pt++)q.charMap[Pt]=String.fromCharCode(Pt);q.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(q.pageSize),this.cursor=0};q.prototype.getData=function(){for(var o="",t=0;tr+i.length,0));return o.reduce((r,i)=>(e.set(i,r),r+i.length),0),e};q.prototype.writeByte=function(o){this.cursor>=q.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=o};q.prototype.writeUTFBytes=function(o){for(var t=o.length,e=0;e=0&&(this.dispose=o)};$.prototype.setRepeat=function(o){this.repeat=o};$.prototype.setTransparent=function(o){this.transparent=o};$.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};$.prototype.finish=function(){this.out.writeByte(59)};$.prototype.setQuality=function(o){o<1&&(o=1),this.sample=o};$.prototype.setDither=function(o){o===!0&&(o="FloydSteinberg"),this.dither=o};$.prototype.setGlobalPalette=function(o){this.globalPalette=o};$.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};$.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};$.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new Pr(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))};$.prototype.indexPixels=function(o){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);for(var e=0,r=0;r=0&&B+u=0&&I+c>16,(o&65280)>>8,o&255,t)};$.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 i=0,n=256*256*256,s=this.colorTab.length,a=0,l=0;a=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)};$.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)};$.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)};$.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)};$.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var o=3*256-this.colorTab.length,t=0;t>8&255)};$.prototype.writePixels=function(){var o=new Dr(this.width,this.height,this.indexedPixels,this.colorDepth);o.encode(this.out)};$.prototype.stream=function(){return this.out};var kr=globalThis&&globalThis.__awaiter||function(o,t,e,r){function i(n){return n instanceof e?n:new e(function(s){s(n)})}return new(e||(e=Promise))(function(n,s){function a(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?n(u.value):i(u.value).then(a,l)}c((r=r.apply(o,t||[])).next())})};const{Canvas:nt}=Ye,Bt=.4;function ie(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 n=new Image;n.onload=function(){e(n),t(n)},n.onerror=function(){r("Image load error"),t(n)},n.src=o;return}let i=new Image;i.setAttribute("crossOrigin","Anonymous"),i.onload=function(){e(i)},i.onerror=function(){r("Image load error")},i.src=o})}class _{constructor(t){const e=Object.assign({},t);if(Object.keys(_.defaultOptions).forEach(r=>{r in e||Object.defineProperty(e,r,{value:_.defaultOptions[r],enumerable:!0,writable:!0})}),e.components?typeof e.components=="object"&&Object.keys(_.defaultComponentOptions).forEach(r=>{r in e.components?Object.defineProperty(e.components,r,{value:Object.assign(Object.assign({},_.defaultComponentOptions[r]),e.components[r]),enumerable:!0,writable:!0}):Object.defineProperty(e.components,r,{value:_.defaultComponentOptions[r],enumerable:!0,writable:!0})}):e.components=_.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 nt(t.size,t.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new ht(-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,i,n,s){t.beginPath(),t.moveTo(e,r),t.arcTo(e+i,r,e+i,r+n,s),t.arcTo(e+i,r+n,e,r+n,s),t.arcTo(e,r+n,e,r,s),t.arcTo(e,r,e+i,r,s),t.closePath()}static _getAverageRGB(t){const r={r:0,g:0,b:0};let i,n,s=-4;const a={r:0,g:0,b:0};let l=0;n=t.naturalHeight||t.height,i=t.naturalWidth||t.width;const u=new nt(i,n).getContext("2d");if(!u)return r;u.drawImage(t,0,0);let f;try{f=u.getImageData(0,0,i,n)}catch{return r}for(;(s+=5*4)200||f.data[s+1]>200||f.data[s+2]>200||(++l,a.r+=f.data[s],a.g+=f.data[s+1],a.b+=f.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,i,n=0,s=1){t.fillRect((e+n)*i,(r+n)*i,s*i,s*i)}static _drawAlignProtector(t,e,r,i){t.clearRect((e-2)*i,(r-2)*i,5*i,5*i),t.fillRect((e-2)*i,(r-2)*i,5*i,5*i)}static _drawAlign(t,e,r,i,n=0,s=1,a,l){const c=t.fillStyle;t.fillStyle=a,new Array(4).fill(0).map((u,f)=>{_._drawDot(t,e-2+f,r-2,i,n,s),_._drawDot(t,e+2,r-2+f,i,n,s),_._drawDot(t,e+2-f,r+2,i,n,s),_._drawDot(t,e-2,r+2-f,i,n,s)}),_._drawDot(t,e,r,i,n,s),l||(t.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map((u,f)=>{_._drawDot(t,e-1+f,r-1,i,n,s),_._drawDot(t,e+1,r-1+f,i,n,s),_._drawDot(t,e+1-f,r+1,i,n,s),_._drawDot(t,e-1,r+1-f,i,n,s)})),t.fillStyle=c}_draw(){var t,e,r,i,n,s,a,l,c,u,f,v,A,k,T,M,g,p,P;return kr(this,void 0,void 0,function*(){const d=(t=this.qrCode)===null||t===void 0?void 0:t.moduleCount,b=this.options.size;let m=this.options.margin;(m<0||m*2>=b)&&(m=0);const y=Math.ceil(m),B=b-2*m,I=this.options.whiteMargin,R=this.options.backgroundDimming,h=Math.ceil(B/d),N=h*d,C=N+2*y,O=new nt(C,C),w=O.getContext("2d");this._clear(),w.save(),w.translate(y,y);const ut=new nt(C,C),G=ut.getContext("2d");let Y=null,lt=[];if(this.options.gifBackground){const D=hr(this.options.gifBackground);if(Y=D,lt=dr(D),this.options.autoColor){let E=0,x=0,S=0,H=0;for(let F=0;F200||U[1]>200||U[2]>200||U[0]===0&&U[1]===0&&U[2]===0||(H++,E+=U[0],x+=U[1],S+=U[2])}E=~~(E/H),x=~~(x/H),S=~~(S/H),this.options.colorDark=`rgb(${E},${x},${S})`}}else if(this.options.backgroundImage){const D=yield ie(this.options.backgroundImage);if(this.options.autoColor){const E=_._getAverageRGB(D);this.options.colorDark=`rgb(${E.r},${E.g},${E.b})`}G.drawImage(D,0,0,D.width,D.height,0,0,C,C),G.rect(0,0,C,C),G.fillStyle=R,G.fill()}else G.rect(0,0,C,C),G.fillStyle=this.options.colorLight,G.fill();const z=L.getPatternPosition(this.qrCode.typeNumber),Q=((r=(e=this.options.components)===null||e===void 0?void 0:e.data)===null||r===void 0?void 0:r.scale)||Bt,zt=(1-Q)*.5;for(let D=0;D=d-8)||E>=d-8&&D<8,H=D==6&&E>=8&&E<=d-8||E==6&&D>=8&&D<=d-8;let F=S||H;for(let X=1;X=z[X]-2&&D<=z[X]+2&&E>=z[X]-2&&E<=z[X]+2;const U=E*h+(F?0:zt*h),tt=D*h+(F?0:zt*h);if(w.strokeStyle=x?this.options.colorDark:this.options.colorLight,w.lineWidth=.5,w.fillStyle=x?this.options.colorDark:this.options.colorLight,z.length===0)F||w.fillRect(U,tt,(F?1:Q)*h,(F?1:Q)*h);else{const X=E=d-4-5&&D=d-4-5;!F&&!X&&w.fillRect(U,tt,(F?1:Q)*h,(F?1:Q)*h)}}const J=z[z.length-1],ve=this.options.colorLight;if(w.fillStyle=ve,w.fillRect(0,0,8*h,8*h),w.fillRect(0,(d-8)*h,8*h,8*h),w.fillRect((d-8)*h,0,8*h,8*h),!((n=(i=this.options.components)===null||i===void 0?void 0:i.timing)===null||n===void 0)&&n.protectors&&(w.fillRect(8*h,6*h,(d-8-8)*h,h),w.fillRect(6*h,8*h,h,(d-8-8)*h)),!((a=(s=this.options.components)===null||s===void 0?void 0:s.cornerAlignment)===null||a===void 0)&&a.protectors&&_._drawAlignProtector(w,J,J,h),!((c=(l=this.options.components)===null||l===void 0?void 0:l.alignment)===null||c===void 0)&&c.protectors)for(let D=0;D=1)&&(E=.2),x<0&&(x=0),S<0&&(S=0);const H=N*E,F=.5*(C-H),U=F;w.restore(),w.fillStyle=this.options.logoBackgroundColor,w.save(),_._prepareRoundedCornerClip(w,F-x,U-x,H+2*x,H+2*x,S+x),w.clip();const tt=w.globalCompositeOperation;w.globalCompositeOperation="destination-out",w.fill(),w.globalCompositeOperation=tt,w.restore(),w.save(),_._prepareRoundedCornerClip(w,F,U,H,H,S),w.clip(),w.drawImage(D,F,U,H,H),w.restore(),w.save(),w.translate(y,y)}if(Y){let D,E,x,S,H,F;if(lt.forEach(function(U){D||(D=new $(b,b),D.setDelay(U.delay),D.setRepeat(0));const{width:tt,height:X}=U.dims;E||(E=new nt(tt,X),x=E.getContext("2d"),x.rect(0,0,E.width,E.height),x.fillStyle="#ffffff",x.fill()),(!S||!F||tt!==S.width||X!==S.height)&&(S=new nt(tt,X),H=S.getContext("2d"),F=H.createImageData(tt,X)),F.data.set(U.patch),H.putImageData(F,0,0),x.drawImage(S.getContext("2d").canvas,U.dims.left,U.dims.top);const yt=new nt(C,C),mt=yt.getContext("2d");mt.drawImage(E.getContext("2d").canvas,0,0,C,C),mt.rect(0,0,C,C),mt.fillStyle=R,mt.fill(),mt.drawImage(O.getContext("2d").canvas,0,0,C,C);const St=new nt(b,b),Zt=St.getContext("2d");Zt.drawImage(yt.getContext("2d").canvas,0,0,b,b),D.addFrame(Zt.getImageData(0,0,St.width,St.height).data)}),!D)throw new Error("No frames.");if(D.finish(),oe(this.canvas)){const tt=D.stream().toFlattenUint8Array().reduce((X,yt)=>X+String.fromCharCode(yt),"");return Promise.resolve(`data:image/gif;base64,${window.btoa(tt)}`)}return Promise.resolve(Buffer.from(D.stream().toFlattenUint8Array()))}else{G.drawImage(O.getContext("2d").canvas,0,0,C,C),w.drawImage(ut.getContext("2d").canvas,-y,-y,C,C);const D=new nt(b,b);D.getContext("2d").drawImage(O.getContext("2d").canvas,0,0,b,b),this.canvas=D;const x=this.options.gifBackground?"gif":"png";return oe(this.canvas)?Promise.resolve(this.canvas.toDataURL(x)):Promise.resolve(this.canvas.toBuffer(x))}})}}_.CorrectLevel=Z;_.defaultComponentOptions={data:{scale:.4},timing:{scale:.5,protectors:!1},alignment:{scale:.5,protectors:!1},cornerAlignment:{scale:.5,protectors:!0}};_.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"rgba(255, 255, 255, 0.6)",correctLevel:Z.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:_.defaultComponentOptions,autoColor:!0,logoBackgroundColor:"#ffffff",backgroundColor:"#ffffff"};function oe(o){try{return o instanceof HTMLElement}catch{return typeof o=="object"&&o.nodeType===1&&typeof o.style=="object"&&typeof o.ownerDocument=="object"}}function Dt(o,...t){if(Array.isArray(o))o.forEach(e=>Dt(e,...t));else return o(...t)}const Tr=(o,t)=>{const e=document.createElement("a");e.href=o,e.download=t||new Date().getTime()+".png",e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)},Er=o=>new Promise((t,e)=>{const r=new XMLHttpRequest;r.responseType="blob",r.onload=()=>{const i=new FileReader;i.onloadend=()=>{t(i.result)},i.onerror=n=>{e(n)},i.onabort=n=>{e(n)},i.readAsArrayBuffer(r.response)},r.open("GET",o),r.send()}),Nt=be({name:"Vue3NextQrcode",props:ke,setup(o,t){const{expose:e}=t,r=ye(()=>({"--ray-qrcode-width":o.size+"px","--ray-qrcode-height":o.size+"px","--ray-qrcode-border-radius":o.logoCornerRadius+"px","--ray-qrcode-mask-color":o.maskColor})),i=qt();let n;const s=qt(!1);let a;const l=async()=>{const{gifBackgroundURL:v}=o;if(v)try{n=await Er(v)}catch(A){console.error(A)}},c=()=>{const{gifBackgroundURL:v,gifBackground:A,...k}=o;new _({...k,gifBackground:n??void 0}).draw().then(T=>{const{onSuccess:M}=o;M&&Dt(M,T),i.value=T}).catch(T=>{const{onError:M}=o;M&&Dt(M,T)})},u=()=>{if(t.slots.errorAction)return;const{onReload:v}=o;v&&Dt(v)},f=v=>i.value&&typeof i.value=="string"?new Promise(A=>{Tr(i.value,v),A()}):Promise.reject();return Ce(()=>{o.watchText?a=De(()=>o.text,()=>c()):a==null||a()}),e({downloadQRCode:f}),Ae(async()=>{await l(),c()}),Pe(()=>{a==null||a()}),{qrcodeURL:i,errorActionClick:u,cssVars:r,isClick:s}},render(){return ot("div",{class:"ray-qrcode",style:[this.cssVars]},[ot("div",{class:[this.status==="loading"&&!this.$slots.loading?"ray-qrcode__loading":"",this.$slots.loading?"ray-qrcode__loading--custom":""]},[this.status==="loading"?this.$slots.loading?ot("div",{class:"ray-qrcode__loading-slots"},[this.$slots.loading()]):ot("div",{class:"ray-qrcode__spin"},null):null,ot("img",Be({src:this.qrcodeURL},{img_tag:"VUE3_NEXT_QRCODE"}),null)]),this.status==="error"?ot("div",{class:"ray-qrcode__error"},[ot("div",{class:"ray-qrcode__error-content"},[typeof this.errorDescription=="string"?this.errorDescription:()=>this.errorDescription]),ot("div",{class:"ray-qrcode__error-btn",onClick:this.errorActionClick.bind(this)},[this.$slots.errorAction?this.$slots.errorAction():ot("span",{onMousedown:()=>{this.isClick=!0},onMouseup:()=>{this.isClick=!1},class:[this.isClick?"ray-qrcode__error-btn-click":""]},[this.errorActionDescription])])]):null])}});Nt.install=function(o){o.component(Nt.name,Nt)};export{Nt as Q};