index-CqxP2hci.js 27 KB

12345678
  1. var kt=Object.defineProperty;var lt=Object.getOwnPropertySymbols;var Ft=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var ft=(t,e,o)=>e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,dt=(t,e)=>{for(var o in e||(e={}))Ft.call(e,o)&&ft(t,o,e[o]);if(lt)for(var o of lt(e))zt.call(e,o)&&ft(t,o,e[o]);return t};var gt=(t,e,o)=>new Promise((r,n)=>{var i=s=>{try{u(o.next(s))}catch(l){n(l)}},a=s=>{try{u(o.throw(s))}catch(l){n(l)}},u=s=>s.done?r(s.value):Promise.resolve(s.value).then(i,a);u((o=o.apply(t,e)).next())});import{aD as Ht}from"./entry/index-CRWhxBeP.js";import{k as Vt,j as Kt}from"./antd-BfqWtMX3.js";import{a as Jt}from"./download-DbzL13NI.js";import{d as Ot,f as Yt,o as $t,w as jt,Z as ht,_ as Qt,a4 as Gt,af as Wt,u as W}from"./vue-DM5HGU8Z.js";var qt=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Et={},I={};let it;const Xt=[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];I.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};I.getSymbolTotalCodewords=function(e){return Xt[e]};I.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};I.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');it=e};I.isKanjiModeEnabled=function(){return typeof it!="undefined"};I.toSJIS=function(e){return it(e)};var Y={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+o)}}t.isValid=function(r){return r&&typeof r.bit!="undefined"&&r.bit>=0&&r.bit<4},t.from=function(r,n){if(t.isValid(r))return r;try{return e(r)}catch(i){return n}}})(Y);function pt(){this.buffer=[],this.length=0}pt.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 o=0;o<e;o++)this.putBit((t>>>e-o-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 Zt=pt;function H(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)}H.prototype.set=function(t,e,o,r){const n=t*this.size+e;this.data[n]=o,r&&(this.reservedBit[n]=!0)};H.prototype.get=function(t,e){return this.data[t*this.size+e]};H.prototype.xor=function(t,e,o){this.data[t*this.size+e]^=o};H.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var xt=H,Bt={};(function(t){const e=I.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,i=e(r),a=i===145?26:Math.ceil((i-13)/(2*n-2))*2,u=[i-7];for(let s=1;s<n-1;s++)u[s]=u[s-1]-a;return u.push(6),u.reverse()},t.getPositions=function(r){const n=[],i=t.getRowColCoords(r),a=i.length;for(let u=0;u<a;u++)for(let s=0;s<a;s++)u===0&&s===0||u===0&&s===a-1||u===a-1&&s===0||n.push([i[u],i[s]]);return n}})(Bt);var At={};const te=I.getSymbolSize,mt=7;At.getPositions=function(e){const o=te(e);return[[0,0],[o-mt,0],[0,o-mt]]};var Tt={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const i=n.size;let a=0,u=0,s=0,l=null,c=null;for(let E=0;E<i;E++){u=s=0,l=c=null;for(let m=0;m<i;m++){let f=n.get(E,m);f===l?u++:(u>=5&&(a+=e.N1+(u-5)),l=f,u=1),f=n.get(m,E),f===c?s++:(s>=5&&(a+=e.N1+(s-5)),c=f,s=1)}u>=5&&(a+=e.N1+(u-5)),s>=5&&(a+=e.N1+(s-5))}return a},t.getPenaltyN2=function(n){const i=n.size;let a=0;for(let u=0;u<i-1;u++)for(let s=0;s<i-1;s++){const l=n.get(u,s)+n.get(u,s+1)+n.get(u+1,s)+n.get(u+1,s+1);(l===4||l===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const i=n.size;let a=0,u=0,s=0;for(let l=0;l<i;l++){u=s=0;for(let c=0;c<i;c++)u=u<<1&2047|n.get(l,c),c>=10&&(u===1488||u===93)&&a++,s=s<<1&2047|n.get(c,l),c>=10&&(s===1488||s===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let i=0;const a=n.data.length;for(let s=0;s<a;s++)i+=n.data[s];return Math.abs(Math.ceil(i*100/a/5)-10)*e.N4};function o(r,n,i){switch(r){case t.Patterns.PATTERN000:return(n+i)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return i%3===0;case t.Patterns.PATTERN011:return(n+i)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2===0;case t.Patterns.PATTERN101:return n*i%2+n*i%3===0;case t.Patterns.PATTERN110:return(n*i%2+n*i%3)%2===0;case t.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(n,i){const a=i.size;for(let u=0;u<a;u++)for(let s=0;s<a;s++)i.isReserved(s,u)||i.xor(s,u,o(n,s,u))},t.getBestMask=function(n,i){const a=Object.keys(t.Patterns).length;let u=0,s=1/0;for(let l=0;l<a;l++){i(l),t.applyMask(l,n);const c=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(l,n),c<s&&(s=c,u=l)}return u}})(Tt);var $={};const R=Y,V=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],K=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];$.getBlocksCount=function(e,o){switch(o){case R.L:return V[(e-1)*4+0];case R.M:return V[(e-1)*4+1];case R.Q:return V[(e-1)*4+2];case R.H:return V[(e-1)*4+3];default:return}};$.getTotalCodewordsCount=function(e,o){switch(o){case R.L:return K[(e-1)*4+0];case R.M:return K[(e-1)*4+1];case R.Q:return K[(e-1)*4+2];case R.H:return K[(e-1)*4+3];default:return}};var It={},j={};const F=new Uint8Array(512),J=new Uint8Array(256);(function(){let e=1;for(let o=0;o<255;o++)F[o]=e,J[e]=o,e<<=1,e&256&&(e^=285);for(let o=255;o<512;o++)F[o]=F[o-255]})();j.log=function(e){if(e<1)throw new Error("log("+e+")");return J[e]};j.exp=function(e){return F[e]};j.mul=function(e,o){return e===0||o===0?0:F[J[e]+J[o]]};(function(t){const e=j;t.mul=function(r,n){const i=new Uint8Array(r.length+n.length-1);for(let a=0;a<r.length;a++)for(let u=0;u<n.length;u++)i[a+u]^=e.mul(r[a],n[u]);return i},t.mod=function(r,n){let i=new Uint8Array(r);for(;i.length-n.length>=0;){const a=i[0];for(let s=0;s<n.length;s++)i[s]^=e.mul(n[s],a);let u=0;for(;u<i.length&&i[u]===0;)u++;i=i.slice(u)}return i},t.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let i=0;i<r;i++)n=t.mul(n,new Uint8Array([1,e.exp(i)]));return n}})(It);const Nt=It;function st(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}st.prototype.initialize=function(e){this.degree=e,this.genPoly=Nt.generateECPolynomial(this.degree)};st.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(e.length+this.degree);o.set(e);const r=Nt.mod(o,this.genPoly),n=this.degree-r.length;if(n>0){const i=new Uint8Array(this.degree);return i.set(r,n),i}return r};var ee=st,St={},L={},at={};at.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var M={};const Mt="[0-9]+",ne="[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
  2. ]))+`;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(ne,"g");const re=new RegExp("^"+z+"$"),ie=new RegExp("^"+Mt+"$"),se=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");M.testKanji=function(e){return re.test(e)};M.testNumeric=function(e){return ie.test(e)};M.testAlphanumeric=function(e){return se.test(e)};(function(t){const e=at,o=M;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(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},t.getBestModeForData=function(i){return o.testNumeric(i)?t.NUMERIC:o.testAlphanumeric(i)?t.ALPHANUMERIC:o.testKanji(i)?t.KANJI:t.BYTE},t.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},t.isValid=function(i){return i&&i.bit&&i.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.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: "+n)}}t.from=function(i,a){if(t.isValid(i))return i;try{return r(i)}catch(u){return a}}})(L);(function(t){const e=I,o=$,r=Y,n=L,i=at,a=7973,u=e.getBCHDigit(a);function s(m,f,d){for(let w=1;w<=40;w++)if(f<=t.getCapacity(w,d,m))return w}function l(m,f){return n.getCharCountIndicator(m,f)+4}function c(m,f){let d=0;return m.forEach(function(w){const A=l(w.mode,f);d+=A+w.getBitsLength()}),d}function E(m,f){for(let d=1;d<=40;d++)if(c(m,d)<=t.getCapacity(d,f,n.MIXED))return d}t.from=function(f,d){return i.isValid(f)?parseInt(f,10):d},t.getCapacity=function(f,d,w){if(!i.isValid(f))throw new Error("Invalid QR Code version");typeof w=="undefined"&&(w=n.BYTE);const A=e.getSymbolTotalCodewords(f),C=o.getTotalCodewordsCount(f,d),y=(A-C)*8;if(w===n.MIXED)return y;const g=y-l(w,f);switch(w){case n.NUMERIC:return Math.floor(g/10*3);case n.ALPHANUMERIC:return Math.floor(g/11*2);case n.KANJI:return Math.floor(g/13);case n.BYTE:default:return Math.floor(g/8)}},t.getBestVersionForData=function(f,d){let w;const A=r.from(d,r.M);if(Array.isArray(f)){if(f.length>1)return E(f,A);if(f.length===0)return 1;w=f[0]}else w=f;return s(w.mode,w.getLength(),A)},t.getEncodedBits=function(f){if(!i.isValid(f)||f<7)throw new Error("Invalid QR Code version");let d=f<<12;for(;e.getBCHDigit(d)-u>=0;)d^=a<<e.getBCHDigit(d)-u;return f<<12|d}})(St);var Pt={};const et=I,bt=1335,ae=21522,wt=et.getBCHDigit(bt);Pt.getEncodedBits=function(e,o){const r=e.bit<<3|o;let n=r<<10;for(;et.getBCHDigit(n)-wt>=0;)n^=bt<<et.getBCHDigit(n)-wt;return(r<<10|n)^ae};var Rt={};const ue=L;function _(t){this.mode=ue.NUMERIC,this.data=t.toString()}_.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};_.prototype.getLength=function(){return this.data.length};_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)};_.prototype.write=function(e){let o,r,n;for(o=0;o+3<=this.data.length;o+=3)r=this.data.substr(o,3),n=parseInt(r,10),e.put(n,10);const i=this.data.length-o;i>0&&(r=this.data.substr(o),n=parseInt(r,10),e.put(n,i*3+1))};var ce=_;const le=L,q=["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 D(t){this.mode=le.ALPHANUMERIC,this.data=t}D.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};D.prototype.getLength=function(){return this.data.length};D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)};D.prototype.write=function(e){let o;for(o=0;o+2<=this.data.length;o+=2){let r=q.indexOf(this.data[o])*45;r+=q.indexOf(this.data[o+1]),e.put(r,11)}this.data.length%2&&e.put(q.indexOf(this.data[o]),6)};var fe=D;const de=L;function U(t){this.mode=de.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}U.getBitsLength=function(e){return e*8};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(t){for(let e=0,o=this.data.length;e<o;e++)t.put(this.data[e],8)};var ge=U;const he=L,me=I;function v(t){this.mode=he.KANJI,this.data=t}v.getBitsLength=function(e){return e*13};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let o=me.toSJIS(this.data[e]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
  3. Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),t.put(o,13)}};var we=v,Lt={exports:{}};(function(t){var e={single_source_shortest_paths:function(o,r,n){var i={},a={};a[r]=0;var u=e.PriorityQueue.make();u.push(r,0);for(var s,l,c,E,m,f,d,w,A;!u.empty();){s=u.pop(),l=s.value,E=s.cost,m=o[l]||{};for(c in m)m.hasOwnProperty(c)&&(f=m[c],d=E+f,w=a[c],A=typeof a[c]=="undefined",(A||w>d)&&(a[c]=d,u.push(c,d),i[c]=l))}if(typeof n!="undefined"&&typeof a[n]=="undefined"){var C=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(C)}return i},extract_shortest_path_from_predecessor_list:function(o,r){for(var n=[],i=r;i;)n.push(i),o[i],i=o[i];return n.reverse(),n},find_path:function(o,r,n){var i=e.single_source_shortest_paths(o,r,n);return e.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(o){var r=e.PriorityQueue,n={},i;o=o||{};for(i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);return n.queue=[],n.sorter=o.sorter||r.default_sorter,n},default_sorter:function(o,r){return o.cost-r.cost},push:function(o,r){var n={value:o,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Lt);var Ce=Lt.exports;(function(t){const e=L,o=ce,r=fe,n=ge,i=we,a=M,u=I,s=Ce;function l(C){return unescape(encodeURIComponent(C)).length}function c(C,y,g){const h=[];let p;for(;(p=C.exec(g))!==null;)h.push({data:p[0],index:p.index,mode:y,length:p[0].length});return h}function E(C){const y=c(a.NUMERIC,e.NUMERIC,C),g=c(a.ALPHANUMERIC,e.ALPHANUMERIC,C);let h,p;return u.isKanjiModeEnabled()?(h=c(a.BYTE,e.BYTE,C),p=c(a.KANJI,e.KANJI,C)):(h=c(a.BYTE_KANJI,e.BYTE,C),p=[]),y.concat(g,h,p).sort(function(T,N){return T.index-N.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function m(C,y){switch(y){case e.NUMERIC:return o.getBitsLength(C);case e.ALPHANUMERIC:return r.getBitsLength(C);case e.KANJI:return i.getBitsLength(C);case e.BYTE:return n.getBitsLength(C)}}function f(C){return C.reduce(function(y,g){const h=y.length-1>=0?y[y.length-1]:null;return h&&h.mode===g.mode?(y[y.length-1].data+=g.data,y):(y.push(g),y)},[])}function d(C){const y=[];for(let g=0;g<C.length;g++){const h=C[g];switch(h.mode){case e.NUMERIC:y.push([h,{data:h.data,mode:e.ALPHANUMERIC,length:h.length},{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.ALPHANUMERIC:y.push([h,{data:h.data,mode:e.BYTE,length:h.length}]);break;case e.KANJI:y.push([h,{data:h.data,mode:e.BYTE,length:l(h.data)}]);break;case e.BYTE:y.push([{data:h.data,mode:e.BYTE,length:l(h.data)}])}}return y}function w(C,y){const g={},h={start:{}};let p=["start"];for(let B=0;B<C.length;B++){const T=C[B],N=[];for(let b=0;b<T.length;b++){const S=T[b],k=""+B+b;N.push(k),g[k]={node:S,lastCount:0},h[k]={};for(let G=0;G<p.length;G++){const P=p[G];g[P]&&g[P].node.mode===S.mode?(h[P][k]=m(g[P].lastCount+S.length,S.mode)-m(g[P].lastCount,S.mode),g[P].lastCount+=S.length):(g[P]&&(g[P].lastCount=S.length),h[P][k]=m(S.length,S.mode)+4+e.getCharCountIndicator(S.mode,y))}}p=N}for(let B=0;B<p.length;B++)h[p[B]].end=0;return{map:h,table:g}}function A(C,y){let g;const h=e.getBestModeForData(C);if(g=e.from(y,h),g!==e.BYTE&&g.bit<h.bit)throw new Error('"'+C+'" cannot be encoded with mode '+e.toString(g)+`.
  4. Suggested mode is: `+e.toString(h));switch(g===e.KANJI&&!u.isKanjiModeEnabled()&&(g=e.BYTE),g){case e.NUMERIC:return new o(C);case e.ALPHANUMERIC:return new r(C);case e.KANJI:return new i(C);case e.BYTE:return new n(C)}}t.fromArray=function(y){return y.reduce(function(g,h){return typeof h=="string"?g.push(A(h,null)):h.data&&g.push(A(h.data,h.mode)),g},[])},t.fromString=function(y,g){const h=E(y,u.isKanjiModeEnabled()),p=d(h),B=w(p,g),T=s.find_path(B.map,"start","end"),N=[];for(let b=1;b<T.length-1;b++)N.push(B.table[T[b]].node);return t.fromArray(f(N))},t.rawSplit=function(y){return t.fromArray(E(y,u.isKanjiModeEnabled()))}})(Rt);const Q=I,X=Y,ye=Zt,Ee=xt,pe=Bt,Be=At,nt=Tt,ot=$,Ae=ee,O=St,Te=Pt,Ie=L,Z=Rt;function Ne(t,e){const o=t.size,r=Be.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],a=r[n][1];for(let u=-1;u<=7;u++)if(!(i+u<=-1||o<=i+u))for(let s=-1;s<=7;s++)a+s<=-1||o<=a+s||(u>=0&&u<=6&&(s===0||s===6)||s>=0&&s<=6&&(u===0||u===6)||u>=2&&u<=4&&s>=2&&s<=4?t.set(i+u,a+s,!0,!0):t.set(i+u,a+s,!1,!0))}}function Se(t){const e=t.size;for(let o=8;o<e-8;o++){const r=o%2===0;t.set(o,6,r,!0),t.set(6,o,r,!0)}}function Me(t,e){const o=pe.getPositions(e);for(let r=0;r<o.length;r++){const n=o[r][0],i=o[r][1];for(let a=-2;a<=2;a++)for(let u=-2;u<=2;u++)a===-2||a===2||u===-2||u===2||a===0&&u===0?t.set(n+a,i+u,!0,!0):t.set(n+a,i+u,!1,!0)}}function Pe(t,e){const o=t.size,r=O.getEncodedBits(e);let n,i,a;for(let u=0;u<18;u++)n=Math.floor(u/3),i=u%3+o-8-3,a=(r>>u&1)===1,t.set(n,i,a,!0),t.set(i,n,a,!0)}function x(t,e,o){const r=t.size,n=Te.getEncodedBits(e,o);let i,a;for(i=0;i<15;i++)a=(n>>i&1)===1,i<6?t.set(i,8,a,!0):i<8?t.set(i+1,8,a,!0):t.set(r-15+i,8,a,!0),i<8?t.set(8,r-i-1,a,!0):i<9?t.set(8,15-i-1+1,a,!0):t.set(8,15-i-1,a,!0);t.set(r-8,8,1,!0)}function be(t,e){const o=t.size;let r=-1,n=o-1,i=7,a=0;for(let u=o-1;u>0;u-=2)for(u===6&&u--;;){for(let s=0;s<2;s++)if(!t.isReserved(n,u-s)){let l=!1;a<e.length&&(l=(e[a]>>>i&1)===1),t.set(n,u-s,l),i--,i===-1&&(a++,i=7)}if(n+=r,n<0||o<=n){n-=r,r=-r;break}}}function Re(t,e,o){const r=new ye;o.forEach(function(s){r.put(s.mode.bit,4),r.put(s.getLength(),Ie.getCharCountIndicator(s.mode,t)),s.write(r)});const n=Q.getSymbolTotalCodewords(t),i=ot.getTotalCodewordsCount(t,e),a=(n-i)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const u=(a-r.getLengthInBits())/8;for(let s=0;s<u;s++)r.put(s%2?17:236,8);return Le(r,t,e)}function Le(t,e,o){const r=Q.getSymbolTotalCodewords(e),n=ot.getTotalCodewordsCount(e,o),i=r-n,a=ot.getBlocksCount(e,o),u=r%a,s=a-u,l=Math.floor(r/a),c=Math.floor(i/a),E=c+1,m=l-c,f=new Ae(m);let d=0;const w=new Array(a),A=new Array(a);let C=0;const y=new Uint8Array(t.buffer);for(let T=0;T<a;T++){const N=T<s?c:E;w[T]=y.slice(d,d+N),A[T]=f.encode(w[T]),d+=N,C=Math.max(C,N)}const g=new Uint8Array(r);let h=0,p,B;for(p=0;p<C;p++)for(B=0;B<a;B++)p<w[B].length&&(g[h++]=w[B][p]);for(p=0;p<m;p++)for(B=0;B<a;B++)g[h++]=A[B][p];return g}function _e(t,e,o,r){let n;if(Array.isArray(t))n=Z.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const c=Z.rawSplit(t);l=O.getBestVersionForData(c,o)}n=Z.fromString(t,l||40)}else throw new Error("Invalid data");const i=O.getBestVersionForData(n,o);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=i;else if(e<i)throw new Error(`
  5. The chosen QR Code version cannot contain this amount of data.
  6. Minimum version required to store current data is: `+i+`.
  7. `);const a=Re(e,o,n),u=Q.getSymbolSize(e),s=new Ee(u);return Ne(s,e),Se(s),Me(s,e),x(s,o,0),e>=7&&Pe(s,e),be(s,a),isNaN(r)&&(r=nt.getBestMask(s,x.bind(null,s,o))),nt.applyMask(r,s),x(s,o,r),{modules:s,version:e,errorCorrectionLevel:o,maskPattern:r,segments:n}}Et.create=function(e,o){if(typeof e=="undefined"||e==="")throw new Error("No input text");let r=X.M,n,i;return typeof o!="undefined"&&(r=X.from(o.errorCorrectionLevel,X.M),n=O.from(o.version),i=nt.from(o.maskPattern),o.toSJISFunc&&Q.setToSJISFunction(o.toSJISFunc)),_e(e,n,r,i)};var _t={},ut={};(function(t){function e(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let r=o.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+o);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const n=parseInt(r.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=typeof r.margin=="undefined"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:i,scale:i?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+n.margin*2?n.width/(r+n.margin*2):n.scale},t.getImageWidth=function(r,n){const i=t.getScale(r,n);return Math.floor((r+n.margin*2)*i)},t.qrToImageData=function(r,n,i){const a=n.modules.size,u=n.modules.data,s=t.getScale(a,i),l=Math.floor((a+i.margin*2)*s),c=i.margin*s,E=[i.color.light,i.color.dark];for(let m=0;m<l;m++)for(let f=0;f<l;f++){let d=(m*l+f)*4,w=i.color.light;if(m>=c&&f>=c&&m<l-c&&f<l-c){const A=Math.floor((m-c)/s),C=Math.floor((f-c)/s);w=E[u[A*a+C]?1:0]}r[d++]=w.r,r[d++]=w.g,r[d++]=w.b,r[d]=w.a}}})(ut);(function(t){const e=ut;function o(n,i,a){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch(n){throw new Error("You need to specify a canvas element")}}t.render=function(i,a,u){let s=u,l=a;typeof s=="undefined"&&(!a||!a.getContext)&&(s=a,a=void 0),a||(l=r()),s=e.getOptions(s);const c=e.getImageWidth(i.modules.size,s),E=l.getContext("2d"),m=E.createImageData(c,c);return e.qrToImageData(m.data,i,s),o(E,l,c),E.putImageData(m,0,0),l},t.renderToDataURL=function(i,a,u){let s=u;typeof s=="undefined"&&(!a||!a.getContext)&&(s=a,a=void 0),s||(s={});const l=t.render(i,a,s),c=s.type||"image/png",E=s.rendererOpts||{};return l.toDataURL(c,E.quality)}})(_t);var Dt={};const De=ut;function Ct(t,e){const o=t.a/255,r=e+'="'+t.hex+'"';return o<1?r+" "+e+'-opacity="'+o.toFixed(2).slice(1)+'"':r}function tt(t,e,o){let r=t+e;return typeof o!="undefined"&&(r+=" "+o),r}function Ue(t,e,o){let r="",n=0,i=!1,a=0;for(let u=0;u<t.length;u++){const s=Math.floor(u%e),l=Math.floor(u/e);!s&&!i&&(i=!0),t[u]?(a++,u>0&&s>0&&t[u-1]||(r+=i?tt("M",s+o,.5+l+o):tt("m",n,0),n=0,i=!1),s+1<e&&t[u+1]||(r+=tt("h",a),a=0)):n++}return r}Dt.render=function(e,o,r){const n=De.getOptions(o),i=e.modules.size,a=e.modules.data,u=i+n.margin*2,s=n.color.light.a?"<path "+Ct(n.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",l="<path "+Ct(n.color.dark,"stroke")+' d="'+Ue(a,i,n.margin)+'"/>',c='viewBox="0 0 '+u+" "+u+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+c+' shape-rendering="crispEdges">'+s+l+`</svg>
  8. `;return typeof r=="function"&&r(null,m),m};const ve=qt,rt=Et,Ut=_t,ke=Dt;function ct(t,e,o,r,n){const i=[].slice.call(arguments,1),a=i.length,u=typeof i[a-1]=="function";if(!u&&!ve())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(n=o,o=e,e=r=void 0):a===3&&(e.getContext&&typeof n=="undefined"?(n=r,r=void 0):(n=r,r=o,o=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(o=e,e=r=void 0):a===2&&!e.getContext&&(r=o,o=e,e=void 0),new Promise(function(s,l){try{const c=rt.create(o,r);s(t(c,e,r))}catch(c){l(c)}})}try{const s=rt.create(o,r);n(null,t(s,e,r))}catch(s){n(s)}}rt.create;var vt=ct.bind(null,Ut.render),Fe=ct.bind(null,Ut.renderToDataURL);ct.bind(null,function(t,e,o){return ke.render(t,o)});const ze=({canvas:t,content:e,width:o=0,options:r={}})=>{const n=Vt(r);return n.errorCorrectionLevel=n.errorCorrectionLevel||Ve(e),He(e,n).then(i=>(n.scale=o===0?void 0:o/i*4,vt(t,e,n)))};function He(t,e){const o=document.createElement("canvas");return vt(o,t,e).then(()=>o.width)}function Ve(t){return t.length>36?"M":t.length>16?"Q":"H"}const Ke=({canvas:t,logo:e})=>{if(!e)return new Promise(y=>{y(t.toDataURL())});const o=t.width,{logoSize:r=.15,bgColor:n="#ffffff",borderSize:i=.05,crossOrigin:a,borderRadius:u=8,logoRadius:s=0}=e,l=Kt(e)?e:e.src,c=o*r,E=o*(1-r)/2,m=o*(r+i),f=o*(1-r-i)/2,d=t.getContext("2d");if(!d)return;yt(d)(f,f,m,m,u),d.fillStyle=n,d.fill();const w=new Image;(a||s)&&w.setAttribute("crossOrigin",a||"anonymous"),w.src=l;const A=y=>{d.drawImage(y,E,E,c,c)},C=y=>{const g=document.createElement("canvas");g.width=E+c,g.height=E+c;const h=g.getContext("2d");if(!h||!d||(h.drawImage(y,E,E,c,c),yt(d)(E,E,c,c,s),!d))return;const p=d.createPattern(g,"no-repeat");p&&(d.fillStyle=p,d.fill())};return new Promise(y=>{w.onload=()=>{s?C(w):A(w),y(t.toDataURL())}})};function yt(t){return(e,o,r,n,i)=>{const a=Math.min(r,n);return i>a/2&&(i=a/2),t.beginPath(),t.moveTo(e+i,o),t.arcTo(e+r,o,e+r,o+n,i),t.arcTo(e+r,o+n,e,o+n,i),t.arcTo(e,o+n,e,o,i),t.arcTo(e,o,e+r,o,i),t.closePath(),t}}const Je=t=>ze(t).then(()=>t).then(Ke),Oe=Ot({name:"QrCode",__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:t=>["canvas","img"].includes(t)}},emits:{done:t=>!!t,error:t=>!!t},setup(t,{expose:e,emit:o}){const r=t,n=o,i=Yt(null);function a(){return gt(this,null,function*(){try{const{tag:s,value:l,options:c={},width:E,logo:m}=r,f=String(l),d=W(i);if(!d)return;if(s==="canvas"){const w=yield Je({canvas:d,width:E,logo:m,content:f,options:c||{}});n("done",{url:w,ctx:d.getContext("2d")});return}if(s==="img"){const w=yield Fe(f,dt({errorCorrectionLevel:"H",width:E},c));W(i).src=w,n("done",{url:w})}}catch(s){n("error",s)}})}function u(s){let l="";const c=W(i);c instanceof HTMLCanvasElement?l=c.toDataURL():c instanceof HTMLImageElement&&(l=c.src),l&&Jt({url:l,fileName:s})}return $t(a),jt(r,()=>{a()},{deep:!0}),e({download:u}),(s,l)=>(ht(),Qt("div",null,[(ht(),Gt(Wt(t.tag),{ref_key:"wrapRef",ref:i},null,512))]))}}),We=Ht(Oe);export{We as Q};