import{R as te}from"./index-BNmigxWy.js";import{r as ee}from"./galois-field-CkUIqpA6.js";var z={},Q,Bt;function ne(){return Bt||(Bt=1,Q=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Q}var G={},U={},pt;function _(){if(pt)return U;pt=1;let r;const o=[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];return U.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},U.getSymbolTotalCodewords=function(n){return o[n]},U.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},U.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');r=n},U.isKanjiModeEnabled=function(){return typeof r<"u"},U.toSJIS=function(n){return r(n)},U}var $={},Rt;function wt(){return Rt||(Rt=1,function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+i)}}r.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},r.from=function(n,t){if(r.isValid(n))return n;try{return o(n)}catch{return t}}}($)),$}var W,At;function re(){if(At)return W;At=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let n=0;n>>i-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},W=r,W}var Z,It;function oe(){if(It)return Z;It=1;function r(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return r.prototype.set=function(o,i,n,t){const e=o*this.size+i;this.data[e]=n,t&&(this.reservedBit[e]=!0)},r.prototype.get=function(o,i){return this.data[o*this.size+i]},r.prototype.xor=function(o,i,n){this.data[o*this.size+i]^=n},r.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},Z=r,Z}var X={},Nt;function ie(){return Nt||(Nt=1,function(r){const o=_().getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,e=o(n),s=e===145?26:Math.ceil((e-13)/(2*t-2))*2,a=[e-7];for(let u=1;u=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){const e=t.size;let s=0,a=0,u=0,c=null,d=null;for(let B=0;B=5&&(s+=o.N1+(a-5)),c=f,a=1),f=t.get(h,B),f===d?u++:(u>=5&&(s+=o.N1+(u-5)),d=f,u=1)}a>=5&&(s+=o.N1+(a-5)),u>=5&&(s+=o.N1+(u-5))}return s},r.getPenaltyN2=function(t){const e=t.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,u=u<<1&2047|t.get(d,c),d>=10&&(u===1488||u===93)&&s++}return s*o.N3},r.getPenaltyN4=function(t){let e=0;const s=t.data.length;for(let u=0;u=0;){const s=e[0];for(let u=0;u0){const a=new Uint8Array(this.degree);return a.set(e,s),a}return e},nt=o,nt}var rt={},ot={},it={},Lt;function Gt(){return Lt||(Lt=1,it.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),it}var L={},Dt;function $t(){if(Dt)return L;Dt=1;const r="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r ]))+`;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),L.BYTE=new RegExp(n,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),e=new RegExp("^"+r+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(u){return t.test(u)},L.testNumeric=function(u){return e.test(u)},L.testAlphanumeric=function(u){return s.test(u)},L}var qt;function F(){return qt||(qt=1,function(r){const o=Gt(),i=$t();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,s){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?e.ccBits[0]:s<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return i.testNumeric(e)?r.NUMERIC:i.testAlphanumeric(e)?r.ALPHANUMERIC:i.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits};function n(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}r.from=function(e,s){if(r.isValid(e))return e;try{return n(e)}catch{return s}}}(ot)),ot}var vt;function fe(){return vt||(vt=1,function(r){const o=_(),i=Qt(),n=wt(),t=F(),e=Gt(),s=7973,a=o.getBCHDigit(s);function u(h,f,T){for(let M=1;M<=40;M++)if(f<=r.getCapacity(M,T,h))return M}function c(h,f){return t.getCharCountIndicator(h,f)+4}function d(h,f){let T=0;return h.forEach(function(M){const S=c(M.mode,f);T+=S+M.getBitsLength()}),T}function B(h,f){for(let T=1;T<=40;T++)if(d(h,T)<=r.getCapacity(T,f,t.MIXED))return T}r.from=function(f,T){return e.isValid(f)?parseInt(f,10):T},r.getCapacity=function(f,T,M){if(!e.isValid(f))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=t.BYTE);const S=o.getSymbolTotalCodewords(f),A=i.getTotalCodewordsCount(f,T),P=(S-A)*8;if(M===t.MIXED)return P;const I=P-c(M,f);switch(M){case t.NUMERIC:return Math.floor(I/10*3);case t.ALPHANUMERIC:return Math.floor(I/11*2);case t.KANJI:return Math.floor(I/13);case t.BYTE:default:return Math.floor(I/8)}},r.getBestVersionForData=function(f,T){let M;const S=n.from(T,n.M);if(Array.isArray(f)){if(f.length>1)return B(f,S);if(f.length===0)return 1;M=f[0]}else M=f;return u(M.mode,M.getLength(),S)},r.getEncodedBits=function(f){if(!e.isValid(f)||f<7)throw new Error("Invalid QR Code version");let T=f<<12;for(;o.getBCHDigit(T)-a>=0;)T^=s<=0;)u^=o<0&&(e=this.data.substr(t),s=parseInt(e,10),n.put(s,a*3+1))},at=o,at}var ct,Ft;function ge(){if(Ft)return ct;Ft=1;const r=F(),o=["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 i(n){this.mode=r.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let s=o.indexOf(this.data[e])*45;s+=o.indexOf(this.data[e+1]),t.put(s,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},ct=i,ct}var ft,kt;function he(){if(kt)return ft;kt=1;const r=F();function o(i){this.mode=r.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return o.getBitsLength=function(n){return n*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){for(let n=0,t=this.data.length;n=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),n.put(e,13)}},lt=i,lt}var dt={exports:{}},Vt;function we(){return Vt||(Vt=1,function(r){var o={single_source_shortest_paths:function(i,n,t){var e={},s={};s[n]=0;var a=o.PriorityQueue.make();a.push(n,0);for(var u,c,d,B,h,f,T,M,S;!a.empty();){u=a.pop(),c=u.value,B=u.cost,h=i[c]||{};for(d in h)h.hasOwnProperty(d)&&(f=h[d],T=B+f,M=s[d],S=typeof s[d]>"u",(S||M>T)&&(s[d]=T,a.push(d,T),e[d]=c))}if(typeof t<"u"&&typeof s[t]>"u"){var A=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(A)}return e},extract_shortest_path_from_predecessor_list:function(i,n){for(var t=[],e=n;e;)t.push(e),i[e],e=i[e];return t.reverse(),t},find_path:function(i,n,t){var e=o.single_source_shortest_paths(i,n,t);return o.extract_shortest_path_from_predecessor_list(e,t)},PriorityQueue:{make:function(i){var n=o.PriorityQueue,t={},e;i=i||{};for(e in n)n.hasOwnProperty(e)&&(t[e]=n[e]);return t.queue=[],t.sorter=i.sorter||n.default_sorter,t},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var t={value:i,cost:n};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=o}(dt)),dt.exports}var Kt;function Ce(){return Kt||(Kt=1,function(r){const o=F(),i=de(),n=ge(),t=he(),e=me(),s=$t(),a=_(),u=we();function c(A){return unescape(encodeURIComponent(A)).length}function d(A,P,I){const p=[];let b;for(;(b=A.exec(I))!==null;)p.push({data:b[0],index:b.index,mode:P,length:b[0].length});return p}function B(A){const P=d(s.NUMERIC,o.NUMERIC,A),I=d(s.ALPHANUMERIC,o.ALPHANUMERIC,A);let p,b;return a.isKanjiModeEnabled()?(p=d(s.BYTE,o.BYTE,A),b=d(s.KANJI,o.KANJI,A)):(p=d(s.BYTE_KANJI,o.BYTE,A),b=[]),P.concat(I,p,b).sort(function(y,C){return y.index-C.index}).map(function(y){return{data:y.data,mode:y.mode,length:y.length}})}function h(A,P){switch(P){case o.NUMERIC:return i.getBitsLength(A);case o.ALPHANUMERIC:return n.getBitsLength(A);case o.KANJI:return e.getBitsLength(A);case o.BYTE:return t.getBitsLength(A)}}function f(A){return A.reduce(function(P,I){const p=P.length-1>=0?P[P.length-1]:null;return p&&p.mode===I.mode?(P[P.length-1].data+=I.data,P):(P.push(I),P)},[])}function T(A){const P=[];for(let I=0;I=0&&w<=6&&(N===0||N===6)||N>=0&&N<=6&&(w===0||w===6)||w>=2&&w<=4&&N>=2&&N<=4?g.set(m+w,E+N,!0,!0):g.set(m+w,E+N,!1,!0))}}function T(g){const y=g.size;for(let C=8;C>w&1)===1,g.set(R,m,E,!0),g.set(m,R,E,!0)}function A(g,y,C){const l=g.size,R=d.getEncodedBits(y,C);let m,E;for(m=0;m<15;m++)E=(R>>m&1)===1,m<6?g.set(m,8,E,!0):m<8?g.set(m+1,8,E,!0):g.set(l-15+m,8,E,!0),m<8?g.set(8,l-m-1,E,!0):m<9?g.set(8,15-m-1+1,E,!0):g.set(8,15-m-1,E,!0);g.set(l-8,8,1,!0)}function P(g,y){const C=g.size;let l=-1,R=C-1,m=7,E=0;for(let w=C-1;w>0;w-=2)for(w===6&&w--;;){for(let N=0;N<2;N++)if(!g.isReserved(R,w-N)){let v=!1;E>>m&1)===1),g.set(R,w-N,v),m--,m===-1&&(E++,m=7)}if(R+=l,R<0||C<=R){R-=l,l=-l;break}}}function I(g,y,C){const l=new i;C.forEach(function(N){l.put(N.mode.bit,4),l.put(N.getLength(),B.getCharCountIndicator(N.mode,g)),N.write(l)});const R=r.getSymbolTotalCodewords(g),m=a.getTotalCodewordsCount(g,y),E=(R-m)*8;for(l.getLengthInBits()+4<=E&&l.put(0,4);l.getLengthInBits()%8!==0;)l.putBit(0);const w=(E-l.getLengthInBits())/8;for(let N=0;N=7&&S(N,y),P(N,E),isNaN(l)&&(l=s.getBestMask(N,A.bind(null,N,C))),s.applyMask(l,N),A(N,C,l),{modules:N,version:y,errorCorrectionLevel:C,maskPattern:l,segments:R}}return G.create=function(y,C){if(typeof y>"u"||y==="")throw new Error("No input text");let l=o.M,R,m;return typeof C<"u"&&(l=o.from(C.errorCorrectionLevel,o.M),R=c.from(C.version),m=s.from(C.maskPattern),C.toSJISFunc&&r.setToSJISFunction(C.toSJISFunc)),b(y,R,l,m)},G}var gt={},ht={},Jt;function Wt(){return Jt||(Jt=1,function(r){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(e){return[e,e]}))),n.length===6&&n.push("F","F");const t=parseInt(n.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+n.slice(0,6).join("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const t=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,e=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:e,scale:e?4:s,margin:t,color:{dark:o(n.color.dark||"#000000ff"),light:o(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,t){return t.width&&t.width>=n+t.margin*2?t.width/(n+t.margin*2):t.scale},r.getImageWidth=function(n,t){const e=r.getScale(n,t);return Math.floor((n+t.margin*2)*e)},r.qrToImageData=function(n,t,e){const s=t.modules.size,a=t.modules.data,u=r.getScale(s,e),c=Math.floor((s+e.margin*2)*u),d=e.margin*u,B=[e.color.light,e.color.dark];for(let h=0;h=d&&f>=d&&h"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=n()),u=o.getOptions(u);const d=o.getImageWidth(e.modules.size,u),B=c.getContext("2d"),h=B.createImageData(d,d);return o.qrToImageData(h.data,e,u),i(B,c,d),B.putImageData(h,0,0),c},r.renderToDataURL=function(e,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=r.render(e,s,u),d=u.type||"image/png",B=u.rendererOpts||{};return c.toDataURL(d,B.quality)}}(gt)),gt}var mt={},jt;function Be(){if(jt)return mt;jt=1;const r=Wt();function o(t,e){const s=t.a/255,a=e+'="'+t.hex+'"';return s<1?a+" "+e+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(t,e,s){let a=t+e;return typeof s<"u"&&(a+=" "+s),a}function n(t,e,s){let a="",u=0,c=!1,d=0;for(let B=0;B0&&h>0&&t[B-1]||(a+=c?i("M",h+s,.5+f+s):i("m",u,0),u=0,c=!1),h+1':"",f="',T='viewBox="0 0 '+B+" "+B+'"',S=''+h+f+` `;return typeof a=="function"&&a(null,S),S},mt}var Ot;function pe(){if(Ot)return z;Ot=1;const r=ne(),o=ye(),i=Ee(),n=Be();function t(e,s,a,u,c){const d=[].slice.call(arguments,1),B=d.length,h=typeof d[B-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(B<2)throw new Error("Too few arguments provided");B===2?(c=a,a=s,s=u=void 0):B===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(B<1)throw new Error("Too few arguments provided");return B===1?(a=s,s=u=void 0):B===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(f,T){try{const M=o.create(a,u);f(e(M,s,u))}catch(M){T(M)}})}try{const f=o.create(a,u);c(null,e(f,s,u))}catch(f){c(f)}}return z.create=o.create,z.toCanvas=t.bind(null,i.render),z.toDataURL=t.bind(null,i.renderToDataURL),z.toString=t.bind(null,function(e,s,a){return n.render(e,a)}),z}var Re=pe();const Ne=te(Re);export{Ne as Q};