memoscan
← all memos

Memo 0xab6ed142…898399 on Ethereum

ffDepth:$,contracting:Fe||B==="to"&&Se?.mode!=="to",contractionExtent:bt,board:be,sourceBoard:Se?H.slice():B==="from"?be.slice():We,sourceDormant:le,sourceLight:Se?Float32Array.from(w,(Ze,Nt)=>be[Nt]?Math.max(Ze,Math.min(.34,.1+$*.07)):Ze):Float32Array.from(B==="to"&&Pe?Pe:be,Number),fieldBoard:Pe,fieldThresholds:Se&&!ce&&!Fe?Ei(H,B==="from"?Pe??m.frames[0]:be,m.seed^Math.imul($,2654435769),$):null,fieldSourceLight:null,fieldTargetLight:null,fieldSourceProvider:null,fieldTargetProvider:null,life:xi(De,ee),startedAt:c,duration:st},Z=null,B==="from"){if(!Se){H=be.slice();for(let Ze=0;Ze<He;Ze+=1)w[Ze]=be[Ze],a[Ze]=0}d=c}else!Se&&Pe&&(H=Pe.slice(),w.set(Pe),a.fill(0),s.set(Pe),d=c);return st},Ae=(B,Y,Ve,Me,De,we,Fe,be)=>{T=Me;let Pe=x,Se=Pe?Pe.handoffDepth+1:0,$=Pe?H.slice():fn(B,H),We=Pe?s.slice():zr(De),Je=Pe?w.slice():Float32Array.from($,Number),le=fn(Y,m.frames[0]),ce=Ei($,le,m.seed);return x={mode:"field",handoffDepth:Se,contracting:!1,contractionExtent:1,board:le,sourceBoard:$,sourceDormant:new Uint8Array(He),sourceLight:Je,fieldBoard:null,fieldThresholds:ce,fieldSourceLight:We,fieldTargetLight:zr(we),fieldSourceProvider:be??null,fieldTargetProvider:Fe??null,life:ee,startedAt:c,duration:Pe?Math.max(650,Ve/(1+Se*.7)):Math.max(1,Ve)},Z=null,Pe||(H=$.slice(),w.set($),a.fill(0),s.set(We??$)),d=c,x.duration},Te=new ResizeObserver(ne);return Te.observe(t),ne(),g(),{render:k,finishTransition:()=>(x&&k(x.startedAt+x.duration),c),isTransitioning:()=>x!==null,snapshot:(B=0)=>{if(B<=0)return H.slice();let Y=Math.round((c+B)/Ai);return m.frames[Ln(Y)].slice()},lightSnapshot:()=>s.slice(),setLifeProfile:B=>{ee=xi(B,ee)},transitionField:Ae,transitionFrom:(B,Y,Ve,Me)=>ye("from",B,Y,Ve,void 0,Me),transitionTo:(B,Y,Ve,Me,De,we,Fe)=>{let be=ye("to",B,Y,Ve,Me,De,we);return x&&(x.fieldSourceProvider=Fe??null),be},resize:ne,start:g,stop:q,destroy(){q(),Te.disconnect()}}}function fn(t,e){if(!t||t.length!==He)return e.slice();let o=Uint8Array.from({length:He},(i,u)=>t[u]?1:0);return o.some(Boolean)?o:e.slice()}function Mi(t,e){if(t.length!==e.length)return!1;for(let o=0;o<t.length;o+=1)if(t[o]!==e[o])return!1;return!0}function jl(t){return Float32Array.from({length:He},(e,o)=>{let i=o%se,u=Math.floor(o/se),l=Math.abs(i-tn)/Math.max(1,tn),m=Math.abs(u-tn)/Math.max(1,tn),w=l*.58+m*.34+Math.min(l,m)*.08,a=Math.atan2(u-tn,i-tn),s=Math.sin(a*3+(t&255)/255*Math.PI*2)*.045,c=((pn(t+Math.imul(o+1,2654435769))>>>8)/16777215-.5)*.12;return pt(.015+w*.9+s+c,.01,.97)})}function Kl(t){let e=new Float32Array(He),o=new Float32Array(He),i=new Float32Array(He),u=new Float32Array(He).fill(1);for(let l=0;l<He;l+=1){let m=l%se,a=Math.floor(l/se)*se+(se-1-m),s=Math.min(l,a),c=pn(t+Math.imul(s+1,2654435769)),d=pn(c^2246822507);e[l]=(c>>>8)/16777215*Math.PI*2,o[l]=1.25+(d>>>8)/16777215*1.8,i[l]=.2+(c>>>24)/255*.16}return{phase:e,rate:o,depth:i,gain:u,timeScale:1}}function xi(t,e){return!t||t.phase.length!==He||t.rate.length!==He||t.depth.length!==He||t.gain.length!==He||!Number.isFinite(t.timeScale)||t.timeScale<=0?e:t}function Zl(t,e,o,i){if(i>=1)return e.mode==="from"?t:e.board;let u=new Uint8Array(He);for(let l=0;l<He;l+=1){let m=i>=Pn(e,o,l);if(e.mode==="field"){u[l]=m?e.board[l]:e.sourceBoard[l];continue}m?u[l]=e.mode==="from"?t[l]:e.board[l]:u[l]=e.sourceDormant[l]?t[l]:e.sourceBoard[l]}return u}function Pn(t,e,o){return t.fieldThresholds?t.fieldThresholds[o]:t.contracting?pt(1-e[o]/Math.max(.01,t.contractionExtent),0,.995):e[o]}function Ei(t,e,o,i=0){let u=Ri(t),l=Ri(e),m=Math.max(.76,1-i*.06);return Float32Array.from({length:He},(w,a)=>{if(t[a]===e[a])return 0;let s=a%se,c=Math.floor(a/se),d=.5+.25*Math.sin(s*.61+c*.27+(o&255)/255*Math.PI*2)+.25*Math.sin(s*.19-c*.53+(o>>>8&255)/255*Math.PI*2),h=(pn(o^Math.imul(a+1,2654435769))>>>8)/16777215;if(e[a]){let b=Math.min(1,u[a]/4);return pt((.08+b*.28+d*.45+h*.1)*m,.04,.92)}let C=Math.min(1,l[a]/4);return pt((.06+(1-C)*.2+d*.48+h*.11)*m,.03,.88)})}function Ri(t){let e=new Uint8Array(He).fill(255),o=new Uint16Array(He),i=0,u=0;for(let l=0;l<He;l+=1)t[l]&&(e[l]=0,o[u++]=l);for(;i<u;){let l=o[i++],m=l%se,w=Math.floor(l/se);for(let a=-1;a<=1;a+=1)for(let s=-1;s<=1;s+=1){if(s===0&&a===0)continue;let c=m+s,d=w+a;if(c<0||c>=se||d<0||d>=se)continue;let h=d*se+c,C=e[l]+1;C>=e[h]||(e[h]=C,o[u++]=h)}}return e}function Ql(t,e){let o=`${e}:${t.toLowerCase()}`,i=sr.get(o);if(i)return i;let u=Jl(t,e,0);return sr.set(o,u),sr.size>ql&&sr.delete(sr.keys().next().value),u}function Jl(t,e,o){let i=kn(t,e,"legacy"),u=$o(t,e,o),l=72+pn(u^1831565813)%113,m=Go(u,l);return{frames:Array.from({length:Yr},()=>m.slice()),motion:i,seed:u}}function ec(t,e,o,i,u,l,m,w,a,s,c,d,h,C,b,H,x,Z,T,K){let M=t.width/Math.max(1,t.getBoundingClientRect().width),z=t.width/M;e.setTransform(M,0,0,M,0,0),e.clearRect(0,0,z,z),e.fillStyle=H.background,e.fillRect(0,0,z,z);let ee=z/se,k=Math.max(1,ee*.12),ne=Math.max(.5,ee-k),Q=k/2;e.fillStyle=H.cell,e.globalAlpha=.045;for(let g=0;g<He;g+=1)ki(e,g,ee,Q,ne,1,C.motion.cornerSize);for(let g=0;g<He;g+=1){K[g]=0;let q=g%se,ye=Math.floor(g/se),B=(pn(C.seed^Math.imul(g+1,2654435769)^Math.imul(w+1,2246822507))>>>8)/16777215*Math.min(.82,C.motion.stagger),Y=hn(pt((m-B)/(1-B),0,1)),Ve=i[g],Me=u[g],De=Ve+(Me-Ve)*Y,we=o[g]*(1-m)*C.motion.trail+l[g]*m*C.motion.trail,Fe=Math.max(De,we);if(x&&Z<Pn(x,T,g)&&x.sourceDormant[g]===0&&(Fe=x.sourceLight[g]),c)d[g]=Fe,h[g]=0;else{let le=Fe>=d[g]?108:72,ce=Fe>=d[g]?18:15;h[g]+=(Fe-d[g])*le*s,h[g]*=Math.exp(-ce*s),d[g]=pt(d[g]+h[g]*s,0,1.08)}let be=pt(d[g],0,1);if(be<.004)continue;let Se=Ve!==Me?Math.sin(Math.PI*Y):0,$=Ci(be,a,g,q,ye,b),We=$;if(x?.mode==="field"){let le=Pn(x,T,g),ce=hn(pt((Z-Math.max(0,le-.09))/.18,0,1)),_e=x.fieldSourceLight?.[g]??$,bt=x.fieldTargetLight?.[g]??$;We=_e+(bt-_e)*ce}if(x?.mode==="to"&&x.fieldSourceLight){let le=Pn(x,T,g),ce=hn(pt((Z-Math.max(0,le-.08))/.16,0,1));We=x.fieldSourceLight[g]+(We-x.fieldSourceLight[g])*ce}if(x?.mode==="to"&&x.board[g]===1){let le=Ci(be,a,g,q,ye,x.life),ce=Pn(x,T,g),_e=Math.max(0,ce-.08),bt=Math.min(.995,ce+.08),Dt=hn(pt((Z-_e)/Math.max(.001,bt-_e),0,1));We+=(le-We)*Dt}K[g]=We;let Je=Math.min(1.06,.76+hn(be)*.23+Se*C.motion.flutter);e.globalAlpha=We,ki(e,g,ee,Q,ne,Je,C.motion.cornerSize)}e.globalAlpha=1}function zr(t){return!t||t.length!==He?null:Float32Array.from({length:He},(e,o)=>pt(Number(t[o])||0,0,1))}function Ci(t,e,o,i,u,l){let m=e/1e3*l.timeScale,w=Number(l.phase[o]),a=Number(l.rate[o]),s=.5+Math.sin(m*a+w)*.5,c=.5+Math.sin(m*a*.43+w*1.71+Math.hypot(i-tn,u-tn)*.31)*.5,d=1-Number(l.depth[o])*(s*.76+c*.24);return pt(t*Number(l.gain[o])*.92*d,0,1)}function ki(t,e,o,i,u,l,m){let w=u*l,a=(u-w)/2,s=e%se*o+i+a,c=Math.floor(e/se)*o+i+a;t.beginPath(),t.roundRect(s,c,w,w,Math.min(m*o/19,w*.2)),t.fill()}function $o(t,e,o){let i=2166136261,u=`${t.toLowerCase()}:${Math.trunc(e)}:${Math.trunc(o)}`;for(let l=0;l<u.length;l+=1)i^=u.charCodeAt(l),i=Math.imul(i,16777619);return pn(i)}function pn(t){let e=t>>>0;return e^=e>>>16,e=Math.imul(e,2146121005),e^=e>>>15,e=Math.imul(e,2221713035),(e^e>>>16)>>>0}function Ln(t){return(Math.trunc(t)%Yr+Yr)%Yr}function pt(t,e,o){return Math.max(e,Math.min(o,t))}function hn(t){let e=pt(t,0,1);return e*e*e*(e*(e*6-15)+10)}var lr=zo,tc=Yo,Xo=se*se,Xr=1831565813;function Dn(t,e,o={}){let i=t.getContext("2d");if(!i)throw new Error("The unawakened renderer requires a 2D canvas context");let u=0,l=0,m,w=!1,a=0,s=Gr(Xr),c=dn(s),d=ir(s),h=dn(d),C=c.slice(),b=new Float32Array(Xo),H=-1/0,x=o.maxFps&&o.maxFps>0?1e3/o.maxFps:0,Z=()=>{a=0,s=Gr(Xr),c=dn(s),d=ir(s),h=dn(d)},T=Q=>{for(Q<a&&Z();a<Q;)a+=1,s=d,c=h,d=ir(s),h=dn(d)},K=Q=>{u=Math.max(0,Q);let g=u/_r,q=Math.floor(g),ye=g-q;T(q);let Ae=Math.max(1,t.getBoundingClientRect().width),Te=Math.min(window.devicePixelRatio||1,o.maxPixelRatio??2),B=Math.round(Ae*Te);(t.width!==B||t.height!==B)&&(t.width=B,t.height=B),i.setTransform(Te,0,0,Te,0,0),i.fillStyle=lr,i.fillRect(0,0,Ae,Ae);let Y=Ae/se,Ve=Math.max(1,Y*.12),Me=Math.max(.5,Y-Ve),De=Ve/2;i.fillStyle=tc,i.globalAlpha=.05;for(let we=0;we<Xo;we+=1)b[we]=0,vi(i,we,Y,De,Me,1,e);for(let we=0;we<Xo;we+=1){let Fe=Vo(Xr^Math.imul(we+1,2654435769)^Math.imul(a+1,2246822507)),be=(Fe>>>8)/16777215*.72,Pe=Li(qo((ye-be)/(1-be),0,1)),Se=c[we]+(h[we]-c[we])*Pe;if(C[we]=Se>=.5?1:0,Se<.004)continue;let $=Vo(Xr^Math.imul(we+1,668265261)),We=($>>>8)/16777215*Math.PI*2,Je=(Vo($^2246822507)>>>8)/16777215*Math.PI*2,le=1.2+(Fe>>>24)/255*1.8,ce=.5+.5*Math.sin(u/1e3*le+We),_e=.5+.5*Math.sin(u/1e3*(.48+($&255)/255*.48)+Je+we%se*.21-Math.floor(we/se)*.13),bt=we%se,Dt=Math.floor(we/se),st=.5+.5*Math.sin(u/1e3*.74+bt*.34+Dt*.18+Math.sin(bt*.17-Dt*.29)*.7),Ze=.28+ce*.34+_e*.16+st*.22,Nt=qo(Se*Ze,0,1);b[we]=Nt,i.globalAlpha=Nt,vi(i,we,Y,De,Me,.76+Li(Se)*.23,e)}i.globalAlpha=1},M=()=>K(u),z=Q=>{w&&(l===0&&(l=Q-u),Q-H>=x-1&&(H=Q,K(Q-l)),m=window.requestAnimationFrame(z))},ee=()=>{w||(w=!0,l=0,H=-1/0,m=window.requestAnimationFrame(z))},k=()=>{w=!1,m!==void 0&&window.cancelAnimationFrame(m),m=void 0},ne=new ResizeObserver(M);return ne.observe(t),M(),ee(),{render:K,snapshot:()=>C.slice(),lightSnapshot:()=>b.slice(),resize:M,start:ee,stop:k,destroy(){k(),ne.disconnect()}}}function vi(t,e,o,i,u,l,m){let w=u*l,a=(u-w)/2,s=e%se*o+i+a,c=Math.floor(e/se)*o+i+a;t.beginPath(),t.roundRect(s,c,w,w,Math.min(m*o/19,w*.2)),t.fill()}function Vo(t){let e=t>>>0;return e^=e>>>16,e=Math.imul(e,2146121005),e^=e>>>15,e=Math.imul(e,2221713035),(e^e>>>16)>>>0}function qo(t,e,o){return Math.max(e,Math.min(o,t))}function Li(t){let e=qo(t,0,1);return e*e*e*(e*(e*6-15)+10)}var jo;(t=>{let l=class l{constructor(a,s,c,d){ae(this,"size");ae(this,"mask");ae(this,"modules",[]);ae(this,"isFunction",[]);if(this.version=a,this.errorCorrectionLevel=s,a<l.MIN_VERSION||a>l.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=a*4+17;let h=[];for(let b=0;b<this.size;b++)h.push(!1);for(let b=0;b<this.size;b++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();let C=this.addEccAndInterleave(c);if(this.drawCodewords(C),d===-1){let b=1e9;for(let H=0;H<8;H++){this.applyMask(H),this.drawFormatBits(H);let x=this.getPenaltyScore();x<b&&(d=H,b=x),this.applyMask(H)}}this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(a,s){let c=t.QrSegment.makeSegments(a);return l.encodeSegments(c,s)}static encodeBinary(a,s){let c=t.QrSegment.makeBytes(a);return l.encodeSegments([c],s)}static encodeSegments(a,s,c=1,d=40,h=-1,C=!0){if(!(l.MIN_VERSION<=c&&c<=d&&d<=l.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let b,H;for(b=c;;b++){let K=l.getNumDataCodewords(b,s)*8,M=u.getTotalBits(a,b);if(M<=K){H=M;break}if(b>=d)throw new RangeError("Data too long")}for(let K of[l.Ecc.MEDIUM,l.Ecc.QUARTILE,l.Ecc.HIGH])C&&H<=l.getNumDataCodewords(b,K)*8&&(s=K);let x=[];for(let K of a){o(K.mode.modeBits,4,x),o(K.numChars,K.mode.numCharCountBits(b),x);for(let M of K.getData())x.push(M)}let Z=l.getNumDataCodewords(b,s)*8;o(0,Math.min(4,Z-x.length),x),o(0,(8-x.length%8)%8,x);for(let K=236;x.length<Z;K^=253)o(K,8,x);let T=[];for(;T.length*8<x.length;)T.push(0);return x.forEach((K,M)=>T[M>>>3]|=K<<7-(M&7)),new l(b,s,T,h)}getModule(a,s){return a>=0&&a<this.size&&s>=0&&s<this.size&&this.modules[s][a]}getModules(){return this.modules}drawFunctionPatterns(){for(let c=0;c<this.size;c++)this.setFunctionModule(6,c,c%2===0),this.setFunctionModule(c,6,c%2===0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let a=this.getAlignmentPatternPositions(),s=a.length;for(let c=0;c<s;c++)for(let d=0;d<s;d++)c===0&&d===0||c===0&&d===s-1||c===s-1&&d===0||this.drawAlignmentPattern(a[c],a[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(a){let s=this.errorCorrectionLevel.formatBits<<3|a,c=s;for(let h=0;h<10;h++)c=c<<1^(c>>>9)*1335;let d=(s<<10|c)^21522;for(let h=0;h<=5;h++)this.setFunctionModule(8,h,i(d,h));this.setFunctionModule(8,7,i(d,6)),this.setFunctionModule(8,8,i(d,7)),this.setFunctionModule(7,8,i(d,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,i(d,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,i(d,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,i(d,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;let s=this.version<<12|a;for(let c=0;c<18;c++){let d=i(s,c),h=this.size-11+c%3,C=Math.floor(c/3);this.setFunctionModule(h,C,d),this.setFunctionModule(C,h,d)}}drawFinderPattern(a,s){for(let c=-4;c<=4;c++)for(let d=-4;d<=4;d++){let h=Math.max(Math.abs(d),Math.abs(c)),C=a+d,b=s+c;C>=0&&C<this.size&&b>=0&&b<this.size&&this.setFunctionModule(C,b,h!==2&&h!==4)}}drawAlignmentPattern(a,s){for(let c=-2;c<=2;c++)for(let d=-2;d<=2;d++)this.setFunctionModule(a+d,s+c,Math.max(Math.abs(d),Math.abs(c))!==1)}setFunctionModule(a,s,c){this.modules[s][a]=c,this.isFunction[s][a]=!0}addEccAndInterleave(a){let s=this.version,c=this.errorCorrectionLevel;if(a.length!==l.getNumDataCodewords(s,c))throw new RangeError("Invalid argument");let d=l.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][s],h=l.ECC_CODEWORDS_PER_BLOCK[c.ordinal][s],C=Math.floor(l.getNumRawDataModules(s)/8),b=d-C%d,H=Math.floor(C/d),x=[],Z=l.reedSolomonComputeDivisor(h);for(let K=0,M=0;K<d;K++){let z=a.slice(M,M+H-h+(K<b?0:1));M+=z.length;let ee=l.reedSolomonComputeRemainder(z,Z);K<b&&z.push(0),x.push(z.concat(ee))}let T=[];for(let K=0;K<x[0].length;K++)x.forEach((M,z)=>{(K!==H-h||z>=b)&&T.push(M[K])});return T}drawCodewords(a){if(a.length!==Math.floor(l.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c===6&&(c=5);for(let d=0;d<this.size;d++)for(let h=0;h<2;h++){let C=c-h,H=(c+1&2)===0?this.size-1-d:d;!this.isFunction[H][C]&&s<a.length*8&&(this.modules[H][C]=i(a[s>>>3],7-(s&7)),s++)}}}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let c=0;c<this.size;c++){let d;switch(a){case 0:d=(c+s)%2===0;break;case 1:d=s%2===0;break;case 2:d=c%3===0;break;case 3:d=(c+s)%3===0;break;case 4:d=(Math.floor(c/3)+Math.floor(s/2))%2===0;break;case 5:d=c*s%2+c*s%3===0;break;case 6:d=(c*s%2+c*s%3)%2===0;break;case 7:d=((c+s)%2+c*s%3)%2===0;break;default:throw new Error("Unreachable")}!this.isFunction[s][c]&&d&&(this.modules[s][c]=!this.modules[s][c])}}getPenaltyScore(){let a=0;for(let h=0;h<this.size;h++){let C=!1,b=0,H=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[h][x]===C?(b++,b===5?a+=l.PENALTY_N1:b>5&&a++):(this.finderPenaltyAddHistory(b,H),C||(a+=this.finderPenaltyCountPatterns(H)*l.PENALTY_N3),C=this.modules[h][x],b=1);a+=this.finderPenaltyTerminateAndCount(C,b,H)*l.PENALTY_N3}for(let h=0;h<this.size;h++){let C=!1,b=0,H=[0,0,0,0,0,0,0];for(let x=0;x<this.size;x++)this.modules[x][h]===C?(b++,b===5?a+=l.PENALTY_N1:b>5&&a++):(this.finderPenaltyAddHistory(b,H),C||(a+=this.finderPenaltyCountPatterns(H)*l.PENALTY_N3),C=this.modules[x][h],b=1);a+=this.finderPenaltyTerminateAndCount(C,b,H)*l.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let C=0;C<this.size-1;C++){let b=this.modules[h][C];b===this.modules[h][C+1]&&b===this.modules[h+1][C]&&b===this.modules[h+1][C+1]&&(a+=l.PENALTY_N2)}let s=0;for(let h of this.modules)s=h.reduce((C,b)=>C+(b?1:0),s);let c=this.size*this.size,d=Math.ceil(Math.abs(s*20-c*10)/c)-1;return a+=d*l.PENALTY_N4,a}getAlignmentPatternPositions(){if(this.version===1)return[];{let a=Math.floor(this.version/7)+2,s=this.version===32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,c=[6];for(let d=this.size-7;c.length<a;d-=s)c.splice(1,0,d);return c}}static getNumRawDataModules(a){if(a<l.MIN_VERSION||a>l.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*a+128)*a+64;if(a>=2){let c=Math.floor(a/7)+2;s-=(25*c-10)*c-55,a>=7&&(s-=36)}return s}static getNumDataCodewords(a,s){return Math.floor(l.getNumRawDataModules(a)/8)-l.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a]*l.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");let s=[];for(let d=0;d<a-1;d++)s.push(0);s.push(1);let c=1;for(let d=0;d<a;d++){for(let h=0;h<s.length;h++)s[h]=l.reedSolomonMultiply(s[h],c),h+1<s.length&&(s[h]^=s[h+1]);c=l.reedSolomonMultiply(c,2)}return s}static reedSolomonComputeRemainder(a,s){let c=s.map(d=>0);for(let d of a){let h=d^c.shift();c.push(0),s.forEach((C,b)=>c[b]^=l.reedSolomonMultiply(C,h))}return c}static reedSolomonMultiply(a,s){if(a>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let d=7;d>=0;d--)c=c<<1^(c>>>7)*285,c^=(s>>>d&1)*a;return c}finderPenaltyCountPatterns(a){let s=a[1],c=s>0&&a[2]===s&&a[3]===s*3&&a[4]===s&&a[5]===s;return(c&&a[0]>=s*4&&a[6]>=s?1:0)+(c&&a[6]>=s*4&&a[0]>=s?1:0)}finderPenaltyTerminateAndCount(a,s,c){return a&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,s){s[0]===0&&(a+=this.size),s.pop(),s.unshift(a)}};ae(l,"MIN_VERSION",1),ae(l,"MAX_VERSION",40),ae(l,"PENALTY_N1",3),ae(l,"PENALTY_N2",3),ae(l,"PENALTY_N3",40),ae(l,"PENALTY_N4",10),ae(l,"ECC_CODEWORDS_PER_BLOCK",[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]]),ae(l,"NUM_ERROR_CORRECTION_BLOCKS",[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]]);let e=l;t.QrCode=e;function o(w,a,s){if(a<0||a>31||w>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)s.push(w>>>c&1)}function i(w,a){return(w>>>a&1)!==0}let m=class m{constructor(a,s,c){if(this.mode=a,this.numChars=s,this.bitData=c,s<0)throw new RangeError("Invalid argument");this.bitData=c.slice()}static makeBytes(a){let s=[];for(let c of a)o(c,8,s);return new m(m.Mode.BYTE,a.length,s)}static makeNumeric(a){if(!m.isNumeric(a))throw new RangeError("String contains non-numeric characters");let s=[];for(let c=0;c<a.length;){let d=Math.min(a.length-c,3);o(Number.parseInt(a.substr(c,d),10),d*3+1,s),c+=d}return new m(m.Mode.NUMERIC,a.length,s)}static makeAlphanumeric(a){if(!m.isAlphanumeric(a))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],c;for(c=0;c+2<=a.length;c+=2){let d=m.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c))*45;d+=m.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c+1)),o(d,11,s)}return c<a.length&&o(m.ALPHANUMERIC_CHARSET.indexOf(a.charAt(c)),6,s),new m(m.Mode.ALPHANUMERIC,a.length,s)}static makeSegments(a){return a===""?[]:m.isNumeric(a)?[m.makeNumeric(a)]:m.isAlphanumeric(a)?[m.makeAlphanumeric(a)]:[m.makeBytes(m.toUtf8ByteArray(a))]}static makeEci(a){let s=[];if(a<0)throw new RangeError("ECI assignment value out of range");if(a<128)o(a,8,s);else if(a<16384)o(2,2,s),o(a,14,s);else if(a<1e6)o(6,3,s),o(a,21,s);else throw new RangeError("ECI assignment value out of range");return new m(m.Mode.ECI,0,s)}static isNumeric(a){return m.NUMERIC_REGEX.test(a)}static isAlphanumeric(a){return m.ALPHANUMERIC_REGEX.test(a)}getData(){return this.bitData.slice()}static getTotalBits(a,s){let c=0;for(let d of a){let h=d.mode.numCharCountBits(s);if(d.numChars>=1<<h)return 1/0;c+=4+h+d.bitData.length}return c}static toUtf8ByteArray(a){a=encodeURI(a);let s=[];for(let c=0;c<a.length;c++)a.charAt(c)!=="%"?s.push(a.charCodeAt(c)):(s.push(Number.parseInt(a.substr(c+1,2),16)),c+=2);return s}};ae(m,"NUMERIC_REGEX",/^\d*$/),ae(m,"ALPHANUMERIC_REGEX",/^[A-Z0-9 $%*+./:-]*$/),ae(m,"ALPHANUMERIC_CHARSET","0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:");let u=m;t.QrSegment=u,(w=>{let s=class s{constructor(d,h){this.ordinal=d,this.formatBits=h}};ae(s,"LOW",new s(0,1)),ae(s,"MEDIUM",new s(1,0)),ae(s,"QUARTILE",new s(2,3)),ae(s,"HIGH",new s(3,2));let a=s;w.Ecc=a})(e=t.QrCode||(t.QrCode={})),(w=>{let s=class s{constructor(d,h){this.modeBits=d,this.numBitsCharCount=h}numCharCountBits(d){return this.numBitsCharCount[Math.floor((d+7)/17)]}};ae(s,"NUMERIC",new s(1,[10,12,14])),ae(s,"ALPHANUMERIC",new s(2,[9,11,13])),ae(s,"BYTE",new s(4,[8,16,16])),ae(s,"KANJI",new s(8,[8,10,12])),ae(s,"ECI",new s(7,[0,0,0]));let a=s;w.Mode=a})(u=t.QrSegment||(t.QrSegment={}))})(jo||(jo={}));var Pi=jo;var{QrCode:Ti,QrSegment:nc}=Pi,Vr=12,tt=Vr*4+17,Ko=4,ur="#e8e8e8",rc="#0a0a0a",Di=(tt-Hr)/2,oc=[0,1,3,5],cr=16;function ac(t){return`0x${t.slice(2,42)}`}function qr(t,e=ac(t.genome),o={}){let i=e.toLowerCase(),u=i,l=ic(t.masks.butterfly),m=sc(l),w=nc.makeSegments(u),a=null,s=o.mask===void 0?oc:[o.mask];for(let h of s){let C=Ti.encodeSegments(w,Ti.Ecc.HIGH,Vr,Vr,h,!1),b=Uint8Array.from({length:tt*tt},(x,Z)=>Number(C.getModule(Z%tt,Math.floor(Z/tt)))),H=uc(b,l,m);(!a||H.score>a.score)&&(a={matrix:b,mask:h,...H})}if(!a)throw new Error("Unable to construct ownership proof");let c=lc(a.matrix,l,m),d=0;return c.forEach((h,C)=>{h!==a.matrix[C]&&(d+=1)}),{owner:i,payload:u,matrix:c,butterfly:l,halo:m,mask:a.mask,agreement:a.targets?a.matches/a.targets:1,modifiedModules:d,styledModules:m.reduce((h,C)=>h+ +!!C,0),version:Vr,size:tt}}function jr(t,e){let i=(tt+Ko*2)*cr;t.width=i,t.height=i;let u=t.getContext("2d");if(u){u.setTransform(1,0,0,1,0,0),u.imageSmoothingEnabled=!1,u.fillStyle=ur,u.fillRect(0,0,i,i);for(let l=0;l<tt;l+=1)for(let m=0;m<tt;m+=1){let w=l*tt+m,a=(m+Ko)*cr,s=(l+Ko)*cr,c=cc(e,w);c!==ur&&(u.fillStyle=c,u.fillRect(a,s,cr,cr))}}}function ic(t){let e=new Uint8Array(tt*tt);return t.forEach((o,i)=>{if(!o)return;let u=i%Hr,l=Math.floor(i/Hr);e[(l+Di)*tt+u+Di]=1}),e}function sc(t){let e=new Uint8Array(t.length);return t.forEach((o,i)=>{if(!o)return;let u=i%tt,l=Math.floor(i/tt);for(let m=-2;m<=2;m+=1)for(let w=-2;w<=2;w+=1){let a=u+w,s=l+m;if(a<0||a>=tt||s<0||s>=tt)continue;let c=s*tt+a;t[c]||(e[c]=1)}}),e}function lc(t,e,o){let i=t.slice();return i.forEach((u,l)=>{e[l]?i[l]=1:o[l]&&(i[l]=0)}),i}function cc(t,e){return t.matrix[e]?rc:ur}function uc(t,e,o){let i=0,u=0,l=0;for(let m=0;m<t.length;m+=1)e[m]?(l+=1,t[m]&&(i+=4,u+=1)):o[m]&&(l+=1,t[m]||(i+=2,u+=1));return{score:i,matches:u,targets:l}}var Ni=[{id:"artwork",label:"Artwork",detail:"1024 x 1024",width:1024,height:1024,socialFrame:!1},{id:"square",label:"Square post",detail:"1080 x 1080",width:1080,height:1080,socialFrame:!0},{id:"portrait",label:"Portrait post