nfets 0.0.50 → 0.0.51
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.
- package/dist/{chunk-YXSKUFMV.mjs → chunk-K6AWXRHY.mjs} +1 -1
- package/dist/{chunk-Q47VIRPG.mjs → chunk-YQCBUAAQ.mjs} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/nfe/index.cjs +1 -1
- package/dist/nfe/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{A as uf,B as hf,D as mf,E as gf,F as vf,G as yf,H as Kn,J as H,K as p,L as Ns,M as ui,d as cf,f as d,g as ff,h as y,i as Ss,j as Ge,l as Wn,n as Ue,o as U,p as pf,q as df,v as lf,w as eo,y as w,z as at}from"./chunk-
|
|
2
|
+
import{A as uf,B as hf,D as mf,E as gf,F as vf,G as yf,H as Kn,J as H,K as p,L as Ns,M as ui,d as cf,f as d,g as ff,h as y,i as Ss,j as Ge,l as Wn,n as Ue,o as U,p as pf,q as df,v as lf,w as eo,y as w,z as at}from"./chunk-YQCBUAAQ.mjs";import{a as s,b as ye,d as b,f as Zl}from"./chunk-W6MRGYXP.mjs";var gc=b((fI,Dp)=>{"use strict";Dp.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var xi=b(ir=>{"use strict";var vc,lh=[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];ir.getSymbolSize=s(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");ir.getSymbolTotalCodewords=s(function(e){return lh[e]},"getSymbolTotalCodewords");ir.getBCHDigit=function(o){let e=0;for(;o!==0;)e++,o>>>=1;return e};ir.setToSJISFunction=s(function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');vc=e},"setToSJISFunction");ir.isKanjiModeEnabled=function(){return typeof vc<"u"};ir.toSJIS=s(function(e){return vc(e)},"toSJIS")});var _a=b(zt=>{"use strict";zt.L={bit:1};zt.M={bit:0};zt.Q={bit:3};zt.H={bit:2};function uh(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return zt.L;case"m":case"medium":return zt.M;case"q":case"quartile":return zt.Q;case"h":case"high":return zt.H;default:throw new Error("Unknown EC Level: "+o)}}s(uh,"fromString");zt.isValid=s(function(e){return e&&typeof e.bit<"u"&&e.bit>=0&&e.bit<4},"isValid");zt.from=s(function(e,t){if(zt.isValid(e))return e;try{return uh(e)}catch{return t}},"from")});var jp=b((hI,Tp)=>{"use strict";function Ep(){this.buffer=[],this.length=0}s(Ep,"BitBuffer");Ep.prototype={get:s(function(o){let e=Math.floor(o/8);return(this.buffer[e]>>>7-o%8&1)===1},"get"),put:s(function(o,e){for(let t=0;t<e;t++)this.putBit((o>>>e-t-1&1)===1)},"put"),getLengthInBits:s(function(){return this.length},"getLengthInBits"),putBit:s(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")};Tp.exports=Ep});var Lp=b((gI,Mp)=>{"use strict";function Ln(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)}s(Ln,"BitMatrix");Ln.prototype.set=function(o,e,t,i){let n=o*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};Ln.prototype.get=function(o,e){return this.data[o*this.size+e]};Ln.prototype.xor=function(o,e,t){this.data[o*this.size+e]^=t};Ln.prototype.isReserved=function(o,e){return this.reservedBit[o*this.size+e]};Mp.exports=Ln});var Bp=b($a=>{"use strict";var hh=xi().getSymbolSize;$a.getRowColCoords=s(function(e){if(e===1)return[];let t=Math.floor(e/7)+2,i=hh(e),n=i===145?26:Math.ceil((i-13)/(2*t-2))*2,r=[i-7];for(let a=1;a<t-1;a++)r[a]=r[a-1]-n;return r.push(6),r.reverse()},"getRowColCoords");$a.getPositions=s(function(e){let t=[],i=$a.getRowColCoords(e),n=i.length;for(let r=0;r<n;r++)for(let a=0;a<n;a++)r===0&&a===0||r===0&&a===n-1||r===n-1&&a===0||t.push([i[r],i[a]]);return t},"getPositions")});var Qp=b(Hp=>{"use strict";var mh=xi().getSymbolSize,Vp=7;Hp.getPositions=s(function(e){let t=mh(e);return[[0,0],[t-Vp,0],[0,t-Vp]]},"getPositions")});var Gp=b(X=>{"use strict";X.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var rr={N1:3,N2:3,N3:40,N4:10};X.isValid=s(function(e){return e!=null&&e!==""&&!isNaN(e)&&e>=0&&e<=7},"isValid");X.from=s(function(e){return X.isValid(e)?parseInt(e,10):void 0},"from");X.getPenaltyN1=s(function(e){let t=e.size,i=0,n=0,r=0,a=null,c=null;for(let f=0;f<t;f++){n=r=0,a=c=null;for(let l=0;l<t;l++){let m=e.get(f,l);m===a?n++:(n>=5&&(i+=rr.N1+(n-5)),a=m,n=1),m=e.get(l,f),m===c?r++:(r>=5&&(i+=rr.N1+(r-5)),c=m,r=1)}n>=5&&(i+=rr.N1+(n-5)),r>=5&&(i+=rr.N1+(r-5))}return i},"getPenaltyN1");X.getPenaltyN2=s(function(e){let t=e.size,i=0;for(let n=0;n<t-1;n++)for(let r=0;r<t-1;r++){let a=e.get(n,r)+e.get(n,r+1)+e.get(n+1,r)+e.get(n+1,r+1);(a===4||a===0)&&i++}return i*rr.N2},"getPenaltyN2");X.getPenaltyN3=s(function(e){let t=e.size,i=0,n=0,r=0;for(let a=0;a<t;a++){n=r=0;for(let c=0;c<t;c++)n=n<<1&2047|e.get(a,c),c>=10&&(n===1488||n===93)&&i++,r=r<<1&2047|e.get(c,a),c>=10&&(r===1488||r===93)&&i++}return i*rr.N3},"getPenaltyN3");X.getPenaltyN4=s(function(e){let t=0,i=e.data.length;for(let r=0;r<i;r++)t+=e.data[r];return Math.abs(Math.ceil(t*100/i/5)-10)*rr.N4},"getPenaltyN4");function gh(o,e,t){switch(o){case X.Patterns.PATTERN000:return(e+t)%2===0;case X.Patterns.PATTERN001:return e%2===0;case X.Patterns.PATTERN010:return t%3===0;case X.Patterns.PATTERN011:return(e+t)%3===0;case X.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2===0;case X.Patterns.PATTERN101:return e*t%2+e*t%3===0;case X.Patterns.PATTERN110:return(e*t%2+e*t%3)%2===0;case X.Patterns.PATTERN111:return(e*t%3+(e+t)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}s(gh,"getMaskAt");X.applyMask=s(function(e,t){let i=t.size;for(let n=0;n<i;n++)for(let r=0;r<i;r++)t.isReserved(r,n)||t.xor(r,n,gh(e,r,n))},"applyMask");X.getBestMask=s(function(e,t){let i=Object.keys(X.Patterns).length,n=0,r=1/0;for(let a=0;a<i;a++){t(a),X.applyMask(a,e);let c=X.getPenaltyN1(e)+X.getPenaltyN2(e)+X.getPenaltyN3(e)+X.getPenaltyN4(e);X.applyMask(a,e),c<r&&(r=c,n=a)}return n},"getBestMask")});var Sc=b(yc=>{"use strict";var Ai=_a(),es=[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],ts=[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];yc.getBlocksCount=s(function(e,t){switch(t){case Ai.L:return es[(e-1)*4+0];case Ai.M:return es[(e-1)*4+1];case Ai.Q:return es[(e-1)*4+2];case Ai.H:return es[(e-1)*4+3];default:return}},"getBlocksCount");yc.getTotalCodewordsCount=s(function(e,t){switch(t){case Ai.L:return ts[(e-1)*4+0];case Ai.M:return ts[(e-1)*4+1];case Ai.Q:return ts[(e-1)*4+2];case Ai.H:return ts[(e-1)*4+3];default:return}},"getTotalCodewordsCount")});var Up=b(is=>{"use strict";var Bn=new Uint8Array(512),os=new Uint8Array(256);s((function(){let e=1;for(let t=0;t<255;t++)Bn[t]=e,os[e]=t,e<<=1,e&256&&(e^=285);for(let t=255;t<512;t++)Bn[t]=Bn[t-255]}),"initTables")();is.log=s(function(e){if(e<1)throw new Error("log("+e+")");return os[e]},"log");is.exp=s(function(e){return Bn[e]},"exp");is.mul=s(function(e,t){return e===0||t===0?0:Bn[os[e]+os[t]]},"mul")});var Yp=b(Vn=>{"use strict";var Nc=Up();Vn.mul=s(function(e,t){let i=new Uint8Array(e.length+t.length-1);for(let n=0;n<e.length;n++)for(let r=0;r<t.length;r++)i[n+r]^=Nc.mul(e[n],t[r]);return i},"mul");Vn.mod=s(function(e,t){let i=new Uint8Array(e);for(;i.length-t.length>=0;){let n=i[0];for(let a=0;a<t.length;a++)i[a]^=Nc.mul(t[a],n);let r=0;for(;r<i.length&&i[r]===0;)r++;i=i.slice(r)}return i},"mod");Vn.generateECPolynomial=s(function(e){let t=new Uint8Array([1]);for(let i=0;i<e;i++)t=Vn.mul(t,new Uint8Array([1,Nc.exp(i)]));return t},"generateECPolynomial")});var Xp=b((OI,qp)=>{"use strict";var Zp=Yp();function bc(o){this.genPoly=void 0,this.degree=o,this.degree&&this.initialize(this.degree)}s(bc,"ReedSolomonEncoder");bc.prototype.initialize=s(function(e){this.degree=e,this.genPoly=Zp.generateECPolynomial(this.degree)},"initialize");bc.prototype.encode=s(function(e){if(!this.genPoly)throw new Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let i=Zp.mod(t,this.genPoly),n=this.degree-i.length;if(n>0){let r=new Uint8Array(this.degree);return r.set(i,n),r}return i},"encode");qp.exports=bc});var Cc=b(Jp=>{"use strict";Jp.isValid=s(function(e){return!isNaN(e)&&e>=1&&e<=40},"isValid")});var Rc=b(li=>{"use strict";var Wp="[0-9]+",vh="[A-Z $%*+\\-./:]+",Hn="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Hn=Hn.replace(/u/g,"\\u");var yh="(?:(?![A-Z0-9 $%*+\\-./:]|"+Hn+`)(?:.|[\r
|
|
3
3
|
]))+`;li.KANJI=new RegExp(Hn,"g");li.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");li.BYTE=new RegExp(yh,"g");li.NUMERIC=new RegExp(Wp,"g");li.ALPHANUMERIC=new RegExp(vh,"g");var Sh=new RegExp("^"+Hn+"$"),Nh=new RegExp("^"+Wp+"$"),bh=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");li.testKanji=s(function(e){return Sh.test(e)},"testKanji");li.testNumeric=s(function(e){return Nh.test(e)},"testNumeric");li.testAlphanumeric=s(function(e){return bh.test(e)},"testAlphanumeric")});var Oi=b(ve=>{"use strict";var Ch=Cc(),Fc=Rc();ve.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};ve.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};ve.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};ve.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};ve.MIXED={bit:-1};ve.getCharCountIndicator=s(function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Ch.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");ve.getBestModeForData=s(function(e){return Fc.testNumeric(e)?ve.NUMERIC:Fc.testAlphanumeric(e)?ve.ALPHANUMERIC:Fc.testKanji(e)?ve.KANJI:ve.BYTE},"getBestModeForData");ve.toString=s(function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},"toString");ve.isValid=s(function(e){return e&&e.bit&&e.ccBits},"isValid");function Rh(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return ve.NUMERIC;case"alphanumeric":return ve.ALPHANUMERIC;case"kanji":return ve.KANJI;case"byte":return ve.BYTE;default:throw new Error("Unknown mode: "+o)}}s(Rh,"fromString");ve.from=s(function(e,t){if(ve.isValid(e))return e;try{return Rh(e)}catch{return t}},"from")});var ed=b(nr=>{"use strict";var rs=xi(),Fh=Sc(),Kp=_a(),Pi=Oi(),Ic=Cc(),_p=7973,kp=rs.getBCHDigit(_p);function Ih(o,e,t){for(let i=1;i<=40;i++)if(e<=nr.getCapacity(i,t,o))return i}s(Ih,"getBestVersionForDataLength");function $p(o,e){return Pi.getCharCountIndicator(o,e)+4}s($p,"getReservedBitsCount");function wh(o,e){let t=0;return o.forEach(function(i){let n=$p(i.mode,e);t+=n+i.getBitsLength()}),t}s(wh,"getTotalBitsFromDataArray");function zh(o,e){for(let t=1;t<=40;t++)if(wh(o,t)<=nr.getCapacity(t,e,Pi.MIXED))return t}s(zh,"getBestVersionForMixedData");nr.from=s(function(e,t){return Ic.isValid(e)?parseInt(e,10):t},"from");nr.getCapacity=s(function(e,t,i){if(!Ic.isValid(e))throw new Error("Invalid QR Code version");typeof i>"u"&&(i=Pi.BYTE);let n=rs.getSymbolTotalCodewords(e),r=Fh.getTotalCodewordsCount(e,t),a=(n-r)*8;if(i===Pi.MIXED)return a;let c=a-$p(i,e);switch(i){case Pi.NUMERIC:return Math.floor(c/10*3);case Pi.ALPHANUMERIC:return Math.floor(c/11*2);case Pi.KANJI:return Math.floor(c/13);case Pi.BYTE:default:return Math.floor(c/8)}},"getCapacity");nr.getBestVersionForData=s(function(e,t){let i,n=Kp.from(t,Kp.M);if(Array.isArray(e)){if(e.length>1)return zh(e,n);if(e.length===0)return 1;i=e[0]}else i=e;return Ih(i.mode,i.getLength(),n)},"getBestVersionForData");nr.getEncodedBits=s(function(e){if(!Ic.isValid(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;rs.getBCHDigit(t)-kp>=0;)t^=_p<<rs.getBCHDigit(t)-kp;return e<<12|t},"getEncodedBits")});var rd=b(id=>{"use strict";var wc=xi(),od=1335,xh=21522,td=wc.getBCHDigit(od);id.getEncodedBits=s(function(e,t){let i=e.bit<<3|t,n=i<<10;for(;wc.getBCHDigit(n)-td>=0;)n^=od<<wc.getBCHDigit(n)-td;return(i<<10|n)^xh},"getEncodedBits")});var ad=b((GI,nd)=>{"use strict";var Ah=Oi();function tn(o){this.mode=Ah.NUMERIC,this.data=o.toString()}s(tn,"NumericData");tn.getBitsLength=s(function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},"getBitsLength");tn.prototype.getLength=s(function(){return this.data.length},"getLength");tn.prototype.getBitsLength=s(function(){return tn.getBitsLength(this.data.length)},"getBitsLength");tn.prototype.write=s(function(e){let t,i,n;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),n=parseInt(i,10),e.put(n,10);let r=this.data.length-t;r>0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,r*3+1))},"write");nd.exports=tn});var cd=b((YI,sd)=>{"use strict";var Oh=Oi(),zc=["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 on(o){this.mode=Oh.ALPHANUMERIC,this.data=o}s(on,"AlphanumericData");on.getBitsLength=s(function(e){return 11*Math.floor(e/2)+6*(e%2)},"getBitsLength");on.prototype.getLength=s(function(){return this.data.length},"getLength");on.prototype.getBitsLength=s(function(){return on.getBitsLength(this.data.length)},"getBitsLength");on.prototype.write=s(function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let i=zc.indexOf(this.data[t])*45;i+=zc.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(zc.indexOf(this.data[t]),6)},"write");sd.exports=on});var pd=b((qI,fd)=>{"use strict";var Ph=Oi();function rn(o){this.mode=Ph.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}s(rn,"ByteData");rn.getBitsLength=s(function(e){return e*8},"getBitsLength");rn.prototype.getLength=s(function(){return this.data.length},"getLength");rn.prototype.getBitsLength=s(function(){return rn.getBitsLength(this.data.length)},"getBitsLength");rn.prototype.write=function(o){for(let e=0,t=this.data.length;e<t;e++)o.put(this.data[e],8)};fd.exports=rn});var ld=b((JI,dd)=>{"use strict";var Dh=Oi(),Eh=xi();function nn(o){this.mode=Dh.KANJI,this.data=o}s(nn,"KanjiData");nn.getBitsLength=s(function(e){return e*13},"getBitsLength");nn.prototype.getLength=s(function(){return this.data.length},"getLength");nn.prototype.getBitsLength=s(function(){return nn.getBitsLength(this.data.length)},"getBitsLength");nn.prototype.write=function(o){let e;for(e=0;e<this.data.length;e++){let t=Eh.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)}};dd.exports=nn});var ud=b((KI,xc)=>{"use strict";var Qn={single_source_shortest_paths:s(function(o,e,t){var i={},n={};n[e]=0;var r=Qn.PriorityQueue.make();r.push(e,0);for(var a,c,f,l,m,g,S,N,F;!r.empty();){a=r.pop(),c=a.value,l=a.cost,m=o[c]||{};for(f in m)m.hasOwnProperty(f)&&(g=m[f],S=l+g,N=n[f],F=typeof n[f]>"u",(F||N>S)&&(n[f]=S,r.push(f,S),i[f]=c))}if(typeof t<"u"&&typeof n[t]>"u"){var O=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(O)}return i},"single_source_shortest_paths"),extract_shortest_path_from_predecessor_list:s(function(o,e){for(var t=[],i=e,n;i;)t.push(i),n=o[i],i=o[i];return t.reverse(),t},"extract_shortest_path_from_predecessor_list"),find_path:s(function(o,e,t){var i=Qn.single_source_shortest_paths(o,e,t);return Qn.extract_shortest_path_from_predecessor_list(i,t)},"find_path"),PriorityQueue:{make:s(function(o){var e=Qn.PriorityQueue,t={},i;o=o||{};for(i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t.queue=[],t.sorter=o.sorter||e.default_sorter,t},"make"),default_sorter:s(function(o,e){return o.cost-e.cost},"default_sorter"),push:s(function(o,e){var t={value:o,cost:e};this.queue.push(t),this.queue.sort(this.sorter)},"push"),pop:s(function(){return this.queue.shift()},"pop"),empty:s(function(){return this.queue.length===0},"empty")}};typeof xc<"u"&&(xc.exports=Qn)});var bd=b(an=>{"use strict";var V=Oi(),gd=ad(),vd=cd(),yd=pd(),Sd=ld(),Gn=Rc(),ns=xi(),Th=ud();function hd(o){return unescape(encodeURIComponent(o)).length}s(hd,"getStringByteLength");function Un(o,e,t){let i=[],n;for(;(n=o.exec(t))!==null;)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}s(Un,"getSegments");function Nd(o){let e=Un(Gn.NUMERIC,V.NUMERIC,o),t=Un(Gn.ALPHANUMERIC,V.ALPHANUMERIC,o),i,n;return ns.isKanjiModeEnabled()?(i=Un(Gn.BYTE,V.BYTE,o),n=Un(Gn.KANJI,V.KANJI,o)):(i=Un(Gn.BYTE_KANJI,V.BYTE,o),n=[]),e.concat(t,i,n).sort(function(a,c){return a.index-c.index}).map(function(a){return{data:a.data,mode:a.mode,length:a.length}})}s(Nd,"getSegmentsFromString");function Ac(o,e){switch(e){case V.NUMERIC:return gd.getBitsLength(o);case V.ALPHANUMERIC:return vd.getBitsLength(o);case V.KANJI:return Sd.getBitsLength(o);case V.BYTE:return yd.getBitsLength(o)}}s(Ac,"getSegmentBitsLength");function jh(o){return o.reduce(function(e,t){let i=e.length-1>=0?e[e.length-1]:null;return i&&i.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}s(jh,"mergeSegments");function Mh(o){let e=[];for(let t=0;t<o.length;t++){let i=o[t];switch(i.mode){case V.NUMERIC:e.push([i,{data:i.data,mode:V.ALPHANUMERIC,length:i.length},{data:i.data,mode:V.BYTE,length:i.length}]);break;case V.ALPHANUMERIC:e.push([i,{data:i.data,mode:V.BYTE,length:i.length}]);break;case V.KANJI:e.push([i,{data:i.data,mode:V.BYTE,length:hd(i.data)}]);break;case V.BYTE:e.push([{data:i.data,mode:V.BYTE,length:hd(i.data)}])}}return e}s(Mh,"buildNodes");function Lh(o,e){let t={},i={start:{}},n=["start"];for(let r=0;r<o.length;r++){let a=o[r],c=[];for(let f=0;f<a.length;f++){let l=a[f],m=""+r+f;c.push(m),t[m]={node:l,lastCount:0},i[m]={};for(let g=0;g<n.length;g++){let S=n[g];t[S]&&t[S].node.mode===l.mode?(i[S][m]=Ac(t[S].lastCount+l.length,l.mode)-Ac(t[S].lastCount,l.mode),t[S].lastCount+=l.length):(t[S]&&(t[S].lastCount=l.length),i[S][m]=Ac(l.length,l.mode)+4+V.getCharCountIndicator(l.mode,e))}}n=c}for(let r=0;r<n.length;r++)i[n[r]].end=0;return{map:i,table:t}}s(Lh,"buildGraph");function md(o,e){let t,i=V.getBestModeForData(o);if(t=V.from(e,i),t!==V.BYTE&&t.bit<i.bit)throw new Error('"'+o+'" cannot be encoded with mode '+V.toString(t)+`.
|
|
5
5
|
Suggested mode is: `+V.toString(i));switch(t===V.KANJI&&!ns.isKanjiModeEnabled()&&(t=V.BYTE),t){case V.NUMERIC:return new gd(o);case V.ALPHANUMERIC:return new vd(o);case V.KANJI:return new Sd(o);case V.BYTE:return new yd(o)}}s(md,"buildSingleSegment");an.fromArray=s(function(e){return e.reduce(function(t,i){return typeof i=="string"?t.push(md(i,null)):i.data&&t.push(md(i.data,i.mode)),t},[])},"fromArray");an.fromString=s(function(e,t){let i=Nd(e,ns.isKanjiModeEnabled()),n=Mh(i),r=Lh(n,t),a=Th.find_path(r.map,"start","end"),c=[];for(let f=1;f<a.length-1;f++)c.push(r.table[a[f]].node);return an.fromArray(jh(c))},"fromString");an.rawSplit=s(function(e){return an.fromArray(Nd(e,ns.isKanjiModeEnabled()))},"rawSplit")});var jc=b(Cd=>{"use strict";var ss=xi(),Oc=_a(),Bh=jp(),Vh=Lp(),Hh=Bp(),Qh=Qp(),Ec=Gp(),Tc=Sc(),Gh=Xp(),as=ed(),Uh=rd(),Yh=Oi(),Pc=bd();function Zh(o,e){let t=o.size,i=Qh.getPositions(e);for(let n=0;n<i.length;n++){let r=i[n][0],a=i[n][1];for(let c=-1;c<=7;c++)if(!(r+c<=-1||t<=r+c))for(let f=-1;f<=7;f++)a+f<=-1||t<=a+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(r+c,a+f,!0,!0):o.set(r+c,a+f,!1,!0))}}s(Zh,"setupFinderPattern");function qh(o){let e=o.size;for(let t=8;t<e-8;t++){let i=t%2===0;o.set(t,6,i,!0),o.set(6,t,i,!0)}}s(qh,"setupTimingPattern");function Xh(o,e){let t=Hh.getPositions(e);for(let i=0;i<t.length;i++){let n=t[i][0],r=t[i][1];for(let a=-2;a<=2;a++)for(let c=-2;c<=2;c++)a===-2||a===2||c===-2||c===2||a===0&&c===0?o.set(n+a,r+c,!0,!0):o.set(n+a,r+c,!1,!0)}}s(Xh,"setupAlignmentPattern");function Jh(o,e){let t=o.size,i=as.getEncodedBits(e),n,r,a;for(let c=0;c<18;c++)n=Math.floor(c/3),r=c%3+t-8-3,a=(i>>c&1)===1,o.set(n,r,a,!0),o.set(r,n,a,!0)}s(Jh,"setupVersionInfo");function Dc(o,e,t){let i=o.size,n=Uh.getEncodedBits(e,t),r,a;for(r=0;r<15;r++)a=(n>>r&1)===1,r<6?o.set(r,8,a,!0):r<8?o.set(r+1,8,a,!0):o.set(i-15+r,8,a,!0),r<8?o.set(8,i-r-1,a,!0):r<9?o.set(8,15-r-1+1,a,!0):o.set(8,15-r-1,a,!0);o.set(i-8,8,1,!0)}s(Dc,"setupFormatInfo");function Wh(o,e){let t=o.size,i=-1,n=t-1,r=7,a=0;for(let c=t-1;c>0;c-=2)for(c===6&&c--;;){for(let f=0;f<2;f++)if(!o.isReserved(n,c-f)){let l=!1;a<e.length&&(l=(e[a]>>>r&1)===1),o.set(n,c-f,l),r--,r===-1&&(a++,r=7)}if(n+=i,n<0||t<=n){n-=i,i=-i;break}}}s(Wh,"setupData");function Kh(o,e,t){let i=new Bh;t.forEach(function(f){i.put(f.mode.bit,4),i.put(f.getLength(),Yh.getCharCountIndicator(f.mode,o)),f.write(i)});let n=ss.getSymbolTotalCodewords(o),r=Tc.getTotalCodewordsCount(o,e),a=(n-r)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);let c=(a-i.getLengthInBits())/8;for(let f=0;f<c;f++)i.put(f%2?17:236,8);return kh(i,o,e)}s(Kh,"createData");function kh(o,e,t){let i=ss.getSymbolTotalCodewords(e),n=Tc.getTotalCodewordsCount(e,t),r=i-n,a=Tc.getBlocksCount(e,t),c=i%a,f=a-c,l=Math.floor(i/a),m=Math.floor(r/a),g=m+1,S=l-m,N=new Gh(S),F=0,O=new Array(a),A=new Array(a),L=0,At=new Uint8Array(o.buffer);for(let fr=0;fr<a;fr++){let ys=fr<f?m:g;O[fr]=At.slice(F,F+ys),A[fr]=N.encode(O[fr]),F+=ys,L=Math.max(L,ys)}let bo=new Uint8Array(i),Qe=0,vt,Co;for(vt=0;vt<L;vt++)for(Co=0;Co<a;Co++)vt<O[Co].length&&(bo[Qe++]=O[Co][vt]);for(vt=0;vt<S;vt++)for(Co=0;Co<a;Co++)bo[Qe++]=A[Co][vt];return bo}s(kh,"createCodewords");function _h(o,e,t,i){let n;if(Array.isArray(o))n=Pc.fromArray(o);else if(typeof o=="string"){let l=e;if(!l){let m=Pc.rawSplit(o);l=as.getBestVersionForData(m,t)}n=Pc.fromString(o,l||40)}else throw new Error("Invalid data");let r=as.getBestVersionForData(n,t);if(!r)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=r;else if(e<r)throw new Error(`
|
|
@@ -102,7 +102,7 @@ Actual: `+N.attribValue);else{var Se=N.tag,Ce=N.tags[N.tags.length-1]||N;Se.ns==
|
|
|
102
102
|
`+a.map(qF).join(`
|
|
103
103
|
`):" "+qF(a[0]):"as no adapter specified";throw new et("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}o(Khe,"getAdapter");var eb={getAdapter:Khe,adapters:ID};function _D(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new fi(null,r)}o(_D,"throwIfCancellationRequested");function tb(r){return _D(r),r.headers=Yr.from(r.headers),r.data=bv.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),eb.getAdapter(r.adapter||Sd.adapter,r)(r).then(o(function(n){return _D(r),n.data=bv.call(r,r.transformResponse,n),n.headers=Yr.from(n.headers),n},"onAdapterResolution"),o(function(n){return Av(n)||(_D(r),n&&n.response&&(n.response.data=bv.call(r,r.transformResponse,n.response),n.response.headers=Yr.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(tb,"dispatchRequest");var rb={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{rb[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var HF={};rb.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+gf+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new et(s(a," has been removed"+(t?" in "+t:"")),et.ERR_DEPRECATED);return t&&!HF[a]&&(HF[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");rb.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function $he(r,e,t){if(typeof r!="object")throw new et("options must be an object",et.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],c=u===void 0||a(u,i,r);if(c!==!0)throw new et("option "+i+" must be "+c,et.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new et("Unknown option "+i,et.ERR_BAD_OPTION)}}o($he,"assertOptions");var Tv={assertOptions:$he,validators:rb};var uo=Tv.validators,nb=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new hD,response:new hD}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
104
104
|
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ma(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&Tv.assertOptions(n,{silentJSONParsing:uo.transitional(uo.boolean),forcedJSONParsing:uo.transitional(uo.boolean),clarifyTimeoutError:uo.transitional(uo.boolean)},!1),s!=null&&(ie.isFunction(s)?t.paramsSerializer={serialize:s}:Tv.assertOptions(s,{encode:uo.function,serialize:uo.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Tv.assertOptions(t,{baseUrl:uo.spelling("baseURL"),withXsrfToken:uo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ie.merge(i.common,i[t.method]);i&&ie.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),t.headers=Yr.concat(a,i);let u=[],c=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(c=c&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(S){l.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!c){let v=[tb.bind(this),void 0];for(v.unshift(...u),v.push(...l),g=v.length,h=Promise.resolve(t);m<g;)h=h.then(v[m++],v[m++]);return h}g=u.length;let y=t;for(;m<g;){let v=u[m++],S=u[m++];try{y=v(y)}catch(w){S.call(this,w);break}}try{h=tb.call(this,y)}catch(v){return Promise.reject(v)}for(m=0,g=l.length;m<g;)h=h.then(l[m++],l[m++]);return h}getUri(e){e=ma(this.defaults,e);let t=mf(e.baseURL,e.url,e.allowAbsoluteUrls);return df(t,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],o(function(e){nb.prototype[e]=function(t,n){return this.request(ma(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ie.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(ma(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),nb.prototype[e]=t(),nb.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var Iv=nb;var Ghe=class KF{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new fi(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new KF(o(function(s){e=s},"executor")),cancel:e}}},$F=Ghe;function DD(r){return o(function(t){return r.apply(null,t)},"wrap")}o(DD,"spread");function BD(r){return ie.isObject(r)&&r.isAxiosError===!0}o(BD,"isAxiosError");var RD={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(RD).forEach(([r,e])=>{RD[e]=r});var GF=RD;function XF(r){let e=new Iv(r),t=yv(Iv.prototype.request,e);return ie.extend(t,Iv.prototype,e,{allOwnKeys:!0}),ie.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return XF(ma(r,s))},"create"),t}o(XF,"createInstance");var En=XF(Sd);En.Axios=Iv;En.CanceledError=fi;En.CancelToken=$F;En.isCancel=Av;En.VERSION=gf;En.toFormData=xc;En.AxiosError=et;En.Cancel=En.CanceledError;En.all=o(function(e){return Promise.all(e)},"all");En.spread=DD;En.isAxiosError=BD;En.mergeConfig=ma;En.AxiosHeaders=Yr;En.formToJSON=r=>WE(ie.isHTMLForm(r)?new FormData(r):r);En.getAdapter=eb.getAdapter;En.HttpStatusCode=GF;En.default=En;var sb=En;var{Axios:CNe,AxiosError:NNe,CanceledError:TNe,isCancel:INe,CancelToken:_Ne,VERSION:DNe,all:BNe,Cancel:RNe,isAxiosError:ONe,spread:PNe,toFormData:kNe,AxiosHeaders:LNe,HttpStatusCode:VNe,formToJSON:UNe,getAdapter:jNe,mergeConfig:FNe}=sb;import Zhe from"os";import{arch as Jhe,platform as Yhe}from"os";import{join as _v,dirname as OD,resolve as Qhe}from"path";import{existsSync as ib}from"fs";import{resolve as zF}from"path";import{createRequire as WF}from"module";import{fileURLToPath as Xhe,pathToFileURL as Whe}from"url";var zhe=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Ad,JF=o(()=>{if(Ad!==void 0)return Ad;if(zhe){Ad=void 0;return}try{Ad=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Ad=void 0}return Ad},"getImportMetaUrl"),YF=o(()=>{if(typeof Je<"u")return Je;let r=JF();if(r)return WF(r);let e=Whe(zF(process.cwd(),"package.json")).href;return WF(e)},"getRequireFn"),QF=o(()=>{if(typeof __filename<"u")return __filename;let r=JF();return r?Xhe(r):zF(process.cwd())},"getCurrentFile");var Dv=o(r=>YF()(r),"exportRequireModule"),ab=o(r=>{r=`${r}.node`;let e=`${Yhe()}-${Jhe()}`;if(process.env.NFETS_ADDONS_DIR)return Dv(_v(process.env.NFETS_ADDONS_DIR,r));let t=QF(),n=Qhe(t,"../../../../"),s=_v(n,"build","addons",e,r);if(ib(s))return Dv(s);let i=t;for(let a=0;a<5;a++){let u=_v(i,"build","addons",e,r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=_v(i,"node_modules","nfets","build","addons",e,r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=_v(i,"build","Release",r);if(ib(u))return Dv(u);let c=OD(i);if(c===i)break;i=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var ob=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(Zhe.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
105
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=ab("winhttp_ssl_client"),{CN:i}=new Cd().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var ZF=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:tpe.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PD({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new PD({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new PD({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=sb.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(epe.platform()==="win32")try{return this.certificate?ob.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,eM.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Ii(c)}catch(t){return Zl(t)}}};var rpe=ab("xml_validator"),tM=rpe;var Q0e=Hl(A9(),1);import Y0e from"crypto";var C9="application/xml";var qt;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(qt||(qt={}));function npe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(npe,"SelectNodesEx");function spe(r,e){let t=Nd("xpath").select;return t(e,r)}o(spe,"SelectNodesNode");var N9=typeof self<"u"?npe:spe;function Hi(r){r=r.replace(/\r\n/g,`
|
|
105
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=ab("winhttp_ssl_client"),{CN:i}=new Cd().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var ZF=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:tpe.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PD({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new PD({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new PD({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=sb.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(epe.platform()==="win32")try{return this.certificate?ob.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,eM.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Ii(c)}catch(t){return Zl(t)}}};var rpe=ab("xml_validator"),tM=rpe;var Q0e=Hl(A9(),1);import Y0e from"crypto";var C9="application/xml";var qt;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(qt||(qt={}));function npe(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(npe,"SelectNodesEx");function spe(r,e){let t=Nd("xpath").select;return t(e,r)}o(spe,"SelectNodesNode");var N9=typeof self<"u"?npe:spe;function Hi(r){r=r.replace(/\r\n/g,`
|
|
106
106
|
`).replace(/\r/g,`
|
|
107
107
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Nd("DOMParser"),new e().parseFromString(r,C9)}o(Hi,"Parse");function lo(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Nd("XMLSerializer"),new e().serializeToString(r)}o(lo,"Stringify");function Ab(r,e){let t=N9(r,e);return t&&t.length>0?t[0]:null}o(Ab,"SelectSingleNode");function T9(r,e){return r&&r.nodeType===e}o(T9,"isNodeType");function pi(r){return T9(r,qt.Element)}o(pi,"isElement");function xf(r){return T9(r,qt.Document)}o(xf,"isDocument");var I9=new Map;function _9(r){for(let e in r)I9.set(e,r[e])}o(_9,"setNodeDependencies");function Nd(r){let e=I9.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Nd,"getNodeDependency");var Ov="element",Pv="attribute",Cb="content";var ipe=1e9;function $D(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o($D,"assign");function Ht(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=$D({},t.items)),t.target=e}}o(Ht,"XmlElement");function Jt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=$D({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||ipe,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Ov},B9(e,s,r)}}o(Jt,"XmlChildElement");function Ur(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=$D({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=Pv,B9(e,s,r)}}o(Ur,"XmlAttribute");function B9(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(B9,"defineProperty");var Ac=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function ape(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(ape,"printf");function ope(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(ope,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=ape(yn[e],...t);this.message=`${this.prefix}${ope(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},De;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(De||(De={}));var yn={};yn[De.NONE]="No description";yn[De.NULL_REFERENCE]="Null reference";yn[De.NULL_PARAM]="'%1' has empty '%2' object";yn[De.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";yn[De.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";yn[De.METHOD_NOT_IMPLEMENTED]="Method is not implemented";yn[De.METHOD_NOT_SUPPORTED]="Method is not supported";yn[De.PARAM_REQUIRED]="Required parameter is missing '%1'";yn[De.CONVERTER_UNSUPPORTED]="Converter is not supported";yn[De.ELEMENT_MALFORMED]="Malformed element '%1'";yn[De.ELEMENT_MISSING]="Element '%1' is missing in '%2'";yn[De.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";yn[De.CONTENT_MISSING]="Content is missing in '%1'";yn[De.CRYPTOGRAPHIC]="Cryptographic error: %1";yn[De.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";yn[De.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";yn[De.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";yn[De.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";yn[De.XML_EXCEPTION]="XML exception: %1";yn[De.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var br=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(De.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Ki={get:o(r=>{if(r)return br.ToBase64(r)},"get"),set:o(r=>br.FromBase64(r),"set")},kv={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var upe="xml_root",Ws=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new $e(De.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new $e(De.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return xf(e)&&(n=e.getElementById(t)),n==null&&(n=Ab(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=Ab(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=Ab(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=upe,t=null,n=null){if(n&&!t)throw new $e(De.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Hi(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=xf(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];pi(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=xf(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(pi(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(pi(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new $e(De.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let c=t[u],l=i.items[u];switch(l.type){case Cb:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.CONTENT_MISSING,a);(h.defaultValue!==c||h.required)&&(s.textContent=m);break}case Pv:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==c||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case Ov:{let h=l,m=null;if(h.parser){if(h.required&&!c||h.minOccurs&&!c.Count){let g=c?.localName||h.localName;throw new $e(De.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(h.required||c.Count)))}else{let g=h.converter?h.converter.get(c):c;if(h.required&&g===void 0)throw new $e(De.ELEMENT_MISSING,h.localName,a);if(c!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let y of g){let v=y instanceof r?y.GetXml(!0):y;v!==null&&m&&m.appendChild(v)}else if(g instanceof r){let y=g.GetXml(!0);y&&m&&m.appendChild(y)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let w=m.childNodes.item(S);pi(w)&&g.push(w)}let y=h.minOccurs||0,v=h.maxOccurs||1/0;if(g.length<y||g.length>v)throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Hi(e).documentElement:t=e,!t)throw new $e(De.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new $e(De.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case Cb:{let c=u;if(c.required&&!t.textContent)throw new $e(De.CONTENT_MISSING,i);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case Pv:{let c=u,l,h;if(!c.localName)throw new $e(De.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),h=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),h=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(De.ATTRIBUTE_MISSING,c.localName,i);if(!l())n[a]=c.defaultValue;else{let m=h(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case Ov:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let h=new c.parser;if(!(h instanceof Td))throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new $e(De.COLLECTION_LIMIT,c.parser.localName,i);n[a]=h;continue}let l=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!pi(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(De.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,i);if(c.parser){if(l){let h=new c.parser;h.localName=c.localName,h.namespaceURI=c.namespaceURI,n[a]=h,h.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let h=l.textContent||"",m=c.converter?c.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?lo(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(De.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Td=class extends Ws{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new Ac(this.GetIterator().map(e))}Filter(e){return new Ac(this.GetIterator().filter(e))}Sort(e){return new Ac(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(De.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(pi(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Id=class extends Ac{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var cpe="[object ArrayBuffer]",vt=class WD{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===cpe}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=WD.toUint8Array(e),s=WD.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},XD="string",lpe=/^[0-9a-f\s]+$/i,fpe=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,hpe=/^[a-zA-Z0-9-_]+$/,R9=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=vt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},fo=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=vt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Nt=class _d{static{o(this,"Convert")}static isHex(e){return typeof e===XD&&lpe.test(e)}static isBase64(e){return typeof e===XD&&fpe.test(e)}static isBase64Url(e){return typeof e===XD&&hpe.test(e)}static ToString(e,t="utf8"){let n=vt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return fo.toString(n,!0);case"utf16":case"utf16be":return fo.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return fo.fromString(e,!0);case"utf16":case"utf16be":return fo.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=vt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=_d.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return R9.fromString(e);case"utf16":case"utf16be":return fo.fromString(e);case"utf16le":case"usc2":return fo.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=_d.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return R9.toString(e);case"utf16":case"utf16be":return fo.toString(e);case"utf16le":case"usc2":return fo.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=vt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=vt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!_d.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return fo.toString(e,t)}static FromUtf16String(e,t=!1){return fo.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Nt.DEFAULT_UTF8_ENCODING="utf8";function O(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(O,"getParametersValue");function Nb(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(Nb,"bufferToHexCodes");function Yo(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(Yo,"utilFromBase");function ga(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);l[i-h-1]=Math.floor(s/m),s-=l[i-h-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(ga,"utilToBase");function wf(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(wf,"utilConcatBuf");function Tb(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(Tb,"utilConcatView");function zD(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=Yo(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,Yo(i,8)-n}o(zD,"utilDecodeTC");function P9(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=ga(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let s=ga(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let c=0;c<a.byteLength;c++)i[c+1]=u[c];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(P9,"utilEncodeTC");function Cc(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Cc,"isEqualBuffer");function zs(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(zs,"padNumber");var k9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",L9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function Ib(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",c=e?L9:k9;if(n){let l=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){l=h;break}r=r.slice(l)}for(;s<r.length;){let l=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=l>>2,y=(l&3)<<4|h>>4,v=(h&15)<<2|m>>6,S=m&63;i===1?v=S=64:a===1&&(S=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(y)}`:S===64?u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(S)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(S)}`}return u}o(Ib,"toBase64");function Dd(r,e=!1,t=!1){let n=e?L9:k9;function s(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(s,"indexOf");function i(c){return c===64?0:c}o(i,"test");let a=0,u="";for(;a<r.length;){let c=s(r.charAt(a++)),l=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(c)<<2|i(l)>>4,y=(i(l)&15)<<4|i(h)>>2,v=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(y)),m!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,l=-1;for(let h=c-1;h>=0;h--)if(u.charCodeAt(h)!==0){l=h;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(Dd,"fromBase64");function Lv(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(Lv,"arrayBufferToString");function Sf(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Sf,"stringToArrayBuffer");var ppe=Math.log(2);function V9(r){let e=Math.log(r)/ppe,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(V9,"nearestPowerOf2");function ke(r,e){for(let t of e)delete r[t]}o(ke,"clearProps");function _b(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(_b,"assertBigInt");function ZD(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(ZD,"concat");function Qo(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(Qo,"checkBufferParams");var eB=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return ZD(this.items)}},Vv=[new Uint8Array([1])],j9="0123456789",JD="name",F9="valueHexView",dpe="isHexOnly",mpe="idBlock",gpe="tagClass",vpe="tagNumber",ype="isConstructed",xpe="fromBER",wpe="toBER",Spe="local",Js="",va=new ArrayBuffer(0),Db=new Uint8Array(0),jv="EndOfContent",q9="OCTET STRING",H9="BIT STRING";function Zo(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?vt.toUint8Array(i.valueHex):Db}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Qo(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",va)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Nt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(Zo,"HexBlock");var Ef=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Js,warnings:n=[],valueBeforeDecode:s=Db}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=vt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Nt.ToHex(this.valueBeforeDecodeView)}}};Ef.NAME="baseBlock";var Ys=class extends Ef{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};Ys.NAME="valueBlock";var K9=class extends Zo(Ef){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?vt.toUint8Array(e.valueHex):Db,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",va}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=ga(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=i[c]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),h=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let g=new Uint8Array(h);for(let y=0;y<l.length;y++)g[y]=l[y];l=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,l[c-1]=i[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(m),this.blockLength<=9?this.tagNumber=Yo(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};K9.NAME="identificationBlock";var $9=class extends Ef{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=s.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Yo(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=ga(this.length,8);if(s.byteLength>127)return this.error="Too big length",va;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};$9.NAME="lengthBlock";var ht={},Is=class extends Ef{static{o(this,"BaseBlock")}constructor({name:e=Js,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new K9(s),this.lenBlock=new $9(s),this.valueBlock=i?new i(s):new Ys(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new eB;t||G9(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?va:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Nt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Nt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Cc(t,n)}};Is.NAME="BaseBlock";function G9(r){var e;if(r instanceof ht.Constructed)for(let t of r.valueBlock.value)G9(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(G9,"prepareIndefiniteForm");var X9=class extends Is{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Js,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};X9.NAME="BaseStringBlock";var W9=class extends Zo(Ys){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};W9.NAME="PrimitiveValueBlock";var z9,xt=class extends Is{static{o(this,"Primitive")}constructor(e={}){super(e,W9),this.idBlock.isConstructed=!1}};z9=xt;ht.Primitive=z9;xt.NAME="PRIMITIVE";function Epe(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(Epe,"localChangeType");function Fv(r,e=0,t=r.length){let n=e,s=new Is({},Ys),i=new Ef;if(!Qo(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let c=Is;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};c=ht.EndOfContent;break;case 1:c=ht.Boolean;break;case 2:c=ht.Integer;break;case 3:c=ht.BitString;break;case 4:c=ht.OctetString;break;case 5:c=ht.Null;break;case 6:c=ht.ObjectIdentifier;break;case 10:c=ht.Enumerated;break;case 12:c=ht.Utf8String;break;case 13:c=ht.RelativeObjectIdentifier;break;case 14:c=ht.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:c=ht.Sequence;break;case 17:c=ht.Set;break;case 18:c=ht.NumericString;break;case 19:c=ht.PrintableString;break;case 20:c=ht.TeletexString;break;case 21:c=ht.VideotexString;break;case 22:c=ht.IA5String;break;case 23:c=ht.UTCTime;break;case 24:c=ht.GeneralizedTime;break;case 25:c=ht.GraphicString;break;case 26:c=ht.VisibleString;break;case 27:c=ht.GeneralString;break;case 28:c=ht.UniversalString;break;case 29:c=ht.CharacterString;break;case 30:c=ht.BmpString;break;case 31:c=ht.DATE;break;case 32:c=ht.TimeOfDay;break;case 33:c=ht.DateTime;break;case 34:c=ht.Duration;break;default:{let l=s.idBlock.isConstructed?new ht.Constructed:new ht.Primitive;l.idBlock=s.idBlock,l.lenBlock=s.lenBlock,l.warnings=s.warnings,s=l}}break;case 2:case 3:case 4:default:c=s.idBlock.isConstructed?ht.Constructed:ht.Primitive}return s=Epe(s,c),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(Fv,"localFromBER");function Qr(r){if(!r.byteLength){let e=new Is({},Ys);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Fv(vt.toUint8Array(r).slice(),0,r.byteLength)}o(Qr,"fromBER");function bpe(r,e){return r?1:e}o(bpe,"checkLen");var Nc=class extends Ys{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=vt.toUint8Array(e);if(!Qo(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;bpe(this.isIndefiniteForm,n)>0;){let a=Fv(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===jv)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===jv?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new eB;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?va:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Nc.NAME="ConstructedValueBlock";var J9,fe=class extends Is{static{o(this,"Constructed")}constructor(e={}){super(e,Nc),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
108
108
|
`).map(s=>` ${s}`).join(`
|
package/dist/core/index.cjs
CHANGED
|
@@ -102,7 +102,7 @@ Actual: `+N.attribValue);else{var Se=N.tag,Ce=N.tags[N.tags.length-1]||N;Se.ns==
|
|
|
102
102
|
`+a.map(s7).join(`
|
|
103
103
|
`):" "+s7(a[0]):"as no adapter specified";throw new Ze("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s}o(Jge,"getAdapter");var Qb={getAdapter:Jge,adapters:ER};function bR(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new xi(null,r)}o(bR,"throwIfCancellationRequested");function Zb(r){return bR(r),r.headers=nn.from(r.headers),r.data=iv.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Qb.getAdapter(r.adapter||Kd.adapter,r)(r).then(o(function(n){return bR(r),n.data=iv.call(r,r.transformResponse,n),n.headers=nn.from(n.headers),n},"onAdapterResolution"),o(function(n){return av(n)||(bR(r),n&&n.response&&(n.response.data=iv.call(r,r.transformResponse,n.response),n.response.headers=nn.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(Zb,"dispatchRequest");var eA={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{eA[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var i7={};eA.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+Lf+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new Ze(s(a," has been removed"+(t?" in "+t:"")),Ze.ERR_DEPRECATED);return t&&!i7[a]&&(i7[a]=!0,console.warn(s(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,u):!0}},"transitional");eA.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function Yge(r,e,t){if(typeof r!="object")throw new Ze("options must be an object",Ze.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),s=n.length;for(;s-- >0;){let i=n[s],a=e[i];if(a){let u=r[i],c=u===void 0||a(u,i,r);if(c!==!0)throw new Ze("option "+i+" must be "+c,Ze.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Ze("Unknown option "+i,Ze.ERR_BAD_OPTION)}}o(Yge,"assertOptions");var cv={assertOptions:Yge,validators:eA};var wo=cv.validators,tA=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new sR,response:new sR}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;let i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
104
104
|
`+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Aa(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&cv.assertOptions(n,{silentJSONParsing:wo.transitional(wo.boolean),forcedJSONParsing:wo.transitional(wo.boolean),clarifyTimeoutError:wo.transitional(wo.boolean)},!1),s!=null&&(ie.isFunction(s)?t.paramsSerializer={serialize:s}:cv.assertOptions(s,{encode:wo.function,serialize:wo.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cv.assertOptions(t,{baseUrl:wo.spelling("baseURL"),withXsrfToken:wo.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&ie.merge(i.common,i[t.method]);i&&ie.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),t.headers=nn.concat(a,i);let u=[],c=!0;this.interceptors.request.forEach(o(function(S){typeof S.runWhen=="function"&&S.runWhen(t)===!1||(c=c&&S.synchronous,u.unshift(S.fulfilled,S.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(S){l.push(S.fulfilled,S.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!c){let y=[Zb.bind(this),void 0];for(y.unshift(...u),y.push(...l),g=y.length,h=Promise.resolve(t);m<g;)h=h.then(y[m++],y[m++]);return h}g=u.length;let v=t;for(;m<g;){let y=u[m++],S=u[m++];try{v=y(v)}catch(w){S.call(this,w);break}}try{h=Zb.call(this,v)}catch(y){return Promise.reject(y)}for(m=0,g=l.length;m<g;)h=h.then(l[m++],l[m++]);return h}getUri(e){e=Aa(this.defaults,e);let t=kf(e.baseURL,e.url,e.allowAbsoluteUrls);return Pf(t,e.params,e.paramsSerializer)}};ie.forEach(["delete","get","head","options"],o(function(e){tA.prototype[e]=function(t,n){return this.request(Aa(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ie.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(Aa(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),tA.prototype[e]=t(),tA.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var lv=tA;var Qge=class a7{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(i){t=i},"promiseExecutor"));let n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i,a=new Promise(u=>{n.subscribe(u),i=u}).then(s);return a.cancel=o(function(){n.unsubscribe(i)},"reject"),a},e(o(function(i,a,u){n.reason||(n.reason=new xi(i,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new a7(o(function(s){e=s},"executor")),cancel:e}}},o7=Qge;function AR(r){return o(function(t){return r.apply(null,t)},"wrap")}o(AR,"spread");function CR(r){return ie.isObject(r)&&r.isAxiosError===!0}o(CR,"isAxiosError");var NR={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(NR).forEach(([r,e])=>{NR[e]=r});var u7=NR;function c7(r){let e=new lv(r),t=ev(lv.prototype.request,e);return ie.extend(t,lv.prototype,e,{allOwnKeys:!0}),ie.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return c7(Aa(r,s))},"create"),t}o(c7,"createInstance");var Tn=c7(Kd);Tn.Axios=lv;Tn.CanceledError=xi;Tn.CancelToken=o7;Tn.isCancel=av;Tn.VERSION=Lf;Tn.toFormData=Fc;Tn.AxiosError=Ze;Tn.Cancel=Tn.CanceledError;Tn.all=o(function(e){return Promise.all(e)},"all");Tn.spread=AR;Tn.isAxiosError=CR;Tn.mergeConfig=Aa;Tn.AxiosHeaders=nn;Tn.formToJSON=r=>Gb(ie.isHTMLForm(r)?new FormData(r):r);Tn.getAdapter=Qb.getAdapter;Tn.HttpStatusCode=u7;Tn.default=Tn;var rA=Tn;var{Axios:ZRe,AxiosError:eOe,CanceledError:tOe,isCancel:rOe,CancelToken:nOe,VERSION:sOe,all:iOe,Cancel:aOe,isAxiosError:oOe,spread:uOe,toFormData:cOe,AxiosHeaders:lOe,HttpStatusCode:fOe,formToJSON:hOe,getAdapter:pOe,mergeConfig:dOe}=rA;var p7=cr(require("os"),1);var sA=require("os"),Yi=require("path"),hv=require("fs");var IR=require("path"),TR=require("module"),nA=require("url");var Zge=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,Xd,l7=o(()=>{if(Xd!==void 0)return Xd;if(Zge){Xd=void 0;return}try{Xd=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{Xd=void 0}return Xd},"getImportMetaUrl"),f7=o(()=>{if(typeof require<"u")return require;let r=l7();if(r)return(0,TR.createRequire)(r);let e=(0,nA.pathToFileURL)((0,IR.resolve)(process.cwd(),"package.json")).href;return(0,TR.createRequire)(e)},"getRequireFn"),h7=o(()=>{if(typeof __filename<"u")return __filename;let r=l7();return r?(0,nA.fileURLToPath)(r):(0,IR.resolve)(process.cwd())},"getCurrentFile");var fv=o(r=>f7()(r),"exportRequireModule"),iA=o(r=>{r=`${r}.node`;let e=`${(0,sA.platform)()}-${(0,sA.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return fv((0,Yi.join)(process.env.NFETS_ADDONS_DIR,r));let t=h7(),n=(0,Yi.resolve)(t,"../../../../"),s=(0,Yi.join)(n,"build","addons",e,r);if((0,hv.existsSync)(s))return fv(s);let i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"build","addons",e,r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"node_modules","nfets","build","addons",e,r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}i=t;for(let a=0;a<5;a++){let u=(0,Yi.join)(i,"build","Release",r);if((0,hv.existsSync)(u))return fv(u);let c=(0,Yi.dirname)(i);if(c===i)break;i=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var aA=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(p7.default.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
105
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=iA("winhttp_ssl_client"),{CN:i}=new xf().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var _R=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:m7.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new oA.Agent({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new oA.Agent({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new oA.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=rA.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(d7.default.platform()==="win32")try{return this.certificate?aA.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,g7.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Li(c)}catch(t){return vf(t)}}};var eye=iA("xml_validator"),y7=eye;var _X=cr(require("crypto"),1),zxe=cr(jK(),1);var MK="application/xml";var Ht;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ht||(Ht={}));function tye(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(tye,"SelectNodesEx");function rye(r,e){let t=Wd("xpath").select;return t(e,r)}o(rye,"SelectNodesNode");var qK=typeof self<"u"?tye:rye;function Qi(r){r=r.replace(/\r\n/g,`
|
|
105
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[s,i]=n.split(":").map(a=>a.trim());return t[s]=i,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),s=iA("winhttp_ssl_client"),{CN:i}=new xf().extractCertificateInfo(this.certificate.certificate),a=await s.request(i??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var _R=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:m7.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new oA.Agent({...e});let{ca:t,password:n,certificate:s,privateKey:i}=this.certificate;return i?new oA.Agent({passphrase:n,cert:s.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(i),...e}):new oA.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=rA.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(d7.default.platform()==="win32")try{return this.certificate?aA.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,g7.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let s=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),i=this.toolkit.getFirstNode(s)??"",a=e.xsd,u=await this.toolkit.validate(i,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:s},{request:t});return Li(c)}catch(t){return vf(t)}}};var eye=iA("xml_validator"),y7=eye;var _X=cr(require("crypto"),1),zxe=cr(jK(),1);var MK="application/xml";var Ht;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(Ht||(Ht={}));function tye(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),s=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),i=[],a;for(;a=s.iterateNext();)i.push(a);return i}o(tye,"SelectNodesEx");function rye(r,e){let t=Wd("xpath").select;return t(e,r)}o(rye,"SelectNodesNode");var qK=typeof self<"u"?tye:rye;function Qi(r){r=r.replace(/\r\n/g,`
|
|
106
106
|
`).replace(/\r/g,`
|
|
107
107
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Wd("DOMParser"),new e().parseFromString(r,MK)}o(Qi,"Parse");function Eo(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Wd("XMLSerializer"),new e().serializeToString(r)}o(Eo,"Stringify");function AA(r,e){let t=qK(r,e);return t&&t.length>0?t[0]:null}o(AA,"SelectSingleNode");function HK(r,e){return r&&r.nodeType===e}o(HK,"isNodeType");function Si(r){return HK(r,Ht.Element)}o(Si,"isElement");function Ff(r){return HK(r,Ht.Document)}o(Ff,"isDocument");var KK=new Map;function $K(r){for(let e in r)KK.set(e,r[e])}o($K,"setNodeDependencies");function Wd(r){let e=KK.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Wd,"getNodeDependency");var mv="element",gv="attribute",CA="content";var nye=1e9;function jR(r,...e){let t=r;for(let n=0;n<e.length;n++){let s=e[n];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=s[i])}return t}o(jR,"assign");function Kt(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=jR({},t.items)),t.target=e}}o(Kt,"XmlElement");function Yt(r={}){return(e,t)=>{let n=e.constructor,s=t;n.items||(n.items={}),n.target!==n&&(n.items=jR({},n.items)),n.target=e;let i;r.parser?i={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||nye,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:i={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||s;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[s]={...i,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:mv},XK(e,s,r)}}o(Yt,"XmlChildElement");function Mr(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,s=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=jR({},n.items)),n.target=e;let i=n.items;i[t]=r,i[t].type=gv,XK(e,s,r)}}o(Mr,"XmlAttribute");function XK(r,e,t){let n=`_${e}`,s={set:o(function(i){this[n]!==i&&(this.element=null,this[n]=i)},"set"),get:o(function(){if(this[n]===void 0){let i=t.defaultValue;t.parser&&(i=new t.parser,i.localName=t.localName),this[n]=i}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,s)}o(XK,"defineProperty");var qc=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function sye(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,s)=>{let i=parseInt(s,10)-1;return e[i]!==void 0?e[i]:""});return t=t.replace(/%%/g,"%"),t}o(sye,"printf");function iye(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(iye,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=sye(bn[e],...t);this.message=`${this.prefix}${iye(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},De;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(De||(De={}));var bn={};bn[De.NONE]="No description";bn[De.NULL_REFERENCE]="Null reference";bn[De.NULL_PARAM]="'%1' has empty '%2' object";bn[De.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";bn[De.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";bn[De.METHOD_NOT_IMPLEMENTED]="Method is not implemented";bn[De.METHOD_NOT_SUPPORTED]="Method is not supported";bn[De.PARAM_REQUIRED]="Required parameter is missing '%1'";bn[De.CONVERTER_UNSUPPORTED]="Converter is not supported";bn[De.ELEMENT_MALFORMED]="Malformed element '%1'";bn[De.ELEMENT_MISSING]="Element '%1' is missing in '%2'";bn[De.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";bn[De.CONTENT_MISSING]="Content is missing in '%1'";bn[De.CRYPTOGRAPHIC]="Cryptographic error: %1";bn[De.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";bn[De.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";bn[De.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";bn[De.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";bn[De.XML_EXCEPTION]="XML exception: %1";bn[De.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var Tr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(De.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(De.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(De.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let s=0;s<e.length;s++){let i=e[s].toString(16);n.push(i.length===1?"0"+i:i)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let s=e.slice(n,n+2);t[n/2]=parseInt(s,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var Zi={get:o(r=>{if(r)return Tr.ToBase64(r)},"get"),set:o(r=>Tr.FromBase64(r),"set")},yv={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var aye="xml_root",ti=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let s=e.getElementsByTagName(t);if(n&&s.length===0)throw new $e(De.ELEMENT_MISSING,t,e.localName);return s[0]||null}static GetAttribute(e,t,n,s=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(s)throw new $e(De.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Ff(e)&&(n=e.getElementById(t)),n==null&&(n=AA(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=AA(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=AA(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=aye,t=null,n=null){if(n&&!t)throw new $e(De.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let s="",i="",a="";n&&(s=n+":",i=":"+n),t&&(a=` xmlns${i}="${t}"`);let u=`${s}${e}`;return Qi(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Ff(e)?e.documentElement:e;let s=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];Si(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&s.push(a)}return s}static GetFirstChild(e,t,n){e=Ff(e)?e.documentElement:e;for(let s=0;s<e.childNodes.length;s++){let i=e.childNodes[s];if(Si(i)&&i.localName===t&&(i.namespaceURI===n||!n))return i}return null}static GetChild(e,t,n,s=!0){for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes[i];if(Si(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(s)throw new $e(De.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],s=this[t];if(n.parser&&s&&s.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),s=this.CreateElement(),i=this.GetStatic(),a=this.localName||"";if(i.items)for(let u in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,u))continue;let c=t[u],l=i.items[u];switch(l.type){case CA:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.CONTENT_MISSING,a);(h.defaultValue!==c||h.required)&&(s.textContent=m);break}case gv:{let h=l,m=h.converter?h.converter.get(c):c;if(h.required&&m==null)throw new $e(De.ATTRIBUTE_MISSING,h.localName,a);(h.defaultValue!==c||h.required)&&(h.namespaceURI?s.setAttributeNS(h.namespaceURI,h.localName||"",m):s.setAttribute(h.localName||"",m));break}case mv:{let h=l,m=null;if(h.parser){if(h.required&&!c||h.minOccurs&&!c.Count){let g=c?.localName||h.localName;throw new $e(De.ELEMENT_MISSING,g,a)}c&&(m=c.GetXml(c.element===void 0&&(h.required||c.Count)))}else{let g=h.converter?h.converter.get(c):c;if(h.required&&g===void 0)throw new $e(De.ELEMENT_MISSING,h.localName,a);if(c!==h.defaultValue||h.required)if(h.namespaceURI?m=n.createElementNS(h.namespaceURI,`${h.prefix?h.prefix+":":""}${h.localName}`):m=n.createElement(`${h.prefix?h.prefix+":":""}${h.localName}`),Array.isArray(g))for(let v of g){let y=v instanceof r?v.GetXml(!0):v;y!==null&&m&&m.appendChild(y)}else if(g instanceof r){let v=g.GetXml(!0);v&&m&&m.appendChild(v)}else m&&(m.textContent=g)}if(m)if(h.noRoot){let g=[];for(let S=0;S<m.childNodes.length;S++){let w=m.childNodes.item(S);Si(w)&&g.push(w)}let v=h.minOccurs||0,y=h.maxOccurs||1/0;if(g.length<v||g.length>y)throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);g.forEach(S=>s.appendChild(S.cloneNode(!0)))}else{if(m.childNodes.length<(h.minOccurs||0)||m.childNodes.length>(h.maxOccurs||1/0))throw new $e(De.COLLECTION_LIMIT,c.localName,i.localName);s.appendChild(m)}break}}}return this.OnGetXml(s),this.element=s,s}LoadXml(e){let t,n=this;if(typeof e=="string"?t=Qi(e).documentElement:t=e,!t)throw new $e(De.PARAM_REQUIRED,"element");let s=this.GetStatic(),i=this.localName||"";if(!(t.localName===i&&t.namespaceURI==this.NamespaceURI))throw new $e(De.ELEMENT_MALFORMED,i);if(s.items)for(let a in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,a))continue;let u=s.items[a];switch(u.type){case CA:{let c=u;if(c.required&&!t.textContent)throw new $e(De.CONTENT_MISSING,i);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case gv:{let c=u,l,h;if(!c.localName)throw new $e(De.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),h=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),h=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(De.ATTRIBUTE_MISSING,c.localName,i);if(!l())n[a]=c.defaultValue;else{let m=h(),g=c.converter&&m?c.converter.set(m):m;n[a]=g}break}case mv:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let h=new c.parser;if(!(h instanceof zd))throw new $e(De.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);h.OnLoadXml(t),delete h.element;let m=c.minOccurs||0,g=c.maxOccurs||1/0;if(h.Count<m||h.Count>g)throw new $e(De.COLLECTION_LIMIT,c.parser.localName,i);n[a]=h;continue}let l=null;for(let h=0;h<t.childNodes.length;h++){let m=t.childNodes.item(h);if(!Si(m))continue;let g=m;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(De.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,i);if(c.parser){if(l){let h=new c.parser;h.localName=c.localName,h.namespaceURI=c.namespaceURI,n[a]=h,h.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let h=l.textContent||"",m=c.converter?c.converter.set(h):h;n[a]=m}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?Eo(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(De.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,s=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(De.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,s=s||this.prefix;let i=(s?`${s}:`:"")+t,a=n&&e?e.createElementNS(n,i):e?.createElement(i);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var zd=class extends ti{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new qc(this.GetIterator().map(e))}Filter(e){return new qc(this.GetIterator().filter(e))}Sort(e){return new qc(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(De.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let s=e.childNodes.item(n);if(!(Si(s)&&s.localName===t.parser.localName&&s.namespaceURI==t.namespaceURI))continue;let i=s,a=new t.parser;a.LoadXml(i),this.Add(a)}}};var Jd=class extends qc{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.prefix===e)return i}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let s=t;s>=0;s--){let i=this.items[s];if(i.namespace===e)return i}return null}};var oye="[object ArrayBuffer]",gt=class HR{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===oye}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=HR.toUint8Array(e),s=HR.toUint8Array(t);if(n.length!==s.byteLength)return!1;for(let i=0;i<n.length;i++)if(n[i]!==s[i])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let s=new Uint8Array(n),i=0;for(let a of t){let u=this.toUint8Array(a);s.set(u,i),i+=u.length}return e[e.length-1]instanceof Function?this.toView(s,e[e.length-1]):s.buffer}},qR="string",uye=/^[0-9a-f\s]+$/i,cye=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,lye=/^[a-zA-Z0-9-_]+$/,WK=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n.buffer}static toString(e){let t=gt.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return decodeURIComponent(escape(n))}},bo=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=gt.toArrayBuffer(e),s=new DataView(n),i="";for(let a=0;a<n.byteLength;a+=2){let u=s.getUint16(a,t);i+=String.fromCharCode(u)}return i}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),s=new DataView(n);for(let i=0;i<e.length;i++)s.setUint16(i*2,e.charCodeAt(i),t);return n}},Nt=class Yd{static{o(this,"Convert")}static isHex(e){return typeof e===qR&&uye.test(e)}static isBase64(e){return typeof e===qR&&cye.test(e)}static isBase64Url(e){return typeof e===qR&&lye.test(e)}static ToString(e,t="utf8"){let n=gt.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return bo.toString(n,!0);case"utf16":case"utf16be":return bo.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return bo.fromString(e,!0);case"utf16":case"utf16be":return bo.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=gt.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=Yd.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return WK.fromString(e);case"utf16":case"utf16be":return bo.fromString(e);case"utf16le":case"usc2":return bo.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Yd.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return WK.toString(e);case"utf16":case"utf16be":return bo.toString(e);case"utf16le":case"usc2":return bo.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let s=0;s<t;s++)n[s]=e.charCodeAt(s);return n.buffer}static ToBinary(e){let t=gt.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return n}static ToHex(e){let t=gt.toUint8Array(e),n="",s=t.length;for(let i=0;i<s;i++){let a=t[i];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Yd.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let s=0;s<t.length;s=s+2){let i=t.slice(s,s+2);n[s/2]=parseInt(i,16)}return n.buffer}static ToUtf16String(e,t=!1){return bo.toString(e,t)}static FromUtf16String(e,t=!1){return bo.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};Nt.DEFAULT_UTF8_ENCODING="utf8";function O(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(O,"getParametersValue");function NA(r,e=0,t=r.byteLength-e,n=!1){let s="";for(let i of new Uint8Array(r,e,t)){let a=i.toString(16).toUpperCase();a.length===1&&(s+="0"),s+=a,n&&(s+=" ")}return s.trim()}o(NA,"bufferToHexCodes");function hu(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(hu,"utilFromBase");function Ca(r,e,t=-1){let n=t,s=r,i=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),i=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),i=n}let l=new Uint8Array(c);for(let h=u-1;h>=0;h--){let m=Math.pow(2,h*e);l[i-h-1]=Math.floor(s/m),s-=l[i-h-1]*m}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Ca,"utilToBase");function jf(...r){let e=0,t=0;for(let i of r)e+=i.byteLength;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(new Uint8Array(i),t),t+=i.byteLength;return n}o(jf,"utilConcatBuf");function TA(...r){let e=0,t=0;for(let i of r)e+=i.length;let n=new ArrayBuffer(e),s=new Uint8Array(n);for(let i of r)s.set(i,t),t+=i.length;return s}o(TA,"utilConcatView");function KR(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=hu(t,8),s=new ArrayBuffer(this.valueHex.byteLength),i=new Uint8Array(s);for(let u=0;u<this.valueHex.byteLength;u++)i[u]=r[u];return i[0]&=127,hu(i,8)-n}o(KR,"utilDecodeTC");function JK(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Ca(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let s=Ca(e,8,n),i=new Uint8Array(s);if(i[0]&128){let a=s.slice(0),u=new Uint8Array(a);s=new ArrayBuffer(s.byteLength+1),i=new Uint8Array(s);for(let c=0;c<a.byteLength;c++)i[c+1]=u[c];i[0]=0}return s}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(JK,"utilEncodeTC");function Hc(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let s=0;s<t.length;s++)if(t[s]!==n[s])return!1;return!0}o(Hc,"isEqualBuffer");function ri(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,s=new Array(n);for(let a=0;a<n;a++)s[a]="0";return s.join("").concat(t)}o(ri,"padNumber");var YK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",QK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function IA(r,e=!1,t=!1,n=!1){let s=0,i=0,a=0,u="",c=e?QK:YK;if(n){let l=0;for(let h=0;h<r.length;h++)if(r.charCodeAt(h)!==0){l=h;break}r=r.slice(l)}for(;s<r.length;){let l=r.charCodeAt(s++);s>=r.length&&(i=1);let h=r.charCodeAt(s++);s>=r.length&&(a=1);let m=r.charCodeAt(s++),g=l>>2,v=(l&3)<<4|h>>4,y=(h&15)<<2|m>>6,S=m&63;i===1?y=S=64:a===1&&(S=64),t?y===64?u+=`${c.charAt(g)}${c.charAt(v)}`:S===64?u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}`:u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}${c.charAt(S)}`:u+=`${c.charAt(g)}${c.charAt(v)}${c.charAt(y)}${c.charAt(S)}`}return u}o(IA,"toBase64");function Qd(r,e=!1,t=!1){let n=e?QK:YK;function s(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(s,"indexOf");function i(c){return c===64?0:c}o(i,"test");let a=0,u="";for(;a<r.length;){let c=s(r.charAt(a++)),l=a>=r.length?0:s(r.charAt(a++)),h=a>=r.length?0:s(r.charAt(a++)),m=a>=r.length?0:s(r.charAt(a++)),g=i(c)<<2|i(l)>>4,v=(i(l)&15)<<4|i(h)>>2,y=(i(h)&3)<<6|i(m);u+=String.fromCharCode(g),h!==64&&(u+=String.fromCharCode(v)),m!==64&&(u+=String.fromCharCode(y))}if(t){let c=u.length,l=-1;for(let h=c-1;h>=0;h--)if(u.charCodeAt(h)!==0){l=h;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(Qd,"fromBase64");function vv(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(vv,"arrayBufferToString");function Mf(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let s=0;s<e;s++)n[s]=r.charCodeAt(s);return t}o(Mf,"stringToArrayBuffer");var fye=Math.log(2);function ZK(r){let e=Math.log(r)/fye,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(ZK,"nearestPowerOf2");function ke(r,e){for(let t of e)delete r[t]}o(ke,"clearProps");function _A(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(_A,"assertBigInt");function WR(r){let e=0,t=0;for(let s=0;s<r.length;s++){let i=r[s];e+=i.byteLength}let n=new Uint8Array(e);for(let s=0;s<r.length;s++){let i=r[s];n.set(new Uint8Array(i),t),t+=i.byteLength}return n.buffer}o(WR,"concat");function pu(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(pu,"checkBufferParams");var zR=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return WR(this.items)}},xv=[new Uint8Array([1])],t$="0123456789",$R="name",r$="valueHexView",hye="isHexOnly",pye="idBlock",dye="tagClass",mye="tagNumber",gye="isConstructed",yye="fromBER",vye="toBER",xye="local",ni="",Na=new ArrayBuffer(0),DA=new Uint8Array(0),Sv="EndOfContent",s$="OCTET STRING",i$="BIT STRING";function du(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var s;super(...n);let i=n[0]||{};this.isHexOnly=(s=i.isHexOnly)!==null&&s!==void 0?s:!1,this.valueHexView=i.valueHex?gt.toUint8Array(i.valueHex):DA}fromBER(n,s,i){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!pu(this,a,s,i))return-1;let u=s+i;return this.valueHexView=a.subarray(s,u),this.valueHexView.length?(this.blockLength=i,u):(this.warnings.push("Zero buffer length"),s)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Na)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:Nt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(du,"HexBlock");var qf=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=ni,warnings:n=[],valueBeforeDecode:s=DA}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=gt.toUint8Array(s)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:Nt.ToHex(this.valueBeforeDecodeView)}}};qf.NAME="baseBlock";var si=class extends qf{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};si.NAME="valueBlock";var a$=class extends du(qf){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,s,i;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?gt.toUint8Array(e.valueHex):DA,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(s=e.tagNumber)!==null&&s!==void 0?s:-1,this.isConstructed=(i=e.isConstructed)!==null&&i!==void 0?i:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Na}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let s=new Uint8Array(1);if(!e){let i=this.tagNumber;i&=31,t|=i,s[0]=t}return s.buffer}if(!this.isHexOnly){let s=Ca(this.tagNumber,7),i=new Uint8Array(s),a=s.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=i[c]|128;u[a]=i[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let s=this.valueHexView;for(let i=0;i<s.length-1;i++)n[i+1]=s[i]|128;n[this.valueHexView.byteLength]=s[s.length-1]}return n.buffer}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;switch(i[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(i[0]&32)===32,this.isHexOnly=!1;let u=i[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),h=255;for(;i[c]&128;){if(l[c-1]=i[c]&127,c++,c>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(c===h){h+=255;let g=new Uint8Array(h);for(let v=0;v<l.length;v++)g[v]=l[v];l=this.valueHexView=new Uint8Array(h)}}this.blockLength=c+1,l[c-1]=i[c]&127;let m=new Uint8Array(c);for(let g=0;g<c;g++)m[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(m),this.blockLength<=9?this.tagNumber=hu(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};a$.NAME="identificationBlock";var o$=class extends qf{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,s;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(s=e.length)!==null&&s!==void 0?s:0}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;let i=s.subarray(t,t+n);if(i.length===0)return this.error="Zero buffer length",-1;if(i[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=i[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(i[0]&128),this.longFormUsed===!1)return this.length=i[0],this.blockLength=1,t+this.blockLength;let a=i[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>i.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=s.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=hu(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let s=Ca(this.length,8);if(s.byteLength>127)return this.error="Too big length",Na;if(t=new ArrayBuffer(s.byteLength+1),e)return t;let i=new Uint8Array(s);n=new Uint8Array(t),n[0]=s.byteLength|128;for(let a=0;a<s.byteLength;a++)n[a+1]=i[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};o$.NAME="lengthBlock";var ft={},ks=class extends qf{static{o(this,"BaseBlock")}constructor({name:e=ni,optional:t=!1,primitiveSchema:n,...s}={},i){super(s),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new a$(s),this.lenBlock=new o$(s),this.valueBlock=i?new i(s):new si(s)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}toBER(e,t){let n=t||new zR;t||u$(this);let s=this.idBlock.toBER(e);if(n.write(s),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let i=this.valueBlock.toBER(e);this.lenBlock.length=i.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(i)}return t?Na:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():Nt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=Nt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Hc(t,n)}};ks.NAME="BaseBlock";function u$(r){var e;if(r instanceof ft.Constructed)for(let t of r.valueBlock.value)u$(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(u$,"prepareIndefiniteForm");var c$=class extends ks{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=ni,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};c$.NAME="BaseStringBlock";var l$=class extends du(si){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};l$.NAME="PrimitiveValueBlock";var f$,vt=class extends ks{static{o(this,"Primitive")}constructor(e={}){super(e,l$),this.idBlock.isConstructed=!1}};f$=vt;ft.Primitive=f$;vt.NAME="PRIMITIVE";function wye(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(wye,"localChangeType");function Ev(r,e=0,t=r.length){let n=e,s=new ks({},si),i=new qf;if(!pu(i,r,e,t))return s.error=i.error,{offset:-1,result:s};if(!r.subarray(e,e+t).length)return s.error="Zero buffer length",{offset:-1,result:s};let u=s.idBlock.fromBER(r,e,t);if(s.idBlock.warnings.length&&s.warnings.concat(s.idBlock.warnings),u===-1)return s.error=s.idBlock.error,{offset:-1,result:s};if(e=u,t-=s.idBlock.blockLength,u=s.lenBlock.fromBER(r,e,t),s.lenBlock.warnings.length&&s.warnings.concat(s.lenBlock.warnings),u===-1)return s.error=s.lenBlock.error,{offset:-1,result:s};if(e=u,t-=s.lenBlock.blockLength,!s.idBlock.isConstructed&&s.lenBlock.isIndefiniteForm)return s.error="Indefinite length form used for primitive encoding form",{offset:-1,result:s};let c=ks;switch(s.idBlock.tagClass){case 1:if(s.idBlock.tagNumber>=37&&s.idBlock.isHexOnly===!1)return s.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:s};switch(s.idBlock.tagNumber){case 0:if(s.idBlock.isConstructed&&s.lenBlock.length>0)return s.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:s};c=ft.EndOfContent;break;case 1:c=ft.Boolean;break;case 2:c=ft.Integer;break;case 3:c=ft.BitString;break;case 4:c=ft.OctetString;break;case 5:c=ft.Null;break;case 6:c=ft.ObjectIdentifier;break;case 10:c=ft.Enumerated;break;case 12:c=ft.Utf8String;break;case 13:c=ft.RelativeObjectIdentifier;break;case 14:c=ft.TIME;break;case 15:return s.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:s};case 16:c=ft.Sequence;break;case 17:c=ft.Set;break;case 18:c=ft.NumericString;break;case 19:c=ft.PrintableString;break;case 20:c=ft.TeletexString;break;case 21:c=ft.VideotexString;break;case 22:c=ft.IA5String;break;case 23:c=ft.UTCTime;break;case 24:c=ft.GeneralizedTime;break;case 25:c=ft.GraphicString;break;case 26:c=ft.VisibleString;break;case 27:c=ft.GeneralString;break;case 28:c=ft.UniversalString;break;case 29:c=ft.CharacterString;break;case 30:c=ft.BmpString;break;case 31:c=ft.DATE;break;case 32:c=ft.TimeOfDay;break;case 33:c=ft.DateTime;break;case 34:c=ft.Duration;break;default:{let l=s.idBlock.isConstructed?new ft.Constructed:new ft.Primitive;l.idBlock=s.idBlock,l.lenBlock=s.lenBlock,l.warnings=s.warnings,s=l}}break;case 2:case 3:case 4:default:c=s.idBlock.isConstructed?ft.Constructed:ft.Primitive}return s=wye(s,c),u=s.fromBER(r,e,s.lenBlock.isIndefiniteForm?t:s.lenBlock.length),s.valueBeforeDecodeView=r.subarray(n,n+s.blockLength),{offset:u,result:s}}o(Ev,"localFromBER");function sn(r){if(!r.byteLength){let e=new ks({},si);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Ev(gt.toUint8Array(r).slice(),0,r.byteLength)}o(sn,"fromBER");function Sye(r,e){return r?1:e}o(Sye,"checkLen");var Kc=class extends si{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let s=gt.toUint8Array(e);if(!pu(this,s,t,n))return-1;if(this.valueBeforeDecodeView=s.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let i=t;for(;Sye(this.isIndefiniteForm,n)>0;){let a=Ev(s,i,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(i=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===Sv)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===Sv?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){let n=t||new zR;for(let s=0;s<this.value.length;s++)this.value[s].toBER(e,n);return t?Na:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};Kc.NAME="ConstructedValueBlock";var h$,fe=class extends ks{static{o(this,"Constructed")}constructor(e={}){super(e,Kc),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let s=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return s===-1?(this.error=this.valueBlock.error,s):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),s)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
108
108
|
`).map(s=>` ${s}`).join(`
|
package/dist/core/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"../chunk-23RWB4QQ.mjs";import{$ as T,A as w,C as x,D as y,G as z,H as A,I as B,J as C,K as D,M as E,N as F,O as G,P as H,Q as I,R as J,S as K,T as L,U as M,V as N,W as O,X as P,Y as Q,Z as R,_ as S,a,aa as U,b,ba as V,c,ca as W,d,da as X,e,ea as Y,f,fa as Z,g,ga as _,h,ha as $,ia as aa,j as i,ja as ba,k as j,ka as ca,la as da,m as k,ma as ea,p as l,q as m,r as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"../chunk-
|
|
2
|
+
import"../chunk-23RWB4QQ.mjs";import{$ as T,A as w,C as x,D as y,G as z,H as A,I as B,J as C,K as D,M as E,N as F,O as G,P as H,Q as I,R as J,S as K,T as L,U as M,V as N,W as O,X as P,Y as Q,Z as R,_ as S,a,aa as U,b,ba as V,c,ca as W,d,da as X,e,ea as Y,f,fa as Z,g,ga as _,h,ha as $,ia as aa,j as i,ja as ba,k as j,ka as ca,la as da,m as k,ma as ea,p as l,q as m,r as n,s as o,t as p,u as q,v as r,w as s,x as t,y as u,z as v}from"../chunk-YQCBUAAQ.mjs";import"../chunk-W6MRGYXP.mjs";export{ea as ASN1,b as CanonicalizationMethod,C as Choice,v as Decimal,e as DigestAlgorithm,l as EntitySigner,h as Environment,B as IsDecimal,w as MemoryCacheAdapter,i as NFeTsError,y as NativeCertificateRepository,x as NullCacheAdapter,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,k as Signer,p as SkipAllValidations,o as SkipValidation,n as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,g as StateAcronyms,F as StateCodeAcValidator,G as StateCodeAlValidator,H as StateCodeAmValidator,I as StateCodeApValidator,J as StateCodeBaValidator,K as StateCodeCeValidator,L as StateCodeDfValidator,M as StateCodeEsValidator,N as StateCodeGoValidator,O as StateCodeMaValidator,P as StateCodeMgValidator,Q as StateCodeMsValidator,R as StateCodeMtValidator,S as StateCodePaValidator,T as StateCodePbValidator,U as StateCodePeValidator,V as StateCodePiValidator,W as StateCodePrValidator,X as StateCodeRjValidator,Y as StateCodeRnValidator,Z as StateCodeRoValidator,_ as StateCodeRrValidator,$ as StateCodeRsValidator,aa as StateCodeScValidator,ba as StateCodeSeValidator,ca as StateCodeSpValidator,da as StateCodeToValidator,f as StateCodes,E as TransformDateString,D as TransformDecimal,s as ValidateErrorsMetadata,u as Validates,j as ValidationError,A as Xml2JsToolkit,m as XmlSigner,q as clearEmptyValues,t as mapConstraintsToErrors,r as plainToInstance};
|
package/dist/index.cjs
CHANGED
|
@@ -115,7 +115,7 @@ Minimum version required to store current data is: `+s+`.
|
|
|
115
115
|
`+a.map(ZQ).join(`
|
|
116
116
|
`):" "+ZQ(a[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i}o(B2e,"getAdapter");var IR={getAdapter:B2e,adapters:zk};function Kk(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new wo(null,r)}o(Kk,"throwIfCancellationRequested");function TR(r){return Kk(r),r.headers=ri.from(r.headers),r.data=Gw.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),IR.getAdapter(r.adapter||Ry.adapter,r)(r).then(o(function(n){return Kk(r),n.data=Gw.call(r,r.transformResponse,n),n.headers=ri.from(n.headers),n},"onAdapterResolution"),o(function(n){return Xw(n)||(Kk(r),n&&n.response&&(n.response.data=Gw.call(r,r.transformResponse,n.response),n.response.headers=ri.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(TR,"dispatchRequest");var RR={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{RR[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var e$={};RR.transitional=o(function(e,t,n){function i(s,a){return"[Axios v"+Ym+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return o(i,"formatMessage"),(s,a,u)=>{if(e===!1)throw new at(i(a," has been removed"+(t?" in "+t:"")),at.ERR_DEPRECATED);return t&&!e$[a]&&(e$[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,u):!0}},"transitional");RR.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function _2e(r,e,t){if(typeof r!="object")throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let s=n[i],a=e[s];if(a){let u=r[s],c=u===void 0||a(u,s,r);if(c!==!0)throw new at("option "+s+" must be "+c,at.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}o(_2e,"assertOptions");var Yw={assertOptions:_2e,validators:RR};var cl=Yw.validators,DR=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new Nk,response:new Nk}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
117
117
|
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Xu(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&Yw.assertOptions(n,{silentJSONParsing:cl.transitional(cl.boolean),forcedJSONParsing:cl.transitional(cl.boolean),clarifyTimeoutError:cl.transitional(cl.boolean)},!1),i!=null&&(ae.isFunction(i)?t.paramsSerializer={serialize:i}:Yw.assertOptions(i,{encode:cl.function,serialize:cl.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Yw.assertOptions(t,{baseUrl:cl.spelling("baseURL"),withXsrfToken:cl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&ae.merge(s.common,s[t.method]);s&&ae.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),t.headers=ri.concat(a,s);let u=[],c=!0;this.interceptors.request.forEach(o(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(c=c&&b.synchronous,u.unshift(b.fulfilled,b.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(b){l.push(b.fulfilled,b.rejected)},"pushResponseInterceptors"));let p,h=0,g;if(!c){let v=[TR.bind(this),void 0];for(v.unshift(...u),v.push(...l),g=v.length,p=Promise.resolve(t);h<g;)p=p.then(v[h++],v[h++]);return p}g=u.length;let y=t;for(;h<g;){let v=u[h++],b=u[h++];try{y=v(y)}catch(S){b.call(this,S);break}}try{p=TR.call(this,y)}catch(v){return Promise.reject(v)}for(h=0,g=l.length;h<g;)p=p.then(l[h++],l[h++]);return p}getUri(e){e=Xu(this.defaults,e);let t=Jm(e.baseURL,e.url,e.allowAbsoluteUrls);return Wm(t,e.params,e.paramsSerializer)}};ae.forEach(["delete","get","head","options"],o(function(e){DR.prototype[e]=function(t,n){return this.request(Xu(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ae.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(s,a,u){return this.request(Xu(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),DR.prototype[e]=t(),DR.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var Qw=DR;var L2e=class t${static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(s){t=s},"promiseExecutor"));let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,a=new Promise(u=>{n.subscribe(u),s=u}).then(i);return a.cancel=o(function(){n.unsubscribe(s)},"reject"),a},e(o(function(s,a,u){n.reason||(n.reason=new wo(s,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new t$(o(function(i){e=i},"executor")),cancel:e}}},r$=L2e;function Gk(r){return o(function(t){return r.apply(null,t)},"wrap")}o(Gk,"spread");function Xk(r){return ae.isObject(r)&&r.isAxiosError===!0}o(Xk,"isAxiosError");var Wk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Wk).forEach(([r,e])=>{Wk[e]=r});var n$=Wk;function i$(r){let e=new Qw(r),t=Mw(Qw.prototype.request,e);return ae.extend(t,Qw.prototype,e,{allOwnKeys:!0}),ae.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(i){return i$(Xu(r,i))},"create"),t}o(i$,"createInstance");var Bi=i$(Ry);Bi.Axios=Qw;Bi.CanceledError=wo;Bi.CancelToken=r$;Bi.isCancel=Xw;Bi.VERSION=Ym;Bi.toFormData=_h;Bi.AxiosError=at;Bi.Cancel=Bi.CanceledError;Bi.all=o(function(e){return Promise.all(e)},"all");Bi.spread=Gk;Bi.isAxiosError=Xk;Bi.mergeConfig=Xu;Bi.AxiosHeaders=ri;Bi.formToJSON=r=>xR(ae.isHTMLForm(r)?new FormData(r):r);Bi.getAdapter=IR.getAdapter;Bi.HttpStatusCode=n$;Bi.default=Bi;var Py=Bi;var{Axios:r9e,AxiosError:n9e,CanceledError:i9e,isCancel:s9e,CancelToken:a9e,VERSION:o9e,all:u9e,Cancel:c9e,isAxiosError:l9e,spread:f9e,toFormData:p9e,AxiosHeaders:h9e,HttpStatusCode:d9e,formToJSON:m9e,getAdapter:g9e,mergeConfig:v9e}=Py;var o$=lr(require("os"),1);var BR=require("os"),au=require("path"),Zw=require("fs");var Yk=require("path"),Jk=require("module"),OR=require("url");var F2e=typeof jest<"u"||process.env.JEST_WORKER_ID!==void 0,By,s$=o(()=>{if(By!==void 0)return By;if(F2e){By=void 0;return}try{By=new Function("try { return import.meta.url; } catch { return undefined; }")()}catch{By=void 0}return By},"getImportMetaUrl"),a$=o(()=>{if(typeof require<"u")return require;let r=s$();if(r)return(0,Jk.createRequire)(r);let e=(0,OR.pathToFileURL)((0,Yk.resolve)(process.cwd(),"package.json")).href;return(0,Jk.createRequire)(e)},"getRequireFn"),PR=o(()=>{if(typeof __filename<"u")return __filename;let r=s$();return r?(0,OR.fileURLToPath)(r):(0,Yk.resolve)(process.cwd())},"getCurrentFile");var $w=o(r=>a$()(r),"exportRequireModule"),_R=o(r=>{r=`${r}.node`;let e=`${(0,BR.platform)()}-${(0,BR.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return $w((0,au.join)(process.env.NFETS_ADDONS_DIR,r));let t=PR(),n=(0,au.resolve)(t,"../../../../"),i=(0,au.join)(n,"build","addons",e,r);if((0,Zw.existsSync)(i))return $w(i);let s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"build","addons",e,r);if((0,Zw.existsSync)(u))return $w(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"node_modules","nfets","build","addons",e,r);if((0,Zw.existsSync)(u))return $w(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"build","Release",r);if((0,Zw.existsSync)(u))return $w(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var LR=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(o$.default.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
118
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[i,s]=n.split(":").map(a=>a.trim());return t[i]=s,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),i=_R("winhttp_ssl_client"),{CN:s}=new Bm().extractCertificateInfo(this.certificate.certificate),a=await i.request(s??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var eE=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:c$.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new FR.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return s?new FR.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e}):new FR.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=Py.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(u$.default.platform()==="win32")try{return this.certificate?LR.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,l$.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{request:t});return mr(c)}catch(t){return ff(t)}}};var k2e=_R("xml_validator"),f$=k2e;var Ere=lr(require("crypto"),1),PDe=lr(_Z(),1);var LZ="application/xml";var ar;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ar||(ar={}));function V2e(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(V2e,"SelectNodesEx");function j2e(r,e){let t=_y("xpath").select;return t(e,r)}o(j2e,"SelectNodesNode");var FZ=typeof self<"u"?V2e:j2e;function ou(r){r=r.replace(/\r\n/g,`
|
|
118
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[i,s]=n.split(":").map(a=>a.trim());return t[i]=s,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),i=_R("winhttp_ssl_client"),{CN:s}=new Bm().extractCertificateInfo(this.certificate.certificate),a=await i.request(s??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var eE=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:c$.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new FR.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return s?new FR.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e}):new FR.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=Py.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(u$.default.platform()==="win32")try{return this.certificate?LR.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,l$.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{request:t});return mr(c)}catch(t){return ff(t)}}};var k2e=_R("xml_validator"),f$=k2e;var Ere=lr(require("crypto"),1),PDe=lr(_Z(),1);var LZ="application/xml";var ar;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ar||(ar={}));function V2e(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(V2e,"SelectNodesEx");function j2e(r,e){let t=_y("xpath").select;return t(e,r)}o(j2e,"SelectNodesNode");var FZ=typeof self<"u"?V2e:j2e;function ou(r){r=r.replace(/\r\n/g,`
|
|
119
119
|
`).replace(/\r/g,`
|
|
120
120
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=_y("DOMParser"),new e().parseFromString(r,LZ)}o(ou,"Parse");function fl(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=_y("XMLSerializer"),new e().serializeToString(r)}o(fl,"Stringify");function ZR(r,e){let t=FZ(r,e);return t&&t.length>0?t[0]:null}o(ZR,"SelectSingleNode");function kZ(r,e){return r&&r.nodeType===e}o(kZ,"isNodeType");function Co(r){return kZ(r,ar.Element)}o(Co,"isElement");function Zm(r){return kZ(r,ar.Document)}o(Zm,"isDocument");var VZ=new Map;function jZ(r){for(let e in r)VZ.set(e,r[e])}o(jZ,"setNodeDependencies");function _y(r){let e=VZ.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(_y,"getNodeDependency");var nE="element",iE="attribute",eD="content";var U2e=1e9;function o8(r,...e){let t=r;for(let n=0;n<e.length;n++){let i=e[n];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}o(o8,"assign");function or(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=o8({},t.items)),t.target=e}}o(or,"XmlElement");function vr(r={}){return(e,t)=>{let n=e.constructor,i=t;n.items||(n.items={}),n.target!==n&&(n.items=o8({},n.items)),n.target=e;let s;r.parser?s={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||U2e,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:s={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||i;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[i]={...s,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:nE},MZ(e,i,r)}}o(vr,"XmlChildElement");function Cn(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,i=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=o8({},n.items)),n.target=e;let s=n.items;s[t]=r,s[t].type=iE,MZ(e,i,r)}}o(Cn,"XmlAttribute");function MZ(r,e,t){let n=`_${e}`,i={set:o(function(s){this[n]!==s&&(this.element=null,this[n]=s)},"set"),get:o(function(){if(this[n]===void 0){let s=t.defaultValue;t.parser&&(s=new t.parser,s.localName=t.localName),this[n]=s}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,i)}o(MZ,"defineProperty");var kh=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function M2e(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,i)=>{let s=parseInt(i,10)-1;return e[s]!==void 0?e[s]:""});return t=t.replace(/%%/g,"%"),t}o(M2e,"printf");function q2e(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(q2e,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=M2e(Ni[e],...t);this.message=`${this.prefix}${q2e(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Fe;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Fe||(Fe={}));var Ni={};Ni[Fe.NONE]="No description";Ni[Fe.NULL_REFERENCE]="Null reference";Ni[Fe.NULL_PARAM]="'%1' has empty '%2' object";Ni[Fe.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";Ni[Fe.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";Ni[Fe.METHOD_NOT_IMPLEMENTED]="Method is not implemented";Ni[Fe.METHOD_NOT_SUPPORTED]="Method is not supported";Ni[Fe.PARAM_REQUIRED]="Required parameter is missing '%1'";Ni[Fe.CONVERTER_UNSUPPORTED]="Converter is not supported";Ni[Fe.ELEMENT_MALFORMED]="Malformed element '%1'";Ni[Fe.ELEMENT_MISSING]="Element '%1' is missing in '%2'";Ni[Fe.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";Ni[Fe.CONTENT_MISSING]="Content is missing in '%1'";Ni[Fe.CRYPTOGRAPHIC]="Cryptographic error: %1";Ni[Fe.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";Ni[Fe.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";Ni[Fe.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";Ni[Fe.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";Ni[Fe.XML_EXCEPTION]="XML exception: %1";Ni[Fe.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var Zr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(Fe.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let i=0;i<e.length;i++){let s=e[i].toString(16);n.push(s.length===1?"0"+s:s)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let i=e.slice(n,n+2);t[n/2]=parseInt(i,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var uu={get:o(r=>{if(r)return Zr.ToBase64(r)},"get"),set:o(r=>Zr.FromBase64(r),"set")},sE={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var H2e="xml_root",Qa=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let i=e.getElementsByTagName(t);if(n&&i.length===0)throw new $e(Fe.ELEMENT_MISSING,t,e.localName);return i[0]||null}static GetAttribute(e,t,n,i=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(i)throw new $e(Fe.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Zm(e)&&(n=e.getElementById(t)),n==null&&(n=ZR(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=ZR(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=ZR(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=H2e,t=null,n=null){if(n&&!t)throw new $e(Fe.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let i="",s="",a="";n&&(i=n+":",s=":"+n),t&&(a=` xmlns${s}="${t}"`);let u=`${i}${e}`;return ou(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Zm(e)?e.documentElement:e;let i=[];for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];Co(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&i.push(a)}return i}static GetFirstChild(e,t,n){e=Zm(e)?e.documentElement:e;for(let i=0;i<e.childNodes.length;i++){let s=e.childNodes[i];if(Co(s)&&s.localName===t&&(s.namespaceURI===n||!n))return s}return null}static GetChild(e,t,n,i=!0){for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];if(Co(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(i)throw new $e(Fe.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],i=this[t];if(n.parser&&i&&i.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),i=this.CreateElement(),s=this.GetStatic(),a=this.localName||"";if(s.items)for(let u in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,u))continue;let c=t[u],l=s.items[u];switch(l.type){case eD:{let p=l,h=p.converter?p.converter.get(c):c;if(p.required&&h==null)throw new $e(Fe.CONTENT_MISSING,a);(p.defaultValue!==c||p.required)&&(i.textContent=h);break}case iE:{let p=l,h=p.converter?p.converter.get(c):c;if(p.required&&h==null)throw new $e(Fe.ATTRIBUTE_MISSING,p.localName,a);(p.defaultValue!==c||p.required)&&(p.namespaceURI?i.setAttributeNS(p.namespaceURI,p.localName||"",h):i.setAttribute(p.localName||"",h));break}case nE:{let p=l,h=null;if(p.parser){if(p.required&&!c||p.minOccurs&&!c.Count){let g=c?.localName||p.localName;throw new $e(Fe.ELEMENT_MISSING,g,a)}c&&(h=c.GetXml(c.element===void 0&&(p.required||c.Count)))}else{let g=p.converter?p.converter.get(c):c;if(p.required&&g===void 0)throw new $e(Fe.ELEMENT_MISSING,p.localName,a);if(c!==p.defaultValue||p.required)if(p.namespaceURI?h=n.createElementNS(p.namespaceURI,`${p.prefix?p.prefix+":":""}${p.localName}`):h=n.createElement(`${p.prefix?p.prefix+":":""}${p.localName}`),Array.isArray(g))for(let y of g){let v=y instanceof r?y.GetXml(!0):y;v!==null&&h&&h.appendChild(v)}else if(g instanceof r){let y=g.GetXml(!0);y&&h&&h.appendChild(y)}else h&&(h.textContent=g)}if(h)if(p.noRoot){let g=[];for(let b=0;b<h.childNodes.length;b++){let S=h.childNodes.item(b);Co(S)&&g.push(S)}let y=p.minOccurs||0,v=p.maxOccurs||1/0;if(g.length<y||g.length>v)throw new $e(Fe.COLLECTION_LIMIT,c.localName,s.localName);g.forEach(b=>i.appendChild(b.cloneNode(!0)))}else{if(h.childNodes.length<(p.minOccurs||0)||h.childNodes.length>(p.maxOccurs||1/0))throw new $e(Fe.COLLECTION_LIMIT,c.localName,s.localName);i.appendChild(h)}break}}}return this.OnGetXml(i),this.element=i,i}LoadXml(e){let t,n=this;if(typeof e=="string"?t=ou(e).documentElement:t=e,!t)throw new $e(Fe.PARAM_REQUIRED,"element");let i=this.GetStatic(),s=this.localName||"";if(!(t.localName===s&&t.namespaceURI==this.NamespaceURI))throw new $e(Fe.ELEMENT_MALFORMED,s);if(i.items)for(let a in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,a))continue;let u=i.items[a];switch(u.type){case eD:{let c=u;if(c.required&&!t.textContent)throw new $e(Fe.CONTENT_MISSING,s);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case iE:{let c=u,l,p;if(!c.localName)throw new $e(Fe.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),p=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),p=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(Fe.ATTRIBUTE_MISSING,c.localName,s);if(!l())n[a]=c.defaultValue;else{let h=p(),g=c.converter&&h?c.converter.set(h):h;n[a]=g}break}case nE:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(Fe.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let p=new c.parser;if(!(p instanceof Ly))throw new $e(Fe.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);p.OnLoadXml(t),delete p.element;let h=c.minOccurs||0,g=c.maxOccurs||1/0;if(p.Count<h||p.Count>g)throw new $e(Fe.COLLECTION_LIMIT,c.parser.localName,s);n[a]=p;continue}let l=null;for(let p=0;p<t.childNodes.length;p++){let h=t.childNodes.item(p);if(!Co(h))continue;let g=h;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(Fe.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,s);if(c.parser){if(l){let p=new c.parser;p.localName=c.localName,p.namespaceURI=c.namespaceURI,n[a]=p,p.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let p=l.textContent||"",h=c.converter?c.converter.set(p):p;n[a]=h}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?fl(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,i=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(Fe.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,i=i||this.prefix;let s=(i?`${i}:`:"")+t,a=n&&e?e.createElementNS(n,s):e?.createElement(s);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Ly=class extends Qa{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new kh(this.GetIterator().map(e))}Filter(e){return new kh(this.GetIterator().filter(e))}Sort(e){return new kh(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(Fe.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let i=e.childNodes.item(n);if(!(Co(i)&&i.localName===t.parser.localName&&i.namespaceURI==t.namespaceURI))continue;let s=i,a=new t.parser;a.LoadXml(s),this.Add(a)}}};var Fy=class extends kh{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.prefix===e)return s}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.namespace===e)return s}return null}};var z2e="[object ArrayBuffer]",At=class l8{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===z2e}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=l8.toUint8Array(e),i=l8.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let i=new Uint8Array(n),s=0;for(let a of t){let u=this.toUint8Array(a);i.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},c8="string",K2e=/^[0-9a-f\s]+$/i,G2e=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,X2e=/^[a-zA-Z0-9-_]+$/,qZ=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=At.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},pl=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=At.toArrayBuffer(e),i=new DataView(n),s="";for(let a=0;a<n.byteLength;a+=2){let u=i.getUint16(a,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),t);return n}},kt=class ky{static{o(this,"Convert")}static isHex(e){return typeof e===c8&&K2e.test(e)}static isBase64(e){return typeof e===c8&&G2e.test(e)}static isBase64Url(e){return typeof e===c8&&X2e.test(e)}static ToString(e,t="utf8"){let n=At.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return pl.toString(n,!0);case"utf16":case"utf16be":return pl.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return pl.fromString(e,!0);case"utf16":case"utf16be":return pl.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=At.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ky.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ky.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=ky.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return qZ.fromString(e);case"utf16":case"utf16be":return pl.fromString(e);case"utf16le":case"usc2":return pl.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=ky.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return qZ.toString(e);case"utf16":case"utf16be":return pl.toString(e);case"utf16le":case"usc2":return pl.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=At.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=At.toUint8Array(e),n="",i=t.length;for(let s=0;s<i;s++){let a=t[s];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!ky.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let s=t.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return pl.toString(e,t)}static FromUtf16String(e,t=!1){return pl.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};kt.DEFAULT_UTF8_ENCODING="utf8";function _(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(_,"getParametersValue");function tD(r,e=0,t=r.byteLength-e,n=!1){let i="";for(let s of new Uint8Array(r,e,t)){let a=s.toString(16).toUpperCase();a.length===1&&(i+="0"),i+=a,n&&(i+=" ")}return i.trim()}o(tD,"bufferToHexCodes");function Af(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(Af,"utilFromBase");function Wu(r,e,t=-1){let n=t,i=r,s=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),s=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let l=new Uint8Array(c);for(let p=u-1;p>=0;p--){let h=Math.pow(2,p*e);l[s-p-1]=Math.floor(i/h),i-=l[s-p-1]*h}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Wu,"utilToBase");function e0(...r){let e=0,t=0;for(let s of r)e+=s.byteLength;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(new Uint8Array(s),t),t+=s.byteLength;return n}o(e0,"utilConcatBuf");function rD(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(s,t),t+=s.length;return i}o(rD,"utilConcatView");function f8(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=Af(t,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,Af(s,8)-n}o(f8,"utilDecodeTC");function zZ(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Wu(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let i=Wu(e,8,n),s=new Uint8Array(i);if(s[0]&128){let a=i.slice(0),u=new Uint8Array(a);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<a.byteLength;c++)s[c+1]=u[c];s[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(zZ,"utilEncodeTC");function Vh(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}o(Vh,"isEqualBuffer");function $a(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let a=0;a<n;a++)i[a]="0";return i.join("").concat(t)}o($a,"padNumber");var KZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",GZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function nD(r,e=!1,t=!1,n=!1){let i=0,s=0,a=0,u="",c=e?GZ:KZ;if(n){let l=0;for(let p=0;p<r.length;p++)if(r.charCodeAt(p)!==0){l=p;break}r=r.slice(l)}for(;i<r.length;){let l=r.charCodeAt(i++);i>=r.length&&(s=1);let p=r.charCodeAt(i++);i>=r.length&&(a=1);let h=r.charCodeAt(i++),g=l>>2,y=(l&3)<<4|p>>4,v=(p&15)<<2|h>>6,b=h&63;s===1?v=b=64:a===1&&(b=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(y)}`:b===64?u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(b)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(b)}`}return u}o(nD,"toBase64");function Vy(r,e=!1,t=!1){let n=e?GZ:KZ;function i(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(i,"indexOf");function s(c){return c===64?0:c}o(s,"test");let a=0,u="";for(;a<r.length;){let c=i(r.charAt(a++)),l=a>=r.length?0:i(r.charAt(a++)),p=a>=r.length?0:i(r.charAt(a++)),h=a>=r.length?0:i(r.charAt(a++)),g=s(c)<<2|s(l)>>4,y=(s(l)&15)<<4|s(p)>>2,v=(s(p)&3)<<6|s(h);u+=String.fromCharCode(g),p!==64&&(u+=String.fromCharCode(y)),h!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,l=-1;for(let p=c-1;p>=0;p--)if(u.charCodeAt(p)!==0){l=p;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(Vy,"fromBase64");function aE(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(aE,"arrayBufferToString");function t0(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let i=0;i<e;i++)n[i]=r.charCodeAt(i);return t}o(t0,"stringToArrayBuffer");var W2e=Math.log(2);function XZ(r){let e=Math.log(r)/W2e,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(XZ,"nearestPowerOf2");function Me(r,e){for(let t of e)delete r[t]}o(Me,"clearProps");function iD(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(iD,"assertBigInt");function m8(r){let e=0,t=0;for(let i=0;i<r.length;i++){let s=r[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let s=r[i];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}o(m8,"concat");function Nf(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(Nf,"checkBufferParams");var g8=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return m8(this.items)}},oE=[new Uint8Array([1])],JZ="0123456789",p8="name",YZ="valueHexView",J2e="isHexOnly",Y2e="idBlock",Q2e="tagClass",$2e="tagNumber",Z2e="isConstructed",eIe="fromBER",tIe="toBER",rIe="local",Za="",Ju=new ArrayBuffer(0),sD=new Uint8Array(0),cE="EndOfContent",$Z="OCTET STRING",ZZ="BIT STRING";function If(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var i;super(...n);let s=n[0]||{};this.isHexOnly=(i=s.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=s.valueHex?At.toUint8Array(s.valueHex):sD}fromBER(n,i,s){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!Nf(this,a,i,s))return-1;let u=i+s;return this.valueHexView=a.subarray(i,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Ju)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:kt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(If,"HexBlock");var r0=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Za,warnings:n=[],valueBeforeDecode:i=sD}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=At.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:kt.ToHex(this.valueBeforeDecodeView)}}};r0.NAME="baseBlock";var eo=class extends r0{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};eo.NAME="valueBlock";var eee=class extends If(r0){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,i,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?At.toUint8Array(e.valueHex):sD,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Ju}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=Wu(this.tagNumber,7),s=new Uint8Array(i),a=i.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=s[c]|128;u[a]=s[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=At.toUint8Array(e);if(!Nf(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),p=255;for(;s[c]&128;){if(l[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===p){p+=255;let g=new Uint8Array(p);for(let y=0;y<l.length;y++)g[y]=l[y];l=this.valueHexView=new Uint8Array(p)}}this.blockLength=c+1,l[c-1]=s[c]&127;let h=new Uint8Array(c);for(let g=0;g<c;g++)h[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(h),this.blockLength<=9?this.tagNumber=Af(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};eee.NAME="identificationBlock";var tee=class extends r0{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=At.toUint8Array(e);if(!Nf(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=i.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Af(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=Wu(this.length,8);if(i.byteLength>127)return this.error="Too big length",Ju;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let s=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let a=0;a<i.byteLength;a++)n[a+1]=s[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};tee.NAME="lengthBlock";var St={},Aa=class extends r0{static{o(this,"BaseBlock")}constructor({name:e=Za,optional:t=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new eee(i),this.lenBlock=new tee(i),this.valueBlock=s?new s(i):new eo(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new g8;t||ree(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(s)}return t?Ju:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():kt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=kt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Vh(t,n)}};Aa.NAME="BaseBlock";function ree(r){var e;if(r instanceof St.Constructed)for(let t of r.valueBlock.value)ree(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(ree,"prepareIndefiniteForm");var nee=class extends Aa{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Za,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};nee.NAME="BaseStringBlock";var iee=class extends If(eo){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};iee.NAME="PrimitiveValueBlock";var see,Tt=class extends Aa{static{o(this,"Primitive")}constructor(e={}){super(e,iee),this.idBlock.isConstructed=!1}};see=Tt;St.Primitive=see;Tt.NAME="PRIMITIVE";function nIe(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(nIe,"localChangeType");function lE(r,e=0,t=r.length){let n=e,i=new Aa({},eo),s=new r0;if(!Nf(s,r,e,t))return i.error=s.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let u=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),u===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=u,t-=i.idBlock.blockLength,u=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),u===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=u,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let c=Aa;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};c=St.EndOfContent;break;case 1:c=St.Boolean;break;case 2:c=St.Integer;break;case 3:c=St.BitString;break;case 4:c=St.OctetString;break;case 5:c=St.Null;break;case 6:c=St.ObjectIdentifier;break;case 10:c=St.Enumerated;break;case 12:c=St.Utf8String;break;case 13:c=St.RelativeObjectIdentifier;break;case 14:c=St.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=St.Sequence;break;case 17:c=St.Set;break;case 18:c=St.NumericString;break;case 19:c=St.PrintableString;break;case 20:c=St.TeletexString;break;case 21:c=St.VideotexString;break;case 22:c=St.IA5String;break;case 23:c=St.UTCTime;break;case 24:c=St.GeneralizedTime;break;case 25:c=St.GraphicString;break;case 26:c=St.VisibleString;break;case 27:c=St.GeneralString;break;case 28:c=St.UniversalString;break;case 29:c=St.CharacterString;break;case 30:c=St.BmpString;break;case 31:c=St.DATE;break;case 32:c=St.TimeOfDay;break;case 33:c=St.DateTime;break;case 34:c=St.Duration;break;default:{let l=i.idBlock.isConstructed?new St.Constructed:new St.Primitive;l.idBlock=i.idBlock,l.lenBlock=i.lenBlock,l.warnings=i.warnings,i=l}}break;case 2:case 3:case 4:default:c=i.idBlock.isConstructed?St.Constructed:St.Primitive}return i=nIe(i,c),u=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:u,result:i}}o(lE,"localFromBER");function ni(r){if(!r.byteLength){let e=new Aa({},eo);return e.error="Input buffer has zero length",{offset:-1,result:e}}return lE(At.toUint8Array(r).slice(),0,r.byteLength)}o(ni,"fromBER");function iIe(r,e){return r?1:e}o(iIe,"checkLen");var jh=class extends eo{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=At.toUint8Array(e);if(!Nf(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;iIe(this.isIndefiniteForm,n)>0;){let a=lE(i,s,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===cE)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===cE?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new g8;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?Ju:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};jh.NAME="ConstructedValueBlock";var aee,de=class extends Aa{static{o(this,"Constructed")}constructor(e={}){super(e,jh),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
121
121
|
`).map(i=>` ${i}`).join(`
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-23RWB4QQ.mjs";import{a as po,b as to,c as xo,d as ao,e as bo,f as co,g as go,h as ho,i as io,j as jo,k as ko,l as lo,m as no,n as qo,o as so,p as uo,q as vo,r as wo,s as yo,t as zo,u as Ao,v as Bo,w as Co,x as Do,y as Eo}from"./chunk-
|
|
2
|
+
import"./chunk-23RWB4QQ.mjs";import{a as po,b as to,c as xo,d as ao,e as bo,f as co,g as go,h as ho,i as io,j as jo,k as ko,l as lo,m as no,n as qo,o as so,p as uo,q as vo,r as wo,s as yo,t as zo,u as Ao,v as Bo,w as Co,x as Do,y as Eo}from"./chunk-K6AWXRHY.mjs";import{$ as T,A as v,C as w,D as y,G as z,H as A,I as B,J as C,K as D,M as E,N as F,O as G,P as H,Q as I,R as J,S as K,T as L,U as M,V as N,W as O,X as P,Y as Q,Z as R,_ as S,a as o,aa as U,b as r,ba as V,c as e,ca as W,d as f,da as X,e as m,ea as Y,f as p,fa as Z,g as t,ga as _,h as x,ha as $,ia as oo,j as a,ja as ro,k as b,ka as eo,la as fo,m as c,ma as mo,p as d,q as g,r as h,s as i,t as j,u as k,v as l,w as n,x as q,y as s,z as u}from"./chunk-YQCBUAAQ.mjs";import"./chunk-W6MRGYXP.mjs";export{mo as ASN1,ao as AccessKeyBuilder,r as CanonicalizationMethod,C as Choice,Do as DanfceDefaultPdfDocument,Eo as DanfceReducedPdfDocument,u as Decimal,bo as DefaultDetBuilderAggregator,co as DefaultTotalBuilderAggregator,m as DigestAlgorithm,d as EntitySigner,x as Environment,B as IsDecimal,v as MemoryCacheAdapter,Ao as NFCeDto,vo as NFeDto,a as NFeTsError,y as NativeCertificateRepository,ko as NfceAuthorizerPipeline,no as NfceConsultStatusPipeline,jo as NfceQrcode,io as NfceRemoteTransmitter,Bo as NfceXmlBuilder,Co as NfceXmlBuilderPipeline,qo as NfeAuthorizationResponsePipeline,ho as NfeAuthorizerPipeline,lo as NfeConsultStatusPipeline,wo as NfeDetXmlBuilder,so as NfeNfceCancelPipeline,uo as NfeNfceVoidRangePipeline,go as NfeRemoteTransmitter,yo as NfeXmlBuilder,zo as NfeXmlBuilderPipeline,w as NullCacheAdapter,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,c as Signer,j as SkipAllValidations,i as SkipValidation,h as SkipValidationMetadata,z as SoapRemoteTransmissionRepository,t as StateAcronyms,F as StateCodeAcValidator,G as StateCodeAlValidator,H as StateCodeAmValidator,I as StateCodeApValidator,J as StateCodeBaValidator,K as StateCodeCeValidator,L as StateCodeDfValidator,M as StateCodeEsValidator,N as StateCodeGoValidator,O as StateCodeMaValidator,P as StateCodeMgValidator,Q as StateCodeMsValidator,R as StateCodeMtValidator,S as StateCodePaValidator,T as StateCodePbValidator,U as StateCodePeValidator,V as StateCodePiValidator,W as StateCodePrValidator,X as StateCodeRjValidator,Y as StateCodeRnValidator,Z as StateCodeRoValidator,_ as StateCodeRrValidator,$ as StateCodeRsValidator,oo as StateCodeScValidator,ro as StateCodeSeValidator,eo as StateCodeSpValidator,fo as StateCodeToValidator,p as StateCodes,po as TpEmis,to as TpEvent,E as TransformDateString,D as TransformDecimal,n as ValidateErrorsMetadata,s as Validates,b as ValidationError,A as Xml2JsToolkit,g as XmlSigner,k as clearEmptyValues,q as mapConstraintsToErrors,l as plainToInstance,xo as schemas};
|
package/dist/nfe/index.cjs
CHANGED
|
@@ -116,7 +116,7 @@ Minimum version required to store current data is: `+s+`.
|
|
|
116
116
|
`+a.map(_Q).join(`
|
|
117
117
|
`):" "+_Q(a[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return i}o(s2e,"getAdapter");var AR={getAdapter:s2e,adapters:qk};function Hk(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new xo(null,r)}o(Hk,"throwIfCancellationRequested");function NR(r){return Hk(r),r.headers=ri.from(r.headers),r.data=Mw.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),AR.getAdapter(r.adapter||Oy.adapter,r)(r).then(o(function(n){return Hk(r),n.data=Mw.call(r,r.transformResponse,n),n.headers=ri.from(n.headers),n},"onAdapterResolution"),o(function(n){return qw(n)||(Hk(r),n&&n.response&&(n.response.data=Mw.call(r,r.transformResponse,n.response),n.response.headers=ri.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(NR,"dispatchRequest");var IR={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{IR[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var LQ={};IR.transitional=o(function(e,t,n){function i(s,a){return"[Axios v"+Wm+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return o(i,"formatMessage"),(s,a,u)=>{if(e===!1)throw new at(i(a," has been removed"+(t?" in "+t:"")),at.ERR_DEPRECATED);return t&&!LQ[a]&&(LQ[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,u):!0}},"transitional");IR.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function a2e(r,e,t){if(typeof r!="object")throw new at("options must be an object",at.ERR_BAD_OPTION_VALUE);let n=Object.keys(r),i=n.length;for(;i-- >0;){let s=n[i],a=e[s];if(a){let u=r[s],c=u===void 0||a(u,s,r);if(c!==!0)throw new at("option "+s+" must be "+c,at.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new at("Unknown option "+s,at.ERR_BAD_OPTION)}}o(a2e,"assertOptions");var Kw={assertOptions:a2e,validators:IR};var cl=Kw.validators,TR=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new Ck,response:new Ck}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;let s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
118
118
|
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Gu(this.defaults,t);let{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&Kw.assertOptions(n,{silentJSONParsing:cl.transitional(cl.boolean),forcedJSONParsing:cl.transitional(cl.boolean),clarifyTimeoutError:cl.transitional(cl.boolean)},!1),i!=null&&(ae.isFunction(i)?t.paramsSerializer={serialize:i}:Kw.assertOptions(i,{encode:cl.function,serialize:cl.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Kw.assertOptions(t,{baseUrl:cl.spelling("baseURL"),withXsrfToken:cl.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&ae.merge(s.common,s[t.method]);s&&ae.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),t.headers=ri.concat(a,s);let u=[],c=!0;this.interceptors.request.forEach(o(function(x){typeof x.runWhen=="function"&&x.runWhen(t)===!1||(c=c&&x.synchronous,u.unshift(x.fulfilled,x.rejected))},"unshiftRequestInterceptors"));let l=[];this.interceptors.response.forEach(o(function(x){l.push(x.fulfilled,x.rejected)},"pushResponseInterceptors"));let p,d=0,g;if(!c){let v=[NR.bind(this),void 0];for(v.unshift(...u),v.push(...l),g=v.length,p=Promise.resolve(t);d<g;)p=p.then(v[d++],v[d++]);return p}g=u.length;let y=t;for(;d<g;){let v=u[d++],x=u[d++];try{y=v(y)}catch(S){x.call(this,S);break}}try{p=NR.call(this,y)}catch(v){return Promise.reject(v)}for(d=0,g=l.length;d<g;)p=p.then(l[d++],l[d++]);return p}getUri(e){e=Gu(this.defaults,e);let t=Xm(e.baseURL,e.url,e.allowAbsoluteUrls);return Gm(t,e.params,e.paramsSerializer)}};ae.forEach(["delete","get","head","options"],o(function(e){TR.prototype[e]=function(t,n){return this.request(Gu(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));ae.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(s,a,u){return this.request(Gu(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),TR.prototype[e]=t(),TR.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var Gw=TR;var o2e=class FQ{static{o(this,"CancelToken")}constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(o(function(s){t=s},"promiseExecutor"));let n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s,a=new Promise(u=>{n.subscribe(u),s=u}).then(i);return a.cancel=o(function(){n.unsubscribe(s)},"reject"),a},e(o(function(s,a,u){n.reason||(n.reason=new xo(s,a,u),t(n.reason))},"cancel"))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=o(n=>{e.abort(n)},"abort");return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new FQ(o(function(i){e=i},"executor")),cancel:e}}},kQ=o2e;function zk(r){return o(function(t){return r.apply(null,t)},"wrap")}o(zk,"spread");function Kk(r){return ae.isObject(r)&&r.isAxiosError===!0}o(Kk,"isAxiosError");var Gk={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Gk).forEach(([r,e])=>{Gk[e]=r});var VQ=Gk;function jQ(r){let e=new Gw(r),t=Fw(Gw.prototype.request,e);return ae.extend(t,Gw.prototype,e,{allOwnKeys:!0}),ae.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(i){return jQ(Gu(r,i))},"create"),t}o(jQ,"createInstance");var Bi=jQ(Oy);Bi.Axios=Gw;Bi.CanceledError=xo;Bi.CancelToken=kQ;Bi.isCancel=qw;Bi.VERSION=Wm;Bi.toFormData=_h;Bi.AxiosError=at;Bi.Cancel=Bi.CanceledError;Bi.all=o(function(e){return Promise.all(e)},"all");Bi.spread=zk;Bi.isAxiosError=Kk;Bi.mergeConfig=Gu;Bi.AxiosHeaders=ri;Bi.formToJSON=r=>SR(ae.isHTMLForm(r)?new FormData(r):r);Bi.getAdapter=AR.getAdapter;Bi.HttpStatusCode=VQ;Bi.default=Bi;var _y=Bi;var{Axios:Iqe,AxiosError:Tqe,CanceledError:Rqe,isCancel:Dqe,CancelToken:Oqe,VERSION:Pqe,all:Bqe,Cancel:_qe,isAxiosError:Lqe,spread:Fqe,toFormData:kqe,AxiosHeaders:Vqe,HttpStatusCode:jqe,formToJSON:Uqe,getAdapter:Mqe,mergeConfig:qqe}=_y;var UQ=lr(require("os"),1);var RR=require("os"),au=require("path"),Ww=require("fs");var Xw=o(r=>L6()(r),"exportRequireModule"),DR=o(r=>{r=`${r}.node`;let e=`${(0,RR.platform)()}-${(0,RR.arch)()}`;if(process.env.NFETS_ADDONS_DIR)return Xw((0,au.join)(process.env.NFETS_ADDONS_DIR,r));let t=q2(),n=(0,au.resolve)(t,"../../../../"),i=(0,au.join)(n,"build","addons",e,r);if((0,Ww.existsSync)(i))return Xw(i);let s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"build","addons",e,r);if((0,Ww.existsSync)(u))return Xw(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"node_modules","nfets","build","addons",e,r);if((0,Ww.existsSync)(u))return Xw(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}s=t;for(let a=0;a<5;a++){let u=(0,au.join)(s,"build","Release",r);if((0,Ww.existsSync)(u))return Xw(u);let c=(0,au.dirname)(s);if(c===s)break;s=c}throw new Error(`Addon ${e}/${r} not found`)},"addon");var OR=class r{static{o(this,"WinHttpClient")}certificate;interceptors={request:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")},response:{use:o(()=>0,"use"),eject:o(()=>{},"eject"),clear:o(()=>{},"clear")}};defaults={headers:{}};constructor(e){this.certificate=e}parseRequestHeaders(e){return e?Object.entries(e).filter(([t,n])=>n!=null).map(([t,n])=>`${t}: ${Array.isArray(n)?n.join(", "):String(n)}`).join(UQ.default.EOL):""}parseRequestBody(e){return e?Buffer.isBuffer(e)?e:typeof e=="string"?Buffer.from(e,"utf8"):Array.isArray(e)?Buffer.concat(e):Buffer.from(JSON.stringify(e),"utf8"):Buffer.from("")}parseResponseHeaders(e){return e?e.split(`\r
|
|
119
|
-
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[i,s]=n.split(":").map(a=>a.trim());return t[i]=s,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),i=DR("winhttp_ssl_client"),{CN:s}=new Kv().extractCertificateInfo(this.certificate.certificate),a=await i.request(s??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var BR=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:qQ.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PR.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return s?new PR.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e}):new PR.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=_y.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(MQ.default.platform()==="win32")try{return this.certificate?OR.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,HQ.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t}});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{request:t});return gr(c)}catch(t){return pf(t)}}};var u2e=DR("xml_validator"),zQ=u2e;var nre=lr(require("crypto"),1),nDe=lr(hZ(),1);var dZ="application/xml";var ar;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ar||(ar={}));function c2e(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(c2e,"SelectNodesEx");function l2e(r,e){let t=Ly("xpath").select;return t(e,r)}o(l2e,"SelectNodesNode");var mZ=typeof self<"u"?c2e:l2e;function ou(r){r=r.replace(/\r\n/g,`
|
|
119
|
+
`).reduce((t,n)=>{if(!n.trim()||n.startsWith("HTTP/"))return t;let[i,s]=n.split(":").map(a=>a.trim());return t[i]=s,t},{}):{}}parseResponseBody(e){return e?Buffer.isBuffer(e)?e.toString("utf8"):e:""}async request(e){let t=e.url??"",n=(e.method??"GET").toUpperCase(),i=DR("winhttp_ssl_client"),{CN:s}=new Kv().extractCertificateInfo(this.certificate.certificate),a=await i.request(s??"",n,t,{headers:this.parseRequestHeaders(e.headers),body:this.parseRequestBody(e.data),timeout:e.timeout});return{status:a.statusCode,data:this.parseResponseBody(a.body),statusText:this.getStatusText(a.statusCode),headers:this.parseResponseHeaders(a.headers),config:e,request:{}}}get(e,t){return this.request({...t,method:"GET",url:e})}post(e,t,n){return this.request({...n,method:"POST",url:e,data:t})}put(e,t,n){return this.request({...n,method:"PUT",url:e,data:t})}patch(e,t,n){return this.request({...n,method:"PATCH",url:e,data:t})}delete(e,t){return this.request({...t,method:"DELETE",url:e})}head(e,t){return this.request({...t,method:"HEAD",url:e})}options(e,t){return this.request({...t,method:"OPTIONS",url:e})}getUri(e){if(!e?.url)return"";try{return new URL(e.url).toString()}catch{return e.url}}static create(e){let t=new r(e),n=t.request.bind(t);return Object.setPrototypeOf(n,r.prototype),Object.assign(n,t),n}getStatusText(e){return{200:"OK",201:"Created",202:"Accepted",204:"No Content",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"}[e]??"Unknown"}};var BR=class{static{o(this,"SoapRemoteTransmissionRepository")}toolkit;certificateRepository;constructor(e,t){this.toolkit=e,this.certificateRepository=t}setCertificate(e){return this.certificate=e,this}get httpsAgent(){let e={rejectUnauthorized:!1,secureOptions:qQ.constants.SSL_OP_LEGACY_SERVER_CONNECT};if(!this.certificate)return new PR.Agent({...e});let{ca:t,password:n,certificate:i,privateKey:s}=this.certificate;return s?new PR.Agent({passphrase:n,cert:i.toString(),ca:t.map(a=>a.toString()),key:this.certificateRepository.getStringPrivateKey(s),...e}):new PR.Agent({...e})}get defaultSoapHeaders(){return{"Content-Type":"application/soap+xml; charset=utf-8"}}getDefaultRequest(){let e=_y.create();return e.defaults.httpsAgent=this.httpsAgent,e}get request(){if(MQ.default.platform()==="win32")try{return this.certificate?OR.create(this.certificate):this.getDefaultRequest()}catch{return this.getDefaultRequest()}return this.getDefaultRequest()}async send(e){try{let t=this.request,n=await(0,HQ.createClientAsync)(`${e.url}?wsdl`,{request:t,attributesKey:"$",wsdl_options:{request:t},forceSoap12Headers:!0});e.payload.$={xmlns:n.wsdl.definitions.$targetNamespace,...e.payload.$};let i=await this.toolkit.build(e.payload,{headless:!0,renderOpts:{pretty:!1},rootName:e.root}),s=this.toolkit.getFirstNode(i)??"",a=e.xsd,u=await this.toolkit.validate(s,a);if(u.isLeft())return u;let[c]=await n[`${e.method}Async`]({_xml:i},{request:t});return gr(c)}catch(t){return pf(t)}}};var u2e=DR("xml_validator"),zQ=u2e;var nre=lr(require("crypto"),1),nDe=lr(hZ(),1);var dZ="application/xml";var ar;(function(r){r[r.None=0]="None",r[r.Element=1]="Element",r[r.Attribute=2]="Attribute",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.EntityReference=5]="EntityReference",r[r.Entity=6]="Entity",r[r.ProcessingInstruction=7]="ProcessingInstruction",r[r.Comment=8]="Comment",r[r.Document=9]="Document",r[r.DocumentType=10]="DocumentType",r[r.DocumentFragment=11]="DocumentFragment",r[r.Notation=12]="Notation",r[r.Whitespace=13]="Whitespace",r[r.SignificantWhitespace=14]="SignificantWhitespace",r[r.EndElement=15]="EndElement",r[r.EndEntity=16]="EndEntity",r[r.XmlDeclaration=17]="XmlDeclaration"})(ar||(ar={}));function c2e(r,e){let t=r.ownerDocument==null?r:r.ownerDocument,n=document.createNSResolver(r.ownerDocument==null?r.documentElement:r.ownerDocument.documentElement),i=t.evaluate(e,r,n,XPathResult.ANY_TYPE,null),s=[],a;for(;a=i.iterateNext();)s.push(a);return s}o(c2e,"SelectNodesEx");function l2e(r,e){let t=Ly("xpath").select;return t(e,r)}o(l2e,"SelectNodesNode");var mZ=typeof self<"u"?c2e:l2e;function ou(r){r=r.replace(/\r\n/g,`
|
|
120
120
|
`).replace(/\r/g,`
|
|
121
121
|
`);let e;return typeof DOMParser<"u"?e=DOMParser:e=Ly("DOMParser"),new e().parseFromString(r,dZ)}o(ou,"Parse");function fl(r){let e;return typeof XMLSerializer<"u"?e=XMLSerializer:e=Ly("XMLSerializer"),new e().serializeToString(r)}o(fl,"Stringify");function YR(r,e){let t=mZ(r,e);return t&&t.length>0?t[0]:null}o(YR,"SelectSingleNode");function gZ(r,e){return r&&r.nodeType===e}o(gZ,"isNodeType");function Eo(r){return gZ(r,ar.Element)}o(Eo,"isElement");function Qm(r){return gZ(r,ar.Document)}o(Qm,"isDocument");var vZ=new Map;function yZ(r){for(let e in r)vZ.set(e,r[e])}o(yZ,"setNodeDependencies");function Ly(r){let e=vZ.get(r);if(!e)throw new Error(`Node dependency not found: ${r}. Please use 'setNodeDependencies' to register it.`);return e}o(Ly,"getNodeDependency");var Qw="element",$w="attribute",QR="content";var f2e=1e9;function n8(r,...e){let t=r;for(let n=0;n<e.length;n++){let i=e[n];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t}o(n8,"assign");function or(r){return e=>{let t=e;t.localName=r.localName||t.name,t.namespaceURI=r.namespaceURI||t.namespaceURI||null,t.prefix=r.prefix||t.prefix||null,t.parser=r.parser||t.parser,t.target!==t&&(t.items=n8({},t.items)),t.target=e}}o(or,"XmlElement");function vr(r={}){return(e,t)=>{let n=e.constructor,i=t;n.items||(n.items={}),n.target!==n&&(n.items=n8({},n.items)),n.target=e;let s;r.parser?s={parser:r.parser,required:r.required||!1,maxOccurs:r.maxOccurs||f2e,minOccurs:r.minOccurs===void 0?0:r.minOccurs,noRoot:r.noRoot||!1}:s={namespaceURI:r.namespaceURI||null,required:r.required||!1,prefix:r.prefix||null,defaultValue:r.defaultValue,converter:r.converter,noRoot:r.noRoot||!1},r.localName=r.localName||r.parser&&r.parser.localName||i;let a=n.items,u=r.parser&&r.parser.namespaceURI;a[i]={...s,namespaceURI:r.namespaceURI||u||null,prefix:r.prefix||r.parser&&r.parser.prefix||null,localName:r.localName,type:Qw},bZ(e,i,r)}}o(vr,"XmlChildElement");function Cn(r={required:!1,namespaceURI:null}){return(e,t)=>{let n=e.constructor,i=t;r.localName||(r.localName=t),n.items||(n.items={}),n.target!==n&&(n.items=n8({},n.items)),n.target=e;let s=n.items;s[t]=r,s[t].type=$w,bZ(e,i,r)}}o(Cn,"XmlAttribute");function bZ(r,e,t){let n=`_${e}`,i={set:o(function(s){this[n]!==s&&(this.element=null,this[n]=s)},"set"),get:o(function(){if(this[n]===void 0){let s=t.defaultValue;t.parser&&(s=new t.parser,s.localName=t.localName),this[n]=s}return this[n]},"get")};Object.defineProperty(r,n,{writable:!0,enumerable:!1}),Object.defineProperty(r,e,i)}o(bZ,"defineProperty");var kh=class r{static{o(this,"Collection")}constructor(e){this.items=[],e&&(this.items=e)}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e)}Pop(){return this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e)}Clear(){this.items=[]}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new r(this.GetIterator().map(e))}Filter(e){return new r(this.GetIterator().filter(e))}Sort(e){return new r(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}};function p2e(r,...e){let t=r.replace(/%([1-9]\d*)/g,(n,i)=>{let s=parseInt(i,10)-1;return e[s]!==void 0?e[s]:""});return t=t.replace(/%%/g,"%"),t}o(p2e,"printf");function h2e(r,e){let t=r+"";for(;t.length<e;)t="0"+t;return t}o(h2e,"padNum");var $e=class{static{o(this,"XmlError")}constructor(e,...t){this.prefix="XMLJS",this.code=e,this.name=this.constructor.name;let n=p2e(Ai[e],...t);this.message=`${this.prefix}${h2e(e,4)}: ${n}`,this.stack=new Error(this.message).stack}},Fe;(function(r){r[r.NONE=0]="NONE",r[r.NULL_REFERENCE=1]="NULL_REFERENCE",r[r.NULL_PARAM=2]="NULL_PARAM",r[r.DECORATOR_NULL_PARAM=3]="DECORATOR_NULL_PARAM",r[r.COLLECTION_LIMIT=4]="COLLECTION_LIMIT",r[r.METHOD_NOT_IMPLEMENTED=5]="METHOD_NOT_IMPLEMENTED",r[r.METHOD_NOT_SUPPORTED=6]="METHOD_NOT_SUPPORTED",r[r.PARAM_REQUIRED=7]="PARAM_REQUIRED",r[r.CONVERTER_UNSUPPORTED=8]="CONVERTER_UNSUPPORTED",r[r.ELEMENT_MALFORMED=9]="ELEMENT_MALFORMED",r[r.ELEMENT_MISSING=10]="ELEMENT_MISSING",r[r.ATTRIBUTE_MISSING=11]="ATTRIBUTE_MISSING",r[r.CONTENT_MISSING=12]="CONTENT_MISSING",r[r.CRYPTOGRAPHIC=13]="CRYPTOGRAPHIC",r[r.CRYPTOGRAPHIC_NO_MODULE=14]="CRYPTOGRAPHIC_NO_MODULE",r[r.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM=15]="CRYPTOGRAPHIC_UNKNOWN_TRANSFORM",r[r.ALGORITHM_NOT_SUPPORTED=16]="ALGORITHM_NOT_SUPPORTED",r[r.ALGORITHM_WRONG_NAME=17]="ALGORITHM_WRONG_NAME",r[r.XML_EXCEPTION=18]="XML_EXCEPTION",r[r.KEY_INFO_CLAUSE_NOT_SUPPORTED=19]="KEY_INFO_CLAUSE_NOT_SUPPORTED"})(Fe||(Fe={}));var Ai={};Ai[Fe.NONE]="No description";Ai[Fe.NULL_REFERENCE]="Null reference";Ai[Fe.NULL_PARAM]="'%1' has empty '%2' object";Ai[Fe.DECORATOR_NULL_PARAM]="Decorator '%1' has empty '%2' parameter";Ai[Fe.COLLECTION_LIMIT]="Collection of '%1' in element '%2' has wrong amount of items";Ai[Fe.METHOD_NOT_IMPLEMENTED]="Method is not implemented";Ai[Fe.METHOD_NOT_SUPPORTED]="Method is not supported";Ai[Fe.PARAM_REQUIRED]="Required parameter is missing '%1'";Ai[Fe.CONVERTER_UNSUPPORTED]="Converter is not supported";Ai[Fe.ELEMENT_MALFORMED]="Malformed element '%1'";Ai[Fe.ELEMENT_MISSING]="Element '%1' is missing in '%2'";Ai[Fe.ATTRIBUTE_MISSING]="Attribute '%1' is missing in '%2'";Ai[Fe.CONTENT_MISSING]="Content is missing in '%1'";Ai[Fe.CRYPTOGRAPHIC]="Cryptographic error: %1";Ai[Fe.CRYPTOGRAPHIC_NO_MODULE]="WebCrypto module is not found";Ai[Fe.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM]="Unknown transform %1";Ai[Fe.ALGORITHM_NOT_SUPPORTED]="Algorithm is not supported '%1'";Ai[Fe.ALGORITHM_WRONG_NAME]="Algorithm wrong name in use '%1'";Ai[Fe.XML_EXCEPTION]="XML exception: %1";Ai[Fe.KEY_INFO_CLAUSE_NOT_SUPPORTED]="KeyInfoClause type '%1' is not supported";var Zr=class{static{o(this,"Convert")}static ToString(e,t="utf8"){let n=new Uint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);default:throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static FromString(e,t="utf8"){switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);default:throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static ToBase64(e){if(typeof btoa<"u"){let t=this.ToString(e,"binary");return btoa(t)}else{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");throw new $e(Fe.CONVERTER_UNSUPPORTED)}}static FromBase64(e){if(e=e.replace(/\n/g,"").replace(/\r/g,"").replace(/\t/g,"").replace(/\s/g,""),typeof atob<"u")return this.FromBinary(atob(e));if(typeof Buffer<"u")return new Uint8Array(Buffer.from(e,"base64"));throw new $e(Fe.CONVERTER_UNSUPPORTED)}static FromBase64Url(e){return this.FromBase64(this.Base64Padding(e.replace(/-/g,"+").replace(/_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static FromUtf8String(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}static ToUtf8String(e){let t=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(t))}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n}static ToBinary(e){let t="";for(let n=0;n<e.length;n++)t=t+String.fromCharCode(e[n]);return t}static ToHex(e){let n=[];for(let i=0;i<e.length;i++){let s=e[i].toString(16);n.push(s.length===1?"0"+s:s)}return n.join("")}static FromHex(e){let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n=n+2){let i=e.slice(n,n+2);t[n/2]=parseInt(i,16)}return t}static ToDateTime(e){return new Date(e)}static FromDateTime(e){return e.toISOString()}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}};var uu={get:o(r=>{if(r)return Zr.ToBase64(r)},"get"),set:o(r=>Zr.FromBase64(r),"set")},Zw={get:o(r=>r?r.toString():"0","get"),set:o(r=>Number(r),"set")};var d2e="xml_root",Qa=class r{static{o(this,"XmlObject")}static LoadXml(e){let t=new this;return t.LoadXml(e),t}static GetElement(e,t,n=!0){let i=e.getElementsByTagName(t);if(n&&i.length===0)throw new $e(Fe.ELEMENT_MISSING,t,e.localName);return i[0]||null}static GetAttribute(e,t,n,i=!0){if(e.hasAttribute(t))return e.getAttribute(t);if(i)throw new $e(Fe.ATTRIBUTE_MISSING,t,e.localName);return n}static GetElementById(e,t){if(e==null||t==null)return null;let n=null;return Qm(e)&&(n=e.getElementById(t)),n==null&&(n=YR(e,`//*[@*[local-name()='Id']='${t}']`),n==null&&(n=YR(e,`//*[@*[local-name()='ID']='${t}']`),n==null&&(n=YR(e,`//*[@*[local-name()='id']='${t}']`)))),n}static CreateDocument(e=d2e,t=null,n=null){if(n&&!t)throw new $e(Fe.PARAM_REQUIRED,"namespaceUri",`Prefix '${n}' requires namespaceUri`);let i="",s="",a="";n&&(i=n+":",s=":"+n),t&&(a=` xmlns${s}="${t}"`);let u=`${i}${e}`;return ou(`<${u}${a}></${u}>`)}static GetChildren(e,t,n){e=Qm(e)?e.documentElement:e;let i=[];for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];Eo(a)&&a.localName===t&&(a.namespaceURI===n||!n)&&i.push(a)}return i}static GetFirstChild(e,t,n){e=Qm(e)?e.documentElement:e;for(let i=0;i<e.childNodes.length;i++){let s=e.childNodes[i];if(Eo(s)&&s.localName===t&&(s.namespaceURI===n||!n))return s}return null}static GetChild(e,t,n,i=!0){for(let s=0;s<e.childNodes.length;s++){let a=e.childNodes[s];if(Eo(a)&&a.localName===t&&(a.namespaceURI===n||!n))return a}if(i)throw new $e(Fe.ELEMENT_MISSING,t,e.localName);return null}constructor(e={}){if(this.prefix=this.GetStatic().prefix||null,this.localName=this.GetStatic().localName,this.namespaceURI=this.GetStatic().namespaceURI,e)for(let[t,n]of Object.entries(e))n!==void 0&&(this[t]=n)}get Element(){return this.element}get Prefix(){return this.prefix}set Prefix(e){this.prefix=e}get LocalName(){return this.localName||""}get NamespaceURI(){return this.namespaceURI||null}HasChanged(){let e=this.GetStatic();if(e.items)for(let t in e.items){if(!Object.prototype.hasOwnProperty.call(e.items,t))continue;let n=e.items[t],i=this[t];if(n.parser&&i&&i.HasChanged())return!0}return this.element===null}GetXml(e){if(!(e||this.HasChanged()))return this.element||null;let t=this,n=this.CreateDocument(),i=this.CreateElement(),s=this.GetStatic(),a=this.localName||"";if(s.items)for(let u in s.items){if(!Object.prototype.hasOwnProperty.call(s.items,u))continue;let c=t[u],l=s.items[u];switch(l.type){case QR:{let p=l,d=p.converter?p.converter.get(c):c;if(p.required&&d==null)throw new $e(Fe.CONTENT_MISSING,a);(p.defaultValue!==c||p.required)&&(i.textContent=d);break}case $w:{let p=l,d=p.converter?p.converter.get(c):c;if(p.required&&d==null)throw new $e(Fe.ATTRIBUTE_MISSING,p.localName,a);(p.defaultValue!==c||p.required)&&(p.namespaceURI?i.setAttributeNS(p.namespaceURI,p.localName||"",d):i.setAttribute(p.localName||"",d));break}case Qw:{let p=l,d=null;if(p.parser){if(p.required&&!c||p.minOccurs&&!c.Count){let g=c?.localName||p.localName;throw new $e(Fe.ELEMENT_MISSING,g,a)}c&&(d=c.GetXml(c.element===void 0&&(p.required||c.Count)))}else{let g=p.converter?p.converter.get(c):c;if(p.required&&g===void 0)throw new $e(Fe.ELEMENT_MISSING,p.localName,a);if(c!==p.defaultValue||p.required)if(p.namespaceURI?d=n.createElementNS(p.namespaceURI,`${p.prefix?p.prefix+":":""}${p.localName}`):d=n.createElement(`${p.prefix?p.prefix+":":""}${p.localName}`),Array.isArray(g))for(let y of g){let v=y instanceof r?y.GetXml(!0):y;v!==null&&d&&d.appendChild(v)}else if(g instanceof r){let y=g.GetXml(!0);y&&d&&d.appendChild(y)}else d&&(d.textContent=g)}if(d)if(p.noRoot){let g=[];for(let x=0;x<d.childNodes.length;x++){let S=d.childNodes.item(x);Eo(S)&&g.push(S)}let y=p.minOccurs||0,v=p.maxOccurs||1/0;if(g.length<y||g.length>v)throw new $e(Fe.COLLECTION_LIMIT,c.localName,s.localName);g.forEach(x=>i.appendChild(x.cloneNode(!0)))}else{if(d.childNodes.length<(p.minOccurs||0)||d.childNodes.length>(p.maxOccurs||1/0))throw new $e(Fe.COLLECTION_LIMIT,c.localName,s.localName);i.appendChild(d)}break}}}return this.OnGetXml(i),this.element=i,i}LoadXml(e){let t,n=this;if(typeof e=="string"?t=ou(e).documentElement:t=e,!t)throw new $e(Fe.PARAM_REQUIRED,"element");let i=this.GetStatic(),s=this.localName||"";if(!(t.localName===s&&t.namespaceURI==this.NamespaceURI))throw new $e(Fe.ELEMENT_MALFORMED,s);if(i.items)for(let a in i.items){if(!Object.prototype.hasOwnProperty.call(i.items,a))continue;let u=i.items[a];switch(u.type){case QR:{let c=u;if(c.required&&!t.textContent)throw new $e(Fe.CONTENT_MISSING,s);if(!t.textContent)n[a]=c.defaultValue;else{let l=c.converter?c.converter.set(t.textContent):t.textContent;n[a]=l}break}case $w:{let c=u,l,p;if(!c.localName)throw new $e(Fe.PARAM_REQUIRED,"localName");if(c.namespaceURI?(l=t.hasAttributeNS.bind(t,c.namespaceURI,c.localName),p=t.getAttributeNS.bind(t,c.namespaceURI,c.localName)):(l=t.hasAttribute.bind(t,c.localName),p=t.getAttribute.bind(t,c.localName)),c.required&&!l())throw new $e(Fe.ATTRIBUTE_MISSING,c.localName,s);if(!l())n[a]=c.defaultValue;else{let d=p(),g=c.converter&&d?c.converter.set(d):d;n[a]=g}break}case Qw:{let c=u;if(c.noRoot){if(!c.parser)throw new $e(Fe.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser'`);let p=new c.parser;if(!(p instanceof Fy))throw new $e(Fe.XML_EXCEPTION,`Schema for '${c.localName}' with flag noRoot must have 'parser' like instance of XmlCollection`);p.OnLoadXml(t),delete p.element;let d=c.minOccurs||0,g=c.maxOccurs||1/0;if(p.Count<d||p.Count>g)throw new $e(Fe.COLLECTION_LIMIT,c.parser.localName,s);n[a]=p;continue}let l=null;for(let p=0;p<t.childNodes.length;p++){let d=t.childNodes.item(p);if(!Eo(d))continue;let g=d;if(g.localName===c.localName&&g.namespaceURI==c.namespaceURI){l=g;break}}if(c.required&&!l)throw new $e(Fe.ELEMENT_MISSING,c.parser?c.parser.localName:c.localName,s);if(c.parser){if(l){let p=new c.parser;p.localName=c.localName,p.namespaceURI=c.namespaceURI,n[a]=p,p.LoadXml(l)}}else if(!l)n[a]=c.defaultValue;else{let p=l.textContent||"",d=c.converter?c.converter.set(p):p;n[a]=d}break}}}this.OnLoadXml(t),this.prefix=t.prefix||"",this.element=t}toString(){let e=this.GetXml();return e?fl(e):""}GetElement(e,t=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetElement(this.element,e,t)}GetChildren(e,t){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetChildren(this.element,e,t||this.NamespaceURI||void 0)}GetChild(e,t=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetChild(this.element,e,this.NamespaceURI||void 0,t)}GetFirstChild(e,t){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetFirstChild(this.element,e,t)}GetAttribute(e,t,n=!0){if(!this.element)throw new $e(Fe.NULL_PARAM,this.localName);return r.GetAttribute(this.element,e,t,n)}IsEmpty(){return this.Element===void 0}OnLoadXml(e){}GetStatic(){return this.constructor}GetPrefix(){return this.Prefix?this.prefix+":":""}OnGetXml(e){}CreateElement(e,t,n=null,i=null){if(!e){let u=this.CreateDocument();if(u)e=u;else throw new $e(Fe.XML_EXCEPTION,"Document not created")}t=t||this.localName,n=n||this.NamespaceURI,i=i||this.prefix;let s=(i?`${i}:`:"")+t,a=n&&e?e.createElementNS(n,s):e?.createElement(s);return e&&a&&e.importNode(a,!0),a}CreateDocument(){return r.CreateDocument(this.localName,this.NamespaceURI,this.Prefix)}};var Fy=class extends Qa{static{o(this,"XmlCollection")}constructor(){super(...arguments),this.MaxOccurs=Number.MAX_VALUE,this.MinOccurs=0,this.items=[]}HasChanged(){let e=super.HasChanged(),t=this.Some(n=>n.HasChanged());return e||t}get Count(){return this.items.length}Item(e){return this.items[e]||null}Add(e){this.items.push(e),this.element=null}Pop(){return this.element=null,this.items.pop()}RemoveAt(e){this.items=this.items.filter((t,n)=>n!==e),this.element=null}Clear(){this.items=[],this.element=null}GetIterator(){return this.items}ForEach(e){this.GetIterator().forEach(e)}Map(e){return new kh(this.GetIterator().map(e))}Filter(e){return new kh(this.GetIterator().filter(e))}Sort(e){return new kh(this.GetIterator().sort(e))}Every(e){return this.GetIterator().every(e)}Some(e){return this.GetIterator().some(e)}IsEmpty(){return this.Count===0}OnGetXml(e){for(let t of this.GetIterator()){let n=t.GetXml();n&&e.appendChild(n)}}OnLoadXml(e){let t=this.GetStatic();if(!t.parser)throw new $e(Fe.XML_EXCEPTION,`${t.localName} doesn't have required 'parser' in @XmlElement`);for(let n=0;n<e.childNodes.length;n++){let i=e.childNodes.item(n);if(!(Eo(i)&&i.localName===t.parser.localName&&i.namespaceURI==t.namespaceURI))continue;let s=i,a=new t.parser;a.LoadXml(s),this.Add(a)}}};var ky=class extends kh{static{o(this,"NamespaceManager")}Add(e){e.prefix=e.prefix||"",e.namespace=e.namespace||"",super.Add(e)}GetPrefix(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.prefix===e)return s}return null}GetNamespace(e,t=this.Count-1){let n=this.Count-1;e=e||"",t>n&&(t=n);for(let i=t;i>=0;i--){let s=this.items[i];if(s.namespace===e)return s}return null}};var m2e="[object ArrayBuffer]",At=class a8{static{o(this,"BufferSourceConverter")}static isArrayBuffer(e){return Object.prototype.toString.call(e)===m2e}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,t){let n=a8.toUint8Array(e),i=a8.toUint8Array(t);if(n.length!==i.byteLength)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s])return!1;return!0}static concat(...e){let t;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?t=e[0]:e[e.length-1]instanceof Function?t=e.slice(0,e.length-1):t=e;let n=0;for(let a of t)n+=a.byteLength;let i=new Uint8Array(n),s=0;for(let a of t){let u=this.toUint8Array(a);i.set(u,s),s+=u.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}},s8="string",g2e=/^[0-9a-f\s]+$/i,v2e=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,y2e=/^[a-zA-Z0-9-_]+$/,xZ=class{static{o(this,"Utf8Converter")}static fromString(e){let t=unescape(encodeURIComponent(e)),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n.buffer}static toString(e){let t=At.toUint8Array(e),n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return decodeURIComponent(escape(n))}},pl=class{static{o(this,"Utf16Converter")}static toString(e,t=!1){let n=At.toArrayBuffer(e),i=new DataView(n),s="";for(let a=0;a<n.byteLength;a+=2){let u=i.getUint16(a,t);s+=String.fromCharCode(u)}return s}static fromString(e,t=!1){let n=new ArrayBuffer(e.length*2),i=new DataView(n);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),t);return n}},kt=class Vy{static{o(this,"Convert")}static isHex(e){return typeof e===s8&&g2e.test(e)}static isBase64(e){return typeof e===s8&&v2e.test(e)}static isBase64Url(e){return typeof e===s8&&y2e.test(e)}static ToString(e,t="utf8"){let n=At.toUint8Array(e);switch(t.toLowerCase()){case"utf8":return this.ToUtf8String(n);case"binary":return this.ToBinary(n);case"hex":return this.ToHex(n);case"base64":return this.ToBase64(n);case"base64url":return this.ToBase64Url(n);case"utf16le":return pl.toString(n,!0);case"utf16":case"utf16be":return pl.toString(n);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return pl.fromString(e,!0);case"utf16":case"utf16be":return pl.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){let t=At.toUint8Array(e);if(typeof btoa<"u"){let n=this.ToString(t,"binary");return btoa(n)}else return Buffer.from(t).toString("base64")}static FromBase64(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Vy.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Vy.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=Vy.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return xZ.fromString(e);case"utf16":case"utf16be":return pl.fromString(e);case"utf16le":case"usc2":return pl.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=Vy.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return xZ.toString(e);case"utf16":case"utf16be":return pl.toString(e);case"utf16le":case"usc2":return pl.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){let t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i++)n[i]=e.charCodeAt(i);return n.buffer}static ToBinary(e){let t=At.toUint8Array(e),n="";for(let i=0;i<t.length;i++)n+=String.fromCharCode(t[i]);return n}static ToHex(e){let t=At.toUint8Array(e),n="",i=t.length;for(let s=0;s<i;s++){let a=t[s];a<16&&(n+="0"),n+=a.toString(16)}return n}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!Vy.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i=i+2){let s=t.slice(i,i+2);n[i/2]=parseInt(s,16)}return n.buffer}static ToUtf16String(e,t=!1){return pl.toString(e,t)}static FromUtf16String(e,t=!1){return pl.fromString(e,t)}static Base64Padding(e){let t=4-e.length%4;if(t<4)for(let n=0;n<t;n++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}};kt.DEFAULT_UTF8_ENCODING="utf8";function _(r,e,t){var n;return r instanceof Object&&(n=r[e])!==null&&n!==void 0?n:t}o(_,"getParametersValue");function $R(r,e=0,t=r.byteLength-e,n=!1){let i="";for(let s of new Uint8Array(r,e,t)){let a=s.toString(16).toUpperCase();a.length===1&&(i+="0"),i+=a,n&&(i+=" ")}return i.trim()}o($R,"bufferToHexCodes");function Nf(r,e){let t=0;if(r.length===1)return r[0];for(let n=r.length-1;n>=0;n--)t+=r[r.length-1-n]*Math.pow(2,e*n);return t}o(Nf,"utilFromBase");function Xu(r,e,t=-1){let n=t,i=r,s=0,a=Math.pow(2,e);for(let u=1;u<8;u++){if(r<a){let c;if(n<0)c=new ArrayBuffer(u),s=u;else{if(n<u)return new ArrayBuffer(0);c=new ArrayBuffer(n),s=n}let l=new Uint8Array(c);for(let p=u-1;p>=0;p--){let d=Math.pow(2,p*e);l[s-p-1]=Math.floor(i/d),i-=l[s-p-1]*d}return c}a*=Math.pow(2,e)}return new ArrayBuffer(0)}o(Xu,"utilToBase");function $m(...r){let e=0,t=0;for(let s of r)e+=s.byteLength;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(new Uint8Array(s),t),t+=s.byteLength;return n}o($m,"utilConcatBuf");function ZR(...r){let e=0,t=0;for(let s of r)e+=s.length;let n=new ArrayBuffer(e),i=new Uint8Array(n);for(let s of r)i.set(s,t),t+=s.length;return i}o(ZR,"utilConcatView");function o8(){let r=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){let u=r[0]===255&&r[1]&128,c=r[0]===0&&(r[1]&128)===0;(u||c)&&this.warnings.push("Needlessly long format")}let e=new ArrayBuffer(this.valueHex.byteLength),t=new Uint8Array(e);for(let u=0;u<this.valueHex.byteLength;u++)t[u]=0;t[0]=r[0]&128;let n=Nf(t,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let u=0;u<this.valueHex.byteLength;u++)s[u]=r[u];return s[0]&=127,Nf(s,8)-n}o(o8,"utilDecodeTC");function EZ(r){let e=r<0?r*-1:r,t=128;for(let n=1;n<8;n++){if(e<=t){if(r<0){let a=t-e,u=Xu(a,8,n),c=new Uint8Array(u);return c[0]|=128,u}let i=Xu(e,8,n),s=new Uint8Array(i);if(s[0]&128){let a=i.slice(0),u=new Uint8Array(a);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let c=0;c<a.byteLength;c++)s[c+1]=u[c];s[0]=0}return i}t*=Math.pow(2,8)}return new ArrayBuffer(0)}o(EZ,"utilEncodeTC");function Vh(r,e){if(r.byteLength!==e.byteLength)return!1;let t=new Uint8Array(r),n=new Uint8Array(e);for(let i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}o(Vh,"isEqualBuffer");function $a(r,e){let t=r.toString(10);if(e<t.length)return"";let n=e-t.length,i=new Array(n);for(let a=0;a<n;a++)i[a]="0";return i.join("").concat(t)}o($a,"padNumber");var CZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",AZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=";function eD(r,e=!1,t=!1,n=!1){let i=0,s=0,a=0,u="",c=e?AZ:CZ;if(n){let l=0;for(let p=0;p<r.length;p++)if(r.charCodeAt(p)!==0){l=p;break}r=r.slice(l)}for(;i<r.length;){let l=r.charCodeAt(i++);i>=r.length&&(s=1);let p=r.charCodeAt(i++);i>=r.length&&(a=1);let d=r.charCodeAt(i++),g=l>>2,y=(l&3)<<4|p>>4,v=(p&15)<<2|d>>6,x=d&63;s===1?v=x=64:a===1&&(x=64),t?v===64?u+=`${c.charAt(g)}${c.charAt(y)}`:x===64?u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(x)}`:u+=`${c.charAt(g)}${c.charAt(y)}${c.charAt(v)}${c.charAt(x)}`}return u}o(eD,"toBase64");function jy(r,e=!1,t=!1){let n=e?AZ:CZ;function i(c){for(let l=0;l<64;l++)if(n.charAt(l)===c)return l;return 64}o(i,"indexOf");function s(c){return c===64?0:c}o(s,"test");let a=0,u="";for(;a<r.length;){let c=i(r.charAt(a++)),l=a>=r.length?0:i(r.charAt(a++)),p=a>=r.length?0:i(r.charAt(a++)),d=a>=r.length?0:i(r.charAt(a++)),g=s(c)<<2|s(l)>>4,y=(s(l)&15)<<4|s(p)>>2,v=(s(p)&3)<<6|s(d);u+=String.fromCharCode(g),p!==64&&(u+=String.fromCharCode(y)),d!==64&&(u+=String.fromCharCode(v))}if(t){let c=u.length,l=-1;for(let p=c-1;p>=0;p--)if(u.charCodeAt(p)!==0){l=p;break}l!==-1?u=u.slice(0,l+1):u=""}return u}o(jy,"fromBase64");function eE(r){let e="",t=new Uint8Array(r);for(let n of t)e+=String.fromCharCode(n);return e}o(eE,"arrayBufferToString");function Zm(r){let e=r.length,t=new ArrayBuffer(e),n=new Uint8Array(t);for(let i=0;i<e;i++)n[i]=r.charCodeAt(i);return t}o(Zm,"stringToArrayBuffer");var S2e=Math.log(2);function NZ(r){let e=Math.log(r)/S2e,t=Math.floor(e),n=Math.round(e);return t===n?t:n}o(NZ,"nearestPowerOf2");function Me(r,e){for(let t of e)delete r[t]}o(Me,"clearProps");function tD(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}o(tD,"assertBigInt");function f8(r){let e=0,t=0;for(let i=0;i<r.length;i++){let s=r[i];e+=s.byteLength}let n=new Uint8Array(e);for(let i=0;i<r.length;i++){let s=r[i];n.set(new Uint8Array(s),t),t+=s.byteLength}return n.buffer}o(f8,"concat");function If(r,e,t,n){return e instanceof Uint8Array?e.byteLength?t<0?(r.error="Wrong parameter: inputOffset less than zero",!1):n<0?(r.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-t-n<0?(r.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(r.error="Wrong parameter: inputBuffer has zero length",!1):(r.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}o(If,"checkBufferParams");var p8=class{static{o(this,"ViewWriter")}constructor(){this.items=[]}write(e){this.items.push(e)}final(){return f8(this.items)}},tE=[new Uint8Array([1])],TZ="0123456789",u8="name",RZ="valueHexView",b2e="isHexOnly",x2e="idBlock",w2e="tagClass",E2e="tagNumber",C2e="isConstructed",A2e="fromBER",N2e="toBER",I2e="local",Za="",Wu=new ArrayBuffer(0),rD=new Uint8Array(0),nE="EndOfContent",OZ="OCTET STRING",PZ="BIT STRING";function Tf(r){var e;return e=class extends r{static{o(this,"Some")}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(n){this.valueHexView=new Uint8Array(n)}constructor(...n){var i;super(...n);let s=n[0]||{};this.isHexOnly=(i=s.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=s.valueHex?At.toUint8Array(s.valueHex):rD}fromBER(n,i,s){let a=n instanceof ArrayBuffer?new Uint8Array(n):n;if(!If(this,a,i,s))return-1;let u=i+s;return this.valueHexView=a.subarray(i,u),this.valueHexView.length?(this.blockLength=s,u):(this.warnings.push("Zero buffer length"),i)}toBER(n=!1){return this.isHexOnly?n?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",Wu)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:kt.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}o(Tf,"HexBlock");var e0=class{static{o(this,"LocalBaseBlock")}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:t=Za,warnings:n=[],valueBeforeDecode:i=rD}={}){this.blockLength=e,this.error=t,this.warnings=n,this.valueBeforeDecodeView=At.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:kt.ToHex(this.valueBeforeDecodeView)}}};e0.NAME="baseBlock";var eo=class extends e0{static{o(this,"ValueBlock")}fromBER(e,t,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};eo.NAME="valueBlock";var BZ=class extends Tf(e0){static{o(this,"LocalIdentificationBlock")}constructor({idBlock:e={}}={}){var t,n,i,s;super(),e?(this.isHexOnly=(t=e.isHexOnly)!==null&&t!==void 0?t:!1,this.valueHexView=e.valueHex?At.toUint8Array(e.valueHex):rD,this.tagClass=(n=e.tagClass)!==null&&n!==void 0?n:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",Wu}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){let i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,t|=s,i[0]=t}return i.buffer}if(!this.isHexOnly){let i=Xu(this.tagNumber,7),s=new Uint8Array(i),a=i.byteLength,u=new Uint8Array(a+1);if(u[0]=t|31,!e){for(let c=0;c<a-1;c++)u[c+1]=s[c]|128;u[a]=s[a-1]}return u.buffer}let n=new Uint8Array(this.valueHexView.byteLength+1);if(n[0]=t|31,!e){let i=this.valueHexView;for(let s=0;s<i.length-1;s++)n[s+1]=i[s]|128;n[this.valueHexView.byteLength]=i[i.length-1]}return n.buffer}fromBER(e,t,n){let i=At.toUint8Array(e);if(!If(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;let u=s[0]&31;if(u!==31)this.tagNumber=u,this.blockLength=1;else{let c=1,l=this.valueHexView=new Uint8Array(255),p=255;for(;s[c]&128;){if(l[c-1]=s[c]&127,c++,c>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(c===p){p+=255;let g=new Uint8Array(p);for(let y=0;y<l.length;y++)g[y]=l[y];l=this.valueHexView=new Uint8Array(p)}}this.blockLength=c+1,l[c-1]=s[c]&127;let d=new Uint8Array(c);for(let g=0;g<c;g++)d[g]=l[g];l=this.valueHexView=new Uint8Array(c),l.set(d),this.blockLength<=9?this.tagNumber=Nf(l,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}};BZ.NAME="identificationBlock";var _Z=class extends e0{static{o(this,"LocalLengthBlock")}constructor({lenBlock:e={}}={}){var t,n,i;super(),this.isIndefiniteForm=(t=e.isIndefiniteForm)!==null&&t!==void 0?t:!1,this.longFormUsed=(n=e.longFormUsed)!==null&&n!==void 0?n:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,t,n){let i=At.toUint8Array(e);if(!If(this,i,t,n))return-1;let s=i.subarray(t,t+n);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,t+this.blockLength;let a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;let u=t+1,c=i.subarray(u,u+a);return c[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Nf(c,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,t+this.blockLength}toBER(e=!1){let t,n;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=128),t;if(this.longFormUsed){let i=Xu(this.length,8);if(i.byteLength>127)return this.error="Too big length",Wu;if(t=new ArrayBuffer(i.byteLength+1),e)return t;let s=new Uint8Array(i);n=new Uint8Array(t),n[0]=i.byteLength|128;for(let a=0;a<i.byteLength;a++)n[a+1]=s[a];return t}return t=new ArrayBuffer(1),e===!1&&(n=new Uint8Array(t),n[0]=this.length),t}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}};_Z.NAME="lengthBlock";var St={},Aa=class extends e0{static{o(this,"BaseBlock")}constructor({name:e=Za,optional:t=!1,primitiveSchema:n,...i}={},s){super(i),this.name=e,this.optional=t,n&&(this.primitiveSchema=n),this.idBlock=new BZ(i),this.lenBlock=new _Z(i),this.valueBlock=s?new s(i):new eo(i)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,t){let n=t||new p8;t||LZ(this);let i=this.idBlock.toBER(e);if(n.write(i),this.lenBlock.isIndefiniteForm)n.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,n),n.write(new ArrayBuffer(2));else{let s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;let a=this.lenBlock.toBER(e);n.write(a),n.write(s)}return t?Wu:n.final()}toJSON(){let e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():kt.ToHex(this.toBER())}onAsciiEncoding(){let e=this.constructor.NAME,t=kt.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${t}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;let t=this.toBER(),n=e.toBER();return Vh(t,n)}};Aa.NAME="BaseBlock";function LZ(r){var e;if(r instanceof St.Constructed)for(let t of r.valueBlock.value)LZ(t)&&(r.lenBlock.isIndefiniteForm=!0);return!!(!((e=r.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}o(LZ,"prepareIndefiniteForm");var FZ=class extends Aa{static{o(this,"BaseStringBlock")}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=Za,...t}={},n){super(t,n),e&&this.fromString(e)}fromBER(e,t,n){let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};FZ.NAME="BaseStringBlock";var kZ=class extends Tf(eo){static{o(this,"LocalPrimitiveValueBlock")}constructor({isHexOnly:e=!0,...t}={}){super(t),this.isHexOnly=e}};kZ.NAME="PrimitiveValueBlock";var VZ,Tt=class extends Aa{static{o(this,"Primitive")}constructor(e={}){super(e,kZ),this.idBlock.isConstructed=!1}};VZ=Tt;St.Primitive=VZ;Tt.NAME="PRIMITIVE";function T2e(r,e){if(r instanceof e)return r;let t=new e;return t.idBlock=r.idBlock,t.lenBlock=r.lenBlock,t.warnings=r.warnings,t.valueBeforeDecodeView=r.valueBeforeDecodeView,t}o(T2e,"localChangeType");function iE(r,e=0,t=r.length){let n=e,i=new Aa({},eo),s=new e0;if(!If(s,r,e,t))return i.error=s.error,{offset:-1,result:i};if(!r.subarray(e,e+t).length)return i.error="Zero buffer length",{offset:-1,result:i};let u=i.idBlock.fromBER(r,e,t);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),u===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=u,t-=i.idBlock.blockLength,u=i.lenBlock.fromBER(r,e,t),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),u===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=u,t-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let c=Aa;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};c=St.EndOfContent;break;case 1:c=St.Boolean;break;case 2:c=St.Integer;break;case 3:c=St.BitString;break;case 4:c=St.OctetString;break;case 5:c=St.Null;break;case 6:c=St.ObjectIdentifier;break;case 10:c=St.Enumerated;break;case 12:c=St.Utf8String;break;case 13:c=St.RelativeObjectIdentifier;break;case 14:c=St.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:c=St.Sequence;break;case 17:c=St.Set;break;case 18:c=St.NumericString;break;case 19:c=St.PrintableString;break;case 20:c=St.TeletexString;break;case 21:c=St.VideotexString;break;case 22:c=St.IA5String;break;case 23:c=St.UTCTime;break;case 24:c=St.GeneralizedTime;break;case 25:c=St.GraphicString;break;case 26:c=St.VisibleString;break;case 27:c=St.GeneralString;break;case 28:c=St.UniversalString;break;case 29:c=St.CharacterString;break;case 30:c=St.BmpString;break;case 31:c=St.DATE;break;case 32:c=St.TimeOfDay;break;case 33:c=St.DateTime;break;case 34:c=St.Duration;break;default:{let l=i.idBlock.isConstructed?new St.Constructed:new St.Primitive;l.idBlock=i.idBlock,l.lenBlock=i.lenBlock,l.warnings=i.warnings,i=l}}break;case 2:case 3:case 4:default:c=i.idBlock.isConstructed?St.Constructed:St.Primitive}return i=T2e(i,c),u=i.fromBER(r,e,i.lenBlock.isIndefiniteForm?t:i.lenBlock.length),i.valueBeforeDecodeView=r.subarray(n,n+i.blockLength),{offset:u,result:i}}o(iE,"localFromBER");function ni(r){if(!r.byteLength){let e=new Aa({},eo);return e.error="Input buffer has zero length",{offset:-1,result:e}}return iE(At.toUint8Array(r).slice(),0,r.byteLength)}o(ni,"fromBER");function R2e(r,e){return r?1:e}o(R2e,"checkLen");var jh=class extends eo{static{o(this,"LocalConstructedValueBlock")}constructor({value:e=[],isIndefiniteForm:t=!1,...n}={}){super(n),this.value=e,this.isIndefiniteForm=t}fromBER(e,t,n){let i=At.toUint8Array(e);if(!If(this,i,t,n))return-1;if(this.valueBeforeDecodeView=i.subarray(t,t+n),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),t;let s=t;for(;R2e(this.isIndefiniteForm,n)>0;){let a=iE(i,s,n);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,n-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===nE)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===nE?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,t){let n=t||new p8;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,n);return t?Wu:n.final()}toJSON(){let e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(let t of this.value)e.value.push(t.toJSON());return e}};jh.NAME="ConstructedValueBlock";var jZ,de=class extends Aa{static{o(this,"Constructed")}constructor(e={}){super(e,jh),this.idBlock.isConstructed=!0}fromBER(e,t,n){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;let i=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?n:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){let e=[];for(let n of this.valueBlock.value)e.push(n.toString("ascii").split(`
|
|
122
122
|
`).map(i=>` ${i}`).join(`
|
package/dist/nfe/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
import{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}from"../chunk-
|
|
2
|
+
import{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}from"../chunk-K6AWXRHY.mjs";import"../chunk-YQCBUAAQ.mjs";import"../chunk-W6MRGYXP.mjs";export{d as AccessKeyBuilder,x as DanfceDefaultPdfDocument,y as DanfceReducedPdfDocument,e as DefaultDetBuilderAggregator,f as DefaultTotalBuilderAggregator,u as NFCeDto,q as NFeDto,k as NfceAuthorizerPipeline,m as NfceConsultStatusPipeline,j as NfceQrcode,i as NfceRemoteTransmitter,v as NfceXmlBuilder,w as NfceXmlBuilderPipeline,n as NfeAuthorizationResponsePipeline,h as NfeAuthorizerPipeline,l as NfeConsultStatusPipeline,r as NfeDetXmlBuilder,o as NfeNfceCancelPipeline,p as NfeNfceVoidRangePipeline,g as NfeRemoteTransmitter,s as NfeXmlBuilder,t as NfeXmlBuilderPipeline,a as TpEmis,b as TpEvent,c as schemas};
|