import{d as Me,af as rt,r as Ft,J as Jt,K as Pe,v as Ne,o as mt,c as Kt,q as Re,L as Le,Y as Yt,a as z,g as Ot,f as xe,t as Se,O as Ue,at as ke,a0 as _e,H as ze,_ as De,am as He,aZ as Fe,ay as jt,__tla as Je}from"./index-2eab2d23.js";import{_ as Ke}from"./_plugin-vue_export-helper-1b428a4d.js";let Qt,Ye=Promise.all([(()=>{try{return Je}catch{}})()]).then(async()=>{var Y={},yt={},R={};let ot;const Vt=[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];R.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 4*t+17},R.getSymbolTotalCodewords=function(t){return Vt[t]},R.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},R.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');ot=t},R.isKanjiModeEnabled=function(){return ot!==void 0},R.toSJIS=function(t){return ot(t)};var S,q={};function Et(){this.buffer=[],this.length=0}(S=q).L={bit:1},S.M={bit:0},S.Q={bit:3},S.H={bit:2},S.isValid=function(t){return t&&t.bit!==void 0&&t.bit>=0&&t.bit<4},S.from=function(t,e){if(S.isValid(t))return t;try{return function(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return S.L;case"m":case"medium":return S.M;case"q":case"quartile":return S.Q;case"h":case"high":return S.H;default:throw new Error("Unknown EC Level: "+r)}}(t)}catch{return e}},Et.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(let r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(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++}};var qt=Et;function O(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}O.prototype.set=function(t,e,r,n){const o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},O.prototype.get=function(t,e){return this.data[t*this.size+e]},O.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},O.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var $t=O,vt={};(function(t){const e=R.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,o=e(r),a=o===145?26:2*Math.ceil((o-13)/(2*n-2)),i=[o-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const l=i.size;let f=0,s=0,u=0,c=null,h=null;for(let w=0;w=5&&(f+=e+(s-5)),c=p,s=1),p=i.get(d,w),p===h?u++:(u>=5&&(f+=e+(u-5)),h=p,u=1)}s>=5&&(f+=e+(s-5)),u>=5&&(f+=e+(u-5))}return f},t.getPenaltyN2=function(i){const l=i.size;let f=0;for(let s=0;s=10&&(s===1488||s===93)&&f++,u=u<<1&2047|i.get(h,c),h>=10&&(u===1488||u===93)&&f++}return f*n},t.getPenaltyN4=function(i){let l=0;const f=i.data.length;for(let s=0;s=0;){const a=o[0];for(let l=0;l0){const o=new Uint8Array(this.degree);return o.set(r,n),o}return r};var Xt=it,It={},_={},Tt={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},U={};const Mt="[0-9]+";let Q="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Q=Q.replace(/u/g,"\\u");const Wt="(?:(?![A-Z0-9 $%*+\\-./:]|"+Q+`)(?:.|[\r ]))+`;U.KANJI=new RegExp(Q,"g"),U.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),U.BYTE=new RegExp(Wt,"g"),U.NUMERIC=new RegExp(Mt,"g"),U.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const Gt=new RegExp("^"+Q+"$"),te=new RegExp("^"+Mt+"$"),ee=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");U.testKanji=function(t){return Gt.test(t)},U.testNumeric=function(t){return te.test(t)},U.testAlphanumeric=function(t){return ee.test(t)},function(t){const e=Tt,r=U;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(n,o){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?n.ccBits[0]:o<27?n.ccBits[1]:n.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},t.isValid=function(n){return n&&n.bit&&n.ccBits},t.from=function(n,o){if(t.isValid(n))return n;try{return function(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+a)}}(n)}catch{return o}}}(_),function(t){const e=R,r=$,n=q,o=_,a=Tt,i=e.getBCHDigit(7973);function l(s,u){return o.getCharCountIndicator(s,u)+4}function f(s,u){let c=0;return s.forEach(function(h){const w=l(h.mode,u);c+=w+h.getBitsLength()}),c}t.from=function(s,u){return a.isValid(s)?parseInt(s,10):u},t.getCapacity=function(s,u,c){if(!a.isValid(s))throw new Error("Invalid QR Code version");c===void 0&&(c=o.BYTE);const h=8*(e.getSymbolTotalCodewords(s)-r.getTotalCodewordsCount(s,u));if(c===o.MIXED)return h;const w=h-l(c,s);switch(c){case o.NUMERIC:return Math.floor(w/10*3);case o.ALPHANUMERIC:return Math.floor(w/11*2);case o.KANJI:return Math.floor(w/13);case o.BYTE:default:return Math.floor(w/8)}},t.getBestVersionForData=function(s,u){let c;const h=n.from(u,n.M);if(Array.isArray(s)){if(s.length>1)return function(w,d){for(let p=1;p<=40;p++)if(f(w,p)<=t.getCapacity(p,d,o.MIXED))return p}(s,h);if(s.length===0)return 1;c=s[0]}else c=s;return function(w,d,p){for(let g=1;g<=40;g++)if(d<=t.getCapacity(g,p,w))return g}(c.mode,c.getLength(),h)},t.getEncodedBits=function(s){if(!a.isValid(s)||s<7)throw new Error("Invalid QR Code version");let u=s<<12;for(;e.getBCHDigit(u)-i>=0;)u^=7973<=0;)n^=1335<0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*o+1))};var re=D;const oe=_,at=["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 H(t){this.mode=oe.ALPHANUMERIC,this.data=t}H.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},H.prototype.getLength=function(){return this.data.length},H.prototype.getBitsLength=function(){return H.getBitsLength(this.data.length)},H.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*at.indexOf(this.data[e]);r+=at.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(at.indexOf(this.data[e]),6)};var ie=H;const se=function(t){for(var e=[],r=t.length,n=0;n=55296&&o<=56319&&r>n+1){var a=t.charCodeAt(n+1);a>=56320&&a<=57343&&(o=1024*(o-55296)+a-56320+65536,n+=1)}o<128?e.push(o):o<2048?(e.push(o>>6|192),e.push(63&o|128)):o<55296||o>=57344&&o<65536?(e.push(o>>12|224),e.push(o>>6&63|128),e.push(63&o|128)):o>=65536&&o<=1114111?(e.push(o>>18|240),e.push(o>>12&63|128),e.push(o>>6&63|128),e.push(63&o|128)):e.push(239,191,189)}return new Uint8Array(e).buffer},ae=_;function F(t){this.mode=ae.BYTE,typeof t=="string"&&(t=se(t)),this.data=new Uint8Array(t)}F.getBitsLength=function(t){return 8*t},F.prototype.getLength=function(){return this.data.length},F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)},F.prototype.write=function(t){for(let e=0,r=this.data.length;e=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+` Make sure your charset is UTF-8`);r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}};var fe=J,Lt={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,o){var a={},i={};i[n]=0;var l,f,s,u,c,h,w,d=e.PriorityQueue.make();for(d.push(n,0);!d.empty();)for(s in f=(l=d.pop()).value,u=l.cost,c=r[f]||{})c.hasOwnProperty(s)&&(h=u+c[s],w=i[s],(i[s]===void 0||w>h)&&(i[s]=h,d.push(s,h),a[s]=f));if(o!==void 0&&i[o]===void 0){var p=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(p)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],a=n;a;)o.push(a),r[a],a=r[a];return o.reverse(),o},find_path:function(r,n,o){var a=e.single_source_shortest_paths(r,n,o);return e.extract_shortest_path_from_predecessor_list(a,o)},PriorityQueue:{make:function(r){var n,o=e.PriorityQueue,a={};for(n in r=r||{},o)o.hasOwnProperty(n)&&(a[n]=o[n]);return a.queue=[],a.sorter=r.sorter||o.default_sorter,a},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Lt);var he=Lt.exports;(function(t){const e=_,r=re,n=ie,o=ue,a=fe,i=U,l=R,f=he;function s(d){return unescape(encodeURIComponent(d)).length}function u(d,p,g){const v=[];let m;for(;(m=d.exec(g))!==null;)v.push({data:m[0],index:m.index,mode:p,length:m[0].length});return v}function c(d){const p=u(i.NUMERIC,e.NUMERIC,d),g=u(i.ALPHANUMERIC,e.ALPHANUMERIC,d);let v,m;return l.isKanjiModeEnabled()?(v=u(i.BYTE,e.BYTE,d),m=u(i.KANJI,e.KANJI,d)):(v=u(i.BYTE_KANJI,e.BYTE,d),m=[]),p.concat(g,v,m).sort(function(E,y){return E.index-y.index}).map(function(E){return{data:E.data,mode:E.mode,length:E.length}})}function h(d,p){switch(p){case e.NUMERIC:return r.getBitsLength(d);case e.ALPHANUMERIC:return n.getBitsLength(d);case e.KANJI:return a.getBitsLength(d);case e.BYTE:return o.getBitsLength(d)}}function w(d,p){let g;const v=e.getBestModeForData(d);if(g=e.from(p,v),g!==e.BYTE&&g.bit=0?A[A.length-1]:null;return C&&C.mode===b.mode?(A[A.length-1].data+=b.data,A):(A.push(b),A)},[])}(E))},t.rawSplit=function(d){return t.fromArray(c(d,l.isKanjiModeEnabled()))}})(Rt);const tt=R,ut=q,de=qt,ge=$t,pe=vt,we=Ct,ct=At,lt=$,me=Xt,et=It,ye=Pt,Ee=_,ft=Rt;function ht(t,e,r){const n=t.size,o=ye.getEncodedBits(e,r);let a,i;for(a=0;a<15;a++)i=(o>>a&1)==1,a<6?t.set(a,8,i,!0):a<8?t.set(a+1,8,i,!0):t.set(n-15+a,8,i,!0),a<8?t.set(8,n-a-1,i,!0):a<9?t.set(8,15-a-1+1,i,!0):t.set(8,15-a-1,i,!0);t.set(n-8,8,1,!0)}function ve(t,e,r){const n=new de;r.forEach(function(i){n.put(i.mode.bit,4),n.put(i.getLength(),Ee.getCharCountIndicator(i.mode,t)),i.write(n)});const o=8*(tt.getSymbolTotalCodewords(t)-lt.getTotalCodewordsCount(t,e));for(n.getLengthInBits()+4<=o&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const a=(o-n.getLengthInBits())/8;for(let i=0;i=0&&g<=6&&(v===0||v===6)||v>=0&&v<=6&&(g===0||g===6)||g>=2&&g<=4&&v>=2&&v<=4?s.set(d+g,p+v,!0,!0):s.set(d+g,p+v,!1,!0))}}(f,e),function(s){const u=s.size;for(let c=8;c=7&&function(s,u){const c=s.size,h=et.getEncodedBits(u);let w,d,p;for(let g=0;g<18;g++)w=Math.floor(g/3),d=g%3+c-8-3,p=(h>>g&1)==1,s.set(w,d,p,!0),s.set(d,w,p,!0)}(f,e),function(s,u){const c=s.size;let h=-1,w=c-1,d=7,p=0;for(let g=c-1;g>0;g-=2)for(g===6&&g--;;){for(let v=0;v<2;v++)if(!s.isReserved(w,g-v)){let m=!1;p>>d&1)==1),s.set(w,g-v,m),d--,d===-1&&(p++,d=7)}if(w+=h,w<0||c<=w){w-=h,h=-h;break}}}(f,i),isNaN(n)&&(n=ct.getBestMask(f,ht.bind(null,f,r))),ct.applyMask(n,f),ht(f,r,n),{modules:f,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}yt.create=function(t,e){if(t===void 0||t==="")throw new Error("No input text");let r,n,o=ut.M;return e!==void 0&&(o=ut.from(e.errorCorrectionLevel,ut.M),r=et.from(e.version),n=ct.from(e.maskPattern),e.toSJISFunc&&tt.setToSJISFunction(e.toSJISFunc)),Ce(t,r,o,n)};var xt={},dt={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);n.length!==3&&n.length!==4||(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:255&o,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=r.margin===void 0||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:o,scale:o?4:a,margin:n,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,n){return n.width&&n.width>=r+2*n.margin?n.width/(r+2*n.margin):n.scale},t.getImageWidth=function(r,n){const o=t.getScale(r,n);return Math.floor((r+2*n.margin)*o)},t.qrToImageData=function(r,n,o){const a=n.modules.size,i=n.modules.data,l=t.getScale(a,o),f=Math.floor((a+2*o.margin)*l),s=o.margin*l,u=[o.color.light,o.color.dark];for(let c=0;c=s&&h>=s&&c':"",f="0&&E>0&&c[m-1]||(d+=g?gt("M",E+w,.5+y+w):gt("m",p,0),p=0,g=!1),E+1',s='viewBox="0 0 '+i+" "+i+'"',u=''+l+f+` `;return typeof r=="function"&&r(null,u),u};const be=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},pt=yt,kt=xt,Be=St;function wt(t,e,r,n,o){const a=[].slice.call(arguments,1),i=a.length,l=typeof a[i-1]=="function";if(!l&&!be())throw new Error("Callback required as last argument");if(!l){if(i<1)throw new Error("Too few arguments provided");return i===1?(r=e,e=n=void 0):i!==2||e.getContext||(n=r,r=e,e=void 0),new Promise(function(f,s){try{const u=pt.create(r,n);f(t(u,e,n))}catch(u){s(u)}})}if(i<2)throw new Error("Too few arguments provided");i===2?(o=r,r=e,e=n=void 0):i===3&&(e.getContext&&o===void 0?(o=n,n=void 0):(o=n,n=r,r=e,e=void 0));try{const f=pt.create(r,n);o(null,t(f,e,n))}catch(f){o(f)}}Y.create=pt.create,Y.toCanvas=wt.bind(null,kt.render),Y.toDataURL=wt.bind(null,kt.renderToDataURL),Y.toString=wt.bind(null,function(t,e,r){return Be.render(t,r)});let _t;_t={class:"absolute left-[50%] top-[50%] font-bold"},Qt=Ke(Me({name:"Qrcode",__name:"Qrcode",props:{tag:rt.string.validate(t=>["canvas","img"].includes(t)).def("canvas"),text:{type:[String,Array],default:null},options:{type:Object,default:()=>({})},width:rt.number.def(200),logo:{type:[String,Object],default:""},disabled:rt.bool.def(!1),disabledText:rt.string.def("")},emits:["done","click","disabled-click"],setup(t,{emit:e}){const r=t,n=e,{getPrefixCls:o}=_e(),a=o("qrcode"),{toCanvas:i,toDataURL:l}=Y,f=Ft(!0),s=Ft(null),u=Jt(()=>String(r.text)),c=Jt(()=>({width:r.width+"px",height:r.width+"px"}));Pe(()=>u.value,m=>{m&&(async()=>{await He();const E=Fe(r.options||{});if(r.tag==="canvas"){E.errorCorrectionLevel=E.errorCorrectionLevel||d(z(u));const y=await w(z(u),E);E.scale=r.width===0?void 0:r.width/y*4;const A=await i(z(s),z(u),E);if(r.logo){const b=await h(A);n("done",b),f.value=!1}else n("done",A.toDataURL()),f.value=!1}else{const y=await l(u.value,{errorCorrectionLevel:"H",width:r.width,...E});z(s).src=y,n("done",y),f.value=!1}})()},{deep:!0,immediate:!0});const h=m=>{const E=m.width,y=Object.assign({logoSize:.15,bgColor:"#ffffff",borderSize:.05,crossOrigin:"anonymous",borderRadius:8,logoRadius:0},jt(r.logo)?{}:r.logo),{logoSize:A=.15,bgColor:b="#ffffff",borderSize:C=.05,crossOrigin:L="anonymous",borderRadius:P=8,logoRadius:T=0}=y,N=jt(r.logo)?r.logo:r.logo.src,M=E*A,B=E*(1-A)/2,x=E*(A+C),K=E*(1-A-C)/2,I=m.getContext("2d");if(!I)return;p(I)(K,K,x,x,P),I.fillStyle=b,I.fill();const V=new Image;return(L||T)&&V.setAttribute("crossOrigin",L),V.src=N,new Promise(Ie=>{V.onload=()=>{var zt;T?(Te=>{const nt=document.createElement("canvas");nt.width=B+M,nt.height=B+M;const Dt=nt.getContext("2d");if(!Dt||!I||(Dt.drawImage(Te,B,B,M,M),p(I)(B,B,M,M,T),!I))return;const Ht=I.createPattern(nt,"no-repeat");Ht&&(I.fillStyle=Ht,I.fill())})(V):(zt=V,I.drawImage(zt,B,B,M,M)),Ie(m.toDataURL())}})},w=async(m,E)=>{const y=document.createElement("canvas");return await i(y,m,E),y.width},d=m=>m.length>36?"M":m.length>16?"Q":"H",p=m=>(E,y,A,b,C)=>{const L=Math.min(A,b);return C>L/2&&(C=L/2),m.beginPath(),m.moveTo(E+C,y),m.arcTo(E+A,y,E+A,y+b,C),m.arcTo(E+A,y+b,E,y+b,C),m.arcTo(E,y+b,E,y,C),m.arcTo(E,y,E+A,y,C),m.closePath(),m},g=()=>{n("click")},v=()=>{n("disabled-click")};return(m,E)=>{const y=De,A=ze;return Ne((mt(),Kt("div",{class:Yt([z(a),"relative inline-block"]),style:ke(c.value)},[(mt(),Re(Le(t.tag),{ref_key:"wrapRef",ref:s,onClick:g},null,512)),t.disabled?(mt(),Kt("div",{key:0,class:Yt([`${z(a)}--disabled`,"absolute left-0 top-0 h-full w-full flex items-center justify-center"]),onClick:v},[Ot("div",_t,[xe(y,{size:30,color:"var(--el-color-primary)",icon:"ep:refresh-right"}),Ot("div",null,Se(t.disabledText),1)])],2)):Ue("",!0)],6)),[[A,f.value]])}}}),[["__scopeId","data-v-8fc6cf2d"]])});export{Qt as Q,Ye as __tla};