var Ft=Object.defineProperty;var lt=Object.getOwnPropertySymbols;var kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var ft=(e,t,r)=>t in e?Ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))kt.call(t,r)&&ft(e,r,t[r]);if(lt)for(var r of lt(t))zt.call(t,r)&&ft(e,r,t[r]);return e};var gt=(e,t,r)=>new Promise((i,o)=>{var n=a=>{try{u(r.next(a))}catch(l){o(l)}},s=a=>{try{u(r.throw(a))}catch(l){o(l)}},u=a=>a.done?i(a.value):Promise.resolve(a.value).then(n,s);u((r=r.apply(e,t)).next())});import{ah as Ht,av as Vt,a as Kt,s as $t,N as Jt,a7 as Ot,aw as Yt,i as q,o as ht,h as jt,j as Qt,ax as Gt,ay as qt}from"./index.7e08ba81.js";import{d as Wt}from"./download.ef0c06e3.js";var Xt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Et={},T={};let it;const Zt=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];T.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};T.getSymbolTotalCodewords=function(t){return Zt[t]};T.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};T.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');it=t};T.isKanjiModeEnabled=function(){return typeof it!="undefined"};T.toSJIS=function(t){return it(t)};var O={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(i){return i&&typeof i.bit!="undefined"&&i.bit>=0&&i.bit<4},e.from=function(i,o){if(e.isValid(i))return i;try{return t(i)}catch(n){return o}}})(O);function pt(){this.buffer=[],this.length=0}pt.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var xt=pt;function H(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}H.prototype.set=function(e,t,r,i){const o=e*this.size+t;this.data[o]=r,i&&(this.reservedBit[o]=!0)};H.prototype.get=function(e,t){return this.data[e*this.size+t]};H.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};H.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var te=H,Bt={};(function(e){const t=T.getSymbolSize;e.getRowColCoords=function(i){if(i===1)return[];const o=Math.floor(i/7)+2,n=t(i),s=n===145?26:Math.ceil((n-13)/(2*o-2))*2,u=[n-7];for(let a=1;a=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const n=o.size;let s=0,u=0,a=0,l=null,c=null;for(let E=0;E=5&&(s+=t.N1+(u-5)),l=f,u=1),f=o.get(d,E),f===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=f,a=1)}u>=5&&(s+=t.N1+(u-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(o){const n=o.size;let s=0;for(let u=0;u=10&&(u===1488||u===93)&&s++,a=a<<1&2047|o.get(c,l),c>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let n=0;const s=o.data.length;for(let a=0;a=0;){const s=n[0];for(let a=0;a0){const n=new Uint8Array(this.degree);return n.set(i,o),n}return i};var ne=st,St={},L={},at={};at.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var M={};const Mt="[0-9]+",re="[A-Z $%*+\\-./:]+";let z="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";z=z.replace(/u/g,"\\u");const oe="(?:(?![A-Z0-9 $%*+\\-./:]|"+z+`)(?:.|[\r ]))+`;M.KANJI=new RegExp(z,"g");M.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");M.BYTE=new RegExp(oe,"g");M.NUMERIC=new RegExp(Mt,"g");M.ALPHANUMERIC=new RegExp(re,"g");const ie=new RegExp("^"+z+"$"),se=new RegExp("^"+Mt+"$"),ae=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");M.testKanji=function(t){return ie.test(t)};M.testNumeric=function(t){return se.test(t)};M.testAlphanumeric=function(t){return ae.test(t)};(function(e){const t=at,r=M;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},e.getBestModeForData=function(n){return r.testNumeric(n)?e.NUMERIC:r.testAlphanumeric(n)?e.ALPHANUMERIC:r.testKanji(n)?e.KANJI:e.BYTE},e.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},e.isValid=function(n){return n&&n.bit&&n.ccBits};function i(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(n,s){if(e.isValid(n))return n;try{return i(n)}catch(u){return s}}})(L);(function(e){const t=T,r=Y,i=O,o=L,n=at,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,u=t.getBCHDigit(s);function a(d,f,g){for(let y=1;y<=40;y++)if(f<=e.getCapacity(y,g,d))return y}function l(d,f){return o.getCharCountIndicator(d,f)+4}function c(d,f){let g=0;return d.forEach(function(y){g+=l(y.mode,f)+y.getBitsLength()}),g}function E(d,f){for(let g=1;g<=40;g++)if(c(d,g)<=e.getCapacity(g,f,o.MIXED))return g}e.from=function(f,g){return n.isValid(f)?parseInt(f,10):g},e.getCapacity=function(f,g,y){if(!n.isValid(f))throw new Error("Invalid QR Code version");typeof y=="undefined"&&(y=o.BYTE);const A=t.getSymbolTotalCodewords(f),w=r.getTotalCodewordsCount(f,g),C=(A-w)*8;if(y===o.MIXED)return C;const h=C-l(y,f);switch(y){case o.NUMERIC:return Math.floor(h/10*3);case o.ALPHANUMERIC:return Math.floor(h/11*2);case o.KANJI:return Math.floor(h/13);case o.BYTE:default:return Math.floor(h/8)}},e.getBestVersionForData=function(f,g){let y;const A=i.from(g,i.M);if(Array.isArray(f)){if(f.length>1)return E(f,A);if(f.length===0)return 1;y=f[0]}else y=f;return a(y.mode,y.getLength(),A)},e.getEncodedBits=function(f){if(!n.isValid(f)||f<7)throw new Error("Invalid QR Code version");let g=f<<12;for(;t.getBCHDigit(g)-u>=0;)g^=s<=0;)o^=Pt<0&&(i=this.data.substr(r),o=parseInt(i,10),t.put(o,n*3+1))};var le=D;const fe=L,W=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function _(e){this.mode=fe.ALPHANUMERIC,this.data=e}_.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let i=W.indexOf(this.data[r])*45;i+=W.indexOf(this.data[r+1]),t.put(i,11)}this.data.length%2&&t.put(W.indexOf(this.data[r]),6)};var de=_,ge=function(t){for(var r=[],i=t.length,o=0;o=55296&&n<=56319&&i>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,o+=1)}if(n<128){r.push(n);continue}if(n<2048){r.push(n>>6|192),r.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128);continue}if(n>=65536&&n<=1114111){r.push(n>>18|240),r.push(n>>12&63|128),r.push(n>>6&63|128),r.push(n&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const he=ge,me=L;function U(e){this.mode=me.BYTE,typeof e=="string"&&(e=he(e)),this.data=new Uint8Array(e)}U.getBitsLength=function(t){return t*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(e){for(let t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};var Ee=v,Lt={exports:{}};(function(e){var t={single_source_shortest_paths:function(r,i,o){var n={},s={};s[i]=0;var u=t.PriorityQueue.make();u.push(i,0);for(var a,l,c,E,d,f,g,y,A;!u.empty();){a=u.pop(),l=a.value,E=a.cost,d=r[l]||{};for(c in d)d.hasOwnProperty(c)&&(f=d[c],g=E+f,y=s[c],A=typeof s[c]=="undefined",(A||y>g)&&(s[c]=g,u.push(c,g),n[c]=l))}if(typeof o!="undefined"&&typeof s[o]=="undefined"){var w=["Could not find a path from ",i," to ",o,"."].join("");throw new Error(w)}return n},extract_shortest_path_from_predecessor_list:function(r,i){for(var o=[],n=i;n;)o.push(n),r[n],n=r[n];return o.reverse(),o},find_path:function(r,i,o){var n=t.single_source_shortest_paths(r,i,o);return t.extract_shortest_path_from_predecessor_list(n,o)},PriorityQueue:{make:function(r){var i=t.PriorityQueue,o={},n;r=r||{};for(n in i)i.hasOwnProperty(n)&&(o[n]=i[n]);return o.queue=[],o.sorter=r.sorter||i.default_sorter,o},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var o={value:r,cost:i};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Lt);(function(e){const t=L,r=le,i=de,o=we,n=Ee,s=M,u=T,a=Lt.exports;function l(w){return unescape(encodeURIComponent(w)).length}function c(w,C,h){const m=[];let p;for(;(p=w.exec(h))!==null;)m.push({data:p[0],index:p.index,mode:C,length:p[0].length});return m}function E(w){const C=c(s.NUMERIC,t.NUMERIC,w),h=c(s.ALPHANUMERIC,t.ALPHANUMERIC,w);let m,p;return u.isKanjiModeEnabled()?(m=c(s.BYTE,t.BYTE,w),p=c(s.KANJI,t.KANJI,w)):(m=c(s.BYTE_KANJI,t.BYTE,w),p=[]),C.concat(h,m,p).sort(function(I,N){return I.index-N.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function d(w,C){switch(C){case t.NUMERIC:return r.getBitsLength(w);case t.ALPHANUMERIC:return i.getBitsLength(w);case t.KANJI:return n.getBitsLength(w);case t.BYTE:return o.getBitsLength(w)}}function f(w){return w.reduce(function(C,h){const m=C.length-1>=0?C[C.length-1]:null;return m&&m.mode===h.mode?(C[C.length-1].data+=h.data,C):(C.push(h),C)},[])}function g(w){const C=[];for(let h=0;h=0&&u<=6&&(a===0||a===6)||a>=0&&a<=6&&(u===0||u===6)||u>=2&&u<=4&&a>=2&&a<=4?e.set(n+u,s+a,!0,!0):e.set(n+u,s+a,!1,!0))}}function be(e){const t=e.size;for(let r=8;r>u&1)===1,e.set(o,n,s,!0),e.set(n,o,s,!0)}function x(e,t,r){const i=e.size,o=Ne.getEncodedBits(t,r);let n,s;for(n=0;n<15;n++)s=(o>>n&1)===1,n<6?e.set(n,8,s,!0):n<8?e.set(n+1,8,s,!0):e.set(i-15+n,8,s,!0),n<8?e.set(8,i-n-1,s,!0):n<9?e.set(8,15-n-1+1,s,!0):e.set(8,15-n-1,s,!0);e.set(i-8,8,1,!0)}function Le(e,t){const r=e.size;let i=-1,o=r-1,n=7,s=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let a=0;a<2;a++)if(!e.isReserved(o,u-a)){let l=!1;s>>n&1)===1),e.set(o,u-a,l),n--,n===-1&&(s++,n=7)}if(o+=i,o<0||r<=o){o-=i,i=-i;break}}}function De(e,t,r){const i=new pe;r.forEach(function(a){i.put(a.mode.bit,4),i.put(a.getLength(),Se.getCharCountIndicator(a.mode,e)),a.write(i)});const o=Q.getSymbolTotalCodewords(e),n=rt.getTotalCodewordsCount(e,t),s=(o-n)*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(s-i.getLengthInBits())/8;for(let a=0;a=7&&Re(a,t),Le(a,s),isNaN(i)&&(i=nt.getBestMask(a,x.bind(null,a,r))),nt.applyMask(i,a),x(a,r,i),{modules:a,version:t,errorCorrectionLevel:r,maskPattern:i,segments:o}}Et.create=function(t,r){if(typeof t=="undefined"||t==="")throw new Error("No input text");let i=X.M,o,n;return typeof r!="undefined"&&(i=X.from(r.errorCorrectionLevel,X.M),o=J.from(r.version),n=nt.from(r.maskPattern),r.toSJISFunc&&Q.setToSJISFunction(r.toSJISFunc)),Ue(t,o,i,n)};var Dt={},ut={};(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(n){return[n,n]}))),i.length===6&&i.push("F","F");const o=parseInt(i.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const o=typeof i.margin=="undefined"||i.margin===null||i.margin<0?4:i.margin,n=i.width&&i.width>=21?i.width:void 0,s=i.scale||4;return{width:n,scale:n?4:s,margin:o,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,o){return o.width&&o.width>=i+o.margin*2?o.width/(i+o.margin*2):o.scale},e.getImageWidth=function(i,o){const n=e.getScale(i,o);return Math.floor((i+o.margin*2)*n)},e.qrToImageData=function(i,o,n){const s=o.modules.size,u=o.modules.data,a=e.getScale(s,n),l=Math.floor((s+n.margin*2)*a),c=n.margin*a,E=[n.color.light,n.color.dark];for(let d=0;d=c&&f>=c&&d0&&a>0&&e[u-1]||(i+=n?tt("M",a+r,.5+l+r):tt("m",o,0),o=0,n=!1),a+1':"",l="',c='viewBox="0 0 '+u+" "+u+'"',E=o.width?'width="'+o.width+'" height="'+o.width+'" ':"",d=''+a+l+` `;return typeof i=="function"&&i(null,d),d};const ke=Xt,ot=Et,Ut=Dt,ze=_t;function ct(e,t,r,i,o){const n=[].slice.call(arguments,1),s=n.length,u=typeof n[s-1]=="function";if(!u&&!ke())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(o=r,r=t,t=i=void 0):s===3&&(t.getContext&&typeof o=="undefined"?(o=i,i=void 0):(o=i,i=r,r=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=t,t=i=void 0):s===2&&!t.getContext&&(i=r,r=t,t=void 0),new Promise(function(a,l){try{const c=ot.create(r,i);a(e(c,t,i))}catch(c){l(c)}})}try{const a=ot.create(r,i);o(null,e(a,t,i))}catch(a){o(a)}}ot.create;var vt=ct.bind(null,Ut.render),He=ct.bind(null,Ut.renderToDataURL);ct.bind(null,function(e,t,r){return ze.render(e,r)});const Ve=({canvas:e,content:t,width:r=0,options:i={}})=>{const o=Ht(i);return o.errorCorrectionLevel=o.errorCorrectionLevel||$e(t),Ke(t,o).then(n=>(o.scale=r===0?void 0:r/n*4,vt(e,t,o)))};function Ke(e,t){const r=document.createElement("canvas");return vt(r,e,t).then(()=>r.width)}function $e(e){return e.length>36?"M":e.length>16?"Q":"H"}const Je=({canvas:e,logo:t})=>{if(!t)return new Promise(C=>{C(e.toDataURL())});const r=e.width,{logoSize:i=.15,bgColor:o="#ffffff",borderSize:n=.05,crossOrigin:s,borderRadius:u=8,logoRadius:a=0}=t,l=Vt(t)?t:t.src,c=r*i,E=r*(1-i)/2,d=r*(i+n),f=r*(1-i-n)/2,g=e.getContext("2d");if(!g)return;yt(g)(f,f,d,d,u),g.fillStyle=o,g.fill();const y=new Image;(s||a)&&y.setAttribute("crossOrigin",s||"anonymous"),y.src=l;const A=C=>{g.drawImage(C,E,E,c,c)},w=C=>{const h=document.createElement("canvas");h.width=E+c,h.height=E+c;const m=h.getContext("2d");if(!m||!g||(m.drawImage(C,E,E,c,c),yt(g)(E,E,c,c,a),!g))return;const p=g.createPattern(h,"no-repeat");p&&(g.fillStyle=p,g.fill())};return new Promise(C=>{y.onload=()=>{a?w(y):A(y),C(e.toDataURL())}})};function yt(e){return(t,r,i,o,n)=>{const s=Math.min(i,o);return n>s/2&&(n=s/2),e.beginPath(),e.moveTo(t+n,r),e.arcTo(t+i,r,t+i,r+o,n),e.arcTo(t+i,r+o,t,r+o,n),e.arcTo(t,r+o,t,r,n),e.arcTo(t,r,t+i,r,n),e.closePath(),e}}const Oe=e=>Ve(e).then(()=>e).then(Je),Ye=Kt({name:"QrCode",props:{value:{type:[String,Array],default:null},options:{type:Object,default:null},width:{type:Number,default:200},logo:{type:[String,Object],default:""},tag:{type:String,default:"canvas",validator:e=>["canvas","img"].includes(e)}},emits:{done:e=>!!e,error:e=>!!e},setup(e,{emit:t}){const r=$t(null);function i(){return gt(this,null,function*(){try{const{tag:n,value:s,options:u={},width:a,logo:l}=e,c=String(s),E=q(r);if(!E)return;if(n==="canvas"){const d=yield Oe({canvas:E,width:a,logo:l,content:c,options:u||{}});t("done",{url:d,ctx:E.getContext("2d")});return}if(n==="img"){const d=yield He(c,dt({errorCorrectionLevel:"H",width:a},u));q(r).src=d,t("done",{url:d})}}catch(n){t("error",n)}})}function o(n){let s="";const u=q(r);u instanceof HTMLCanvasElement?s=u.toDataURL():u instanceof HTMLImageElement&&(s=u.src),s&&Wt({url:s,fileName:n})}return Jt(i),Ot(e,()=>{i()},{deep:!0}),{wrapRef:r,download:o}}});function je(e,t,r,i,o,n){return ht(),jt("div",null,[(ht(),Qt(Gt(e.tag),{ref:"wrapRef"},null,512))])}var Qe=Yt(Ye,[["render",je]]);const Xe=qt(Qe);export{Xe as Q};