nfets 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import{A as fo,B as Op,E as xp,F as Bf,G as Uf,H as qf,I as Ap,J as wp,L as H,M as f,N as Rr,d as Rp,f as d,g as Fp,h as S,i as hn,k as Hi,o as Sn,p as po,q as Ip,w as zp,x as co,z as D}from"./chunk-MXBBYFAK.mjs";import{a,e as Lf,f as ts}from"./chunk-W6MRGYXP.mjs";var ht=(function(t){return t.Normal="1",t.EPEC="4",t.SVCAN="6",t.SVCRS="7",t.OFFLINE="9",t})({});var Qf={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21"},Pp=process.env.NFETS_NFE_SCHEMAS_DIR??"",Ep=Qf;var $i=class{static{a(this,"AccessKeyBuilder")}compile(e){let o=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),r=(e.identification??"").padStart(14,"0"),s=e.mod.toString().padStart(2,"0"),p=e.serie.toString().padStart(3,"0"),g=e.nNF.toString().padStart(9,"0"),m=e.tpEmis.toString().padStart(1,"0"),v=(e.cNF??this.code()).toString().padStart(8,"0"),N=`${o}${n}${i}${r}${s}${p}${g}${m}${v}`;return`${N}${this.verifyingDigit(N)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,r,s,p,g,m,v,N,b,I,h]=n;return{cUF:r,year:s,month:p,identification:g,mod:m,serie:v,nNF:N,tpEmis:b,cNF:I,vd:h}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let o=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let s=0;s<8&&n>=0;s++){let p=parseInt(e[n]);i+=p*o[s],n--}let r=11-i%11;return r>9?0:r}};var Ji=class{static{a(this,"DefaultDetBuilderAggregator")}builder;constructor(e){this.builder=e}prod(e){let o=fo.from(0);this.builder.increment(({ICMSTot:n})=>({ICMSTot:{vProd:fo.newOrZero(n?.vProd).add(e.vProd).toFixed(2),vFrete:fo.newOrZero(n?.vFrete).add(e.vFrete??o).toFixed(2),vSeg:fo.newOrZero(n?.vSeg).add(e.vSeg??o).toFixed(2),vDesc:fo.newOrZero(n?.vDesc).add(e.vDesc??o).toFixed(2),vOutro:fo.newOrZero(n?.vOutro).add(e.vOutro??o).toFixed(2)}}))}icms(e){}};var Gi=class{static{a(this,"DefaultTotalBuilderAggregator")}builder;constructor(e){this.builder=e}aggregate(){let e=fo.from(0);this.builder.increment(({ICMSTot:o,ISSQNtot:n})=>({ICMSTot:{vNF:fo.newOrZero(o?.vProd).sub(o?.vDesc??e).sub(o?.vICMSDeson??e).add(o?.vST??e).add(o?.vFCPST??e).add(o?.vFrete??e).add(o?.vSeg??e).add(o?.vOutro??e).add(o?.vII??e).add(o?.vIPI??e).add(o?.vIPIDevol??e).add(n?.vServ??e).toFixed(2)}}))}};function fi(t,e){return a(function(){return t.apply(e,arguments)},"wrap")}a(fi,"bind");var{toString:Hf}=Object.prototype,{getPrototypeOf:rs}=Object,{iterator:Yi,toStringTag:jp}=Symbol,Ki=(t=>e=>{let o=Hf.call(e);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Tt=a(t=>(t=t.toLowerCase(),e=>Ki(e)===t),"kindOfTest"),Xi=a(t=>e=>typeof e===t,"typeOfTest"),{isArray:Cn}=Array,Nn=Xi("undefined");function di(t){return t!==null&&!Nn(t)&&t.constructor!==null&&!Nn(t.constructor)&&dt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}a(di,"isBuffer");var Tp=Tt("ArrayBuffer");function $f(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Tp(t.buffer),e}a($f,"isArrayBufferView");var Jf=Xi("string"),dt=Xi("function"),Vp=Xi("number"),ui=a(t=>t!==null&&typeof t=="object","isObject"),Gf=a(t=>t===!0||t===!1,"isBoolean"),Wi=a(t=>{if(Ki(t)!=="object")return!1;let e=rs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jp in t)&&!(Yi in t)},"isPlainObject"),Wf=a(t=>{if(!ui(t)||di(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},"isEmptyObject"),Yf=Tt("Date"),Kf=Tt("File"),Xf=Tt("Blob"),Zf=Tt("FileList"),kf=a(t=>ui(t)&&dt(t.pipe),"isStream"),ed=a(t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||dt(t.append)&&((e=Ki(t))==="formdata"||e==="object"&&dt(t.toString)&&t.toString()==="[object FormData]"))},"isFormData"),td=Tt("URLSearchParams"),[od,rd,nd,id]=["ReadableStream","Request","Response","Headers"].map(Tt),ad=a(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function li(t,e,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Cn(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(di(t))return;let r=o?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,p;for(n=0;n<s;n++)p=r[n],e.call(null,t[p],p,t)}}a(li,"forEach");function Mp(t,e){if(di(t))return null;e=e.toLowerCase();let o=Object.keys(t),n=o.length,i;for(;n-- >0;)if(i=o[n],e===i.toLowerCase())return i;return null}a(Mp,"findKey");var Ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_p=a(t=>!Nn(t)&&t!==Ur,"isContextDefined");function os(){let{caseless:t,skipUndefined:e}=_p(this)&&this||{},o={},n=a((i,r)=>{let s=t&&Mp(o,r)||r;Wi(o[s])&&Wi(i)?o[s]=os(o[s],i):Wi(i)?o[s]=os({},i):Cn(i)?o[s]=i.slice():(!e||!Nn(i))&&(o[s]=i)},"assignValue");for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&li(arguments[i],n);return o}a(os,"merge");var sd=a((t,e,o,{allOwnKeys:n}={})=>(li(e,(i,r)=>{o&&dt(i)?t[r]=fi(i,o):t[r]=i},{allOwnKeys:n}),t),"extend"),pd=a(t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),"stripBOM"),cd=a((t,e,o,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},"inherits"),fd=a((t,e,o,n)=>{let i,r,s,p={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)s=i[r],(!n||n(s,t,e))&&!p[s]&&(e[s]=t[s],p[s]=!0);t=o!==!1&&rs(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},"toFlatObject"),dd=a((t,e,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=e.length;let n=t.indexOf(e,o);return n!==-1&&n===o},"endsWith"),ud=a(t=>{if(!t)return null;if(Cn(t))return t;let e=t.length;if(!Vp(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},"toArray"),ld=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&rs(Uint8Array)),md=a((t,e)=>{let n=(t&&t[Yi]).call(t),i;for(;(i=n.next())&&!i.done;){let r=i.value;e.call(t,r[0],r[1])}},"forEachEntry"),vd=a((t,e)=>{let o,n=[];for(;(o=t.exec(e))!==null;)n.push(o);return n},"matchAll"),yd=Tt("HTMLFormElement"),gd=a(t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function(o,n,i){return n.toUpperCase()+i},"replacer")),"toCamelCase"),Dp=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),hd=Tt("RegExp"),Lp=a((t,e)=>{let o=Object.getOwnPropertyDescriptors(t),n={};li(o,(i,r)=>{let s;(s=e(i,r,t))!==!1&&(n[r]=s||i)}),Object.defineProperties(t,n)},"reduceDescriptors"),Sd=a(t=>{Lp(t,(e,o)=>{if(dt(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let n=t[o];if(dt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},"freezeMethods"),Nd=a((t,e)=>{let o={},n=a(i=>{i.forEach(r=>{o[r]=!0})},"define");return Cn(t)?n(t):n(String(t).split(e)),o},"toObjectSet"),Cd=a(()=>{},"noop"),bd=a((t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,"toFiniteNumber");function Rd(t){return!!(t&&dt(t.append)&&t[jp]==="FormData"&&t[Yi])}a(Rd,"isSpecCompliantForm");var Fd=a(t=>{let e=new Array(10),o=a((n,i)=>{if(ui(n)){if(e.indexOf(n)>=0)return;if(di(n))return n;if(!("toJSON"in n)){e[i]=n;let r=Cn(n)?[]:{};return li(n,(s,p)=>{let g=o(s,i+1);!Nn(g)&&(r[p]=g)}),e[i]=void 0,r}}return n},"visit");return o(t,0)},"toJSONObject"),Id=Tt("AsyncFunction"),zd=a(t=>t&&(ui(t)||dt(t))&&dt(t.then)&&dt(t.catch),"isThenable"),Bp=((t,e)=>t?setImmediate:e?((o,n)=>(Ur.addEventListener("message",({source:i,data:r})=>{i===Ur&&r===o&&n.length&&n.shift()()},!1),i=>{n.push(i),Ur.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",dt(Ur.postMessage)),Od=typeof queueMicrotask<"u"?queueMicrotask.bind(Ur):typeof process<"u"&&process.nextTick||Bp,xd=a(t=>t!=null&&dt(t[Yi]),"isIterable"),c={isArray:Cn,isArrayBuffer:Tp,isBuffer:di,isFormData:ed,isArrayBufferView:$f,isString:Jf,isNumber:Vp,isBoolean:Gf,isObject:ui,isPlainObject:Wi,isEmptyObject:Wf,isReadableStream:od,isRequest:rd,isResponse:nd,isHeaders:id,isUndefined:Nn,isDate:Yf,isFile:Kf,isBlob:Xf,isRegExp:hd,isFunction:dt,isStream:kf,isURLSearchParams:td,isTypedArray:ld,isFileList:Zf,forEach:li,merge:os,extend:sd,trim:ad,stripBOM:pd,inherits:cd,toFlatObject:fd,kindOf:Ki,kindOfTest:Tt,endsWith:dd,toArray:ud,forEachEntry:md,matchAll:vd,isHTMLForm:yd,hasOwnProperty:Dp,hasOwnProp:Dp,reduceDescriptors:Lp,freezeMethods:Sd,toObjectSet:Nd,toCamelCase:gd,noop:Cd,toFiniteNumber:bd,findKey:Mp,global:Ur,isContextDefined:_p,isSpecCompliantForm:Rd,toJSONObject:Fd,isAsyncFn:Id,isThenable:zd,setImmediate:Bp,asap:Od,isIterable:xd};function bn(t,e,o,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}a(bn,"AxiosError");c.inherits(bn,Error,{toJSON:a(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var Up=bn.prototype,qp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{qp[t]={value:t}});Object.defineProperties(bn,qp);Object.defineProperty(Up,"isAxiosError",{value:!0});bn.from=(t,e,o,n,i,r)=>{let s=Object.create(Up);c.toFlatObject(t,s,a(function(v){return v!==Error.prototype},"filter"),m=>m!=="isAxiosError");let p=t&&t.message?t.message:"Error",g=e==null&&t?t.code:e;return bn.call(s,p,g,o,n,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var R=bn;var Qp=ts(Bf(),1),Zi=Qp.default;function ns(t){return c.isPlainObject(t)||c.isArray(t)}a(ns,"isVisitable");function $p(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}a($p,"removeBrackets");function Hp(t,e,o){return t?t.concat(e).map(a(function(i,r){return i=$p(i),!o&&r?"["+i+"]":i},"each")).join(o?".":""):e}a(Hp,"renderKey");function Ad(t){return c.isArray(t)&&!t.some(ns)}a(Ad,"isFlatArray");var wd=c.toFlatObject(c,{},null,a(function(e){return/^is[A-Z]/.test(e)},"filter"));function Pd(t,e,o){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(Zi||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,a(function(F,C){return!c.isUndefined(C[F])},"defined"));let n=o.metaTokens,i=o.visitor||v,r=o.dots,s=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(i))throw new TypeError("visitor must be a function");function m(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(c.isBoolean(h))return h.toString();if(!g&&c.isBlob(h))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?g&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}a(m,"convertValue");function v(h,F,C){let Q=h;if(h&&!C&&typeof h=="object"){if(c.endsWith(F,"{}"))F=n?F:F.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&Ad(h)||(c.isFileList(h)||c.endsWith(F,"[]"))&&(Q=c.toArray(h)))return F=$p(F),Q.forEach(a(function(B,le){!(c.isUndefined(B)||B===null)&&e.append(s===!0?Hp([F],le,r):s===null?F:F+"[]",m(B))},"each")),!1}return ns(h)?!0:(e.append(Hp(C,F,r),m(h)),!1)}a(v,"defaultVisitor");let N=[],b=Object.assign(wd,{defaultVisitor:v,convertValue:m,isVisitable:ns});function I(h,F){if(!c.isUndefined(h)){if(N.indexOf(h)!==-1)throw Error("Circular reference detected in "+F.join("."));N.push(h),c.forEach(h,a(function(Q,Y){(!(c.isUndefined(Q)||Q===null)&&i.call(e,Q,c.isString(Y)?Y.trim():Y,F,b))===!0&&I(Q,F?F.concat(Y):[Y])},"each")),N.pop()}}if(a(I,"build"),!c.isObject(t))throw new TypeError("data must be an object");return I(t),e}a(Pd,"toFormData");var Fr=Pd;function Jp(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,a(function(n){return e[n]},"replacer"))}a(Jp,"encode");function Gp(t,e){this._pairs=[],t&&Fr(t,this,e)}a(Gp,"AxiosURLSearchParams");var Wp=Gp.prototype;Wp.append=a(function(e,o){this._pairs.push([e,o])},"append");Wp.toString=a(function(e){let o=e?function(n){return e.call(this,n,Jp)}:Jp;return this._pairs.map(a(function(i){return o(i[0])+"="+o(i[1])},"each"),"").join("&")},"toString");var Yp=Gp;function Ed(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}a(Ed,"encode");function qr(t,e,o){if(!e)return t;let n=o&&o.encode||Ed;c.isFunction(o)&&(o={serialize:o});let i=o&&o.serialize,r;if(i?r=i(e,o):r=c.isURLSearchParams(e)?e.toString():new Yp(e,o).toString(n),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}a(qr,"buildURL");var Dd=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,o,n){return this.handlers.push({fulfilled:e,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,a(function(n){n!==null&&e(n)},"forEachHandler"))}},is=Dd;var Rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Td from"crypto";import jd from"url";var Kp=jd.URLSearchParams;var as="abcdefghijklmnopqrstuvwxyz",Xp="0123456789",Zp={DIGIT:Xp,ALPHA:as,ALPHA_DIGIT:as+as.toUpperCase()+Xp},Vd=a((t=16,e=Zp.ALPHA_DIGIT)=>{let o="",{length:n}=e,i=new Uint32Array(t);Td.randomFillSync(i);for(let r=0;r<t;r++)o+=e[i[r]%n];return o},"generateString"),kp={isNode:!0,classes:{URLSearchParams:Kp,FormData:Zi,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Zp,generateString:Vd,protocols:["http","https","file","data"]};var cs={};Lf(cs,{hasBrowserEnv:()=>ps,hasStandardBrowserEnv:()=>Md,hasStandardBrowserWebWorkerEnv:()=>_d,navigator:()=>ss,origin:()=>Ld});var ps=typeof window<"u"&&typeof document<"u",ss=typeof navigator=="object"&&navigator||void 0,Md=ps&&(!ss||["ReactNative","NativeScript","NS"].indexOf(ss.product)<0),_d=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ld=ps&&window.location.href||"http://localhost";var U={...cs,...kp};function fs(t,e){return Fr(t,new U.classes.URLSearchParams,{visitor:a(function(o,n,i,r){return U.isNode&&c.isBuffer(o)?(this.append(n,o.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},"visitor"),...e})}a(fs,"toURLEncodedForm");function Bd(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}a(Bd,"parsePropPath");function Ud(t){let e={},o=Object.keys(t),n,i=o.length,r;for(n=0;n<i;n++)r=o[n],e[r]=t[r];return e}a(Ud,"arrayToObject");function qd(t){function e(o,n,i,r){let s=o[r++];if(s==="__proto__")return!0;let p=Number.isFinite(+s),g=r>=o.length;return s=!s&&c.isArray(i)?i.length:s,g?(c.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!p):((!i[s]||!c.isObject(i[s]))&&(i[s]=[]),e(o,n,i[s],r)&&c.isArray(i[s])&&(i[s]=Ud(i[s])),!p)}if(a(e,"buildPath"),c.isFormData(t)&&c.isFunction(t.entries)){let o={};return c.forEachEntry(t,(n,i)=>{e(Bd(n),i,o,0)}),o}return null}a(qd,"formDataToJSON");var ki=qd;function Qd(t,e,o){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(o||JSON.stringify)(t)}a(Qd,"stringifySafely");var ds={transitional:Rn,adapter:["xhr","http","fetch"],transformRequest:[a(function(e,o){let n=o.getContentType()||"",i=n.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(ki(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let p;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return fs(e,this.formSerializer).toString();if((p=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){let g=this.env&&this.env.FormData;return Fr(p?{"files[]":e}:e,g&&new g,this.formSerializer)}}return r||i?(o.setContentType("application/json",!1),Qd(e)):e},"transformRequest")],transformResponse:[a(function(e){let o=this.transitional||ds.transitional,n=o&&o.forcedJSONParsing,i=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||i)){let s=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(p){if(s)throw p.name==="SyntaxError"?R.from(p,R.ERR_BAD_RESPONSE,this,null,this.response):p}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:a(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{ds.headers[t]={}});var Fn=ds;var Hd=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ec=a((t=>{let e={},o,n,i;return t&&t.split(`
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{A as fo,B as Op,E as xp,F as Bf,G as Uf,H as qf,I as Ap,J as wp,L as H,M as f,N as Rr,d as Rp,f as d,g as Fp,h as S,i as hn,k as Hi,o as Sn,p as po,q as Ip,w as zp,x as co,z as D}from"./chunk-TKSZP5SJ.mjs";import{a,e as Lf,f as ts}from"./chunk-WEMHPBTC.mjs";var ht=(function(t){return t.Normal="1",t.EPEC="4",t.SVCAN="6",t.SVCRS="7",t.OFFLINE="9",t})({});var Qf={PL_009_V4:"PL_009_V4",PL_010_V1:"PL_010_V1",PL_010_V1_21:"PL_010_V1.21"},Pp=process.env.NFETS_NFE_SCHEMAS_DIR??"",Ep=Qf;var $i=class{static{a(this,"AccessKeyBuilder")}compile(e){let o=e.cUF.toString().padStart(2,"0"),n=e.year.toString().padStart(2,"0"),i=e.month.toString().padStart(2,"0"),r=(e.identification??"").padStart(14,"0"),s=e.mod.toString().padStart(2,"0"),p=e.serie.toString().padStart(3,"0"),g=e.nNF.toString().padStart(9,"0"),m=e.tpEmis.toString().padStart(1,"0"),v=(e.cNF??this.code()).toString().padStart(8,"0"),N=`${o}${n}${i}${r}${s}${p}${g}${m}${v}`;return`${N}${this.verifyingDigit(N)}`}decompile(e){if(e.length!==44)return;let n=/^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{14})([0-9]{2})([0-9]{3})([0-9]{9})([0-9]{1})([0-9]{8})([0-9]{1})$/.exec(e);if(!n)return;let[i,r,s,p,g,m,v,N,b,I,h]=n;return{cUF:r,year:s,month:p,identification:g,mod:m,serie:v,nNF:N,tpEmis:b,cNF:I,vd:h}}code(){let e=Math.floor(Math.random()*1e8).toString().padStart(8,"0");return this.isCodeValid(e)?e:this.code()}isCodeValid(e){return!~["00000000","11111111","22222222","33333333","44444444","55555555","66666666","77777777","88888888","99999999","12345678","23456789","34567890","45678901","56789012","67890123","78901234","89012345","90123456","01234567"].indexOf(e)}verifyingDigit(e){let o=[2,3,4,5,6,7,8,9],n=42,i=0;for(;n>=0;)for(let s=0;s<8&&n>=0;s++){let p=parseInt(e[n]);i+=p*o[s],n--}let r=11-i%11;return r>9?0:r}};var Ji=class{static{a(this,"DefaultDetBuilderAggregator")}builder;constructor(e){this.builder=e}prod(e){let o=fo.from(0);this.builder.increment(({ICMSTot:n})=>({ICMSTot:{vProd:fo.newOrZero(n?.vProd).add(e.vProd).toFixed(2),vFrete:fo.newOrZero(n?.vFrete).add(e.vFrete??o).toFixed(2),vSeg:fo.newOrZero(n?.vSeg).add(e.vSeg??o).toFixed(2),vDesc:fo.newOrZero(n?.vDesc).add(e.vDesc??o).toFixed(2),vOutro:fo.newOrZero(n?.vOutro).add(e.vOutro??o).toFixed(2)}}))}icms(e){}};var Gi=class{static{a(this,"DefaultTotalBuilderAggregator")}builder;constructor(e){this.builder=e}aggregate(){let e=fo.from(0);this.builder.increment(({ICMSTot:o,ISSQNtot:n})=>({ICMSTot:{vNF:fo.newOrZero(o?.vProd).sub(o?.vDesc??e).sub(o?.vICMSDeson??e).add(o?.vST??e).add(o?.vFCPST??e).add(o?.vFrete??e).add(o?.vSeg??e).add(o?.vOutro??e).add(o?.vII??e).add(o?.vIPI??e).add(o?.vIPIDevol??e).add(n?.vServ??e).toFixed(2)}}))}};function fi(t,e){return a(function(){return t.apply(e,arguments)},"wrap")}a(fi,"bind");var{toString:Hf}=Object.prototype,{getPrototypeOf:rs}=Object,{iterator:Yi,toStringTag:jp}=Symbol,Ki=(t=>e=>{let o=Hf.call(e);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Tt=a(t=>(t=t.toLowerCase(),e=>Ki(e)===t),"kindOfTest"),Xi=a(t=>e=>typeof e===t,"typeOfTest"),{isArray:Cn}=Array,Nn=Xi("undefined");function di(t){return t!==null&&!Nn(t)&&t.constructor!==null&&!Nn(t.constructor)&&dt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}a(di,"isBuffer");var Tp=Tt("ArrayBuffer");function $f(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Tp(t.buffer),e}a($f,"isArrayBufferView");var Jf=Xi("string"),dt=Xi("function"),Vp=Xi("number"),ui=a(t=>t!==null&&typeof t=="object","isObject"),Gf=a(t=>t===!0||t===!1,"isBoolean"),Wi=a(t=>{if(Ki(t)!=="object")return!1;let e=rs(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(jp in t)&&!(Yi in t)},"isPlainObject"),Wf=a(t=>{if(!ui(t)||di(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},"isEmptyObject"),Yf=Tt("Date"),Kf=Tt("File"),Xf=Tt("Blob"),Zf=Tt("FileList"),kf=a(t=>ui(t)&&dt(t.pipe),"isStream"),ed=a(t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||dt(t.append)&&((e=Ki(t))==="formdata"||e==="object"&&dt(t.toString)&&t.toString()==="[object FormData]"))},"isFormData"),td=Tt("URLSearchParams"),[od,rd,nd,id]=["ReadableStream","Request","Response","Headers"].map(Tt),ad=a(t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),"trim");function li(t,e,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let n,i;if(typeof t!="object"&&(t=[t]),Cn(t))for(n=0,i=t.length;n<i;n++)e.call(null,t[n],n,t);else{if(di(t))return;let r=o?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,p;for(n=0;n<s;n++)p=r[n],e.call(null,t[p],p,t)}}a(li,"forEach");function Mp(t,e){if(di(t))return null;e=e.toLowerCase();let o=Object.keys(t),n=o.length,i;for(;n-- >0;)if(i=o[n],e===i.toLowerCase())return i;return null}a(Mp,"findKey");var Ur=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,_p=a(t=>!Nn(t)&&t!==Ur,"isContextDefined");function os(){let{caseless:t,skipUndefined:e}=_p(this)&&this||{},o={},n=a((i,r)=>{let s=t&&Mp(o,r)||r;Wi(o[s])&&Wi(i)?o[s]=os(o[s],i):Wi(i)?o[s]=os({},i):Cn(i)?o[s]=i.slice():(!e||!Nn(i))&&(o[s]=i)},"assignValue");for(let i=0,r=arguments.length;i<r;i++)arguments[i]&&li(arguments[i],n);return o}a(os,"merge");var sd=a((t,e,o,{allOwnKeys:n}={})=>(li(e,(i,r)=>{o&&dt(i)?t[r]=fi(i,o):t[r]=i},{allOwnKeys:n}),t),"extend"),pd=a(t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),"stripBOM"),cd=a((t,e,o,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},"inherits"),fd=a((t,e,o,n)=>{let i,r,s,p={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),r=i.length;r-- >0;)s=i[r],(!n||n(s,t,e))&&!p[s]&&(e[s]=t[s],p[s]=!0);t=o!==!1&&rs(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},"toFlatObject"),dd=a((t,e,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=e.length;let n=t.indexOf(e,o);return n!==-1&&n===o},"endsWith"),ud=a(t=>{if(!t)return null;if(Cn(t))return t;let e=t.length;if(!Vp(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},"toArray"),ld=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&rs(Uint8Array)),md=a((t,e)=>{let n=(t&&t[Yi]).call(t),i;for(;(i=n.next())&&!i.done;){let r=i.value;e.call(t,r[0],r[1])}},"forEachEntry"),vd=a((t,e)=>{let o,n=[];for(;(o=t.exec(e))!==null;)n.push(o);return n},"matchAll"),yd=Tt("HTMLFormElement"),gd=a(t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,a(function(o,n,i){return n.toUpperCase()+i},"replacer")),"toCamelCase"),Dp=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),hd=Tt("RegExp"),Lp=a((t,e)=>{let o=Object.getOwnPropertyDescriptors(t),n={};li(o,(i,r)=>{let s;(s=e(i,r,t))!==!1&&(n[r]=s||i)}),Object.defineProperties(t,n)},"reduceDescriptors"),Sd=a(t=>{Lp(t,(e,o)=>{if(dt(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let n=t[o];if(dt(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},"freezeMethods"),Nd=a((t,e)=>{let o={},n=a(i=>{i.forEach(r=>{o[r]=!0})},"define");return Cn(t)?n(t):n(String(t).split(e)),o},"toObjectSet"),Cd=a(()=>{},"noop"),bd=a((t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,"toFiniteNumber");function Rd(t){return!!(t&&dt(t.append)&&t[jp]==="FormData"&&t[Yi])}a(Rd,"isSpecCompliantForm");var Fd=a(t=>{let e=new Array(10),o=a((n,i)=>{if(ui(n)){if(e.indexOf(n)>=0)return;if(di(n))return n;if(!("toJSON"in n)){e[i]=n;let r=Cn(n)?[]:{};return li(n,(s,p)=>{let g=o(s,i+1);!Nn(g)&&(r[p]=g)}),e[i]=void 0,r}}return n},"visit");return o(t,0)},"toJSONObject"),Id=Tt("AsyncFunction"),zd=a(t=>t&&(ui(t)||dt(t))&&dt(t.then)&&dt(t.catch),"isThenable"),Bp=((t,e)=>t?setImmediate:e?((o,n)=>(Ur.addEventListener("message",({source:i,data:r})=>{i===Ur&&r===o&&n.length&&n.shift()()},!1),i=>{n.push(i),Ur.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",dt(Ur.postMessage)),Od=typeof queueMicrotask<"u"?queueMicrotask.bind(Ur):typeof process<"u"&&process.nextTick||Bp,xd=a(t=>t!=null&&dt(t[Yi]),"isIterable"),c={isArray:Cn,isArrayBuffer:Tp,isBuffer:di,isFormData:ed,isArrayBufferView:$f,isString:Jf,isNumber:Vp,isBoolean:Gf,isObject:ui,isPlainObject:Wi,isEmptyObject:Wf,isReadableStream:od,isRequest:rd,isResponse:nd,isHeaders:id,isUndefined:Nn,isDate:Yf,isFile:Kf,isBlob:Xf,isRegExp:hd,isFunction:dt,isStream:kf,isURLSearchParams:td,isTypedArray:ld,isFileList:Zf,forEach:li,merge:os,extend:sd,trim:ad,stripBOM:pd,inherits:cd,toFlatObject:fd,kindOf:Ki,kindOfTest:Tt,endsWith:dd,toArray:ud,forEachEntry:md,matchAll:vd,isHTMLForm:yd,hasOwnProperty:Dp,hasOwnProp:Dp,reduceDescriptors:Lp,freezeMethods:Sd,toObjectSet:Nd,toCamelCase:gd,noop:Cd,toFiniteNumber:bd,findKey:Mp,global:Ur,isContextDefined:_p,isSpecCompliantForm:Rd,toJSONObject:Fd,isAsyncFn:Id,isThenable:zd,setImmediate:Bp,asap:Od,isIterable:xd};function bn(t,e,o,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}a(bn,"AxiosError");c.inherits(bn,Error,{toJSON:a(function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}},"toJSON")});var Up=bn.prototype,qp={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{qp[t]={value:t}});Object.defineProperties(bn,qp);Object.defineProperty(Up,"isAxiosError",{value:!0});bn.from=(t,e,o,n,i,r)=>{let s=Object.create(Up);c.toFlatObject(t,s,a(function(v){return v!==Error.prototype},"filter"),m=>m!=="isAxiosError");let p=t&&t.message?t.message:"Error",g=e==null&&t?t.code:e;return bn.call(s,p,g,o,n,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var R=bn;var Qp=ts(Bf(),1),Zi=Qp.default;function ns(t){return c.isPlainObject(t)||c.isArray(t)}a(ns,"isVisitable");function $p(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}a($p,"removeBrackets");function Hp(t,e,o){return t?t.concat(e).map(a(function(i,r){return i=$p(i),!o&&r?"["+i+"]":i},"each")).join(o?".":""):e}a(Hp,"renderKey");function Ad(t){return c.isArray(t)&&!t.some(ns)}a(Ad,"isFlatArray");var wd=c.toFlatObject(c,{},null,a(function(e){return/^is[A-Z]/.test(e)},"filter"));function Pd(t,e,o){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(Zi||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,a(function(F,C){return!c.isUndefined(C[F])},"defined"));let n=o.metaTokens,i=o.visitor||v,r=o.dots,s=o.indexes,g=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(i))throw new TypeError("visitor must be a function");function m(h){if(h===null)return"";if(c.isDate(h))return h.toISOString();if(c.isBoolean(h))return h.toString();if(!g&&c.isBlob(h))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(h)||c.isTypedArray(h)?g&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}a(m,"convertValue");function v(h,F,C){let Q=h;if(h&&!C&&typeof h=="object"){if(c.endsWith(F,"{}"))F=n?F:F.slice(0,-2),h=JSON.stringify(h);else if(c.isArray(h)&&Ad(h)||(c.isFileList(h)||c.endsWith(F,"[]"))&&(Q=c.toArray(h)))return F=$p(F),Q.forEach(a(function(B,le){!(c.isUndefined(B)||B===null)&&e.append(s===!0?Hp([F],le,r):s===null?F:F+"[]",m(B))},"each")),!1}return ns(h)?!0:(e.append(Hp(C,F,r),m(h)),!1)}a(v,"defaultVisitor");let N=[],b=Object.assign(wd,{defaultVisitor:v,convertValue:m,isVisitable:ns});function I(h,F){if(!c.isUndefined(h)){if(N.indexOf(h)!==-1)throw Error("Circular reference detected in "+F.join("."));N.push(h),c.forEach(h,a(function(Q,Y){(!(c.isUndefined(Q)||Q===null)&&i.call(e,Q,c.isString(Y)?Y.trim():Y,F,b))===!0&&I(Q,F?F.concat(Y):[Y])},"each")),N.pop()}}if(a(I,"build"),!c.isObject(t))throw new TypeError("data must be an object");return I(t),e}a(Pd,"toFormData");var Fr=Pd;function Jp(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,a(function(n){return e[n]},"replacer"))}a(Jp,"encode");function Gp(t,e){this._pairs=[],t&&Fr(t,this,e)}a(Gp,"AxiosURLSearchParams");var Wp=Gp.prototype;Wp.append=a(function(e,o){this._pairs.push([e,o])},"append");Wp.toString=a(function(e){let o=e?function(n){return e.call(this,n,Jp)}:Jp;return this._pairs.map(a(function(i){return o(i[0])+"="+o(i[1])},"each"),"").join("&")},"toString");var Yp=Gp;function Ed(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}a(Ed,"encode");function qr(t,e,o){if(!e)return t;let n=o&&o.encode||Ed;c.isFunction(o)&&(o={serialize:o});let i=o&&o.serialize,r;if(i?r=i(e,o):r=c.isURLSearchParams(e)?e.toString():new Yp(e,o).toString(n),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}a(qr,"buildURL");var Dd=class{static{a(this,"InterceptorManager")}constructor(){this.handlers=[]}use(e,o,n){return this.handlers.push({fulfilled:e,rejected:o,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,a(function(n){n!==null&&e(n)},"forEachHandler"))}},is=Dd;var Rn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Td from"crypto";import jd from"url";var Kp=jd.URLSearchParams;var as="abcdefghijklmnopqrstuvwxyz",Xp="0123456789",Zp={DIGIT:Xp,ALPHA:as,ALPHA_DIGIT:as+as.toUpperCase()+Xp},Vd=a((t=16,e=Zp.ALPHA_DIGIT)=>{let o="",{length:n}=e,i=new Uint32Array(t);Td.randomFillSync(i);for(let r=0;r<t;r++)o+=e[i[r]%n];return o},"generateString"),kp={isNode:!0,classes:{URLSearchParams:Kp,FormData:Zi,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:Zp,generateString:Vd,protocols:["http","https","file","data"]};var cs={};Lf(cs,{hasBrowserEnv:()=>ps,hasStandardBrowserEnv:()=>Md,hasStandardBrowserWebWorkerEnv:()=>_d,navigator:()=>ss,origin:()=>Ld});var ps=typeof window<"u"&&typeof document<"u",ss=typeof navigator=="object"&&navigator||void 0,Md=ps&&(!ss||["ReactNative","NativeScript","NS"].indexOf(ss.product)<0),_d=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ld=ps&&window.location.href||"http://localhost";var U={...cs,...kp};function fs(t,e){return Fr(t,new U.classes.URLSearchParams,{visitor:a(function(o,n,i,r){return U.isNode&&c.isBuffer(o)?(this.append(n,o.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},"visitor"),...e})}a(fs,"toURLEncodedForm");function Bd(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}a(Bd,"parsePropPath");function Ud(t){let e={},o=Object.keys(t),n,i=o.length,r;for(n=0;n<i;n++)r=o[n],e[r]=t[r];return e}a(Ud,"arrayToObject");function qd(t){function e(o,n,i,r){let s=o[r++];if(s==="__proto__")return!0;let p=Number.isFinite(+s),g=r>=o.length;return s=!s&&c.isArray(i)?i.length:s,g?(c.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!p):((!i[s]||!c.isObject(i[s]))&&(i[s]=[]),e(o,n,i[s],r)&&c.isArray(i[s])&&(i[s]=Ud(i[s])),!p)}if(a(e,"buildPath"),c.isFormData(t)&&c.isFunction(t.entries)){let o={};return c.forEachEntry(t,(n,i)=>{e(Bd(n),i,o,0)}),o}return null}a(qd,"formDataToJSON");var ki=qd;function Qd(t,e,o){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(o||JSON.stringify)(t)}a(Qd,"stringifySafely");var ds={transitional:Rn,adapter:["xhr","http","fetch"],transformRequest:[a(function(e,o){let n=o.getContentType()||"",i=n.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(ki(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let p;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return fs(e,this.formSerializer).toString();if((p=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){let g=this.env&&this.env.FormData;return Fr(p?{"files[]":e}:e,g&&new g,this.formSerializer)}}return r||i?(o.setContentType("application/json",!1),Qd(e)):e},"transformRequest")],transformResponse:[a(function(e){let o=this.transitional||ds.transitional,n=o&&o.forcedJSONParsing,i=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||i)){let s=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(p){if(s)throw p.name==="SyntaxError"?R.from(p,R.ERR_BAD_RESPONSE,this,null,this.response):p}}return e},"transformResponse")],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:a(function(e){return e>=200&&e<300},"validateStatus"),headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{ds.headers[t]={}});var Fn=ds;var Hd=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ec=a((t=>{let e={},o,n,i;return t&&t.split(`
2
3
  `).forEach(a(function(s){i=s.indexOf(":"),o=s.substring(0,i).trim().toLowerCase(),n=s.substring(i+1).trim(),!(!o||e[o]&&Hd[o])&&(o==="set-cookie"?e[o]?e[o].push(n):e[o]=[n]:e[o]=e[o]?e[o]+", "+n:n)},"parser")),e}),"default");var tc=Symbol("internals");function mi(t){return t&&String(t).trim().toLowerCase()}a(mi,"normalizeHeader");function ea(t){return t===!1||t==null?t:c.isArray(t)?t.map(ea):String(t)}a(ea,"normalizeValue");function $d(t){let e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=o.exec(t);)e[n[1]]=n[2];return e}a($d,"parseTokens");var Jd=a(t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()),"isValidHeaderName");function us(t,e,o,n,i){if(c.isFunction(n))return n.call(this,e,o);if(i&&(e=o),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}a(us,"matchHeaderValue");function Gd(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,o,n)=>o.toUpperCase()+n)}a(Gd,"formatHeader");function Wd(t,e){let o=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+o,{value:a(function(i,r,s){return this[n].call(this,e,i,r,s)},"value"),configurable:!0})})}a(Wd,"buildAccessors");var ta=class{static{a(this,"AxiosHeaders")}constructor(e){e&&this.set(e)}set(e,o,n){let i=this;function r(p,g,m){let v=mi(g);if(!v)throw new Error("header name must be a non-empty string");let N=c.findKey(i,v);(!N||i[N]===void 0||m===!0||m===void 0&&i[N]!==!1)&&(i[N||g]=ea(p))}a(r,"setHeader");let s=a((p,g)=>c.forEach(p,(m,v)=>r(m,v,g)),"setHeaders");if(c.isPlainObject(e)||e instanceof this.constructor)s(e,o);else if(c.isString(e)&&(e=e.trim())&&!Jd(e))s(ec(e),o);else if(c.isObject(e)&&c.isIterable(e)){let p={},g,m;for(let v of e){if(!c.isArray(v))throw TypeError("Object iterator must return a key-value pair");p[m=v[0]]=(g=p[m])?c.isArray(g)?[...g,v[1]]:[g,v[1]]:v[1]}s(p,o)}else e!=null&&r(o,e,n);return this}get(e,o){if(e=mi(e),e){let n=c.findKey(this,e);if(n){let i=this[n];if(!o)return i;if(o===!0)return $d(i);if(c.isFunction(o))return o.call(this,i,n);if(c.isRegExp(o))return o.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,o){if(e=mi(e),e){let n=c.findKey(this,e);return!!(n&&this[n]!==void 0&&(!o||us(this,this[n],n,o)))}return!1}delete(e,o){let n=this,i=!1;function r(s){if(s=mi(s),s){let p=c.findKey(n,s);p&&(!o||us(n,n[p],p,o))&&(delete n[p],i=!0)}}return a(r,"deleteHeader"),c.isArray(e)?e.forEach(r):r(e),i}clear(e){let o=Object.keys(this),n=o.length,i=!1;for(;n--;){let r=o[n];(!e||us(this,this[r],r,e,!0))&&(delete this[r],i=!0)}return i}normalize(e){let o=this,n={};return c.forEach(this,(i,r)=>{let s=c.findKey(n,r);if(s){o[s]=ea(i),delete o[r];return}let p=e?Gd(r):String(r).trim();p!==r&&delete o[r],o[p]=ea(i),n[p]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let o=Object.create(null);return c.forEach(this,(n,i)=>{n!=null&&n!==!1&&(o[i]=e&&c.isArray(n)?n.join(", "):n)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,o])=>e+": "+o).join(`
3
4
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...o){let n=new this(e);return o.forEach(i=>n.set(i)),n}static accessor(e){let n=(this[tc]=this[tc]={accessors:{}}).accessors,i=this.prototype;function r(s){let p=mi(s);n[p]||(Wd(i,s),n[p]=!0)}return a(r,"defineAccessor"),c.isArray(e)?e.forEach(r):r(e),this}};ta.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(ta.prototype,({value:t},e)=>{let o=e[0].toUpperCase()+e.slice(1);return{get:a(()=>t,"get"),set(n){this[o]=n}}});c.freezeMethods(ta);var ce=ta;function vi(t,e){let o=this||Fn,n=e||o,i=ce.from(n.headers),r=n.data;return c.forEach(t,a(function(p){r=p.call(o,r,i.normalize(),e?e.status:void 0)},"transform")),i.normalize(),r}a(vi,"transformData");function yi(t){return!!(t&&t.__CANCEL__)}a(yi,"isCancel");function oc(t,e,o){R.call(this,t??"canceled",R.ERR_CANCELED,e,o),this.name="CanceledError"}a(oc,"CanceledError");c.inherits(oc,R,{__CANCEL__:!0});var St=oc;function uo(t,e,o){let n=o.config.validateStatus;!o.status||!n||n(o.status)?t(o):e(new R("Request failed with status code "+o.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}a(uo,"settle");function ls(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}a(ls,"isAbsoluteURL");function ms(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}a(ms,"combineURLs");function Qr(t,e,o){let n=!ls(e);return t&&(n||o==!1)?ms(t,e):e}a(Qr,"buildFullPath");var mc=ts(Uf(),1),gc=ts(qf(),1);import du from"http";import uu from"https";import vc from"http2";import yc from"util";import zr from"zlib";var Hr="1.13.2";function gi(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}a(gi,"parseProtocol");var Yd=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function vs(t,e,o){let n=o&&o.Blob||U.classes.Blob,i=gi(t);if(e===void 0&&n&&(e=!0),i==="data"){t=i.length?t.slice(i.length+1):t;let r=Yd.exec(t);if(!r)throw new R("Invalid URL",R.ERR_INVALID_URL);let s=r[1],p=r[2],g=r[3],m=Buffer.from(decodeURIComponent(g),p?"base64":"utf8");if(e){if(!n)throw new R("Blob is not supported",R.ERR_NOT_SUPPORT);return new n([m],{type:s})}return m}throw new R("Unsupported protocol "+i,R.ERR_NOT_SUPPORT)}a(vs,"fromDataURI");import Ir from"stream";import Kd from"stream";var ys=Symbol("internals"),Xd=class extends Kd.Transform{static{a(this,"AxiosTransformStream")}constructor(e){e=c.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,i)=>!c.isUndefined(i[n])),super({readableHighWaterMark:e.chunkSize});let o=this[ys]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(e){let o=this[ys];return o.onReadCallback&&o.onReadCallback(),super._read(e)}_transform(e,o,n){let i=this[ys],r=i.maxRate,s=this.readableHighWaterMark,p=i.timeWindow,g=1e3/p,m=r/g,v=i.minChunkSize!==!1?Math.max(i.minChunkSize,m*.01):0,N=a((I,h)=>{let F=Buffer.byteLength(I);i.bytesSeen+=F,i.bytes+=F,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(I)?process.nextTick(h):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(h)}},"pushChunk"),b=a((I,h)=>{let F=Buffer.byteLength(I),C=null,Q=s,Y,B=0;if(r){let le=Date.now();(!i.ts||(B=le-i.ts)>=p)&&(i.ts=le,Y=m-i.bytes,i.bytes=Y<0?-Y:0,B=0),Y=m-i.bytes}if(r){if(Y<=0)return setTimeout(()=>{h(null,I)},p-B);Y<Q&&(Q=Y)}Q&&F>Q&&F-Q>v&&(C=I.subarray(Q),I=I.subarray(0,Q)),N(I,C?()=>{process.nextTick(h,null,C)}:h)},"transformChunk");b(e,a(function I(h,F){if(h)return n(h);F?b(F,I):n(null)},"transformNextChunk"))}},gs=Xd;import{EventEmitter as lu}from"events";import kd from"util";import{Readable as eu}from"stream";var{asyncIterator:rc}=Symbol,Zd=a(async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[rc]?yield*t[rc]():yield t},"readBlob"),oa=Zd;var tu=U.ALPHABET.ALPHA_DIGIT+"-_",hi=typeof TextEncoder=="function"?new TextEncoder:new kd.TextEncoder,$r=`\r
4
5
  `,ou=hi.encode($r),ru=2,nu=class{static{a(this,"FormDataPart")}constructor(e,o){let{escapeName:n}=this.constructor,i=c.isString(o),r=`Content-Disposition: form-data; name="${n(e)}"${!i&&o.name?`; filename="${n(o.name)}"`:""}${$r}`;i?o=hi.encode(String(o).replace(/\r?\n|\r\n?/g,$r)):r+=`Content-Type: ${o.type||"application/octet-stream"}${$r}`,this.headers=hi.encode(r+$r),this.contentLength=i?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+ru,this.name=e,this.value=o}async*encode(){yield this.headers;let{value:e}=this;c.isTypedArray(e)?yield e:yield*oa(e),yield ou}static escapeName(e){return String(e).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},iu=a((t,e,o)=>{let{tag:n="form-data-boundary",size:i=25,boundary:r=n+"-"+U.generateString(i,tu)}=o||{};if(!c.isFormData(t))throw TypeError("FormData instance required");if(r.length<1||r.length>70)throw Error("boundary must be 10-70 characters long");let s=hi.encode("--"+r+$r),p=hi.encode("--"+r+"--"+$r),g=p.byteLength,m=Array.from(t.entries()).map(([N,b])=>{let I=new nu(N,b);return g+=I.size,I});g+=s.byteLength*m.length,g=c.toFiniteNumber(g);let v={"Content-Type":`multipart/form-data; boundary=${r}`};return Number.isFinite(g)&&(v["Content-Length"]=g),e&&e(v),eu.from((async function*(){for(let N of m)yield s,yield*N.encode();yield p})())},"formDataToStream"),nc=iu;import au from"stream";var su=class extends au.Transform{static{a(this,"ZlibHeaderTransformStream")}__transform(e,o,n){this.push(e),n()}_transform(e,o,n){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,o)}this.__transform(e,o,n)}},ic=su;var pu=a((t,e)=>c.isAsyncFn(t)?function(...o){let n=o.pop();t.apply(this,o).then(i=>{try{e?n(null,...e(i)):n(null,i)}catch(r){n(r)}},n)}:t,"callbackify"),ac=pu;function cu(t,e){t=t||10;let o=new Array(t),n=new Array(t),i=0,r=0,s;return e=e!==void 0?e:1e3,a(function(g){let m=Date.now(),v=n[r];s||(s=m),o[i]=g,n[i]=m;let N=r,b=0;for(;N!==i;)b+=o[N++],N=N%t;if(i=(i+1)%t,i===r&&(r=(r+1)%t),m-s<e)return;let I=v&&m-v;return I?Math.round(b*1e3/I):void 0},"push")}a(cu,"speedometer");var sc=cu;function fu(t,e){let o=0,n=1e3/e,i,r,s=a((m,v=Date.now())=>{o=v,i=null,r&&(clearTimeout(r),r=null),t(...m)},"invoke");return[a((...m)=>{let v=Date.now(),N=v-o;N>=n?s(m,v):(i=m,r||(r=setTimeout(()=>{r=null,s(i)},n-N)))},"throttled"),a(()=>i&&s(i),"flush")]}a(fu,"throttle");var pc=fu;var Do=a((t,e,o=3)=>{let n=0,i=sc(50,250);return pc(r=>{let s=r.loaded,p=r.lengthComputable?r.total:void 0,g=s-n,m=i(g),v=s<=p;n=s;let N={loaded:s,total:p,progress:p?s/p:void 0,bytes:g,rate:m||void 0,estimated:m&&p&&v?(p-s)/m:void 0,event:r,lengthComputable:p!=null,[e?"download":"upload"]:!0};t(N)},o)},"progressEventReducer"),In=a((t,e)=>{let o=t!=null;return[n=>e[0]({lengthComputable:o,total:t,loaded:n}),e[1]]},"progressEventDecorator"),zn=a(t=>(...e)=>c.asap(()=>t(...e)),"asyncDecorator");function hs(t){if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let o=t.slice(5,e),n=t.slice(e+1);if(/;base64/i.test(o)){let r=n.length,s=n.length;for(let b=0;b<s;b++)if(n.charCodeAt(b)===37&&b+2<s){let I=n.charCodeAt(b+1),h=n.charCodeAt(b+2);(I>=48&&I<=57||I>=65&&I<=70||I>=97&&I<=102)&&(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(r-=2,b+=2)}let p=0,g=s-1,m=a(b=>b>=2&&n.charCodeAt(b-2)===37&&n.charCodeAt(b-1)===51&&(n.charCodeAt(b)===68||n.charCodeAt(b)===100),"tailIsPct3D");g>=0&&(n.charCodeAt(g)===61?(p++,g--):m(g)&&(p++,g-=3)),p===1&&g>=0&&(n.charCodeAt(g)===61||m(g))&&p++;let N=Math.floor(r/4)*3-(p||0);return N>0?N:0}return Buffer.byteLength(n,"utf8")}a(hs,"estimateDataURLDecodedBytes");var cc={flush:zr.constants.Z_SYNC_FLUSH,finishFlush:zr.constants.Z_SYNC_FLUSH},mu={flush:zr.constants.BROTLI_OPERATION_FLUSH,finishFlush:zr.constants.BROTLI_OPERATION_FLUSH},fc=c.isFunction(zr.createBrotliDecompress),{http:vu,https:yu}=gc.default,gu=/https:?/,dc=U.protocols.map(t=>t+":"),uc=a((t,[e,o])=>(t.on("end",o).on("error",o),e),"flushOnFinish"),hu=class{static{a(this,"Http2Sessions")}constructor(){this.sessions=Object.create(null)}getSession(e,o){o=Object.assign({sessionTimeout:1e3},o);let n=this.sessions[e];if(n){let v=n.length;for(let N=0;N<v;N++){let[b,I]=n[N];if(!b.destroyed&&!b.closed&&yc.isDeepStrictEqual(I,o))return b}}let i=vc.connect(e,o),r,s=a(()=>{if(r)return;r=!0;let v=n,N=v.length,b=N;for(;b--;)if(v[b][0]===i){N===1?delete this.sessions[e]:v.splice(b,1);return}},"removeSession"),p=i.request,{sessionTimeout:g}=o;if(g!=null){let v,N=0;i.request=function(){let b=p.apply(this,arguments);return N++,v&&(clearTimeout(v),v=null),b.once("close",()=>{--N||(v=setTimeout(()=>{v=null,s()},g))}),b}}i.once("close",s);let m=[i,o];return n?n.push(m):n=this.sessions[e]=[m],i}},Su=new hu;function Nu(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}a(Nu,"dispatchBeforeRedirect");function hc(t,e,o){let n=e;if(!n&&n!==!1){let i=mc.default.getProxyForUrl(o);i&&(n=new URL(i))}if(n){if(n.username&&(n.auth=(n.username||"")+":"+(n.password||"")),n.auth){(n.auth.username||n.auth.password)&&(n.auth=(n.auth.username||"")+":"+(n.auth.password||""));let r=Buffer.from(n.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+r}t.headers.host=t.hostname+(t.port?":"+t.port:"");let i=n.hostname||n.host;t.hostname=i,t.host=i,t.port=n.port,t.path=o,n.protocol&&(t.protocol=n.protocol.includes(":")?n.protocol:`${n.protocol}:`)}t.beforeRedirects.proxy=a(function(r){hc(r,e,r.href)},"beforeRedirect")}a(hc,"setProxy");var Cu=typeof process<"u"&&c.kindOf(process)==="process",bu=a(t=>new Promise((e,o)=>{let n,i,r=a((g,m)=>{i||(i=!0,n&&n(g,m))},"done"),s=a(g=>{r(g),e(g)},"_resolve"),p=a(g=>{r(g,!0),o(g)},"_reject");t(s,p,g=>n=g).catch(p)}),"wrapAsync"),Ru=a(({address:t,family:e})=>{if(!c.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},"resolveFamily"),lc=a((t,e)=>Ru(c.isObject(t)?t:{address:t,family:e}),"buildAddressEntry"),Fu={request(t,e){let o=t.protocol+"//"+t.hostname+":"+(t.port||80),{http2Options:n,headers:i}=t,r=Su.getSession(o,n),{HTTP2_HEADER_SCHEME:s,HTTP2_HEADER_METHOD:p,HTTP2_HEADER_PATH:g,HTTP2_HEADER_STATUS:m}=vc.constants,v={[s]:t.protocol.replace(":",""),[p]:t.method,[g]:t.path};c.forEach(i,(b,I)=>{I.charAt(0)!==":"&&(v[I]=b)});let N=r.request(v);return N.once("response",b=>{let I=N;b=Object.assign({},b);let h=b[m];delete b[m],I.headers=b,I.statusCode=+h,e(I)}),N}},Sc=Cu&&a(function(e){return bu(a(async function(n,i,r){let{data:s,lookup:p,family:g,httpVersion:m=1,http2Options:v}=e,{responseType:N,responseEncoding:b}=e,I=e.method.toUpperCase(),h,F=!1,C;if(m=+m,Number.isNaN(m))throw TypeError(`Invalid protocol version: '${e.httpVersion}' is not a number`);if(m!==1&&m!==2)throw TypeError(`Unsupported protocol version '${m}'`);let Q=m===2;if(p){let E=ac(p,O=>c.isArray(O)?O:[O]);p=a((O,G,gt)=>{E(O,G,(ve,jt,br)=>{if(ve)return gt(ve);let ft=c.isArray(jt)?jt.map(Qi=>lc(Qi)):[lc(jt,br)];G.all?gt(ve,ft):gt(ve,ft[0].address,ft[0].family)})},"lookup")}let Y=new lu;function B(E){try{Y.emit("abort",!E||E.type?new St(null,e,C):E)}catch(O){console.warn("emit error",O)}}a(B,"abort"),Y.once("abort",i);let le=a(()=>{e.cancelToken&&e.cancelToken.unsubscribe(B),e.signal&&e.signal.removeEventListener("abort",B),Y.removeAllListeners()},"onFinished");(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(B),e.signal&&(e.signal.aborted?B():e.signal.addEventListener("abort",B))),r((E,O)=>{if(h=!0,O){F=!0,le();return}let{data:G}=E;if(G instanceof Ir.Readable||G instanceof Ir.Duplex){let gt=Ir.finished(G,()=>{gt(),le()})}else le()});let pt=Qr(e.baseURL,e.url,e.allowAbsoluteUrls),me=new URL(pt,U.hasBrowserEnv?U.origin:void 0),xe=me.protocol||dc[0];if(xe==="data:"){if(e.maxContentLength>-1){let O=String(e.url||pt||"");if(hs(O)>e.maxContentLength)return i(new R("maxContentLength size of "+e.maxContentLength+" exceeded",R.ERR_BAD_RESPONSE,e))}let E;if(I!=="GET")return uo(n,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{E=vs(e.url,N==="blob",{Blob:e.env&&e.env.Blob})}catch(O){throw R.from(O,R.ERR_BAD_REQUEST,e)}return N==="text"?(E=E.toString(b),(!b||b==="utf8")&&(E=c.stripBOM(E))):N==="stream"&&(E=Ir.Readable.from(E)),uo(n,i,{data:E,status:200,statusText:"OK",headers:new ce,config:e})}if(dc.indexOf(xe)===-1)return i(new R("Unsupported protocol "+xe,R.ERR_BAD_REQUEST,e));let Me=ce.from(e.headers).normalize();Me.set("User-Agent","axios/"+Hr,!1);let{onUploadProgress:Nr,onDownloadProgress:yn}=e,Br=e.maxRate,Po,so;if(c.isSpecCompliantForm(s)){let E=Me.getContentType(/boundary=([-_\w\d]{10,70})/i);s=nc(s,O=>{Me.set(O)},{tag:`axios-${Hr}-boundary`,boundary:E&&E[1]||void 0})}else if(c.isFormData(s)&&c.isFunction(s.getHeaders)){if(Me.set(s.getHeaders()),!Me.hasContentLength())try{let E=await yc.promisify(s.getLength).call(s);Number.isFinite(E)&&E>=0&&Me.setContentLength(E)}catch{}}else if(c.isBlob(s)||c.isFile(s))s.size&&Me.setContentType(s.type||"application/octet-stream"),Me.setContentLength(s.size||0),s=Ir.Readable.from(oa(s));else if(s&&!c.isStream(s)){if(!Buffer.isBuffer(s))if(c.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(c.isString(s))s=Buffer.from(s,"utf-8");else return i(new R("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",R.ERR_BAD_REQUEST,e));if(Me.setContentLength(s.length,!1),e.maxBodyLength>-1&&s.length>e.maxBodyLength)return i(new R("Request body larger than maxBodyLength limit",R.ERR_BAD_REQUEST,e))}let Eo=c.toFiniteNumber(Me.getContentLength());c.isArray(Br)?(Po=Br[0],so=Br[1]):Po=so=Br,s&&(Nr||Po)&&(c.isStream(s)||(s=Ir.Readable.from(s,{objectMode:!1})),s=Ir.pipeline([s,new gs({maxRate:c.toFiniteNumber(Po)})],c.noop),Nr&&s.on("progress",uc(s,In(Eo,Do(zn(Nr),!1,3)))));let Cr;if(e.auth){let E=e.auth.username||"",O=e.auth.password||"";Cr=E+":"+O}if(!Cr&&me.username){let E=me.username,O=me.password;Cr=E+":"+O}Cr&&Me.delete("authorization");let yt;try{yt=qr(me.pathname+me.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(E){let O=new Error(E.message);return O.config=e,O.url=e.url,O.exists=!0,i(O)}Me.set("Accept-Encoding","gzip, compress, deflate"+(fc?", br":""),!1);let _e={path:yt,method:I,headers:Me.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:Cr,protocol:xe,family:g,beforeRedirect:Nu,beforeRedirects:{},http2Options:v};!c.isUndefined(p)&&(_e.lookup=p),e.socketPath?_e.socketPath=e.socketPath:(_e.hostname=me.hostname.startsWith("[")?me.hostname.slice(1,-1):me.hostname,_e.port=me.port,hc(_e,e.proxy,xe+"//"+me.hostname+(me.port?":"+me.port:"")+_e.path));let ct,gn=gu.test(_e.protocol);if(_e.agent=gn?e.httpsAgent:e.httpAgent,Q?ct=Fu:e.transport?ct=e.transport:e.maxRedirects===0?ct=gn?uu:du:(e.maxRedirects&&(_e.maxRedirects=e.maxRedirects),e.beforeRedirect&&(_e.beforeRedirects.config=e.beforeRedirect),ct=gn?yu:vu),e.maxBodyLength>-1?_e.maxBodyLength=e.maxBodyLength:_e.maxBodyLength=1/0,e.insecureHTTPParser&&(_e.insecureHTTPParser=e.insecureHTTPParser),C=ct.request(_e,a(function(O){if(C.destroyed)return;let G=[O],gt=c.toFiniteNumber(O.headers["content-length"]);if(yn||so){let ft=new gs({maxRate:c.toFiniteNumber(so)});yn&&ft.on("progress",uc(ft,In(gt,Do(zn(yn),!0,3)))),G.push(ft)}let ve=O,jt=O.req||C;if(e.decompress!==!1&&O.headers["content-encoding"])switch((I==="HEAD"||O.statusCode===204)&&delete O.headers["content-encoding"],(O.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":G.push(zr.createUnzip(cc)),delete O.headers["content-encoding"];break;case"deflate":G.push(new ic),G.push(zr.createUnzip(cc)),delete O.headers["content-encoding"];break;case"br":fc&&(G.push(zr.createBrotliDecompress(mu)),delete O.headers["content-encoding"])}ve=G.length>1?Ir.pipeline(G,c.noop):G[0];let br={status:O.statusCode,statusText:O.statusMessage,headers:new ce(O.headers),config:e,request:jt};if(N==="stream")br.data=ve,uo(n,i,br);else{let ft=[],Qi=0;ve.on("data",a(function(ot){ft.push(ot),Qi+=ot.length,e.maxContentLength>-1&&Qi>e.maxContentLength&&(F=!0,ve.destroy(),B(new R("maxContentLength size of "+e.maxContentLength+" exceeded",R.ERR_BAD_RESPONSE,e,jt)))},"handleStreamData")),ve.on("aborted",a(function(){if(F)return;let ot=new R("stream has been aborted",R.ERR_BAD_RESPONSE,e,jt);ve.destroy(ot),i(ot)},"handlerStreamAborted")),ve.on("error",a(function(ot){C.destroyed||i(R.from(ot,null,e,jt))},"handleStreamError")),ve.on("end",a(function(){try{let ot=ft.length===1?ft[0]:Buffer.concat(ft);N!=="arraybuffer"&&(ot=ot.toString(b),(!b||b==="utf8")&&(ot=c.stripBOM(ot))),br.data=ot}catch(ot){return i(R.from(ot,null,e,br.request,br))}uo(n,i,br)},"handleStreamEnd"))}Y.once("abort",ft=>{ve.destroyed||(ve.emit("error",ft),ve.destroy())})},"handleResponse")),Y.once("abort",E=>{C.close?C.close():C.destroy(E)}),C.on("error",a(function(O){i(R.from(O,null,e,C))},"handleRequestError")),C.on("socket",a(function(O){O.setKeepAlive(!0,1e3*60)},"handleRequestSocket")),e.timeout){let E=parseInt(e.timeout,10);if(Number.isNaN(E)){B(new R("error trying to parse `config.timeout` to int",R.ERR_BAD_OPTION_VALUE,e,C));return}C.setTimeout(E,a(function(){if(h)return;let G=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",gt=e.transitional||Rn;e.timeoutErrorMessage&&(G=e.timeoutErrorMessage),B(new R(G,gt.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,C))},"handleRequestTimeout"))}else C.setTimeout(0);if(c.isStream(s)){let E=!1,O=!1;s.on("end",()=>{E=!0}),s.once("error",G=>{O=!0,C.destroy(G)}),s.on("close",()=>{!E&&!O&&B(new St("Request stream has been aborted",e,C))}),s.pipe(C)}else s&&C.write(s),C.end()},"dispatchHttpRequest"))},"httpAdapter");var Nc=U.hasStandardBrowserEnv?((t,e)=>o=>(o=new URL(o,U.origin),t.protocol===o.protocol&&t.host===o.host&&(e||t.port===o.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0;var Cc=U.hasStandardBrowserEnv?{write(t,e,o,n,i,r,s){if(typeof document>"u")return;let p=[`${t}=${encodeURIComponent(e)}`];c.isNumber(o)&&p.push(`expires=${new Date(o).toUTCString()}`),c.isString(n)&&p.push(`path=${n}`),c.isString(i)&&p.push(`domain=${i}`),r===!0&&p.push("secure"),c.isString(s)&&p.push(`SameSite=${s}`),document.cookie=p.join("; ")},read(t){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};var bc=a(t=>t instanceof ce?{...t}:t,"headersToObject");function Vt(t,e){e=e||{};let o={};function n(m,v,N,b){return c.isPlainObject(m)&&c.isPlainObject(v)?c.merge.call({caseless:b},m,v):c.isPlainObject(v)?c.merge({},v):c.isArray(v)?v.slice():v}a(n,"getMergedValue");function i(m,v,N,b){if(c.isUndefined(v)){if(!c.isUndefined(m))return n(void 0,m,N,b)}else return n(m,v,N,b)}a(i,"mergeDeepProperties");function r(m,v){if(!c.isUndefined(v))return n(void 0,v)}a(r,"valueFromConfig2");function s(m,v){if(c.isUndefined(v)){if(!c.isUndefined(m))return n(void 0,m)}else return n(void 0,v)}a(s,"defaultToConfig2");function p(m,v,N){if(N in e)return n(m,v);if(N in t)return n(void 0,m)}a(p,"mergeDirectKeys");let g={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:p,headers:a((m,v,N)=>i(bc(m),bc(v),N,!0),"headers")};return c.forEach(Object.keys({...t,...e}),a(function(v){let N=g[v]||i,b=N(t[v],e[v],v);c.isUndefined(b)&&N!==p||(o[v]=b)},"computeConfigValue")),o}a(Vt,"mergeConfig");var ra=a((t=>{let e=Vt({},t),{data:o,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:s,auth:p}=e;if(e.headers=s=ce.from(s),e.url=qr(Qr(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),p&&s.set("Authorization","Basic "+btoa((p.username||"")+":"+(p.password?unescape(encodeURIComponent(p.password)):""))),c.isFormData(o)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(o.getHeaders)){let g=o.getHeaders(),m=["content-type","content-length"];Object.entries(g).forEach(([v,N])=>{m.includes(v.toLowerCase())&&s.set(v,N)})}}if(U.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&Nc(e.url))){let g=i&&r&&Cc.read(r);g&&s.set(i,g)}return e}),"default");var Iu=typeof XMLHttpRequest<"u",Rc=Iu&&function(t){return new Promise(a(function(o,n){let i=ra(t),r=i.data,s=ce.from(i.headers).normalize(),{responseType:p,onUploadProgress:g,onDownloadProgress:m}=i,v,N,b,I,h;function F(){I&&I(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(v),i.signal&&i.signal.removeEventListener("abort",v)}a(F,"done");let C=new XMLHttpRequest;C.open(i.method.toUpperCase(),i.url,!0),C.timeout=i.timeout;function Q(){if(!C)return;let B=ce.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),pt={data:!p||p==="text"||p==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:B,config:t,request:C};uo(a(function(xe){o(xe),F()},"_resolve"),a(function(xe){n(xe),F()},"_reject"),pt),C=null}a(Q,"onloadend"),"onloadend"in C?C.onloadend=Q:C.onreadystatechange=a(function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(Q)},"handleLoad"),C.onabort=a(function(){C&&(n(new R("Request aborted",R.ECONNABORTED,t,C)),C=null)},"handleAbort"),C.onerror=a(function(le){let pt=le&&le.message?le.message:"Network Error",me=new R(pt,R.ERR_NETWORK,t,C);me.event=le||null,n(me),C=null},"handleError"),C.ontimeout=a(function(){let le=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",pt=i.transitional||Rn;i.timeoutErrorMessage&&(le=i.timeoutErrorMessage),n(new R(le,pt.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,t,C)),C=null},"handleTimeout"),r===void 0&&s.setContentType(null),"setRequestHeader"in C&&c.forEach(s.toJSON(),a(function(le,pt){C.setRequestHeader(pt,le)},"setRequestHeader")),c.isUndefined(i.withCredentials)||(C.withCredentials=!!i.withCredentials),p&&p!=="json"&&(C.responseType=i.responseType),m&&([b,h]=Do(m,!0),C.addEventListener("progress",b)),g&&C.upload&&([N,I]=Do(g),C.upload.addEventListener("progress",N),C.upload.addEventListener("loadend",I)),(i.cancelToken||i.signal)&&(v=a(B=>{C&&(n(!B||B.type?new St(null,t,C):B),C.abort(),C=null)},"onCanceled"),i.cancelToken&&i.cancelToken.subscribe(v),i.signal&&(i.signal.aborted?v():i.signal.addEventListener("abort",v)));let Y=gi(i.url);if(Y&&U.protocols.indexOf(Y)===-1){n(new R("Unsupported protocol "+Y+":",R.ERR_BAD_REQUEST,t));return}C.send(r||null)},"dispatchXhrRequest"))};var zu=a((t,e)=>{let{length:o}=t=t?t.filter(Boolean):[];if(e||o){let n=new AbortController,i,r=a(function(m){if(!i){i=!0,p();let v=m instanceof Error?m:this.reason;n.abort(v instanceof R?v:new St(v instanceof Error?v.message:v))}},"onabort"),s=e&&setTimeout(()=>{s=null,r(new R(`timeout ${e} of ms exceeded`,R.ETIMEDOUT))},e),p=a(()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(m=>{m.unsubscribe?m.unsubscribe(r):m.removeEventListener("abort",r)}),t=null)},"unsubscribe");t.forEach(m=>m.addEventListener("abort",r));let{signal:g}=n;return g.unsubscribe=()=>c.asap(p),g}},"composeSignals"),Fc=zu;var Ou=a(function*(t,e){let o=t.byteLength;if(!e||o<e){yield t;return}let n=0,i;for(;n<o;)i=n+e,yield t.slice(n,i),n=i},"streamChunk"),xu=a(async function*(t,e){for await(let o of Au(t))yield*Ou(o,e)},"readBytes"),Au=a(async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:o,value:n}=await e.read();if(o)break;yield n}}finally{await e.cancel()}},"readStream"),Ss=a((t,e,o,n)=>{let i=xu(t,e),r=0,s,p=a(g=>{s||(s=!0,n&&n(g))},"_onFinish");return new ReadableStream({async pull(g){try{let{done:m,value:v}=await i.next();if(m){p(),g.close();return}let N=v.byteLength;if(o){let b=r+=N;o(b)}g.enqueue(new Uint8Array(v))}catch(m){throw p(m),m}},cancel(g){return p(g),i.return()}},{highWaterMark:2})},"trackStream");var Ic=64*1024,{isFunction:na}=c,wu=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:zc,TextEncoder:Oc}=c.global,xc=a((t,...e)=>{try{return!!t(...e)}catch{return!1}},"test"),Pu=a(t=>{t=c.merge.call({skipUndefined:!0},wu,t);let{fetch:e,Request:o,Response:n}=t,i=e?na(e):typeof fetch=="function",r=na(o),s=na(n);if(!i)return!1;let p=i&&na(zc),g=i&&(typeof Oc=="function"?(h=>F=>h.encode(F))(new Oc):async h=>new Uint8Array(await new o(h).arrayBuffer())),m=r&&p&&xc(()=>{let h=!1,F=new o(U.origin,{body:new zc,method:"POST",get duplex(){return h=!0,"half"}}).headers.has("Content-Type");return h&&!F}),v=s&&p&&xc(()=>c.isReadableStream(new n("").body)),N={stream:v&&(h=>h.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(h=>{!N[h]&&(N[h]=(F,C)=>{let Q=F&&F[h];if(Q)return Q.call(F);throw new R(`Response type '${h}' is not supported`,R.ERR_NOT_SUPPORT,C)})});let b=a(async h=>{if(h==null)return 0;if(c.isBlob(h))return h.size;if(c.isSpecCompliantForm(h))return(await new o(U.origin,{method:"POST",body:h}).arrayBuffer()).byteLength;if(c.isArrayBufferView(h)||c.isArrayBuffer(h))return h.byteLength;if(c.isURLSearchParams(h)&&(h=h+""),c.isString(h))return(await g(h)).byteLength},"getBodyLength"),I=a(async(h,F)=>{let C=c.toFiniteNumber(h.getContentLength());return C??b(F)},"resolveBodyLength");return async h=>{let{url:F,method:C,data:Q,signal:Y,cancelToken:B,timeout:le,onDownloadProgress:pt,onUploadProgress:me,responseType:xe,headers:Me,withCredentials:Nr="same-origin",fetchOptions:yn}=ra(h),Br=e||fetch;xe=xe?(xe+"").toLowerCase():"text";let Po=Fc([Y,B&&B.toAbortSignal()],le),so=null,Eo=Po&&Po.unsubscribe&&(()=>{Po.unsubscribe()}),Cr;try{if(me&&m&&C!=="get"&&C!=="head"&&(Cr=await I(Me,Q))!==0){let O=new o(F,{method:"POST",body:Q,duplex:"half"}),G;if(c.isFormData(Q)&&(G=O.headers.get("content-type"))&&Me.setContentType(G),O.body){let[gt,ve]=In(Cr,Do(zn(me)));Q=Ss(O.body,Ic,gt,ve)}}c.isString(Nr)||(Nr=Nr?"include":"omit");let yt=r&&"credentials"in o.prototype,_e={...yn,signal:Po,method:C.toUpperCase(),headers:Me.normalize().toJSON(),body:Q,duplex:"half",credentials:yt?Nr:void 0};so=r&&new o(F,_e);let ct=await(r?Br(so,yn):Br(F,_e)),gn=v&&(xe==="stream"||xe==="response");if(v&&(pt||gn&&Eo)){let O={};["status","statusText","headers"].forEach(jt=>{O[jt]=ct[jt]});let G=c.toFiniteNumber(ct.headers.get("content-length")),[gt,ve]=pt&&In(G,Do(zn(pt),!0))||[];ct=new n(Ss(ct.body,Ic,gt,()=>{ve&&ve(),Eo&&Eo()}),O)}xe=xe||"text";let E=await N[c.findKey(N,xe)||"text"](ct,h);return!gn&&Eo&&Eo(),await new Promise((O,G)=>{uo(O,G,{data:E,headers:ce.from(ct.headers),status:ct.status,statusText:ct.statusText,config:h,request:so})})}catch(yt){throw Eo&&Eo(),yt&&yt.name==="TypeError"&&/Load failed|fetch/i.test(yt.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,h,so),{cause:yt.cause||yt}):R.from(yt,yt&&yt.code,h,so)}}},"factory"),Eu=new Map,Ns=a(t=>{let e=t&&t.env||{},{fetch:o,Request:n,Response:i}=e,r=[n,i,o],s=r.length,p=s,g,m,v=Eu;for(;p--;)g=r[p],m=v.get(g),m===void 0&&v.set(g,m=p?new Map:Pu(e)),v=m;return m},"getFetch"),Zg=Ns();var Cs={http:Sc,xhr:Rc,fetch:{get:Ns}};c.forEach(Cs,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var Ac=a(t=>`- ${t}`,"renderReason"),ju=a(t=>c.isFunction(t)||t===null||t===!1,"isResolvedHandle");function Tu(t,e){t=c.isArray(t)?t:[t];let{length:o}=t,n,i,r={};for(let s=0;s<o;s++){n=t[s];let p;if(i=n,!ju(n)&&(i=Cs[(p=String(n)).toLowerCase()],i===void 0))throw new R(`Unknown adapter '${p}'`);if(i&&(c.isFunction(i)||(i=i.get(e))))break;r[p||"#"+s]=i}if(!i){let s=Object.entries(r).map(([g,m])=>`adapter ${g} `+(m===!1?"is not supported by the environment":"is not available in the build")),p=o?s.length>1?`since :
@@ -0,0 +1 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
@@ -1,4 +1,5 @@
1
- import{a as o,b as Xe,d as Z,f as Yx}from"./chunk-W6MRGYXP.mjs";var $t=Z((Dpe,OO)=>{"use strict";OO.exports={options:{usePureJavaScript:!1}}});var VO=Z((Rpe,LO)=>{"use strict";var k2={};LO.exports=k2;var kO={};k2.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=Ez(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var c=0,f=r[s];c<u.length;++c)f+=u[c]<<8,u[c]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as o,b as Xe,d as Z,f as Yx}from"./chunk-WEMHPBTC.mjs";var $t=Z((Dpe,OO)=>{"use strict";OO.exports={options:{usePureJavaScript:!1}}});var VO=Z((Rpe,LO)=>{"use strict";var k2={};LO.exports=k2;var kO={};k2.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=Ez(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var c=0,f=r[s];c<u.length;++c)f+=u[c]<<8,u[c]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
2
3
  `)}return n};k2.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=kO[e];if(!t){t=kO[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var c=0,f=u;c<a.length;++c)f+=a[c]*s,a[c]=f&255,f>>=8;for(;f>0;)a.push(f&255),f>>=8}for(var h=0;r[h]===i&&h<r.length-1;++h)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function Ez(r,e){var t=0,n=e.length,s=e.charAt(0),i=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<i.length;++a)u+=i[a]<<8,i[a]=u%n,u=u/n|0;for(;u>0;)i.push(u%n),u=u/n|0}var c="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)c+=s;for(t=i.length-1;t>=0;--t)c+=e[i[t]];return c}o(Ez,"_encodeWithByteBuffer")});var lr=Z((Ope,FO)=>{"use strict";var UO=$t(),jO=VO(),ne=FO.exports=UO.util=UO.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){ne.nextTick=process.nextTick,typeof setImmediate=="function"?ne.setImmediate=setImmediate:ne.setImmediate=ne.nextTick;return}if(typeof setImmediate=="function"){ne.setImmediate=function(){return setImmediate.apply(void 0,arguments)},ne.nextTick=function(u){return setImmediate(u)};return}if(ne.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(c){if(c.source===window&&c.data===r){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];ne.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(s,{attributes:!0});var i=ne.setImmediate;ne.setImmediate=function(c){Date.now()-t>15?(t=Date.now(),i(c)):(e.push(c),e.length===1&&s.setAttribute("a",n=!n))}}ne.nextTick=ne.setImmediate})();ne.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;ne.globalScope=(function(){return ne.isNodejs?global:typeof self>"u"?window:self})();ne.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};ne.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};ne.isArrayBufferView=function(r){return r&&ne.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function X0(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(X0,"_checkBitsParam");ne.ByteBuffer=L2;function L2(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(ne.isArrayBuffer(r)||ne.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof L2||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(L2,"ByteStringBuffer");ne.ByteStringBuffer=L2;var Az=4096;ne.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>Az&&(this.data.substr(0,1),this._constructedStringLength=0)};ne.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};ne.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};ne.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};ne.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};ne.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};ne.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(ne.encodeUtf8(r))};ne.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};ne.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};ne.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};ne.ByteStringBuffer.prototype.putInt=function(r,e){X0(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};ne.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};ne.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};ne.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};ne.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};ne.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};ne.ByteStringBuffer.prototype.getInt32=function(){var r=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,r};ne.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};ne.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};ne.ByteStringBuffer.prototype.getInt32Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,r};ne.ByteStringBuffer.prototype.getInt=function(r){X0(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};ne.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ne.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ne.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ne.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};ne.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};ne.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};ne.ByteStringBuffer.prototype.copy=function(){var r=ne.createBuffer(this.data);return r.read=this.read,r};ne.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};ne.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};ne.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};ne.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ne.ByteStringBuffer.prototype.toString=function(){return ne.decodeUtf8(this.bytes())};function Cz(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=ne.isArrayBuffer(r),n=ne.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(Cz,"DataBuffer");ne.DataBuffer=Cz;ne.DataBuffer.prototype.length=function(){return this.write-this.read};ne.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};ne.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};ne.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};ne.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};ne.DataBuffer.prototype.putBytes=function(r,e){if(ne.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var s=new Uint8Array(this.data.buffer,this.write);return s.set(t),this.write+=n,this}if(ne.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof ne.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&ne.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var s=new Uint8Array(r.data.byteLength,this.write);return s.set(t),this.write+=t.byteLength,this}if(r instanceof ne.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var i;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.hex.decode(r,i,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=ne.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=ne.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};ne.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};ne.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};ne.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};ne.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};ne.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};ne.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};ne.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};ne.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};ne.DataBuffer.prototype.putInt=function(r,e){X0(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};ne.DataBuffer.prototype.putSignedInt=function(r,e){return X0(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};ne.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};ne.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};ne.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};ne.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};ne.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};ne.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};ne.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};ne.DataBuffer.prototype.getInt=function(r){X0(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};ne.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ne.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ne.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ne.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};ne.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};ne.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};ne.DataBuffer.prototype.copy=function(){return new ne.DataBuffer(this)};ne.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};ne.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};ne.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};ne.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ne.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return ne.binary.raw.encode(e);if(r==="hex")return ne.binary.hex.encode(e);if(r==="base64")return ne.binary.base64.encode(e);if(r==="utf8")return ne.text.utf8.decode(e);if(r==="utf16")return ne.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};ne.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=ne.encodeUtf8(r)),new ne.ByteBuffer(r)};ne.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};ne.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,u=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=i,i="",u=0),i+=String.fromCharCode(s),++u;return n+=i,n};ne.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};ne.bytesToHex=function(r){return ne.createBuffer(r).toHex()};ne.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var Du="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ru=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],MO="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ne.encode64=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.length;)s=r.charCodeAt(u++),i=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=Du.charAt(s>>2),t+=Du.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=Du.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":Du.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
4
  `,t=t.substr(e));return n+=t,n};ne.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=Ru[r.charCodeAt(a++)-43],n=Ru[r.charCodeAt(a++)-43],s=Ru[r.charCodeAt(a++)-43],i=Ru[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),s!==64&&(e+=String.fromCharCode((n&15)<<4|s>>2),i!==64&&(e+=String.fromCharCode((s&3)<<6|i)));return e};ne.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};ne.decodeUtf8=function(r){return decodeURIComponent(escape(r))};ne.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:jO.encode,decode:jO.decode}};ne.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};ne.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};ne.binary.hex.encode=ne.bytesToHex;ne.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var s=0,i=t;for(r.length&1&&(s=1,n[i++]=parseInt(r[0],16));s<r.length;s+=2)n[i++]=parseInt(r.substr(s,2),16);return e?i-t:n};ne.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.byteLength;)s=r[u++],i=r[u++],a=r[u++],t+=Du.charAt(s>>2),t+=Du.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=Du.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":Du.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
4
5
  `,t=t.substr(e));return n+=t,n};ne.binary.base64.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/4)*3)),r=r.replace(/[^A-Za-z0-9\+\/\=]/g,""),t=t||0;for(var s,i,a,u,c=0,f=t;c<r.length;)s=Ru[r.charCodeAt(c++)-43],i=Ru[r.charCodeAt(c++)-43],a=Ru[r.charCodeAt(c++)-43],u=Ru[r.charCodeAt(c++)-43],n[f++]=s<<2|i>>4,a!==64&&(n[f++]=(i&15)<<4|a>>2,u!==64&&(n[f++]=(a&3)<<6|u));return e?f-t:n.subarray(0,f)};ne.binary.base58.encode=function(r,e){return ne.binary.baseN.encode(r,MO,e)};ne.binary.base58.decode=function(r,e){return ne.binary.baseN.decode(r,MO,e)};ne.text={utf8:{},utf16:{}};ne.text.utf8.encode=function(r,e,t){r=ne.encodeUtf8(r);var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};ne.text.utf8.decode=function(r){return ne.decodeUtf8(String.fromCharCode.apply(null,r))};ne.text.utf16.encode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length*2));var s=new Uint16Array(n.buffer);t=t||0;for(var i=t,a=t,u=0;u<r.length;++u)s[a++]=r.charCodeAt(u),i+=2;return e?i-t:n};ne.text.utf16.decode=function(r){return String.fromCharCode.apply(null,new Uint16Array(r.buffer))};ne.deflate=function(r,e,t){if(e=ne.decode64(r.deflate(ne.encode64(e)).rval),t){var n=2,s=e.charCodeAt(1);s&32&&(n=6),e=e.substring(n,e.length-4)}return e};ne.inflate=function(r,e,t){var n=r.inflate(ne.encode64(e)).rval;return n===null?null:ne.decode64(n)};var V2=o(function(r,e,t){if(!r)throw new Error("WebStorage not available.");var n;if(t===null?n=r.removeItem(e):(t=ne.encode64(JSON.stringify(t)),n=r.setItem(e,t)),typeof n<"u"&&n.rval!==!0){var s=new Error(n.error.message);throw s.id=n.error.id,s.name=n.error.name,s}},"_setStorageObject"),U2=o(function(r,e){if(!r)throw new Error("WebStorage not available.");var t=r.getItem(e);if(r.init)if(t.rval===null){if(t.error){var n=new Error(t.error.message);throw n.id=t.error.id,n.name=t.error.name,n}t=null}else t=t.rval;return t!==null&&(t=JSON.parse(ne.decode64(t))),t},"_getStorageObject"),Nz=o(function(r,e,t,n){var s=U2(r,e);s===null&&(s={}),s[t]=n,V2(r,e,s)},"_setItem"),Tz=o(function(r,e,t){var n=U2(r,e);return n!==null&&(n=t in n?n[t]:null),n},"_getItem"),Iz=o(function(r,e,t){var n=U2(r,e);if(n!==null&&t in n){delete n[t];var s=!0;for(var i in n){s=!1;break}s&&(n=null),V2(r,e,n)}},"_removeItem"),_z=o(function(r,e){V2(r,e,null)},"_clearItems"),cw=o(function(r,e,t){var n=null;typeof t>"u"&&(t=["web","flash"]);var s,i=!1,a=null;for(var u in t){s=t[u];try{if(s==="flash"||s==="both"){if(e[0]===null)throw new Error("Flash local storage not available.");n=r.apply(this,e),i=s==="flash"}(s==="web"||s==="both")&&(e[0]=localStorage,n=r.apply(this,e),i=!0)}catch(c){a=c}if(i)break}if(!i)throw a;return n},"_callStorageFunction");ne.setItem=function(r,e,t,n,s){cw(Nz,arguments,s)};ne.getItem=function(r,e,t,n){return cw(Tz,arguments,n)};ne.removeItem=function(r,e,t,n){cw(Iz,arguments,n)};ne.clearItems=function(r,e,t){cw(_z,arguments,t)};ne.isEmpty=function(r){for(var e in r)if(r.hasOwnProperty(e))return!1;return!0};ne.format=function(r){for(var e=/%./g,t,n,s=0,i=[],a=0;t=e.exec(r);){n=r.substring(a,e.lastIndex-2),n.length>0&&i.push(n),a=e.lastIndex;var u=t[0][1];switch(u){case"s":case"o":s<arguments.length?i.push(arguments[s+++1]):i.push("<?>");break;case"%":i.push("%");break;default:i.push("<%"+u+"?>")}}return i.push(r.substring(a)),i.join("")};ne.formatNumber=function(r,e,t,n){var s=r,i=isNaN(e=Math.abs(e))?2:e,a=t===void 0?",":t,u=n===void 0?".":n,c=s<0?"-":"",f=parseInt(s=Math.abs(+s||0).toFixed(i),10)+"",h=f.length>3?f.length%3:0;return c+(h?f.substr(0,h)+u:"")+f.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+u)+(i?a+Math.abs(s-f).toFixed(i).slice(2):"")};ne.formatSize=function(r){return r>=1073741824?r=ne.formatNumber(r/1073741824,2,".","")+" GiB":r>=1048576?r=ne.formatNumber(r/1048576,2,".","")+" MiB":r>=1024?r=ne.formatNumber(r/1024,0)+" KiB":r=ne.formatNumber(r,0)+" bytes",r};ne.bytesFromIP=function(r){return r.indexOf(".")!==-1?ne.bytesFromIPv4(r):r.indexOf(":")!==-1?ne.bytesFromIPv6(r):null};ne.bytesFromIPv4=function(r){if(r=r.split("."),r.length!==4)return null;for(var e=ne.createBuffer(),t=0;t<r.length;++t){var n=parseInt(r[t],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()};ne.bytesFromIPv6=function(r){var e=0;r=r.split(":").filter(function(a){return a.length===0&&++e,!0});for(var t=(8-r.length+e)*2,n=ne.createBuffer(),s=0;s<8;++s){if(!r[s]||r[s].length===0){n.fillWithByte(0,t),t=0;continue}var i=ne.hexToBytes(r[s]);i.length<2&&n.putByte(0),n.putBytes(i)}return n.getBytes()};ne.bytesToIP=function(r){return r.length===4?ne.bytesToIPv4(r):r.length===16?ne.bytesToIPv6(r):null};ne.bytesToIPv4=function(r){if(r.length!==4)return null;for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e.join(".")};ne.bytesToIPv6=function(r){if(r.length!==16)return null;for(var e=[],t=[],n=0,s=0;s<r.length;s+=2){for(var i=ne.bytesToHex(r[s]+r[s+1]);i[0]==="0"&&i!=="0";)i=i.substr(1);if(i==="0"){var a=t[t.length-1],u=e.length;!a||u!==a.end+1?t.push({start:u,end:u}):(a.end=u,a.end-a.start>t[n].end-t[n].start&&(n=t.length-1))}e.push(i)}if(t.length>0){var c=t[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),c.start===0&&e.unshift(""),c.end===7&&e.push(""))}return e.join(":")};ne.estimateCores=function(r,e){if(typeof r=="function"&&(e=r,r={}),r=r||{},"cores"in ne&&!r.update)return e(null,ne.cores);if(typeof navigator<"u"&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return ne.cores=navigator.hardwareConcurrency,e(null,ne.cores);if(typeof Worker>"u")return ne.cores=1,e(null,ne.cores);if(typeof Blob>"u")return ne.cores=2,e(null,ne.cores);var t=URL.createObjectURL(new Blob(["(",(function(){self.addEventListener("message",function(a){for(var u=Date.now(),c=u+4;Date.now()<c;);self.postMessage({st:u,et:c})})}).toString(),")()"],{type:"application/javascript"}));n([],5,16);function n(a,u,c){if(u===0){var f=Math.floor(a.reduce(function(h,m){return h+m},0)/a.length);return ne.cores=Math.max(1,f),URL.revokeObjectURL(t),e(null,ne.cores)}s(c,function(h,m){a.push(i(c,m)),n(a,u-1,c)})}o(n,"sample");function s(a,u){for(var c=[],f=[],h=0;h<a;++h){var m=new Worker(t);m.addEventListener("message",function(g){if(f.push(g.data),f.length===a){for(var x=0;x<a;++x)c[x].terminate();u(null,f)}}),c.push(m)}for(var h=0;h<a;++h)c[h].postMessage(h)}o(s,"map");function i(a,u){for(var c=[],f=0;f<a;++f)for(var h=u[f],m=c[f]=[],g=0;g<a;++g)if(f!==g){var x=u[g];(h.st>x.st&&h.st<x.et||x.st>h.st&&x.st<h.et)&&m.push(g)}return c.reduce(function(v,w){return Math.max(v,w.length)},0)}o(i,"reduce")}});var lw=Z((Lpe,qO)=>{"use strict";var Tn=$t();lr();qO.exports=Tn.cipher=Tn.cipher||{};Tn.cipher.algorithms=Tn.cipher.algorithms||{};Tn.cipher.createCipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Tn.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Tn.cipher.BlockCipher({algorithm:t,key:e,decrypt:!1})};Tn.cipher.createDecipher=function(r,e){var t=r;if(typeof t=="string"&&(t=Tn.cipher.getAlgorithm(t),t&&(t=t())),!t)throw new Error("Unsupported algorithm: "+r);return new Tn.cipher.BlockCipher({algorithm:t,key:e,decrypt:!0})};Tn.cipher.registerAlgorithm=function(r,e){r=r.toUpperCase(),Tn.cipher.algorithms[r]=e};Tn.cipher.getAlgorithm=function(r){return r=r.toUpperCase(),r in Tn.cipher.algorithms?Tn.cipher.algorithms[r]:null};var j2=Tn.cipher.BlockCipher=function(r){this.algorithm=r.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=r.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=r.decrypt,this.algorithm.initialize(r)};j2.prototype.start=function(r){r=r||{};var e={};for(var t in r)e[t]=r[t];e.decrypt=this._decrypt,this._finish=!1,this._input=Tn.util.createBuffer(),this.output=r.output||Tn.util.createBuffer(),this.mode.start(e)};j2.prototype.update=function(r){for(r&&this._input.putBuffer(r);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};j2.prototype.finish=function(r){r&&(this.mode.name==="ECB"||this.mode.name==="CBC")&&(this.mode.pad=function(t){return r(this.blockSize,t,!1)},this.mode.unpad=function(t){return r(this.blockSize,t,!0)});var e={};return e.decrypt=this._decrypt,e.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,e)||(this._finish=!0,this.update(),this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,e))||this.mode.afterFinish&&!this.mode.afterFinish(this.output,e))}});var F2=Z((Vpe,HO)=>{"use strict";var In=$t();lr();In.cipher=In.cipher||{};var Jt=HO.exports=In.cipher.modes=In.cipher.modes||{};Jt.ecb=function(r){r=r||{},this.name="ECB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Jt.ecb.prototype.start=function(r){};Jt.ecb.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};Jt.ecb.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n])};Jt.ecb.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};Jt.ecb.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};Jt.cbc=function(r){r=r||{},this.name="CBC",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)};Jt.cbc.prototype.start=function(r){if(r.iv===null){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in r)this._iv=fw(r.iv,this.blockSize),this._prev=this._iv.slice(0);else throw new Error("Invalid IV parameter.")};Jt.cbc.prototype.encrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^r.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._outBlock[n]);this._prev=this._outBlock};Jt.cbc.prototype.decrypt=function(r,e,t){if(r.length()<this.blockSize&&!(t&&r.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=r.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(var n=0;n<this._ints;++n)e.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)};Jt.cbc.prototype.pad=function(r,e){var t=r.length()===this.blockSize?this.blockSize:this.blockSize-r.length();return r.fillWithByte(t,t),!0};Jt.cbc.prototype.unpad=function(r,e){if(e.overflow>0)return!1;var t=r.length(),n=r.at(t-1);return n>this.blockSize<<2?!1:(r.truncate(n),!0)};Jt.cfb=function(r){r=r||{},this.name="CFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=In.util.createBuffer(),this._partialBytes=0};Jt.cfb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=fw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Jt.cfb.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32()^this._outBlock[s],e.putInt32(this._inBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32()^this._outBlock[s],this._partialOutput.putInt32(this._partialBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Jt.cfb.prototype.decrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)this._inBlock[s]=r.getInt32(),e.putInt32(this._inBlock[s]^this._outBlock[s]);return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialBlock[s]=r.getInt32(),this._partialOutput.putInt32(this._partialBlock[s]^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._partialBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Jt.ofb=function(r){r=r||{},this.name="OFB",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=In.util.createBuffer(),this._partialBytes=0};Jt.ofb.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=fw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Jt.ofb.prototype.encrypt=function(r,e,t){var n=r.length();if(r.length()===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]),this._inBlock[s]=this._outBlock[s];return}var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0)r.read-=this.blockSize;else for(var s=0;s<this._ints;++s)this._inBlock[s]=this._outBlock[s];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0};Jt.ofb.prototype.decrypt=Jt.ofb.prototype.encrypt;Jt.ctr=function(r){r=r||{},this.name="CTR",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=In.util.createBuffer(),this._partialBytes=0};Jt.ctr.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");this._iv=fw(r.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0};Jt.ctr.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize)for(var s=0;s<this._ints;++s)e.putInt32(r.getInt32()^this._outBlock[s]);else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i>0&&(r.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}hw(this._inBlock)};Jt.ctr.prototype.decrypt=Jt.ctr.prototype.encrypt;Jt.gcm=function(r){r=r||{},this.name="GCM",this.cipher=r.cipher,this.blockSize=r.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=In.util.createBuffer(),this._partialBytes=0,this._R=3774873600};Jt.gcm.prototype.start=function(r){if(!("iv"in r))throw new Error("Invalid IV parameter.");var e=In.util.createBuffer(r.iv);this._cipherLength=0;var t;if("additionalData"in r?t=In.util.createBuffer(r.additionalData):t=In.util.createBuffer(),"tagLength"in r?this._tagLength=r.tagLength:this._tagLength=128,this._tag=null,r.decrypt&&(this._tag=In.util.createBuffer(r.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var n=e.length();if(n===12)this._j0=[e.getInt32(),e.getInt32(),e.getInt32(),1];else{for(this._j0=[0,0,0,0];e.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(M2(n*8)))}this._inBlock=this._j0.slice(0),hw(this._inBlock),this._partialBytes=0,t=In.util.createBuffer(t),this._aDataLength=M2(t.length()*8);var s=t.length()%this.blockSize;for(s&&t.fillWithByte(0,this.blockSize-s),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])};Jt.gcm.prototype.encrypt=function(r,e,t){var n=r.length();if(n===0)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),this._partialBytes===0&&n>=this.blockSize){for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^=r.getInt32());this._cipherLength+=this.blockSize}else{var i=(this.blockSize-n)%this.blockSize;i>0&&(i=this.blockSize-i),this._partialOutput.clear();for(var s=0;s<this._ints;++s)this._partialOutput.putInt32(r.getInt32()^this._outBlock[s]);if(i<=0||t){if(t){var a=n%this.blockSize;this._cipherLength+=a,this._partialOutput.truncate(this.blockSize-a)}else this._cipherLength+=this.blockSize;for(var s=0;s<this._ints;++s)this._outBlock[s]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!t)return r.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),hw(this._inBlock)};Jt.gcm.prototype.decrypt=function(r,e,t){var n=r.length();if(n<this.blockSize&&!(t&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),hw(this._inBlock),this._hashBlock[0]=r.getInt32(),this._hashBlock[1]=r.getInt32(),this._hashBlock[2]=r.getInt32(),this._hashBlock[3]=r.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var s=0;s<this._ints;++s)e.putInt32(this._outBlock[s]^this._hashBlock[s]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize};Jt.gcm.prototype.afterFinish=function(r,e){var t=!0;e.decrypt&&e.overflow&&r.truncate(this.blockSize-e.overflow),this.tag=In.util.createBuffer();var n=this._aDataLength.concat(M2(this._cipherLength*8));this._s=this.ghash(this._hashSubkey,this._s,n);var s=[];this.cipher.encrypt(this._j0,s);for(var i=0;i<this._ints;++i)this.tag.putInt32(this._s[i]^s[i]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),e.decrypt&&this.tag.bytes()!==this._tag&&(t=!1),t};Jt.gcm.prototype.multiply=function(r,e){for(var t=[0,0,0,0],n=e.slice(0),s=0;s<128;++s){var i=r[s/32|0]&1<<31-s%32;i&&(t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]),this.pow(n,n)}return t};Jt.gcm.prototype.pow=function(r,e){for(var t=r[3]&1,n=3;n>0;--n)e[n]=r[n]>>>1|(r[n-1]&1)<<31;e[0]=r[0]>>>1,t&&(e[0]^=this._R)};Jt.gcm.prototype.tableMultiply=function(r){for(var e=[0,0,0,0],t=0;t<32;++t){var n=t/8|0,s=r[n]>>>(7-t%8)*4&15,i=this._m[t][s];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e};Jt.gcm.prototype.ghash=function(r,e,t){return e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3],this.tableMultiply(e)};Jt.gcm.prototype.generateHashTable=function(r,e){for(var t=8/e,n=4*t,s=16*t,i=new Array(s),a=0;a<s;++a){var u=[0,0,0,0],c=a/n|0,f=(n-1-a%n)*e;u[c]=1<<e-1<<f,i[a]=this.generateSubHashTable(this.multiply(u,r),e)}return i};Jt.gcm.prototype.generateSubHashTable=function(r,e){var t=1<<e,n=t>>>1,s=new Array(t);s[n]=r.slice(0);for(var i=n>>>1;i>0;)this.pow(s[2*i],s[i]=[]),i>>=1;for(i=2;i<n;){for(var a=1;a<i;++a){var u=s[i],c=s[a];s[i+a]=[u[0]^c[0],u[1]^c[1],u[2]^c[2],u[3]^c[3]]}i*=2}for(s[0]=[0,0,0,0],i=n+1;i<t;++i){var f=s[i^n];s[i]=[r[0]^f[0],r[1]^f[1],r[2]^f[2],r[3]^f[3]]}return s};function fw(r,e){if(typeof r=="string"&&(r=In.util.createBuffer(r)),In.util.isArray(r)&&r.length>4){var t=r;r=In.util.createBuffer();for(var n=0;n<t.length;++n)r.putByte(t[n])}if(r.length()<e)throw new Error("Invalid IV length; got "+r.length()+" bytes and expected "+e+" bytes.");if(!In.util.isArray(r)){for(var s=[],i=e/4,n=0;n<i;++n)s.push(r.getInt32());r=s}return r}o(fw,"transformIV");function hw(r){r[r.length-1]=r[r.length-1]+1&4294967295}o(hw,"inc32");function M2(r){return[r/4294967296|0,r&4294967295]}o(M2,"from64To32")});var Pu=Z((jpe,XO)=>{"use strict";var Dr=$t();lw();F2();lr();XO.exports=Dr.aes=Dr.aes||{};Dr.aes.startEncrypting=function(r,e,t,n){var s=pw({key:r,output:t,decrypt:!1,mode:n});return s.start(e),s};Dr.aes.createEncryptionCipher=function(r,e){return pw({key:r,output:null,decrypt:!1,mode:e})};Dr.aes.startDecrypting=function(r,e,t,n){var s=pw({key:r,output:t,decrypt:!0,mode:n});return s.start(e),s};Dr.aes.createDecryptionCipher=function(r,e){return pw({key:r,output:null,decrypt:!0,mode:e})};Dr.aes.Algorithm=function(r,e){K2||$O();var t=this;t.name=r,t.mode=new e({blockSize:16,cipher:{encrypt:o(function(n,s){return H2(t._w,n,s,!1)},"encrypt"),decrypt:o(function(n,s){return H2(t._w,n,s,!0)},"decrypt")}}),t._init=!1};Dr.aes.Algorithm.prototype.initialize=function(r){if(!this._init){var e=r.key,t;if(typeof e=="string"&&(e.length===16||e.length===24||e.length===32))e=Dr.util.createBuffer(e);else if(Dr.util.isArray(e)&&(e.length===16||e.length===24||e.length===32)){t=e,e=Dr.util.createBuffer();for(var n=0;n<t.length;++n)e.putByte(t[n])}if(!Dr.util.isArray(e)){t=e,e=[];var s=t.length();if(s===16||s===24||s===32){s=s>>>2;for(var n=0;n<s;++n)e.push(t.getInt32())}}if(!Dr.util.isArray(e)||!(e.length===4||e.length===6||e.length===8))throw new Error("Invalid key parameter.");var i=this.mode.name,a=["CFB","OFB","CTR","GCM"].indexOf(i)!==-1;this._w=GO(e,r.decrypt&&!a),this._init=!0}};Dr.aes._expandKey=function(r,e){return K2||$O(),GO(r,e)};Dr.aes._updateBlock=H2;ip("AES-ECB",Dr.cipher.modes.ecb);ip("AES-CBC",Dr.cipher.modes.cbc);ip("AES-CFB",Dr.cipher.modes.cfb);ip("AES-OFB",Dr.cipher.modes.ofb);ip("AES-CTR",Dr.cipher.modes.ctr);ip("AES-GCM",Dr.cipher.modes.gcm);function ip(r,e){var t=o(function(){return new Dr.aes.Algorithm(r,e)},"factory");Dr.cipher.registerAlgorithm(r,t)}o(ip,"registerAlgorithm");var K2=!1,sp=4,gs,q2,KO,Il,Zi;function $O(){K2=!0,KO=[0,1,2,4,8,16,32,64,128,27,54];for(var r=new Array(256),e=0;e<128;++e)r[e]=e<<1,r[e+128]=e+128<<1^283;gs=new Array(256),q2=new Array(256),Il=new Array(4),Zi=new Array(4);for(var e=0;e<4;++e)Il[e]=new Array(256),Zi[e]=new Array(256);for(var t=0,n=0,s,i,a,u,c,f,h,e=0;e<256;++e){u=n^n<<1^n<<2^n<<3^n<<4,u=u>>8^u&255^99,gs[t]=u,q2[u]=t,c=r[u],s=r[t],i=r[s],a=r[i],f=c<<24^u<<16^u<<8^(u^c),h=(s^i^a)<<24^(t^a)<<16^(t^i^a)<<8^(t^s^a);for(var m=0;m<4;++m)Il[m][t]=f,Zi[m][u]=h,f=f<<24|f>>>8,h=h<<24|h>>>8;t===0?t=n=1:(t=s^r[r[r[s^a]]],n^=r[r[n]])}}o($O,"initialize");function GO(r,e){for(var t=r.slice(0),n,s=1,i=t.length,a=i+6+1,u=sp*a,c=i;c<u;++c)n=t[c-1],c%i===0?(n=gs[n>>>16&255]<<24^gs[n>>>8&255]<<16^gs[n&255]<<8^gs[n>>>24]^KO[s]<<24,s++):i>6&&c%i===4&&(n=gs[n>>>24]<<24^gs[n>>>16&255]<<16^gs[n>>>8&255]<<8^gs[n&255]),t[c]=t[c-i]^n;if(e){var f,h=Zi[0],m=Zi[1],g=Zi[2],x=Zi[3],v=t.slice(0);u=t.length;for(var c=0,w=u-sp;c<u;c+=sp,w-=sp)if(c===0||c===u-sp)v[c]=t[w],v[c+1]=t[w+3],v[c+2]=t[w+2],v[c+3]=t[w+1];else for(var S=0;S<sp;++S)f=t[w+S],v[c+(3&-S)]=h[gs[f>>>24]]^m[gs[f>>>16&255]]^g[gs[f>>>8&255]]^x[gs[f&255]];t=v}return t}o(GO,"_expandKey");function H2(r,e,t,n){var s=r.length/4-1,i,a,u,c,f;n?(i=Zi[0],a=Zi[1],u=Zi[2],c=Zi[3],f=q2):(i=Il[0],a=Il[1],u=Il[2],c=Il[3],f=gs);var h,m,g,x,v,w,S;h=e[0]^r[0],m=e[n?3:1]^r[1],g=e[2]^r[2],x=e[n?1:3]^r[3];for(var A=3,T=1;T<s;++T)v=i[h>>>24]^a[m>>>16&255]^u[g>>>8&255]^c[x&255]^r[++A],w=i[m>>>24]^a[g>>>16&255]^u[x>>>8&255]^c[h&255]^r[++A],S=i[g>>>24]^a[x>>>16&255]^u[h>>>8&255]^c[m&255]^r[++A],x=i[x>>>24]^a[h>>>16&255]^u[m>>>8&255]^c[g&255]^r[++A],h=v,m=w,g=S;t[0]=f[h>>>24]<<24^f[m>>>16&255]<<16^f[g>>>8&255]<<8^f[x&255]^r[++A],t[n?3:1]=f[m>>>24]<<24^f[g>>>16&255]<<16^f[x>>>8&255]<<8^f[h&255]^r[++A],t[2]=f[g>>>24]<<24^f[x>>>16&255]<<16^f[h>>>8&255]<<8^f[m&255]^r[++A],t[n?1:3]=f[x>>>24]<<24^f[h>>>16&255]<<16^f[m>>>8&255]<<8^f[g&255]^r[++A]}o(H2,"_updateBlock");function pw(r){r=r||{};var e=(r.mode||"CBC").toUpperCase(),t="AES-"+e,n;r.decrypt?n=Dr.cipher.createDecipher(t,r.key):n=Dr.cipher.createCipher(t,r.key);var s=n.start;return n.start=function(i,a){var u=null;a instanceof Dr.util.ByteBuffer&&(u=a,a={}),a=a||{},a.output=u,a.iv=i,s.call(n,a)},n}o(pw,"_createCipher")});var Ou=Z((Fpe,WO)=>{"use strict";var W0=$t();W0.pki=W0.pki||{};var $2=WO.exports=W0.pki.oids=W0.oids=W0.oids||{};function Ue(r,e){$2[r]=e,$2[e]=r}o(Ue,"_IN");function xr(r,e){$2[r]=e}o(xr,"_I_");Ue("1.2.840.113549.1.1.1","rsaEncryption");Ue("1.2.840.113549.1.1.4","md5WithRSAEncryption");Ue("1.2.840.113549.1.1.5","sha1WithRSAEncryption");Ue("1.2.840.113549.1.1.7","RSAES-OAEP");Ue("1.2.840.113549.1.1.8","mgf1");Ue("1.2.840.113549.1.1.9","pSpecified");Ue("1.2.840.113549.1.1.10","RSASSA-PSS");Ue("1.2.840.113549.1.1.11","sha256WithRSAEncryption");Ue("1.2.840.113549.1.1.12","sha384WithRSAEncryption");Ue("1.2.840.113549.1.1.13","sha512WithRSAEncryption");Ue("1.3.101.112","EdDSA25519");Ue("1.2.840.10040.4.3","dsa-with-sha1");Ue("1.3.14.3.2.7","desCBC");Ue("1.3.14.3.2.26","sha1");Ue("1.3.14.3.2.29","sha1WithRSASignature");Ue("2.16.840.1.101.3.4.2.1","sha256");Ue("2.16.840.1.101.3.4.2.2","sha384");Ue("2.16.840.1.101.3.4.2.3","sha512");Ue("2.16.840.1.101.3.4.2.4","sha224");Ue("2.16.840.1.101.3.4.2.5","sha512-224");Ue("2.16.840.1.101.3.4.2.6","sha512-256");Ue("1.2.840.113549.2.2","md2");Ue("1.2.840.113549.2.5","md5");Ue("1.2.840.113549.1.7.1","data");Ue("1.2.840.113549.1.7.2","signedData");Ue("1.2.840.113549.1.7.3","envelopedData");Ue("1.2.840.113549.1.7.4","signedAndEnvelopedData");Ue("1.2.840.113549.1.7.5","digestedData");Ue("1.2.840.113549.1.7.6","encryptedData");Ue("1.2.840.113549.1.9.1","emailAddress");Ue("1.2.840.113549.1.9.2","unstructuredName");Ue("1.2.840.113549.1.9.3","contentType");Ue("1.2.840.113549.1.9.4","messageDigest");Ue("1.2.840.113549.1.9.5","signingTime");Ue("1.2.840.113549.1.9.6","counterSignature");Ue("1.2.840.113549.1.9.7","challengePassword");Ue("1.2.840.113549.1.9.8","unstructuredAddress");Ue("1.2.840.113549.1.9.14","extensionRequest");Ue("1.2.840.113549.1.9.20","friendlyName");Ue("1.2.840.113549.1.9.21","localKeyId");Ue("1.2.840.113549.1.9.22.1","x509Certificate");Ue("1.2.840.113549.1.12.10.1.1","keyBag");Ue("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag");Ue("1.2.840.113549.1.12.10.1.3","certBag");Ue("1.2.840.113549.1.12.10.1.4","crlBag");Ue("1.2.840.113549.1.12.10.1.5","secretBag");Ue("1.2.840.113549.1.12.10.1.6","safeContentsBag");Ue("1.2.840.113549.1.5.13","pkcs5PBES2");Ue("1.2.840.113549.1.5.12","pkcs5PBKDF2");Ue("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4");Ue("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4");Ue("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC");Ue("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC");Ue("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC");Ue("1.2.840.113549.2.7","hmacWithSHA1");Ue("1.2.840.113549.2.8","hmacWithSHA224");Ue("1.2.840.113549.2.9","hmacWithSHA256");Ue("1.2.840.113549.2.10","hmacWithSHA384");Ue("1.2.840.113549.2.11","hmacWithSHA512");Ue("1.2.840.113549.3.7","des-EDE3-CBC");Ue("2.16.840.1.101.3.4.1.2","aes128-CBC");Ue("2.16.840.1.101.3.4.1.22","aes192-CBC");Ue("2.16.840.1.101.3.4.1.42","aes256-CBC");Ue("2.5.4.3","commonName");Ue("2.5.4.4","surname");Ue("2.5.4.5","serialNumber");Ue("2.5.4.6","countryName");Ue("2.5.4.7","localityName");Ue("2.5.4.8","stateOrProvinceName");Ue("2.5.4.9","streetAddress");Ue("2.5.4.10","organizationName");Ue("2.5.4.11","organizationalUnitName");Ue("2.5.4.12","title");Ue("2.5.4.13","description");Ue("2.5.4.15","businessCategory");Ue("2.5.4.17","postalCode");Ue("2.5.4.42","givenName");Ue("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName");Ue("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName");Ue("2.16.840.1.113730.1.1","nsCertType");Ue("2.16.840.1.113730.1.13","nsComment");xr("2.5.29.1","authorityKeyIdentifier");xr("2.5.29.2","keyAttributes");xr("2.5.29.3","certificatePolicies");xr("2.5.29.4","keyUsageRestriction");xr("2.5.29.5","policyMapping");xr("2.5.29.6","subtreesConstraint");xr("2.5.29.7","subjectAltName");xr("2.5.29.8","issuerAltName");xr("2.5.29.9","subjectDirectoryAttributes");xr("2.5.29.10","basicConstraints");xr("2.5.29.11","nameConstraints");xr("2.5.29.12","policyConstraints");xr("2.5.29.13","basicConstraints");Ue("2.5.29.14","subjectKeyIdentifier");Ue("2.5.29.15","keyUsage");xr("2.5.29.16","privateKeyUsagePeriod");Ue("2.5.29.17","subjectAltName");Ue("2.5.29.18","issuerAltName");Ue("2.5.29.19","basicConstraints");xr("2.5.29.20","cRLNumber");xr("2.5.29.21","cRLReason");xr("2.5.29.22","expirationDate");xr("2.5.29.23","instructionCode");xr("2.5.29.24","invalidityDate");xr("2.5.29.25","cRLDistributionPoints");xr("2.5.29.26","issuingDistributionPoint");xr("2.5.29.27","deltaCRLIndicator");xr("2.5.29.28","issuingDistributionPoint");xr("2.5.29.29","certificateIssuer");xr("2.5.29.30","nameConstraints");Ue("2.5.29.31","cRLDistributionPoints");Ue("2.5.29.32","certificatePolicies");xr("2.5.29.33","policyMappings");xr("2.5.29.34","policyConstraints");Ue("2.5.29.35","authorityKeyIdentifier");xr("2.5.29.36","policyConstraints");Ue("2.5.29.37","extKeyUsage");xr("2.5.29.46","freshestCRL");xr("2.5.29.54","inhibitAnyPolicy");Ue("1.3.6.1.4.1.11129.2.4.2","timestampList");Ue("1.3.6.1.5.5.7.1.1","authorityInfoAccess");Ue("1.3.6.1.5.5.7.3.1","serverAuth");Ue("1.3.6.1.5.5.7.3.2","clientAuth");Ue("1.3.6.1.5.5.7.3.3","codeSigning");Ue("1.3.6.1.5.5.7.3.4","emailProtection");Ue("1.3.6.1.5.5.7.3.8","timeStamping")});var ea=Z((Hpe,JO)=>{"use strict";var jr=$t();lr();Ou();var Ze=JO.exports=jr.asn1=jr.asn1||{};Ze.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};Ze.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};Ze.create=function(r,e,t,n,s){if(jr.util.isArray(n)){for(var i=[],a=0;a<n.length;++a)n[a]!==void 0&&i.push(n[a]);n=i}var u={tagClass:r,type:e,constructed:t,composed:t||jr.util.isArray(n),value:n};return s&&"bitStringContents"in s&&(u.bitStringContents=s.bitStringContents,u.original=Ze.copy(u)),u};Ze.copy=function(r,e){var t;if(jr.util.isArray(r)){t=[];for(var n=0;n<r.length;++n)t.push(Ze.copy(r[n],e));return t}return typeof r=="string"?r:(t={tagClass:r.tagClass,type:r.type,constructed:r.constructed,composed:r.composed,value:Ze.copy(r.value,e)},e&&!e.excludeBitStringContents&&(t.bitStringContents=r.bitStringContents),t)};Ze.equals=function(r,e,t){if(jr.util.isArray(r)){if(!jr.util.isArray(e)||r.length!==e.length)return!1;for(var n=0;n<r.length;++n)if(!Ze.equals(r[n],e[n]))return!1;return!0}if(typeof r!=typeof e)return!1;if(typeof r=="string")return r===e;var s=r.tagClass===e.tagClass&&r.type===e.type&&r.constructed===e.constructed&&r.composed===e.composed&&Ze.equals(r.value,e.value);return t&&t.includeBitStringContents&&(s=s&&r.bitStringContents===e.bitStringContents),s};Ze.getBerValueLength=function(r){var e=r.getByte();if(e!==128){var t,n=e&128;return n?t=r.getInt((e&127)<<3):t=e,t}};function z0(r,e,t){if(t>e){var n=new Error("Too few bytes to parse DER.");throw n.available=r.length(),n.remaining=e,n.requested=t,n}}o(z0,"_checkBufferLength");var Bz=o(function(r,e){var t=r.getByte();if(e--,t!==128){var n,s=t&128;if(!s)n=t;else{var i=t&127;z0(r,e,i),n=r.getInt(i<<3)}if(n<0)throw new Error("Negative length: "+n);return n}},"_getValueLength");Ze.fromDer=function(r,e){e===void 0&&(e={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),typeof e=="boolean"&&(e={strict:e,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in e||(e.strict=!0),"parseAllBytes"in e||(e.parseAllBytes=!0),"decodeBitStrings"in e||(e.decodeBitStrings=!0),typeof r=="string"&&(r=jr.util.createBuffer(r));var t=r.length(),n=dw(r,r.length(),0,e);if(e.parseAllBytes&&r.length()!==0){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=t,s.remaining=r.length(),s}return n};function dw(r,e,t,n){var s;z0(r,e,2);var i=r.getByte();e--;var a=i&192,u=i&31;s=r.length();var c=Bz(r,e);if(e-=s-r.length(),c!==void 0&&c>e){if(n.strict){var f=new Error("Too few bytes to read ASN.1 value.");throw f.available=r.length(),f.remaining=e,f.requested=c,f}c=e}var h,m,g=(i&32)===32;if(g)if(h=[],c===void 0)for(;;){if(z0(r,e,2),r.bytes(2)==="\0\0"){r.getBytes(2),e-=2;break}s=r.length(),h.push(dw(r,e,t+1,n)),e-=s-r.length()}else for(;c>0;)s=r.length(),h.push(dw(r,c,t+1,n)),e-=s-r.length(),c-=s-r.length();if(h===void 0&&a===Ze.Class.UNIVERSAL&&u===Ze.Type.BITSTRING&&(m=r.bytes(c)),h===void 0&&n.decodeBitStrings&&a===Ze.Class.UNIVERSAL&&u===Ze.Type.BITSTRING&&c>1){var x=r.read,v=e,w=0;if(u===Ze.Type.BITSTRING&&(z0(r,e,1),w=r.getByte(),e--),w===0)try{s=r.length();var S={strict:!0,decodeBitStrings:!0},A=dw(r,e,t+1,S),T=s-r.length();e-=T,u==Ze.Type.BITSTRING&&T++;var b=A.tagClass;T===c&&(b===Ze.Class.UNIVERSAL||b===Ze.Class.CONTEXT_SPECIFIC)&&(h=[A])}catch{}h===void 0&&(r.read=x,e=v)}if(h===void 0){if(c===void 0){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");c=e}if(u===Ze.Type.BMPSTRING)for(h="";c>0;c-=2)z0(r,e,2),h+=String.fromCharCode(r.getInt16()),e-=2;else h=r.getBytes(c),e-=c}var E=m===void 0?null:{bitStringContents:m};return Ze.create(a,u,g,h,E)}o(dw,"_fromDer");Ze.toDer=function(r){var e=jr.util.createBuffer(),t=r.tagClass|r.type,n=jr.util.createBuffer(),s=!1;if("bitStringContents"in r&&(s=!0,r.original&&(s=Ze.equals(r,r.original))),s)n.putBytes(r.bitStringContents);else if(r.composed){r.constructed?t|=32:n.putByte(0);for(var i=0;i<r.value.length;++i)r.value[i]!==void 0&&n.putBuffer(Ze.toDer(r.value[i]))}else if(r.type===Ze.Type.BMPSTRING)for(var i=0;i<r.value.length;++i)n.putInt16(r.value.charCodeAt(i));else r.type===Ze.Type.INTEGER&&r.value.length>1&&(r.value.charCodeAt(0)===0&&(r.value.charCodeAt(1)&128)===0||r.value.charCodeAt(0)===255&&(r.value.charCodeAt(1)&128)===128)?n.putBytes(r.value.substr(1)):n.putBytes(r.value);if(e.putByte(t),n.length()<=127)e.putByte(n.length()&127);else{var a=n.length(),u="";do u+=String.fromCharCode(a&255),a=a>>>8;while(a>0);e.putByte(u.length|128);for(var i=u.length-1;i>=0;--i)e.putByte(u.charCodeAt(i))}return e.putBuffer(n),e};Ze.oidToDer=function(r){var e=r.split("."),t=jr.util.createBuffer();t.putByte(40*parseInt(e[0],10)+parseInt(e[1],10));for(var n,s,i,a,u=2;u<e.length;++u){n=!0,s=[],i=parseInt(e[u],10);do a=i&127,i=i>>>7,n||(a|=128),s.push(a),n=!1;while(i>0);for(var c=s.length-1;c>=0;--c)t.putByte(s[c])}return t};Ze.derToOid=function(r){var e;typeof r=="string"&&(r=jr.util.createBuffer(r));var t=r.getByte();e=Math.floor(t/40)+"."+t%40;for(var n=0;r.length()>0;)t=r.getByte(),n=n<<7,t&128?n+=t&127:(e+="."+(n+t),n=0);return e};Ze.utcTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,2),10);t=t>=50?1900+t:2e3+t;var n=parseInt(r.substr(2,2),10)-1,s=parseInt(r.substr(4,2),10),i=parseInt(r.substr(6,2),10),a=parseInt(r.substr(8,2),10),u=0;if(r.length>11){var c=r.charAt(10),f=10;c!=="+"&&c!=="-"&&(u=parseInt(r.substr(10,2),10),f+=2)}if(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,0),f&&(c=r.charAt(f),c==="+"||c==="-")){var h=parseInt(r.substr(f+1,2),10),m=parseInt(r.substr(f+4,2),10),g=h*60+m;g*=6e4,c==="+"?e.setTime(+e-g):e.setTime(+e+g)}return e};Ze.generalizedTimeToDate=function(r){var e=new Date,t=parseInt(r.substr(0,4),10),n=parseInt(r.substr(4,2),10)-1,s=parseInt(r.substr(6,2),10),i=parseInt(r.substr(8,2),10),a=parseInt(r.substr(10,2),10),u=parseInt(r.substr(12,2),10),c=0,f=0,h=!1;r.charAt(r.length-1)==="Z"&&(h=!0);var m=r.length-5,g=r.charAt(m);if(g==="+"||g==="-"){var x=parseInt(r.substr(m+1,2),10),v=parseInt(r.substr(m+4,2),10);f=x*60+v,f*=6e4,g==="+"&&(f*=-1),h=!0}return r.charAt(14)==="."&&(c=parseFloat(r.substr(14),10)*1e3),h?(e.setUTCFullYear(t,n,s),e.setUTCHours(i,a,u,c),e.setTime(+e+f)):(e.setFullYear(t,n,s),e.setHours(i,a,u,c)),e};Ze.dateToUtcTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push((""+r.getUTCFullYear()).substr(2)),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Ze.dateToGeneralizedTime=function(r){if(typeof r=="string")return r;var e="",t=[];t.push(""+r.getUTCFullYear()),t.push(""+(r.getUTCMonth()+1)),t.push(""+r.getUTCDate()),t.push(""+r.getUTCHours()),t.push(""+r.getUTCMinutes()),t.push(""+r.getUTCSeconds());for(var n=0;n<t.length;++n)t[n].length<2&&(e+="0"),e+=t[n];return e+="Z",e};Ze.integerToDer=function(r){var e=jr.util.createBuffer();if(r>=-128&&r<128)return e.putSignedInt(r,8);if(r>=-32768&&r<32768)return e.putSignedInt(r,16);if(r>=-8388608&&r<8388608)return e.putSignedInt(r,24);if(r>=-2147483648&&r<2147483648)return e.putSignedInt(r,32);var t=new Error("Integer too large; max is 32-bits.");throw t.integer=r,t};Ze.derToInteger=function(r){typeof r=="string"&&(r=jr.util.createBuffer(r));var e=r.length()*8;if(e>32)throw new Error("Integer too large; max is 32-bits.");return r.getSignedInt(e)};Ze.validate=function(r,e,t,n){var s=!1;if((r.tagClass===e.tagClass||typeof e.tagClass>"u")&&(r.type===e.type||typeof e.type>"u"))if(r.constructed===e.constructed||typeof e.constructed>"u"){if(s=!0,e.value&&jr.util.isArray(e.value))for(var i=0,a=0;s&&a<e.value.length;++a)s=e.value[a].optional||!1,r.value[i]&&(s=Ze.validate(r.value[i],e.value[a],t,n),s?++i:e.value[a].optional&&(s=!0)),!s&&n&&n.push("["+e.name+'] Tag class "'+e.tagClass+'", type "'+e.type+'" expected value length "'+e.value.length+'", got "'+r.value.length+'"');if(s&&t&&(e.capture&&(t[e.capture]=r.value),e.captureAsn1&&(t[e.captureAsn1]=r),e.captureBitStringContents&&"bitStringContents"in r&&(t[e.captureBitStringContents]=r.bitStringContents),e.captureBitStringValue&&"bitStringContents"in r)){var u;if(r.bitStringContents.length<2)t[e.captureBitStringValue]="";else{var c=r.bitStringContents.charCodeAt(0);if(c!==0)throw new Error("captureBitStringValue only supported for zero unused bits");t[e.captureBitStringValue]=r.bitStringContents.slice(1)}}}else n&&n.push("["+e.name+'] Expected constructed "'+e.constructed+'", got "'+r.constructed+'"');else n&&(r.tagClass!==e.tagClass&&n.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+r.tagClass+'"'),r.type!==e.type&&n.push("["+e.name+'] Expected type "'+e.type+'", got "'+r.type+'"'));return s};var zO=/[^\\u0000-\\u00ff]/;Ze.prettyPrint=function(r,e,t){var n="";e=e||0,t=t||2,e>0&&(n+=`
@@ -50,7 +51,7 @@ function print() { __p += __j.call(arguments, '') }
50
51
  `+a.map(q8).join(`
51
52
  `):" "+q8(a[0]):"as no adapter specified";throw new at("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},"getAdapter"),adapters:RT};function AT(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Gu(null,r)}o(AT,"throwIfCancellationRequested");function H8(r){return AT(r),r.headers=ks.from(r.headers),r.data=bT.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),m5.getAdapter(r.adapter||MT.adapter,r)(r).then(o(function(n){return AT(r),n.data=bT.call(r,r.transformResponse,n),n.headers=ks.from(n.headers),n},"onAdapterResolution"),o(function(n){return c5(n)||(AT(r),n&&n.response&&(n.response.data=bT.call(r,r.transformResponse,n.response),n.response.headers=ks.from(n.response.headers))),Promise.reject(n)},"onAdapterRejection"))}o(H8,"dispatchRequest");var pS={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{pS[r]=o(function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r},"validator")});var K8={};pS.transitional=o(function(e,t,n){function s(i,a){return"[Axios v"+aS+"] Transitional option '"+i+"'"+a+(n?". "+n:"")}return o(s,"formatMessage"),(i,a,u)=>{if(e===!1)throw new at(s(a," has been removed"+(t?" in "+t:"")),at.ERR_DEPRECATED);return t&&!K8[a]&&(K8[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");pS.spelling=o(function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)},"spelling");function Une(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),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 at("option "+i+" must be "+c,at.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new at("Unknown option "+i,at.ERR_BAD_OPTION)}}o(Une,"assertOptions");var sS={assertOptions:Une,validators:pS},Ua=sS.validators,Pp=class{static{o(this,"Axios")}constructor(e){this.defaults=e||{},this.interceptors={request:new N8,response:new N8}}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+=`
52
53
  `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Hl(this.defaults,t);let{transitional:n,paramsSerializer:s,headers:i}=t;n!==void 0&&sS.assertOptions(n,{silentJSONParsing:Ua.transitional(Ua.boolean),forcedJSONParsing:Ua.transitional(Ua.boolean),clarifyTimeoutError:Ua.transitional(Ua.boolean)},!1),s!=null&&(fe.isFunction(s)?t.paramsSerializer={serialize:s}:sS.assertOptions(s,{encode:Ua.function,serialize:Ua.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),sS.assertOptions(t,{baseUrl:Ua.spelling("baseURL"),withXsrfToken:Ua.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=i&&fe.merge(i.common,i[t.method]);i&&fe.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),t.headers=ks.concat(a,i);let u=[],c=!0;this.interceptors.request.forEach(o(function(w){typeof w.runWhen=="function"&&w.runWhen(t)===!1||(c=c&&w.synchronous,u.unshift(w.fulfilled,w.rejected))},"unshiftRequestInterceptors"));let f=[];this.interceptors.response.forEach(o(function(w){f.push(w.fulfilled,w.rejected)},"pushResponseInterceptors"));let h,m=0,g;if(!c){let v=[H8.bind(this),void 0];for(v.unshift(...u),v.push(...f),g=v.length,h=Promise.resolve(t);m<g;)h=h.then(v[m++],v[m++]);return h}g=u.length;let x=t;for(;m<g;){let v=u[m++],w=u[m++];try{x=v(x)}catch(S){w.call(this,S);break}}try{h=H8.call(this,x)}catch(v){return Promise.reject(v)}for(m=0,g=f.length;m<g;)h=h.then(f[m++],f[m++]);return h}getUri(e){e=Hl(this.defaults,e);let t=FT(e.baseURL,e.url,e.allowAbsoluteUrls);return LT(t,e.params,e.paramsSerializer)}};fe.forEach(["delete","get","head","options"],o(function(e){Pp.prototype[e]=function(t,n){return this.request(Hl(n||{},{method:e,url:t,data:(n||{}).data}))}},"forEachMethodNoData"));fe.forEach(["post","put","patch"],o(function(e){function t(n){return o(function(i,a,u){return this.request(Hl(u||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))},"httpMethod")}o(t,"generateHTTPMethod"),Pp.prototype[e]=t(),Pp.prototype[e+"Form"]=t(!0)},"forEachMethodWithData"));var iS=Pp,PT=class r{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 Gu(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 r(o(function(s){e=s},"executor")),cancel:e}}},jne=PT;function Mne(r){return o(function(t){return r.apply(null,t)},"wrap")}o(Mne,"spread");function Fne(r){return fe.isObject(r)&&r.isAxiosError===!0}o(Fne,"isAxiosError");var OT={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};Object.entries(OT).forEach(([r,e])=>{OT[e]=r});var qne=OT;function g5(r){let e=new iS(r),t=W8(iS.prototype.request,e);return fe.extend(t,iS.prototype,e,{allOwnKeys:!0}),fe.extend(t,e,null,{allOwnKeys:!0}),t.create=o(function(s){return g5(Hl(r,s))},"create"),t}o(g5,"createInstance");var mn=g5(MT);mn.Axios=iS;mn.CanceledError=Gu;mn.CancelToken=jne;mn.isCancel=c5;mn.VERSION=aS;mn.toFormData=hS;mn.AxiosError=at;mn.Cancel=mn.CanceledError;mn.all=o(function(e){return Promise.all(e)},"all");mn.spread=Mne;mn.isAxiosError=Fne;mn.mergeConfig=Hl;mn.AxiosHeaders=ks;mn.formToJSON=r=>u5(fe.isHTMLForm(r)?new FormData(r):r);mn.getAdapter=m5.getAdapter;mn.HttpStatusCode=qne;mn.default=mn;v5.exports=mn});var y5=Z((q0e,Pr)=>{"use strict";Pr.exports.NTLMFLAG_NEGOTIATE_UNICODE=1;Pr.exports.NTLMFLAG_NEGOTIATE_OEM=2;Pr.exports.NTLMFLAG_REQUEST_TARGET=4;Pr.exports.NTLMFLAG_NEGOTIATE_SIGN=16;Pr.exports.NTLMFLAG_NEGOTIATE_SEAL=32;Pr.exports.NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE=64;Pr.exports.NTLMFLAG_NEGOTIATE_LM_KEY=128;Pr.exports.NTLMFLAG_NEGOTIATE_NETWARE=256;Pr.exports.NTLMFLAG_NEGOTIATE_NTLM_KEY=512;Pr.exports.NTLMFLAG_NEGOTIATE_ANONYMOUS=2048;Pr.exports.NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED=4096;Pr.exports.NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED=8192;Pr.exports.NTLMFLAG_NEGOTIATE_LOCAL_CALL=16384;Pr.exports.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN=32768;Pr.exports.NTLMFLAG_TARGET_TYPE_DOMAIN=65536;Pr.exports.NTLMFLAG_TARGET_TYPE_SERVER=1<<17;Pr.exports.NTLMFLAG_TARGET_TYPE_SHARE=1<<18;Pr.exports.NTLMFLAG_NEGOTIATE_NTLM2_KEY=1<<19;Pr.exports.NTLMFLAG_REQUEST_INIT_RESPONSE=1<<20;Pr.exports.NTLMFLAG_REQUEST_ACCEPT_RESPONSE=1<<21;Pr.exports.NTLMFLAG_REQUEST_NONNT_SESSION_KEY=1<<22;Pr.exports.NTLMFLAG_NEGOTIATE_TARGET_INFO=1<<23;Pr.exports.NTLMFLAG_NEGOTIATE_128=1<<29;Pr.exports.NTLMFLAG_NEGOTIATE_KEY_EXCHANGE=1<<30;Pr.exports.NTLMFLAG_NEGOTIATE_56=1<<31});var HT=Z(_i=>{"use strict";_i.readUInt32BE=o(function(e,t){var n=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return n>>>0},"readUInt32BE");_i.writeUInt32BE=o(function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=t&255},"writeUInt32BE");_i.ip=o(function(e,t,n,s){for(var i=0,a=0,u=6;u>=0;u-=2){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>>c+u&1;for(var c=0;c<=24;c+=8)i<<=1,i|=e>>>c+u&1}for(var u=6;u>=0;u-=2){for(var c=1;c<=25;c+=8)a<<=1,a|=t>>>c+u&1;for(var c=1;c<=25;c+=8)a<<=1,a|=e>>>c+u&1}n[s+0]=i>>>0,n[s+1]=a>>>0},"ip");_i.rip=o(function(e,t,n,s){for(var i=0,a=0,u=0;u<4;u++)for(var c=24;c>=0;c-=8)i<<=1,i|=t>>>c+u&1,i<<=1,i|=e>>>c+u&1;for(var u=4;u<8;u++)for(var c=24;c>=0;c-=8)a<<=1,a|=t>>>c+u&1,a<<=1,a|=e>>>c+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"rip");_i.pc1=o(function(e,t,n,s){for(var i=0,a=0,u=7;u>=5;u--){for(var c=0;c<=24;c+=8)i<<=1,i|=t>>c+u&1;for(var c=0;c<=24;c+=8)i<<=1,i|=e>>c+u&1}for(var c=0;c<=24;c+=8)i<<=1,i|=t>>c+u&1;for(var u=1;u<=3;u++){for(var c=0;c<=24;c+=8)a<<=1,a|=t>>c+u&1;for(var c=0;c<=24;c+=8)a<<=1,a|=e>>c+u&1}for(var c=0;c<=24;c+=8)a<<=1,a|=e>>c+u&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc1");_i.r28shl=o(function(e,t){return e<<t&268435455|e>>>28-t},"r28shl");var dS=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];_i.pc2=o(function(e,t,n,s){for(var i=0,a=0,u=dS.length>>>1,c=0;c<u;c++)i<<=1,i|=e>>>dS[c]&1;for(var c=u;c<dS.length;c++)a<<=1,a|=t>>>dS[c]&1;n[s+0]=i>>>0,n[s+1]=a>>>0},"pc2");_i.expand=o(function(e,t,n){var s=0,i=0;s=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4)s<<=6,s|=e>>>a&63;for(var a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(e&31)<<1|e>>>31,t[n+0]=s>>>0,t[n+1]=i>>>0},"expand");var x5=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];_i.substitute=o(function(e,t){for(var n=0,s=0;s<4;s++){var i=e>>>18-s*6&63,a=x5[s*64+i];n<<=4,n|=a}for(var s=0;s<4;s++){var i=t>>>18-s*6&63,a=x5[256+s*64+i];n<<=4,n|=a}return n>>>0},"substitute");var w5=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];_i.permute=o(function(e){for(var t=0,n=0;n<w5.length;n++)t<<=1,t|=e>>>w5[n]&1;return t>>>0},"permute");_i.padSplit=o(function(e,t,n){for(var s=e.toString(2);s.length<t;)s="0"+s;for(var i=[],a=0;a<t;a+=n)i.push(s.slice(a,a+n));return i.join(" ")},"padSplit")});var Eg=Z(($0e,b5)=>{"use strict";b5.exports=S5;function S5(r,e){if(!r)throw new Error(e||"Assertion failed")}o(S5,"assert");S5.equal=o(function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)},"assertEqual")});var mS=Z((X0e,E5)=>{"use strict";var Hne=Eg();function Bi(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=r.padding!==!1}o(Bi,"Cipher");E5.exports=Bi;Bi.prototype._init=o(function(){},"_init");Bi.prototype.update=o(function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},"update");Bi.prototype._buffer=o(function(e,t){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-t),s=0;s<n;s++)this.buffer[this.bufferOff+s]=e[t+s];return this.bufferOff+=n,n},"_buffer");Bi.prototype._flushBuffer=o(function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},"_flushBuffer");Bi.prototype._updateEncrypt=o(function(e){var t=0,n=0,s=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(s*this.blockSize);this.bufferOff!==0&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(i,n)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,n),n+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},"_updateEncrypt");Bi.prototype._updateDecrypt=o(function(e){for(var t=0,n=0,s=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(s*this.blockSize);s>0;s--)t+=this._buffer(e,t),n+=this._flushBuffer(i,n);return t+=this._buffer(e,t),i},"_updateDecrypt");Bi.prototype.final=o(function(e){var t;e&&(t=this.update(e));var n;return this.type==="encrypt"?n=this._finalEncrypt():n=this._finalDecrypt(),t?t.concat(n):n},"final");Bi.prototype._pad=o(function(e,t){if(t===0)return!1;for(;t<e.length;)e[t++]=0;return!0},"_pad");Bi.prototype._finalEncrypt=o(function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},"_finalEncrypt");Bi.prototype._unpad=o(function(e){return e},"_unpad");Bi.prototype._finalDecrypt=o(function(){Hne.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)},"_finalDecrypt")});var A5=Z((z0e,KT)=>{"use strict";typeof Object.create=="function"?KT.exports=o(function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):KT.exports=o(function(e,t){if(t){e.super_=t;var n=o(function(){},"TempCtor");n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},"inherits")});var gS=Z((Y0e,GT)=>{"use strict";try{if($T=Xe("util"),typeof $T.inherits!="function")throw"";GT.exports=$T.inherits}catch{GT.exports=A5()}var $T});var XT=Z((Q0e,T5)=>{"use strict";var C5=Eg(),Kne=gS(),bn=HT(),N5=mS();function $ne(){this.tmp=new Array(2),this.keys=null}o($ne,"DESState");function Ma(r){N5.call(this,r);var e=new $ne;this._desState=e,this.deriveKeys(e,r.key)}o(Ma,"DES");Kne(Ma,N5);T5.exports=Ma;Ma.create=o(function(e){return new Ma(e)},"create");var Gne=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];Ma.prototype.deriveKeys=o(function(e,t){e.keys=new Array(32),C5.equal(t.length,this.blockSize,"Invalid key length");var n=bn.readUInt32BE(t,0),s=bn.readUInt32BE(t,4);bn.pc1(n,s,e.tmp,0),n=e.tmp[0],s=e.tmp[1];for(var i=0;i<e.keys.length;i+=2){var a=Gne[i>>>1];n=bn.r28shl(n,a),s=bn.r28shl(s,a),bn.pc2(n,s,e.keys,i)}},"deriveKeys");Ma.prototype._update=o(function(e,t,n,s){var i=this._desState,a=bn.readUInt32BE(e,t),u=bn.readUInt32BE(e,t+4);bn.ip(a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],this.type==="encrypt"?this._encrypt(i,a,u,i.tmp,0):this._decrypt(i,a,u,i.tmp,0),a=i.tmp[0],u=i.tmp[1],bn.writeUInt32BE(n,a,s),bn.writeUInt32BE(n,u,s+4)},"_update");Ma.prototype._pad=o(function(e,t){if(this.padding===!1)return!1;for(var n=e.length-t,s=t;s<e.length;s++)e[s]=n;return!0},"_pad");Ma.prototype._unpad=o(function(e){if(this.padding===!1)return e;for(var t=e[e.length-1],n=e.length-t;n<e.length;n++)C5.equal(e[n],t);return e.slice(0,e.length-t)},"_unpad");Ma.prototype._encrypt=o(function(e,t,n,s,i){for(var a=t,u=n,c=0;c<e.keys.length;c+=2){var f=e.keys[c],h=e.keys[c+1];bn.expand(u,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=bn.substitute(f,h),g=bn.permute(m),x=u;u=(a^g)>>>0,a=x}bn.rip(u,a,s,i)},"_encrypt");Ma.prototype._decrypt=o(function(e,t,n,s,i){for(var a=n,u=t,c=e.keys.length-2;c>=0;c-=2){var f=e.keys[c],h=e.keys[c+1];bn.expand(a,e.tmp,0),f^=e.tmp[0],h^=e.tmp[1];var m=bn.substitute(f,h),g=bn.permute(m),x=a;a=(u^g)>>>0,u=x}bn.rip(a,u,s,i)},"_decrypt")});var _5=Z(I5=>{"use strict";var Xne=Eg(),Wne=gS(),vS={};function zne(r){Xne.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e<this.iv.length;e++)this.iv[e]=r[e]}o(zne,"CBCState");function Jne(r){function e(i){r.call(this,i),this._cbcInit()}o(e,"CBC"),Wne(e,r);for(var t=Object.keys(vS),n=0;n<t.length;n++){var s=t[n];e.prototype[s]=vS[s]}return e.create=o(function(a){return new e(a)},"create"),e}o(Jne,"instantiate");I5.instantiate=Jne;vS._cbcInit=o(function(){var e=new zne(this.options.iv);this._cbcState=e},"_cbcInit");vS._update=o(function(e,t,n,s){var i=this._cbcState,a=this.constructor.super_.prototype,u=i.iv;if(this.type==="encrypt"){for(var c=0;c<this.blockSize;c++)u[c]^=e[t+c];a._update.call(this,u,0,n,s);for(var c=0;c<this.blockSize;c++)u[c]=n[s+c]}else{a._update.call(this,e,t,n,s);for(var c=0;c<this.blockSize;c++)n[s+c]^=u[c];for(var c=0;c<this.blockSize;c++)u[c]=e[t+c]}},"_update")});var R5=Z((rge,D5)=>{"use strict";var Yne=Eg(),Qne=gS(),B5=mS(),Xu=XT();function Zne(r,e){Yne.equal(e.length,24,"Invalid key length");var t=e.slice(0,8),n=e.slice(8,16),s=e.slice(16,24);r==="encrypt"?this.ciphers=[Xu.create({type:"encrypt",key:t}),Xu.create({type:"decrypt",key:n}),Xu.create({type:"encrypt",key:s})]:this.ciphers=[Xu.create({type:"decrypt",key:s}),Xu.create({type:"encrypt",key:n}),Xu.create({type:"decrypt",key:t})]}o(Zne,"EDEState");function Kl(r){B5.call(this,r);var e=new Zne(this.type,this.options.key);this._edeState=e}o(Kl,"EDE");Qne(Kl,B5);D5.exports=Kl;Kl.create=o(function(e){return new Kl(e)},"create");Kl.prototype._update=o(function(e,t,n,s){var i=this._edeState;i.ciphers[0]._update(e,t,n,s),i.ciphers[1]._update(n,s,n,s),i.ciphers[2]._update(n,s,n,s)},"_update");Kl.prototype._pad=Xu.prototype._pad;Kl.prototype._unpad=Xu.prototype._unpad});var P5=Z(kp=>{"use strict";kp.utils=HT();kp.Cipher=mS();kp.DES=XT();kp.CBC=_5();kp.EDE=R5()});var O5=Z((ige,yS)=>{"use strict";(function(){"use strict";var r=typeof window=="object"?window:{},e=!r.JS_MD4_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;e&&(r=global);var t=!r.JS_MD4_NO_COMMON_JS&&typeof yS=="object"&&yS.exports,n=typeof define=="function"&&define.amd,s=!r.JS_MD4_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",i="0123456789abcdef".split(""),a=[128,32768,8388608,-2147483648],u=[0,8,16,24],c=["hex","array","digest","buffer","arrayBuffer"],f=[],h;if(s){var m=new ArrayBuffer(68);h=new Uint8Array(m),f=new Uint32Array(m)}var g=o(function(A){return function(T){return new w(!0).update(T)[A]()}},"createOutputMethod"),x=o(function(){var A=g("hex");e&&(A=v(A)),A.create=function(){return new w},A.update=function(E){return A.create().update(E)};for(var T=0;T<c.length;++T){var b=c[T];A[b]=g(b)}return A},"createMethod"),v=o(function(A){var T=Xe("crypto"),b=Xe("buffer").Buffer,E=o(function(C){if(typeof C=="string")return T.createHash("md4").update(C,"utf8").digest("hex");if(s&&C instanceof ArrayBuffer)C=new Uint8Array(C);else if(C.length===void 0)return A(C);return T.createHash("md4").update(new b(C)).digest("hex")},"nodeMethod");return E},"nodeWrap");function w(A){if(A)f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f,this.buffer8=h;else if(s){var T=new ArrayBuffer(68);this.buffer8=new Uint8Array(T),this.blocks=new Uint32Array(T)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}o(w,"Md4"),w.prototype.update=function(A){if(!this.finalized){var T=typeof A!="string";T&&s&&A instanceof ArrayBuffer&&(A=new Uint8Array(A));for(var b,E=0,C,_=A.length||0,F=this.blocks,R=this.buffer8;E<_;){if(this.hashed&&(this.hashed=!1,F[0]=F[16],F[16]=F[1]=F[2]=F[3]=F[4]=F[5]=F[6]=F[7]=F[8]=F[9]=F[10]=F[11]=F[12]=F[13]=F[14]=F[15]=0),T)if(s)for(C=this.start;E<_&&C<64;++E)R[C++]=A[E];else for(C=this.start;E<_&&C<64;++E)F[C>>2]|=A[E]<<u[C++&3];else if(s)for(C=this.start;E<_&&C<64;++E)b=A.charCodeAt(E),b<128?R[C++]=b:b<2048?(R[C++]=192|b>>6,R[C++]=128|b&63):b<55296||b>=57344?(R[C++]=224|b>>12,R[C++]=128|b>>6&63,R[C++]=128|b&63):(b=65536+((b&1023)<<10|A.charCodeAt(++E)&1023),R[C++]=240|b>>18,R[C++]=128|b>>12&63,R[C++]=128|b>>6&63,R[C++]=128|b&63);else for(C=this.start;E<_&&C<64;++E)b=A.charCodeAt(E),b<128?F[C>>2]|=b<<u[C++&3]:b<2048?(F[C>>2]|=(192|b>>6)<<u[C++&3],F[C>>2]|=(128|b&63)<<u[C++&3]):b<55296||b>=57344?(F[C>>2]|=(224|b>>12)<<u[C++&3],F[C>>2]|=(128|b>>6&63)<<u[C++&3],F[C>>2]|=(128|b&63)<<u[C++&3]):(b=65536+((b&1023)<<10|A.charCodeAt(++E)&1023),F[C>>2]|=(240|b>>18)<<u[C++&3],F[C>>2]|=(128|b>>12&63)<<u[C++&3],F[C>>2]|=(128|b>>6&63)<<u[C++&3],F[C>>2]|=(128|b&63)<<u[C++&3]);this.lastByteIndex=C,this.bytes+=C-this.start,C>=64?(this.start=C-64,this.hash(),this.hashed=!0):this.start=C}return this}},w.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var A=this.blocks,T=this.lastByteIndex;A[T>>2]|=a[T&3],T>=56&&(this.hashed||this.hash(),A[0]=A[16],A[16]=A[1]=A[2]=A[3]=A[4]=A[5]=A[6]=A[7]=A[8]=A[9]=A[10]=A[11]=A[12]=A[13]=A[14]=A[15]=0),A[14]=this.bytes<<3,this.hash()}},w.prototype.hash=function(){var A,T,b,E,C,_,F,R,q=this.blocks;this.first?(A=q[0]-1,A=A<<3|A>>>29,E=(A&4023233417|~A&2562383102)+q[1]+271733878,E=E<<7|E>>>25,b=(E&A|~E&4023233417)+q[2]-1732584194,b=b<<11|b>>>21,T=(b&E|~b&A)+q[3]-271733879,T=T<<19|T>>>13):(A=this.h0,T=this.h1,b=this.h2,E=this.h3,A+=(T&b|~T&E)+q[0],A=A<<3|A>>>29,E+=(A&T|~A&b)+q[1],E=E<<7|E>>>25,b+=(E&A|~E&T)+q[2],b=b<<11|b>>>21,T+=(b&E|~b&A)+q[3],T=T<<19|T>>>13),A+=(T&b|~T&E)+q[4],A=A<<3|A>>>29,E+=(A&T|~A&b)+q[5],E=E<<7|E>>>25,b+=(E&A|~E&T)+q[6],b=b<<11|b>>>21,T+=(b&E|~b&A)+q[7],T=T<<19|T>>>13,A+=(T&b|~T&E)+q[8],A=A<<3|A>>>29,E+=(A&T|~A&b)+q[9],E=E<<7|E>>>25,b+=(E&A|~E&T)+q[10],b=b<<11|b>>>21,T+=(b&E|~b&A)+q[11],T=T<<19|T>>>13,A+=(T&b|~T&E)+q[12],A=A<<3|A>>>29,E+=(A&T|~A&b)+q[13],E=E<<7|E>>>25,b+=(E&A|~E&T)+q[14],b=b<<11|b>>>21,T+=(b&E|~b&A)+q[15],T=T<<19|T>>>13,_=T&b,A+=(_|T&E|b&E)+q[0]+1518500249,A=A<<3|A>>>29,C=A&T,E+=(C|A&b|_)+q[4]+1518500249,E=E<<5|E>>>27,R=E&A,b+=(R|E&T|C)+q[8]+1518500249,b=b<<9|b>>>23,F=b&E,T+=(F|b&A|R)+q[12]+1518500249,T=T<<13|T>>>19,_=T&b,A+=(_|T&E|F)+q[1]+1518500249,A=A<<3|A>>>29,C=A&T,E+=(C|A&b|_)+q[5]+1518500249,E=E<<5|E>>>27,R=E&A,b+=(R|E&T|C)+q[9]+1518500249,b=b<<9|b>>>23,F=b&E,T+=(F|b&A|R)+q[13]+1518500249,T=T<<13|T>>>19,_=T&b,A+=(_|T&E|F)+q[2]+1518500249,A=A<<3|A>>>29,C=A&T,E+=(C|A&b|_)+q[6]+1518500249,E=E<<5|E>>>27,R=E&A,b+=(R|E&T|C)+q[10]+1518500249,b=b<<9|b>>>23,F=b&E,T+=(F|b&A|R)+q[14]+1518500249,T=T<<13|T>>>19,_=T&b,A+=(_|T&E|F)+q[3]+1518500249,A=A<<3|A>>>29,C=A&T,E+=(C|A&b|_)+q[7]+1518500249,E=E<<5|E>>>27,R=E&A,b+=(R|E&T|C)+q[11]+1518500249,b=b<<9|b>>>23,T+=(b&E|b&A|R)+q[15]+1518500249,T=T<<13|T>>>19,_=T^b,A+=(_^E)+q[0]+1859775393,A=A<<3|A>>>29,E+=(_^A)+q[8]+1859775393,E=E<<9|E>>>23,R=E^A,b+=(R^T)+q[4]+1859775393,b=b<<11|b>>>21,T+=(R^b)+q[12]+1859775393,T=T<<15|T>>>17,_=T^b,A+=(_^E)+q[2]+1859775393,A=A<<3|A>>>29,E+=(_^A)+q[10]+1859775393,E=E<<9|E>>>23,R=E^A,b+=(R^T)+q[6]+1859775393,b=b<<11|b>>>21,T+=(R^b)+q[14]+1859775393,T=T<<15|T>>>17,_=T^b,A+=(_^E)+q[1]+1859775393,A=A<<3|A>>>29,E+=(_^A)+q[9]+1859775393,E=E<<9|E>>>23,R=E^A,b+=(R^T)+q[5]+1859775393,b=b<<11|b>>>21,T+=(R^b)+q[13]+1859775393,T=T<<15|T>>>17,_=T^b,A+=(_^E)+q[3]+1859775393,A=A<<3|A>>>29,E+=(_^A)+q[11]+1859775393,E=E<<9|E>>>23,R=E^A,b+=(R^T)+q[7]+1859775393,b=b<<11|b>>>21,T+=(R^b)+q[15]+1859775393,T=T<<15|T>>>17,this.first?(this.h0=A+1732584193<<0,this.h1=T-271733879<<0,this.h2=b-1732584194<<0,this.h3=E+271733878<<0,this.first=!1):(this.h0=this.h0+A<<0,this.h1=this.h1+T<<0,this.h2=this.h2+b<<0,this.h3=this.h3+E<<0)},w.prototype.hex=function(){this.finalize();var A=this.h0,T=this.h1,b=this.h2,E=this.h3;return i[A>>4&15]+i[A&15]+i[A>>12&15]+i[A>>8&15]+i[A>>20&15]+i[A>>16&15]+i[A>>28&15]+i[A>>24&15]+i[T>>4&15]+i[T&15]+i[T>>12&15]+i[T>>8&15]+i[T>>20&15]+i[T>>16&15]+i[T>>28&15]+i[T>>24&15]+i[b>>4&15]+i[b&15]+i[b>>12&15]+i[b>>8&15]+i[b>>20&15]+i[b>>16&15]+i[b>>28&15]+i[b>>24&15]+i[E>>4&15]+i[E&15]+i[E>>12&15]+i[E>>8&15]+i[E>>20&15]+i[E>>16&15]+i[E>>28&15]+i[E>>24&15]},w.prototype.toString=w.prototype.hex,w.prototype.digest=function(){this.finalize();var A=this.h0,T=this.h1,b=this.h2,E=this.h3;return[A&255,A>>8&255,A>>16&255,A>>24&255,T&255,T>>8&255,T>>16&255,T>>24&255,b&255,b>>8&255,b>>16&255,b>>24&255,E&255,E>>8&255,E>>16&255,E>>24&255]},w.prototype.array=w.prototype.digest,w.prototype.arrayBuffer=function(){this.finalize();var A=new ArrayBuffer(16),T=new Uint32Array(A);return T[0]=this.h0,T[1]=this.h1,T[2]=this.h2,T[3]=this.h3,A},w.prototype.buffer=w.prototype.arrayBuffer;var S=x();t?yS.exports=S:(r.md4=S,n&&define(function(){return S}))})()});var V5=Z((uge,L5)=>{"use strict";var WT=Xe("crypto"),oge=P5(),ese=O5();function tse(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),Wu(n.slice(0,7),r).copy(t),Wu(n.slice(7,14),r).copy(t,8),Wu(n.slice(14),r).copy(t,16),t}o(tse,"createLMResponse");function rse(r){var e=new Buffer.alloc(16),t=new Buffer.alloc(14),n=new Buffer.from("KGS!@#$%","ascii");return r.length>14?(e.fill(0),e):(t.fill(0),t.write(r.toUpperCase(),0,"ascii"),Buffer.concat([Wu(t.slice(0,7),n),Wu(t.slice(7),n)]))}o(rse,"createLMHash");function Wu(r,e){var t=new Buffer.alloc(8);t[0]=r[0]&254,t[1]=r[0]<<7&255|r[1]>>1,t[2]=r[1]<<6&255|r[2]>>2,t[3]=r[2]<<5&255|r[3]>>3,t[4]=r[3]<<4&255|r[4]>>4,t[5]=r[4]<<3&255|r[5]>>5,t[6]=r[5]<<2&255|r[6]>>6,t[7]=r[6]<<1&255;for(var n=0;n<8;n++){for(var s=0,i=1;i<8;i++)s+=(t[n]>>i)%2;t[n]|=s%2===0?1:0}var a=a.DES.create({type:"encrypt",ley:t});return a.update(e)}o(Wu,"calculateDES");function nse(r,e){var t=new Buffer.alloc(24),n=new Buffer.alloc(21).fill(0);return e.copy(n),Wu(n.slice(0,7),r).copy(t),Wu(n.slice(7,14),r).copy(t,8),Wu(n.slice(14),r).copy(t,16),t}o(nse,"createNTLMResponse");function sse(r){var e=ese.create();return e.update(new Buffer.from(r,"ucs2")),e.buffer()}o(sse,"createNTLMHash");function k5(r,e,t){var n=WT.createHmac("md5",r);return n.update(new Buffer.from(e.toUpperCase()+t,"ucs2")),n.digest()}o(k5,"createNTLMv2Hash");function ise(r,e,t,n,s){var i=new Buffer.alloc(24),a=k5(t,e,s),u=WT.createHmac("md5",a);r.challenge.copy(i,8),i.write(n||zT(16),16,"hex"),u.update(i.slice(8));var c=u.digest();return c.copy(i),i}o(ise,"createLMv2Response");function ase(r,e,t,n,s){var i=new Buffer.alloc(48+r.targetInfo.buffer.length),a=k5(t,e,s),u=WT.createHmac("md5",a);r.challenge.copy(i,8),i.writeUInt32BE(16842752,16),i.writeUInt32LE(0,20);var c=((Date.now()+116444736e5)*1e4).toString(16),f=+("0x"+c.substring(Math.max(0,c.length-8))),h=+("0x"+c.substring(0,Math.max(0,c.length-8)));i.writeUInt32LE(f,24,!1),i.writeUInt32LE(h,28,!1),i.write(n||zT(16),32,"hex"),i.writeUInt32LE(0,40),r.targetInfo.buffer.copy(i,44),i.writeUInt32LE(0,44+r.targetInfo.buffer.length),u.update(i.slice(8));var m=u.digest();return m.copy(i),i}o(ase,"createNTLMv2Response");function zT(r){for(var e="";e.length<r;)e+=Math.floor(Math.random()*16).toString(16);return e}o(zT,"createPseudoRandomValue");L5.exports={createLMHash:rse,createNTLMHash:sse,createLMResponse:tse,createNTLMResponse:nse,createLMv2Response:ise,createNTLMv2Response:ase,createPseudoRandomValue:zT}});var M5=Z((lge,j5)=>{"use strict";var U5=Xe("os"),Ju=y5(),zu=V5(),Yu="NTLMSSP\0";function ose(r,e){var t=32,n=0,s=new Buffer.alloc(1024);return r=r===void 0?U5.hostname():r,e=e===void 0?"":e,s.write(Yu,n,Yu.length,"ascii"),n+=Yu.length,s.writeUInt32LE(1,n),n+=4,s.writeUInt32LE(Ju.NTLMFLAG_NEGOTIATE_OEM|Ju.NTLMFLAG_REQUEST_TARGET|Ju.NTLMFLAG_NEGOTIATE_NTLM_KEY|Ju.NTLMFLAG_NEGOTIATE_NTLM2_KEY|Ju.NTLMFLAG_NEGOTIATE_ALWAYS_SIGN,n),n+=4,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt16LE(e.length,n),n+=2,s.writeUInt32LE(e.length===0?0:t,n),n+=4,e.length>0&&(t+=s.write(e,t,"ascii")),s.writeUInt16LE(r.length,n),n+=2,s.writeUInt16LE(r.length,n),n+=2,s.writeUInt32LE(r.length===0?0:t,n),n+=4,r.length>0&&(t+=s.write(r,t,"ascii")),"NTLM "+s.toString("base64",0,t)}o(ose,"createType1Message");function use(r){if(r===void 0)throw new Error("Invalid argument");if(Object.prototype.toString.call(r)!=="[object String]")if(r.hasOwnProperty("headers")&&r.headers.hasOwnProperty("www-authenticate"))r=r.headers["www-authenticate"];else throw new Error("Invalid argument");var e=/^NTLM ([^,\s]+)/.exec(r);e&&(r=e[1]);var t=new Buffer.from(r,"base64"),n={};if(t.toString("ascii",0,Yu.length)!==Yu)throw new Error("Invalid message signature: "+r);if(t.readUInt32LE(Yu.length)!==2)throw new Error("Invalid message type (no type 2)");return n.flags=t.readUInt32LE(20),n.encoding=n.flags&Ju.NTLMFLAG_NEGOTIATE_OEM?"ascii":"ucs2",n.version=n.flags&Ju.NTLMFLAG_NEGOTIATE_NTLM2_KEY?2:1,n.challenge=t.slice(24,32),n.targetName=(function(){var s=t.readUInt16LE(12),i=t.readUInt32LE(16);if(s===0)return"";if(i+s>t.length||i<32)throw new Error("Bad type 2 message");return t.toString(n.encoding,i,i+s)})(),n.flags&Ju.NTLMFLAG_NEGOTIATE_TARGET_INFO&&(n.targetInfo=(function(){var s={},i=t.readUInt16LE(40),a=t.readUInt32LE(44),u=new Buffer.alloc(i);if(t.copy(u,0,a,a+i),i===0)return s;if(a+i>t.length||a<32)throw new Error("Bad type 2 message");for(var c=a;c<a+i;){var f=t.readUInt16LE(c);c+=2;var h=t.readUInt16LE(c);if(c+=2,f===0)break;var m=void 0;switch(f){case 1:m="SERVER";break;case 2:m="DOMAIN";break;case 3:m="FQDN";break;case 4:m="DNS";break;case 5:m="PARENT_DNS";break;default:m="";break}m&&(s[m]=t.toString("ucs2",c,c+h)),c+=h}return{parsed:s,buffer:u}})()),n}o(use,"decodeType2Message");function cse(r,e,t,n,s){var i=52,a=new Buffer.alloc(1024);if(n===void 0&&(n=U5.hostname()),s===void 0&&(s=r.targetName),a.write(Yu,0,Yu.length,"ascii"),a.writeUInt32LE(3,8),r.version===2){i=64;var u=zu.createNTLMHash(t),c=zu.createPseudoRandomValue(16),f=zu.createLMv2Response(r,e,u,c,s),h=zu.createNTLMv2Response(r,e,u,c,s);a.writeUInt16LE(f.length,12),a.writeUInt16LE(f.length,14),a.writeUInt32LE(i,16),f.copy(a,i),i+=f.length,a.writeUInt16LE(h.length,20),a.writeUInt16LE(h.length,22),a.writeUInt32LE(i,24),h.copy(a,i),i+=h.length}else{var m=zu.createLMHash(t),u=zu.createNTLMHash(t),g=zu.createLMResponse(r.challenge,m),x=zu.createNTLMResponse(r.challenge,u);a.writeUInt16LE(g.length,12),a.writeUInt16LE(g.length,14),a.writeUInt32LE(i,16),g.copy(a,i),i+=g.length,a.writeUInt16LE(x.length,20),a.writeUInt16LE(x.length,22),a.writeUInt32LE(i,24),x.copy(a,i),i+=x.length}return a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,28),a.writeUInt16LE(r.encoding==="ascii"?s.length:s.length*2,30),a.writeUInt32LE(i,32),i+=a.write(s,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,36),a.writeUInt16LE(r.encoding==="ascii"?e.length:e.length*2,38),a.writeUInt32LE(i,40),i+=a.write(e,i,r.encoding),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,44),a.writeUInt16LE(r.encoding==="ascii"?n.length:n.length*2,46),a.writeUInt32LE(i,48),i+=a.write(n,i,r.encoding),r.version===2&&(a.writeUInt16LE(0,52),a.writeUInt16LE(0,54),a.writeUInt32LE(0,56),a.writeUInt32LE(r.flags,60)),"NTLM "+a.toString("base64",0,i)}o(cse,"createType3Message");j5.exports={createType1Message:ose,decodeType2Message:use,createType3Message:cse}});var K5=Z((hge,H5)=>{"use strict";var lse=Xe("util"),fse=Xe("stream"),F5=fse.Writable,q5=q5||function(r){setTimeout(r,0)};H5.exports=Ag;lse.inherits(Ag,F5);function Ag(r){if(!(this instanceof Ag))return new Ag(r);r=r||{},F5.call(this,r)}o(Ag,"DevNull");Ag.prototype._write=function(r,e,t){q5(t)}});var G5=Z($n=>{"use strict";var hse=$n&&$n.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),pse=$n&&$n.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),xS=$n&&$n.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&hse(t,e,n[s]);return pse(t,e),t}})(),dse=$n&&$n.__awaiter||function(r,e,t,n){function s(i){return i instanceof t?i:new t(function(a){a(i)})}return o(s,"adopt"),new(t||(t=Promise))(function(i,a){function u(h){try{f(n.next(h))}catch(m){a(m)}}o(u,"fulfilled");function c(h){try{f(n.throw(h))}catch(m){a(m)}}o(c,"rejected");function f(h){h.done?i(h.value):s(h.value).then(u,c)}o(f,"step"),f((n=n.apply(r,e||[])).next())})},mse=$n&&$n.__generator||function(r,e){var t={label:0,sent:o(function(){if(i[0]&1)throw i[1];return i[1]},"sent"),trys:[],ops:[]},n,s,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(f){return function(h){return c([f,h])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,f[0]&&(t=0)),t;)try{if(n=1,s&&(i=f[0]&2?s.return:f[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,f[1])).done)return i;switch(s=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return t.label++,{value:f[1],done:!1};case 5:t.label++,s=f[1],f=[0];continue;case 7:f=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){t=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){t.label=f[1];break}if(f[0]===6&&t.label<i[1]){t.label=i[1],i=f;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(f);break}i[2]&&t.ops.pop(),t.trys.pop();continue}f=e.call(r,t)}catch(h){f=[6,h],s=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},gse=$n&&$n.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($n,"__esModule",{value:!0});$n.AxiosError=void 0;$n.NtlmClient=wse;var $5=xS(qT());Object.defineProperty($n,"AxiosError",{enumerable:!0,get:o(function(){return $5.AxiosError},"get")});var JT=xS(M5()),vse=xS(Xe("https")),yse=xS(Xe("http")),xse=gse(K5());function wse(r,e){var t=this,n=e??{};n.httpAgent||(n.httpAgent=new yse.Agent({keepAlive:!0})),n.httpsAgent||(n.httpsAgent=new vse.Agent({keepAlive:!0}));var s=$5.default.create(n);return s.interceptors.response.use(function(i){return i},function(i){return dse(t,void 0,void 0,function(){var a,u,c,f,h,m,g,x;return mse(this,function(v){switch(v.label){case 0:return a=i.response,a&&a.status===401&&a.headers["www-authenticate"]&&a.headers["www-authenticate"].includes("NTLM")&&(!a.config.headers["X-retry"]||a.config.headers["X-retry"]!=="false")?(u=((g=a.headers["www-authenticate"].split(",").find(function(w){return w.match(/ *NTLM/)}))===null||g===void 0?void 0:g.trim())||"",a.config.headers||(a.config.headers={}),u.length<50?(c=JT.createType1Message(r.workstation,r.domain),a.config.headers.Authorization=c):(f=JT.decodeType2Message((u.match(/^NTLM\s+(.+?)(,|\s+|$)/)||[])[1]),h=JT.createType3Message(f,r.username,r.password,r.workstation,r.domain),a.config.headers["X-retry"]="false",a.config.headers.Authorization=h),a.config.responseType!=="stream"?[3,2]:(m=(x=i.response)===null||x===void 0?void 0:x.data,m&&!m.readableEnded?[4,new Promise(function(w){m.pipe((0,xse.default)()),m.once("close",w)})]:[3,2])):[3,3];case 1:v.sent(),v.label=2;case 2:return[2,s(a.config)];case 3:throw i}})})}),s}o(wse,"NtlmClient")});var Cg=Z(Qu=>{"use strict";Qu.removeLeadingAndTrailingHTTPWhitespace=r=>r.replace(/^[ \t\n\r]+/u,"").replace(/[ \t\n\r]+$/u,"");Qu.removeTrailingHTTPWhitespace=r=>r.replace(/[ \t\n\r]+$/u,"");Qu.isHTTPWhitespaceChar=r=>r===" "||r===" "||r===`
53
- `||r==="\r";Qu.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);Qu.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);Qu.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());Qu.collectAnHTTPQuotedString=(r,e)=>{let t="";for(e++;;){for(;e<r.length&&r[e]!=='"'&&r[e]!=="\\";)t+=r[e],++e;if(e>=r.length)break;let n=r[e];if(++e,n==="\\"){if(e>=r.length){t+="\\";break}t+=r[e],++e}else break}return[t,e]}});var W5=Z((yge,X5)=>{"use strict";var{asciiLowercase:wS,solelyContainsHTTPTokenCodePoints:Sse,soleyContainsHTTPQuotedStringTokenCodePoints:bse}=Cg();X5.exports=class{static{o(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=wS(String(e)),this._map.get(e)}has(e){return e=wS(String(e)),this._map.has(e)}set(e,t){if(e=wS(String(e)),t=String(t),!Sse(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!bse(t))throw new Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=wS(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var Y5=Z((wge,J5)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:Ese,removeTrailingHTTPWhitespace:z5,isHTTPWhitespaceChar:Ase,solelyContainsHTTPTokenCodePoints:YT,soleyContainsHTTPQuotedStringTokenCodePoints:Cse,asciiLowercase:QT,collectAnHTTPQuotedString:Nse}=Cg();J5.exports=r=>{r=Ese(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!YT(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=z5(n),n.length===0||!YT(n))return null;let s={type:QT(t),subtype:QT(n),parameters:new Map};for(;e<r.length;){for(++e;Ase(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=QT(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=Nse(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=z5(a),a==="")continue}i.length>0&&YT(i)&&Cse(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var Z5=Z((Sge,Q5)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:Tse}=Cg();Q5.exports=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,n]of r.parameters)e+=";",e+=t,e+="=",(!Tse(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var nV=Z((Ege,rV)=>{"use strict";var Ise=W5(),_se=Y5(),Bse=Z5(),{asciiLowercase:eV,solelyContainsHTTPTokenCodePoints:tV}=Cg();rV.exports=class{static{o(this,"MIMEType")}constructor(e){e=String(e);let t=_se(e);if(t===null)throw new Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new Ise(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=eV(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!tV(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=eV(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!tV(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return Bse(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var Zu=Z(gn=>{"use strict";var Dse=gn&&gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Rse=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Pse=gn&&gn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Dse(t,e,n[s]);return Rse(t,e),t}})();Object.defineProperty(gn,"__esModule",{value:!0});gn.wsdlCacheSingleton=gn.TNS_PREFIX=void 0;gn.passwordDigest=kse;gn.findPrefix=Lse;gn.splitQName=Vse;gn.xmlEscape=Use;gn.parseMTOMResp=jse;var Ose=Pse(Xe("crypto"));function kse(r,e,t){let n=Ose.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),u=Buffer.concat([s,i,a]);return n.update(u),n.digest("base64")}o(kse,"passwordDigest");gn.TNS_PREFIX="__tns__";function Lse(r,e){for(let t in r)if(t!==gn.TNS_PREFIX&&r[t]===e)return t}o(Lse,"findPrefix");function Vse(r){if(typeof r!="string")return{prefix:gn.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||gn.TNS_PREFIX,name:e.substring(t+1)}}o(Vse,"splitQName");function Use(r){return typeof r=="string"?r.substr(0,9)==="<![CDATA["&&r.substr(-3)==="]]>"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):r}o(Use,"xmlEscape");function jse(r,e,t){return import("./src-NRIPS2N7.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",u,c=0,f=new n;return f.initWithBoundary(e),f.on("data",({name:h,buffer:m,start:g,end:x})=>{switch(h){case"partBegin":s.parts[c]={body:null,headers:{}},u=Buffer.from("");break;case"headerField":i=m.slice(g,x).toString();break;case"headerValue":a=m.slice(g,x).toString();break;case"headerEnd":s.parts[c].headers[i.toLowerCase()]=a;break;case"partData":u=Buffer.concat([u,m.slice(g,x)]);break;case"partEnd":s.parts[c].body=u,c++;break}}),f.write(r),t(null,s)}).catch(t)}o(jse,"parseMTOMResp");var Mse=class{static{o(this,"DefaultWSDLCache")}constructor(){this.cache={}}has(e){return!!this.cache[e]}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}clear(){this.cache={}}};gn.wsdlCacheSingleton=new Mse});var sV=Z((Ige,Fse)=>{Fse.exports={name:"soap",version:"1.6.0",description:"A minimal node SOAP client",engines:{node:">=14.17.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.12.2","axios-ntlm":"^1.4.6",debug:"^4.4.3",formidable:"^3.5.4","get-stream":"^6.0.1",lodash:"^4.17.21",sax:"^1.4.1","strip-bom":"^3.0.0","whatwg-mimetype":"4.0.0","xml-crypto":"^6.1.2"},repository:{type:"git",url:"https://github.com/vpulim/node-soap.git"},main:"./lib/soap.js",types:"./lib/soap.d.ts",directories:{lib:"./lib",test:"./test"},scripts:{build:"tsc -p .",watch:"tsc -w -p .",lint:"eslint .",format:"prettier --write .","format:check":"prettier --check .",toc:"./node_modules/.bin/doctoc Readme.md --github --maxlevel 3",cover:"OPENSSL_ENABLE_SHA1_SIGNATURES=1 nyc --extension=.ts --reporter=lcov --reporter=html --reporter=text mocha --no-parallel --timeout 30000 --exit test/*-test.js test/security/*.js",coveralls:"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js -v",docs:"typedoc --out docs",test:"mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^9.38.0","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/lodash":"^4.17.20","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^3.0.2","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.2.1",duplexer:"~0.1.2",eslint:"^9.38.0",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^11.0.3",mocha:"^11.7.4",nyc:"^17.1.0",prettier:"^3.6.2","readable-stream":"^4.7.0",semver:"^7.7.3","serve-static":"^2.2.0",should:"^13.2.3",sinon:"^21.0.0","source-map-support":"^0.5.21",timekeeper:"^2.3.1",typedoc:"^0.28.14",typescript:"^5.9.3","typescript-eslint":"^8.46.1"}}});var SS=Z(Di=>{"use strict";var qse=Di&&Di.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Hse=Di&&Di.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),oV=Di&&Di.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&qse(t,e,n[s]);return Hse(t,e),t}})(),uV=Di&&Di.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Di,"__esModule",{value:!0});Di.HttpClient=void 0;var Kse=oV(qT()),$se=G5(),iV=Xe("crypto"),Gse=uV(bp()),Xse=oV(Xe("url")),Wse=uV(nV()),zse=Xe("zlib"),Jse=Zu(),aV=(0,Gse.default)("node-soap"),Yse=sV(),Qse=class{static{o(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||Kse.create()}buildRequest(e,t,n,s={}){let i=Xse.parse(e),a=t?"POST":"GET",u=i.hostname,c=parseInt(i.port,10),f={"User-Agent":"node-soap/"+Yse.version,Accept:"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8","Accept-Encoding":"none","Accept-Charset":"utf-8",...s.forever&&{Connection:"keep-alive"},Host:u+(isNaN(c)?"":":"+c)},h=["headers"],{attachments:m,...g}=s,x=m||[];typeof t=="string"&&x.length===0&&!s.forceMTOM&&(f["Content-Length"]=Buffer.byteLength(t,"utf8"),f["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let w in n)f[w]=n[w];let v={url:i.href,method:a,headers:f,transformResponse:o(w=>w,"transformResponse")};if(s.ntlm||(v.validateStatus=null),s.forceMTOM||x.length>0){let w=(0,iV.randomUUID)(),S=null;if(f["Content-Type"].indexOf("action")>-1)for(let E of f["Content-Type"].split("; "))E.indexOf("action")>-1&&(S=E);let A=(0,iV.randomUUID)();f["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+w+'>"; start-info="text/xml"; boundary='+A,S&&(f["Content-Type"]=f["Content-Type"]+"; "+S);let T=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+w+">",body:t}];x.forEach(E=>{T.push({"Content-Type":E.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+E.contentId+">","Content-Disposition":'attachment; filename="'+E.name+'"',body:E.body})}),v.data=[Buffer.from(`--${A}\r
54
+ `||r==="\r";Qu.solelyContainsHTTPTokenCodePoints=r=>/^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u.test(r);Qu.soleyContainsHTTPQuotedStringTokenCodePoints=r=>/^[\t\u0020-\u007E\u0080-\u00FF]*$/u.test(r);Qu.asciiLowercase=r=>r.replace(/[A-Z]/ug,e=>e.toLowerCase());Qu.collectAnHTTPQuotedString=(r,e)=>{let t="";for(e++;;){for(;e<r.length&&r[e]!=='"'&&r[e]!=="\\";)t+=r[e],++e;if(e>=r.length)break;let n=r[e];if(++e,n==="\\"){if(e>=r.length){t+="\\";break}t+=r[e],++e}else break}return[t,e]}});var W5=Z((yge,X5)=>{"use strict";var{asciiLowercase:wS,solelyContainsHTTPTokenCodePoints:Sse,soleyContainsHTTPQuotedStringTokenCodePoints:bse}=Cg();X5.exports=class{static{o(this,"MIMETypeParameters")}constructor(e){this._map=e}get size(){return this._map.size}get(e){return e=wS(String(e)),this._map.get(e)}has(e){return e=wS(String(e)),this._map.has(e)}set(e,t){if(e=wS(String(e)),t=String(t),!Sse(e))throw new Error(`Invalid MIME type parameter name "${e}": only HTTP token code points are valid.`);if(!bse(t))throw new Error(`Invalid MIME type parameter value "${t}": only HTTP quoted-string token code points are valid.`);return this._map.set(e,t)}clear(){this._map.clear()}delete(e){return e=wS(String(e)),this._map.delete(e)}forEach(e,t){this._map.forEach(e,t)}keys(){return this._map.keys()}values(){return this._map.values()}entries(){return this._map.entries()}[Symbol.iterator](){return this._map[Symbol.iterator]()}}});var Y5=Z((wge,J5)=>{"use strict";var{removeLeadingAndTrailingHTTPWhitespace:Ese,removeTrailingHTTPWhitespace:z5,isHTTPWhitespaceChar:Ase,solelyContainsHTTPTokenCodePoints:YT,soleyContainsHTTPQuotedStringTokenCodePoints:Cse,asciiLowercase:QT,collectAnHTTPQuotedString:Nse}=Cg();J5.exports=r=>{r=Ese(r);let e=0,t="";for(;e<r.length&&r[e]!=="/";)t+=r[e],++e;if(t.length===0||!YT(t)||e>=r.length)return null;++e;let n="";for(;e<r.length&&r[e]!==";";)n+=r[e],++e;if(n=z5(n),n.length===0||!YT(n))return null;let s={type:QT(t),subtype:QT(n),parameters:new Map};for(;e<r.length;){for(++e;Ase(r[e]);)++e;let i="";for(;e<r.length&&r[e]!==";"&&r[e]!=="=";)i+=r[e],++e;if(i=QT(i),e<r.length){if(r[e]===";")continue;++e}let a=null;if(r[e]==='"')for([a,e]=Nse(r,e);e<r.length&&r[e]!==";";)++e;else{for(a="";e<r.length&&r[e]!==";";)a+=r[e],++e;if(a=z5(a),a==="")continue}i.length>0&&YT(i)&&Cse(a)&&!s.parameters.has(i)&&s.parameters.set(i,a)}return s}});var Z5=Z((Sge,Q5)=>{"use strict";var{solelyContainsHTTPTokenCodePoints:Tse}=Cg();Q5.exports=r=>{let e=`${r.type}/${r.subtype}`;if(r.parameters.size===0)return e;for(let[t,n]of r.parameters)e+=";",e+=t,e+="=",(!Tse(n)||n.length===0)&&(n=n.replace(/(["\\])/ug,"\\$1"),n=`"${n}"`),e+=n;return e}});var nV=Z((Ege,rV)=>{"use strict";var Ise=W5(),_se=Y5(),Bse=Z5(),{asciiLowercase:eV,solelyContainsHTTPTokenCodePoints:tV}=Cg();rV.exports=class{static{o(this,"MIMEType")}constructor(e){e=String(e);let t=_se(e);if(t===null)throw new Error(`Could not parse MIME type string "${e}"`);this._type=t.type,this._subtype=t.subtype,this._parameters=new Ise(t.parameters)}static parse(e){try{return new this(e)}catch{return null}}get essence(){return`${this.type}/${this.subtype}`}get type(){return this._type}set type(e){if(e=eV(String(e)),e.length===0)throw new Error("Invalid type: must be a non-empty string");if(!tV(e))throw new Error(`Invalid type ${e}: must contain only HTTP token code points`);this._type=e}get subtype(){return this._subtype}set subtype(e){if(e=eV(String(e)),e.length===0)throw new Error("Invalid subtype: must be a non-empty string");if(!tV(e))throw new Error(`Invalid subtype ${e}: must contain only HTTP token code points`);this._subtype=e}get parameters(){return this._parameters}toString(){return Bse(this)}isJavaScript({prohibitParameters:e=!1}={}){switch(this._type){case"text":switch(this._subtype){case"ecmascript":case"javascript":case"javascript1.0":case"javascript1.1":case"javascript1.2":case"javascript1.3":case"javascript1.4":case"javascript1.5":case"jscript":case"livescript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}case"application":switch(this._subtype){case"ecmascript":case"javascript":case"x-ecmascript":case"x-javascript":return!e||this._parameters.size===0;default:return!1}default:return!1}}isXML(){return this._subtype==="xml"&&(this._type==="text"||this._type==="application")||this._subtype.endsWith("+xml")}isHTML(){return this._subtype==="html"&&this._type==="text"}}});var Zu=Z(gn=>{"use strict";var Dse=gn&&gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Rse=gn&&gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),Pse=gn&&gn.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&Dse(t,e,n[s]);return Rse(t,e),t}})();Object.defineProperty(gn,"__esModule",{value:!0});gn.wsdlCacheSingleton=gn.TNS_PREFIX=void 0;gn.passwordDigest=kse;gn.findPrefix=Lse;gn.splitQName=Vse;gn.xmlEscape=Use;gn.parseMTOMResp=jse;var Ose=Pse(Xe("crypto"));function kse(r,e,t){let n=Ose.createHash("sha1"),s=Buffer.from(r||"","base64"),i=Buffer.from(e||"","utf8"),a=Buffer.from(t||"","utf8"),u=Buffer.concat([s,i,a]);return n.update(u),n.digest("base64")}o(kse,"passwordDigest");gn.TNS_PREFIX="__tns__";function Lse(r,e){for(let t in r)if(t!==gn.TNS_PREFIX&&r[t]===e)return t}o(Lse,"findPrefix");function Vse(r){if(typeof r!="string")return{prefix:gn.TNS_PREFIX,name:r};let[e]=r.split("|",1),t=e.indexOf(":");return{prefix:e.substring(0,t)||gn.TNS_PREFIX,name:e.substring(t+1)}}o(Vse,"splitQName");function Use(r){return typeof r=="string"?r.substr(0,9)==="<![CDATA["&&r.substr(-3)==="]]>"?r:r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):r}o(Use,"xmlEscape");function jse(r,e,t){return import("./src-B7B5NP75.mjs").then(({MultipartParser:n})=>{let s={parts:[]},i="",a="",u,c=0,f=new n;return f.initWithBoundary(e),f.on("data",({name:h,buffer:m,start:g,end:x})=>{switch(h){case"partBegin":s.parts[c]={body:null,headers:{}},u=Buffer.from("");break;case"headerField":i=m.slice(g,x).toString();break;case"headerValue":a=m.slice(g,x).toString();break;case"headerEnd":s.parts[c].headers[i.toLowerCase()]=a;break;case"partData":u=Buffer.concat([u,m.slice(g,x)]);break;case"partEnd":s.parts[c].body=u,c++;break}}),f.write(r),t(null,s)}).catch(t)}o(jse,"parseMTOMResp");var Mse=class{static{o(this,"DefaultWSDLCache")}constructor(){this.cache={}}has(e){return!!this.cache[e]}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}clear(){this.cache={}}};gn.wsdlCacheSingleton=new Mse});var sV=Z((Ige,Fse)=>{Fse.exports={name:"soap",version:"1.6.0",description:"A minimal node SOAP client",engines:{node:">=14.17.0"},author:"Vinay Pulim <v@pulim.com>",dependencies:{axios:"^1.12.2","axios-ntlm":"^1.4.6",debug:"^4.4.3",formidable:"^3.5.4","get-stream":"^6.0.1",lodash:"^4.17.21",sax:"^1.4.1","strip-bom":"^3.0.0","whatwg-mimetype":"4.0.0","xml-crypto":"^6.1.2"},repository:{type:"git",url:"https://github.com/vpulim/node-soap.git"},main:"./lib/soap.js",types:"./lib/soap.d.ts",directories:{lib:"./lib",test:"./test"},scripts:{build:"tsc -p .",watch:"tsc -w -p .",lint:"eslint .",format:"prettier --write .","format:check":"prettier --check .",toc:"./node_modules/.bin/doctoc Readme.md --github --maxlevel 3",cover:"OPENSSL_ENABLE_SHA1_SIGNATURES=1 nyc --extension=.ts --reporter=lcov --reporter=html --reporter=text mocha --no-parallel --timeout 30000 --exit test/*-test.js test/security/*.js",coveralls:"cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js -v",docs:"typedoc --out docs",test:"mocha --timeout 15000 --bail --exit test/*-test.js test/security/*.js"},keywords:["soap"],license:"MIT",devDependencies:{"@eslint/js":"^9.38.0","@types/debug":"^4.1.12","@types/formidable":"^3.4.6","@types/lodash":"^4.17.20","@types/node":"^14.0.0","@types/sax":"^1.2.7","@types/whatwg-mimetype":"^3.0.2","body-parser":"^2.2.0",colors:"^1.4.0",diff:"^8.0.2",doctoc:"^2.2.1",duplexer:"~0.1.2",eslint:"^9.38.0",express:"^5.1.0",finalhandler:"^2.1.0",glob:"^11.0.3",mocha:"^11.7.4",nyc:"^17.1.0",prettier:"^3.6.2","readable-stream":"^4.7.0",semver:"^7.7.3","serve-static":"^2.2.0",should:"^13.2.3",sinon:"^21.0.0","source-map-support":"^0.5.21",timekeeper:"^2.3.1",typedoc:"^0.28.14",typescript:"^5.9.3","typescript-eslint":"^8.46.1"}}});var SS=Z(Di=>{"use strict";var qse=Di&&Di.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Hse=Di&&Di.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),oV=Di&&Di.__importStar||(function(){var r=o(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[n.length]=s);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),s=0;s<n.length;s++)n[s]!=="default"&&qse(t,e,n[s]);return Hse(t,e),t}})(),uV=Di&&Di.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Di,"__esModule",{value:!0});Di.HttpClient=void 0;var Kse=oV(qT()),$se=G5(),iV=Xe("crypto"),Gse=uV(bp()),Xse=oV(Xe("url")),Wse=uV(nV()),zse=Xe("zlib"),Jse=Zu(),aV=(0,Gse.default)("node-soap"),Yse=sV(),Qse=class{static{o(this,"HttpClient")}constructor(e){e=e||{},this.options=e,this._request=e.request||Kse.create()}buildRequest(e,t,n,s={}){let i=Xse.parse(e),a=t?"POST":"GET",u=i.hostname,c=parseInt(i.port,10),f={"User-Agent":"node-soap/"+Yse.version,Accept:"text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8","Accept-Encoding":"none","Accept-Charset":"utf-8",...s.forever&&{Connection:"keep-alive"},Host:u+(isNaN(c)?"":":"+c)},h=["headers"],{attachments:m,...g}=s,x=m||[];typeof t=="string"&&x.length===0&&!s.forceMTOM&&(f["Content-Length"]=Buffer.byteLength(t,"utf8"),f["Content-Type"]="application/x-www-form-urlencoded"),n=n||{};for(let w in n)f[w]=n[w];let v={url:i.href,method:a,headers:f,transformResponse:o(w=>w,"transformResponse")};if(s.ntlm||(v.validateStatus=null),s.forceMTOM||x.length>0){let w=(0,iV.randomUUID)(),S=null;if(f["Content-Type"].indexOf("action")>-1)for(let E of f["Content-Type"].split("; "))E.indexOf("action")>-1&&(S=E);let A=(0,iV.randomUUID)();f["Content-Type"]='multipart/related; type="application/xop+xml"; start="<'+w+'>"; start-info="text/xml"; boundary='+A,S&&(f["Content-Type"]=f["Content-Type"]+"; "+S);let T=[{"Content-Type":'application/xop+xml; charset=UTF-8; type="text/xml"',"Content-ID":"<"+w+">",body:t}];x.forEach(E=>{T.push({"Content-Type":E.mimetype,"Content-Transfer-Encoding":"binary","Content-ID":"<"+E.contentId+">","Content-Disposition":'attachment; filename="'+E.name+'"',body:E.body})}),v.data=[Buffer.from(`--${A}\r
54
55
  `)];let b=0;T.forEach(E=>{Object.keys(E).forEach(C=>{C!=="body"&&v.data.push(Buffer.from(`${C}: ${E[C]}\r
55
56
  `))}),v.data.push(Buffer.from(`\r
56
57
  `),Buffer.from(E.body),Buffer.from(`\r
@@ -97,7 +98,7 @@ ${e.join(`
97
98
  <?`):this.result.push("<?"),this.result.push(t),e.nodeValue&&(this.result.push(" "),this.result.push(this.NormalizeString(e.nodeValue,Ut.ProcessingInstruction))),this.state===hi.BeforeDocElement?this.result.push(`?>
98
99
  `):this.result.push("?>"))}WriteElementNode(e){let t=this.state;this.state===hi.BeforeDocElement&&(this.state=hi.InsideDocElement),this.result.push("<"),this.result.push(e.nodeName);let n=this.WriteNamespacesAxis(e);this.WriteAttributesAxis(e),this.result.push(">");for(let s=e.firstChild;s!=null;s=s.nextSibling)this.WriteNode(s);for(this.result.push("</"),this.result.push(e.nodeName),this.result.push(">"),t===hi.BeforeDocElement&&(this.state=hi.AfterDocElement);n--;)this.visibleNamespaces.Pop()}WriteNamespacesAxis(e){let t=[],n=0;for(let i=0;i<e.attributes.length;i++){let a=e.attributes[i];if(!jD(a)){if(a.prefix&&!this.IsNamespaceRendered(a.prefix,a.namespaceURI)){let h={prefix:a.prefix,namespace:a.namespaceURI};t.push(h),this.visibleNamespaces.Add(h),n++}continue}if(a.localName==="xmlns"&&!a.prefix&&!a.nodeValue){let h={prefix:a.prefix,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}let u=null,c;(c=/xmlns:([\w.-]+)/.exec(a.nodeName))&&(u=c[1]);let f=!0;if(this.exclusive&&!this.IsNamespaceInclusive(e,u)){let h=_9(e,u);if(h>1)f=!1;else if(h===0)continue}if(!this.IsNamespaceRendered(u,a.nodeValue)&&f){let h={prefix:u,namespace:a.nodeValue};t.push(h),this.visibleNamespaces.Add(h),n++}}if(!this.IsNamespaceRendered(e.prefix,e.namespaceURI)&&e.namespaceURI!=="http://www.w3.org/2000/xmlns/"){let i={prefix:e.prefix,namespace:e.namespaceURI};t.push(i),this.visibleNamespaces.Add(i),n++}t.sort(uhe);let s=null;return t.forEach(i=>{i.prefix!==s&&(s=i.prefix,this.result.push(" xmlns"),i.prefix&&this.result.push(":"+i.prefix),this.result.push('="'),this.result.push(i.namespace||""),this.result.push('"'))}),n}WriteAttributesAxis(e){let t=[];for(let n=0;n<e.attributes.length;n++){let s=e.attributes[n];jD(s)||t.push(s)}t.sort(che),t.forEach(n=>{n!=null&&(this.result.push(" "),this.result.push(n.nodeName),this.result.push('="'),this.result.push(this.NormalizeString(n.nodeValue,Ut.Attribute)),this.result.push('"'))})}NormalizeString(e,t){let n=[];if(e)for(let s=0;s<e.length;s++){let i=e[s];i==="<"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&lt;"):i===">"&&this.IsTextNode(t)?n.push("&gt;"):i==="&"&&(t===Ut.Attribute||this.IsTextNode(t))?n.push("&amp;"):i==='"'&&t===Ut.Attribute?n.push("&quot;"):i===" "&&t===Ut.Attribute?n.push("&#x9;"):i===`
99
100
  `&&t===Ut.Attribute?n.push("&#xA;"):i==="\r"?n.push("&#xD;"):n.push(i)}return n.join("")}IsTextNode(e){switch(e){case Ut.Text:case Ut.CDATA:case Ut.SignificantWhitespace:case Ut.Whitespace:return!0}return!1}IsNamespaceInclusive(e,t){let n=t||null;return e.prefix===n?!1:this.inclusiveNamespacesPrefixList.indexOf(n||"")!==-1}IsNamespaceRendered(e,t){if(e=e||"",t=t||"",!e&&!t||e==="xml"&&t==="http://www.w3.org/XML/1998/namespace")return!0;let n=this.visibleNamespaces.GetPrefix(e);return n?n.namespace===t:!1}};function uhe(r,e){return r==e?0:r?e?r.prefix?e.prefix?r.prefix<e.prefix?-1:r.prefix>e.prefix?1:0:1:-1:1:-1}o(uhe,"XmlDsigC14NTransformNamespacesComparer");function che(r,e){if(!r.namespaceURI&&e.namespaceURI)return-1;if(!e.namespaceURI&&r.namespaceURI)return 1;let t=(r.namespaceURI||"")+r.localName,n=(e.namespaceURI||"")+e.localName;return t===n?0:t<n?-1:1}o(che,"XmlDsigC14NTransformAttributesComparer");function _9(r,e,t=0){let n=e||null;if(r.prefix===n)return++t;if(r.attributes)for(let s=0;s<r.attributes.length;s++){let i=r.attributes[s];if(!jD(i)&&e&&r.attributes[s].prefix===e)return++t}for(let s=r.firstChild;s;s=s.nextSibling)if(s.nodeType===Ut.Element){let a=_9(s,e,t);if(s.nodeType===Ut.Element&&a)return++t+a}return t}o(_9,"IsNamespaceUsed");function jD(r){let e=/xmlns:/;return!!(r!==null&&r.nodeType===Ut.Attribute&&(r.nodeName==="xmlns"||e.test(r.nodeName)))}o(jD,"IsNamespaceNode");var iC=class extends $i{static{o(this,"SignatureMethodOther")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element||n.nodeName===me.ElementNames.HMACOutputLength)continue;let s;switch(n.localName){case me.ElementNames.RSAPSSParams:s=xa;break;default:break}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};iC=He([jt({localName:"Other"})],iC);var uo=class extends Kr{static{o(this,"SignatureMethod")}};He([Or({localName:me.AttributeNames.Algorithm,required:!0,defaultValue:""}),ht("design:type",String)],uo.prototype,"Algorithm",void 0);He([Gt({localName:me.ElementNames.HMACOutputLength,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,converter:Wg}),ht("design:type",Number)],uo.prototype,"HMACOutputLength",void 0);He([Gt({parser:iC,noRoot:!0,minOccurs:0}),ht("design:type",iC)],uo.prototype,"Any",void 0);uo=He([jt({localName:me.ElementNames.SignatureMethod})],uo);var h0=class extends Kr{static{o(this,"CanonicalizationMethod")}};He([Or({localName:me.AttributeNames.Algorithm,required:!0,defaultValue:me.DefaultCanonMethod}),ht("design:type",String)],h0.prototype,"Algorithm",void 0);h0=He([jt({localName:me.ElementNames.CanonicalizationMethod})],h0);var p0=class extends Kr{static{o(this,"DataObject")}};He([Or({localName:me.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],p0.prototype,"Id",void 0);He([Or({localName:me.AttributeNames.MimeType,defaultValue:""}),ht("design:type",String)],p0.prototype,"MimeType",void 0);He([Or({localName:me.AttributeNames.Encoding,defaultValue:""}),ht("design:type",String)],p0.prototype,"Encoding",void 0);p0=He([jt({localName:me.ElementNames.Object})],p0);var sx=class extends $i{static{o(this,"DataObjects")}};sx=He([jt({localName:"xmldsig_objects",parser:p0})],sx);var ls=class extends Kr{static{o(this,"Transform")}constructor(){super(...arguments),this.innerXml=null}GetOutput(){throw new Fe(Te.METHOD_NOT_IMPLEMENTED)}LoadInnerXml(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"node");this.innerXml=e}GetInnerXml(){return this.innerXml}};He([Or({localName:me.AttributeNames.Algorithm,defaultValue:""}),ht("design:type",String)],ls.prototype,"Algorithm",void 0);He([Gt({localName:me.ElementNames.XPath,defaultValue:""}),ht("design:type",String)],ls.prototype,"XPath",void 0);ls=He([jt({localName:me.ElementNames.Transform})],ls);var fu=class extends ls{static{o(this,"XmlDsigBase64Transform")}constructor(){super(...arguments),this.Algorithm=me.AlgorithmNamespaces.XmlDsigBase64Transform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return wr.FromString(this.innerXml.textContent||"","base64")}};var co=class extends ls{static{o(this,"XmlDsigC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315",this.xmlCanonicalizer=new oo(!1,!1)}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}},lo=class extends co{static{o(this,"XmlDsigC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments",this.xmlCanonicalizer=new oo(!0,!1)}};var hu=class extends ls{static{o(this,"XmlDsigEnvelopedSignatureTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");let e=this.innerXml.firstChild,t=[];for(;e;)oi(e)&&e.localName===me.ElementNames.Signature&&e.namespaceURI===me.NamespaceURI&&t.push(e),e=e.nextSibling;for(let n of t)n.parentNode?.removeChild(n);return this.innerXml}};var fo=class extends ls{static{o(this,"XmlDsigExcC14NTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#",this.xmlCanonicalizer=new oo(!1,!0)}get InclusiveNamespacesPrefixList(){return this.xmlCanonicalizer.InclusiveNamespacesPrefixList}set InclusiveNamespacesPrefixList(e){this.xmlCanonicalizer.InclusiveNamespacesPrefixList=e}LoadXml(e){if(super.LoadXml(e),this.Element&&this.Element.childNodes)for(let t=0;t<this.Element.childNodes.length;t++){let n=this.Element.childNodes[t];if(n&&n.nodeType===1)switch(n.localName){case"InclusiveNamespaces":this.setInclusiveNamespacesElement(n);break}}}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");return this.xmlCanonicalizer.Canonicalize(this.innerXml)}setInclusiveNamespacesElement(e){let t=e.getAttribute("PrefixList");t&&t.length>0&&(this.xmlCanonicalizer.InclusiveNamespacesPrefixList=t)}},ho=class extends fo{static{o(this,"XmlDsigExcC14NWithCommentsTransform")}constructor(){super(...arguments),this.Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#WithComments",this.xmlCanonicalizer=new oo(!0,!0)}};function B9(r){return r.parentNode?B9(r.parentNode):r}o(B9,"lookupParentNode");var d0=class extends ls{static{o(this,"XmlDsigXPathTransform")}constructor(){super(...arguments),this.Algorithm=me.AlgorithmNamespaces.XmlDsigXPathTransform}GetOutput(){if(!this.innerXml)throw new Fe(Te.PARAM_REQUIRED,"innerXml");this.Filter(B9(this.innerXml),this.XPath)}Filter(e,t){let n=e.childNodes,s=[];for(let i=0;n&&i<n.length;i++){let a=n.item(i);s.push(a)}s.forEach(i=>{this.Evaluate(i,t)?i.parentNode&&i.parentNode.removeChild(i):this.Filter(i,t)})}GetEvaluator(e){return typeof self<"u"?e.ownerDocument==null?e:e.ownerDocument:Yp("xpath")}Evaluate(e,t){try{let n=this.GetEvaluator(e),s=this.GetXml();if(!s||!s.firstChild)throw new Error("XML element or firstChild is not defined");let i=s.firstChild,a=`boolean(${t})`,u=typeof self>"u"?Yp("xpath"):self;return!n.evaluate(a,e,{lookupNamespaceURI:o(f=>i.lookupNamespaceURI(f),"lookupNamespaceURI")},u.XPathResult.ANY_TYPE,null).booleanValue}catch{return!1}}};He([Gt({localName:me.ElementNames.XPath,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,required:!0}),ht("design:type",String)],d0.prototype,"XPath",void 0);var m0=class extends $i{static{o(this,"Transforms")}OnLoadXml(e){super.OnLoadXml(e),this.items=this.GetIterator().map(t=>{switch(t.Algorithm){case me.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:return Rh(t,hu);case me.AlgorithmNamespaces.XmlDsigC14NTransform:return Rh(t,co);case me.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:return Rh(t,lo);case me.AlgorithmNamespaces.XmlDsigExcC14NTransform:return Rh(t,fo);case me.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:return Rh(t,ho);case me.AlgorithmNamespaces.XmlDsigBase64Transform:return Rh(t,fu);case me.AlgorithmNamespaces.XmlDsigXPathTransform:return Rh(t,d0);default:try{let n=ix.CreateFromName(t.Algorithm);if(!t.Element)throw new Error("Transform element is not defined");return n.LoadXml(t.Element),n}catch{throw new Fe(Te.CRYPTOGRAPHIC_UNKNOWN_TRANSFORM,t.Algorithm)}}})}};m0=He([jt({localName:me.ElementNames.Transforms,parser:ls})],m0);function Rh(r,e){let t=new e;if(!r.Element)throw new Error("Transform element is not defined");return t.LoadXml(r.Element),t}o(Rh,"ChangeTransform");var po=class extends Kr{static{o(this,"Reference")}constructor(e){super(),this.DigestMethod=new Gi,e&&(this.Uri=e)}};He([Or({defaultValue:""}),ht("design:type",String)],po.prototype,"Id",void 0);He([Or({localName:me.AttributeNames.URI}),ht("design:type",String)],po.prototype,"Uri",void 0);He([Or({localName:me.AttributeNames.Type,defaultValue:""}),ht("design:type",String)],po.prototype,"Type",void 0);He([Gt({parser:m0}),ht("design:type",m0)],po.prototype,"Transforms",void 0);He([Gt({required:!0,parser:Gi}),ht("design:type",Gi)],po.prototype,"DigestMethod",void 0);He([Gt({required:!0,localName:me.ElementNames.DigestValue,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,converter:Vi}),ht("design:type",Uint8Array)],po.prototype,"DigestValue",void 0);po=He([jt({localName:me.ElementNames.Reference}),ht("design:paramtypes",[String])],po);var g0=class extends $i{static{o(this,"References")}};g0=He([jt({localName:"References",parser:po})],g0);var pu=class extends Kr{static{o(this,"SignedInfo")}};He([Or({localName:me.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],pu.prototype,"Id",void 0);He([Gt({parser:h0,required:!0}),ht("design:type",h0)],pu.prototype,"CanonicalizationMethod",void 0);He([Gt({parser:uo,required:!0}),ht("design:type",uo)],pu.prototype,"SignatureMethod",void 0);He([Gt({parser:g0,minOccurs:1,noRoot:!0}),ht("design:type",g0)],pu.prototype,"References",void 0);pu=He([jt({localName:me.ElementNames.SignedInfo})],pu);var w0="http://www.w3.org/2001/04/xmldsig-more#",S0="ecdsa",Ph=class extends Ms{static{o(this,"EcdsaPublicKey")}};He([Gt({localName:me.ElementNames.X,namespaceURI:w0,prefix:S0,required:!0,converter:Vi}),ht("design:type",Uint8Array)],Ph.prototype,"X",void 0);He([Gt({localName:me.ElementNames.Y,namespaceURI:w0,prefix:S0,required:!0,converter:Vi}),ht("design:type",Uint8Array)],Ph.prototype,"Y",void 0);Ph=He([jt({localName:me.ElementNames.PublicKey,namespaceURI:w0,prefix:S0})],Ph);var v0=class extends Ms{static{o(this,"NamedCurve")}};He([Or({localName:me.AttributeNames.URI,required:!0}),ht("design:type",String)],v0.prototype,"Uri",void 0);v0=He([jt({localName:me.ElementNames.NamedCurve,namespaceURI:w0,prefix:S0})],v0);var y0=class extends Ms{static{o(this,"DomainParameters")}};He([Gt({parser:v0}),ht("design:type",v0)],y0.prototype,"NamedCurve",void 0);y0=He([jt({localName:me.ElementNames.DomainParameters,namespaceURI:w0,prefix:S0})],y0);var x0=class extends fi{static{o(this,"EcdsaKeyValue")}constructor(){super(...arguments),this.name=me.ElementNames.ECDSAKeyValue,this.key=null,this.jwk=null,this.keyUsage=null}static canImportCryptoKey(e){return e.algorithm.name.toUpperCase()===cu.toUpperCase()}get NamedCurve(){return R9(this.DomainParameters.NamedCurve.Uri)}async importKey(e){if(!e.algorithm.name||e.algorithm.name.toUpperCase()!=="ECDSA")throw new Fe(Te.ALGORITHM_WRONG_NAME,e.algorithm.name);let t=await vn.crypto.subtle.exportKey("jwk",e);return this.key=e,this.jwk=t,this.PublicKey=new Ph,this.PublicKey.X=wr.FromString(t.x||"","base64url"),this.PublicKey.Y=wr.FromString(t.y||"","base64url"),this.DomainParameters||(this.DomainParameters=new y0),this.DomainParameters.NamedCurve||(this.DomainParameters.NamedCurve=new v0),this.DomainParameters.NamedCurve.Uri=R9(t.crv||""),this.keyUsage=e.usages,this}async exportKey(e){if(this.key)return this.key;let t=wr.ToBase64Url(this.PublicKey.X),n=wr.ToBase64Url(this.PublicKey.Y),s=lhe(this.DomainParameters.NamedCurve.Uri),i={kty:"EC",crv:s,x:t,y:n,ext:!0};this.keyUsage=["verify"];let a=await vn.crypto.subtle.importKey("jwk",i,{name:"ECDSA",namedCurve:s},!0,this.keyUsage);return this.key=a,this.key}};He([Gt({parser:y0}),ht("design:type",y0)],x0.prototype,"DomainParameters",void 0);He([Gt({parser:Ph,required:!0}),ht("design:type",Ph)],x0.prototype,"PublicKey",void 0);x0=He([jt({localName:me.ElementNames.ECDSAKeyValue,namespaceURI:w0,prefix:S0})],x0);function R9(r){switch(r){case"P-256":return"urn:oid:1.2.840.10045.3.1.7";case"P-384":return"urn:oid:1.3.132.0.34";case"P-521":return"urn:oid:1.3.132.0.35"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve")}o(R9,"GetNamedCurveOid");function lhe(r){switch(r){case"urn:oid:1.2.840.10045.3.1.7":return"P-256";case"urn:oid:1.3.132.0.34":return"P-384";case"urn:oid:1.3.132.0.35":return"P-521"}throw new Fe(Te.CRYPTOGRAPHIC,"Unknown NamedCurve OID")}o(lhe,"GetNamedCurveFromOid");var fhe=class extends Map{static{o(this,"KeyInfoClauseRegistry")}},gl=new fhe;gl.set(me.ElementNames.RSAKeyValue,l0);gl.set(me.ElementNames.ECDSAKeyValue,x0);var aC=class{static{o(this,"KeyInfoClauseFactory")}static create(e){let t=gl.get(e);if(!t)throw new Fe(Te.KEY_INFO_CLAUSE_NOT_SUPPORTED,e);return new t}};var ax=class extends fi{static{o(this,"KeyValue")}set Value(e){this.element=null,this.value=e}get Value(){return this.value}constructor(e){super(),e&&(this.Value=e)}async importKey(e){for(let[,t]of gl)if(t.canImportCryptoKey(e)){let n=new t;return await n.importKey(e),this.Value=n,this}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.algorithm.name)}async exportKey(e){if(!this.Value)throw new Fe(Te.NULL_REFERENCE);return this.Value.exportKey(e)}OnGetXml(e){if(!this.Value)throw new Fe(Te.CRYPTOGRAPHIC,"KeyValue has empty value");let t=this.Value.GetXml();t&&e.appendChild(t)}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(oi(n))try{let s=n.localName,i=aC.create(s);i.LoadXml(n),this.value=i;return}catch{}}throw new Fe(Te.CRYPTOGRAPHIC,"Unsupported KeyValue in use")}};ax=He([jt({localName:me.ElementNames.KeyValue}),ht("design:paramtypes",[fi])],ax);var hhe={"2.5.4.3":{short:"CN",long:"CommonName"},"2.5.4.6":{short:"C",long:"Country"},"2.5.4.5":{long:"DeviceSerialNumber"},"0.9.2342.19200300.100.1.25":{short:"DC",long:"DomainComponent"},"1.2.840.113549.1.9.1":{short:"E",long:"EMail"},"2.5.4.42":{short:"G",long:"GivenName"},"2.5.4.43":{short:"I",long:"Initials"},"2.5.4.7":{short:"L",long:"Locality"},"2.5.4.10":{short:"O",long:"Organization"},"2.5.4.11":{short:"OU",long:"OrganizationUnit"},"2.5.4.8":{short:"ST",long:"State"},"2.5.4.9":{short:"Street",long:"StreetAddress"},"2.5.4.4":{short:"SN",long:"SurName"},"2.5.4.12":{short:"T",long:"Title"},"1.2.840.113549.1.9.8":{long:"UnstructuredAddress"},"1.2.840.113549.1.9.2":{long:"UnstructuredName"}},b0=class{static{o(this,"X509Certificate")}constructor(e){if(this.publicKey=null,e){let t=new Uint8Array(e);this.LoadRaw(t),this.raw=t}}get SerialNumber(){return this.simpl.serialNumber.valueBlock.toString()}get Issuer(){return this.NameToString(this.simpl.issuer)}get Subject(){return this.NameToString(this.simpl.subject)}async Thumbprint(e="SHA-1"){return vn.crypto.subtle.digest(e,this.raw)}get PublicKey(){return this.publicKey}GetRaw(){return this.raw}async exportKey(e){if(e){let t={algorithm:e,usages:["verify"]};if(t.algorithm.name.toUpperCase()===cu){let s=this.simpl.subjectPublicKeyInfo.toJSON();if("crv"in s&&s.crv)t.algorithm.namedCurve=s.crv;else throw new Error("Cannot get Curved name from the ECDSA public key")}this.isHashedAlgorithm(t.algorithm)&&typeof t.algorithm.hash=="string"&&(t.algorithm.hash={name:t.algorithm.hash});let n=await this.simpl.getPublicKey({algorithm:t});return this.publicKey=n,n}return this.simpl.subjectPublicKeyInfo.algorithm.algorithmId==="1.2.840.113549.1.1.1"?this.publicKey=await this.simpl.getPublicKey({algorithm:{algorithm:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},usages:["verify"]}}):this.publicKey=await this.simpl.getPublicKey(),this.publicKey}NameToString(e,t=","){let n=[];return e.typesAndValues.forEach(s=>{let i=s.type,a=hhe[i.toString()],u=a?a.short:null;n.push(`${u||i}=${s.value.valueBlock.value}`)}),n.join(t+" ")}LoadRaw(e){this.raw=new Uint8Array(e);let t=Gr(this.raw.buffer);this.simpl=new cs({schema:t.result})}isHashedAlgorithm(e){return!!e.hash}};var oC=class extends Kr{static{o(this,"X509IssuerSerial")}};He([Gt({localName:me.ElementNames.X509IssuerName,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,required:!0}),ht("design:type",String)],oC.prototype,"X509IssuerName",void 0);He([Gt({localName:me.ElementNames.X509SerialNumber,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,required:!0}),ht("design:type",String)],oC.prototype,"X509SerialNumber",void 0);oC=He([jt({localName:me.ElementNames.X509IssuerSerial})],oC);var Oh;(function(r){r[r.None=0]="None",r[r.EndCertOnly=1]="EndCertOnly",r[r.ExcludeRoot=2]="ExcludeRoot",r[r.WholeChain=3]="WholeChain"})(Oh||(Oh={}));var E0=class extends fi{static{o(this,"KeyInfoX509Data")}constructor(e,t=Oh.None){if(super(),this.x509crl=null,this.SubjectKeyIdList=[],e){if(e instanceof Uint8Array)this.AddCertificate(new b0(e));else if(e instanceof b0)switch(t){case Oh.None:case Oh.EndCertOnly:this.AddCertificate(e);break;case Oh.ExcludeRoot:this.AddCertificatesChainFrom(e,!1);break;case Oh.WholeChain:this.AddCertificatesChainFrom(e,!0);break}}}async importKey(e){throw new Fe(Te.METHOD_NOT_SUPPORTED)}async exportKey(e){if(!this.Certificates.length)throw new Fe(Te.NULL_REFERENCE);return this.Key=await this.Certificates[0].exportKey(e),this.Key}get Certificates(){return this.X509CertificateList}get CRL(){return this.x509crl}set CRL(e){this.x509crl=e}get IssuerSerials(){return this.IssuerSerialList}get SubjectKeyIds(){return this.SubjectKeyIdList}get SubjectNames(){return this.SubjectNameList}AddCertificate(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"certificate");this.X509CertificateList||(this.X509CertificateList=[]),this.X509CertificateList.push(e)}AddIssuerSerial(e,t){if(e==null)throw new Fe(Te.PARAM_REQUIRED,"issuerName");this.IssuerSerialList==null&&(this.IssuerSerialList=[]);let n={issuerName:e,serialNumber:t};this.IssuerSerialList.push(n)}AddSubjectKeyId(e){if(this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),typeof e=="string"){if(e!=null){let t=wr.FromBase64(e);this.SubjectKeyIdList.push(t)}}else this.SubjectKeyIdList.push(e)}AddSubjectName(e){this.SubjectNameList==null&&(this.SubjectNameList=[]),this.SubjectNameList.push(e)}GetXml(){let e=this.CreateDocument(),t=this.CreateElement(e),n=this.GetPrefix();if(this.IssuerSerialList!=null&&this.IssuerSerialList.length>0&&this.IssuerSerialList.forEach(s=>{let i=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509IssuerSerial),a=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509IssuerName);a.textContent=s.issuerName,i.appendChild(a);let u=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509SerialNumber);u.textContent=s.serialNumber,i.appendChild(u),t.appendChild(i)}),this.SubjectKeyIdList!=null&&this.SubjectKeyIdList.length>0&&this.SubjectKeyIdList.forEach(s=>{let i=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509SKI);i.textContent=wr.ToBase64(s),t.appendChild(i)}),this.SubjectNameList!=null&&this.SubjectNameList.length>0&&this.SubjectNameList.forEach(s=>{let i=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509SubjectName);i.textContent=s,t.appendChild(i)}),this.X509CertificateList!=null&&this.X509CertificateList.length>0&&this.X509CertificateList.forEach(s=>{let i=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509Certificate);i.textContent=wr.ToBase64(s.GetRaw()),t.appendChild(i)}),this.x509crl!=null){let s=e.createElementNS(me.NamespaceURI,n+me.ElementNames.X509CRL);s.textContent=wr.ToBase64(this.x509crl),t.appendChild(s)}return t}LoadXml(e){super.LoadXml(e),this.IssuerSerialList&&(this.IssuerSerialList=[]),this.SubjectKeyIdList&&(this.SubjectKeyIdList=[]),this.SubjectNameList&&(this.SubjectNameList=[]),this.X509CertificateList&&(this.X509CertificateList=[]),this.x509crl=null;let t=this.GetChildren(me.ElementNames.X509IssuerSerial);t&&t.forEach(s=>{let i=Kr.GetChild(s,me.ElementNames.X509IssuerName,me.NamespaceURI,!0),a=Kr.GetChild(s,me.ElementNames.X509SerialNumber,me.NamespaceURI,!0);i&&i.textContent&&a&&a.textContent&&this.AddIssuerSerial(i.textContent,a.textContent)}),t=this.GetChildren(me.ElementNames.X509SKI),t&&t.forEach(s=>{if(s.textContent){let i=wr.FromBase64(s.textContent);this.AddSubjectKeyId(i)}}),t=this.GetChildren(me.ElementNames.X509SubjectName),t?.forEach(s=>{s.textContent&&this.AddSubjectName(s.textContent)}),t=this.GetChildren(me.ElementNames.X509Certificate),t&&t.forEach(s=>{if(s.textContent){let i=wr.FromBase64(s.textContent);this.AddCertificate(new b0(i))}});let n=this.GetChild(me.ElementNames.X509CRL,!1);n&&n.textContent&&(this.x509crl=wr.FromBase64(n.textContent))}AddCertificatesChainFrom(e,t){}};E0=He([jt({localName:me.ElementNames.X509Data}),ht("design:paramtypes",[Object,Object])],E0);var ox=class extends fi{static{o(this,"SPKIData")}async importKey(e){let t=await vn.crypto.subtle.exportKey("spki",e);return this.SPKIexp=new Uint8Array(t),this.Key=e,this}async exportKey(e){if(!this.SPKIexp)throw new Error("SPKI data is not defined");let t=await vn.crypto.subtle.importKey("spki",this.SPKIexp,e,!0,["verify"]);return this.Key=t,t}};He([Gt({localName:me.ElementNames.SPKIexp,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,required:!0,converter:Vi}),ht("design:type",Object)],ox.prototype,"SPKIexp",void 0);ox=He([jt({localName:me.ElementNames.SPKIData})],ox);var kh=class extends $i{static{o(this,"KeyInfo")}OnLoadXml(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes.item(t);if(n.nodeType!==Ut.Element)continue;let s=null;switch(n.localName){case me.ElementNames.KeyValue:s=ax;break;case me.ElementNames.X509Data:s=E0;break;case me.ElementNames.SPKIData:s=ox;break;case me.ElementNames.KeyName:case me.ElementNames.RetrievalMethod:case me.ElementNames.PGPData:case me.ElementNames.MgmtData:}if(s){let i=new s;i.LoadXml(n),this.Add(i)}}}};He([Or({localName:me.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],kh.prototype,"Id",void 0);kh=He([jt({localName:me.ElementNames.KeyInfo})],kh);var vl=class extends Kr{static{o(this,"Signature")}};He([Or({localName:me.AttributeNames.Id,defaultValue:""}),ht("design:type",String)],vl.prototype,"Id",void 0);He([Gt({parser:pu,required:!0}),ht("design:type",pu)],vl.prototype,"SignedInfo",void 0);He([Gt({localName:me.ElementNames.SignatureValue,namespaceURI:me.NamespaceURI,prefix:me.DefaultPrefix,required:!0,converter:Vi,defaultValue:null}),ht("design:type",Object)],vl.prototype,"SignatureValue",void 0);He([Gt({parser:kh}),ht("design:type",kh)],vl.prototype,"KeyInfo",void 0);He([Gt({parser:sx,noRoot:!0}),ht("design:type",sx)],vl.prototype,"ObjectList",void 0);vl=He([jt({localName:me.ElementNames.Signature})],vl);var dhe=class extends Map{static{o(this,"AlgorithmRegistry")}},dr=new dhe;dr.set(ZA,{type:"signature",algorithm:a0});dr.set(eC,{type:"signature",algorithm:o0});dr.set(tC,{type:"signature",algorithm:u0});dr.set(rC,{type:"signature",algorithm:c0});dr.set(ZA,{type:"signature",algorithm:a0});dr.set(eC,{type:"signature",algorithm:o0});dr.set(tC,{type:"signature",algorithm:u0});dr.set(rC,{type:"signature",algorithm:c0});dr.set(UD,{type:"signature",algorithm:sC});dr.set(XA,{type:"signature",algorithm:t0});dr.set(WA,{type:"signature",algorithm:r0});dr.set(zA,{type:"signature",algorithm:n0});dr.set(JA,{type:"signature",algorithm:s0});dr.set(XA.toUpperCase(),{type:"signature",algorithm:t0});dr.set(WA.toUpperCase(),{type:"signature",algorithm:r0});dr.set(zA.toUpperCase(),{type:"signature",algorithm:n0});dr.set(JA.toUpperCase(),{type:"signature",algorithm:s0});dr.set(RD,{type:"signature",algorithm:ex});dr.set(PD,{type:"signature",algorithm:tx});dr.set(OD,{type:"signature",algorithm:rx});dr.set(kD,{type:"signature",algorithm:nx});dr.set(Ym,{type:"hash",algorithm:KA});dr.set(Qm,{type:"hash",algorithm:Zy});dr.set(Zm,{type:"hash",algorithm:$A});dr.set(e0,{type:"hash",algorithm:GA});var Lh=class{static{o(this,"AlgorithmFactory")}static createHashAlgorithmFromNamespace(e){for(let[t,{type:n,algorithm:s}]of dr)if(n==="hash"&&t===e)return new s;throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}static createSignatureAlgorithmFromMethod(e){for(let[t,{type:n,algorithm:s}]of dr)if(n==="signature"&&e.Algorithm===t){let i=new s;return i.fromMethod&&i.fromMethod(e),i}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.Algorithm)}static createHashAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of dr)if(t==="hash"){let s=new n;if(s.algorithm.name.toUpperCase()===e.name.toUpperCase())return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}static createSignatureAlgorithmFromAlgorithm(e){for(let[,{type:t,algorithm:n}]of dr)if(t==="signature"){let s=n.fromAlgorithm(e);if(s)return s}throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e.name)}};var mhe=class extends Map{static{o(this,"TransformRegistry")}},du=new mhe;du.set(me.AlgorithmNamespaces.XmlDsigBase64Transform,fu);du.set(me.AlgorithmNamespaces.XmlDsigC14NTransform,co);du.set(me.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform,lo);du.set(me.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform,hu);du.set(me.AlgorithmNamespaces.XmlDsigExcC14NTransform,fo);du.set(me.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform,ho);var ix=class{static{o(this,"CryptoConfig")}static CreateFromName(e){if(!e)throw new Fe(Te.PARAM_REQUIRED,"name");let t=du.get(e);if(t)return new t;let n;switch(e){case me.AlgorithmNamespaces.XmlDsigBase64Transform:n=new fu;break;case me.AlgorithmNamespaces.XmlDsigC14NTransform:n=new co;break;case me.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform:n=new lo;break;case me.AlgorithmNamespaces.XmlDsigEnvelopedSignatureTransform:n=new hu;break;case me.AlgorithmNamespaces.XmlDsigXPathTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case me.AlgorithmNamespaces.XmlDsigXsltTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);case me.AlgorithmNamespaces.XmlDsigExcC14NTransform:n=new fo;break;case me.AlgorithmNamespaces.XmlDsigExcC14NWithCommentsTransform:n=new ho;break;case me.AlgorithmNamespaces.XmlDecryptionTransform:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e);default:throw new Fe(Te.ALGORITHM_NOT_SUPPORTED,e)}return n}static CreateSignatureAlgorithm(e){return Lh.createSignatureAlgorithmFromMethod(e)}static CreateHashAlgorithm(e){return Lh.createHashAlgorithmFromNamespace(e)}static GetHashAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return Lh.createHashAlgorithmFromAlgorithm(t)}static GetSignatureAlgorithm(e){let t=typeof e=="string"?{name:e}:e;return"hash"in t&&typeof t.hash=="string"&&(t.hash={name:t.hash}),Lh.createSignatureAlgorithmFromAlgorithm(t)}static CreateSignatureMethod(e){let t=new uo;return t.Algorithm=e.namespaceURI,e.toMethod&&e.toMethod(t),t}static RegisterSignatureAlgorithm(e,t){dr.set(e,{type:"signature",algorithm:t})}static RegisterHashAlgorithm(e,t){dr.set(e,{type:"hash",algorithm:t})}static RegisterKeyInfoClause(e,t){gl.set(e,t)}static RegisterTransform(e,t){du.set(e,t)}};var uC=Yx(TI(),1);var P9={xmldec:{version:"1.0",encoding:"UTF-8",standalone:void 0}};var O9={explicitArray:!1,explicitRoot:!1,preserveChildrenOrder:!0};var k9=class{static{o(this,"Xml2JsToolkit")}xml2js;constructor(e=yhe){this.xml2js=e,Yj({XMLSerializer:uC.default.XMLSerializer,DOMParser:uC.default.DOMParser,DOMImplementation:uC.default.DOMImplementation})}async validate(e,t){try{return await AU.validate(e,t),ri()}catch(n){return Bu(n)}}parse(e,t){return new Promise((n,s)=>new this.xml2js.Parser({...O9,...t}).parseString(e,(i,a)=>i?s(i):n(a)))}build(e,t){return Promise.resolve(new this.xml2js.Builder({...P9,...t}).buildObject(e))}digest(e,t,n=K0){return this.hash(this.canonicalize(e,n),t)}canonicalize(e,t=K0){let n=Li(this.clear(e));return new oo(t.includeComments,t.exclusive).Canonicalize(n)}getNode(e,t){let s=Li(e).documentElement.getElementsByTagName(t).item(0);return s?this.clear(Qa(s)):null}getFirstNode(e){let n=Li(e).documentElement.firstChild;return n?this.clear(Qa(n)):null}getAttribute(e,t){return Li(e).documentElement.getAttribute(t)}appendNode(e,t){let n=Li(e),{documentElement:s}=Li(t);return n.documentElement.appendChild(s),this.clear(Qa(n))}hash(e,t){return vhe.createHash(t).update(e,"utf8").digest().toString("base64")}clear(e){return['xmlns:default="http://www.w3.org/2000/09/xmldsig#"',' standalone="no"',"default:",":default",`
100
- `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as xhe}from"class-validator";var L9=o(r=>(e,t)=>{xhe({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof np?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as V9}from"class-validator";var A0=Symbol("choice"),C0=o(r=>r==null||r==="","isEmpty"),ATe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(A0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(A0,i,e);for(let u of t)V9({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,f){let h=f.object,m=f.property,g=Reflect.getMetadata(A0,e);if(!g)return!0;let x=g.find(v=>v.properties.includes(m));if(!x||C0(c))return!0;for(let v of x.properties){if(v===m)continue;let w=h[v];if(!C0(w))return!1}for(let v of g)if(v!==x)for(let w of v.properties){let S=h[w];if(!C0(S))return!1}return!0},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return`${c.property} validation error`;let h=f.find(g=>g.properties.includes(c.property));if(!h)return`${c.property} validation error`;let m=c.object;for(let g of h.properties){let x=m[g];if(!C0(x)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of f)if(g!==h)for(let x of g.properties){let v=m[x];if(!C0(v))return`${c.property} cannot be set because ${x} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)V9({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,f){let h=f.object,m=Reflect.getMetadata(A0,e);if(!m)return!0;let g=m.find(x=>x.properties.includes(f.property));if(!g?.required)return!0;for(let x of g.properties){let v=h[x];if(!C0(v))return!0}return f.property!==g.properties[0]},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(c.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as whe}from"class-transformer";var DTe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{L9(e)(t,n),whe(({value:s})=>np.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as Ehe}from"class-transformer";import{IsDateString as Ahe}from"class-validator";import MD from"dayjs";import She from"dayjs/plugin/utc";import bhe from"dayjs/plugin/timezone";MD.extend(She);MD.extend(bhe);var U9=MD;var FTe=o((r={})=>(e,t)=>{Ehe(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?U9(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),Ahe()(e,t)},"TransformDateString");var j9=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((v,w,S)=>v+w*a[S],0)%11,f=c===0||c===1?0:11-c,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((v,w,S)=>v+w*h[S],0)%11,x=g===0||g===1?0:11-g;return s===f&&i===x}};var M9=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var F9=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var q9=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let m=0;m<8;m++)c+=parseInt(t[m],10)*u[m];let h=11-c%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var H9=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(w=>parseInt(w,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let w=0;w<i.length;w++)a+=n[w]*i[w];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let h=(t.slice(0,t.length-2)+c.toString()).split("").map(w=>parseInt(w,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let w=0;w<m.length;w++)g+=h[w]*m[w];let x=g%s,v=s-x;return(s===11&&x<=1||s===10&&x===0)&&(v=0),v===n[t.length-2]&&c===n[t.length-1]}};var K9=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var $9=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=c[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var G9=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var X9=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var W9=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var z9=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let x=0;x<12;x++){let v=x%2===0?1:2,w=(parseInt(s[x])*v).toString();i+=w.split("").reduce((S,A)=>S+parseInt(A),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let x=0;x<12;x++)h+=parseInt(c[x])*f[x];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var J9=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var Y9=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var Q9=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var Z9=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var eq=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let x=0;x<7;x++)i+=n[x]*s[x];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let x=0;x<8;x++)h+=c[x]*f[x];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var tq=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var rq=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],f=0;for(let m=0;m<9;m++)f+=c[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var nq=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var sq=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var iq=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var aq=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var oq=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var uq=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var cq=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var lq=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let h=0;h<11;h++)c+=n[h]*u[h];let f=c%11%10;return a===n[8]&&f===n[11]}};var fq=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var cC=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
101
+ `,"\r"," "].reduce((n,s)=>n.replace(s,""),e.replace(/(>)\s*(<)/gm,"$1$2"))}};import{registerDecorator as xhe}from"class-validator";var L9=o(r=>(e,t)=>{xhe({name:"isDecimal",target:e.constructor,propertyName:t,options:r,validator:{validate(n){return n instanceof np?!0:typeof n=="string"||typeof n=="number"||typeof n=="bigint"},defaultMessage(n){return`${n.property} is not a valid Decimal value`}}})},"IsDecimal");import"reflect-metadata";import{registerDecorator as V9}from"class-validator";var A0=Symbol("choice"),C0=o(r=>r==null||r==="","isEmpty"),ATe=o(r=>e=>{let{properties:t,required:n=!1,...s}=r,i=Reflect.getMetadata(A0,e)??[],a={properties:t,required:n};i.push(a),Reflect.defineMetadata(A0,i,e);for(let u of t)V9({name:"choice",target:e,propertyName:u,options:s,validator:{validate(c,f){let h=f.object,m=f.property,g=Reflect.getMetadata(A0,e);if(!g)return!0;let x=g.find(v=>v.properties.includes(m));if(!x||C0(c))return!0;for(let v of x.properties){if(v===m)continue;let w=h[v];if(!C0(w))return!1}for(let v of g)if(v!==x)for(let w of v.properties){let S=h[w];if(!C0(S))return!1}return!0},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return`${c.property} validation error`;let h=f.find(g=>g.properties.includes(c.property));if(!h)return`${c.property} validation error`;let m=c.object;for(let g of h.properties){let x=m[g];if(!C0(x)&&g!==c.property)return`${c.property} cannot be set because ${g} is already set. Only one property from this choice group is allowed.`}for(let g of f)if(g!==h)for(let x of g.properties){let v=m[x];if(!C0(v))return`${c.property} cannot be set because ${x} from a different choice group is already set.`}return`${c.property} validation error`}}});if(n)for(let u of t)V9({name:"choiceGroupRequired",target:e,propertyName:u,options:{...s,always:!0},validator:{validate(c,f){let h=f.object,m=Reflect.getMetadata(A0,e);if(!m)return!0;let g=m.find(x=>x.properties.includes(f.property));if(!g?.required)return!0;for(let x of g.properties){let v=h[x];if(!C0(v))return!0}return f.property!==g.properties[0]},defaultMessage(c){let f=Reflect.getMetadata(A0,e);if(!f)return"At least one property from a choice group must be provided";let h=f.find(m=>m.properties.includes(c.property));return h?`You must provide a value for one of the following properties: ${h.properties.join(", ")}`:"At least one property from a choice group must be provided"}}})},"Choice");import"reflect-metadata";import{Transform as whe}from"class-transformer";var DTe=o(({fixed:r,...e}={fixed:2})=>(t,n)=>{L9(e)(t,n),whe(({value:s})=>np.newOrUndefined(s)?.toFixed(r))(t,n)},"TransformDecimal");import{Transform as Ehe}from"class-transformer";import{IsDateString as Ahe}from"class-validator";import MD from"dayjs";import She from"dayjs/plugin/utc.js";import bhe from"dayjs/plugin/timezone.js";MD.extend(She);MD.extend(bhe);var U9=MD;var FTe=o((r={})=>(e,t)=>{Ehe(({value:n})=>{let s=n instanceof Date?n.toISOString():n;return s?U9(s).tz("America/Sao_Paulo").format(r.format):void 0})(e,t),Ahe()(e,t)},"TransformDateString");var j9=class{static{o(this,"StateCodeAcValidator")}execute(e){if(e=e.replace(/\D/g,""),!/^01\d{11}$/.test(e))return!1;let t=e.split("").map(Number),n=t.slice(0,11),s=t[11],i=t[12],a=[4,3,2,9,8,7,6,5,4,3,2],c=n.reduce((v,w,S)=>v+w*a[S],0)%11,f=c===0||c===1?0:11-c,h=[5,4,3,2,9,8,7,6,5,4,3,2],g=[...n,f].reduce((v,w,S)=>v+w*h[S],0)%11,x=g===0||g===1?0:11-g;return s===f&&i===x}};var M9=class{static{o(this,"StateCodeAlValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let a=s*10%11;return(a===10?0:a)===parseInt(t[8],10)}};var F9=class{static{o(this,"StateCodeAmValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let a=0;a<8;a++)s+=parseInt(t[a],10)*n[a];let i;if(s<11)i=11-s;else{let a=s%11;i=a<=1?0:11-a}return i===parseInt(t[8],10)}};var q9=class{static{o(this,"StateCodeApValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("03"))return!1;let n=t.substring(0,8),s=parseInt(n,10),i,a;s>=3017001&&s<=3019022?(i=9,a=1):s>=3000001&&s<=3017e3?(i=5,a=0):(i=0,a=0);let u=[9,8,7,6,5,4,3,2],c=i;for(let m=0;m<8;m++)c+=parseInt(t[m],10)*u[m];let h=11-c%11;return h===10?h=0:h===11&&(h=a),h===parseInt(t[8],10)}};var H9=class{static{o(this,"StateCodeBaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8&&t.length!==9)return!1;let n=t.split("").map(w=>parseInt(w,10)),s=(t.length===8?n[0]:n[1])<=5||n[0]===8?10:11,i=t.length===8?[7,6,5,4,3,2]:[8,7,6,5,4,3,2],a=0;for(let w=0;w<i.length;w++)a+=n[w]*i[w];let u=a%s,c=s-u;(s===11&&u<=1||s===10&&u===0)&&(c=0);let h=(t.slice(0,t.length-2)+c.toString()).split("").map(w=>parseInt(w,10)),m=t.length===8?[8,7,6,5,4,3,2]:[9,8,7,6,5,4,3,2],g=0;for(let w=0;w<m.length;w++)g+=h[w]*m[w];let x=g%s,v=s-x;return(s===11&&x<=1||s===10&&x===0)&&(v=0),v===n[t.length-2]&&c===n[t.length-1]}};var K9=class{static{o(this,"StateCodeCeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var $9=class{static{o(this,"StateCodeDfValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13||!t.startsWith("07"))return!1;let n=t.slice(0,11).split("").map(Number),s=t.slice(11).split("").map(Number),i=[2,3,4,5,6,7,8,9],a=0;for(let m=10,g=0;m>=0;m--,g=(g+1)%i.length)a+=n[m]*i[g];let u=11-a%11;(u===10||u===11)&&(u=0);let c=n.concat([u]),f=0;for(let m=11,g=0;m>=0;m--,g=(g+1)%i.length)f+=c[m]*i[g];let h=11-f%11;return(h===10||h===11)&&(h=0),u===s[0]&&h===s[1]}};var G9=class{static{o(this,"StateCodeEsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<2?0:11-i)===parseInt(t[8],10)}};var X9=class{static{o(this,"StateCodeGoValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=parseInt(t.substring(0,2));if(!(n===10||n===11||n>=20&&n<=29))return!1;let s=[9,8,7,6,5,4,3,2],i=0;for(let c=0;c<8;c++)i+=parseInt(t[c],10)*s[c];let a=i%11;return(a===0||a===1?0:11-a)===parseInt(t[8],10)}};var W9=class{static{o(this,"StateCodeMaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("12"))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8],10)}};var z9=class{static{o(this,"StateCodeMgValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==13)return!1;let n=t.slice(0,11),s=n.slice(0,3)+"0"+n.slice(3),i=0;for(let x=0;x<12;x++){let v=x%2===0?1:2,w=(parseInt(s[x])*v).toString();i+=w.split("").reduce((S,A)=>S+parseInt(A),0)}let u=Math.ceil(i/10)*10-i,c=n+u.toString(),f=[3,2,11,10,9,8,7,6,5,4,3,2],h=0;for(let x=0;x<12;x++)h+=parseInt(c[x])*f[x];let m=h%11,g=m<2?0:11-m;return parseInt(t[11])===u&&parseInt(t[12])===g}};var J9=class{static{o(this,"StateCodeMsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!(t.startsWith("28")||t.startsWith("50")))return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let c=0;c<8;c++)s+=parseInt(t[c],10)*n[c];let i=s%11,a=11-i;return(i===0||a>9?0:a)===parseInt(t[8],10)}};var Y9=class{static{o(this,"StateCodeMtValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=[3,2,9,8,7,6,5,4,3,2],s=0;for(let u=0;u<10;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[10],10)}};var Q9=class{static{o(this,"StateCodePaValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let i=s%11;return(i===0||i===1?0:11-i)===parseInt(t[8])}};var Z9=class{static{o(this,"StateCodePbValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8])}};var eq=class{static{o(this,"StateCodePeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=t.slice(0,7).split("").map(Number),s=[8,7,6,5,4,3,2],i=0;for(let x=0;x<7;x++)i+=n[x]*s[x];let a=i%11,u=a===0||a===1?0:11-a,c=[...n,u],f=[9,8,7,6,5,4,3,2],h=0;for(let x=0;x<8;x++)h+=c[x]*f[x];let m=h%11,g=m===0||m===1?0:11-m;return u===parseInt(t[7])&&g===parseInt(t[8])}};var tq=class{static{o(this,"StateCodePiValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var rq=class{static{o(this,"StateCodePrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=t.slice(0,8).split("").map(Number),s=[3,2,7,6,5,4,3,2],i=[4,3,2,7,6,5,4,3,2],a=0;for(let m=0;m<8;m++)a+=n[m]*s[m];let u=11-a%11;u>=10&&(u=0);let c=[...n,u],f=0;for(let m=0;m<9;m++)f+=c[m]*i[m];let h=11-f%11;return h>=10&&(h=0),u===parseInt(t[8])&&h===parseInt(t[9])}};var nq=class{static{o(this,"StateCodeRjValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==8)return!1;let n=[2,7,6,5,4,3,2],s=0;for(let u=0;u<7;u++)s+=parseInt(t[u],10)*n[u];let i=s%11;return(i<=1?0:11-i)===parseInt(t[7],10)}};var sq=class{static{o(this,"StateCodeRnValidator")}execute(e){let t=e.replace(/\D/g,"");if(!(t.length===9||t.length===10)||!t.startsWith("20"))return!1;let n=t.length===9?[9,8,7,6,5,4,3,2]:[10,9,8,7,6,5,4,3,2],s=t.slice(0,n.length).split("").map(Number),i=0;for(let f=0;f<n.length;f++)i+=s[f]*n[f];let u=i*10%11;return(u===10?0:u)===parseInt(t[t.length-1])}};var iq=class{static{o(this,"StateCodeRoValidator")}execute(e){let t=e.replace(/\D/g,""),n,s;if(t.length===9)n=t.slice(3,8).split("").map(Number),s=[6,5,4,3,2];else if(t.length===14)n=t.slice(0,13).split("").map(Number),s=[6,5,4,3,2,9,8,7,6,5,4,3,2];else return!1;let i=0;for(let c=0;c<s.length;c++)i+=n[c]*s[c];let u=11-i%11;return(u===10||u===11)&&(u-=10),u===parseInt(t[t.length-1])}};var aq=class{static{o(this,"StateCodeRrValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9||!t.startsWith("24"))return!1;let n=0;for(let i=0;i<8;i++)n+=(i+1)*parseInt(t[i],10);return n%9===parseInt(t[8],10)}};var oq=class{static{o(this,"StateCodeRsValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==10)return!1;let n=[2,9,8,7,6,5,4,3,2],s=0;for(let a=0;a<9;a++)s+=parseInt(t[a],10)*n[a];let i=11-s%11;return(i===10||i===11)&&(i=0),i===parseInt(t[9],10)}};var uq=class{static{o(this,"StateCodeScValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u],10)*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var cq=class{static{o(this,"StateCodeSeValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==9)return!1;let n=[9,8,7,6,5,4,3,2],s=0;for(let u=0;u<8;u++)s+=parseInt(t[u])*n[u];let a=11-s%11;return(a===10||a===11)&&(a=0),a===parseInt(t[8],10)}};var lq=class{static{o(this,"StateCodeSpValidator")}execute(e){let t=e;if(t.length!==12)return!1;let n=t.split("").map(Number),s=[1,3,4,5,6,7,8,10],i=0;for(let h=0;h<8;h++)i+=n[h]*s[h];let a=i%11%10,u=[3,2,10,9,8,7,6,5,4,3,2],c=0;for(let h=0;h<11;h++)c+=n[h]*u[h];let f=c%11%10;return a===n[8]&&f===n[11]}};var fq=class{static{o(this,"StateCodeToValidator")}execute(e){let t=e.replace(/\D/g,"");if(t.length!==11)return!1;let n=t.split(""),s=n.slice(0,2).concat(n.slice(4,10)).map(Number),i=[9,8,7,6,5,4,3,2],a=0;for(let f=0;f<i.length;f++)a+=s[f]*i[f];let u=a%11;return(u<2?0:11-u)===parseInt(t[10])}};var cC=class{static{o(this,"ASN1")}extractCertificateInfo(e){let n=e.subject.split(`
101
102
  `).reduce((i,a)=>{let[u,c]=a.split("=").map(f=>f.trim());return!u||!c?i:i.set(u,c)},new Map),s=this.oid("2.16.76.1.3.1",e.raw);return{CNPJ:this.oid("2.16.76.1.3.3",e.raw),CPF:s,CN:n.get("CN")?.replace(/:.*$/g,""),O:n.get("O"),OU:n.get("OU"),ST:n.get("ST"),L:n.get("L"),C:n.get("C")}}oid(e,t){let n=this.marker(e),s=t.indexOf(n);if(s===-1)return;let i=[t.subarray(0,s),t.subarray(s)];if(i.length<=1)return;let u=i[0].subarray(-4),c=u.subarray(-2);u[0]===48?c=u:u[1]===48&&(c=u.subarray(-3));let f=Buffer.concat([c,n,i[1]]),h=this.length(f),m=n.length,g=f.subarray(2+m,2+m+h),x=g.length-c.length-2;if(x<=0||x>g.length)return;let w=g.subarray(-x).toString("utf8");return w.substring(Buffer.from(w).findIndex((S,A)=>w.charCodeAt(A)>=32&&w.charCodeAt(A)<=126))}length(e){return e.length<2?0:e[1]<=127?e[1]:Buffer.from([e[1]&15]).reduce((t,n)=>t<<8|n,0)}marker(e){let t=e.split("."),n=t.slice(2).reduce((s,i)=>{let a=this.base128(s,Number.parseInt(i,10),!0);return s.length=0,s.push(...a),s},[]);return Buffer.from([6,n.length+1,40*Number.parseInt(t[0],10)+Number.parseInt(t[1],10),...n])}base128(e,t,n){let s=[...e];if(t>127){let a=this.base128(e,Math.floor(t/128),!1);a.length=0,s.push(...a)}let i=t%128;return n?s.push(i):s.push(128|i),s}};var pq=class{static{o(this,"NativeCertificateRepository")}httpClient;cache;constructor(e,t=new uw){this.httpClient=e,this.cache=t}async read(e){try{let{password:t}=e,n=await this.getPfxBuffer(e);if(n.isLeft())return n;let s=Vh.default.asn1.fromDer(n.value.toString("binary")),i=Vh.default.pkcs12.pkcs12FromAsn1(s,t),{certBag:a,pkcs8ShroudedKeyBag:u}=Vh.default.pki.oids,c=i.getBags({bagType:a}),f=i.getBags({bagType:u}),h=c[a];if(!h?.length)return ti(new pn("Cannot read certificate"));let[{cert:m},...g]=h;if(!m)return ti(new pn("Issuer Certificate not found"));let x=f[u]?.[0].key;if(!x)return ti(new pn("Certificate Private Key not found"));let v=g.reduce((b,{cert:E})=>(E&&b.push(new N0.X509Certificate(Vh.default.pki.certificateToPem(E))),b),[]),w=Vh.default.pki.privateKeyToPem(x),S=Vh.default.pki.certificateToPem(m),A=N0.createPrivateKey(w),T=new N0.X509Certificate(S);return ri({ca:v,password:t,privateKey:A,certificate:T})}catch(t){return Bu(t)}}async sign(e,t,n=Cu.SHA1){try{let i=N0.sign(n,Buffer.from(e),{key:t,padding:N0.constants.RSA_PKCS1_PADDING}).toString("base64");return await Promise.resolve(ri(i))}catch(s){return Promise.resolve(Bu(s))}}getCertificateInfo(e){return new cC().extractCertificateInfo(e)}getStringCertificate(e){return e.raw.toString("base64")}getStringPrivateKey(e){try{return e.export({type:"pkcs8",format:"pem"}).toString()}catch{throw new pn("Cannot extract private key")}}async getPfxBuffer(e){let{pfxPathOrBase64:t,password:n}=e,s=this.getCacheKey(t,n),i=await this.cache.get(s);if(i)return ri(i);if(Che.isAbsolute(t)||hq.existsSync(t))return this.hitBufferOnCache(s,hq.readFileSync(t));if(this.isValidRemoteUrl(t))try{let a=await this.httpClient.get(t,{responseType:"arraybuffer"});return await this.hitBufferOnCache(s,Buffer.from(a.data))}catch(a){return Bu(a)}return this.hitBufferOnCache(s,Buffer.from(t,"base64"))}getCacheKey(e,t){return N0.createHash("sha256").update(`${e}.${t}`).digest("hex")}async hitBufferOnCache(e,t){return await this.cache.set(e,t),ri(t)}isValidRemoteUrl(e){try{return new URL(e),!0}catch{return!1}}};var X_e={[br.AC]:"America/Rio_Branco",[br.AL]:"America/Maceio",[br.AM]:"America/Manaus",[br.AP]:"America/Belem",[br.BA]:"America/Bahia",[br.CE]:"America/Fortaleza",[br.DF]:"America/Sao_Paulo",[br.ES]:"America/Sao_Paulo",[br.GO]:"America/Sao_Paulo",[br.MA]:"America/Fortaleza",[br.MG]:"America/Sao_Paulo",[br.MS]:"America/Campo_Grande",[br.MT]:"America/Cuiaba",[br.PA]:"America/Belem",[br.PB]:"America/Fortaleza",[br.PE]:"America/Recife",[br.PI]:"America/Fortaleza",[br.PR]:"America/Sao_Paulo",[br.RJ]:"America/Sao_Paulo",[br.RN]:"America/Fortaleza",[br.RO]:"America/Porto_Velho",[br.RR]:"America/Boa_Vista",[br.RS]:"America/Sao_Paulo",[br.SC]:"America/Sao_Paulo",[br.SE]:"America/Maceio",[br.SP]:"America/Sao_Paulo",[br.TO]:"America/Araguaina"};export{C2 as a,hO as b,N2 as c,Cu as d,T2 as e,br as f,The as g,_he as h,pn as i,pO as j,I2 as k,Zh as l,_2 as m,Qx as n,ti as o,ri as p,dO as q,mO as r,$0 as s,spe as t,ipe as u,Zx as v,gO as w,vO as x,yO as y,mpe as z,np as A,PO as B,Bu as C,uw as D,pq as E,p8 as F,m8 as G,b8 as H,mU as I,k9 as J,L9 as K,ATe as L,DTe as M,FTe as N,j9 as O,M9 as P,F9 as Q,q9 as R,H9 as S,K9 as T,$9 as U,G9 as V,X9 as W,W9 as X,z9 as Y,J9 as Z,Y9 as _,Q9 as $,Z9 as aa,eq as ba,tq as ca,rq as da,nq as ea,sq as fa,iq as ga,aq as ha,oq as ia,uq as ja,cq as ka,lq as la,fq as ma,cC as na};
102
103
  /*! Bundled license information:
103
104
 
@@ -1 +1,2 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
1
2
  var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a,b)=>e(a,"name",{value:b,configurable:!0}),n=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),q=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var r=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d,q as e,r as f};
@@ -1,3 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
1
2
  "use strict";var oQ=Object.create;var pg=Object.defineProperty;var uQ=Object.getOwnPropertyDescriptor;var cQ=Object.getOwnPropertyNames;var lQ=Object.getPrototypeOf,fQ=Object.prototype.hasOwnProperty;var o=(r,e)=>pg(r,"name",{value:e,configurable:!0});var us=(r,e)=>()=>(r&&(e=r(r=0)),e);var Q=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),CN=(r,e)=>{for(var t in e)pg(r,t,{get:e[t],enumerable:!0})},Lk=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of cQ(e))!fQ.call(r,s)&&s!==t&&pg(r,s,{get:()=>e[s],enumerable:!(n=uQ(e,s))||n.enumerable});return r};var Cn=(r,e,t)=>(t=r!=null?oQ(lQ(r)):{},Lk(e||!r||!r.__esModule?pg(t,"default",{value:r,enumerable:!0}):t,r)),hQ=r=>Lk(pg({},"__esModule",{value:!0}),r);var Xt=Q((Rve,Zk)=>{"use strict";Zk.exports={options:{usePureJavaScript:!1}}});var r4=Q((Ove,t4)=>{"use strict";var jN={};t4.exports=jN;var e4={};jN.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=fZ(r,e);else{var s=0,i=e.length,a=e.charAt(0),u=[0];for(s=0;s<r.length;++s){for(var c=0,f=r[s];c<u.length;++c)f+=u[c]<<8,u[c]=f%i,f=f/i|0;for(;f>0;)u.push(f%i),f=f/i|0}for(s=0;r[s]===0&&s<r.length-1;++s)n+=a;for(s=u.length-1;s>=0;--s)n+=e[u[s]]}if(t){var h=new RegExp(".{1,"+t+"}","g");n=n.match(h).join(`\r
2
3
  `)}return n};jN.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=e4[e];if(!t){t=e4[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var s=e.length,i=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var c=0,f=u;c<a.length;++c)f+=a[c]*s,a[c]=f&255,f>>=8;for(;f>0;)a.push(f&255),f>>=8}for(var h=0;r[h]===i&&h<r.length-1;++h)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function fZ(r,e){var t=0,n=e.length,s=e.charAt(0),i=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<i.length;++a)u+=i[a]<<8,i[a]=u%n,u=u/n|0;for(;u>0;)i.push(u%n),u=u/n|0}var c="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)c+=s;for(t=i.length-1;t>=0;--t)c+=e[i[t]];return c}o(fZ,"_encodeWithByteBuffer")});var hr=Q((kve,a4)=>{"use strict";var n4=Xt(),s4=r4(),ne=a4.exports=n4.util=n4.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){ne.nextTick=process.nextTick,typeof setImmediate=="function"?ne.setImmediate=setImmediate:ne.setImmediate=ne.nextTick;return}if(typeof setImmediate=="function"){ne.setImmediate=function(){return setImmediate.apply(void 0,arguments)},ne.nextTick=function(u){return setImmediate(u)};return}if(ne.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(c){if(c.source===window&&c.data===r){c.stopPropagation();var f=e.slice();e.length=0,f.forEach(function(h){h()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];ne.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,s=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(f){f()})}).observe(s,{attributes:!0});var i=ne.setImmediate;ne.setImmediate=function(c){Date.now()-t>15?(t=Date.now(),i(c)):(e.push(c),e.length===1&&s.setAttribute("a",n=!n))}}ne.nextTick=ne.setImmediate})();ne.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;ne.globalScope=(function(){return ne.isNodejs?global:typeof self>"u"?window:self})();ne.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};ne.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};ne.isArrayBufferView=function(r){return r&&ne.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function yg(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(yg,"_checkBitsParam");ne.ByteBuffer=FN;function FN(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(ne.isArrayBuffer(r)||ne.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof FN||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(FN,"ByteStringBuffer");ne.ByteStringBuffer=FN;var hZ=4096;ne.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>hZ&&(this.data.substr(0,1),this._constructedStringLength=0)};ne.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};ne.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};ne.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};ne.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};ne.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};ne.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(ne.encodeUtf8(r))};ne.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ne.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};ne.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};ne.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};ne.ByteStringBuffer.prototype.putInt=function(r,e){yg(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};ne.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};ne.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};ne.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};ne.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};ne.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};ne.ByteStringBuffer.prototype.getInt32=function(){var r=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,r};ne.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};ne.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};ne.ByteStringBuffer.prototype.getInt32Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,r};ne.ByteStringBuffer.prototype.getInt=function(r){yg(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};ne.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ne.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ne.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ne.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};ne.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};ne.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};ne.ByteStringBuffer.prototype.copy=function(){var r=ne.createBuffer(this.data);return r.read=this.read,r};ne.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};ne.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};ne.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};ne.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ne.ByteStringBuffer.prototype.toString=function(){return ne.decodeUtf8(this.bytes())};function pZ(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=ne.isArrayBuffer(r),n=ne.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(pZ,"DataBuffer");ne.DataBuffer=pZ;ne.DataBuffer.prototype.length=function(){return this.write-this.read};ne.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};ne.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};ne.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};ne.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};ne.DataBuffer.prototype.putBytes=function(r,e){if(ne.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var s=new Uint8Array(this.data.buffer,this.write);return s.set(t),this.write+=n,this}if(ne.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var s=new Uint8Array(this.data.buffer);return s.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof ne.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&ne.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var s=new Uint8Array(r.data.byteLength,this.write);return s.set(t),this.write+=t.byteLength,this}if(r instanceof ne.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var i;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.hex.decode(r,i,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.base64.decode(r,i,this.write),this;if(e==="utf8"&&(r=ne.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=ne.binary.raw.decode(i),this;if(e==="utf16")return this.accommodate(r.length*2),i=new Uint16Array(this.data.buffer,this.write),this.write+=ne.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};ne.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};ne.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};ne.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};ne.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};ne.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};ne.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};ne.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};ne.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};ne.DataBuffer.prototype.putInt=function(r,e){yg(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};ne.DataBuffer.prototype.putSignedInt=function(r,e){return yg(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};ne.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};ne.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};ne.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};ne.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};ne.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};ne.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};ne.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};ne.DataBuffer.prototype.getInt=function(r){yg(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};ne.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ne.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ne.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ne.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};ne.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};ne.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};ne.DataBuffer.prototype.copy=function(){return new ne.DataBuffer(this)};ne.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};ne.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};ne.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};ne.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ne.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return ne.binary.raw.encode(e);if(r==="hex")return ne.binary.hex.encode(e);if(r==="base64")return ne.binary.base64.encode(e);if(r==="utf8")return ne.text.utf8.decode(e);if(r==="utf16")return ne.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};ne.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=ne.encodeUtf8(r)),new ne.ByteBuffer(r)};ne.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};ne.xorBytes=function(r,e,t){for(var n="",s="",i="",a=0,u=0;t>0;--t,++a)s=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=i,i="",u=0),i+=String.fromCharCode(s),++u;return n+=i,n};ne.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};ne.bytesToHex=function(r){return ne.createBuffer(r).toHex()};ne.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var qu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Hu=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],i4="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ne.encode64=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.length;)s=r.charCodeAt(u++),i=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=qu.charAt(s>>2),t+=qu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=qu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":qu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
4
  `,t=t.substr(e));return n+=t,n};ne.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,s,i,a=0;a<r.length;)t=Hu[r.charCodeAt(a++)-43],n=Hu[r.charCodeAt(a++)-43],s=Hu[r.charCodeAt(a++)-43],i=Hu[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),s!==64&&(e+=String.fromCharCode((n&15)<<4|s>>2),i!==64&&(e+=String.fromCharCode((s&3)<<6|i)));return e};ne.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};ne.decodeUtf8=function(r){return decodeURIComponent(escape(r))};ne.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s4.encode,decode:s4.decode}};ne.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};ne.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var s=t,i=0;i<r.length;++i)n[s++]=r.charCodeAt(i);return e?s-t:n};ne.binary.hex.encode=ne.bytesToHex;ne.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var s=0,i=t;for(r.length&1&&(s=1,n[i++]=parseInt(r[0],16));s<r.length;s+=2)n[i++]=parseInt(r.substr(s,2),16);return e?i-t:n};ne.binary.base64.encode=function(r,e){for(var t="",n="",s,i,a,u=0;u<r.byteLength;)s=r[u++],i=r[u++],a=r[u++],t+=qu.charAt(s>>2),t+=qu.charAt((s&3)<<4|i>>4),isNaN(i)?t+="==":(t+=qu.charAt((i&15)<<2|a>>6),t+=isNaN(a)?"=":qu.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
@@ -1 +1,2 @@
1
- import"../chunk-I4KZJHBR.mjs";import{$ as Y,A,B,C,D,E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a,aa as Z,b,ba as _,c,ca as $,d,da as aa,e,ea as ba,f,fa as ca,g,ga as da,h,ha as ea,i,ia as fa,j,ja as ga,k,ka as ha,l,la as ia,m,ma as ja,n,na as ka,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-MXBBYFAK.mjs";import"../chunk-W6MRGYXP.mjs";export{ka as ASN1,b as CanonicalizationMethod,I as Choice,A as Decimal,e as DigestAlgorithm,q as EntitySigner,h as Environment,H as IsDecimal,m as Left,B as MemoryCacheAdapter,i as NFeTsError,E as NativeCertificateRepository,D as NullCacheAdapter,n as Right,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,l as Signer,u as SkipAllValidations,t as SkipValidation,s as SkipValidationMetadata,F as SoapRemoteTransmissionRepository,g as StateAcronyms,L as StateCodeAcValidator,M as StateCodeAlValidator,N as StateCodeAmValidator,O as StateCodeApValidator,P as StateCodeBaValidator,Q as StateCodeCeValidator,R as StateCodeDfValidator,S as StateCodeEsValidator,T as StateCodeGoValidator,U as StateCodeMaValidator,V as StateCodeMgValidator,W as StateCodeMsValidator,X as StateCodeMtValidator,Y as StateCodePaValidator,Z as StateCodePbValidator,_ as StateCodePeValidator,$ as StateCodePiValidator,aa as StateCodePrValidator,ba as StateCodeRjValidator,ca as StateCodeRnValidator,da as StateCodeRoValidator,ea as StateCodeRrValidator,fa as StateCodeRsValidator,ga as StateCodeScValidator,ha as StateCodeSeValidator,ia as StateCodeSpValidator,ja as StateCodeToValidator,f as StateCodes,K as TransformDateString,J as TransformDecimal,x as ValidateErrorsMetadata,z as Validates,j as ValidationError,G as Xml2JsToolkit,r as XmlSigner,v as clearEmptyValues,o as left,C as leftFromError,y as mapConstraintsToErrors,w as plainToInstance,p as right,k as unreachable};
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import"../chunk-SMZIOTOE.mjs";import{$ as Y,A,B,C,D,E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a,aa as Z,b,ba as _,c,ca as $,d,da as aa,e,ea as ba,f,fa as ca,g,ga as da,h,ha as ea,i,ia as fa,j,ja as ga,k,ka as ha,l,la as ia,m,ma as ja,n,na as ka,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-TKSZP5SJ.mjs";import"../chunk-WEMHPBTC.mjs";export{ka as ASN1,b as CanonicalizationMethod,I as Choice,A as Decimal,e as DigestAlgorithm,q as EntitySigner,h as Environment,H as IsDecimal,m as Left,B as MemoryCacheAdapter,i as NFeTsError,E as NativeCertificateRepository,D as NullCacheAdapter,n as Right,d as SignatureAlgorithm,c as SignatureMethod,a as SignatureNamespace,l as Signer,u as SkipAllValidations,t as SkipValidation,s as SkipValidationMetadata,F as SoapRemoteTransmissionRepository,g as StateAcronyms,L as StateCodeAcValidator,M as StateCodeAlValidator,N as StateCodeAmValidator,O as StateCodeApValidator,P as StateCodeBaValidator,Q as StateCodeCeValidator,R as StateCodeDfValidator,S as StateCodeEsValidator,T as StateCodeGoValidator,U as StateCodeMaValidator,V as StateCodeMgValidator,W as StateCodeMsValidator,X as StateCodeMtValidator,Y as StateCodePaValidator,Z as StateCodePbValidator,_ as StateCodePeValidator,$ as StateCodePiValidator,aa as StateCodePrValidator,ba as StateCodeRjValidator,ca as StateCodeRnValidator,da as StateCodeRoValidator,ea as StateCodeRrValidator,fa as StateCodeRsValidator,ga as StateCodeScValidator,ha as StateCodeSeValidator,ia as StateCodeSpValidator,ja as StateCodeToValidator,f as StateCodes,K as TransformDateString,J as TransformDecimal,x as ValidateErrorsMetadata,z as Validates,j as ValidationError,G as Xml2JsToolkit,r as XmlSigner,v as clearEmptyValues,o as left,C as leftFromError,y as mapConstraintsToErrors,w as plainToInstance,p as right,k as unreachable};
package/dist/index.cjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
1
2
  "use strict";var Ooe=Object.create;var Ex=Object.defineProperty;var Poe=Object.getOwnPropertyDescriptor;var Boe=Object.getOwnPropertyNames;var Foe=Object.getPrototypeOf,Loe=Object.prototype.hasOwnProperty;var o=(r,e)=>Ex(r,"name",{value:e,configurable:!0});var qs=(r,e)=>()=>(r&&(e=r(r=0)),e);var Z=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),ON=(r,e)=>{for(var t in e)Ex(r,t,{get:e[t],enumerable:!0})},IU=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Boe(e))!Loe.call(r,i)&&i!==t&&Ex(r,i,{get:()=>e[i],enumerable:!(n=Poe(e,i))||n.enumerable});return r};var Dr=(r,e,t)=>(t=r!=null?Ooe(Foe(r)):{},IU(e||!r||!r.__esModule?Ex(t,"default",{value:r,enumerable:!0}):t,r)),koe=r=>IU(Ex({},"__esModule",{value:!0}),r);var pr=Z((q2e,zU)=>{"use strict";zU.exports={options:{usePureJavaScript:!1}}});var GU=Z((H2e,$U)=>{"use strict";var EP={};$U.exports=EP;var KU={};EP.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=Pue(r,e);else{var i=0,s=e.length,a=e.charAt(0),u=[0];for(i=0;i<r.length;++i){for(var c=0,l=r[i];c<u.length;++c)l+=u[c]<<8,u[c]=l%s,l=l/s|0;for(;l>0;)u.push(l%s),l=l/s|0}for(i=0;r[i]===0&&i<r.length-1;++i)n+=a;for(i=u.length-1;i>=0;--i)n+=e[u[i]]}if(t){var p=new RegExp(".{1,"+t+"}","g");n=n.match(p).join(`\r
2
3
  `)}return n};EP.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=KU[e];if(!t){t=KU[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var i=e.length,s=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var c=0,l=u;c<a.length;++c)l+=a[c]*i,a[c]=l&255,l>>=8;for(;l>0;)a.push(l&255),l>>=8}for(var p=0;r[p]===s&&p<r.length-1;++p)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function Pue(r,e){var t=0,n=e.length,i=e.charAt(0),s=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<s.length;++a)u+=s[a]<<8,s[a]=u%n,u=u/n|0;for(;u>0;)s.push(u%n),u=u/n|0}var c="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)c+=i;for(t=s.length-1;t>=0;--t)c+=e[s[t]];return c}o(Pue,"_encodeWithByteBuffer")});var kr=Z((K2e,QU)=>{"use strict";var XU=pr(),WU=GU(),ae=QU.exports=XU.util=XU.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){ae.nextTick=process.nextTick,typeof setImmediate=="function"?ae.setImmediate=setImmediate:ae.setImmediate=ae.nextTick;return}if(typeof setImmediate=="function"){ae.setImmediate=function(){return setImmediate.apply(void 0,arguments)},ae.nextTick=function(u){return setImmediate(u)};return}if(ae.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(c){if(c.source===window&&c.data===r){c.stopPropagation();var l=e.slice();e.length=0,l.forEach(function(p){p()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];ae.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(l){l()})}).observe(i,{attributes:!0});var s=ae.setImmediate;ae.setImmediate=function(c){Date.now()-t>15?(t=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}ae.nextTick=ae.setImmediate})();ae.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;ae.globalScope=(function(){return ae.isNodejs?global:typeof self>"u"?window:self})();ae.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};ae.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};ae.isArrayBufferView=function(r){return r&&ae.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function Ox(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(Ox,"_checkBitsParam");ae.ByteBuffer=AP;function AP(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(ae.isArrayBuffer(r)||ae.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof AP||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(AP,"ByteStringBuffer");ae.ByteStringBuffer=AP;var Bue=4096;ae.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>Bue&&(this.data.substr(0,1),this._constructedStringLength=0)};ae.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};ae.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};ae.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};ae.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};ae.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};ae.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(ae.encodeUtf8(r))};ae.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};ae.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};ae.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};ae.ByteStringBuffer.prototype.putInt=function(r,e){Ox(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};ae.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};ae.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};ae.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};ae.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};ae.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};ae.ByteStringBuffer.prototype.getInt32=function(){var r=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,r};ae.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};ae.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};ae.ByteStringBuffer.prototype.getInt32Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,r};ae.ByteStringBuffer.prototype.getInt=function(r){Ox(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};ae.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ae.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ae.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ae.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};ae.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};ae.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};ae.ByteStringBuffer.prototype.copy=function(){var r=ae.createBuffer(this.data);return r.read=this.read,r};ae.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};ae.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};ae.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};ae.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ae.ByteStringBuffer.prototype.toString=function(){return ae.decodeUtf8(this.bytes())};function Fue(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=ae.isArrayBuffer(r),n=ae.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(Fue,"DataBuffer");ae.DataBuffer=Fue;ae.DataBuffer.prototype.length=function(){return this.write-this.read};ae.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};ae.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};ae.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};ae.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};ae.DataBuffer.prototype.putBytes=function(r,e){if(ae.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(t),this.write+=n,this}if(ae.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof ae.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&ae.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var i=new Uint8Array(r.data.byteLength,this.write);return i.set(t),this.write+=t.byteLength,this}if(r instanceof ae.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var s;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.hex.decode(r,s,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.base64.decode(r,s,this.write),this;if(e==="utf8"&&(r=ae.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.raw.decode(s),this;if(e==="utf16")return this.accommodate(r.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=ae.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};ae.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};ae.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};ae.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};ae.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};ae.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};ae.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};ae.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};ae.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};ae.DataBuffer.prototype.putInt=function(r,e){Ox(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};ae.DataBuffer.prototype.putSignedInt=function(r,e){return Ox(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};ae.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};ae.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};ae.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};ae.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};ae.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};ae.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};ae.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};ae.DataBuffer.prototype.getInt=function(r){Ox(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};ae.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ae.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ae.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ae.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};ae.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};ae.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};ae.DataBuffer.prototype.copy=function(){return new ae.DataBuffer(this)};ae.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};ae.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};ae.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};ae.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ae.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return ae.binary.raw.encode(e);if(r==="hex")return ae.binary.hex.encode(e);if(r==="base64")return ae.binary.base64.encode(e);if(r==="utf8")return ae.text.utf8.decode(e);if(r==="utf16")return ae.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};ae.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=ae.encodeUtf8(r)),new ae.ByteBuffer(r)};ae.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};ae.xorBytes=function(r,e,t){for(var n="",i="",s="",a=0,u=0;t>0;--t,++a)i=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=s,s="",u=0),s+=String.fromCharCode(i),++u;return n+=s,n};ae.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};ae.bytesToHex=function(r){return ae.createBuffer(r).toHex()};ae.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var Op="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Pp=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],JU="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ae.encode64=function(r,e){for(var t="",n="",i,s,a,u=0;u<r.length;)i=r.charCodeAt(u++),s=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=Op.charAt(i>>2),t+=Op.charAt((i&3)<<4|s>>4),isNaN(s)?t+="==":(t+=Op.charAt((s&15)<<2|a>>6),t+=isNaN(a)?"=":Op.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
4
  `,t=t.substr(e));return n+=t,n};ae.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,i,s,a=0;a<r.length;)t=Pp[r.charCodeAt(a++)-43],n=Pp[r.charCodeAt(a++)-43],i=Pp[r.charCodeAt(a++)-43],s=Pp[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};ae.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};ae.decodeUtf8=function(r){return decodeURIComponent(escape(r))};ae.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:WU.encode,decode:WU.decode}};ae.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};ae.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var i=t,s=0;s<r.length;++s)n[i++]=r.charCodeAt(s);return e?i-t:n};ae.binary.hex.encode=ae.bytesToHex;ae.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var i=0,s=t;for(r.length&1&&(i=1,n[s++]=parseInt(r[0],16));i<r.length;i+=2)n[s++]=parseInt(r.substr(i,2),16);return e?s-t:n};ae.binary.base64.encode=function(r,e){for(var t="",n="",i,s,a,u=0;u<r.byteLength;)i=r[u++],s=r[u++],a=r[u++],t+=Op.charAt(i>>2),t+=Op.charAt((i&3)<<4|s>>4),isNaN(s)?t+="==":(t+=Op.charAt((s&15)<<2|a>>6),t+=isNaN(a)?"=":Op.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
package/dist/index.mjs CHANGED
@@ -1 +1,2 @@
1
- import"./chunk-I4KZJHBR.mjs";import{a as go,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo}from"./chunk-D6GG2M7K.mjs";import{$ as Y,A,B,C,D,E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a as o,aa as Z,b as r,ba as _,c as e,ca as $,d as f,da as oo,e as m,ea as ro,f as p,fa as eo,g as t,ga as fo,h as x,ha as mo,i as a,ia as po,j as b,ja as to,k as c,ka as xo,l as d,la as ao,m as g,ma as bo,n as h,na as co,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunk-MXBBYFAK.mjs";import"./chunk-W6MRGYXP.mjs";export{co as ASN1,io as AccessKeyBuilder,r as CanonicalizationMethod,I as Choice,A as Decimal,jo as DefaultDetBuilderAggregator,ko as DefaultTotalBuilderAggregator,m as DigestAlgorithm,k as EntitySigner,x as Environment,H as IsDecimal,g as Left,B as MemoryCacheAdapter,so as NFCeDto,lo as NFeDto,a as NFeTsError,E as NativeCertificateRepository,vo as NfceQrcode,uo as NfceRemoteTransmitter,zo as NfceXmlBuilder,qo as NfeAuthorizerPipeline,wo as NfeDetXmlBuilder,no as NfeRemoteTransmitter,yo as NfeXmlBuilder,D as NullCacheAdapter,h as Right,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,d as Signer,s as SkipAllValidations,q as SkipValidation,n as SkipValidationMetadata,F as SoapRemoteTransmissionRepository,t as StateAcronyms,L as StateCodeAcValidator,M as StateCodeAlValidator,N as StateCodeAmValidator,O as StateCodeApValidator,P as StateCodeBaValidator,Q as StateCodeCeValidator,R as StateCodeDfValidator,S as StateCodeEsValidator,T as StateCodeGoValidator,U as StateCodeMaValidator,V as StateCodeMgValidator,W as StateCodeMsValidator,X as StateCodeMtValidator,Y as StateCodePaValidator,Z as StateCodePbValidator,_ as StateCodePeValidator,$ as StateCodePiValidator,oo as StateCodePrValidator,ro as StateCodeRjValidator,eo as StateCodeRnValidator,fo as StateCodeRoValidator,mo as StateCodeRrValidator,po as StateCodeRsValidator,to as StateCodeScValidator,xo as StateCodeSeValidator,ao as StateCodeSpValidator,bo as StateCodeToValidator,p as StateCodes,go as TpEmis,K as TransformDateString,J as TransformDecimal,w as ValidateErrorsMetadata,z as Validates,b as ValidationError,G as Xml2JsToolkit,l as XmlSigner,u as clearEmptyValues,ho as directory,i as left,C as leftFromError,y as mapConstraintsToErrors,v as plainToInstance,j as right,c as unreachable};
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import"./chunk-SMZIOTOE.mjs";import{a as go,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo}from"./chunk-MKETPTVV.mjs";import{$ as Y,A,B,C,D,E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,U as R,V as S,W as T,X as U,Y as V,Z as W,_ as X,a as o,aa as Z,b as r,ba as _,c as e,ca as $,d as f,da as oo,e as m,ea as ro,f as p,fa as eo,g as t,ga as fo,h as x,ha as mo,i as a,ia as po,j as b,ja as to,k as c,ka as xo,l as d,la as ao,m as g,ma as bo,n as h,na as co,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w,y,z}from"./chunk-TKSZP5SJ.mjs";import"./chunk-WEMHPBTC.mjs";export{co as ASN1,io as AccessKeyBuilder,r as CanonicalizationMethod,I as Choice,A as Decimal,jo as DefaultDetBuilderAggregator,ko as DefaultTotalBuilderAggregator,m as DigestAlgorithm,k as EntitySigner,x as Environment,H as IsDecimal,g as Left,B as MemoryCacheAdapter,so as NFCeDto,lo as NFeDto,a as NFeTsError,E as NativeCertificateRepository,vo as NfceQrcode,uo as NfceRemoteTransmitter,zo as NfceXmlBuilder,qo as NfeAuthorizerPipeline,wo as NfeDetXmlBuilder,no as NfeRemoteTransmitter,yo as NfeXmlBuilder,D as NullCacheAdapter,h as Right,f as SignatureAlgorithm,e as SignatureMethod,o as SignatureNamespace,d as Signer,s as SkipAllValidations,q as SkipValidation,n as SkipValidationMetadata,F as SoapRemoteTransmissionRepository,t as StateAcronyms,L as StateCodeAcValidator,M as StateCodeAlValidator,N as StateCodeAmValidator,O as StateCodeApValidator,P as StateCodeBaValidator,Q as StateCodeCeValidator,R as StateCodeDfValidator,S as StateCodeEsValidator,T as StateCodeGoValidator,U as StateCodeMaValidator,V as StateCodeMgValidator,W as StateCodeMsValidator,X as StateCodeMtValidator,Y as StateCodePaValidator,Z as StateCodePbValidator,_ as StateCodePeValidator,$ as StateCodePiValidator,oo as StateCodePrValidator,ro as StateCodeRjValidator,eo as StateCodeRnValidator,fo as StateCodeRoValidator,mo as StateCodeRrValidator,po as StateCodeRsValidator,to as StateCodeScValidator,xo as StateCodeSeValidator,ao as StateCodeSpValidator,bo as StateCodeToValidator,p as StateCodes,go as TpEmis,K as TransformDateString,J as TransformDecimal,w as ValidateErrorsMetadata,z as Validates,b as ValidationError,G as Xml2JsToolkit,l as XmlSigner,u as clearEmptyValues,ho as directory,i as left,C as leftFromError,y as mapConstraintsToErrors,v as plainToInstance,j as right,c as unreachable};
@@ -1,3 +1,4 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
1
2
  "use strict";var noe=Object.create;var wx=Object.defineProperty;var ioe=Object.getOwnPropertyDescriptor;var soe=Object.getOwnPropertyNames;var aoe=Object.getPrototypeOf,ooe=Object.prototype.hasOwnProperty;var o=(r,e)=>wx(r,"name",{value:e,configurable:!0});var Ms=(r,e)=>()=>(r&&(e=r(r=0)),e);var Z=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),bN=(r,e)=>{for(var t in e)wx(r,t,{get:e[t],enumerable:!0})},X5=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of soe(e))!ooe.call(r,i)&&i!==t&&wx(r,i,{get:()=>e[i],enumerable:!(n=ioe(e,i))||n.enumerable});return r};var Dr=(r,e,t)=>(t=r!=null?noe(aoe(r)):{},X5(e||!r||!r.__esModule?wx(t,"default",{value:r,enumerable:!0}):t,r)),uoe=r=>X5(wx({},"__esModule",{value:!0}),r);var pr=Z((yNe,lU)=>{"use strict";lU.exports={options:{usePureJavaScript:!1}}});var hU=Z((SNe,pU)=>{"use strict";var mP={};pU.exports=mP;var fU={};mP.encode=function(r,e,t){if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t!==void 0&&typeof t!="number")throw new TypeError('"maxline" must be a number.');var n="";if(!(r instanceof Uint8Array))n=nue(r,e);else{var i=0,s=e.length,a=e.charAt(0),u=[0];for(i=0;i<r.length;++i){for(var c=0,l=r[i];c<u.length;++c)l+=u[c]<<8,u[c]=l%s,l=l/s|0;for(;l>0;)u.push(l%s),l=l/s|0}for(i=0;r[i]===0&&i<r.length-1;++i)n+=a;for(i=u.length-1;i>=0;--i)n+=e[u[i]]}if(t){var p=new RegExp(".{1,"+t+"}","g");n=n.match(p).join(`\r
2
3
  `)}return n};mP.decode=function(r,e){if(typeof r!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');var t=fU[e];if(!t){t=fU[e]=[];for(var n=0;n<e.length;++n)t[e.charCodeAt(n)]=n}r=r.replace(/\s/g,"");for(var i=e.length,s=e.charAt(0),a=[0],n=0;n<r.length;n++){var u=t[r.charCodeAt(n)];if(u===void 0)return;for(var c=0,l=u;c<a.length;++c)l+=a[c]*i,a[c]=l&255,l>>=8;for(;l>0;)a.push(l&255),l>>=8}for(var p=0;r[p]===s&&p<r.length-1;++p)a.push(0);return typeof Buffer<"u"?Buffer.from(a.reverse()):new Uint8Array(a.reverse())};function nue(r,e){var t=0,n=e.length,i=e.charAt(0),s=[0];for(t=0;t<r.length();++t){for(var a=0,u=r.at(t);a<s.length;++a)u+=s[a]<<8,s[a]=u%n,u=u/n|0;for(;u>0;)s.push(u%n),u=u/n|0}var c="";for(t=0;r.at(t)===0&&t<r.length()-1;++t)c+=i;for(t=s.length-1;t>=0;--t)c+=e[s[t]];return c}o(nue,"_encodeWithByteBuffer")});var kr=Z((bNe,vU)=>{"use strict";var dU=pr(),mU=hU(),ae=vU.exports=dU.util=dU.util||{};(function(){if(typeof process<"u"&&process.nextTick&&!process.browser){ae.nextTick=process.nextTick,typeof setImmediate=="function"?ae.setImmediate=setImmediate:ae.setImmediate=ae.nextTick;return}if(typeof setImmediate=="function"){ae.setImmediate=function(){return setImmediate.apply(void 0,arguments)},ae.nextTick=function(u){return setImmediate(u)};return}if(ae.setImmediate=function(u){setTimeout(u,0)},typeof window<"u"&&typeof window.postMessage=="function"){let u=function(c){if(c.source===window&&c.data===r){c.stopPropagation();var l=e.slice();e.length=0,l.forEach(function(p){p()})}};var a=u;o(u,"handler");var r="forge.setImmediate",e=[];ae.setImmediate=function(c){e.push(c),e.length===1&&window.postMessage(r,"*")},window.addEventListener("message",u,!0)}if(typeof MutationObserver<"u"){var t=Date.now(),n=!0,i=document.createElement("div"),e=[];new MutationObserver(function(){var c=e.slice();e.length=0,c.forEach(function(l){l()})}).observe(i,{attributes:!0});var s=ae.setImmediate;ae.setImmediate=function(c){Date.now()-t>15?(t=Date.now(),s(c)):(e.push(c),e.length===1&&i.setAttribute("a",n=!n))}}ae.nextTick=ae.setImmediate})();ae.isNodejs=typeof process<"u"&&process.versions&&process.versions.node;ae.globalScope=(function(){return ae.isNodejs?global:typeof self>"u"?window:self})();ae.isArray=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};ae.isArrayBuffer=function(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer};ae.isArrayBufferView=function(r){return r&&ae.isArrayBuffer(r.buffer)&&r.byteLength!==void 0};function Ax(r){if(!(r===8||r===16||r===24||r===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+r)}o(Ax,"_checkBitsParam");ae.ByteBuffer=gP;function gP(r){if(this.data="",this.read=0,typeof r=="string")this.data=r;else if(ae.isArrayBuffer(r)||ae.isArrayBufferView(r))if(typeof Buffer<"u"&&r instanceof Buffer)this.data=r.toString("binary");else{var e=new Uint8Array(r);try{this.data=String.fromCharCode.apply(null,e)}catch{for(var t=0;t<e.length;++t)this.putByte(e[t])}}else(r instanceof gP||typeof r=="object"&&typeof r.data=="string"&&typeof r.read=="number")&&(this.data=r.data,this.read=r.read);this._constructedStringLength=0}o(gP,"ByteStringBuffer");ae.ByteStringBuffer=gP;var iue=4096;ae.ByteStringBuffer.prototype._optimizeConstructedString=function(r){this._constructedStringLength+=r,this._constructedStringLength>iue&&(this.data.substr(0,1),this._constructedStringLength=0)};ae.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};ae.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0};ae.ByteStringBuffer.prototype.putByte=function(r){return this.putBytes(String.fromCharCode(r))};ae.ByteStringBuffer.prototype.fillWithByte=function(r,e){r=String.fromCharCode(r);for(var t=this.data;e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return this.data=t,this._optimizeConstructedString(e),this};ae.ByteStringBuffer.prototype.putBytes=function(r){return this.data+=r,this._optimizeConstructedString(r.length),this};ae.ByteStringBuffer.prototype.putString=function(r){return this.putBytes(ae.encodeUtf8(r))};ae.ByteStringBuffer.prototype.putInt16=function(r){return this.putBytes(String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt24=function(r){return this.putBytes(String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt32=function(r){return this.putBytes(String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255))};ae.ByteStringBuffer.prototype.putInt16Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255))};ae.ByteStringBuffer.prototype.putInt24Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255))};ae.ByteStringBuffer.prototype.putInt32Le=function(r){return this.putBytes(String.fromCharCode(r&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>24&255))};ae.ByteStringBuffer.prototype.putInt=function(r,e){Ax(e);var t="";do e-=8,t+=String.fromCharCode(r>>e&255);while(e>0);return this.putBytes(t)};ae.ByteStringBuffer.prototype.putSignedInt=function(r,e){return r<0&&(r+=2<<e-1),this.putInt(r,e)};ae.ByteStringBuffer.prototype.putBuffer=function(r){return this.putBytes(r.getBytes())};ae.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)};ae.ByteStringBuffer.prototype.getInt16=function(){var r=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,r};ae.ByteStringBuffer.prototype.getInt24=function(){var r=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,r};ae.ByteStringBuffer.prototype.getInt32=function(){var r=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,r};ae.ByteStringBuffer.prototype.getInt16Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,r};ae.ByteStringBuffer.prototype.getInt24Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,r};ae.ByteStringBuffer.prototype.getInt32Le=function(){var r=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,r};ae.ByteStringBuffer.prototype.getInt=function(r){Ax(r);var e=0;do e=(e<<8)+this.data.charCodeAt(this.read++),r-=8;while(r>0);return e};ae.ByteStringBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ae.ByteStringBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ae.ByteStringBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ae.ByteStringBuffer.prototype.at=function(r){return this.data.charCodeAt(this.read+r)};ae.ByteStringBuffer.prototype.setAt=function(r,e){return this.data=this.data.substr(0,this.read+r)+String.fromCharCode(e)+this.data.substr(this.read+r+1),this};ae.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};ae.ByteStringBuffer.prototype.copy=function(){var r=ae.createBuffer(this.data);return r.read=this.read,r};ae.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this};ae.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this};ae.ByteStringBuffer.prototype.truncate=function(r){var e=Math.max(0,this.length()-r);return this.data=this.data.substr(this.read,e),this.read=0,this};ae.ByteStringBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.length;++e){var t=this.data.charCodeAt(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ae.ByteStringBuffer.prototype.toString=function(){return ae.decodeUtf8(this.bytes())};function sue(r,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var t=ae.isArrayBuffer(r),n=ae.isArrayBufferView(r);if(t||n){t?this.data=new DataView(r):this.data=new DataView(r.buffer,r.byteOffset,r.byteLength),this.write="writeOffset"in e?e.writeOffset:this.data.byteLength;return}this.data=new DataView(new ArrayBuffer(0)),this.write=0,r!=null&&this.putBytes(r),"writeOffset"in e&&(this.write=e.writeOffset)}o(sue,"DataBuffer");ae.DataBuffer=sue;ae.DataBuffer.prototype.length=function(){return this.write-this.read};ae.DataBuffer.prototype.isEmpty=function(){return this.length()<=0};ae.DataBuffer.prototype.accommodate=function(r,e){if(this.length()>=r)return this;e=Math.max(e||this.growSize,r);var t=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(t),this.data=new DataView(n.buffer),this};ae.DataBuffer.prototype.putByte=function(r){return this.accommodate(1),this.data.setUint8(this.write++,r),this};ae.DataBuffer.prototype.fillWithByte=function(r,e){this.accommodate(e);for(var t=0;t<e;++t)this.data.setUint8(r);return this};ae.DataBuffer.prototype.putBytes=function(r,e){if(ae.isArrayBufferView(r)){var t=new Uint8Array(r.buffer,r.byteOffset,r.byteLength),n=t.byteLength-t.byteOffset;this.accommodate(n);var i=new Uint8Array(this.data.buffer,this.write);return i.set(t),this.write+=n,this}if(ae.isArrayBuffer(r)){var t=new Uint8Array(r);this.accommodate(t.byteLength);var i=new Uint8Array(this.data.buffer);return i.set(t,this.write),this.write+=t.byteLength,this}if(r instanceof ae.DataBuffer||typeof r=="object"&&typeof r.read=="number"&&typeof r.write=="number"&&ae.isArrayBufferView(r.data)){var t=new Uint8Array(r.data.byteLength,r.read,r.length());this.accommodate(t.byteLength);var i=new Uint8Array(r.data.byteLength,this.write);return i.set(t),this.write+=t.byteLength,this}if(r instanceof ae.ByteStringBuffer&&(r=r.data,e="binary"),e=e||"binary",typeof r=="string"){var s;if(e==="hex")return this.accommodate(Math.ceil(r.length/2)),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.hex.decode(r,s,this.write),this;if(e==="base64")return this.accommodate(Math.ceil(r.length/4)*3),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.base64.decode(r,s,this.write),this;if(e==="utf8"&&(r=ae.encodeUtf8(r),e="binary"),e==="binary"||e==="raw")return this.accommodate(r.length),s=new Uint8Array(this.data.buffer,this.write),this.write+=ae.binary.raw.decode(s),this;if(e==="utf16")return this.accommodate(r.length*2),s=new Uint16Array(this.data.buffer,this.write),this.write+=ae.text.utf16.encode(s),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+r)};ae.DataBuffer.prototype.putBuffer=function(r){return this.putBytes(r),r.clear(),this};ae.DataBuffer.prototype.putString=function(r){return this.putBytes(r,"utf16")};ae.DataBuffer.prototype.putInt16=function(r){return this.accommodate(2),this.data.setInt16(this.write,r),this.write+=2,this};ae.DataBuffer.prototype.putInt24=function(r){return this.accommodate(3),this.data.setInt16(this.write,r>>8&65535),this.data.setInt8(this.write,r>>16&255),this.write+=3,this};ae.DataBuffer.prototype.putInt32=function(r){return this.accommodate(4),this.data.setInt32(this.write,r),this.write+=4,this};ae.DataBuffer.prototype.putInt16Le=function(r){return this.accommodate(2),this.data.setInt16(this.write,r,!0),this.write+=2,this};ae.DataBuffer.prototype.putInt24Le=function(r){return this.accommodate(3),this.data.setInt8(this.write,r>>16&255),this.data.setInt16(this.write,r>>8&65535,!0),this.write+=3,this};ae.DataBuffer.prototype.putInt32Le=function(r){return this.accommodate(4),this.data.setInt32(this.write,r,!0),this.write+=4,this};ae.DataBuffer.prototype.putInt=function(r,e){Ax(e),this.accommodate(e/8);do e-=8,this.data.setInt8(this.write++,r>>e&255);while(e>0);return this};ae.DataBuffer.prototype.putSignedInt=function(r,e){return Ax(e),this.accommodate(e/8),r<0&&(r+=2<<e-1),this.putInt(r,e)};ae.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)};ae.DataBuffer.prototype.getInt16=function(){var r=this.data.getInt16(this.read);return this.read+=2,r};ae.DataBuffer.prototype.getInt24=function(){var r=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,r};ae.DataBuffer.prototype.getInt32=function(){var r=this.data.getInt32(this.read);return this.read+=4,r};ae.DataBuffer.prototype.getInt16Le=function(){var r=this.data.getInt16(this.read,!0);return this.read+=2,r};ae.DataBuffer.prototype.getInt24Le=function(){var r=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,r};ae.DataBuffer.prototype.getInt32Le=function(){var r=this.data.getInt32(this.read,!0);return this.read+=4,r};ae.DataBuffer.prototype.getInt=function(r){Ax(r);var e=0;do e=(e<<8)+this.data.getInt8(this.read++),r-=8;while(r>0);return e};ae.DataBuffer.prototype.getSignedInt=function(r){var e=this.getInt(r),t=2<<r-2;return e>=t&&(e-=t<<1),e};ae.DataBuffer.prototype.getBytes=function(r){var e;return r?(r=Math.min(this.length(),r),e=this.data.slice(this.read,this.read+r),this.read+=r):r===0?e="":(e=this.read===0?this.data:this.data.slice(this.read),this.clear()),e};ae.DataBuffer.prototype.bytes=function(r){return typeof r>"u"?this.data.slice(this.read):this.data.slice(this.read,this.read+r)};ae.DataBuffer.prototype.at=function(r){return this.data.getUint8(this.read+r)};ae.DataBuffer.prototype.setAt=function(r,e){return this.data.setUint8(r,e),this};ae.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};ae.DataBuffer.prototype.copy=function(){return new ae.DataBuffer(this)};ae.DataBuffer.prototype.compact=function(){if(this.read>0){var r=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(r.byteLength);e.set(r),this.data=new DataView(e),this.write-=this.read,this.read=0}return this};ae.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this};ae.DataBuffer.prototype.truncate=function(r){return this.write=Math.max(0,this.length()-r),this.read=Math.min(this.read,this.write),this};ae.DataBuffer.prototype.toHex=function(){for(var r="",e=this.read;e<this.data.byteLength;++e){var t=this.data.getUint8(e);t<16&&(r+="0"),r+=t.toString(16)}return r};ae.DataBuffer.prototype.toString=function(r){var e=new Uint8Array(this.data,this.read,this.length());if(r=r||"utf8",r==="binary"||r==="raw")return ae.binary.raw.encode(e);if(r==="hex")return ae.binary.hex.encode(e);if(r==="base64")return ae.binary.base64.encode(e);if(r==="utf8")return ae.text.utf8.decode(e);if(r==="utf16")return ae.text.utf16.decode(e);throw new Error("Invalid encoding: "+r)};ae.createBuffer=function(r,e){return e=e||"raw",r!==void 0&&e==="utf8"&&(r=ae.encodeUtf8(r)),new ae.ByteBuffer(r)};ae.fillString=function(r,e){for(var t="";e>0;)e&1&&(t+=r),e>>>=1,e>0&&(r+=r);return t};ae.xorBytes=function(r,e,t){for(var n="",i="",s="",a=0,u=0;t>0;--t,++a)i=r.charCodeAt(a)^e.charCodeAt(a),u>=10&&(n+=s,s="",u=0),s+=String.fromCharCode(i),++u;return n+=s,n};ae.hexToBytes=function(r){var e="",t=0;for(r.length&!0&&(t=1,e+=String.fromCharCode(parseInt(r[0],16)));t<r.length;t+=2)e+=String.fromCharCode(parseInt(r.substr(t,2),16));return e};ae.bytesToHex=function(r){return ae.createBuffer(r).toHex()};ae.int32ToBytes=function(r){return String.fromCharCode(r>>24&255)+String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(r&255)};var Rp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Dp=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],gU="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";ae.encode64=function(r,e){for(var t="",n="",i,s,a,u=0;u<r.length;)i=r.charCodeAt(u++),s=r.charCodeAt(u++),a=r.charCodeAt(u++),t+=Rp.charAt(i>>2),t+=Rp.charAt((i&3)<<4|s>>4),isNaN(s)?t+="==":(t+=Rp.charAt((s&15)<<2|a>>6),t+=isNaN(a)?"=":Rp.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
3
4
  `,t=t.substr(e));return n+=t,n};ae.decode64=function(r){r=r.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",t,n,i,s,a=0;a<r.length;)t=Dp[r.charCodeAt(a++)-43],n=Dp[r.charCodeAt(a++)-43],i=Dp[r.charCodeAt(a++)-43],s=Dp[r.charCodeAt(a++)-43],e+=String.fromCharCode(t<<2|n>>4),i!==64&&(e+=String.fromCharCode((n&15)<<4|i>>2),s!==64&&(e+=String.fromCharCode((i&3)<<6|s)));return e};ae.encodeUtf8=function(r){return unescape(encodeURIComponent(r))};ae.decodeUtf8=function(r){return decodeURIComponent(escape(r))};ae.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:mU.encode,decode:mU.decode}};ae.binary.raw.encode=function(r){return String.fromCharCode.apply(null,r)};ae.binary.raw.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(r.length)),t=t||0;for(var i=t,s=0;s<r.length;++s)n[i++]=r.charCodeAt(s);return e?i-t:n};ae.binary.hex.encode=ae.bytesToHex;ae.binary.hex.decode=function(r,e,t){var n=e;n||(n=new Uint8Array(Math.ceil(r.length/2))),t=t||0;var i=0,s=t;for(r.length&1&&(i=1,n[s++]=parseInt(r[0],16));i<r.length;i+=2)n[s++]=parseInt(r.substr(i,2),16);return e?s-t:n};ae.binary.base64.encode=function(r,e){for(var t="",n="",i,s,a,u=0;u<r.byteLength;)i=r[u++],s=r[u++],a=r[u++],t+=Rp.charAt(i>>2),t+=Rp.charAt((i&3)<<4|s>>4),isNaN(s)?t+="==":(t+=Rp.charAt((s&15)<<2|a>>6),t+=isNaN(a)?"=":Rp.charAt(a&63)),e&&t.length>e&&(n+=t.substr(0,e)+`\r
@@ -1 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"../chunk-D6GG2M7K.mjs";import"../chunk-MXBBYFAK.mjs";import"../chunk-W6MRGYXP.mjs";export{c as AccessKeyBuilder,d as DefaultDetBuilderAggregator,e as DefaultTotalBuilderAggregator,i as NFCeDto,f as NFeDto,k as NfceQrcode,j as NfceRemoteTransmitter,n as NfceXmlBuilder,h as NfeAuthorizerPipeline,l as NfeDetXmlBuilder,g as NfeRemoteTransmitter,m as NfeXmlBuilder,a as TpEmis,b as directory};
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}from"../chunk-MKETPTVV.mjs";import"../chunk-TKSZP5SJ.mjs";import"../chunk-WEMHPBTC.mjs";export{c as AccessKeyBuilder,d as DefaultDetBuilderAggregator,e as DefaultTotalBuilderAggregator,i as NFCeDto,f as NFeDto,k as NfceQrcode,j as NfceRemoteTransmitter,n as NfceXmlBuilder,h as NfeAuthorizerPipeline,l as NfeDetXmlBuilder,g as NfeRemoteTransmitter,m as NfeXmlBuilder,a as TpEmis,b as directory};
@@ -1,4 +1,5 @@
1
- import{a as s,b as te,c as b,d as E,e as Di,f as ht}from"./chunk-W6MRGYXP.mjs";import ee from"fs";import Bi from"crypto";import{EventEmitter as Ri}from"events";var Ii,ct,ut=b(()=>{"use strict";Ii=class extends Ri{static{s(this,"PersistentFile")}constructor({filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a}){super(),this.lastModifiedDate=null,Object.assign(this,{filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a}),this.size=0,this._writeStream=null,typeof this.hashAlgorithm=="string"?this.hash=Bi.createHash(this.hashAlgorithm):this.hash=null}open(){this._writeStream=ee.createWriteStream(this.filepath),this._writeStream.on("error",t=>{this.emit("error",t)})}toJSON(){let t={size:this.size,filepath:this.filepath,newFilename:this.newFilename,mimetype:this.mimetype,mtime:this.lastModifiedDate,length:this.length,originalFilename:this.originalFilename};return this.hash&&this.hash!==""&&(t.hash=this.hash),t}toString(){return`PersistentFile: ${this.newFilename}, Original: ${this.originalFilename}, Path: ${this.filepath}`}write(t,i){if(this.hash&&this.hash.update(t),this._writeStream.closed){i();return}this._writeStream.write(t,()=>{this.lastModifiedDate=new Date,this.size+=t.length,this.emit("progress",this.size),i()})}end(t){this.hash&&(this.hash=this.hash.digest("hex")),this._writeStream.end(()=>{this.emit("end"),t()})}destroy(){this._writeStream.destroy();let t=this.filepath;setTimeout(function(){ee.unlink(t,()=>{})},1)}},ct=Ii});import{createHash as Pi}from"crypto";import{EventEmitter as Hi}from"events";var Ui,ft,dt=b(()=>{"use strict";Ui=class extends Hi{static{s(this,"VolatileFile")}constructor({filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a,createFileWriteStream:o}){super(),this.lastModifiedDate=null,Object.assign(this,{filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a,createFileWriteStream:o}),this.size=0,this._writeStream=null,typeof this.hashAlgorithm=="string"?this.hash=Pi(this.hashAlgorithm):this.hash=null}open(){this._writeStream=this.createFileWriteStream(this),this._writeStream.on("error",t=>{this.emit("error",t)})}destroy(){this._writeStream.destroy()}toJSON(){let t={size:this.size,newFilename:this.newFilename,length:this.length,originalFilename:this.originalFilename,mimetype:this.mimetype};return this.hash&&this.hash!==""&&(t.hash=this.hash),t}toString(){return`VolatileFile: ${this.originalFilename}`}write(t,i){if(this.hash&&this.hash.update(t),this._writeStream.closed||this._writeStream.destroyed){i();return}this._writeStream.write(t,()=>{this.size+=t.length,this.emit("progress",this.size),i()})}end(t){this.hash&&(this.hash=this.hash.digest("hex")),this._writeStream.end(()=>{this.emit("end"),t()})}},ft=Ui});var Se=E(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.toBig=c.shrSL=c.shrSH=c.rotrSL=c.rotrSH=c.rotrBL=c.rotrBH=c.rotr32L=c.rotr32H=c.rotlSL=c.rotlSH=c.rotlBL=c.rotlBH=c.add5L=c.add5H=c.add4L=c.add4H=c.add3L=c.add3H=void 0;c.add=ge;c.fromBig=mt;c.split=ie;var Y=BigInt(2**32-1),pt=BigInt(32);function mt(e,t=!1){return t?{h:Number(e&Y),l:Number(e>>pt&Y)}:{h:Number(e>>pt&Y)|0,l:Number(e&Y)|0}}s(mt,"fromBig");function ie(e,t=!1){let i=e.length,r=new Uint32Array(i),n=new Uint32Array(i);for(let a=0;a<i;a++){let{h:o,l}=mt(e[a],t);[r[a],n[a]]=[o,l]}return[r,n]}s(ie,"split");var re=s((e,t)=>BigInt(e>>>0)<<pt|BigInt(t>>>0),"toBig");c.toBig=re;var se=s((e,t,i)=>e>>>i,"shrSH");c.shrSH=se;var ne=s((e,t,i)=>e<<32-i|t>>>i,"shrSL");c.shrSL=ne;var oe=s((e,t,i)=>e>>>i|t<<32-i,"rotrSH");c.rotrSH=oe;var ae=s((e,t,i)=>e<<32-i|t>>>i,"rotrSL");c.rotrSL=ae;var le=s((e,t,i)=>e<<64-i|t>>>i-32,"rotrBH");c.rotrBH=le;var he=s((e,t,i)=>e>>>i-32|t<<64-i,"rotrBL");c.rotrBL=he;var ce=s((e,t)=>t,"rotr32H");c.rotr32H=ce;var ue=s((e,t)=>e,"rotr32L");c.rotr32L=ue;var fe=s((e,t,i)=>e<<i|t>>>32-i,"rotlSH");c.rotlSH=fe;var de=s((e,t,i)=>t<<i|e>>>32-i,"rotlSL");c.rotlSL=de;var pe=s((e,t,i)=>t<<i-32|e>>>64-i,"rotlBH");c.rotlBH=pe;var me=s((e,t,i)=>e<<i-32|t>>>64-i,"rotlBL");c.rotlBL=me;function ge(e,t,i,r){let n=(t>>>0)+(r>>>0);return{h:e+i+(n/2**32|0)|0,l:n|0}}s(ge,"add");var ye=s((e,t,i)=>(e>>>0)+(t>>>0)+(i>>>0),"add3L");c.add3L=ye;var _e=s((e,t,i,r)=>t+i+r+(e/2**32|0)|0,"add3H");c.add3H=_e;var be=s((e,t,i,r)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0),"add4L");c.add4L=be;var we=s((e,t,i,r,n)=>t+i+r+n+(e/2**32|0)|0,"add4H");c.add4H=we;var xe=s((e,t,i,r,n)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0)+(n>>>0),"add5L");c.add5L=xe;var Ee=s((e,t,i,r,n,a)=>t+i+r+n+a+(e/2**32|0)|0,"add5H");c.add5H=Ee;var Ni={fromBig:mt,split:ie,toBig:re,shrSH:se,shrSL:ne,rotrSH:oe,rotrSL:ae,rotrBH:le,rotrBL:he,rotr32H:ce,rotr32L:ue,rotlSH:fe,rotlSL:de,rotlBH:pe,rotlBL:me,add:ge,add3L:ye,add3H:_e,add4L:be,add4H:we,add5H:Ee,add5L:xe};c.default=Ni});var Ae=E(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.crypto=void 0;var O=te("crypto");X.crypto=O&&typeof O=="object"&&"webcrypto"in O?O.webcrypto:O&&typeof O=="object"&&"randomBytes"in O?O:void 0});var Re=E(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.wrapXOFConstructorWithOpts=h.wrapConstructorWithOpts=h.wrapConstructor=h.Hash=h.nextTick=h.swap32IfBE=h.byteSwapIfBE=h.swap8IfBE=h.isLE=void 0;h.isBytes=Te;h.anumber=gt;h.abytes=N;h.ahash=vi;h.aexists=Ci;h.aoutput=Mi;h.u8=zi;h.u32=ji;h.clean=$i;h.createView=Vi;h.rotr=qi;h.rotl=Wi;h.byteSwap=yt;h.byteSwap32=ke;h.bytesToHex=Xi;h.hexToBytes=Ji;h.asyncLoop=Qi;h.utf8ToBytes=_t;h.bytesToUtf8=Zi;h.toBytes=J;h.kdfInputToBytes=Gi;h.concatBytes=tr;h.checkOpts=er;h.createHasher=Oe;h.createOptHasher=De;h.createXOFer=Be;h.randomBytes=rr;var U=Ae();function Te(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}s(Te,"isBytes");function gt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}s(gt,"anumber");function N(e,...t){if(!Te(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}s(N,"abytes");function vi(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");gt(e.outputLen),gt(e.blockLen)}s(vi,"ahash");function Ci(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}s(Ci,"aexists");function Mi(e,t){N(e);let i=t.outputLen;if(e.length<i)throw new Error("digestInto() expects output buffer of length at least "+i)}s(Mi,"aoutput");function zi(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}s(zi,"u8");function ji(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}s(ji,"u32");function $i(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}s($i,"clean");function Vi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}s(Vi,"createView");function qi(e,t){return e<<32-t|e>>>t}s(qi,"rotr");function Wi(e,t){return e<<t|e>>>32-t>>>0}s(Wi,"rotl");h.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function yt(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}s(yt,"byteSwap");h.swap8IfBE=h.isLE?e=>e:e=>yt(e);h.byteSwapIfBE=h.swap8IfBE;function ke(e){for(let t=0;t<e.length;t++)e[t]=yt(e[t]);return e}s(ke,"byteSwap32");h.swap32IfBE=h.isLE?e=>e:ke;var Le=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Yi=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xi(e){if(N(e),Le)return e.toHex();let t="";for(let i=0;i<e.length;i++)t+=Yi[e[i]];return t}s(Xi,"bytesToHex");var L={_0:48,_9:57,A:65,F:70,a:97,f:102};function Fe(e){if(e>=L._0&&e<=L._9)return e-L._0;if(e>=L.A&&e<=L.F)return e-(L.A-10);if(e>=L.a&&e<=L.f)return e-(L.a-10)}s(Fe,"asciiToBase16");function Ji(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Le)return Uint8Array.fromHex(e);let t=e.length,i=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(i);for(let n=0,a=0;n<i;n++,a+=2){let o=Fe(e.charCodeAt(a)),l=Fe(e.charCodeAt(a+1));if(o===void 0||l===void 0){let u=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+a)}r[n]=o*16+l}return r}s(Ji,"hexToBytes");var Ki=s(async()=>{},"nextTick");h.nextTick=Ki;async function Qi(e,t,i){let r=Date.now();for(let n=0;n<e;n++){i(n);let a=Date.now()-r;a>=0&&a<t||(await(0,h.nextTick)(),r+=a)}}s(Qi,"asyncLoop");function _t(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}s(_t,"utf8ToBytes");function Zi(e){return new TextDecoder().decode(e)}s(Zi,"bytesToUtf8");function J(e){return typeof e=="string"&&(e=_t(e)),N(e),e}s(J,"toBytes");function Gi(e){return typeof e=="string"&&(e=_t(e)),N(e),e}s(Gi,"kdfInputToBytes");function tr(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];N(n),t+=n.length}let i=new Uint8Array(t);for(let r=0,n=0;r<e.length;r++){let a=e[r];i.set(a,n),n+=a.length}return i}s(tr,"concatBytes");function er(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}s(er,"checkOpts");var ir=class{static{s(this,"Hash")}};h.Hash=ir;function Oe(e){let t=s(r=>e().update(J(r)).digest(),"hashC"),i=e();return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=()=>e(),t}s(Oe,"createHasher");function De(e){let t=s((r,n)=>e(n).update(J(r)).digest(),"hashC"),i=e({});return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=r=>e(r),t}s(De,"createOptHasher");function Be(e){let t=s((r,n)=>e(n).update(J(r)).digest(),"hashC"),i=e({});return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=r=>e(r),t}s(Be,"createXOFer");h.wrapConstructor=Oe;h.wrapConstructorWithOpts=De;h.wrapXOFConstructorWithOpts=Be;function rr(e=32){if(U.crypto&&typeof U.crypto.getRandomValues=="function")return U.crypto.getRandomValues(new Uint8Array(e));if(U.crypto&&typeof U.crypto.randomBytes=="function")return Uint8Array.from(U.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}s(rr,"randomBytes")});var je=E(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.shake256=p.shake128=p.keccak_512=p.keccak_384=p.keccak_256=p.keccak_224=p.sha3_512=p.sha3_384=p.sha3_256=p.sha3_224=p.Keccak=void 0;p.keccakP=Ce;var M=Se(),w=Re(),sr=BigInt(0),C=BigInt(1),nr=BigInt(2),or=BigInt(7),ar=BigInt(256),lr=BigInt(113),He=[],Ue=[],Ne=[];for(let e=0,t=C,i=1,r=0;e<24;e++){[i,r]=[r,(2*i+3*r)%5],He.push(2*(5*r+i)),Ue.push((e+1)*(e+2)/2%64);let n=sr;for(let a=0;a<7;a++)t=(t<<C^(t>>or)*lr)%ar,t&nr&&(n^=C<<(C<<BigInt(a))-C);Ne.push(n)}var ve=(0,M.split)(Ne,!0),hr=ve[0],cr=ve[1],Ie=s((e,t,i)=>i>32?(0,M.rotlBH)(e,t,i):(0,M.rotlSH)(e,t,i),"rotlH"),Pe=s((e,t,i)=>i>32?(0,M.rotlBL)(e,t,i):(0,M.rotlSL)(e,t,i),"rotlL");function Ce(e,t=24){let i=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)i[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){let l=(o+8)%10,u=(o+2)%10,y=i[u],d=i[u+1],T=Ie(y,d,1)^i[l],_=Pe(y,d,1)^i[l+1];for(let S=0;S<50;S+=10)e[o+S]^=T,e[o+S+1]^=_}let n=e[2],a=e[3];for(let o=0;o<24;o++){let l=Ue[o],u=Ie(n,a,l),y=Pe(n,a,l),d=He[o];n=e[d],a=e[d+1],e[d]=u,e[d+1]=y}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)i[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~i[(l+2)%10]&i[(l+4)%10]}e[0]^=hr[r],e[1]^=cr[r]}(0,w.clean)(i)}s(Ce,"keccakP");var bt=class Me extends w.Hash{static{s(this,"Keccak")}constructor(t,i,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=i,this.outputLen=r,this.enableXOF=n,this.rounds=a,(0,w.anumber)(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,w.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,w.swap32IfBE)(this.state32),Ce(this.state32,this.rounds),(0,w.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,w.aexists)(this),t=(0,w.toBytes)(t),(0,w.abytes)(t);let{blockLen:i,state:r}=this,n=t.length;for(let a=0;a<n;){let o=Math.min(i-this.pos,n-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===i&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:i,pos:r,blockLen:n}=this;t[r]^=i,(i&128)!==0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,w.aexists)(this,!1),(0,w.abytes)(t),this.finish();let i=this.state,{blockLen:r}=this;for(let n=0,a=t.length;n<a;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,a-n);t.set(i.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,w.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,w.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,w.clean)(this.state)}_cloneInto(t){let{blockLen:i,suffix:r,outputLen:n,rounds:a,enableXOF:o}=this;return t||(t=new Me(i,r,n,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}};p.Keccak=bt;var D=s((e,t,i)=>(0,w.createHasher)(()=>new bt(t,e,i)),"gen");p.sha3_224=D(6,144,224/8);p.sha3_256=D(6,136,256/8);p.sha3_384=D(6,104,384/8);p.sha3_512=D(6,72,512/8);p.keccak_224=D(1,144,224/8);p.keccak_256=D(1,136,256/8);p.keccak_384=D(1,104,384/8);p.keccak_512=D(1,72,512/8);var ze=s((e,t,i)=>(0,w.createXOFer)((r={})=>new bt(t,e,r.dkLen===void 0?i:r.dkLen,!0)),"genShake");p.shake128=ze(31,168,128/8);p.shake256=ze(31,136,256/8)});var Ke=E((Fs,B)=>{"use strict";var{sha3_512:ur}=je(),Ve=24,z=32,wt=s((e=4,t=Math.random)=>{let i="";for(;i.length<e;)i=i+Math.floor(t()*36).toString(36);return i},"createEntropy");function qe(e){let t=8n,i=0n;for(let r of e.values()){let n=BigInt(r);i=(i<<t)+n}return i}s(qe,"bufToBigInt");var We=s((e="")=>qe(ur(e)).toString(36).slice(1),"hash"),$e=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),fr=s(e=>$e[Math.floor(e()*$e.length)],"randomLetter"),Ye=s(({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let i=Object.keys(e).toString(),r=i.length?i+wt(z,t):wt(z,t);return We(r).substring(0,z)},"createFingerprint"),Xe=s(e=>()=>e++,"createCounter"),dr=476782367,Je=s(({random:e=Math.random,counter:t=Xe(Math.floor(e()*dr)),length:i=Ve,fingerprint:r=Ye({random:e})}={})=>s(function(){let a=fr(e),o=Date.now().toString(36),l=t().toString(36),u=wt(i,e),y=`${o+u+l+r}`;return`${a+We(y).substring(1,i)}`},"cuid2"),"init"),pr=Je(),mr=s((e,{minLength:t=2,maxLength:i=z}={})=>{let r=e.length,n=/^[0-9a-z]+$/;try{if(typeof e=="string"&&r>=t&&r<=i&&n.test(e))return!0}finally{}return!1},"isCuid");B.exports.getConstants=()=>({defaultLength:Ve,bigLength:z});B.exports.init=Je;B.exports.createId=pr;B.exports.bufToBigInt=qe;B.exports.createCounter=Xe;B.exports.createFingerprint=Ye;B.exports.isCuid=mr});var Qe=E((ks,j)=>{"use strict";var{createId:gr,init:yr,getConstants:_r,isCuid:br}=Ke();j.exports.createId=gr;j.exports.init=yr;j.exports.getConstants=_r;j.exports.isCuid=br});var xt=E((Ls,Ge)=>{"use strict";Ge.exports=Ze;function Ze(e,t){if(e&&t)return Ze(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(r){i[r]=e[r]}),i;function i(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];var a=e.apply(this,r),o=r[r.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(l){a[l]=o[l]}),a}s(i,"wrapper")}s(Ze,"wrappy")});var si=E((Ds,ri)=>{"use strict";var K,wr=typeof setImmediate=="function";ri.exports=ei;function ei(e){F.length||(ii(),Et=!0),F[F.length]=e}s(ei,"rawAsap");var F=[],Et=!1,A=0,xr=1024;function ti(){for(;A<F.length;){var e=A;if(A=A+1,F[e].call(),A>xr){for(var t=0,i=F.length-A;t<i;t++)F[t]=F[t+A];F.length-=A,A=0}}F.length=0,A=0,Et=!1}s(ti,"flush");ei.requestFlush=ii;function ii(){var e=process.domain;e&&(K||(K=te("domain")),K.active=process.domain=null),Et&&wr?setImmediate(ti):process.nextTick(ti),e&&(K.active=process.domain=e)}s(ii,"requestFlush")});var li=E((Rs,ai)=>{"use strict";var ni=si(),St=[];ai.exports=Er;function Er(e){var t;St.length?t=St.pop():t=new oi,t.task=e,t.domain=process.domain,ni(t)}s(Er,"asap");function oi(){this.task=null,this.domain=null}s(oi,"RawTask");oi.prototype.call=function(){this.domain&&this.domain.enter();var e=!0;try{this.task.call(),e=!1,this.domain&&this.domain.exit()}finally{e&&ni.requestFlush(),this.task=null,this.domain=null,St.push(this)}}});var ui=E((Ps,ci)=>{"use strict";var Sr=xt();ci.exports=Sr(Ar);var hi=li();function Ar(e){var t=!0;return hi(function(){t=!1}),s(function(){var r=arguments,n=this;t?hi(function(){e.apply(n,r)}):e.apply(n,r)},"zalgoSafe")}s(Ar,"dezalgo")});var pi=E((Us,At)=>{"use strict";var fi=xt();At.exports=fi(Q);At.exports.strict=fi(di);Q.proto=Q(function(){Object.defineProperty(Function.prototype,"once",{value:s(function(){return Q(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:s(function(){return di(this)},"value"),configurable:!0})});function Q(e){var t=s(function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))},"f");return t.called=!1,t}s(Q,"once");function di(e){var t=s(function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},"f"),i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}s(di,"onceStrict")});var $={};Di($,{aborted:()=>kt,biggerThanMaxFileSize:()=>zt,biggerThanTotalMaxFileSize:()=>Pt,cannotCreateDir:()=>$t,default:()=>m,filenameNotString:()=>Dt,malformedMultipart:()=>Nt,maxFieldsExceeded:()=>Rt,maxFieldsSizeExceeded:()=>Bt,maxFilesExceeded:()=>Mt,missingContentType:()=>Ut,missingMultipartBoundary:()=>vt,missingPlugin:()=>Ft,noEmptyFiles:()=>Ht,noParser:()=>Lt,pluginFailed:()=>jt,pluginFunction:()=>Tt,smallerThanMinFileSize:()=>It,uninitializedParser:()=>Ot,unknownTransferEncoding:()=>Ct});var Ft,Tt,kt,Lt,Ot,Dt,Bt,Rt,It,Pt,Ht,Ut,Nt,vt,Ct,Mt,zt,jt,$t,Fr,m,I=b(()=>{"use strict";Ft=1e3,Tt=1001,kt=1002,Lt=1003,Ot=1004,Dt=1005,Bt=1006,Rt=1007,It=1008,Pt=1009,Ht=1010,Ut=1011,Nt=1012,vt=1013,Ct=1014,Mt=1015,zt=1016,jt=1017,$t=1018,Fr=class extends Error{static{s(this,"FormidableError")}constructor(e,t,i=500){super(e),this.code=t,this.httpCode=i}},m=Fr});import{Transform as Tr}from"stream";var kr,Z,Vt=b(()=>{"use strict";kr=class extends Tr{static{s(this,"DummyParser")}constructor(t,i={}){super(),this.globalOptions={...i},this.incomingForm=t}_flush(t){this.incomingForm.ended=!0,this.incomingForm._maybeEnd(),t()}},Z=kr});import{Transform as Lr}from"stream";function Ir(e){return e|32}var x,f,mi,R,G,tt,Or,V,Dr,Br,Rr,gi,yi,q,et=b(()=>{"use strict";I();I();x=0,f={PARSER_UNINITIALIZED:x++,START:x++,START_BOUNDARY:x++,HEADER_FIELD_START:x++,HEADER_FIELD:x++,HEADER_VALUE_START:x++,HEADER_VALUE:x++,HEADER_VALUE_ALMOST_DONE:x++,HEADERS_ALMOST_DONE:x++,PART_DATA_START:x++,PART_DATA:x++,PART_END:x++,END:x++},mi=1,R={PART_BOUNDARY:mi,LAST_BOUNDARY:mi*=2},G=10,tt=13,Or=32,V=45,Dr=58,Br=97,Rr=122;s(Ir,"lower");gi={};Object.keys(f).forEach(e=>{gi[e]=f[e]});yi=class _i extends Lr{static{s(this,"MultipartParser")}constructor(t={}){super({readableObjectMode:!0}),this.boundary=null,this.boundaryChars=null,this.lookbehind=null,this.bufferLength=0,this.state=f.PARSER_UNINITIALIZED,this.globalOptions={...t},this.index=null,this.flags=0}_endUnexpected(){return new m(`MultipartParser.end(): stream ended unexpectedly: ${this.explain()}`,1012,400)}_flush(t){this.state===f.HEADER_FIELD_START&&this.index===0||this.state===f.PART_DATA&&this.index===this.boundary.length?(this._handleCallback("partEnd"),this._handleCallback("end"),t()):this.state!==f.END?t(this._endUnexpected()):t()}initWithBoundary(t){this.boundary=Buffer.from(`\r
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+ import{a as s,b as te,c as b,d as E,e as Di,f as ht}from"./chunk-WEMHPBTC.mjs";import ee from"fs";import Bi from"crypto";import{EventEmitter as Ri}from"events";var Ii,ct,ut=b(()=>{"use strict";Ii=class extends Ri{static{s(this,"PersistentFile")}constructor({filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a}){super(),this.lastModifiedDate=null,Object.assign(this,{filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a}),this.size=0,this._writeStream=null,typeof this.hashAlgorithm=="string"?this.hash=Bi.createHash(this.hashAlgorithm):this.hash=null}open(){this._writeStream=ee.createWriteStream(this.filepath),this._writeStream.on("error",t=>{this.emit("error",t)})}toJSON(){let t={size:this.size,filepath:this.filepath,newFilename:this.newFilename,mimetype:this.mimetype,mtime:this.lastModifiedDate,length:this.length,originalFilename:this.originalFilename};return this.hash&&this.hash!==""&&(t.hash=this.hash),t}toString(){return`PersistentFile: ${this.newFilename}, Original: ${this.originalFilename}, Path: ${this.filepath}`}write(t,i){if(this.hash&&this.hash.update(t),this._writeStream.closed){i();return}this._writeStream.write(t,()=>{this.lastModifiedDate=new Date,this.size+=t.length,this.emit("progress",this.size),i()})}end(t){this.hash&&(this.hash=this.hash.digest("hex")),this._writeStream.end(()=>{this.emit("end"),t()})}destroy(){this._writeStream.destroy();let t=this.filepath;setTimeout(function(){ee.unlink(t,()=>{})},1)}},ct=Ii});import{createHash as Pi}from"crypto";import{EventEmitter as Hi}from"events";var Ui,ft,dt=b(()=>{"use strict";Ui=class extends Hi{static{s(this,"VolatileFile")}constructor({filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a,createFileWriteStream:o}){super(),this.lastModifiedDate=null,Object.assign(this,{filepath:t,newFilename:i,originalFilename:r,mimetype:n,hashAlgorithm:a,createFileWriteStream:o}),this.size=0,this._writeStream=null,typeof this.hashAlgorithm=="string"?this.hash=Pi(this.hashAlgorithm):this.hash=null}open(){this._writeStream=this.createFileWriteStream(this),this._writeStream.on("error",t=>{this.emit("error",t)})}destroy(){this._writeStream.destroy()}toJSON(){let t={size:this.size,newFilename:this.newFilename,length:this.length,originalFilename:this.originalFilename,mimetype:this.mimetype};return this.hash&&this.hash!==""&&(t.hash=this.hash),t}toString(){return`VolatileFile: ${this.originalFilename}`}write(t,i){if(this.hash&&this.hash.update(t),this._writeStream.closed||this._writeStream.destroyed){i();return}this._writeStream.write(t,()=>{this.size+=t.length,this.emit("progress",this.size),i()})}end(t){this.hash&&(this.hash=this.hash.digest("hex")),this._writeStream.end(()=>{this.emit("end"),t()})}},ft=Ui});var Se=E(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.toBig=c.shrSL=c.shrSH=c.rotrSL=c.rotrSH=c.rotrBL=c.rotrBH=c.rotr32L=c.rotr32H=c.rotlSL=c.rotlSH=c.rotlBL=c.rotlBH=c.add5L=c.add5H=c.add4L=c.add4H=c.add3L=c.add3H=void 0;c.add=ge;c.fromBig=mt;c.split=ie;var Y=BigInt(2**32-1),pt=BigInt(32);function mt(e,t=!1){return t?{h:Number(e&Y),l:Number(e>>pt&Y)}:{h:Number(e>>pt&Y)|0,l:Number(e&Y)|0}}s(mt,"fromBig");function ie(e,t=!1){let i=e.length,r=new Uint32Array(i),n=new Uint32Array(i);for(let a=0;a<i;a++){let{h:o,l}=mt(e[a],t);[r[a],n[a]]=[o,l]}return[r,n]}s(ie,"split");var re=s((e,t)=>BigInt(e>>>0)<<pt|BigInt(t>>>0),"toBig");c.toBig=re;var se=s((e,t,i)=>e>>>i,"shrSH");c.shrSH=se;var ne=s((e,t,i)=>e<<32-i|t>>>i,"shrSL");c.shrSL=ne;var oe=s((e,t,i)=>e>>>i|t<<32-i,"rotrSH");c.rotrSH=oe;var ae=s((e,t,i)=>e<<32-i|t>>>i,"rotrSL");c.rotrSL=ae;var le=s((e,t,i)=>e<<64-i|t>>>i-32,"rotrBH");c.rotrBH=le;var he=s((e,t,i)=>e>>>i-32|t<<64-i,"rotrBL");c.rotrBL=he;var ce=s((e,t)=>t,"rotr32H");c.rotr32H=ce;var ue=s((e,t)=>e,"rotr32L");c.rotr32L=ue;var fe=s((e,t,i)=>e<<i|t>>>32-i,"rotlSH");c.rotlSH=fe;var de=s((e,t,i)=>t<<i|e>>>32-i,"rotlSL");c.rotlSL=de;var pe=s((e,t,i)=>t<<i-32|e>>>64-i,"rotlBH");c.rotlBH=pe;var me=s((e,t,i)=>e<<i-32|t>>>64-i,"rotlBL");c.rotlBL=me;function ge(e,t,i,r){let n=(t>>>0)+(r>>>0);return{h:e+i+(n/2**32|0)|0,l:n|0}}s(ge,"add");var ye=s((e,t,i)=>(e>>>0)+(t>>>0)+(i>>>0),"add3L");c.add3L=ye;var _e=s((e,t,i,r)=>t+i+r+(e/2**32|0)|0,"add3H");c.add3H=_e;var be=s((e,t,i,r)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0),"add4L");c.add4L=be;var we=s((e,t,i,r,n)=>t+i+r+n+(e/2**32|0)|0,"add4H");c.add4H=we;var xe=s((e,t,i,r,n)=>(e>>>0)+(t>>>0)+(i>>>0)+(r>>>0)+(n>>>0),"add5L");c.add5L=xe;var Ee=s((e,t,i,r,n,a)=>t+i+r+n+a+(e/2**32|0)|0,"add5H");c.add5H=Ee;var Ni={fromBig:mt,split:ie,toBig:re,shrSH:se,shrSL:ne,rotrSH:oe,rotrSL:ae,rotrBH:le,rotrBL:he,rotr32H:ce,rotr32L:ue,rotlSH:fe,rotlSL:de,rotlBH:pe,rotlBL:me,add:ge,add3L:ye,add3H:_e,add4L:be,add4H:we,add5H:Ee,add5L:xe};c.default=Ni});var Ae=E(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.crypto=void 0;var O=te("crypto");X.crypto=O&&typeof O=="object"&&"webcrypto"in O?O.webcrypto:O&&typeof O=="object"&&"randomBytes"in O?O:void 0});var Re=E(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.wrapXOFConstructorWithOpts=h.wrapConstructorWithOpts=h.wrapConstructor=h.Hash=h.nextTick=h.swap32IfBE=h.byteSwapIfBE=h.swap8IfBE=h.isLE=void 0;h.isBytes=Te;h.anumber=gt;h.abytes=N;h.ahash=vi;h.aexists=Ci;h.aoutput=Mi;h.u8=zi;h.u32=ji;h.clean=$i;h.createView=Vi;h.rotr=qi;h.rotl=Wi;h.byteSwap=yt;h.byteSwap32=ke;h.bytesToHex=Xi;h.hexToBytes=Ji;h.asyncLoop=Qi;h.utf8ToBytes=_t;h.bytesToUtf8=Zi;h.toBytes=J;h.kdfInputToBytes=Gi;h.concatBytes=tr;h.checkOpts=er;h.createHasher=Oe;h.createOptHasher=De;h.createXOFer=Be;h.randomBytes=rr;var U=Ae();function Te(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}s(Te,"isBytes");function gt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}s(gt,"anumber");function N(e,...t){if(!Te(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}s(N,"abytes");function vi(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");gt(e.outputLen),gt(e.blockLen)}s(vi,"ahash");function Ci(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}s(Ci,"aexists");function Mi(e,t){N(e);let i=t.outputLen;if(e.length<i)throw new Error("digestInto() expects output buffer of length at least "+i)}s(Mi,"aoutput");function zi(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}s(zi,"u8");function ji(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}s(ji,"u32");function $i(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}s($i,"clean");function Vi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}s(Vi,"createView");function qi(e,t){return e<<32-t|e>>>t}s(qi,"rotr");function Wi(e,t){return e<<t|e>>>32-t>>>0}s(Wi,"rotl");h.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function yt(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}s(yt,"byteSwap");h.swap8IfBE=h.isLE?e=>e:e=>yt(e);h.byteSwapIfBE=h.swap8IfBE;function ke(e){for(let t=0;t<e.length;t++)e[t]=yt(e[t]);return e}s(ke,"byteSwap32");h.swap32IfBE=h.isLE?e=>e:ke;var Le=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Yi=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Xi(e){if(N(e),Le)return e.toHex();let t="";for(let i=0;i<e.length;i++)t+=Yi[e[i]];return t}s(Xi,"bytesToHex");var L={_0:48,_9:57,A:65,F:70,a:97,f:102};function Fe(e){if(e>=L._0&&e<=L._9)return e-L._0;if(e>=L.A&&e<=L.F)return e-(L.A-10);if(e>=L.a&&e<=L.f)return e-(L.a-10)}s(Fe,"asciiToBase16");function Ji(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Le)return Uint8Array.fromHex(e);let t=e.length,i=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(i);for(let n=0,a=0;n<i;n++,a+=2){let o=Fe(e.charCodeAt(a)),l=Fe(e.charCodeAt(a+1));if(o===void 0||l===void 0){let u=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+a)}r[n]=o*16+l}return r}s(Ji,"hexToBytes");var Ki=s(async()=>{},"nextTick");h.nextTick=Ki;async function Qi(e,t,i){let r=Date.now();for(let n=0;n<e;n++){i(n);let a=Date.now()-r;a>=0&&a<t||(await(0,h.nextTick)(),r+=a)}}s(Qi,"asyncLoop");function _t(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}s(_t,"utf8ToBytes");function Zi(e){return new TextDecoder().decode(e)}s(Zi,"bytesToUtf8");function J(e){return typeof e=="string"&&(e=_t(e)),N(e),e}s(J,"toBytes");function Gi(e){return typeof e=="string"&&(e=_t(e)),N(e),e}s(Gi,"kdfInputToBytes");function tr(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];N(n),t+=n.length}let i=new Uint8Array(t);for(let r=0,n=0;r<e.length;r++){let a=e[r];i.set(a,n),n+=a.length}return i}s(tr,"concatBytes");function er(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(e,t)}s(er,"checkOpts");var ir=class{static{s(this,"Hash")}};h.Hash=ir;function Oe(e){let t=s(r=>e().update(J(r)).digest(),"hashC"),i=e();return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=()=>e(),t}s(Oe,"createHasher");function De(e){let t=s((r,n)=>e(n).update(J(r)).digest(),"hashC"),i=e({});return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=r=>e(r),t}s(De,"createOptHasher");function Be(e){let t=s((r,n)=>e(n).update(J(r)).digest(),"hashC"),i=e({});return t.outputLen=i.outputLen,t.blockLen=i.blockLen,t.create=r=>e(r),t}s(Be,"createXOFer");h.wrapConstructor=Oe;h.wrapConstructorWithOpts=De;h.wrapXOFConstructorWithOpts=Be;function rr(e=32){if(U.crypto&&typeof U.crypto.getRandomValues=="function")return U.crypto.getRandomValues(new Uint8Array(e));if(U.crypto&&typeof U.crypto.randomBytes=="function")return Uint8Array.from(U.crypto.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}s(rr,"randomBytes")});var je=E(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.shake256=p.shake128=p.keccak_512=p.keccak_384=p.keccak_256=p.keccak_224=p.sha3_512=p.sha3_384=p.sha3_256=p.sha3_224=p.Keccak=void 0;p.keccakP=Ce;var M=Se(),w=Re(),sr=BigInt(0),C=BigInt(1),nr=BigInt(2),or=BigInt(7),ar=BigInt(256),lr=BigInt(113),He=[],Ue=[],Ne=[];for(let e=0,t=C,i=1,r=0;e<24;e++){[i,r]=[r,(2*i+3*r)%5],He.push(2*(5*r+i)),Ue.push((e+1)*(e+2)/2%64);let n=sr;for(let a=0;a<7;a++)t=(t<<C^(t>>or)*lr)%ar,t&nr&&(n^=C<<(C<<BigInt(a))-C);Ne.push(n)}var ve=(0,M.split)(Ne,!0),hr=ve[0],cr=ve[1],Ie=s((e,t,i)=>i>32?(0,M.rotlBH)(e,t,i):(0,M.rotlSH)(e,t,i),"rotlH"),Pe=s((e,t,i)=>i>32?(0,M.rotlBL)(e,t,i):(0,M.rotlSL)(e,t,i),"rotlL");function Ce(e,t=24){let i=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let o=0;o<10;o++)i[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){let l=(o+8)%10,u=(o+2)%10,y=i[u],d=i[u+1],T=Ie(y,d,1)^i[l],_=Pe(y,d,1)^i[l+1];for(let S=0;S<50;S+=10)e[o+S]^=T,e[o+S+1]^=_}let n=e[2],a=e[3];for(let o=0;o<24;o++){let l=Ue[o],u=Ie(n,a,l),y=Pe(n,a,l),d=He[o];n=e[d],a=e[d+1],e[d]=u,e[d+1]=y}for(let o=0;o<50;o+=10){for(let l=0;l<10;l++)i[l]=e[o+l];for(let l=0;l<10;l++)e[o+l]^=~i[(l+2)%10]&i[(l+4)%10]}e[0]^=hr[r],e[1]^=cr[r]}(0,w.clean)(i)}s(Ce,"keccakP");var bt=class Me extends w.Hash{static{s(this,"Keccak")}constructor(t,i,r,n=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=i,this.outputLen=r,this.enableXOF=n,this.rounds=a,(0,w.anumber)(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,w.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,w.swap32IfBE)(this.state32),Ce(this.state32,this.rounds),(0,w.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(t){(0,w.aexists)(this),t=(0,w.toBytes)(t),(0,w.abytes)(t);let{blockLen:i,state:r}=this,n=t.length;for(let a=0;a<n;){let o=Math.min(i-this.pos,n-a);for(let l=0;l<o;l++)r[this.pos++]^=t[a++];this.pos===i&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:i,pos:r,blockLen:n}=this;t[r]^=i,(i&128)!==0&&r===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){(0,w.aexists)(this,!1),(0,w.abytes)(t),this.finish();let i=this.state,{blockLen:r}=this;for(let n=0,a=t.length;n<a;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,a-n);t.set(i.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,w.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,w.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,w.clean)(this.state)}_cloneInto(t){let{blockLen:i,suffix:r,outputLen:n,rounds:a,enableXOF:o}=this;return t||(t=new Me(i,r,n,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=n,t.enableXOF=o,t.destroyed=this.destroyed,t}};p.Keccak=bt;var D=s((e,t,i)=>(0,w.createHasher)(()=>new bt(t,e,i)),"gen");p.sha3_224=D(6,144,224/8);p.sha3_256=D(6,136,256/8);p.sha3_384=D(6,104,384/8);p.sha3_512=D(6,72,512/8);p.keccak_224=D(1,144,224/8);p.keccak_256=D(1,136,256/8);p.keccak_384=D(1,104,384/8);p.keccak_512=D(1,72,512/8);var ze=s((e,t,i)=>(0,w.createXOFer)((r={})=>new bt(t,e,r.dkLen===void 0?i:r.dkLen,!0)),"genShake");p.shake128=ze(31,168,128/8);p.shake256=ze(31,136,256/8)});var Ke=E((Fs,B)=>{"use strict";var{sha3_512:ur}=je(),Ve=24,z=32,wt=s((e=4,t=Math.random)=>{let i="";for(;i.length<e;)i=i+Math.floor(t()*36).toString(36);return i},"createEntropy");function qe(e){let t=8n,i=0n;for(let r of e.values()){let n=BigInt(r);i=(i<<t)+n}return i}s(qe,"bufToBigInt");var We=s((e="")=>qe(ur(e)).toString(36).slice(1),"hash"),$e=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),fr=s(e=>$e[Math.floor(e()*$e.length)],"randomLetter"),Ye=s(({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let i=Object.keys(e).toString(),r=i.length?i+wt(z,t):wt(z,t);return We(r).substring(0,z)},"createFingerprint"),Xe=s(e=>()=>e++,"createCounter"),dr=476782367,Je=s(({random:e=Math.random,counter:t=Xe(Math.floor(e()*dr)),length:i=Ve,fingerprint:r=Ye({random:e})}={})=>s(function(){let a=fr(e),o=Date.now().toString(36),l=t().toString(36),u=wt(i,e),y=`${o+u+l+r}`;return`${a+We(y).substring(1,i)}`},"cuid2"),"init"),pr=Je(),mr=s((e,{minLength:t=2,maxLength:i=z}={})=>{let r=e.length,n=/^[0-9a-z]+$/;try{if(typeof e=="string"&&r>=t&&r<=i&&n.test(e))return!0}finally{}return!1},"isCuid");B.exports.getConstants=()=>({defaultLength:Ve,bigLength:z});B.exports.init=Je;B.exports.createId=pr;B.exports.bufToBigInt=qe;B.exports.createCounter=Xe;B.exports.createFingerprint=Ye;B.exports.isCuid=mr});var Qe=E((ks,j)=>{"use strict";var{createId:gr,init:yr,getConstants:_r,isCuid:br}=Ke();j.exports.createId=gr;j.exports.init=yr;j.exports.getConstants=_r;j.exports.isCuid=br});var xt=E((Ls,Ge)=>{"use strict";Ge.exports=Ze;function Ze(e,t){if(e&&t)return Ze(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(r){i[r]=e[r]}),i;function i(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];var a=e.apply(this,r),o=r[r.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(l){a[l]=o[l]}),a}s(i,"wrapper")}s(Ze,"wrappy")});var si=E((Ds,ri)=>{"use strict";var K,wr=typeof setImmediate=="function";ri.exports=ei;function ei(e){F.length||(ii(),Et=!0),F[F.length]=e}s(ei,"rawAsap");var F=[],Et=!1,A=0,xr=1024;function ti(){for(;A<F.length;){var e=A;if(A=A+1,F[e].call(),A>xr){for(var t=0,i=F.length-A;t<i;t++)F[t]=F[t+A];F.length-=A,A=0}}F.length=0,A=0,Et=!1}s(ti,"flush");ei.requestFlush=ii;function ii(){var e=process.domain;e&&(K||(K=te("domain")),K.active=process.domain=null),Et&&wr?setImmediate(ti):process.nextTick(ti),e&&(K.active=process.domain=e)}s(ii,"requestFlush")});var li=E((Rs,ai)=>{"use strict";var ni=si(),St=[];ai.exports=Er;function Er(e){var t;St.length?t=St.pop():t=new oi,t.task=e,t.domain=process.domain,ni(t)}s(Er,"asap");function oi(){this.task=null,this.domain=null}s(oi,"RawTask");oi.prototype.call=function(){this.domain&&this.domain.enter();var e=!0;try{this.task.call(),e=!1,this.domain&&this.domain.exit()}finally{e&&ni.requestFlush(),this.task=null,this.domain=null,St.push(this)}}});var ui=E((Ps,ci)=>{"use strict";var Sr=xt();ci.exports=Sr(Ar);var hi=li();function Ar(e){var t=!0;return hi(function(){t=!1}),s(function(){var r=arguments,n=this;t?hi(function(){e.apply(n,r)}):e.apply(n,r)},"zalgoSafe")}s(Ar,"dezalgo")});var pi=E((Us,At)=>{"use strict";var fi=xt();At.exports=fi(Q);At.exports.strict=fi(di);Q.proto=Q(function(){Object.defineProperty(Function.prototype,"once",{value:s(function(){return Q(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:s(function(){return di(this)},"value"),configurable:!0})});function Q(e){var t=s(function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))},"f");return t.called=!1,t}s(Q,"once");function di(e){var t=s(function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},"f"),i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}s(di,"onceStrict")});var $={};Di($,{aborted:()=>kt,biggerThanMaxFileSize:()=>zt,biggerThanTotalMaxFileSize:()=>Pt,cannotCreateDir:()=>$t,default:()=>m,filenameNotString:()=>Dt,malformedMultipart:()=>Nt,maxFieldsExceeded:()=>Rt,maxFieldsSizeExceeded:()=>Bt,maxFilesExceeded:()=>Mt,missingContentType:()=>Ut,missingMultipartBoundary:()=>vt,missingPlugin:()=>Ft,noEmptyFiles:()=>Ht,noParser:()=>Lt,pluginFailed:()=>jt,pluginFunction:()=>Tt,smallerThanMinFileSize:()=>It,uninitializedParser:()=>Ot,unknownTransferEncoding:()=>Ct});var Ft,Tt,kt,Lt,Ot,Dt,Bt,Rt,It,Pt,Ht,Ut,Nt,vt,Ct,Mt,zt,jt,$t,Fr,m,I=b(()=>{"use strict";Ft=1e3,Tt=1001,kt=1002,Lt=1003,Ot=1004,Dt=1005,Bt=1006,Rt=1007,It=1008,Pt=1009,Ht=1010,Ut=1011,Nt=1012,vt=1013,Ct=1014,Mt=1015,zt=1016,jt=1017,$t=1018,Fr=class extends Error{static{s(this,"FormidableError")}constructor(e,t,i=500){super(e),this.code=t,this.httpCode=i}},m=Fr});import{Transform as Tr}from"stream";var kr,Z,Vt=b(()=>{"use strict";kr=class extends Tr{static{s(this,"DummyParser")}constructor(t,i={}){super(),this.globalOptions={...i},this.incomingForm=t}_flush(t){this.incomingForm.ended=!0,this.incomingForm._maybeEnd(),t()}},Z=kr});import{Transform as Lr}from"stream";function Ir(e){return e|32}var x,f,mi,R,G,tt,Or,V,Dr,Br,Rr,gi,yi,q,et=b(()=>{"use strict";I();I();x=0,f={PARSER_UNINITIALIZED:x++,START:x++,START_BOUNDARY:x++,HEADER_FIELD_START:x++,HEADER_FIELD:x++,HEADER_VALUE_START:x++,HEADER_VALUE:x++,HEADER_VALUE_ALMOST_DONE:x++,HEADERS_ALMOST_DONE:x++,PART_DATA_START:x++,PART_DATA:x++,PART_END:x++,END:x++},mi=1,R={PART_BOUNDARY:mi,LAST_BOUNDARY:mi*=2},G=10,tt=13,Or=32,V=45,Dr=58,Br=97,Rr=122;s(Ir,"lower");gi={};Object.keys(f).forEach(e=>{gi[e]=f[e]});yi=class _i extends Lr{static{s(this,"MultipartParser")}constructor(t={}){super({readableObjectMode:!0}),this.boundary=null,this.boundaryChars=null,this.lookbehind=null,this.bufferLength=0,this.state=f.PARSER_UNINITIALIZED,this.globalOptions={...t},this.index=null,this.flags=0}_endUnexpected(){return new m(`MultipartParser.end(): stream ended unexpectedly: ${this.explain()}`,1012,400)}_flush(t){this.state===f.HEADER_FIELD_START&&this.index===0||this.state===f.PART_DATA&&this.index===this.boundary.length?(this._handleCallback("partEnd"),this._handleCallback("end"),t()):this.state!==f.END?t(this._endUnexpected()):t()}initWithBoundary(t){this.boundary=Buffer.from(`\r
2
3
  --${t}`),this.lookbehind=Buffer.alloc(this.boundary.length+8),this.state=f.START,this.boundaryChars={};for(let i=0;i<this.boundary.length;i++)this.boundaryChars[this.boundary[i]]=!0}_handleCallback(t,i,r,n){r!==void 0&&r===n||this.push({name:t,buffer:i,start:r,end:n})}_transform(t,i,r){let n=0,a=this.index,{index:o,state:l,flags:u}=this,{lookbehind:y,boundary:d,boundaryChars:T}=this,_=d.length,S=_-1;this.bufferLength=t.length;let g=null,at=null,v=s((k,W)=>{this[`${k}Mark`]=typeof W=="number"?W:n},"setMark"),Gt=s(k=>{delete this[`${k}Mark`]},"clearMarkSymbol"),H=s((k,W)=>{let lt=`${k}Mark`;lt in this&&(W?(this._handleCallback(k,t,this[lt],n),Gt(k)):(this._handleCallback(k,t,this[lt],t.length),v(k,0)))},"dataCallback");for(n=0;n<this.bufferLength;n++)switch(g=t[n],l){case f.PARSER_UNINITIALIZED:r(this._endUnexpected());return;case f.START:o=0,l=f.START_BOUNDARY;case f.START_BOUNDARY:if(o===d.length-2){if(g===V)u|=R.LAST_BOUNDARY;else if(g!==tt){r(this._endUnexpected());return}o++;break}else if(o-1===d.length-2){if(u&R.LAST_BOUNDARY&&g===V)this._handleCallback("end"),l=f.END,u=0;else if(!(u&R.LAST_BOUNDARY)&&g===G)o=0,this._handleCallback("partBegin"),l=f.HEADER_FIELD_START;else{r(this._endUnexpected());return}break}g!==d[o+2]&&(o=-2),g===d[o+2]&&o++;break;case f.HEADER_FIELD_START:l=f.HEADER_FIELD,v("headerField"),o=0;case f.HEADER_FIELD:if(g===tt){Gt("headerField"),l=f.HEADERS_ALMOST_DONE;break}if(o++,g===V)break;if(g===Dr){if(o===1){r(this._endUnexpected());return}H("headerField",!0),l=f.HEADER_VALUE_START;break}if(at=Ir(g),at<Br||at>Rr){r(this._endUnexpected());return}break;case f.HEADER_VALUE_START:if(g===Or)break;v("headerValue"),l=f.HEADER_VALUE;case f.HEADER_VALUE:g===tt&&(H("headerValue",!0),this._handleCallback("headerEnd"),l=f.HEADER_VALUE_ALMOST_DONE);break;case f.HEADER_VALUE_ALMOST_DONE:if(g!==G){r(this._endUnexpected());return}l=f.HEADER_FIELD_START;break;case f.HEADERS_ALMOST_DONE:if(g!==G){r(this._endUnexpected());return}this._handleCallback("headersEnd"),l=f.PART_DATA_START;break;case f.PART_DATA_START:l=f.PART_DATA,v("partData");case f.PART_DATA:if(a=o,o===0){for(n+=S;n<this.bufferLength&&!(t[n]in T);)n+=_;n-=S,g=t[n]}if(o<d.length)d[o]===g?(o===0&&H("partData",!0),o++):o=0;else if(o===d.length)o++,g===tt?u|=R.PART_BOUNDARY:g===V?u|=R.LAST_BOUNDARY:o=0;else if(o-1===d.length)if(u&R.PART_BOUNDARY){if(o=0,g===G){u&=~R.PART_BOUNDARY,this._handleCallback("partEnd"),this._handleCallback("partBegin"),l=f.HEADER_FIELD_START;break}}else u&R.LAST_BOUNDARY&&g===V?(this._handleCallback("partEnd"),this._handleCallback("end"),l=f.END,u=0):o=0;o>0?y[o-1]=g:a>0&&(this._handleCallback("partData",y,0,a),a=0,v("partData"),n--);break;case f.END:break;default:r(this._endUnexpected());return}return H("headerField"),H("headerValue"),H("partData"),this.index=o,this.state=l,this.flags=u,r(),this.bufferLength}explain(){return`state = ${_i.stateToString(this.state)}`}};yi.stateToString=e=>{for(let t in f)if(f[t]===e)return t};q=Object.assign(yi,{STATES:gi})});import{PassThrough as Pr}from"stream";var Hr,qt,Wt=b(()=>{"use strict";Hr=class extends Pr{static{s(this,"OctetStreamParser")}constructor(t={}){super(),this.globalOptions={...t}}},qt=Hr});async function it(e,t){let i=this||e;return/octet-stream/i.test(i.headers["content-type"])&&await Nr.call(i,i,t),i}async function Nr(e,t){this.type=Ur;let i=this.headers["x-file-name"],r=this.headers["content-type"],n={originalFilename:i,mimetype:r},a=this._getNewName(n),o=this._joinDirectoryName(a),l=await this._newFile({newFilename:a,filepath:o,originalFilename:i,mimetype:r});this.emit("fileBegin",i,l),l.open(),this.openedFiles.push(l),this._flushing+=1,this._parser=new qt(this.options);let u=0;return this._parser.on("data",y=>{this.pause(),u+=1,l.write(y,()=>{u-=1,this.resume(),this.ended&&this._parser.emit("doneWritingFile")})}),this._parser.on("end",()=>{this._flushing-=1,this.ended=!0;let y=s(()=>{l.end(()=>{this.emit("file","file",l),this._maybeEnd()})},"done");u===0?y():this._parser.once("doneWritingFile",y)}),this}var Ur,bi=b(()=>{"use strict";Wt();Ur="octet-stream";s(it,"plugin");s(Nr,"init")});import{Transform as vr}from"stream";var Cr,Yt,Xt=b(()=>{"use strict";Cr=class extends vr{static{s(this,"QuerystringParser")}constructor(t={}){super({readableObjectMode:!0}),this.globalOptions={...t},this.buffer="",this.bufferLength=0}_transform(t,i,r){this.buffer+=t.toString("ascii"),this.bufferLength=this.buffer.length,r()}_flush(t){let i=new URLSearchParams(this.buffer);for(let[r,n]of i)this.push({key:r,value:n});this.buffer="",t()}},Yt=Cr});function rt(e,t){let i=this||e;return/urlencoded/i.test(i.headers["content-type"])&&zr.call(i,i,t),i}function zr(e,t){this.type=Mr;let i=new Yt(this.options);return i.on("data",({key:r,value:n})=>{this.emit("field",r,n)}),i.once("end",()=>{this.ended=!0,this._maybeEnd()}),this._parser=i,this}var Mr,wi=b(()=>{"use strict";Xt();Mr="urlencoded";s(rt,"plugin");s(zr,"init")});import{Stream as jr}from"stream";function st(e,t){let i=this||e;if(/multipart/i.test(i.headers["content-type"])){let n=i.headers["content-type"].match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(n)Vr(n[1]||n[2]).call(i,i,t);else{let a=new m("bad content-type header, no multipart boundary",1013,400);i._error(a)}}return i}function Vr(e){return s(function(){this.type=$r;let i=new q(this.options),r,n,a;i.initWithBoundary(e),i.on("data",async({name:o,buffer:l,start:u,end:y})=>{if(o==="partBegin")a=new jr,a.readable=!0,a.headers={},a.name=null,a.originalFilename=null,a.mimetype=null,a.transferEncoding=this.options.encoding,a.transferBuffer="",r="",n="";else if(o==="headerField")r+=l.toString(this.options.encoding,u,y);else if(o==="headerValue")n+=l.toString(this.options.encoding,u,y);else if(o==="headerEnd"){r=r.toLowerCase(),a.headers[r]=n;let d=n.match(/\bname=("([^"]*)"|([^\(\)<>@,;:\\"\/\[\]\?=\{\}\s\t/]+))/i);r==="content-disposition"?(d&&(a.name=d[2]||d[3]||""),a.originalFilename=this._getFileName(n)):r==="content-type"?a.mimetype=n:r==="content-transfer-encoding"&&(a.transferEncoding=n.toLowerCase()),r="",n=""}else if(o==="headersEnd"){switch(a.transferEncoding){case"binary":case"7bit":case"8bit":case"utf-8":{let d=s(_=>{_.name==="partData"&&a.emit("data",_.buffer.slice(_.start,_.end))},"dataPropagation"),T=s(_=>{_.name==="partEnd"&&(a.emit("end"),i.off("data",d),i.off("data",T))},"dataStopPropagation");i.on("data",d),i.on("data",T);break}case"base64":{let d=s(_=>{if(_.name==="partData"){a.transferBuffer+=_.buffer.slice(_.start,_.end).toString("ascii");let S=parseInt(a.transferBuffer.length/4,10)*4;a.emit("data",Buffer.from(a.transferBuffer.substring(0,S),"base64")),a.transferBuffer=a.transferBuffer.substring(S)}},"dataPropagation"),T=s(_=>{_.name==="partEnd"&&(a.emit("data",Buffer.from(a.transferBuffer,"base64")),a.emit("end"),i.off("data",d),i.off("data",T))},"dataStopPropagation");i.on("data",d),i.on("data",T);break}default:return this._error(new m("unknown transfer-encoding",1014,501))}this._parser.pause(),await this.onPart(a),this._parser.resume()}else o==="end"&&(this.ended=!0,this._maybeEnd())}),this._parser=i},"initMultipart")}var $r,xi=b(()=>{"use strict";et();I();I();$r="multipart";s(st,"plugin");s(Vr,"createInitMultipart")});import{Transform as qr}from"stream";var Wr,Jt,Kt=b(()=>{"use strict";Wr=class extends qr{static{s(this,"JSONParser")}constructor(t={}){super({readableObjectMode:!0}),this.chunks=[],this.globalOptions={...t}}_transform(t,i,r){this.chunks.push(String(t)),r()}_flush(t){try{let i=JSON.parse(this.chunks.join(""));this.push(i)}catch(i){t(i);return}this.chunks=null,t()}},Jt=Wr});function nt(e,t){let i=this||e;return/json/i.test(i.headers["content-type"])&&Xr.call(i,i,t),i}function Xr(e,t){this.type=Yr;let i=new Jt(this.options);i.on("data",r=>{this.fields=r}),i.once("end",()=>{this.ended=!0,this._maybeEnd()}),this._parser=i}var Yr,Ei=b(()=>{"use strict";Kt();Yr="json";s(nt,"plugin");s(Xr,"init")});var Qt=b(()=>{"use strict";bi();wi();xi();Ei()});import{EventEmitter as Jr}from"events";import Kr from"fs/promises";import ot from"os";import P from"path";import{StringDecoder as Qr}from"string_decoder";function Si(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Ai,Fi,Ti,Zr,Gr,Zt,ts,es,is,rs,ki,Li=b(()=>{"use strict";Ai=ht(Qe(),1),Fi=ht(ui(),1),Ti=ht(pi(),1);I();ut();dt();Vt();et();Qt();Zr=`${process.env.NODE_ENV}-${ot.platform()}-${ot.hostname()}`,Gr=(0,Ai.init)({length:25,fingerprint:Zr.toLowerCase()}),Zt={maxFields:1e3,maxFieldsSize:20*1024*1024,maxFiles:1/0,maxFileSize:200*1024*1024,maxTotalFileSize:void 0,minFileSize:1,allowEmptyFiles:!1,createDirsFromUploads:!1,keepExtensions:!1,encoding:"utf-8",hashAlgorithm:!1,uploadDir:ot.tmpdir(),enabledPlugins:[it,rt,st,nt],fileWriteStreamHandler:null,defaultInvalidName:"invalid-name",filter(e){return!0},filename:void 0};s(Si,"hasOwnProp");ts=s(function(e){let t=Promise.resolve();return async function(...i){let r=t,n,a;return t=new Promise(function(o){a=o}),await r,n=e(...i),n.then(a).catch(a),n}},"decorateForceSequential"),es=ts(function(e){let t=P.dirname(e);return Kr.mkdir(t,{recursive:!0})}),is=s(e=>{let t=e.charCodeAt(0);return!(t===46||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122)},"invalidExtensionChar"),rs=class extends Jr{static{s(this,"IncomingForm")}constructor(t={}){super(),this.options={...Zt,...t},this.options.maxTotalFileSize||(this.options.maxTotalFileSize=this.options.maxFileSize);let i=P.resolve(this.options.uploadDir||this.options.uploaddir||ot.tmpdir());if(this.uploaddir=i,this.uploadDir=i,["error","headers","type","bytesExpected","bytesReceived","_parser","req"].forEach(r=>{this[r]=null}),this._setUpRename(),this._flushing=0,this._fieldsSize=0,this._totalFileSize=0,this._plugins=[],this.openedFiles=[],this.options.enabledPlugins=[].concat(this.options.enabledPlugins).filter(Boolean),this.options.enabledPlugins.length===0)throw new m("expect at least 1 enabled builtin plugin, see options.enabledPlugins",1e3);this.options.enabledPlugins.forEach(r=>{this.use(r)}),this._setUpMaxFields(),this._setUpMaxFiles(),this.ended=void 0,this.type=void 0}use(t){if(typeof t!="function")throw new m(".use: expect `plugin` to be a function",1001);return this._plugins.push(t.bind(this)),this}pause(){try{this.req.pause()}catch(t){return this.ended||this._error(t),!1}return!0}resume(){try{this.req.resume()}catch(t){return this.ended||this._error(t),!1}return!0}async parse(t,i){this.req=t;let r;if(!i){let o,l;r=new Promise((u,y)=>{o=u,l=y}),i=s((u,y,d)=>{u?l(u):o([y,d])},"cb")}let n=(0,Ti.default)((0,Fi.default)(i));this.fields={};let a={};return this.on("field",(o,l)=>{this.type==="multipart"||this.type==="urlencoded"?Si(this.fields,o)?this.fields[o].push(l):this.fields[o]=[l]:this.fields[o]=l}),this.on("file",(o,l)=>{Si(a,o)?a[o].push(l):a[o]=[l]}),this.on("error",o=>{n(o,this.fields,a)}),this.on("end",()=>{n(null,this.fields,a)}),await this.writeHeaders(t.headers),t.on("error",o=>{this._error(o)}).on("aborted",()=>{this.emit("aborted"),this._error(new m("Request aborted",1002))}).on("data",o=>{try{this.write(o)}catch(l){this._error(l)}}).on("end",()=>{this.error||this._parser&&this._parser.end()}),r||this}async writeHeaders(t){if(this.headers=t,this._parseContentLength(),await this._parseContentType(),!this._parser){this._error(new m("no parser found",1003,415));return}this._parser.once("error",i=>{this._error(i)})}write(t){return this.error?null:this._parser?(this.bytesReceived+=t.length,this.emit("progress",this.bytesReceived,this.bytesExpected),this._parser.write(t),this.bytesReceived):(this._error(new m("uninitialized parser",1004)),null)}onPart(t){return this._handlePart(t)}async _handlePart(t){if(t.originalFilename&&typeof t.originalFilename!="string"){this._error(new m("the part.originalFilename should be string when it exists",1005));return}if(!t.mimetype){let o="",l=new Qr(t.transferEncoding||this.options.encoding);t.on("data",u=>{if(this._fieldsSize+=u.length,this._fieldsSize>this.options.maxFieldsSize){this._error(new m(`options.maxFieldsSize (${this.options.maxFieldsSize} bytes) exceeded, received ${this._fieldsSize} bytes of field data`,1006,413));return}o+=l.write(u)}),t.on("end",()=>{this.emit("field",t.name,o)});return}if(!this.options.filter(t))return;this._flushing+=1;let i=0,r=this._getNewName(t),n=this._joinDirectoryName(r),a=await this._newFile({newFilename:r,filepath:n,originalFilename:t.originalFilename,mimetype:t.mimetype});a.on("error",o=>{this._error(o)}),this.emit("fileBegin",t.name,a),a.open(),this.openedFiles.push(a),t.on("data",o=>{if(this._totalFileSize+=o.length,i+=o.length,this._totalFileSize>this.options.maxTotalFileSize){this._error(new m(`options.maxTotalFileSize (${this.options.maxTotalFileSize} bytes) exceeded, received ${this._totalFileSize} bytes of file data`,1009,413));return}o.length!==0&&(this.pause(),a.write(o,()=>{this.resume()}))}),t.on("end",()=>{if(!this.options.allowEmptyFiles&&i===0){this._error(new m("options.allowEmptyFiles is false, file size should be greater than 0",1010,400));return}if(i<this.options.minFileSize){this._error(new m(`options.minFileSize (${this.options.minFileSize} bytes) inferior, received ${i} bytes of file data`,1008,400));return}if(i>this.options.maxFileSize){this._error(new m(`options.maxFileSize (${this.options.maxFileSize} bytes), received ${i} bytes of file data`,1016,413));return}a.end(()=>{this._flushing-=1,this.emit("file",t.name,a),this._maybeEnd()})})}async _parseContentType(){if(this.bytesExpected===0){this._parser=new Z(this,this.options);return}if(!this.headers["content-type"]){this._error(new m("bad content-type header, no content-type",1011,400));return}new Z(this,this.options);let t=[];await Promise.all(this._plugins.map(async(i,r)=>{let n=null;try{n=await i(this,this.options)||this}catch(a){let o=new m(`plugin on index ${r} failed with: ${a.message}`,1017,500);throw o.idx=r,o}Object.assign(this,n),this.emit("plugin",r,n)})),this.emit("pluginsResults",t)}_error(t,i="error"){this.error||this.ended||(this.req=null,this.error=t,this.emit(i,t),this.openedFiles.forEach(r=>{r.destroy()}))}_parseContentLength(){this.bytesReceived=0,this.headers["content-length"]?this.bytesExpected=parseInt(this.headers["content-length"],10):this.headers["transfer-encoding"]===void 0&&(this.bytesExpected=0),this.bytesExpected!==null&&this.emit("progress",this.bytesReceived,this.bytesExpected)}_newParser(){return new q(this.options)}async _newFile({filepath:t,originalFilename:i,mimetype:r,newFilename:n}){if(this.options.fileWriteStreamHandler)return new ft({newFilename:n,filepath:t,originalFilename:i,mimetype:r,createFileWriteStream:this.options.fileWriteStreamHandler,hashAlgorithm:this.options.hashAlgorithm});if(this.options.createDirsFromUploads)try{await es(t)}catch{this._error(new m("cannot create directory",1018,409))}return new ct({newFilename:n,filepath:t,originalFilename:i,mimetype:r,hashAlgorithm:this.options.hashAlgorithm})}_getFileName(t){let i=t.match(/\bfilename=("(.*?)"|([^()<>{}[\]@,;:"?=\s/\t]+))($|;\s)/i);if(!i)return null;let r=i[2]||i[3]||"",n=r.substr(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#([\d]{4});/g,(a,o)=>String.fromCharCode(o)),n}_getExtension(t){if(!t)return"";let i=P.basename(t),r=i.indexOf("."),n=i.lastIndexOf("."),a=P.extname(i);r!==n&&(a=i.slice(r));let o,l=Array.from(a).findIndex(is);return l===-1?o=a:o=a.substring(0,l),o==="."?"":o}_joinDirectoryName(t){let i=P.join(this.uploadDir,t);return i.startsWith(this.uploadDir)?i:P.join(this.uploadDir,this.options.defaultInvalidName)}_setUpRename(){typeof this.options.filename=="function"?this._getNewName=i=>{let r="",n=this.options.defaultInvalidName;return i.originalFilename&&({ext:r,name:n}=P.parse(i.originalFilename),this.options.keepExtensions!==!0&&(r="")),this.options.filename.call(this,n,r,i,this)}:this._getNewName=i=>{let r=Gr();if(i&&this.options.keepExtensions){let n=typeof i=="string"?i:i.originalFilename;return`${r}${this._getExtension(n)}`}return r}}_setUpMaxFields(){if(this.options.maxFields!==1/0){let t=0;this.on("field",()=>{t+=1,t>this.options.maxFields&&this._error(new m(`options.maxFields (${this.options.maxFields}) exceeded`,1007,413))})}}_setUpMaxFiles(){if(this.options.maxFiles!==1/0){let t=0;this.on("fileBegin",()=>{t+=1,t>this.options.maxFiles&&this._error(new m(`options.maxFiles (${this.options.maxFiles}) exceeded`,1015,413))})}}_maybeEnd(){!this.ended||this._flushing||this.error||(this.req=null,this.emit("end"))}},ki=rs});var Oi=b(()=>{"use strict";Kt();Vt();et();Wt();Xt()});var ss,Xn,Jn,ns=b(()=>{ut();dt();Li();Oi();Qt();I();ss=s((...e)=>new ki(...e),"formidable"),{enabledPlugins:Xn}=Zt,Jn=ss});ns();export{Z as DummyParser,ct as File,ki as Formidable,ki as IncomingForm,Jt as JSONParser,q as MultipartParser,qt as OctetStreamParser,qt as OctetstreamParser,ct as PersistentFile,Yt as QueryStringParser,Yt as QuerystringParser,ft as VolatileFile,Jn as default,Zt as defaultOptions,Xn as enabledPlugins,$ as errors,ss as formidable,nt as json,st as multipart,it as octetstream,rt as querystring};
3
4
  /*! Bundled license information:
4
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nfets",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "typescript libraries for Brazilian's SEFAZ standards",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
File without changes