PageSourceSearch

https://wei.city/_nuxt/C1sFeeWI.js

js wei.city collected 2026-09-24 14:36:35 UTC 10,850 bytes, 1 lines download raw bytes

1var w=(s=>(s[s.Border=-1]="Border",s[s.Data=0]="Data",s[s.Function=1]="Function",s[s.Position=2]="Position",s[s.Timing=3]="Timing",s[s.Alignment=4]="Alignment",s))(w||{});const L=[0,1],B=[1,0],N=[2,3],I=[3,2],D={L,M:B,Q:N,H:I},T=/^\d*$/,V=/^[A-Z0-9 $%*+./:-]*$/,A="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",z=1,y=40,C=3,Y=3,E=40,G=10,k=[[-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]],v=[[-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]];class X{constructor(e,t,n,o){if(this.version=e,this.ecc=t,e<z||e>y)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;const i=Array.from({length:this.size}).fill(!1);for(let l=0;l<this.size;l++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();const r=this.addEccAndInterleave(n);if(this.drawCodewords(r),o===-1){let l=1e9;for(let a=0;a<8;a++){this.applyMask(a),this.drawFormatBits(a);const c=this.getPenaltyScore();c<l&&(o=a,l=c),this.applyMask(a)}}this.mask=o,this.applyMask(o),this.drawFormatBits(o)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2===0,w.Timing),this.setFunctionModule(n,6,n%2===0,w.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let o=0;o<t;o++)n===0&&o===0||n===0&&o===t-1||n===t-1&&o===0||this.drawAlignmentPattern(e[n],e[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.ecc[1]<<3|e;let n=t;for(let i=0;i<10;i++)n=n<<1^(n>>>9)*1335;const o=(t<<10|n)^21522;for(let i=0;i<=5;i++)this.setFunctionModule(8,i,d(o,i));this.setFunctionModule(8,7,d(o,6)),this.setFunctionModule(8,8,d(o,7)),this.setFunctionModule(7,8,d(o,8));for(let i=9;i<15;i++)this.setFunctionModule(14-i,8,d(o,i));for(let i=0;i<8;i++)this.setFunctionModule(this.size-1-i,8,d(o,i));for(let i=8;i<15;i++)this.setFunctionModule(8,this.size-15+i,d(o,i));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const t=this.version<<12|e;for(let n=0;n<18;n++){const o=d(t,n),i=this.size-11+n%3,r=Math.floor(n/3);this.setFunctionModule(i,r,o),this.setFunctionModule(r,i,o)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let o=-4;o<=4;o++){const i=Math.max(Math.abs(o),Math.abs(n)),r=e+o,l=t+n;r>=0&&r<this.size&&l>
1=0&&l<this.size&&this.setFunctionModule(r,l,i!==2&&i!==4,w.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let o=-2;o<=2;o++)this.setFunctionModule(e+o,t+n,Math.max(Math.abs(o),Math.abs(n))!==1,w.Alignment)}setFunctionModule(e,t,n,o=w.Function){this.modules[t][e]=n,this.types[t][e]=o}addEccAndInterleave(e){const t=this.version,n=this.ecc;if(e.length!==p(t,n))throw new RangeError("Invalid argument");const o=v[n[0]][t],i=k[n[0]][t],r=Math.floor(P(t)/8),l=o-r%o,a=Math.floor(r/o),c=[],u=Q(i);for(let f=0,m=0;f<o;f++){const M=e.slice(m,m+a-i+(f<l?0:1));m+=M.length;const U=tt(M,u);f<l&&M.push(0),c.push(M.concat(U))}const h=[];for(let f=0;f<c[0].length;f++)c.forEach((m,M)=>{(f!==a-i||M>=l)&&h.push(m[f])});return h}drawCodewords(e){if(e.length!==Math.floor(P(this.version)/8))throw new RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let o=0;o<this.size;o++)for(let i=0;i<2;i++){const r=n-i,a=(n+1&2)===0?this.size-1-o:o;!this.types[a][r]&&t<e.length*8&&(this.modules[a][r]=d(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let o;switch(e){case 0:o=(n+t)%2===0;break;case 1:o=t%2===0;break;case 2:o=n%3===0;break;case 3:o=(n+t)%3===0;break;case 4:o=(Math.floor(n/3)+Math.floor(t/2))%2===0;break;case 5:o=n*t%2+n*t%3===0;break;case 6:o=(n*t%2+n*t%3)%2===0;break;case 7:o=((n+t)%2+n*t%3)%2===0;break;default:throw new Error("Unreachable")}!this.types[t][n]&&o&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let i=0;i<this.size;i++){let r=!1,l=0;const a=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[i][c]===r?(l++,l===5?e+=C:l>5&&e++):(this.finderPenaltyAddHistory(l,a),r||(e+=this.finderPenaltyCountPatterns(a)*E),r=this.modules[i][c],l=1);e+=this.finderPenaltyTerminateAndCount(r,l,a)*E}for(let i=0;i<this.size;i++){let r=!1,l=0;const a=[0,0,0,0,0,0,0];for(let c=0;c<this.size;c++)this.modules[c][i]===r?(l++,l===5?e+=C:l>5&&e++):(this.finderPenaltyAddHistory(l,a),r||(e+=this.finderPenaltyCountPatterns(a)*E),r=this.modules[c][i],l=1);e+=this.finderPenaltyTerminateAndCount(r,l,a)*E}for(let i=0;i<this.size-1;i++)for(let r=0;r<this.size-1;r++){const l=this.modules[i][r];l===this.modules[i][r+1]&&l===this.modules[i+1][r]&&l===this.modules[i+1][r+1]&&(e+=Y)}let t=0;for(const i of this.modules)t=i.reduce((r,l)=>r+(l?1:0),t);const n=this.size*this.size,o=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=o*G,e}getAlignmentPatternPositions(){if(this.version===1)return[];{const e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let o=this.size-7;n.length<e;o-=t)n.splice(1,0,o);return n}}finderPenaltyCountPatterns(e){const t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}}function g(s,e,t){if(e<0||e>31||s>>>e)throw new RangeError("Value out of range");for(let n=e-1;n>=0;n--)t.push(s>>>n&1)}function d(s,e){return(s>>>e&1)!==0}class R{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}const j=[1,10,12,14],q=[2,9,11,13],x=[4,8,16,16];function _(s,e){return s[Math.floor((e+7)/17)+1]}function S(s){const e=[];for(const t of s)g(t,8,e);return new R(x,s.length,e)}function H(s){if(!O(s))throw new RangeError("String contains non-numeric characters");const e=[];for(let t=0;t<s.length;){const n=Math.min(s.length-t,3);g(Number.parseInt(s.substring(t,t+n),10),n*3+1,e),t+=n}return new R(j,s.length,e)}function K(s){if(!$(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");const e=[];let t;for(t=0;t+2<=s.length;t+=2){let n=A.indexOf(s.charAt(t))*45;n+=A.indexOf(s.charAt(t+1)),g(n,11,e)}return t<s.length&&g(A.indexOf(s.charAt(t)),6,e),new R(q,s.length,e)}function W(s){return s===""?[]:O(s)?[H(s)]:$(s)?[K(s)]:[S(J(s))]}function O(s){return T.test(s)}function $(s){return V.test(s)}function Z(s,e){let t=0;for(const n of s){const o=_(n.mode,e);if(n.numChars>=1<<o)return Number.POSITIVE_INFINITY;t+=4+o+n.bitData.length}return t}function J(s){s=encodeURI(s);const e=[];for(let t=0;t<s.length;t++)s.charAt(t)!=="%"?e.push(s.charCodeAt(t)):(e.push(Number.parseInt(s.substring(t+1,t+3),16)),t+=2);return e}function P(s){if(s<z||s>y)throw new RangeError("Version number out of range");let e=(16*s+128)*s+64;if(s>=2){const t=Math.floor(s/7)+2;e-=(25*t-10)*t-55,s>=7&&(e-=36)}return e}function p(s,e){return Math.floor(P(s)/8)-k[e[0]][s]*v[e[0]][s]}function Q(s){if(s<1||s>255)throw new RangeError("Degree out of range");const e=[];for(let n=0;n<s-1;n++)e.push(0);e.push(1);let t=1;for(let n=0;n<s;n++){for(let o=0;o<e.length;o++)e[o]=b(e[o],t),o+1<e.length&&(e[o]^=e[o+1]);t=b(t,2)}return e}function tt(s,e){const t=e.map(n=>0);for(const n of s){const o=n^t.shift();t.push(0),e.forEach((i,r)=>t[r]^=b(i,o))}return t}function b(s,e){if(s>>>8||e>>>8)throw new RangeError("Byte out of range");let t=0;for(let n=7;n>=0;n--)t=t<<1^(t>>>7)*285,t^=(e>>>n&1)*s;return t}function et(s,e,t=1,n=40,o=-1,i=!0){if(!(z<=t&&t<=n&&n<=y)||o<-1||o>7)throw new RangeError("Invalid value");let r,l;for(r=t;;r++){const h=p(r,e)*8,f=Z(s,r);if(f<=h){l=f;break}if(r>=n)throw new RangeError("Data too long")}for(const h of[B,N,I])i&&l<=p(r,h)*8&&(e=h);const a=[];for(const h of s){g(h.mode[0],4,a),g(h.numChars,_(h.mode,r),a);for(const f of h.getData())a.push(f)}const c=p(r,e)*8;g(0,Math.min(4,c-a.length),a),g(0,(8-a.length%8)%8,a);for(let h=236;a.length<c;h^=253)g(h,8,a);const u=Array.from({length:Math.ceil(a.length/8)},()=>0);return a.forEach((h,f)=>u[f>>>3]|=h<<7-(f&7)),new X(r,e,u,o)}function nt(s,e){const{ecc:t="L",boostEcc:n=!1,minVersion:o=1,maxVersion:i=40,maskPattern:r=-1,border:l=1}=e||{},a=typeof s=="string"?W(s):Array.isArray(s)?[S(s)]:void 0;if(!a)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof s}`);
1const c=et(a,D[t],o,i,r,n),u=st({version:c.version,maskPattern:c.mask,size:c.size,data:c.modules,types:c.types},l);return e?.invert&&(u.data=u.data.map(h=>h.map(f=>!f))),e?.onEncoded?.(u),u}function st(s,e=1){if(!e)return s;const{size:t}=s,n=t+e*2;s.size=n,s.data.forEach(i=>{for(let r=0;r<e;r++)i.unshift(!1),i.push(!1)});for(let i=0;i<e;i++)s.data.unshift(Array.from({length:n},r=>!1)),s.data.push(Array.from({length:n},r=>!1));const o=w.Border;s.types.forEach(i=>{for(let r=0;r<e;r++)i.unshift(o),i.push(o)});for(let i=0;i<e;i++)s.types.unshift(Array.from({length:n},r=>o)),s.types.push(Array.from({length:n},r=>o));return s}function F(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ot(s,e={}){const t=nt(s,e),{pixelSize:n=10,whiteColor:o="white",blackColor:i="black"}=e,r=t.size*n,l=t.size*n;let a=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${l} ${r}">`;const c=[];for(let u=0;u<t.size;u++)for(let h=0;h<t.size;h++){const f=h*n,m=u*n;t.data[u][h]&&c.push(`M${f},${m}h${n}v${n}h-${n}z`)}return a+=`<rect fill="${F(o)}" width="${l}" height="${r}"/>`,a+=`<path fill="${F(i)}" d="${c.join("")}"/>`,a+="</svg>",a}export{ot as r};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.