import{w as W,i as kt,r as zt,a as Ot,b as j}from"./index-B6fu-u6K.js";import{n as v,c as Vt}from"./if-defined-D6swbWyQ.js";import"./index-CuJMoJHR.js";import"./index-DUZ-8KUm.js";var J={},Ht=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Bt={},b={};let ht;const Kt=[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];b.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};b.getSymbolTotalCodewords=function(t){return Kt[t]};b.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};b.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');ht=t};b.isKanjiModeEnabled=function(){return typeof ht<"u"};b.toSJIS=function(t){return ht(t)};var X={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.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: "+i)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,r){if(e.isValid(o))return o;try{return t(o)}catch{return r}}})(X);function At(){this.buffer=[],this.length=0}At.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 i=0;i>>t-i-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 Jt=At;function Y(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)}Y.prototype.set=function(e,t,i,o){const r=e*this.size+t;this.data[r]=i,o&&(this.reservedBit[r]=!0)};Y.prototype.get=function(e,t){return this.data[e*this.size+t]};Y.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};Y.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Yt=Y,It={};(function(e){const t=b.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const r=Math.floor(o/7)+2,n=t(o),s=n===145?26:Math.ceil((n-13)/(2*r-2))*2,u=[n-7];for(let a=1;a=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const n=r.size;let s=0,u=0,a=0,d=null,g=null;for(let B=0;B=5&&(s+=t.N1+(u-5)),d=w,u=1),w=r.get(y,B),w===g?a++:(a>=5&&(s+=t.N1+(a-5)),g=w,a=1)}u>=5&&(s+=t.N1+(u-5)),a>=5&&(s+=t.N1+(a-5))}return s},e.getPenaltyN2=function(r){const n=r.size;let s=0;for(let u=0;u=10&&(u===1488||u===93)&&s++,a=a<<1&2047|r.get(g,d),g>=10&&(a===1488||a===93)&&s++}return s*t.N3},e.getPenaltyN4=function(r){let n=0;const s=r.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(o,r),n}return o};var Gt=dt,Mt={},U={},gt={};gt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var M={};const Rt="[0-9]+",Qt="[A-Z $%*+\\-./:]+";let K="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";K=K.replace(/u/g,"\\u");const Wt="(?:(?![A-Z0-9 $%*+\\-./:]|"+K+`)(?:.|[\r ]))+`;M.KANJI=new RegExp(K,"g");M.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");M.BYTE=new RegExp(Wt,"g");M.NUMERIC=new RegExp(Rt,"g");M.ALPHANUMERIC=new RegExp(Qt,"g");const qt=new RegExp("^"+K+"$"),xt=new RegExp("^"+Rt+"$"),Xt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");M.testKanji=function(t){return qt.test(t)};M.testNumeric=function(t){return xt.test(t)};M.testAlphanumeric=function(t){return Xt.test(t)};(function(e){const t=gt,i=M;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,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 i.testNumeric(n)?e.NUMERIC:i.testAlphanumeric(n)?e.ALPHANUMERIC:i.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 o(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.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: "+r)}}e.from=function(n,s){if(e.isValid(n))return n;try{return o(n)}catch{return s}}})(U);(function(e){const t=b,i=Z,o=X,r=U,n=gt,s=7973,u=t.getBCHDigit(s);function a(y,w,E){for(let m=1;m<=40;m++)if(w<=e.getCapacity(m,E,y))return m}function d(y,w){return r.getCharCountIndicator(y,w)+4}function g(y,w){let E=0;return y.forEach(function(m){const p=d(m.mode,w);E+=p+m.getBitsLength()}),E}function B(y,w){for(let E=1;E<=40;E++)if(g(y,E)<=e.getCapacity(E,w,r.MIXED))return E}e.from=function(w,E){return n.isValid(w)?parseInt(w,10):E},e.getCapacity=function(w,E,m){if(!n.isValid(w))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=r.BYTE);const p=t.getSymbolTotalCodewords(w),f=i.getTotalCodewordsCount(w,E),l=(p-f)*8;if(m===r.MIXED)return l;const h=l-d(m,w);switch(m){case r.NUMERIC:return Math.floor(h/10*3);case r.ALPHANUMERIC:return Math.floor(h/11*2);case r.KANJI:return Math.floor(h/13);case r.BYTE:default:return Math.floor(h/8)}},e.getBestVersionForData=function(w,E){let m;const p=o.from(E,o.M);if(Array.isArray(w)){if(w.length>1)return B(w,p);if(w.length===0)return 1;m=w[0]}else m=w;return a(m.mode,m.getLength(),p)},e.getEncodedBits=function(w){if(!n.isValid(w)||w<7)throw new Error("Invalid QR Code version");let E=w<<12;for(;t.getBCHDigit(E)-u>=0;)E^=s<=0;)r^=Lt<0&&(o=this.data.substr(i),r=parseInt(o,10),t.put(r,n*3+1))};var te=F;const ee=U,nt=["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 k(e){this.mode=ee.ALPHANUMERIC,this.data=e}k.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};k.prototype.getLength=function(){return this.data.length};k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)};k.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let o=nt.indexOf(this.data[i])*45;o+=nt.indexOf(this.data[i+1]),t.put(o,11)}this.data.length%2&&t.put(nt.indexOf(this.data[i]),6)};var ne=k,re=function(t){for(var i=[],o=t.length,r=0;r=55296&&n<=56319&&o>r+1){var s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(n=(n-55296)*1024+s-56320+65536,r+=1)}if(n<128){i.push(n);continue}if(n<2048){i.push(n>>6|192),i.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){i.push(n>>12|224),i.push(n>>6&63|128),i.push(n&63|128);continue}if(n>=65536&&n<=1114111){i.push(n>>18|240),i.push(n>>12&63|128),i.push(n>>6&63|128),i.push(n&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const oe=re,ie=U;function z(e){this.mode=ie.BYTE,typeof e=="string"&&(e=oe(e)),this.data=new Uint8Array(e)}z.getBitsLength=function(t){return t*8};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(e){for(let t=0,i=this.data.length;t=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var ce=O,Dt={exports:{}};(function(e){var t={single_source_shortest_paths:function(i,o,r){var n={},s={};s[o]=0;var u=t.PriorityQueue.make();u.push(o,0);for(var a,d,g,B,y,w,E,m,p;!u.empty();){a=u.pop(),d=a.value,B=a.cost,y=i[d]||{};for(g in y)y.hasOwnProperty(g)&&(w=y[g],E=B+w,m=s[g],p=typeof s[g]>"u",(p||m>E)&&(s[g]=E,u.push(g,E),n[g]=d))}if(typeof r<"u"&&typeof s[r]>"u"){var f=["Could not find a path from ",o," to ",r,"."].join("");throw new Error(f)}return n},extract_shortest_path_from_predecessor_list:function(i,o){for(var r=[],n=o;n;)r.push(n),i[n],n=i[n];return r.reverse(),r},find_path:function(i,o,r){var n=t.single_source_shortest_paths(i,o,r);return t.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(i){var o=t.PriorityQueue,r={},n;i=i||{};for(n in o)o.hasOwnProperty(n)&&(r[n]=o[n]);return r.queue=[],r.sorter=i.sorter||o.default_sorter,r},default_sorter:function(i,o){return i.cost-o.cost},push:function(i,o){var r={value:i,cost:o};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Dt);var le=Dt.exports;(function(e){const t=U,i=te,o=ne,r=se,n=ce,s=M,u=b,a=le;function d(f){return unescape(encodeURIComponent(f)).length}function g(f,l,h){const c=[];let C;for(;(C=f.exec(h))!==null;)c.push({data:C[0],index:C.index,mode:l,length:C[0].length});return c}function B(f){const l=g(s.NUMERIC,t.NUMERIC,f),h=g(s.ALPHANUMERIC,t.ALPHANUMERIC,f);let c,C;return u.isKanjiModeEnabled()?(c=g(s.BYTE,t.BYTE,f),C=g(s.KANJI,t.KANJI,f)):(c=g(s.BYTE_KANJI,t.BYTE,f),C=[]),l.concat(h,c,C).sort(function(I,N){return I.index-N.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function y(f,l){switch(l){case t.NUMERIC:return i.getBitsLength(f);case t.ALPHANUMERIC:return o.getBitsLength(f);case t.KANJI:return n.getBitsLength(f);case t.BYTE:return r.getBitsLength(f)}}function w(f){return f.reduce(function(l,h){const c=l.length-1>=0?l[l.length-1]:null;return c&&c.mode===h.mode?(l[l.length-1].data+=h.data,l):(l.push(h),l)},[])}function E(f){const l=[];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 Ee(e){const t=e.size;for(let i=8;i>u&1)===1,e.set(r,n,s,!0),e.set(n,r,s,!0)}function it(e,t,i){const o=e.size,r=we.getEncodedBits(t,i);let n,s;for(n=0;n<15;n++)s=(r>>n&1)===1,n<6?e.set(n,8,s,!0):n<8?e.set(n+1,8,s,!0):e.set(o-15+n,8,s,!0),n<8?e.set(8,o-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(o-8,8,1,!0)}function Ae(e,t){const i=e.size;let o=-1,r=i-1,n=7,s=0;for(let u=i-1;u>0;u-=2)for(u===6&&u--;;){for(let a=0;a<2;a++)if(!e.isReserved(r,u-a)){let d=!1;s>>n&1)===1),e.set(r,u-a,d),n--,n===-1&&(s++,n=7)}if(r+=o,r<0||i<=r){r-=o,o=-o;break}}}function Ie(e,t,i){const o=new fe;i.forEach(function(a){o.put(a.mode.bit,4),o.put(a.getLength(),pe.getCharCountIndicator(a.mode,e)),a.write(o)});const r=tt.getSymbolTotalCodewords(e),n=lt.getTotalCodewordsCount(e,t),s=(r-n)*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const u=(s-o.getLengthInBits())/8;for(let a=0;a=7&&Be(a,t),Ae(a,s),isNaN(o)&&(o=ct.getBestMask(a,it.bind(null,a,i))),ct.applyMask(o,a),it(a,i,o),{modules:a,version:t,errorCorrectionLevel:i,maskPattern:o,segments:r}}Bt.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let o=rt.M,r,n;return typeof i<"u"&&(o=rt.from(i.errorCorrectionLevel,rt.M),r=x.from(i.version),n=ct.from(i.maskPattern),i.toSJISFunc&&tt.setToSJISFunction(i.toSJISFunc)),Ne(t,r,o,n)};var vt={},mt={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let o=i.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+i);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(n){return[n,n]}))),o.length===6&&o.push("F","F");const r=parseInt(o.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const r=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,n=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:n,scale:n?4:s,margin:r,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,r){return r.width&&r.width>=o+r.margin*2?r.width/(o+r.margin*2):r.scale},e.getImageWidth=function(o,r){const n=e.getScale(o,r);return Math.floor((o+r.margin*2)*n)},e.qrToImageData=function(o,r,n){const s=r.modules.size,u=r.modules.data,a=e.getScale(s,n),d=Math.floor((s+n.margin*2)*a),g=n.margin*a,B=[n.color.light,n.color.dark];for(let y=0;y=g&&w>=g&&y"u"&&(!s||!s.getContext)&&(a=s,s=void 0),s||(d=o()),a=t.getOptions(a);const g=t.getImageWidth(n.modules.size,a),B=d.getContext("2d"),y=B.createImageData(g,g);return t.qrToImageData(y.data,n,a),i(B,d,g),B.putImageData(y,0,0),d},e.renderToDataURL=function(n,s,u){let a=u;typeof a>"u"&&(!s||!s.getContext)&&(a=s,s=void 0),a||(a={});const d=e.render(n,s,a),g=a.type||"image/png",B=a.rendererOpts||{};return d.toDataURL(g,B.quality)}})(vt);var Ut={};const Te=mt;function Et(e,t){const i=e.a/255,o=t+'="'+e.hex+'"';return i<1?o+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':o}function st(e,t,i){let o=e+t;return typeof i<"u"&&(o+=" "+i),o}function Se(e,t,i){let o="",r=0,n=!1,s=0;for(let u=0;u0&&a>0&&e[u-1]||(o+=n?st("M",a+i,.5+d+i):st("m",r,0),r=0,n=!1),a+1':"",d="',g='viewBox="0 0 '+u+" "+u+'"',y=''+a+d+` `;return typeof o=="function"&&o(null,y),y};const Me=Ht,ft=Bt,Ft=vt,Re=Ut;function wt(e,t,i,o,r){const n=[].slice.call(arguments,1),s=n.length,u=typeof n[s-1]=="function";if(!u&&!Me())throw new Error("Callback required as last argument");if(u){if(s<2)throw new Error("Too few arguments provided");s===2?(r=i,i=t,t=o=void 0):s===3&&(t.getContext&&typeof r>"u"?(r=o,o=void 0):(r=o,o=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=o=void 0):s===2&&!t.getContext&&(o=i,i=t,t=void 0),new Promise(function(a,d){try{const g=ft.create(i,o);a(e(g,t,o))}catch(g){d(g)}})}try{const a=ft.create(i,o);r(null,e(a,t,o))}catch(a){r(a)}}J.create=ft.create;J.toCanvas=wt.bind(null,Ft.render);J.toDataURL=wt.bind(null,Ft.renderToDataURL);J.toString=wt.bind(null,function(e,t,i){return Re.render(e,i)});const Pe=.1,Ct=2.5,P=7;function at(e,t,i){return e===t?!1:(e-t<0?t-e:e-t)<=i+Pe}function Le(e,t){const i=Array.prototype.slice.call(J.create(e,{errorCorrectionLevel:t}).modules.data,0),o=Math.sqrt(i.length);return i.reduce((r,n,s)=>(s%o===0?r.push([n]):r[r.length-1].push(n))&&r,[])}const _e={generate({uri:e,size:t,logoSize:i,dotColor:o="#141414"}){const r="transparent",s=[],u=Le(e,"Q"),a=t/u.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach(({x:m,y:p})=>{const f=(u.length-P)*a*m,l=(u.length-P)*a*p,h=.45;for(let c=0;c `)}});const g=Math.floor((i+25)/a),B=u.length/2-g/2,y=u.length/2+g/2-1,w=[];u.forEach((m,p)=>{m.forEach((f,l)=>{if(u[p][l]&&!(pu.length-(P+1)&&lu.length-(P+1))&&!(p>B&&pB&&l{var f;E[m]?(f=E[m])==null||f.push(p):E[m]=[p]}),Object.entries(E).map(([m,p])=>{const f=p.filter(l=>p.every(h=>!at(l,h,a)));return[Number(m),f]}).forEach(([m,p])=>{p.forEach(f=>{s.push(W``)})}),Object.entries(E).filter(([m,p])=>p.length>1).map(([m,p])=>{const f=p.filter(l=>p.some(h=>at(l,h,a)));return[Number(m),f]}).map(([m,p])=>{p.sort((l,h)=>lc.some(C=>at(l,C,a)));h?h.push(l):f.push([l])}return[m,f.map(l=>[l[0],l[l.length-1]])]}).forEach(([m,p])=>{p.forEach(([f,l])=>{s.push(W` `)})}),s}},De=kt` :host { position: relative; user-select: none; display: block; overflow: hidden; aspect-ratio: 1 / 1; width: var(--local-size); } :host([data-theme='dark']) { border-radius: clamp(0px, var(--wui-border-radius-l), 40px); background-color: var(--wui-color-inverse-100); padding: var(--wui-spacing-l); } :host([data-theme='light']) { box-shadow: 0 0 0 1px var(--wui-color-bg-125); background-color: var(--wui-color-bg-125); } :host([data-clear='true']) > wui-icon { display: none; } svg:first-child, wui-image, wui-icon { position: absolute; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%); } wui-image { width: 25%; height: 25%; border-radius: var(--wui-border-radius-xs); } wui-icon { width: 100%; height: 100%; color: var(--local-icon-color) !important; transform: translateY(-50%) translateX(-50%) scale(0.25); } `;var L=function(e,t,i,o){var r=arguments.length,n=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,i):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(e,t,i,o);else for(var u=e.length-1;u>=0;u--)(s=e[u])&&(n=(r<3?s(n):r>3?s(t,i,n):s(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const ve="#3396ff";let T=class extends Ot{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=` --local-size: ${this.size}px; --local-icon-color: ${this.color??ve} `,j`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const t=this.theme==="light"?this.size:this.size-32;return W` ${_e.generate({uri:this.uri,size:t,logoSize:this.arenaClear?0:t/4,dotColor:this.color})} `}templateVisual(){return this.imageSrc?j``:this.farcaster?j``:j``}};T.styles=[zt,De];L([v()],T.prototype,"uri",void 0);L([v({type:Number})],T.prototype,"size",void 0);L([v()],T.prototype,"theme",void 0);L([v()],T.prototype,"imageSrc",void 0);L([v()],T.prototype,"alt",void 0);L([v()],T.prototype,"color",void 0);L([v({type:Boolean})],T.prototype,"arenaClear",void 0);L([v({type:Boolean})],T.prototype,"farcaster",void 0);T=L([Vt("wui-qr-code")],T);