nfets 0.0.145 → 0.0.147

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- import{e as qd}from"../chunk-CBNKLDJE.mjs";import{a,b as He,d as F,f as Gd}from"../chunk-W6MRGYXP.mjs";var Wl=F((vT,um)=>{"use strict";um.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Xn=F(Mr=>{"use strict";var _l,ZS=[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];Mr.getSymbolSize=a(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},"getSymbolSize");Mr.getSymbolTotalCodewords=a(function(e){return ZS[e]},"getSymbolTotalCodewords");Mr.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e};Mr.setToSJISFunction=a(function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');_l=e},"setToSJISFunction");Mr.isKanjiModeEnabled=function(){return typeof _l<"u"};Mr.toSJIS=a(function(e){return _l(e)},"toSJIS")});var Xf=F(mo=>{"use strict";mo.L={bit:1};mo.M={bit:0};mo.Q={bit:3};mo.H={bit:2};function YS(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return mo.L;case"m":case"medium":return mo.M;case"q":case"quartile":return mo.Q;case"h":case"high":return mo.H;default:throw new Error("Unknown EC Level: "+o)}}a(YS,"fromString");mo.isValid=a(function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},"isValid");mo.from=a(function(e,t){if(mo.isValid(e))return e;try{return YS(e)}catch{return t}},"from")});var gm=F((NT,mm)=>{"use strict";function hm(){this.buffer=[],this.length=0}a(hm,"BitBuffer");hm.prototype={get:a(function(o){let e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},"get"),put:a(function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},"put"),getLengthInBits:a(function(){return this.length},"getLengthInBits"),putBit:a(function(o){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++},"putBit")};mm.exports=hm});var ym=F((RT,vm)=>{"use strict";function mc(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)}a(mc,"BitMatrix");mc.prototype.set=function(o,e,t,n){let r=o*this.size+e;this.data[r]=t,n&&(this.reservedBit[r]=!0)};mc.prototype.get=function(o,e){return this.data[o*this.size+e]};mc.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t};mc.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};vm.exports=mc});var Sm=F(Jf=>{"use strict";var XS=Xn().getSymbolSize;Jf.getRowColCoords=a(function(e){if(e===1)return[];let t=Math.floor(e/7)+2,n=XS(e),r=n===145?26:Math.ceil((n-13)/(2*t-2))*2,i=[n-7];for(let s=1;s<t-1;s++)i[s]=i[s-1]-r;return i.push(6),i.reverse()},"getRowColCoords");Jf.getPositions=a(function(e){let t=[],n=Jf.getRowColCoords(e),r=n.length;for(let i=0;i<r;i++)for(let s=0;s<r;s++)i===0&&s===0||i===0&&s===r-1||i===r-1&&s===0||t.push([n[i],n[s]]);return t},"getPositions")});var Nm=F(bm=>{"use strict";var JS=Xn().getSymbolSize,Cm=7;bm.getPositions=a(function(e){let t=JS(e);return[[0,0],[t-Cm,0],[0,t-Cm]]},"getPositions")});var Im=F(te=>{"use strict";te.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var jr={N1:3,N2:3,N3:40,N4:10};te.isValid=a(function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},"isValid");te.from=a(function(e){return te.isValid(e)?parseInt(e,10):void 0},"from");te.getPenaltyN1=a(function(e){let t=e.size,n=0,r=0,i=0,s=null,c=null;for(let f=0;f<t;f++){r=i=0,s=c=null;for(let p=0;p<t;p++){let u=e.get(f,p);u===s?r++:(r>=5&&(n+=jr.N1+(r-5)),s=u,r=1),u=e.get(p,f),u===c?i++:(i>=5&&(n+=jr.N1+(i-5)),c=u,i=1)}r>=5&&(n+=jr.N1+(r-5)),i>=5&&(n+=jr.N1+(i-5))}return n},"getPenaltyN1");te.getPenaltyN2=a(function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let s=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);(s===4||s===0)&&n++}return n*jr.N2},"getPenaltyN2");te.getPenaltyN3=a(function(e){let t=e.size,n=0,r=0,i=0;for(let s=0;s<t;s++){r=i=0;for(let c=0;c<t;c++)r=r<<1&2047|e.get(s,c),c>=10&&(r===1488||r===93)&&n++,i=i<<1&2047|e.get(c,s),c>=10&&(i===1488||i===93)&&n++}return n*jr.N3},"getPenaltyN3");te.getPenaltyN4=a(function(e){let t=0,n=e.data.length;for(let i=0;i<n;i++)t+=e.data[i];return Math.abs(Math.ceil(t*100/n/5)-10)*jr.N4},"getPenaltyN4");function WS(o,e,t){switch(o){case te.Patterns.PATTERN000:return(e+t)%2===0;case te.Patterns.PATTERN001:return e%2===0;case te.Patterns.PATTERN010:return t%3===0;case te.Patterns.PATTERN011:return(e+t)%3===0;case te.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case te.Patterns.PATTERN101:return e*t%2+e*t%3===0;case te.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case te.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a(WS,"getMaskAt");te.applyMask=a(function(e,t){let n=t.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)t.isReserved(i,r)||t.xor(i,r,WS(e,i,r))},"applyMask");te.getBestMask=a(function(e,t){let n=Object.keys(te.Patterns).length,r=0,i=1/0;for(let s=0;s<n;s++){t(s),te.applyMask(s,e);let c=te.getPenaltyN1(e)+te.getPenaltyN2(e)+te.getPenaltyN3(e)+te.getPenaltyN4(e);te.applyMask(s,e),c<i&&(i=c,r=s)}return r},"getBestMask")});var kl=F(Kl=>{"use strict";var Jn=Xf(),Wf=[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],_f=[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];Kl.getBlocksCount=a(function(e,t){switch(t){case Jn.L:return Wf[(e-1)*4+0];case Jn.M:return Wf[(e-1)*4+1];case Jn.Q:return Wf[(e-1)*4+2];case Jn.H:return Wf[(e-1)*4+3];default:return}},"getBlocksCount");Kl.getTotalCodewordsCount=a(function(e,t){switch(t){case Jn.L:return _f[(e-1)*4+0];case Jn.M:return _f[(e-1)*4+1];case Jn.Q:return _f[(e-1)*4+2];case Jn.H:return _f[(e-1)*4+3];default:return}},"getTotalCodewordsCount")});var Rm=F(kf=>{"use strict";var gc=new Uint8Array(512),Kf=new Uint8Array(256);a((function(){let e=1;for(let t=0;t<255;t++)gc[t]=e,Kf[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)gc[t]=gc[t-255]}),"initTables")();kf.log=a(function(e){if(e<1)throw new Error("log("+e+")");return Kf[e]},"log");kf.exp=a(function(e){return gc[e]},"exp");kf.mul=a(function(e,t){return e===0||t===0?0:gc[Kf[e]+Kf[t]]},"mul")});var Om=F(vc=>{"use strict";var $l=Rm();vc.mul=a(function(e,t){let n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]^=$l.mul(e[r],t[i]);return n},"mul");vc.mod=a(function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){let r=n[0];for(let s=0;s<t.length;s++)n[s]^=$l.mul(t[s],r);let i=0;for(;i<n.length&&n[i]===0;)i++;n=n.slice(i)}return n},"mod");vc.generateECPolynomial=a(function(e){let t=new Uint8Array([1]);for(let n=0;n<e;n++)t=vc.mul(t,new Uint8Array([1,$l.exp(n)]));return t},"generateECPolynomial")});var Am=F((VT,Dm)=>{"use strict";var Fm=Om();function ed(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}a(ed,"ReedSolomonEncoder");ed.prototype.initialize=a(function(e){this.degree=e,this.genPoly=Fm.generateECPolynomial(this.degree)},"initialize");ed.prototype.encode=a(function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let n=Fm.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){let i=new Uint8Array(this.degree);return i.set(n,r),i}return n},"encode");Dm.exports=ed});var td=F(xm=>{"use strict";xm.isValid=a(function(e){return!isNaN(e)&&e>=1&&e<=40},"isValid")});var od=F(dn=>{"use strict";var wm="[0-9]+",_S="[A-Z $%*+\\-./:]+",yc="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";yc=yc.replace(/u/g,"\\u");var KS="(?:(?![A-Z0-9 $%*+\\-./:]|"+yc+`)(?:.|[\r
2
+ import{e as qd}from"../chunk-CYG4CXYX.mjs";import{a,b as He,d as F,f as Gd}from"../chunk-W6MRGYXP.mjs";var Wl=F((vT,um)=>{"use strict";um.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var Xn=F(Mr=>{"use strict";var _l,ZS=[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];Mr.getSymbolSize=a(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},"getSymbolSize");Mr.getSymbolTotalCodewords=a(function(e){return ZS[e]},"getSymbolTotalCodewords");Mr.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e};Mr.setToSJISFunction=a(function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');_l=e},"setToSJISFunction");Mr.isKanjiModeEnabled=function(){return typeof _l<"u"};Mr.toSJIS=a(function(e){return _l(e)},"toSJIS")});var Xf=F(mo=>{"use strict";mo.L={bit:1};mo.M={bit:0};mo.Q={bit:3};mo.H={bit:2};function YS(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return mo.L;case"m":case"medium":return mo.M;case"q":case"quartile":return mo.Q;case"h":case"high":return mo.H;default:throw new Error("Unknown EC Level: "+o)}}a(YS,"fromString");mo.isValid=a(function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},"isValid");mo.from=a(function(e,t){if(mo.isValid(e))return e;try{return YS(e)}catch{return t}},"from")});var gm=F((NT,mm)=>{"use strict";function hm(){this.buffer=[],this.length=0}a(hm,"BitBuffer");hm.prototype={get:a(function(o){let e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},"get"),put:a(function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},"put"),getLengthInBits:a(function(){return this.length},"getLengthInBits"),putBit:a(function(o){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++},"putBit")};mm.exports=hm});var ym=F((RT,vm)=>{"use strict";function mc(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)}a(mc,"BitMatrix");mc.prototype.set=function(o,e,t,n){let r=o*this.size+e;this.data[r]=t,n&&(this.reservedBit[r]=!0)};mc.prototype.get=function(o,e){return this.data[o*this.size+e]};mc.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t};mc.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};vm.exports=mc});var Sm=F(Jf=>{"use strict";var XS=Xn().getSymbolSize;Jf.getRowColCoords=a(function(e){if(e===1)return[];let t=Math.floor(e/7)+2,n=XS(e),r=n===145?26:Math.ceil((n-13)/(2*t-2))*2,i=[n-7];for(let s=1;s<t-1;s++)i[s]=i[s-1]-r;return i.push(6),i.reverse()},"getRowColCoords");Jf.getPositions=a(function(e){let t=[],n=Jf.getRowColCoords(e),r=n.length;for(let i=0;i<r;i++)for(let s=0;s<r;s++)i===0&&s===0||i===0&&s===r-1||i===r-1&&s===0||t.push([n[i],n[s]]);return t},"getPositions")});var Nm=F(bm=>{"use strict";var JS=Xn().getSymbolSize,Cm=7;bm.getPositions=a(function(e){let t=JS(e);return[[0,0],[t-Cm,0],[0,t-Cm]]},"getPositions")});var Im=F(te=>{"use strict";te.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var jr={N1:3,N2:3,N3:40,N4:10};te.isValid=a(function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},"isValid");te.from=a(function(e){return te.isValid(e)?parseInt(e,10):void 0},"from");te.getPenaltyN1=a(function(e){let t=e.size,n=0,r=0,i=0,s=null,c=null;for(let f=0;f<t;f++){r=i=0,s=c=null;for(let p=0;p<t;p++){let u=e.get(f,p);u===s?r++:(r>=5&&(n+=jr.N1+(r-5)),s=u,r=1),u=e.get(p,f),u===c?i++:(i>=5&&(n+=jr.N1+(i-5)),c=u,i=1)}r>=5&&(n+=jr.N1+(r-5)),i>=5&&(n+=jr.N1+(i-5))}return n},"getPenaltyN1");te.getPenaltyN2=a(function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let s=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);(s===4||s===0)&&n++}return n*jr.N2},"getPenaltyN2");te.getPenaltyN3=a(function(e){let t=e.size,n=0,r=0,i=0;for(let s=0;s<t;s++){r=i=0;for(let c=0;c<t;c++)r=r<<1&2047|e.get(s,c),c>=10&&(r===1488||r===93)&&n++,i=i<<1&2047|e.get(c,s),c>=10&&(i===1488||i===93)&&n++}return n*jr.N3},"getPenaltyN3");te.getPenaltyN4=a(function(e){let t=0,n=e.data.length;for(let i=0;i<n;i++)t+=e.data[i];return Math.abs(Math.ceil(t*100/n/5)-10)*jr.N4},"getPenaltyN4");function WS(o,e,t){switch(o){case te.Patterns.PATTERN000:return(e+t)%2===0;case te.Patterns.PATTERN001:return e%2===0;case te.Patterns.PATTERN010:return t%3===0;case te.Patterns.PATTERN011:return(e+t)%3===0;case te.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case te.Patterns.PATTERN101:return e*t%2+e*t%3===0;case te.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case te.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}a(WS,"getMaskAt");te.applyMask=a(function(e,t){let n=t.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)t.isReserved(i,r)||t.xor(i,r,WS(e,i,r))},"applyMask");te.getBestMask=a(function(e,t){let n=Object.keys(te.Patterns).length,r=0,i=1/0;for(let s=0;s<n;s++){t(s),te.applyMask(s,e);let c=te.getPenaltyN1(e)+te.getPenaltyN2(e)+te.getPenaltyN3(e)+te.getPenaltyN4(e);te.applyMask(s,e),c<i&&(i=c,r=s)}return r},"getBestMask")});var kl=F(Kl=>{"use strict";var Jn=Xf(),Wf=[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],_f=[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];Kl.getBlocksCount=a(function(e,t){switch(t){case Jn.L:return Wf[(e-1)*4+0];case Jn.M:return Wf[(e-1)*4+1];case Jn.Q:return Wf[(e-1)*4+2];case Jn.H:return Wf[(e-1)*4+3];default:return}},"getBlocksCount");Kl.getTotalCodewordsCount=a(function(e,t){switch(t){case Jn.L:return _f[(e-1)*4+0];case Jn.M:return _f[(e-1)*4+1];case Jn.Q:return _f[(e-1)*4+2];case Jn.H:return _f[(e-1)*4+3];default:return}},"getTotalCodewordsCount")});var Rm=F(kf=>{"use strict";var gc=new Uint8Array(512),Kf=new Uint8Array(256);a((function(){let e=1;for(let t=0;t<255;t++)gc[t]=e,Kf[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)gc[t]=gc[t-255]}),"initTables")();kf.log=a(function(e){if(e<1)throw new Error("log("+e+")");return Kf[e]},"log");kf.exp=a(function(e){return gc[e]},"exp");kf.mul=a(function(e,t){return e===0||t===0?0:gc[Kf[e]+Kf[t]]},"mul")});var Om=F(vc=>{"use strict";var $l=Rm();vc.mul=a(function(e,t){let n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]^=$l.mul(e[r],t[i]);return n},"mul");vc.mod=a(function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){let r=n[0];for(let s=0;s<t.length;s++)n[s]^=$l.mul(t[s],r);let i=0;for(;i<n.length&&n[i]===0;)i++;n=n.slice(i)}return n},"mod");vc.generateECPolynomial=a(function(e){let t=new Uint8Array([1]);for(let n=0;n<e;n++)t=vc.mul(t,new Uint8Array([1,$l.exp(n)]));return t},"generateECPolynomial")});var Am=F((VT,Dm)=>{"use strict";var Fm=Om();function ed(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}a(ed,"ReedSolomonEncoder");ed.prototype.initialize=a(function(e){this.degree=e,this.genPoly=Fm.generateECPolynomial(this.degree)},"initialize");ed.prototype.encode=a(function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let n=Fm.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){let i=new Uint8Array(this.degree);return i.set(n,r),i}return n},"encode");Dm.exports=ed});var td=F(xm=>{"use strict";xm.isValid=a(function(e){return!isNaN(e)&&e>=1&&e<=40},"isValid")});var od=F(dn=>{"use strict";var wm="[0-9]+",_S="[A-Z $%*+\\-./:]+",yc="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";yc=yc.replace(/u/g,"\\u");var KS="(?:(?![A-Z0-9 $%*+\\-./:]|"+yc+`)(?:.|[\r
3
3
  ]))+`;dn.KANJI=new RegExp(yc,"g");dn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");dn.BYTE=new RegExp(KS,"g");dn.NUMERIC=new RegExp(wm,"g");dn.ALPHANUMERIC=new RegExp(_S,"g");var kS=new RegExp("^"+yc+"$"),$S=new RegExp("^"+wm+"$"),eC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");dn.testKanji=a(function(e){return kS.test(e)},"testKanji");dn.testNumeric=a(function(e){return $S.test(e)},"testNumeric");dn.testAlphanumeric=a(function(e){return eC.test(e)},"testAlphanumeric")});var Wn=F(Le=>{"use strict";var tC=td(),id=od();Le.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Le.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Le.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Le.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Le.MIXED={bit:-1};Le.getCharCountIndicator=a(function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!tC.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},"getCharCountIndicator");Le.getBestModeForData=a(function(e){return id.testNumeric(e)?Le.NUMERIC:id.testAlphanumeric(e)?Le.ALPHANUMERIC:id.testKanji(e)?Le.KANJI:Le.BYTE},"getBestModeForData");Le.toString=a(function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},"toString");Le.isValid=a(function(e){return e&&e.bit&&e.ccBits},"isValid");function oC(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return Le.NUMERIC;case"alphanumeric":return Le.ALPHANUMERIC;case"kanji":return Le.KANJI;case"byte":return Le.BYTE;default:throw new Error("Unknown mode: "+o)}}a(oC,"fromString");Le.from=a(function(e,t){if(Le.isValid(e))return e;try{return oC(e)}catch{return t}},"from")});var Mm=F(Br=>{"use strict";var $f=Xn(),iC=kl(),Pm=Xf(),_n=Wn(),nd=td(),zm=7973,Em=$f.getBCHDigit(zm);function nC(o,e,t){for(let n=1;n<=40;n++)if(e<=Br.getCapacity(n,t,o))return n}a(nC,"getBestVersionForDataLength");function Tm(o,e){return _n.getCharCountIndicator(o,e)+4}a(Tm,"getReservedBitsCount");function rC(o,e){let t=0;return o.forEach(function(n){let r=Tm(n.mode,e);t+=r+n.getBitsLength()}),t}a(rC,"getTotalBitsFromDataArray");function sC(o,e){for(let t=1;t<=40;t++)if(rC(o,t)<=Br.getCapacity(t,e,_n.MIXED))return t}a(sC,"getBestVersionForMixedData");Br.from=a(function(e,t){return nd.isValid(e)?parseInt(e,10):t},"from");Br.getCapacity=a(function(e,t,n){if(!nd.isValid(e))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=_n.BYTE);let r=$f.getSymbolTotalCodewords(e),i=iC.getTotalCodewordsCount(e,t),s=(r-i)*8;if(n===_n.MIXED)return s;let c=s-Tm(n,e);switch(n){case _n.NUMERIC:return Math.floor(c/10*3);case _n.ALPHANUMERIC:return Math.floor(c/11*2);case _n.KANJI:return Math.floor(c/13);case _n.BYTE:default:return Math.floor(c/8)}},"getCapacity");Br.getBestVersionForData=a(function(e,t){let n,r=Pm.from(t,Pm.M);if(Array.isArray(e)){if(e.length>1)return sC(e,r);if(e.length===0)return 1;n=e[0]}else n=e;return nC(n.mode,n.getLength(),r)},"getBestVersionForData");Br.getEncodedBits=a(function(e){if(!nd.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;$f.getBCHDigit(t)-Em>=0;)t^=zm<<$f.getBCHDigit(t)-Em;return e<<12|t},"getEncodedBits")});var Lm=F(Vm=>{"use strict";var rd=Xn(),Bm=1335,aC=21522,jm=rd.getBCHDigit(Bm);Vm.getEncodedBits=a(function(e,t){let n=e.bit<<3|t,r=n<<10;for(;rd.getBCHDigit(r)-jm>=0;)r^=Bm<<rd.getBCHDigit(r)-jm;return(n<<10|r)^aC},"getEncodedBits")});var Um=F((_T,Hm)=>{"use strict";var cC=Wn();function ra(o){this.mode=cC.NUMERIC,this.data=o.toString()}a(ra,"NumericData");ra.getBitsLength=a(function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},"getBitsLength");ra.prototype.getLength=a(function(){return this.data.length},"getLength");ra.prototype.getBitsLength=a(function(){return ra.getBitsLength(this.data.length)},"getBitsLength");ra.prototype.write=a(function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},"write");Hm.exports=ra});var Gm=F((kT,Qm)=>{"use strict";var fC=Wn(),sd=["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 sa(o){this.mode=fC.ALPHANUMERIC,this.data=o}a(sa,"AlphanumericData");sa.getBitsLength=a(function(e){return 11*Math.floor(e/2)+6*(e%2)},"getBitsLength");sa.prototype.getLength=a(function(){return this.data.length},"getLength");sa.prototype.getBitsLength=a(function(){return sa.getBitsLength(this.data.length)},"getBitsLength");sa.prototype.write=a(function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=sd.indexOf(this.data[t])*45;n+=sd.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(sd.indexOf(this.data[t]),6)},"write");Qm.exports=sa});var Zm=F((e2,qm)=>{"use strict";var pC=Wn();function aa(o){this.mode=pC.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}a(aa,"ByteData");aa.getBitsLength=a(function(e){return e*8},"getBitsLength");aa.prototype.getLength=a(function(){return this.data.length},"getLength");aa.prototype.getBitsLength=a(function(){return aa.getBitsLength(this.data.length)},"getBitsLength");aa.prototype.write=function(o){for(let e=0,t=this.data.length;e<t;e++)o.put(this.data[e],8)};qm.exports=aa});var Xm=F((o2,Ym)=>{"use strict";var lC=Wn(),dC=Xn();function ca(o){this.mode=lC.KANJI,this.data=o}a(ca,"KanjiData");ca.getBitsLength=a(function(e){return e*13},"getBitsLength");ca.prototype.getLength=a(function(){return this.data.length},"getLength");ca.prototype.getBitsLength=a(function(){return ca.getBitsLength(this.data.length)},"getBitsLength");ca.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let t=dC.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
4
4
  Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),o.put(t,13)}};Ym.exports=ca});var Jm=F((n2,ad)=>{"use strict";var Sc={single_source_shortest_paths:a(function(o,e,t){var n={},r={};r[e]=0;var i=Sc.PriorityQueue.make();i.push(e,0);for(var s,c,f,p,u,h,v,y,S;!i.empty();){s=i.pop(),c=s.value,p=s.cost,u=o[c]||{};for(f in u)u.hasOwnProperty(f)&&(h=u[f],v=p+h,y=r[f],S=typeof r[f]>"u",(S||y>v)&&(r[f]=v,i.push(f,v),n[f]=c))}if(typeof t<"u"&&typeof r[t]>"u"){var N=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(N)}return n},"single_source_shortest_paths"),extract_shortest_path_from_predecessor_list:a(function(o,e){for(var t=[],n=e,r;n;)t.push(n),r=o[n],n=o[n];return t.reverse(),t},"extract_shortest_path_from_predecessor_list"),find_path:a(function(o,e,t){var n=Sc.single_source_shortest_paths(o,e,t);return Sc.extract_shortest_path_from_predecessor_list(n,t)},"find_path"),PriorityQueue:{make:a(function(o){var e=Sc.PriorityQueue,t={},n;o=o||{};for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t.queue=[],t.sorter=o.sorter||e.default_sorter,t},"make"),default_sorter:a(function(o,e){return o.cost-e.cost},"default_sorter"),push:a(function(o,e){var t={value:o,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},"push"),pop:a(function(){return this.queue.shift()},"pop"),empty:a(function(){return this.queue.length===0},"empty")}};typeof ad<"u"&&(ad.exports=Sc)});var og=F(fa=>{"use strict";var U=Wn(),Km=Um(),km=Gm(),$m=Zm(),eg=Xm(),Cc=od(),ep=Xn(),uC=Jm();function Wm(o){return unescape(encodeURIComponent(o)).length}a(Wm,"getStringByteLength");function bc(o,e,t){let n=[],r;for(;(r=o.exec(t))!==null;)n.push({data:r[0],index:r.index,mode:e,length:r[0].length});return n}a(bc,"getSegments");function tg(o){let e=bc(Cc.NUMERIC,U.NUMERIC,o),t=bc(Cc.ALPHANUMERIC,U.ALPHANUMERIC,o),n,r;return ep.isKanjiModeEnabled()?(n=bc(Cc.BYTE,U.BYTE,o),r=bc(Cc.KANJI,U.KANJI,o)):(n=bc(Cc.BYTE_KANJI,U.BYTE,o),r=[]),e.concat(t,n,r).sort(function(s,c){return s.index-c.index}).map(function(s){return{data:s.data,mode:s.mode,length:s.length}})}a(tg,"getSegmentsFromString");function cd(o,e){switch(e){case U.NUMERIC:return Km.getBitsLength(o);case U.ALPHANUMERIC:return km.getBitsLength(o);case U.KANJI:return eg.getBitsLength(o);case U.BYTE:return $m.getBitsLength(o)}}a(cd,"getSegmentBitsLength");function hC(o){return o.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}a(hC,"mergeSegments");function mC(o){let e=[];for(let t=0;t<o.length;t++){let n=o[t];switch(n.mode){case U.NUMERIC:e.push([n,{data:n.data,mode:U.ALPHANUMERIC,length:n.length},{data:n.data,mode:U.BYTE,length:n.length}]);break;case U.ALPHANUMERIC:e.push([n,{data:n.data,mode:U.BYTE,length:n.length}]);break;case U.KANJI:e.push([n,{data:n.data,mode:U.BYTE,length:Wm(n.data)}]);break;case U.BYTE:e.push([{data:n.data,mode:U.BYTE,length:Wm(n.data)}])}}return e}a(mC,"buildNodes");function gC(o,e){let t={},n={start:{}},r=["start"];for(let i=0;i<o.length;i++){let s=o[i],c=[];for(let f=0;f<s.length;f++){let p=s[f],u=""+i+f;c.push(u),t[u]={node:p,lastCount:0},n[u]={};for(let h=0;h<r.length;h++){let v=r[h];t[v]&&t[v].node.mode===p.mode?(n[v][u]=cd(t[v].lastCount+p.length,p.mode)-cd(t[v].lastCount,p.mode),t[v].lastCount+=p.length):(t[v]&&(t[v].lastCount=p.length),n[v][u]=cd(p.length,p.mode)+4+U.getCharCountIndicator(p.mode,e))}}r=c}for(let i=0;i<r.length;i++)n[r[i]].end=0;return{map:n,table:t}}a(gC,"buildGraph");function _m(o,e){let t,n=U.getBestModeForData(o);if(t=U.from(e,n),t!==U.BYTE&&t.bit<n.bit)throw new Error('"'+o+'" cannot be encoded with mode '+U.toString(t)+`.
5
5
  Suggested mode is: `+U.toString(n));switch(t===U.KANJI&&!ep.isKanjiModeEnabled()&&(t=U.BYTE),t){case U.NUMERIC:return new Km(o);case U.ALPHANUMERIC:return new km(o);case U.KANJI:return new eg(o);case U.BYTE:return new $m(o)}}a(_m,"buildSingleSegment");fa.fromArray=a(function(e){return e.reduce(function(t,n){return typeof n=="string"?t.push(_m(n,null)):n.data&&t.push(_m(n.data,n.mode)),t},[])},"fromArray");fa.fromString=a(function(e,t){let n=tg(e,ep.isKanjiModeEnabled()),r=mC(n),i=gC(r,t),s=uC.find_path(i.map,"start","end"),c=[];for(let f=1;f<s.length-1;f++)c.push(i.table[s[f]].node);return fa.fromArray(hC(c))},"fromString");fa.rawSplit=a(function(e){return fa.fromArray(tg(e,ep.isKanjiModeEnabled()))},"rawSplit")});var hd=F(ig=>{"use strict";var op=Xn(),fd=Xf(),vC=gm(),yC=ym(),SC=Sm(),CC=Nm(),dd=Im(),ud=kl(),bC=Am(),tp=Mm(),NC=Lm(),IC=Wn(),pd=og();function RC(o,e){let t=o.size,n=CC.getPositions(e);for(let r=0;r<n.length;r++){let i=n[r][0],s=n[r][1];for(let c=-1;c<=7;c++)if(!(i+c<=-1||t<=i+c))for(let f=-1;f<=7;f++)s+f<=-1||t<=s+f||(c>=0&&c<=6&&(f===0||f===6)||f>=0&&f<=6&&(c===0||c===6)||c>=2&&c<=4&&f>=2&&f<=4?o.set(i+c,s+f,!0,!0):o.set(i+c,s+f,!1,!0))}}a(RC,"setupFinderPattern");function OC(o){let e=o.size;for(let t=8;t<e-8;t++){let n=t%2===0;o.set(t,6,n,!0),o.set(6,t,n,!0)}}a(OC,"setupTimingPattern");function FC(o,e){let t=SC.getPositions(e);for(let n=0;n<t.length;n++){let r=t[n][0],i=t[n][1];for(let s=-2;s<=2;s++)for(let c=-2;c<=2;c++)s===-2||s===2||c===-2||c===2||s===0&&c===0?o.set(r+s,i+c,!0,!0):o.set(r+s,i+c,!1,!0)}}a(FC,"setupAlignmentPattern");function DC(o,e){let t=o.size,n=tp.getEncodedBits(e),r,i,s;for(let c=0;c<18;c++)r=Math.floor(c/3),i=c%3+t-8-3,s=(n>>c&1)===1,o.set(r,i,s,!0),o.set(i,r,s,!0)}a(DC,"setupVersionInfo");function ld(o,e,t){let n=o.size,r=NC.getEncodedBits(e,t),i,s;for(i=0;i<15;i++)s=(r>>i&1)===1,i<6?o.set(i,8,s,!0):i<8?o.set(i+1,8,s,!0):o.set(n-15+i,8,s,!0),i<8?o.set(8,n-i-1,s,!0):i<9?o.set(8,15-i-1+1,s,!0):o.set(8,15-i-1,s,!0);o.set(n-8,8,1,!0)}a(ld,"setupFormatInfo");function AC(o,e){let t=o.size,n=-1,r=t-1,i=7,s=0;for(let c=t-1;c>0;c-=2)for(c===6&&c--;;){for(let f=0;f<2;f++)if(!o.isReserved(r,c-f)){let p=!1;s<e.length&&(p=(e[s]>>>i&1)===1),o.set(r,c-f,p),i--,i===-1&&(s++,i=7)}if(r+=n,r<0||t<=r){r-=n,n=-n;break}}}a(AC,"setupData");function xC(o,e,t){let n=new vC;t.forEach(function(f){n.put(f.mode.bit,4),n.put(f.getLength(),IC.getCharCountIndicator(f.mode,o)),f.write(n)});let r=op.getSymbolTotalCodewords(o),i=ud.getTotalCodewordsCount(o,e),s=(r-i)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let c=(s-n.getLengthInBits())/8;for(let f=0;f<c;f++)n.put(f%2?17:236,8);return wC(n,o,e)}a(xC,"createData");function wC(o,e,t){let n=op.getSymbolTotalCodewords(e),r=ud.getTotalCodewordsCount(e,t),i=n-r,s=ud.getBlocksCount(e,t),c=n%s,f=s-c,p=Math.floor(n/s),u=Math.floor(i/s),h=u+1,v=p-u,y=new bC(v),S=0,N=new Array(s),A=new Array(s),z=0,Ce=new Uint8Array(o.buffer);for(let Fi=0;Fi<s;Fi++){let Dp=Fi<f?u:h;N[Fi]=Ce.slice(S,S+Dp),A[Fi]=y.encode(N[Fi]),S+=Dp,z=Math.max(z,Dp)}let _=new Uint8Array(n),Q=0,Ie,Kt;for(Ie=0;Ie<z;Ie++)for(Kt=0;Kt<s;Kt++)Ie<N[Kt].length&&(_[Q++]=N[Kt][Ie]);for(Ie=0;Ie<v;Ie++)for(Kt=0;Kt<s;Kt++)_[Q++]=A[Kt][Ie];return _}a(wC,"createCodewords");function PC(o,e,t,n){let r;if(Array.isArray(o))r=pd.fromArray(o);else if(typeof o=="string"){let p=e;if(!p){let u=pd.rawSplit(o);p=tp.getBestVersionForData(u,t)}r=pd.fromString(o,p||40)}else throw new Error("Invalid data");let i=tp.getBestVersionForData(r,t);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(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nfets",
3
- "version": "0.0.145",
3
+ "version": "0.0.147",
4
4
  "description": "typescript libraries for Brazilian's SEFAZ standards",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -71,7 +71,7 @@
71
71
  "@types/node": "^26.1.2",
72
72
  "@types/pdfkit": "^0.17.3",
73
73
  "@typescript-eslint/parser": "^8.66.0",
74
- "axios": "^1.19.0",
74
+ "axios": "^1.20.0",
75
75
  "cross-env": "^10.1.0",
76
76
  "eslint": "^10.8.0",
77
77
  "eslint-plugin-prettier": "^5.5.6",